From af57ba0beeec0154ad61684c18a2ad1439852d91 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 May 2010 15:17:49 +0200 Subject: Add root .gitignore --- .gitignore | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b9998d --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# Compiler/linker output. +# +*.o +*.o.d +*.so +*.a +*.l +*.l.cpp-options + +# Generated documentation. +# +*.pdf +*.ps + +# Generated build system files. +# +*-dynamic.make + +# Generated .gitignore files. +# +.gitignore -- cgit v1.1 From 2cea0dc10d7becabf707f7b6da4c65144397257b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:51:32 +0200 Subject: Build system setup --- build/bootstrap.make | 71 ++++++++++++++++++++++++++++++++++++++ build/configuration-rules.make | 20 +++++++++++ build/configuration.make | 22 ++++++++++++ build/configure | 32 ++++++++++++++++++ build/mysql/configure | 77 ++++++++++++++++++++++++++++++++++++++++++ build/mysql/mysql | 56 ++++++++++++++++++++++++++++++ 6 files changed, 278 insertions(+) create mode 100644 build/bootstrap.make create mode 100644 build/configuration-rules.make create mode 100644 build/configuration.make create mode 100755 build/configure create mode 100755 build/mysql/configure create mode 100755 build/mysql/mysql diff --git a/build/bootstrap.make b/build/bootstrap.make new file mode 100644 index 0000000..12d3425 --- /dev/null +++ b/build/bootstrap.make @@ -0,0 +1,71 @@ +# file : build/bootstrap.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +project_name := odb-tests + +# First try to include the bundled bootstrap.make if it exist. If that +# fails, let make search for the external bootstrap.make. +# +build := build-0.3 + +-include $(dir $(lastword $(MAKEFILE_LIST)))../../$(build)/bootstrap.make + +ifeq ($(patsubst %build/bootstrap.make,,$(lastword $(MAKEFILE_LIST))),) +include $(build)/bootstrap.make +endif + +# Configuration +# +$(call include,$(scf_root)/configuration.make) + +def_goal := $(.DEFAULT_GOAL) + +# Include C++ configuration. We need to know if we are using the generic +# C++ compiler in which case we need to compensate for missing dependency +# auto-generation (see below). +# +$(call include,$(bld_root)/cxx/configuration.make) + +# Aliases +# +.PHONY: $(out_base)/ \ + $(out_base)/.test \ + $(out_base)/.clean + +ifdef %interactive% + +.PHONY: test clean + +test: $(out_base)/.test +clean: $(out_base)/.clean + +endif + +# If we don't have dependency auto-generation then we need to manually +# make sure that ODB files are generated before C++ file are compiler. +# To do this we make the object files ($2) depend in order-only on +# generated files ($3). +# +ifeq ($(cxx_id),generic) + +define include-dep +$(if $2,$(eval $2: | $3)) +endef + +else + +define include-dep +$(call -include,$1) +endef + +endif + +# Don't include dependency info for certain targets. +# +ifneq ($(filter $(MAKECMDGOALS),clean disfigure),) +include-dep = +endif + +.DEFAULT_GOAL := $(def_goal) diff --git a/build/configuration-rules.make b/build/configuration-rules.make new file mode 100644 index 0000000..19e7ef0 --- /dev/null +++ b/build/configuration-rules.make @@ -0,0 +1,20 @@ +# file : build/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. + $(call message,,$(scf_root)/configure $@) + +ifndef %foreign% + +disfigure:: + $(call message,rm $$1,rm -f $$1,$(dcf_root)/configuration-dynamic.make) + $(call message,rm $$1,rm -f $$1,$(dcf_root)/db.options) + $(call message,rm $$1,rm -f $$1,$(dcf_root)/db-driver) + +endif + +ifeq ($(.DEFAULT_GOAL),$(dcf_root)/configuration-dynamic.make) +.DEFAULT_GOAL := +endif diff --git a/build/configuration.make b/build/configuration.make new file mode 100644 index 0000000..fe27430 --- /dev/null +++ b/build/configuration.make @@ -0,0 +1,22 @@ +# file : build/configuration.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) + +# Dynamic configuration. +# +db_id := + +$(call -include,$(dcf_root)/configuration-dynamic.make) + +ifdef db_id + +$(out_root)/%: db_id := $(db_id) + +else + +.NOTPARALLEL: + +endif diff --git a/build/configure b/build/configure new file mode 100755 index 0000000..0bb1e07 --- /dev/null +++ b/build/configure @@ -0,0 +1,32 @@ +#! /usr/bin/env bash + +# file : build/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 +$echo "configuring '$project_name'" +$echo +$echo + +$echo +$echo "Please select the database you would like to use:" +$echo +$echo "(1) MySQL" +$echo + +db_id=`read_option "mysql" "mysql"` + +echo "db_id := $db_id" >$1 + +source $scf_root/$db_id/configure diff --git a/build/mysql/configure b/build/mysql/configure new file mode 100755 index 0000000..e4bae87 --- /dev/null +++ b/build/mysql/configure @@ -0,0 +1,77 @@ +#! /usr/bin/env bash + +# file : build/mysql/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +$echo +$echo "Please enter the MySQL client program path." +$echo + +driver=`read_path --command mysql` + +$echo +$echo "Please enter the MySQL database user." +$echo + +user=`read_value "odb_test"` + +$echo +$echo "Please enter the MySQL database password. Enter NULL for" +$echo "unspecified password as opposed to the empty password." +$echo + +passwd=`read_value "NULL"` + +$echo +$echo "Please enter the MySQL database name. Note that it WILL BE" +$echo "MODIFIED by the tests." +$echo + +db=`read_value "odb_test"` + +$echo +$echo "Please enter the MySQL database host." +$echo + +host=`read_value "localhost"` + +$echo +$echo "Please enter the MySQL database port." +$echo + +port=`read_value "0"` + +$echo +$echo "Please enter the MySQL database socket name. Enter NULL for" +$echo "unspecified name as opposed to the empty name." +$echo + +socket=`read_value "NULL"` + +opt=$dcf_root/db.options +drv=$dcf_root/db-driver + +echo "--user '$user'" >$opt + +if [ "$passwd" != "NULL" ]; then +echo "--passwd '$passwd'" >>$opt +fi + +echo "--db-name '$db'" >>$opt +echo "--host '$host'" >>$opt +echo "--port $port" >>$opt + +if [ "$socket" != "NULL" ]; then +echo "--socket '$socket'" >>$opt +fi + +echo "#!/bin/sh" >$drv +echo "opt=\`cat $opt\`" >>$drv +echo "eval $scf_root/mysql/mysql --driver $driver \$opt \$*" >>$drv +chmod 755 $drv diff --git a/build/mysql/mysql b/build/mysql/mysql new file mode 100755 index 0000000..766e580 --- /dev/null +++ b/build/mysql/mysql @@ -0,0 +1,56 @@ +#! /usr/bin/env bash + +# file : build/mysql/mysql +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# MySQL driver wrapper. +# + +while [ $# -gt 0 ]; do + case $1 in + --driver) + driver=$2 + shift 2 + ;; + --user) + opt="$opt --user=$2" + shift 2 + ;; + --passwd) + opt="$opt --password=$2" + shift 2 + ;; + --db-name) + opt="$opt --database=$2" + shift 2 + ;; + --host) + opt="$opt --host=$2" + shift 2 + ;; + --port) + opt="$opt --port=$2" + shift 2 + ;; + --socket) + opt="$opt --socket=$2" + shift 2 + ;; + *) + break + ;; + esac +done + +if [ -z "$driver" ]; then + driver=mysql +fi + +if [ -n "$1" ]; then + exec $driver $opt <$1 +else + exec $driver $opt +fi -- cgit v1.1 From 71d8f742b321cdcaf9eeb7568bb43fdc7560811c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:52:42 +0200 Subject: Ignore generated database driver and options file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3b9998d..53c48be 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,8 @@ # Generated build system files. # *-dynamic.make +build/db.options +build/db-driver # Generated .gitignore files. # -- cgit v1.1 From 805554d4cdd816cf63928b7869ae14c1858f1aca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:53:12 +0200 Subject: Add license files --- GPLv2 | 340 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 12 +++ 2 files changed, 352 insertions(+) create mode 100644 GPLv2 create mode 100644 LICENSE diff --git a/GPLv2 b/GPLv2 new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/GPLv2 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 more 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +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 -- cgit v1.1 From 68a9e99fc72e54aed2bcf5e4c3531296a2ae189c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:53:23 +0200 Subject: Add version information --- version | 1 + 1 file changed, 1 insertion(+) create mode 100644 version diff --git a/version b/version new file mode 100644 index 0000000..ad6d2a9 --- /dev/null +++ b/version @@ -0,0 +1 @@ +1.0.0.a1 \ No newline at end of file -- cgit v1.1 From bdb7fa4620c9950b16e8292c22424bbf15a25613 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:54:30 +0200 Subject: Add import stubs for cli, odb, libodb, libodb-tracer, and libodb-mysql --- build/import/cli/LICENSE | 21 ++++++++ build/import/cli/cli-cxx.make | 45 +++++++++++++++++ build/import/cli/configuration-rules.make | 15 ++++++ build/import/cli/configure | 55 ++++++++++++++++++++ build/import/cli/stub.make | 30 +++++++++++ build/import/libodb-mysql/LICENSE | 12 +++++ build/import/libodb-mysql/configuration-rules.make | 15 ++++++ build/import/libodb-mysql/configure | 55 ++++++++++++++++++++ build/import/libodb-mysql/stub.make | 30 +++++++++++ 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 +++++++++++ build/import/libodb/LICENSE | 12 +++++ build/import/libodb/configuration-rules.make | 15 ++++++ build/import/libodb/configure | 55 ++++++++++++++++++++ build/import/libodb/stub.make | 30 +++++++++++ build/import/odb/LICENSE | 12 +++++ build/import/odb/configuration-rules.make | 15 ++++++ build/import/odb/configure | 55 ++++++++++++++++++++ build/import/odb/hxx-cxx.make | 58 ++++++++++++++++++++++ build/import/odb/stub.make | 30 +++++++++++ 22 files changed, 672 insertions(+) create mode 100644 build/import/cli/LICENSE create mode 100644 build/import/cli/cli-cxx.make create mode 100644 build/import/cli/configuration-rules.make create mode 100755 build/import/cli/configure create mode 100644 build/import/cli/stub.make create mode 100644 build/import/libodb-mysql/LICENSE create mode 100644 build/import/libodb-mysql/configuration-rules.make create mode 100755 build/import/libodb-mysql/configure create mode 100644 build/import/libodb-mysql/stub.make create mode 100644 build/import/libodb-tracer/LICENSE create mode 100644 build/import/libodb-tracer/configuration-rules.make create mode 100755 build/import/libodb-tracer/configure create mode 100644 build/import/libodb-tracer/stub.make create mode 100644 build/import/libodb/LICENSE create mode 100644 build/import/libodb/configuration-rules.make create mode 100755 build/import/libodb/configure create mode 100644 build/import/libodb/stub.make create mode 100644 build/import/odb/LICENSE create mode 100644 build/import/odb/configuration-rules.make create mode 100755 build/import/odb/configure create mode 100644 build/import/odb/hxx-cxx.make create mode 100644 build/import/odb/stub.make diff --git a/build/import/cli/LICENSE b/build/import/cli/LICENSE new file mode 100644 index 0000000..db16aa3 --- /dev/null +++ b/build/import/cli/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2009-2010 Code Synthesis Tools CC. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/build/import/cli/cli-cxx.make b/build/import/cli/cli-cxx.make new file mode 100644 index 0000000..cb60d37 --- /dev/null +++ b/build/import/cli/cli-cxx.make @@ -0,0 +1,45 @@ +# file : build/import/cli/cli-cxx.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# Here we are operating in the importing project's space, not in +# cli's. +# + +# Get the C++ file extensions. +# +$(call include,$(bld_root)/cxx/configuration-static.make) + +cli_pattern := \ +$(out_base)/%.$(cxx_s_suffix) \ +$(out_base)/%.$(cxx_h_suffix) \ +$(out_base)/%.$(cxx_i_suffix) + +$(cli_pattern): cli_options := \ +--hxx-suffix .$(cxx_h_suffix) \ +--ixx-suffix .$(cxx_i_suffix) \ +--cxx-suffix .$(cxx_s_suffix) + +.PRECIOUS: $(cli_pattern) + +ifeq ($(out_base),$(src_base)) + +$(cli_pattern): $(src_base)/%.cli + $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) + +else + +$(cli_pattern): $(src_base)/%.cli | $$(dir $$@). + $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) + +$(cli_pattern): $(out_base)/%.cli | $$(dir $$@). + $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) +endif + +.PHONY: $(out_base)/%.cxx.cli.clean + +$(out_base)/%.cxx.cli.clean: + $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_s_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_h_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_i_suffix))) diff --git a/build/import/cli/configuration-rules.make b/build/import/cli/configuration-rules.make new file mode 100644 index 0000000..52c334d --- /dev/null +++ b/build/import/cli/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/cli/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +$(dcf_root)/import/cli/configuration-dynamic.make: | $(dcf_root)/import/cli/. + $(call message,,$(scf_root)/import/cli/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/cli/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/cli/configuration-dynamic.make) + +endif diff --git a/build/import/cli/configure b/build/import/cli/configure new file mode 100755 index 0000000..21a09c5 --- /dev/null +++ b/build/import/cli/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/cli/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; 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 'cli' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed " +$echo "version of 'cli' 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 'cli'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'cli'." +$eche + +out_root=`read_path --directory $src_root` + +fi + +echo cli_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/cli/stub.make b/build/import/cli/stub.make new file mode 100644 index 0000000..250a5ee --- /dev/null +++ b/build/import/cli/stub.make @@ -0,0 +1,30 @@ +# file : build/import/cli/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/cli/configuration-rules.make,$(dcf_root)) + +cli_installed := + +$(call -include,$(dcf_root)/import/cli/configuration-dynamic.make) + +ifdef cli_installed + +ifeq ($(cli_installed),y) + +$(call export,cli: cli,cli-rules: $(scf_root)/import/cli/cli-cxx.make) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/cli/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libodb-mysql/LICENSE b/build/import/libodb-mysql/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-mysql/LICENSE @@ -0,0 +1,12 @@ +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-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make new file mode 100644 index 0000000..b57907c --- /dev/null +++ b/build/import/libodb-mysql/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-mysql/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. + $(call message,,$(scf_root)/import/libodb-mysql/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-mysql/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-mysql/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure new file mode 100755 index 0000000..b16cabe --- /dev/null +++ b/build/import/libodb-mysql/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-mysql/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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-mysql' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-mysql' 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-mysql'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-mysql'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_mysql_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-mysql/stub.make b/build/import/libodb-mysql/stub.make new file mode 100644 index 0000000..259f1a1 --- /dev/null +++ b/build/import/libodb-mysql/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-mysql/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) + +libodb_mysql_installed := + +$(call -include,$(dcf_root)/import/libodb-mysql/configuration-dynamic.make) + +ifdef libodb_mysql_installed + +ifeq ($(libodb_mysql_installed),y) + +$(call export,l: -lodb-mysql -lodb -lmysqlclient,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-mysql/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libodb-tracer/LICENSE b/build/import/libodb-tracer/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-tracer/LICENSE @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000..d5d2c21 --- /dev/null +++ b/build/import/libodb-tracer/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-tracer/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 new file mode 100755 index 0000000..d02d7d6 --- /dev/null +++ b/build/import/libodb-tracer/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-tracer/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..a2c1798 --- /dev/null +++ b/build/import/libodb-tracer/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-tracer/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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/build/import/libodb/LICENSE b/build/import/libodb/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb/LICENSE @@ -0,0 +1,12 @@ +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/configuration-rules.make b/build/import/libodb/configuration-rules.make new file mode 100644 index 0000000..2c30e7f --- /dev/null +++ b/build/import/libodb/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. + $(call message,,$(scf_root)/import/libodb/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb/configuration-dynamic.make) + +endif diff --git a/build/import/libodb/configure b/build/import/libodb/configure new file mode 100755 index 0000000..792bb80 --- /dev/null +++ b/build/import/libodb/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed " +$echo "version of 'libodb' 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'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_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/stub.make b/build/import/libodb/stub.make new file mode 100644 index 0000000..9196552 --- /dev/null +++ b/build/import/libodb/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) + +libodb_installed := + +$(call -include,$(dcf_root)/import/libodb/configuration-dynamic.make) + +ifdef libodb_installed + +ifeq ($(libodb_installed),y) + +$(call export,l: -lodb,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/odb/LICENSE b/build/import/odb/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/odb/LICENSE @@ -0,0 +1,12 @@ +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/odb/configuration-rules.make b/build/import/odb/configuration-rules.make new file mode 100644 index 0000000..817f1b1 --- /dev/null +++ b/build/import/odb/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/odb/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. + $(call message,,$(scf_root)/import/odb/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/odb/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/odb/configuration-dynamic.make) + +endif diff --git a/build/import/odb/configure b/build/import/odb/configure new file mode 100755 index 0000000..1ba2f09 --- /dev/null +++ b/build/import/odb/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/odb/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 'odb' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed " +$echo "version of 'odb' 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 'odb'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'odb'." +$eche + +out_root=`read_path --directory $src_root` + +fi + +echo odb_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/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make new file mode 100644 index 0000000..4d16e5a --- /dev/null +++ b/build/import/odb/hxx-cxx.make @@ -0,0 +1,58 @@ +# file : build/import/odb/hxx-cxx.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# Here we are operating in the importing project's space, not in odb's. +# + +# Get the C++ configuration (file extensions, and extra CPP options). +# +$(call include,$(bld_root)/cxx/configuration.make) + +odb_pattern := \ +$(out_base)/%-odb.$(cxx_s_suffix) \ +$(out_base)/%-odb.$(cxx_h_suffix) \ +$(out_base)/%-odb.$(cxx_i_suffix) \ +$(out_base)/%.sql + +$(odb_pattern): odb_options := \ +--hxx-suffix .$(cxx_h_suffix) \ +--ixx-suffix .$(cxx_i_suffix) \ +--cxx-suffix .$(cxx_s_suffix) + +$(odb_pattern): odb-expand-cpp-options-impl = \ +$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) + +$(odb_pattern): odb-expand-cpp-options = \ +$(call odb-expand-cpp-options-impl,$(filter %.cpp-options,$1)) + +.PRECIOUS: $(odb_pattern) + +ifeq ($(out_base),$(src_base)) + +$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) + +else + +$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) | $$(dir $$@). + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) + +$(odb_pattern): $(out_base)/%.$(cxx_h_suffix) | $$(dir $$@). + $(call message,odb $<,$(odb) $(cpp_options) \ +$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +--output-dir $(dir $@) $<) +endif + +.PHONY: $(out_base)/%-odb.cxx.hxx.clean + +$(out_base)/%-odb.cxx.hxx.clean: + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_s_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_h_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_i_suffix))) + $(call message,rm $$1,rm -f $$1,$(@:-odb.cxx.hxx.clean=.sql)) diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make new file mode 100644 index 0000000..48585f0 --- /dev/null +++ b/build/import/odb/stub.make @@ -0,0 +1,30 @@ +# file : build/import/odb/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) + +odb_installed := + +$(call -include,$(dcf_root)/import/odb/configuration-dynamic.make) + +ifdef odb_installed + +ifeq ($(odb_installed),y) + +$(call export,odb: odb,odb-rules: $(scf_root)/import/odb/hxx-cxx.make) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/odb/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif -- cgit v1.1 From ca42db0da0d12b1dcdee1cc82dbbd171131cb628 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 16:57:53 +0200 Subject: Initial set of tests --- common/makefile | 20 ++ common/schema/driver.cxx | 43 +++ common/schema/makefile | 82 +++++ common/schema/test.hxx | 58 +++ common/schema/test.std | 1 + common/template/driver.cxx | 43 +++ common/template/makefile | 82 +++++ common/template/test.hxx | 44 +++ common/template/test.std | 1 + libcommon/common.cxx | 45 +++ libcommon/common.hxx | 16 + libcommon/makefile | 82 +++++ libcommon/options.cli | 58 +++ libcommon/options.cxx | 794 ++++++++++++++++++++++++++++++++++++++++++ libcommon/options.hxx | 396 +++++++++++++++++++++ libcommon/options.ixx | 256 ++++++++++++++ makefile | 32 ++ tracer/makefile | 20 ++ tracer/object/driver.cxx | 78 +++++ tracer/object/makefile | 81 +++++ tracer/object/test.hxx | 44 +++ tracer/object/test.std | 32 ++ tracer/transaction/driver.cxx | 100 ++++++ tracer/transaction/makefile | 65 ++++ tracer/transaction/test.std | 25 ++ 25 files changed, 2498 insertions(+) create mode 100644 common/makefile create mode 100644 common/schema/driver.cxx create mode 100644 common/schema/makefile create mode 100644 common/schema/test.hxx create mode 100644 common/schema/test.std create mode 100644 common/template/driver.cxx create mode 100644 common/template/makefile create mode 100644 common/template/test.hxx create mode 100644 common/template/test.std create mode 100644 libcommon/common.cxx create mode 100644 libcommon/common.hxx create mode 100644 libcommon/makefile create mode 100644 libcommon/options.cli create mode 100644 libcommon/options.cxx create mode 100644 libcommon/options.hxx create mode 100644 libcommon/options.ixx create mode 100644 makefile create mode 100644 tracer/makefile create mode 100644 tracer/object/driver.cxx create mode 100644 tracer/object/makefile create mode 100644 tracer/object/test.hxx create mode 100644 tracer/object/test.std create mode 100644 tracer/transaction/driver.cxx create mode 100644 tracer/transaction/makefile create mode 100644 tracer/transaction/test.std diff --git a/common/makefile b/common/makefile new file mode 100644 index 0000000..b81fd58 --- /dev/null +++ b/common/makefile @@ -0,0 +1,20 @@ +# file : common/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +tests := \ +schema \ +template + +default := $(out_base)/ +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) + +$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx new file mode 100644 index 0000000..4d27e81 --- /dev/null +++ b/common/schema/driver.cxx @@ -0,0 +1,43 @@ +// file : common/schema/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin_transaction ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/schema/makefile b/common/schema/makefile new file mode 100644 index 0000000..29cca5f --- /dev/null +++ b/common/schema/makefile @@ -0,0 +1,82 @@ +# file : common/schema/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/schema/test.hxx b/common/schema/test.hxx new file mode 100644 index 0000000..471d27b --- /dev/null +++ b/common/schema/test.hxx @@ -0,0 +1,58 @@ +// file : common/schema/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +// Table names. +// +#pragma odb object table ("TABLE_EXPLICIT") +struct table_explicit +{ + #pragma odb id + unsigned long id_; +}; + +#pragma odb object +struct table_implicit +{ + #pragma odb id + unsigned long id_; +}; + +// Column names. +// +#pragma odb object +struct column +{ + #pragma odb id + int m1; + + #pragma odb column ("foo") + int m2; + + int m_m3; + int _m4; + int m5_; + int m_; + int m__; +}; + +// Column types. +// +#pragma odb object +struct type +{ + #pragma odb id + int id; + + #pragma odb type ("INTEGER") + bool m1; +}; + +#endif // TEST_HXX diff --git a/common/schema/test.std b/common/schema/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/common/schema/test.std @@ -0,0 +1 @@ +test 001 diff --git a/common/template/driver.cxx b/common/template/driver.cxx new file mode 100644 index 0000000..0361c13 --- /dev/null +++ b/common/template/driver.cxx @@ -0,0 +1,43 @@ +// file : common/template/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin_transaction ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/template/makefile b/common/template/makefile new file mode 100644 index 0000000..c963659 --- /dev/null +++ b/common/template/makefile @@ -0,0 +1,82 @@ +# file : common/template/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/template/test.hxx b/common/template/test.hxx new file mode 100644 index 0000000..48acd44 --- /dev/null +++ b/common/template/test.hxx @@ -0,0 +1,44 @@ +// file : common/template/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma odb object +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma odb id + unsigned long id_; +}; + +#pragma odb object +struct object2 +{ + object2 (const std::string& id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma odb id + std::string id_; +}; + +#endif // TEST_HXX diff --git a/common/template/test.std b/common/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/common/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/libcommon/common.cxx b/libcommon/common.cxx new file mode 100644 index 0000000..bfc3482 --- /dev/null +++ b/libcommon/common.cxx @@ -0,0 +1,45 @@ +// file : libcommon/common.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::exit +#include + +#ifdef DB_ID_MYSQL +# include +#endif + +#include "common.hxx" +#include "options.hxx" + +using namespace std; +using namespace odb; + +auto_ptr +create_database (int argc, char* argv[]) +{ +#ifdef DB_ID_MYSQL + cli::argv_file_scanner scan (argc, argv, "--options-file"); + cli::mysql_options ops (scan); + + if (ops.help ()) + { + cerr << "Usage: " << argv[0] << " [options]" << endl + << "Options:" << endl; + cli::mysql_options::print_usage (cerr); + exit (0); + } + + return auto_ptr ( + new mysql::database ( + ops.user (), + ops.passwd_specified () ? &ops.passwd () : 0, + ops.db_name (), + ops.host (), + ops.port (), + ops.socket_specified () ? &ops.socket () : 0)); +#else + return auto_ptr (0); +#endif +} diff --git a/libcommon/common.hxx b/libcommon/common.hxx new file mode 100644 index 0000000..8e5bd4d --- /dev/null +++ b/libcommon/common.hxx @@ -0,0 +1,16 @@ +// file : libcommon/common.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_HXX +#define LIBCOMMON_COMMON_HXX + +#include // std::auto_ptr + +#include + +std::auto_ptr +create_database (int argc, char* argv[]); + +#endif // LIBCOMMON_COMMON_HXX diff --git a/libcommon/makefile b/libcommon/makefile new file mode 100644 index 0000000..44c789a --- /dev/null +++ b/libcommon/makefile @@ -0,0 +1,82 @@ +# file : libcommon/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +# Options file. +# +cli_tun := options.cli +cxx_tun := common.cxx + +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_base)/common.l +common.l.cpp-options := $(out_base)/common.l.cpp-options + +default := $(out_base)/ +clean := $(out_base)/.clean + +# Import. +# +$(call import,\ + $(scf_root)/import/cli/stub.make,\ + cli: cli,cli-rules: cli_rules) + +$(call import,\ + $(scf_root)/import/libodb/stub.make,\ + l: odb.l,cpp-options: odb.l.cpp-options) + +ifdef db_id +$(call import,\ + $(scf_root)/import/libodb-$(db_id)/stub.make,\ + l: odb_db.l,cpp-options: odb_db.l.cpp-options) +endif + +ifeq ($(odb_db.l.cpp-options),) +odb_db.l.cpp-options := $(out_base)/.unbuildable +endif + +# Build. +# +$(common.l): $(cxx_obj) $(odb.l) $(odb_db.l) + +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) +$(common.l.cpp-options): value := -I$(src_base) +$(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) + +ifeq ($(db_id),mysql) +$(cxx_obj): cpp_options += -DDB_ID_MYSQL +endif + +genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(cli) +$(gen): cli := $(cli) +$(gen): cli_options += \ +--generate-specifier \ +--generate-file-scanner \ +--guard-prefix LIBCOMMON + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Convenience alias for default target. +# +$(out_base)/: $(common.l) + +# Clean. +# +$(clean): $(common.l).o.clean \ + $(common.l.cpp-options).clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) + +# How to. +# +$(call include,$(cli_rules)) +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-l.make) diff --git a/libcommon/options.cli b/libcommon/options.cli new file mode 100644 index 0000000..a16c5b0 --- /dev/null +++ b/libcommon/options.cli @@ -0,0 +1,58 @@ +// file : libcommon/options.cli +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +include ; + +namespace cli +{ + class mysql_options + { + bool --help {"Print usage information and exit."}; + + std::string --user + { + "", + "MySQL database user." + }; + + std::string --passwd + { + "", + "MySQL database password" + }; + + std::string --db-name + { + "", + "MySQL database name." + }; + + std::string --host + { + "", + "MySQL database host name or address (localhost by default)." + }; + + unsigned int --port = 0 + { + "", + "MySQL database port number." + }; + + std::string --socket + { + "", + "MySQL database socket name." + }; + + std::string --options-file + { + "", + "Read additional options from . Each option appearing on a separate + line optionally followed by space and an option value. Empty lines and + lines starting with \cb{#} are ignored." + }; + }; +} diff --git a/libcommon/options.cxx b/libcommon/options.cxx new file mode 100644 index 0000000..2a2280d --- /dev/null +++ b/libcommon/options.cxx @@ -0,0 +1,794 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +#include "options.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cli +{ + // unknown_option + // + unknown_option:: + ~unknown_option () throw () + { + } + + void unknown_option:: + print (std::ostream& os) const + { + os << "unknown option '" << option () << "'"; + } + + const char* unknown_option:: + what () const throw () + { + return "unknown option"; + } + + // unknown_argument + // + unknown_argument:: + ~unknown_argument () throw () + { + } + + void unknown_argument:: + print (std::ostream& os) const + { + os << "unknown argument '" << argument () << "'"; + } + + const char* unknown_argument:: + what () const throw () + { + return "unknown argument"; + } + + // missing_value + // + missing_value:: + ~missing_value () throw () + { + } + + void missing_value:: + print (std::ostream& os) const + { + os << "missing value for option '" << option () << "'"; + } + + const char* missing_value:: + what () const throw () + { + return "missing option value"; + } + + // invalid_value + // + invalid_value:: + ~invalid_value () throw () + { + } + + void invalid_value:: + print (std::ostream& os) const + { + os << "invalid value '" << value () << "' for option '" + << option () << "'"; + } + + const char* invalid_value:: + what () const throw () + { + return "invalid option value"; + } + + // eos_reached + // + void eos_reached:: + print (std::ostream& os) const + { + os << what (); + } + + const char* eos_reached:: + what () const throw () + { + return "end of argument stream reached"; + } + + // file_io_failure + // + file_io_failure:: + ~file_io_failure () throw () + { + } + + void file_io_failure:: + print (std::ostream& os) const + { + os << "unable to open file '" << file () << "' or read failure"; + } + + const char* file_io_failure:: + what () const throw () + { + return "unable to open file or read failure"; + } + + // unmatched_quote + // + unmatched_quote:: + ~unmatched_quote () throw () + { + } + + void unmatched_quote:: + print (std::ostream& os) const + { + os << "unmatched quote in argument '" << argument () << "'"; + } + + const char* unmatched_quote:: + what () const throw () + { + return "unmatched quote"; + } + + // scanner + // + scanner:: + ~scanner () + { + } + + // argv_scanner + // + bool argv_scanner:: + more () + { + return i_ < argc_; + } + + const char* argv_scanner:: + peek () + { + if (i_ < argc_) + return argv_[i_]; + else + throw eos_reached (); + } + + const char* argv_scanner:: + next () + { + if (i_ < argc_) + { + const char* r (argv_[i_]); + + if (erase_) + { + for (int i (i_ + 1); i < argc_; ++i) + argv_[i - 1] = argv_[i]; + + --argc_; + argv_[argc_] = 0; + } + else + ++i_; + + return r; + } + else + throw eos_reached (); + } + + void argv_scanner:: + skip () + { + if (i_ < argc_) + ++i_; + else + throw eos_reached (); + } + + // argv_file_scanner + // + bool argv_file_scanner:: + more () + { + if (!args_.empty ()) + return true; + + while (base::more ()) + { + // See if the next argument is the file option. + // + const char* a (base::peek ()); + + if (!skip_ && a == option_) + { + base::next (); + + if (!base::more ()) + throw missing_value (option_); + + load (base::next ()); + + if (!args_.empty ()) + return true; + } + else + { + if (!skip_) + skip_ = (std::strcmp (a, "--") == 0); + + return true; + } + } + + return false; + } + + const char* argv_file_scanner:: + peek () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? base::peek () : args_.front ().c_str (); + } + + const char* argv_file_scanner:: + next () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::next (); + else + { + hold_.swap (args_.front ()); + args_.pop_front (); + return hold_.c_str (); + } + } + + void argv_file_scanner:: + skip () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::skip (); + else + args_.pop_front (); + } + + void argv_file_scanner:: + load (const char* file) + { + using namespace std; + + ifstream is (file); + + if (!is.is_open ()) + throw file_io_failure (file); + + while (!is.eof ()) + { + string line; + getline (is, line); + + if (is.fail () && !is.eof ()) + throw file_io_failure (file); + + string::size_type n (line.size ()); + + // Trim the line from leading and trailing whitespaces. + // + if (n != 0) + { + const char* f (line.c_str ()); + const char* l (f + n); + + const char* of (f); + while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) + ++f; + + --l; + + const char* ol (l); + while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) + --l; + + if (f != of || l != ol) + line = f <= l ? string (f, l - f + 1) : string (); + } + + // Ignore empty lines, those that start with #. + // + if (line.empty () || line[0] == '#') + continue; + + string::size_type p (line.find (' ')); + + if (p == string::npos) + { + if (!skip_) + skip_ = (line == "--"); + + args_.push_back (line); + } + else + { + string s1 (line, 0, p); + + // Skip leading whitespaces in the argument. + // + n = line.size (); + for (++p; p < n; ++p) + { + char c (line[p]); + + if (c != ' ' && c != '\t' && c != '\r') + break; + } + + string s2 (line, p); + + // If the string is wrapped in quotes, remove them. + // + n = s2.size (); + char cf (s2[0]), cl (s2[n - 1]); + + if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') + { + if (n == 1 || cf != cl) + throw unmatched_quote (s2); + + s2 = string (s2, 1, n - 2); + } + + if (!skip_ && s1 == option_) + load (s2.c_str ()); + else + { + args_.push_back (s1); + args_.push_back (s2); + } + } + } + } + + template + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + std::istringstream is (v); + if (!(is >> x && is.eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser + { + static void + parse (bool& x, scanner& s) + { + s.next (); + x = true; + } + }; + + template <> + struct parser + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::vector& c, bool& xs, scanner& s) + { + X x; + parser::parse (x, s); + c.push_back (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::set& c, bool& xs, scanner& s) + { + X x; + parser::parse (x, s); + c.insert (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::map& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + if (p == std::string::npos) + { + K k = K (); + + if (!ov.empty ()) + { + std::istringstream ks (ov); + + if (!(ks >> k && ks.eof ())) + throw invalid_value (o, ov); + } + + m[k] = V (); + } + else + { + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, p + 1); + + if (!kstr.empty ()) + { + std::istringstream ks (kstr); + + if (!(ks >> k && ks.eof ())) + throw invalid_value (o, ov); + } + + if (!vstr.empty ()) + { + std::istringstream vs (vstr); + + if (!(vs >> v && vs.eof ())) + throw invalid_value (o, ov); + } + + m[k] = v; + } + } + else + throw missing_value (o); + + xs = true; + } + }; + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, s); + } + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, x.*S, s); + } +} + +#include +#include + +namespace cli +{ + // mysql_options + // + + mysql_options:: + mysql_options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + } + + mysql_options:: + mysql_options (int start, + int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + } + + mysql_options:: + mysql_options (int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + mysql_options:: + mysql_options (int start, + int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + mysql_options:: + mysql_options (::cli::scanner& s, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + _parse (s, opt, arg); + } + + void mysql_options:: + print_usage (::std::ostream& os) + { + os << "--help Print usage information and exit." << ::std::endl; + + os << "--user MySQL database user." << ::std::endl; + + os << "--passwd MySQL database password" << ::std::endl; + + os << "--db-name MySQL database name." << ::std::endl; + + os << "--host MySQL database host name or address (localhost by" << ::std::endl + << " default)." << ::std::endl; + + os << "--port MySQL database port number." << ::std::endl; + + os << "--socket MySQL database socket name." << ::std::endl; + + os << "--options-file Read additional options from ." << ::std::endl; + } + + typedef + std::map + _cli_mysql_options_map; + + static _cli_mysql_options_map _cli_mysql_options_map_; + + struct _cli_mysql_options_map_init + { + _cli_mysql_options_map_init () + { + _cli_mysql_options_map_["--help"] = + &::cli::thunk< mysql_options, bool, &mysql_options::help_ >; + _cli_mysql_options_map_["--user"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::user_, + &mysql_options::user_specified_ >; + _cli_mysql_options_map_["--passwd"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::passwd_, + &mysql_options::passwd_specified_ >; + _cli_mysql_options_map_["--db-name"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::db_name_, + &mysql_options::db_name_specified_ >; + _cli_mysql_options_map_["--host"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::host_, + &mysql_options::host_specified_ >; + _cli_mysql_options_map_["--port"] = + &::cli::thunk< mysql_options, unsigned int, &mysql_options::port_, + &mysql_options::port_specified_ >; + _cli_mysql_options_map_["--socket"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::socket_, + &mysql_options::socket_specified_ >; + _cli_mysql_options_map_["--options-file"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::options_file_, + &mysql_options::options_file_specified_ >; + } + } _cli_mysql_options_map_init_; + + void mysql_options:: + _parse (::cli::scanner& s, + ::cli::unknown_mode opt_mode, + ::cli::unknown_mode arg_mode) + { + bool opt = true; + + while (s.more ()) + { + const char* o = s.peek (); + + if (std::strcmp (o, "--") == 0) + { + s.skip (); + opt = false; + continue; + } + + _cli_mysql_options_map::const_iterator i ( + opt ? _cli_mysql_options_map_.find (o) : _cli_mysql_options_map_.end ()); + + if (i != _cli_mysql_options_map_.end ()) + { + (*(i->second)) (*this, s); + } + else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0') + { + switch (opt_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_option (o); + } + } + + break; + } + else + { + switch (arg_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_argument (o); + } + } + + break; + } + } + } +} + diff --git a/libcommon/options.hxx b/libcommon/options.hxx new file mode 100644 index 0000000..d9e3ab8 --- /dev/null +++ b/libcommon/options.hxx @@ -0,0 +1,396 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef LIBCOMMON_OPTIONS_HXX +#define LIBCOMMON_OPTIONS_HXX + +#include +#include +#include +#include + +namespace cli +{ + class unknown_mode + { + public: + enum value + { + skip, + stop, + fail + }; + + unknown_mode (value v); + + operator value () const + { + return v_; + } + + private: + value v_; + }; + + // Exceptions. + // + + class exception: public std::exception + { + public: + virtual void + print (std::ostream&) const = 0; + }; + + std::ostream& + operator<< (std::ostream&, const exception&); + + class unknown_option: public exception + { + public: + virtual + ~unknown_option () throw (); + + unknown_option (const std::string& option); + + const std::string& + option () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class unknown_argument: public exception + { + public: + virtual + ~unknown_argument () throw (); + + unknown_argument (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + class missing_value: public exception + { + public: + virtual + ~missing_value () throw (); + + missing_value (const std::string& option); + + const std::string& + option () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class invalid_value: public exception + { + public: + virtual + ~invalid_value () throw (); + + invalid_value (const std::string& option, + const std::string& value); + + const std::string& + option () const; + + const std::string& + value () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + std::string value_; + }; + + class eos_reached: public exception + { + public: + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + }; + + class file_io_failure: public exception + { + public: + virtual + ~file_io_failure () throw (); + + file_io_failure (const std::string& file); + + const std::string& + file () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string file_; + }; + + class unmatched_quote: public exception + { + public: + virtual + ~unmatched_quote () throw (); + + unmatched_quote (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + class scanner + { + public: + virtual + ~scanner (); + + virtual bool + more () = 0; + + virtual const char* + peek () = 0; + + virtual const char* + next () = 0; + + virtual void + skip () = 0; + }; + + class argv_scanner: public scanner + { + public: + argv_scanner (int& argc, char** argv, bool erase = false); + argv_scanner (int start, int& argc, char** argv, bool erase = false); + + int + end () const; + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + private: + int i_; + int& argc_; + char** argv_; + bool erase_; + }; + + class argv_file_scanner: public argv_scanner + { + public: + argv_file_scanner (int& argc, + char** argv, + const std::string& file_option, + bool erase = false); + + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& file_option, + bool erase = false); + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + private: + void + load (const char* file); + + typedef argv_scanner base; + + const std::string option_; + std::string hold_; + std::deque args_; + bool skip_; + }; +} + +#include + +namespace cli +{ + class mysql_options + { + public: + + mysql_options (int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int start, + int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (::cli::scanner&, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + // Option accessors. + // + + const bool& + help () const; + + const std::string& + user () const; + + bool + user_specified () const; + + const std::string& + passwd () const; + + bool + passwd_specified () const; + + const std::string& + db_name () const; + + bool + db_name_specified () const; + + const std::string& + host () const; + + bool + host_specified () const; + + const unsigned int& + port () const; + + bool + port_specified () const; + + const std::string& + socket () const; + + bool + socket_specified () const; + + const std::string& + options_file () const; + + bool + options_file_specified () const; + + // Print usage information. + // + static void + print_usage (::std::ostream&); + + private: + void + _parse (::cli::scanner&, + ::cli::unknown_mode option, + ::cli::unknown_mode argument); + + public: + bool help_; + std::string user_; + bool user_specified_; + std::string passwd_; + bool passwd_specified_; + std::string db_name_; + bool db_name_specified_; + std::string host_; + bool host_specified_; + unsigned int port_; + bool port_specified_; + std::string socket_; + bool socket_specified_; + std::string options_file_; + bool options_file_specified_; + }; +} + +#include "options.ixx" + +#endif // LIBCOMMON_OPTIONS_HXX diff --git a/libcommon/options.ixx b/libcommon/options.ixx new file mode 100644 index 0000000..0fa60e5 --- /dev/null +++ b/libcommon/options.ixx @@ -0,0 +1,256 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +namespace cli +{ + // unknown_mode + // + inline unknown_mode:: + unknown_mode (value v) + : v_ (v) + { + } + + // exception + // + inline std::ostream& + operator<< (std::ostream& os, const exception& e) + { + e.print (os); + return os; + } + + // unknown_option + // + inline unknown_option:: + unknown_option (const std::string& option) + : option_ (option) + { + } + + inline const std::string& unknown_option:: + option () const + { + return option_; + } + + // unknown_argument + // + inline unknown_argument:: + unknown_argument (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unknown_argument:: + argument () const + { + return argument_; + } + + // missing_value + // + inline missing_value:: + missing_value (const std::string& option) + : option_ (option) + { + } + + inline const std::string& missing_value:: + option () const + { + return option_; + } + + // invalid_value + // + inline invalid_value:: + invalid_value (const std::string& option, + const std::string& value) + : option_ (option), value_ (value) + { + } + + inline const std::string& invalid_value:: + option () const + { + return option_; + } + + inline const std::string& invalid_value:: + value () const + { + return value_; + } + + // file_io_failure + // + inline file_io_failure:: + file_io_failure (const std::string& file) + : file_ (file) + { + } + + inline const std::string& file_io_failure:: + file () const + { + return file_; + } + + // unmatched_quote + // + inline unmatched_quote:: + unmatched_quote (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unmatched_quote:: + argument () const + { + return argument_; + } + + // argv_scanner + // + inline argv_scanner:: + argv_scanner (int& argc, char** argv, bool erase) + : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase) + { + } + + inline argv_scanner:: + argv_scanner (int start, int& argc, char** argv, bool erase) + : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase) + { + } + + inline int argv_scanner:: + end () const + { + return i_; + } + + // argv_file_scanner + // + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (argc, argv, erase), + option_ (option), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (start, argc, argv, erase), + option_ (option), + skip_ (false) + { + } +} + +namespace cli +{ + // mysql_options + // + + inline const bool& mysql_options:: + help () const + { + return this->help_; + } + + inline const std::string& mysql_options:: + user () const + { + return this->user_; + } + + inline bool mysql_options:: + user_specified () const + { + return this->user_specified_; + } + + inline const std::string& mysql_options:: + passwd () const + { + return this->passwd_; + } + + inline bool mysql_options:: + passwd_specified () const + { + return this->passwd_specified_; + } + + inline const std::string& mysql_options:: + db_name () const + { + return this->db_name_; + } + + inline bool mysql_options:: + db_name_specified () const + { + return this->db_name_specified_; + } + + inline const std::string& mysql_options:: + host () const + { + return this->host_; + } + + inline bool mysql_options:: + host_specified () const + { + return this->host_specified_; + } + + inline const unsigned int& mysql_options:: + port () const + { + return this->port_; + } + + inline bool mysql_options:: + port_specified () const + { + return this->port_specified_; + } + + inline const std::string& mysql_options:: + socket () const + { + return this->socket_; + } + + inline bool mysql_options:: + socket_specified () const + { + return this->socket_specified_; + } + + inline const std::string& mysql_options:: + options_file () const + { + return this->options_file_; + } + + inline bool mysql_options:: + options_file_specified () const + { + return this->options_file_specified_; + } +} + diff --git a/makefile b/makefile new file mode 100644 index 0000000..fc5718f --- /dev/null +++ b/makefile @@ -0,0 +1,32 @@ +# file : makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make + +default := $(out_base)/ +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Build. +# +$(default): \ +$(out_base)/tracer/ \ +$(out_base)/common/ \ +$(out_base)/libcommon/ + +# Test. +# +$(test): $(out_base)/tracer/.test $(out_base)/common/.test + +# Clean. +# +$(clean): \ +$(out_base)/tracer/.clean \ +$(out_base)/common/.clean \ +$(out_base)/libcommon/.clean + +$(call import,$(src_base)/tracer/makefile) +$(call import,$(src_base)/common/makefile) +$(call import,$(src_base)/libcommon/makefile) diff --git a/tracer/makefile b/tracer/makefile new file mode 100644 index 0000000..41368ea --- /dev/null +++ b/tracer/makefile @@ -0,0 +1,20 @@ +# file : tracer/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +tests := \ +object \ +transaction + +default := $(out_base)/ +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) + +$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx new file mode 100644 index 0000000..8680b0a --- /dev/null +++ b/tracer/object/driver.cxx @@ -0,0 +1,78 @@ +// file : tracer/object/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include +#include + +#include +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main () +{ + tracer::database db; + + // transient -> persistent in transaction + // + cout << "test 001" << endl; + { + shared_ptr o1 (new (shared) object1 (1)); + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + db.persist (o1); + cout << "s 2" << endl; + t.commit (); + cout << "s 3" << endl; + } + + // persistent -> transient in transaction + // + cout << "test 002" << endl; + { + shared_ptr o1 (new (shared) object1 (1)); + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + db.persist (o1); + cout << "s 2" << endl; + db.erase (o1); + cout << "s 3" << endl; + t.commit (); + cout << "s 4" << endl; + } + + // load in transaction + // + cout << "test 003" << endl; + { + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + shared_ptr o1 (db.load (1)); + cout << "s 2" << endl; + t.commit (); + cout << "s 3" << endl; + } + + // persistent/clean -> persistent/dirty in transaction + // + cout << "test 004" << endl; + { + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + shared_ptr o1 (db.load (1)); + cout << "s 2" << endl; + db.modified (o1); + cout << "s 3" << endl; + t.commit (); + cout << "s 4" << endl; + } +} diff --git a/tracer/object/makefile b/tracer/object/makefile new file mode 100644 index 0000000..ed7c562 --- /dev/null +++ b/tracer/object/makefile @@ -0,0 +1,81 @@ +# file : tracer/object/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 +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) +$(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): odb_options += --database tracer +$(gen): cpp_options := -I$(out_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) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< | diff -u $(src_base)/test.std -) + +# 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)) + +# 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/object/test.hxx b/tracer/object/test.hxx new file mode 100644 index 0000000..a988411 --- /dev/null +++ b/tracer/object/test.hxx @@ -0,0 +1,44 @@ +// file : tracer/object/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma odb object +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma odb id + unsigned long id_; +}; + +#pragma odb object +struct object2 +{ + object2 (const std::string& id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma odb id + std::string id_; +}; + +#endif // TEST_HXX diff --git a/tracer/object/test.std b/tracer/object/test.std new file mode 100644 index 0000000..c7e458c --- /dev/null +++ b/tracer/object/test.std @@ -0,0 +1,32 @@ +test 001 +begin transaction +s 1 +insert ::object1 id 1 +s 2 +commit transaction +s 3 +test 002 +begin transaction +s 1 +insert ::object1 id 1 +s 2 +s 3 +delete ::object1 id 1 +commit transaction +s 4 +test 003 +begin transaction +s 1 +select ::object1 id 1 +s 2 +commit transaction +s 3 +test 004 +begin transaction +s 1 +select ::object1 id 1 +s 2 +s 3 +update ::object1 id 1 +commit transaction +s 4 diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx new file mode 100644 index 0000000..164b9a0 --- /dev/null +++ b/tracer/transaction/driver.cxx @@ -0,0 +1,100 @@ +// file : tracer/transaction/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include +#include + +#include +#include +#include +#include +#include + +using namespace std; +using namespace odb; + +int +main () +{ + tracer::database db; + + assert (!transaction::has_current ()); + + // Current and db accessors. + // + cout << "test 001" << endl; + { + transaction t (db.begin_transaction ()); + assert (&t.database () == &db); + assert (transaction::has_current ()); + assert (&transaction::current () == &t); + } + + // Commit. + // + cout << "test 002" << endl; + { + transaction t (db.begin_transaction ()); + t.commit (); + } + + // Rollback. + // + cout << "test 003" << endl; + { + transaction t (db.begin_transaction ()); + t.rollback (); + } + + // Auto rollback. + // + cout << "test 004" << endl; + { + transaction t (db.begin_transaction ()); + } + + // Nested transaction. + // + cout << "test 005" << endl; + { + transaction t (db.begin_transaction ()); + try + { + transaction n (db.begin_transaction ()); + } + catch (const already_in_transaction&) + { + cout << "already_in_transaction" << endl; + } + } + + // Existing session via current. + // + cout << "test 006" << endl; + { + session s; + transaction t (db.begin_transaction ()); + assert (&t.session () == &s); + } + + // Existing session passed explicitly. + // + cout << "test 007" << endl; + { + session s; + transaction t (db.begin_transaction (s)); + assert (&t.session () == &s); + } + + // Concrete transaction type. + // + cout << "test 008" << endl; + { + assert (sizeof (tracer::transaction) == sizeof (transaction)); + + tracer::transaction t (db.begin_transaction ()); + tracer::transaction& r (tracer::transaction::current ()); + } +} diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile new file mode 100644 index 0000000..5919e6e --- /dev/null +++ b/tracer/transaction/makefile @@ -0,0 +1,65 @@ +# file : tracer/transaction/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 +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) +$(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) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< | diff -u $(src_base)/test.std -) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) + +# 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)/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 new file mode 100644 index 0000000..8f962ef --- /dev/null +++ b/tracer/transaction/test.std @@ -0,0 +1,25 @@ +test 001 +begin 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 +test 007 +begin transaction +rollback transaction +test 008 +begin transaction +rollback transaction -- cgit v1.1 From afc6505d75dbc391452f41081af457045d5e7526 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jul 2010 11:08:04 +0200 Subject: Get rid of the session mechanism for now Test low-level API instead. --- tracer/object/driver.cxx | 183 ++++++++++++++++++++++++++++++++++++++---- tracer/object/test.hxx | 22 +---- tracer/object/test.std | 94 +++++++++++++++++++--- tracer/transaction/driver.cxx | 21 +---- tracer/transaction/test.std | 6 -- 5 files changed, 257 insertions(+), 69 deletions(-) diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index 8680b0a..8e9e437 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -3,9 +3,11 @@ // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +#include #include #include +#include #include #include @@ -15,18 +17,33 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main () { tracer::database db; - // transient -> persistent in transaction + // 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 << "test 001" << endl; + cout << "\ntest 002" << endl; { - shared_ptr o1 (new (shared) object1 (1)); + object o1 (1); transaction t (db.begin_transaction ()); cout << "s 1" << endl; db.persist (o1); @@ -35,44 +52,180 @@ main () cout << "s 3" << endl; } - // persistent -> transient in transaction + // transient -> persistent (already exist) // - cout << "test 002" << endl; + cout << "\ntest 003" << endl; { - shared_ptr o1 (new (shared) object1 (1)); + object o1 (0); + transaction t (db.begin_transaction ()); + 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_transaction ()); 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; } - // load in transaction + // persistent -> transient (not exist) + // + cout << "\ntest 005" << endl; + { + object o1 (0); + transaction t (db.begin_transaction ()); + 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 << "test 003" << endl; + cout << "\ntest 006" << endl; { transaction t (db.begin_transaction ()); cout << "s 1" << endl; - shared_ptr o1 (db.load (1)); + auto_ptr o1 (db.load (1)); cout << "s 2" << endl; t.commit (); cout << "s 3" << endl; } - // persistent/clean -> persistent/dirty in transaction + // load new object (not exist) + // + cout << "\ntest 007" << endl; + { + transaction t (db.begin_transaction ()); + 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 << "test 004" << endl; + cout << "\ntest 008" << endl; { + object o1; transaction t (db.begin_transaction ()); cout << "s 1" << endl; - shared_ptr o1 (db.load (1)); + db.load (1, o1); cout << "s 2" << endl; - db.modified (o1); + t.commit (); + cout << "s 3" << endl; + } + + // load into existing object (not exist) + // + cout << "\ntest 009" << endl; + { + object o1; + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + try + { + db.load (0, o1); + } + catch (const object_not_persistent&) + { + cout << "object not persistent" << endl; + } + cout << "s 2" << endl; + } + + // store + // + cout << "\ntest 010" << endl; + { + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + auto_ptr o1 (db.load (1)); + cout << "s 2" << endl; + db.store (*o1); cout << "s 3" << endl; t.commit (); cout << "s 4" << endl; } + + // store (not exist) + // + cout << "\ntest 011" << endl; + { + object o1 (0); + transaction t (db.begin_transaction ()); + cout << "s 1" << endl; + try + { + db.store (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_transaction ()); + 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_transaction ()); + 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/test.hxx b/tracer/object/test.hxx index a988411..d640e75 100644 --- a/tracer/object/test.hxx +++ b/tracer/object/test.hxx @@ -10,14 +10,14 @@ #include #pragma odb object -struct object1 +struct object { - object1 (unsigned long id) + object (unsigned long id) : id_ (id) { } - object1 () + object () { } @@ -25,20 +25,4 @@ struct object1 unsigned long id_; }; -#pragma odb object -struct object2 -{ - object2 (const std::string& id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma odb id - std::string id_; -}; - #endif // TEST_HXX diff --git a/tracer/object/test.std b/tracer/object/test.std index c7e458c..aa495e7 100644 --- a/tracer/object/test.std +++ b/tracer/object/test.std @@ -1,32 +1,108 @@ + test 001 +s 1 +s 2.b + +test 002 begin transaction s 1 -insert ::object1 id 1 +insert ::object id 1 s 2 commit transaction s 3 -test 002 + +test 003 +begin transaction +s 1 +insert ::object id 0 +object already persistent +s 2 +rollback transaction + +test 004 begin transaction s 1 -insert ::object1 id 1 +insert ::object id 1 +insert ::object id 2 s 2 +delete ::object id 1 +delete ::object id 2 s 3 -delete ::object1 id 1 commit transaction s 4 -test 003 + +test 005 begin transaction s 1 -select ::object1 id 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 004 + +test 007 begin transaction s 1 -select ::object1 id 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 -update ::object1 id 1 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/transaction/driver.cxx b/tracer/transaction/driver.cxx index 164b9a0..752eb0b 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -7,7 +7,6 @@ #include #include -#include #include #include #include @@ -70,27 +69,9 @@ main () } } - // Existing session via current. - // - cout << "test 006" << endl; - { - session s; - transaction t (db.begin_transaction ()); - assert (&t.session () == &s); - } - - // Existing session passed explicitly. - // - cout << "test 007" << endl; - { - session s; - transaction t (db.begin_transaction (s)); - assert (&t.session () == &s); - } - // Concrete transaction type. // - cout << "test 008" << endl; + cout << "test 006" << endl; { assert (sizeof (tracer::transaction) == sizeof (transaction)); diff --git a/tracer/transaction/test.std b/tracer/transaction/test.std index 8f962ef..8083774 100644 --- a/tracer/transaction/test.std +++ b/tracer/transaction/test.std @@ -17,9 +17,3 @@ rollback transaction test 006 begin transaction rollback transaction -test 007 -begin transaction -rollback transaction -test 008 -begin transaction -rollback transaction -- cgit v1.1 From a40caf1f2cb9da06b12885c9753c0a9bc54ce9c5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Jul 2010 14:14:45 +0200 Subject: Test mapping of basic C++ types to DB types --- common/schema/test.hxx | 20 +++++++++++++++++++- common/template/test.hxx | 22 +++------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 471d27b..c9ddd14 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -51,7 +51,25 @@ struct type #pragma odb id int id; - #pragma odb type ("INTEGER") + // Test default C++ to DB type mapping. + // + bool b; + char c; + signed char sc; + unsigned char uc; + short s; + unsigned short us; + int i; + unsigned int ui; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + float f; + double d; + std::string str; + + #pragma odb type ("INTEGER UNSIGNED") bool m1; }; diff --git a/common/template/test.hxx b/common/template/test.hxx index 48acd44..3891a75 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -10,14 +10,14 @@ #include #pragma odb object -struct object1 +struct object { - object1 (unsigned long id) + object (unsigned long id) : id_ (id) { } - object1 () + object () { } @@ -25,20 +25,4 @@ struct object1 unsigned long id_; }; -#pragma odb object -struct object2 -{ - object2 (const std::string& id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma odb id - std::string id_; -}; - #endif // TEST_HXX -- cgit v1.1 From 8d7db5926bc4764cc368570ea9b64e354c13f671 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Jul 2010 14:35:31 +0200 Subject: Use std::string as object id --- common/schema/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/schema/test.hxx b/common/schema/test.hxx index c9ddd14..26a8b41 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -49,7 +49,7 @@ struct column struct type { #pragma odb id - int id; + std::string id; // Test default C++ to DB type mapping. // -- cgit v1.1 From b9161e6e332cb0279ef8616dbbce4c90b60bce15 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Aug 2010 14:12:48 +0200 Subject: New tests --- common/lifecycle/driver.cxx | 117 +++++++++++++++ common/lifecycle/makefile | 82 +++++++++++ common/lifecycle/test.hxx | 29 ++++ common/lifecycle/test.std | 0 common/makefile | 3 +- common/schema/driver.cxx | 3 + common/schema/test.hxx | 3 + common/template/driver.cxx | 3 + common/template/test.hxx | 1 - libcommon/options.cxx | 6 +- makefile | 38 ++--- mysql/makefile | 21 +++ mysql/template/driver.cxx | 46 ++++++ mysql/template/makefile | 88 +++++++++++ mysql/template/test.hxx | 27 ++++ mysql/template/test.std | 1 + mysql/truncation/driver.cxx | 102 +++++++++++++ mysql/truncation/makefile | 88 +++++++++++ mysql/truncation/test.hxx | 48 ++++++ mysql/truncation/test.std | 0 mysql/types/driver.cxx | 108 ++++++++++++++ mysql/types/makefile | 89 +++++++++++ mysql/types/test.hxx | 335 ++++++++++++++++++++++++++++++++++++++++++ mysql/types/test.std | 0 mysql/types/traits.hxx | 231 +++++++++++++++++++++++++++++ tracer/object/driver.cxx | 3 + tracer/transaction/driver.cxx | 3 + 27 files changed, 1448 insertions(+), 27 deletions(-) create mode 100644 common/lifecycle/driver.cxx create mode 100644 common/lifecycle/makefile create mode 100644 common/lifecycle/test.hxx create mode 100644 common/lifecycle/test.std create mode 100644 mysql/makefile create mode 100644 mysql/template/driver.cxx create mode 100644 mysql/template/makefile create mode 100644 mysql/template/test.hxx create mode 100644 mysql/template/test.std create mode 100644 mysql/truncation/driver.cxx create mode 100644 mysql/truncation/makefile create mode 100644 mysql/truncation/test.hxx create mode 100644 mysql/truncation/test.std create mode 100644 mysql/types/driver.cxx create mode 100644 mysql/types/makefile create mode 100644 mysql/types/test.hxx create mode 100644 mysql/types/test.std create mode 100644 mysql/types/traits.hxx diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx new file mode 100644 index 0000000..4b43129 --- /dev/null +++ b/common/lifecycle/driver.cxx @@ -0,0 +1,117 @@ +// file : common/lifecycle/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object state transistions. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // transient + // + try + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + + // persistent + // + { + object o (1); + o.str_ = "value 1"; + + transaction t (db->begin_transaction ()); + db->persist (o); + t.commit (); + + try + { + transaction t (db->begin_transaction ()); + db->persist (o); + assert (false); + t.commit (); + } + catch (const object_already_persistent&) + { + } + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + assert (o->str_ == "value 1"); + t.commit (); + } + + // modified + // + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + o->str_ = "value 2"; + db->store (*o); + t.commit (); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + assert (o->str_ == "value 2"); + t.commit (); + } + + // transient + // + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + db->erase (*o); + t.commit (); + } + + try + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (1)); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile new file mode 100644 index 0000000..21278fc --- /dev/null +++ b/common/lifecycle/makefile @@ -0,0 +1,82 @@ +# file : common/lifecycle/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/lifecycle/test.hxx b/common/lifecycle/test.hxx new file mode 100644 index 0000000..268678c --- /dev/null +++ b/common/lifecycle/test.hxx @@ -0,0 +1,29 @@ +// file : common/lifecycle/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma odb object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma odb id + unsigned long id_; + std::string str_; +}; + +#endif // TEST_HXX diff --git a/common/lifecycle/test.std b/common/lifecycle/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index b81fd58..021c648 100644 --- a/common/makefile +++ b/common/makefile @@ -7,7 +7,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ schema \ -template +template \ +lifecycle default := $(out_base)/ test := $(out_base)/.test diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index 4d27e81..1cc6be9 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +// Test database schema creation. +// + #include // std::auto_ptr #include #include diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 26a8b41..14c5113 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -71,6 +71,9 @@ struct type #pragma odb type ("INTEGER UNSIGNED") bool m1; + + #pragma odb transient + char* m2; }; #endif // TEST_HXX diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 0361c13..0aaa228 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +// PLACE TEST DESCRIPTION HERE +// + #include // std::auto_ptr #include #include diff --git a/common/template/test.hxx b/common/template/test.hxx index 3891a75..cb25360 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -6,7 +6,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include #include #pragma odb object diff --git a/libcommon/options.cxx b/libcommon/options.cxx index 2a2280d..9d15251 100644 --- a/libcommon/options.cxx +++ b/libcommon/options.cxx @@ -429,7 +429,8 @@ namespace cli parse (std::vector& c, bool& xs, scanner& s) { X x; - parser::parse (x, s); + bool dummy; + parser::parse (x, dummy, s); c.push_back (x); xs = true; } @@ -442,7 +443,8 @@ namespace cli parse (std::set& c, bool& xs, scanner& s) { X x; - parser::parse (x, s); + bool dummy; + parser::parse (x, dummy, s); c.insert (x); xs = true; } diff --git a/makefile b/makefile index fc5718f..e3559a9 100644 --- a/makefile +++ b/makefile @@ -1,32 +1,24 @@ -# file : makefile +# file : mysql/makefile # author : Boris Kolpackov # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean +tests := \ +common \ +tracer -# Build. -# -$(default): \ -$(out_base)/tracer/ \ -$(out_base)/common/ \ -$(out_base)/libcommon/ +ifeq ($(db_id),mysql) +tests += mysql +endif -# Test. -# -$(test): $(out_base)/tracer/.test $(out_base)/common/.test +default := $(out_base)/ +test := $(out_base)/.test +clean := $(out_base)/.clean -# Clean. -# -$(clean): \ -$(out_base)/tracer/.clean \ -$(out_base)/common/.clean \ -$(out_base)/libcommon/.clean +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) -$(call import,$(src_base)/tracer/makefile) -$(call import,$(src_base)/common/makefile) -$(call import,$(src_base)/libcommon/makefile) +$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mysql/makefile b/mysql/makefile new file mode 100644 index 0000000..ae1b83f --- /dev/null +++ b/mysql/makefile @@ -0,0 +1,21 @@ +# file : mysql/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +tests := \ +truncation \ +types \ +template + +default := $(out_base)/ +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) + +$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx new file mode 100644 index 0000000..76a41bb --- /dev/null +++ b/mysql/template/driver.cxx @@ -0,0 +1,46 @@ +// file : mysql/template/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin_transaction ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/template/makefile b/mysql/template/makefile new file mode 100644 index 0000000..a614597 --- /dev/null +++ b/mysql/template/makefile @@ -0,0 +1,88 @@ +# file : mysql/template/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +ifdef db_id +ifneq ($(db_id),mysql) +$(error trying to build a MySQL-specific test with $(db_id)) +endif +endif + +# 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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/mysql/template/test.hxx b/mysql/template/test.hxx new file mode 100644 index 0000000..c71a962 --- /dev/null +++ b/mysql/template/test.hxx @@ -0,0 +1,27 @@ +// file : mysql/template/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma odb object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma odb id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/mysql/template/test.std b/mysql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/mysql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx new file mode 100644 index 0000000..f94205e --- /dev/null +++ b/mysql/truncation/driver.cxx @@ -0,0 +1,102 @@ +// file : mysql/truncation/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin_transaction ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin_transaction ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin_transaction ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin_transaction ()); + db->store (o); + t.commit (); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile new file mode 100644 index 0000000..84eb4f3 --- /dev/null +++ b/mysql/truncation/makefile @@ -0,0 +1,88 @@ +# file : mysql/truncation/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +ifdef db_id +ifneq ($(db_id),mysql) +$(error trying to build a MySQL-specific test with $(db_id)) +endif +endif + +# 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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/mysql/truncation/test.hxx b/mysql/truncation/test.hxx new file mode 100644 index 0000000..4e1c1bc --- /dev/null +++ b/mysql/truncation/test.hxx @@ -0,0 +1,48 @@ +// file : mysql/truncation/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma odb object table ("test") +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma odb id + unsigned long id_; + + std::string str_; +}; + +#pragma odb object table ("test") +struct object2 +{ + object2 (unsigned long id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma odb id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/mysql/truncation/test.std b/mysql/truncation/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx new file mode 100644 index 0000000..1221d5c --- /dev/null +++ b/mysql/types/driver.cxx @@ -0,0 +1,108 @@ +// file : mysql/types/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test MySQL type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + + o.bool_ = true; + o.schar_ = -123; + o.uchar_ = 123; + o.short_ = -12345; + o.ushort_ = 12345; + o.mint_ = -123456; + o.umint_ = 123456; + o.int_ = -123456; + o.uint_ = 123456; + o.long_long_ = -123456; + o.ulong_long_ = 123456; + + o.float_ = 1.123; + o.double_ = 1.123; + o.decimal_ = "123.456"; + + o.date_ = date_time (false, 2010, 8, 29, 0, 0, 0); + o.time_ = date_time (true, 0, 0, 0, 12, 26, 59); + o.date_time_ = date_time (false, 2010, 8, 29, 12, 26, 59); + o.timestamp_ = date_time (false, 2010, 8, 29, 12, 26, 59); + o.year_ = 2010; + + string short_str (128, 's'); + ::buffer short_buf (short_str.c_str (), short_str.size ()); + string medium_str (250, 'm'); + ::buffer medium_buf (medium_str.c_str (), medium_str.size ()); + string long_str (2040, 'l'); + ::buffer long_buf (long_str.c_str (), long_str.size ()); + + o.char_ = short_str; + o.binary_ = short_buf; + o.varchar_ = medium_str; + o.varbinary_ = medium_buf; + o.tinytext_ = short_str; + o.tinyblob_ = short_buf; + o.text_ = long_str; + o.blob_ = long_buf; + o.mediumtext_ = long_str; + o.mediumblob_ = long_buf; + o.longtext_ = long_str; + o.longblob_ = long_buf; + + o.bit_.a = 1; + o.bit_.b = 0; + o.bit_.c = 0; + o.bit_.d = 1; + + o.enum_ = "green"; + o.set_.insert ("green"); + o.set_.insert ("red"); + o.set_.insert ("blue"); + + { + transaction t (db->begin_transaction ()); + db->persist (o); + t.commit (); + } + + // + // + { + transaction t (db->begin_transaction ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/types/makefile b/mysql/types/makefile new file mode 100644 index 0000000..bf23a69 --- /dev/null +++ b/mysql/types/makefile @@ -0,0 +1,89 @@ +# file : mysql/types/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +ifdef db_id +ifneq ($(db_id),mysql) +$(error trying to build a MySQL-specific test with $(db_id)) +endif +endif + +# 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) +$(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): odb_options += --database $(db_id) --generate-schema \ +--cxx-prologue '\\\#include "traits.hxx"' +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/mysql/types/test.hxx b/mysql/types/test.hxx new file mode 100644 index 0000000..7f2ce4d --- /dev/null +++ b/mysql/types/test.hxx @@ -0,0 +1,335 @@ +// file : mysql/types/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::auto_ptr +#include // std::size_t +#include // std::{memcmp,memcpy} + +#include + +struct date_time +{ + date_time () + { + } + + date_time (bool n, + unsigned int y, + unsigned int m, + unsigned int d, + unsigned int h, + unsigned int min, + unsigned int sec) + : negative (n), + year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec) + { + } + + bool + operator== (const date_time& y) + { + return + negative == y.negative && + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second; + } + + bool negative; + unsigned int year; + unsigned int month; + unsigned int day; + unsigned int hour; + unsigned int minute; + unsigned int second; +}; + +struct buffer +{ + ~buffer () + { + delete[] data_; + } + + buffer () + : data_ (0), size_ (0) + { + } + + buffer (const void* data, std::size_t size) + : data_ (0), size_ (size) + { + data_ = new char[size_]; + std::memcpy (data_, data, size_); + } + + buffer (const buffer& y) + : data_ (0), size_ (0) + { + assign (y.data_, y.size_); + } + + buffer& + operator= (const buffer& y) + { + if (this != &y) + assign (y.data_, y.size_); + + return *this; + } + + void + assign (const void* data, std::size_t size) + { + if (size_ < size) + { + char* p (new char[size]); + delete[] data_; + data_ = p; + } + + std::memcpy (data_, data, size); + size_ = size; + } + + char* + data () + { + return data_; + } + + const char* + data () const + { + return data_; + } + + std::size_t + size () const + { + return size_; + } + + bool + operator== (const buffer& y) + { + return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; + } + +private: + char* data_; + std::size_t size_; +}; + +struct bitfield +{ + unsigned int a: 1; + unsigned int b: 1; + unsigned int c: 1; + unsigned int d: 1; +}; + +inline bool +operator== (bitfield x, bitfield y) +{ + return + x.a == y.a && + x.b == y.b && + x.c == y.c && + x.d == y.d; +} + +typedef std::set set; +typedef std::auto_ptr string_ptr; + +#pragma odb object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma odb id + unsigned long id_; + + // Integral types. + // + #pragma odb type ("BOOL NOT NULL") + bool bool_; + + #pragma odb type ("TINYINT NOT NULL") + signed char schar_; + + #pragma odb type ("TINYINT UNSIGNED NOT NULL") + unsigned char uchar_; + + #pragma odb type ("SMALLINT NOT NULL") + short short_; + + #pragma odb type ("SMALLINT UNSIGNED NOT NULL") + unsigned short ushort_; + + #pragma odb type ("MEDIUMINT NOT NULL") + int mint_; + + #pragma odb type ("MEDIUMINT UNSIGNED NOT NULL") + unsigned int umint_; + + #pragma odb type ("INT NOT NULL") + int int_; + + #pragma odb type ("INT UNSIGNED NOT NULL") + unsigned int uint_; + + #pragma odb type ("BIGINT NOT NULL") + long long long_long_; + + #pragma odb type ("BIGINT UNSIGNED NOT NULL") + unsigned long long ulong_long_; + + // Float types. + // + #pragma odb type ("FLOAT NOT NULL") + float float_; + + #pragma odb type ("DOUBLE NOT NULL") + double double_; + + #pragma odb type ("DECIMAL(6,3) NOT NULL") + std::string decimal_; + + // Data-time types. + // + #pragma odb type ("DATE NOT NULL") + date_time date_; + + #pragma odb type ("TIME NOT NULL") + date_time time_; + + #pragma odb type ("DATETIME NOT NULL") + date_time date_time_; + + #pragma odb type ("TIMESTAMP NOT NULL") + date_time timestamp_; + + #pragma odb type ("YEAR NOT NULL") + short year_; + + // String and binary types. + // + #pragma odb type ("CHAR(128) NOT NULL") + std::string char_; + + #pragma odb type ("BINARY(128) NOT NULL") + buffer binary_; + + #pragma odb type ("VARCHAR(256) NOT NULL") + std::string varchar_; + + #pragma odb type ("VARBINARY(256) NOT NULL") + buffer varbinary_; + + #pragma odb type ("TINYTEXT NOT NULL") + std::string tinytext_; + + #pragma odb type ("TINYBLOB NOT NULL") + buffer tinyblob_; + + #pragma odb type ("TEXT NOT NULL") + std::string text_; + + #pragma odb type ("BLOB NOT NULL") + buffer blob_; + + #pragma odb type ("MEDIUMTEXT NOT NULL") + std::string mediumtext_; + + #pragma odb type ("MEDIUMBLOB NOT NULL") + buffer mediumblob_; + + #pragma odb type ("LONGTEXT NOT NULL") + std::string longtext_; + + #pragma odb type ("LONGBLOB NOT NULL") + buffer longblob_; + + // Other types. + // + #pragma odb type ("BIT(4) NOT NULL") + bitfield bit_; + + #pragma odb type ("ENUM('red', 'green', 'blue') NOT NULL") + std::string enum_; + + #pragma odb type ("SET('red', 'green', 'blue') NOT NULL") + set set_; + + // Test NULL value. + // + #pragma odb type ("TEXT") + string_ptr null_; + + bool + operator== (const object& y) + { + return + id_ == y.id_ && + bool_ == y.bool_ && + schar_ == y.schar_ && + uchar_ == y.uchar_ && + short_ == y.short_ && + ushort_ == y.ushort_ && + mint_ == y.mint_ && + umint_ == y.umint_ && + int_ == y.int_ && + uint_ == y.uint_ && + long_long_ == y.long_long_ && + ulong_long_ == y.ulong_long_ && + float_ == y.float_ && + double_ == y.double_ && + decimal_ == y.decimal_ && + date_ == y.date_ && + time_ == y.time_ && + date_time_ == y.date_time_ && + timestamp_ == y.timestamp_ && + year_ == y.year_ && + char_ == y.char_ && + binary_ == y.binary_ && + varchar_ == y.varchar_ && + varbinary_ == y.varbinary_ && + tinytext_ == y.tinytext_ && + tinyblob_ == y.tinyblob_ && + text_ == y.text_ && + blob_ == y.blob_ && + mediumtext_ == y.mediumtext_ && + mediumblob_ == y.mediumblob_ && + longtext_ == y.longtext_ && + longblob_ == y.longblob_ && + bit_ == y.bit_ && + enum_ == y.enum_ && + set_ == y.set_ && + null_.get () == 0 && y.null_.get () == 0 || *null_ == *y.null_; + } +}; + +#endif // TEST_HXX diff --git a/mysql/types/test.std b/mysql/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx new file mode 100644 index 0000000..0db33aa --- /dev/null +++ b/mysql/types/traits.hxx @@ -0,0 +1,231 @@ +// file : mysql/types/traits.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::memcpy, std::memset + +#include + +#include "test.hxx" // date_time + +namespace odb +{ + namespace mysql + { + template <> + class value_traits + { + public: + typedef date_time value_type; + + static void + set_value (date_time& v, const MYSQL_TIME& i, bool is_null) + { + if (!is_null) + { + v.negative = i.neg; + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + } + else + v = date_time (); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const date_time& v) + { + is_null = false; + i.neg = v.negative; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.second_part = 0; + } + }; + + template <> + class value_traits< ::buffer > + { + public: + typedef ::buffer value_type; + + static void + set_value (value_type& v, const char* s, std::size_t n, bool is_null) + { + if (!is_null) + v.assign (s, n); + else + v.assign (0, 0); + } + + static void + set_image (char* s, + std::size_t c, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + n = v.size (); + + if (n > c) + n = c; + + if (n != 0) + std::memcpy (s, v.data (), n); + } + + static void + set_image (odb::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + n = v.size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v.data (), n); + } + }; + + template <> + class value_traits + { + public: + typedef bitfield value_type; + + static void + set_value (bitfield& v, + const unsigned char* s, + std::size_t n, + bool is_null) + { + if (!is_null) + std::memcpy (&v, s, 1); + else + std::memset (&v, 0, sizeof (bitfield)); + } + + static void + set_image (unsigned char* s, + std::size_t c, + std::size_t& n, + bool& is_null, + bitfield v) + { + is_null = false; + n = 1; + std::memcpy (s, &v, 1); + } + }; + + template <> + class value_traits + { + public: + typedef set value_type; + + static void + set_value (set& v, const char* s, std::size_t n, bool is_null) + { + v.clear (); + + if (!is_null) + { + const char* e (s + n); + + while (s < e) + { + const char* p (s); + + while (p < e && *p != ',') + ++p; + + v.insert (std::string (s, p - s)); + s = p; + + if (p != e) + ++s; + } + } + } + + static void + set_image (odb::buffer& buf, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + n = 0; + + for (set::const_iterator b (v.begin ()), i (b); i != v.end (); ++i) + { + std::size_t m (i->size () + (i != b ? 1 : 0)); + + if (n + m > buf.capacity ()) + buf.capacity (n + m, n); + + if (i != b) + buf.data ()[n++] = ','; + + std::memcpy (buf.data () + n, i->c_str (), i->size ()); + n += i->size (); + } + } + }; + + template <> + class value_traits > + { + public: + typedef std::auto_ptr value_type; + + static void + set_value (std::auto_ptr& v, + const char* s, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (s, n)); + } + + static void + set_image (odb::buffer& b, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index 8e9e437..0d84d0f 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +// Test object persistence operations. +// + #include #include #include diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index 752eb0b..9fcce97 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +// Test transaction operations. +// + #include #include -- cgit v1.1 From 3076df2628f514b50065912a72269f2dc717e164 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Aug 2010 11:19:14 +0200 Subject: Query test --- common/makefile | 3 +- common/query/driver.cxx | 162 ++++++++++++++++++++++++++++++++++++++++++++++++ common/query/makefile | 82 ++++++++++++++++++++++++ common/query/test.hxx | 43 +++++++++++++ common/query/test.std | 15 +++++ 5 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 common/query/driver.cxx create mode 100644 common/query/makefile create mode 100644 common/query/test.hxx create mode 100644 common/query/test.std diff --git a/common/makefile b/common/makefile index 021c648..ad3b0a4 100644 --- a/common/makefile +++ b/common/makefile @@ -8,7 +8,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ schema \ template \ -lifecycle +lifecycle \ +query default := $(out_base)/ test := $(out_base)/.test diff --git a/common/query/driver.cxx b/common/query/driver.cxx new file mode 100644 index 0000000..214dd7b --- /dev/null +++ b/common/query/driver.cxx @@ -0,0 +1,162 @@ +// file : common/query/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; + +void +print (result& r) +{ + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + auto_ptr o (*i); + cout << *o << endl; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + { + person p1 (1, "John", "Doe", 30); + person p2 (2, "Jane", "Doe", 29); + person p3 (3, "Joe", "Dirt", 31); + + transaction t (db->begin_transaction ()); + db->persist (p1); + db->persist (p2); + db->persist (p3); + t.commit (); + } + + // Compilation tests. + // + if (false) + { + typedef odb::query query; + + string name; + unsigned short age; + + db->query ("age = " + query::_ref (age)); + db->query ("age = " + query::_val (age)); + + query age_q (query::_ref (age) + " = age"); + query name_q ("first_name = " + query::_val (name)); + query q (age_q + "AND" + name_q); + + db->query (q); + db->query (age_q + "OR" + + name_q + "OR" + + "age < " + query::_ref (age)); + } + + // Select-all query. + // + cout << "test 001" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query ()); + print (r); + t.commit (); + } + + // Select-all query with order by. + // + cout << "test 002" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query ("ORDER BY age")); + print (r); + t.commit (); + } + + // String query. + // + cout << "test 003" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query ("age >= 30 AND last_name = 'Doe'")); + print (r); + t.commit (); + } + + typedef odb::query query; + + // Value binding. + // + cout << "test 004" << endl; + { + transaction t (db->begin_transaction ()); + + const char* name = "Doe"; + + result r ( + db->query ( + "age >= " + query::_ref (30) + "AND" + + "last_name = " + query::_val (name))); + + print (r); + t.commit (); + } + + // Reference binding. + // + cout << "test 005" << endl; + { + transaction t (db->begin_transaction ()); + + string name; + unsigned short age; + + query q ("age >= " + query::_ref (age) + "AND" + + "last_name = " + query::_ref (name)); + + { + name = "Doe"; + age = 30; + result r (db->query (q)); + print (r); + } + + { + name = "Dirt"; + age = 31; + result r (db->query (q)); + print (r); + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/query/makefile b/common/query/makefile new file mode 100644 index 0000000..276b948 --- /dev/null +++ b/common/query/makefile @@ -0,0 +1,82 @@ +# file : common/query/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/query/test.hxx b/common/query/test.hxx new file mode 100644 index 0000000..a923458 --- /dev/null +++ b/common/query/test.hxx @@ -0,0 +1,43 @@ +// file : common/query/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma odb object +struct person +{ + person (unsigned long id, + const std::string& fn, + const std::string& ln, + unsigned short age) + : id_ (id), first_name_ (fn), last_name_ (ln), age_ (age) + { + } + + person () + { + } + + #pragma odb id + unsigned long id_; + + std::string first_name_; + std::string last_name_; + unsigned short age_; +}; + +inline std::ostream& +operator<< (std::ostream& os, const person& p) +{ + return os << p.first_name_ << ' ' << p.last_name_ << ' ' << p.age_; +} + +#endif // TEST_HXX diff --git a/common/query/test.std b/common/query/test.std new file mode 100644 index 0000000..0235af1 --- /dev/null +++ b/common/query/test.std @@ -0,0 +1,15 @@ +test 001 +John Doe 30 +Jane Doe 29 +Joe Dirt 31 +test 002 +Jane Doe 29 +John Doe 30 +Joe Dirt 31 +test 003 +John Doe 30 +test 004 +John Doe 30 +test 005 +John Doe 30 +Joe Dirt 31 -- cgit v1.1 From 9ed005a6000008b8e84d98a52407a0ab8cb412d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Aug 2010 13:59:08 +0200 Subject: Test new result interface --- common/query/driver.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 214dd7b..bcfbff1 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -137,19 +137,15 @@ main (int argc, char* argv[]) query q ("age >= " + query::_ref (age) + "AND" + "last_name = " + query::_ref (name)); - { - name = "Doe"; - age = 30; - result r (db->query (q)); - print (r); - } - - { - name = "Dirt"; - age = 31; - result r (db->query (q)); - print (r); - } + name = "Doe"; + age = 30; + result r (db->query (q)); + print (r); + + name = "Dirt"; + age = 31; + r = db->query (q); + print (r); t.commit (); } -- cgit v1.1 From 466dbfe2a99cd40c0d60e00ed5f05c862a8b41b1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Aug 2010 17:05:37 +0200 Subject: Test ability to load result into an existing object --- common/query/driver.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index bcfbff1..9a8300a 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -82,7 +82,14 @@ main (int argc, char* argv[]) { transaction t (db->begin_transaction ()); result r (db->query ()); - print (r); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + person p; + i.load (p); + cout << p << endl; + } + t.commit (); } -- cgit v1.1 From 1e75d3970354325d8bfc943dc293cef78f58fbf2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Aug 2010 13:45:19 +0200 Subject: Fix operator precedence --- mysql/types/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 7f2ce4d..f156506 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -328,7 +328,7 @@ struct object bit_ == y.bit_ && enum_ == y.enum_ && set_ == y.set_ && - null_.get () == 0 && y.null_.get () == 0 || *null_ == *y.null_; + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); } }; -- cgit v1.1 From c58a371ed1a28d926cab0742a3b11740cffe6fe6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Aug 2010 13:45:37 +0200 Subject: Clear unused bits when copying a bitfield --- mysql/types/traits.hxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 0db33aa..1aea637 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -20,6 +20,7 @@ namespace odb class value_traits { public: + typedef date_time type; typedef date_time value_type; static void @@ -58,10 +59,11 @@ namespace odb class value_traits< ::buffer > { public: + typedef ::buffer type; typedef ::buffer value_type; static void - set_value (value_type& v, const char* s, std::size_t n, bool is_null) + set_value (type& v, const char* s, std::size_t n, bool is_null) { if (!is_null) v.assign (s, n); @@ -74,7 +76,7 @@ namespace odb std::size_t c, std::size_t& n, bool& is_null, - const value_type& v) + const type& v) { is_null = false; n = v.size (); @@ -90,7 +92,7 @@ namespace odb set_image (odb::buffer& b, std::size_t& n, bool& is_null, - const value_type& v) + const type& v) { is_null = false; n = v.size (); @@ -107,12 +109,13 @@ namespace odb class value_traits { public: + typedef bitfield type; typedef bitfield value_type; static void set_value (bitfield& v, const unsigned char* s, - std::size_t n, + std::size_t, bool is_null) { if (!is_null) @@ -123,7 +126,7 @@ namespace odb static void set_image (unsigned char* s, - std::size_t c, + std::size_t, std::size_t& n, bool& is_null, bitfield v) @@ -131,6 +134,7 @@ namespace odb is_null = false; n = 1; std::memcpy (s, &v, 1); + s[0] &= 0x0F; // Clear unused bits -- MySQL is sensitive about that. } }; @@ -138,6 +142,7 @@ namespace odb class value_traits { public: + typedef set type; typedef set value_type; static void @@ -169,7 +174,7 @@ namespace odb set_image (odb::buffer& buf, std::size_t& n, bool& is_null, - const value_type& v) + const set& v) { is_null = false; n = 0; @@ -194,7 +199,8 @@ namespace odb class value_traits > { public: - typedef std::auto_ptr value_type; + typedef std::auto_ptr type; + typedef std::string value_type; static void set_value (std::auto_ptr& v, -- cgit v1.1 From 94845b83a38e0fdbc0bee496db058373057093c4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Aug 2010 13:46:23 +0200 Subject: Get rid of a warning --- tracer/transaction/driver.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index 9fcce97..2fd8e06 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -80,5 +80,6 @@ main () tracer::transaction t (db.begin_transaction ()); tracer::transaction& r (tracer::transaction::current ()); + assert (&t == &r); } } -- cgit v1.1 From 7b8192c9e9bfa3a228938e12daa222af3bbfa6f1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Aug 2010 13:46:57 +0200 Subject: Test language-embedded queries --- common/query/driver.cxx | 247 ++++++++++++++++++++++++++++++++++++++++++++---- common/query/makefile | 3 +- common/query/test.hxx | 30 +++++- common/query/test.std | 98 +++++++++++++++++-- common/query/traits.hxx | 58 ++++++++++++ 5 files changed, 406 insertions(+), 30 deletions(-) create mode 100644 common/query/traits.hxx diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 9a8300a..9c2f9ce 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -31,8 +31,12 @@ print (result& r) auto_ptr o (*i); cout << *o << endl; } + cout << endl; } +const char* names[] = { "John", "Jane", "Joe" }; +const char** names_end = names + sizeof (names)/sizeof (names[0]); + int main (int argc, char* argv[]) { @@ -40,17 +44,24 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + typedef odb::query query; + typedef odb::result result; + // // { - person p1 (1, "John", "Doe", 30); - person p2 (2, "Jane", "Doe", 29); - person p3 (3, "Joe", "Dirt", 31); + person p1 (1, "John", "Doe", 30, true); + person p2 (2, "Jane", "Doe", 29, true); + person p3 (3, "Joe", "Dirt", 31, false); + p3.middle_name_.reset (new string ("Squeaky")); + person p4 (4, "Johansen", "Johansen", 32, false); + p4.middle_name_.reset (new string ("J")); transaction t (db->begin_transaction ()); db->persist (p1); db->persist (p2); db->persist (p3); + db->persist (p4); t.commit (); } @@ -58,8 +69,6 @@ main (int argc, char* argv[]) // if (false) { - typedef odb::query query; - string name; unsigned short age; @@ -67,13 +76,16 @@ main (int argc, char* argv[]) db->query ("age = " + query::_val (age)); query age_q (query::_ref (age) + " = age"); - query name_q ("first_name = " + query::_val (name)); + query name_q ("first = " + query::_val (name)); query q (age_q + "AND" + name_q); db->query (q); db->query (age_q + "OR" + name_q + "OR" + "age < " + query::_ref (age)); + + query q1 (query::_val (name)); + q1 += " = first"; } // Select-all query. @@ -81,9 +93,9 @@ main (int argc, char* argv[]) cout << "test 001" << endl; { transaction t (db->begin_transaction ()); - result r (db->query ()); + result r (db->query ()); - for (result::iterator i (r.begin ()); i != r.end (); ++i) + for (result::iterator i (r.begin ()); i != r.end (); ++i) { person p; i.load (p); @@ -98,7 +110,7 @@ main (int argc, char* argv[]) cout << "test 002" << endl; { transaction t (db->begin_transaction ()); - result r (db->query ("ORDER BY age")); + result r (db->query ("ORDER BY age")); print (r); t.commit (); } @@ -108,13 +120,11 @@ main (int argc, char* argv[]) cout << "test 003" << endl; { transaction t (db->begin_transaction ()); - result r (db->query ("age >= 30 AND last_name = 'Doe'")); + result r (db->query ("age >= 30 AND last = 'Doe'")); print (r); t.commit (); } - typedef odb::query query; - // Value binding. // cout << "test 004" << endl; @@ -123,10 +133,10 @@ main (int argc, char* argv[]) const char* name = "Doe"; - result r ( + result r ( db->query ( "age >= " + query::_ref (30) + "AND" + - "last_name = " + query::_val (name))); + "last = " + query::_val (name))); print (r); t.commit (); @@ -142,11 +152,11 @@ main (int argc, char* argv[]) unsigned short age; query q ("age >= " + query::_ref (age) + "AND" + - "last_name = " + query::_ref (name)); + "last = " + query::_ref (name)); name = "Doe"; age = 30; - result r (db->query (q)); + result r (db->query (q)); print (r); name = "Dirt"; @@ -156,6 +166,211 @@ main (int argc, char* argv[]) t.commit (); } + + // + // Language-embedded queries. + // + + // Compilation tests. + // + if (false) + { + string name; + unsigned short age; + + // Column operators. + // + query q1 (query::married); + db->query (query::married); + db->query (query::married == true); + + //db->query (query::age); + + db->query (query::age == 30); + db->query (query::age == age); + db->query (query::age == query::_val (30)); + db->query (query::age == query::_val (age)); + db->query (query::age == query::_ref (age)); + //db->query (query::age == "123"); + //db->query ("123" == query::age); + //db->query (query::age == query::_val ("123")); + //db->query (query::age == query::_ref (name)); + db->query (query::last_name == "Doe"); + db->query (query::last_name == name); + db->query (query::last_name == query::_val ("Doe")); + db->query (query::last_name == query::_val (name)); + db->query (query::last_name == query::_ref (name)); + //db->query (query::last_name == 30); + //db->query (query::last_name == query::_val (30)); + //db->query (query::last_name == query::_ref (age)); + + db->query (query::last_name.is_null ()); + db->query (query::last_name.is_not_null ()); + + db->query (query::first_name == query::last_name); + + db->query (query::first_name.in ("John", "Jane")); + db->query (query::first_name.in_range (names, names_end)); + + // Query operators. + // + db->query (query::age == 30 && query::last_name == "Doe"); + db->query (query::age == 30 || query::last_name == "Doe"); + db->query (!(query::age == 30 || query::last_name == "Doe")); + db->query ((query::last_name == "Doe") + "ORDER BY age"); + } + + // Test is_null/is_not_null. + // + cout << "test 006" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query (query::middle_name.is_null ())); + print (r); + r = db->query (query::middle_name.is_not_null ()); + print (r); + t.commit (); + } + + // Test boolean columns. + // + cout << "test 007" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query (query::married)); + print (r); + r = db->query (!query::married); + print (r); + t.commit (); + } + + // Test implicit by-value, explicit by-value, and by-reference. + // + cout << "test 008" << endl; + { + string name ("Dirt"); + + transaction t (db->begin_transaction ()); + result r (db->query (query::last_name == "Doe")); + print (r); + r = db->query (query::last_name == query::_val (name)); + print (r); + query q (query::last_name == query::_ref (name)); + name = "Doe"; + r = db->query (q); + print (r); + t.commit (); + } + + // Test column operators (==, !=, <, >, <=, >=). + // + cout << "test 009" << endl; + { + transaction t (db->begin_transaction ()); + + // == + // + result r (db->query (query::last_name == "Doe")); + print (r); + + // != + // + r = db->query (query::last_name != "Doe"); + print (r); + + // < + // + r = db->query (query::age < 31); + print (r); + + // > + // + r = db->query (query::age > 30); + print (r); + + // <= + // + r = db->query (query::age <= 30); + print (r); + + // >= + // + r = db->query (query::age >= 31); + print (r); + + t.commit (); + } + + // Test query operators (&&, ||, (), !, +). + // + cout << "test 010" << endl; + { + transaction t (db->begin_transaction ()); + + // && + // + result r (db->query ( + query::last_name == "Doe" && query::age == 29)); + print (r); + + // || + // + r = db->query (query::last_name == "Doe" || query::age == 31); + print (r); + + // () + // + r = db->query ( + (query::last_name != "Doe" || query::age == 29) && query::married); + print (r); + + // != + // + r = db->query (!(query::last_name == "Doe")); + print (r); + + // + + // + r = db->query ((query::last_name == "Doe") + "ORDER BY age"); + print (r); + + t.commit (); + } + + // Test in/in_range. + // + cout << "test 011" << endl; + { + transaction t (db->begin_transaction ()); + + result r (db->query (query::first_name.in ("John", "Jane"))); + print (r); + + r = db->query (query::first_name.in_range (names, names_end)); + print (r); + + t.commit (); + } + + // Test column-to-column comparison. + // + cout << "test 012" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query (query::first_name == query::last_name)); + print (r); + t.commit (); + } + + // Test value_traits::type != value_traits::value_type. + // + cout << "test 013" << endl; + { + transaction t (db->begin_transaction ()); + result r (db->query (query::middle_name == "Squeaky")); + print (r); + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/query/makefile b/common/query/makefile index 276b948..f5726a1 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -34,7 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen): odb_options += --database $(db_id) --generate-schema \ +--hxx-prologue '\\\#include "traits.hxx"' $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) diff --git a/common/query/test.hxx b/common/query/test.hxx index a923458..34c489d 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -7,18 +7,26 @@ #define TEST_HXX #include +#include #include #include +typedef std::auto_ptr string_ptr; // @@ tmp + #pragma odb object struct person { person (unsigned long id, const std::string& fn, const std::string& ln, - unsigned short age) - : id_ (id), first_name_ (fn), last_name_ (ln), age_ (age) + unsigned short age, + bool married) + : id_ (id), + first_name_ (fn), + last_name_ (ln), + age_ (age), + married_ (married) { } @@ -29,15 +37,31 @@ struct person #pragma odb id unsigned long id_; + #pragma odb column ("first") std::string first_name_; + + #pragma odb column ("middle") type ("TEXT") + string_ptr middle_name_; + + #pragma odb column ("last") std::string last_name_; + unsigned short age_; + bool married_; }; inline std::ostream& operator<< (std::ostream& os, const person& p) { - return os << p.first_name_ << ' ' << p.last_name_ << ' ' << p.age_; + os << p.first_name_; + + if (p.middle_name_.get () != 0) + os << ' ' << *p.middle_name_; + + os << ' ' << p.last_name_ << ' ' << p.age_ << + (p.married_ ? " married" : " single"); + + return os; } #endif // TEST_HXX diff --git a/common/query/test.std b/common/query/test.std index 0235af1..e065765 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -1,15 +1,93 @@ test 001 -John Doe 30 -Jane Doe 29 -Joe Dirt 31 +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single test 002 -Jane Doe 29 -John Doe 30 -Joe Dirt 31 +Jane Doe 29 married +John Doe 30 married +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + test 003 -John Doe 30 +John Doe 30 married + test 004 -John Doe 30 +John Doe 30 married + test 005 -John Doe 30 -Joe Dirt 31 +John Doe 30 married + +Joe Squeaky Dirt 31 single + +test 006 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 007 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 008 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single + +John Doe 30 married +Jane Doe 29 married + +test 009 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 010 +Jane Doe 29 married + +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single + +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +Jane Doe 29 married +John Doe 30 married + +test 011 +John Doe 30 married +Jane Doe 29 married + +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single + +test 012 +Johansen J Johansen 32 single + +test 013 +Joe Squeaky Dirt 31 single + diff --git a/common/query/traits.hxx b/common/query/traits.hxx new file mode 100644 index 0000000..39d2ca4 --- /dev/null +++ b/common/query/traits.hxx @@ -0,0 +1,58 @@ +// file : common/query/traits.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include +#include + +#include + +namespace odb +{ + namespace mysql + { + template <> + class value_traits > + { + public: + typedef std::auto_ptr type; + typedef std::string value_type; + static const image_id_type image_id = id_string; + + static void + set_value (std::auto_ptr& v, + const char* s, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (s, n)); + } + + static void + set_image (odb::buffer& b, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX -- cgit v1.1 From 9da1e93b22dc23bb31aa502b82fb7ff999cff879 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Aug 2010 15:35:57 +0200 Subject: Add the --generate-query option --- common/query/makefile | 2 +- mysql/types/makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/query/makefile b/common/query/makefile index f5726a1..5389d55 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen): odb_options += --database $(db_id) --generate-schema \ ---hxx-prologue '\\\#include "traits.hxx"' +--generate-query --hxx-prologue '\\\#include "traits.hxx"' $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/types/makefile b/mysql/types/makefile index bf23a69..c7c8742 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -41,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen): odb_options += --database $(db_id) --generate-schema \ ---cxx-prologue '\\\#include "traits.hxx"' +--generate-query --cxx-prologue '\\\#include "traits.hxx"' $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From fad897c8f3239f6594bd379e42166dc9a528e210 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Aug 2010 11:46:35 +0200 Subject: Test pointer guard in query result --- common/query/driver.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 9c2f9ce..cb19859 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -111,7 +111,19 @@ main (int argc, char* argv[]) { transaction t (db->begin_transaction ()); result r (db->query ("ORDER BY age")); - print (r); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + cout << i->first_name_; + + if (i->middle_name_.get () != 0) + cout << ' ' << *i->middle_name_; + + cout << ' ' << i->last_name_ << ' ' << i->age_ << + (i->married_ ? " married" : " single") << endl; + } + cout << endl; + t.commit (); } -- cgit v1.1 From e0750fbbc76732b3e8aa83ce786c28fcbf24374d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 17:57:38 +0200 Subject: Add multi-threading test --- common/makefile | 2 + common/threads/driver.cxx | 146 ++++++++++++++++++++++++++++++++++++++++++++++ common/threads/makefile | 82 ++++++++++++++++++++++++++ common/threads/test.hxx | 31 ++++++++++ common/threads/test.std | 0 5 files changed, 261 insertions(+) create mode 100644 common/threads/driver.cxx create mode 100644 common/threads/makefile create mode 100644 common/threads/test.hxx create mode 100644 common/threads/test.std diff --git a/common/makefile b/common/makefile index ad3b0a4..87488be 100644 --- a/common/makefile +++ b/common/makefile @@ -11,6 +11,8 @@ template \ lifecycle \ query +tests += threads + default := $(out_base)/ test := $(out_base)/.test clean := $(out_base)/.clean diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx new file mode 100644 index 0000000..9ae5b50 --- /dev/null +++ b/common/threads/driver.cxx @@ -0,0 +1,146 @@ +// file : common/threads/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test operations in a multi-threaded environment. +// + +#include +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +using odb::shared_ptr; +using odb::details::thread; + +const size_t thread_count = 32; +const size_t iteration_count = 100; + +struct task +{ + task (database& db, size_t n) + : db_ (db), n_ (n) + { + } + + void + execute () + { + try + { + for (size_t i (0); i < iteration_count; ++i) + { + unsigned long id ((n_ * iteration_count + i) * 3); + + { + object o1 (id, "frist object"); + object o2 (id + 1, "second object"); + object o3 (id + 2, "third object"); + + transaction t (db_.begin_transaction ()); + db_.persist (o1); + db_.persist (o2); + db_.persist (o3); + t.commit (); + } + + { + transaction t (db_.begin_transaction ()); + auto_ptr o (db_.load (id)); + assert (o->str_ == "frist object"); + o->str_ = "another value"; + db_.store (*o); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db_.begin_transaction ()); + result r (db_.query (query::str == "another value")); + + bool found (false); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->id_ == id) + { + found = true; + break; + } + } + assert (found); + t.commit (); + } + + { + transaction t (db_.begin_transaction ()); + db_.erase (id); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + } + } + + static void* + execute (void* arg) + { + static_cast (arg)->execute (); + return 0; + } + + database& db_; + size_t n_; +}; + + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + vector > threads; + vector > tasks; + + for (size_t i (0); i < thread_count; ++i) + { + shared_ptr t (new (shared) task (*db, i)); + tasks.push_back (t); + + threads.push_back ( + shared_ptr ( + new (shared) thread (&task::execute, t.get ()))); + } + + for (size_t i (0); i < thread_count; ++i) + threads[i]->join (); + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } + + // pthread_exit (0); +} diff --git a/common/threads/makefile b/common/threads/makefile new file mode 100644 index 0000000..af03a93 --- /dev/null +++ b/common/threads/makefile @@ -0,0 +1,82 @@ +# file : common/threads/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema --generate-query +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/threads/test.hxx b/common/threads/test.hxx new file mode 100644 index 0000000..d02fdfd --- /dev/null +++ b/common/threads/test.hxx @@ -0,0 +1,31 @@ +// file : common/template/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma odb object +struct object +{ + object (unsigned long id, const std::string& str) + : id_ (id), str_ (str) + { + } + + object () + { + } + + #pragma odb id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/common/threads/test.std b/common/threads/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From b41056d73ee0c2ba29649932625d620434350a9f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 18:01:37 +0200 Subject: Cosmetic changes --- common/lifecycle/driver.cxx | 2 -- common/query/driver.cxx | 2 -- common/schema/driver.cxx | 2 -- common/template/driver.cxx | 2 -- mysql/template/driver.cxx | 2 -- mysql/truncation/driver.cxx | 2 -- mysql/types/driver.cxx | 2 -- 7 files changed, 14 deletions(-) diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 4b43129..ef5a4aa 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { diff --git a/common/query/driver.cxx b/common/query/driver.cxx index cb19859..2573d7e 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - void print (result& r) { diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index 1cc6be9..2647d8c 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 0aaa228..08e4196 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 76a41bb..4f1bb52 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index f94205e..2117a9e 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 1221d5c..d8b8d21 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -21,8 +21,6 @@ using namespace std; using namespace odb; -using odb::shared_ptr; - int main (int argc, char* argv[]) { -- cgit v1.1 From a5e7a049052324e34cb7d163333f6e449065c5af Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 18:27:00 +0200 Subject: Move buffer to the details namespace --- common/query/traits.hxx | 2 +- mysql/types/driver.cxx | 6 +++--- mysql/types/traits.hxx | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/query/traits.hxx b/common/query/traits.hxx index 39d2ca4..dbef5ac 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -33,7 +33,7 @@ namespace odb } static void - set_image (odb::buffer& b, + set_image (details::buffer& b, std::size_t& n, bool& is_null, const std::auto_ptr& v) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index d8b8d21..e0d6b42 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -53,11 +53,11 @@ main (int argc, char* argv[]) o.year_ = 2010; string short_str (128, 's'); - ::buffer short_buf (short_str.c_str (), short_str.size ()); + buffer short_buf (short_str.c_str (), short_str.size ()); string medium_str (250, 'm'); - ::buffer medium_buf (medium_str.c_str (), medium_str.size ()); + buffer medium_buf (medium_str.c_str (), medium_str.size ()); string long_str (2040, 'l'); - ::buffer long_buf (long_str.c_str (), long_str.size ()); + buffer long_buf (long_str.c_str (), long_str.size ()); o.char_ = short_str; o.binary_ = short_buf; diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 1aea637..d113e7d 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -56,14 +56,14 @@ namespace odb }; template <> - class value_traits< ::buffer > + class value_traits { public: - typedef ::buffer type; - typedef ::buffer value_type; + typedef buffer type; + typedef buffer value_type; static void - set_value (type& v, const char* s, std::size_t n, bool is_null) + set_value (buffer& v, const char* s, std::size_t n, bool is_null) { if (!is_null) v.assign (s, n); @@ -76,7 +76,7 @@ namespace odb std::size_t c, std::size_t& n, bool& is_null, - const type& v) + const buffer& v) { is_null = false; n = v.size (); @@ -89,10 +89,10 @@ namespace odb } static void - set_image (odb::buffer& b, + set_image (details::buffer& b, std::size_t& n, bool& is_null, - const type& v) + const buffer& v) { is_null = false; n = v.size (); @@ -171,7 +171,7 @@ namespace odb } static void - set_image (odb::buffer& buf, + set_image (details::buffer& buf, std::size_t& n, bool& is_null, const set& v) @@ -212,7 +212,7 @@ namespace odb } static void - set_image (odb::buffer& b, + set_image (details::buffer& b, std::size_t& n, bool& is_null, const std::auto_ptr& v) -- cgit v1.1 From bc95a07e6ecd388b4ef485f218aa1211d36e0e53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Aug 2010 20:04:09 +0200 Subject: Move shared_ptr to the details namespace --- common/threads/driver.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 9ae5b50..c883bba 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -25,8 +25,9 @@ using namespace std; using namespace odb; -using odb::shared_ptr; -using odb::details::thread; +using details::shared; +using details::shared_ptr; +using details::thread; const size_t thread_count = 32; const size_t iteration_count = 100; -- cgit v1.1 From b59214c08549043cb5812c025159c49d6f9efe01 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Aug 2010 11:25:20 +0200 Subject: Test automatic id assignment --- common/auto/driver.cxx | 69 ++++++++++++++++++++++++++++++++++++++++++ common/auto/makefile | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ common/auto/test.hxx | 33 ++++++++++++++++++++ common/auto/test.std | 0 common/makefile | 1 + 5 files changed, 185 insertions(+) create mode 100644 common/auto/driver.cxx create mode 100644 common/auto/makefile create mode 100644 common/auto/test.hxx create mode 100644 common/auto/test.std diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx new file mode 100644 index 0000000..423254e --- /dev/null +++ b/common/auto/driver.cxx @@ -0,0 +1,69 @@ +// file : common/auto/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test automatic id assignment. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + unsigned long id1, id2, id3; + { + object o1 ("one"); + object o2 ("two"); + object o3 ("three"); + + transaction t (db->begin_transaction ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = o1.id_; + id2 = o2.id_; + id3 = o3.id_; + + assert (id1 != id2); + assert (id1 != id3); + assert (id2 != id3); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o1 (db->load (id1)); + auto_ptr o2 (db->load (id2)); + auto_ptr o3 (db->load (id3)); + t.commit (); + + assert (o1->id_ == id1 && o1->str_ == "one"); + assert (o2->id_ == id2 && o2->str_ == "two"); + assert (o3->id_ == id3 && o3->str_ == "three"); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/auto/makefile b/common/auto/makefile new file mode 100644 index 0000000..31c7efb --- /dev/null +++ b/common/auto/makefile @@ -0,0 +1,82 @@ +# file : common/auto/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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.l +common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options + +driver := $(out_base)/driver +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) +$(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): odb_options += --database $(db_id) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/auto/test.hxx b/common/auto/test.hxx new file mode 100644 index 0000000..c23027e --- /dev/null +++ b/common/auto/test.hxx @@ -0,0 +1,33 @@ +// file : common/auto/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma odb object +struct object +{ + object (const std::string& str) + : id_ (1), str_ (str) + { + } + + #pragma odb auto id + unsigned long id_; + std::string str_; + +private: + object () + { + } + + friend class odb::access; +}; + +#endif // TEST_HXX diff --git a/common/auto/test.std b/common/auto/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 87488be..1e56ecb 100644 --- a/common/makefile +++ b/common/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ +auto \ schema \ template \ lifecycle \ -- cgit v1.1 From a89b75a7f5c03ce10ff426b06dec63f9f5402635 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Aug 2010 17:08:10 +0200 Subject: Cosmetic change --- common/query/test.hxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/query/test.hxx b/common/query/test.hxx index 34c489d..59655f6 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -12,8 +12,6 @@ #include -typedef std::auto_ptr string_ptr; // @@ tmp - #pragma odb object struct person { @@ -40,6 +38,7 @@ struct person #pragma odb column ("first") std::string first_name_; + typedef std::auto_ptr string_ptr; // @@ tmp #pragma odb column ("middle") type ("TEXT") string_ptr middle_name_; -- cgit v1.1 From 1d2a288f2f9ae248b1e39ba7ecf7710adc718773 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Aug 2010 09:59:56 +0200 Subject: Remove unused header inclusion --- tracer/object/test.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/tracer/object/test.hxx b/tracer/object/test.hxx index d640e75..dfa6603 100644 --- a/tracer/object/test.hxx +++ b/tracer/object/test.hxx @@ -6,7 +6,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include #include #pragma odb object -- cgit v1.1 From 18e5490a1d36da346b079497bfb410edd6dd5ab8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Aug 2010 10:00:34 +0200 Subject: Test C++ type handling (anonymous types, aliasing) --- tracer/makefile | 3 +- tracer/types/driver.cxx | 35 +++++++++++++++++++++ tracer/types/makefile | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ tracer/types/test.hxx | 34 +++++++++++++++++++++ tracer/types/test.std | 0 5 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 tracer/types/driver.cxx create mode 100644 tracer/types/makefile create mode 100644 tracer/types/test.hxx create mode 100644 tracer/types/test.std diff --git a/tracer/makefile b/tracer/makefile index 41368ea..03b8747 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -7,7 +7,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ object \ -transaction +transaction \ +types default := $(out_base)/ test := $(out_base)/.test diff --git a/tracer/types/driver.cxx b/tracer/types/driver.cxx new file mode 100644 index 0000000..3b28480 --- /dev/null +++ b/tracer/types/driver.cxx @@ -0,0 +1,35 @@ +// file : tracer/types/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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; + +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 new file mode 100644 index 0000000..382d1b5 --- /dev/null +++ b/tracer/types/makefile @@ -0,0 +1,81 @@ +# file : tracer/types/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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 +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) +$(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): odb_options += --database tracer +$(gen): cpp_options := -I$(out_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) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< | diff -u $(src_base)/test.std -) + +# 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)) + +# 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/types/test.hxx b/tracer/types/test.hxx new file mode 100644 index 0000000..965f133 --- /dev/null +++ b/tracer/types/test.hxx @@ -0,0 +1,34 @@ +// file : tracer/types/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 odb object +struct object1 +{ + typedef int int_type; + + #pragma odb id + int_type id_; +}; + +#pragma odb object +struct object2 +{ + #pragma odb id + num_type num_; +}; + +#endif // TEST_HXX diff --git a/tracer/types/test.std b/tracer/types/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 0f9123ae095d3da7f2fb55d95af49ec3aa0a9c17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Sep 2010 16:22:33 +0200 Subject: Add missing include --- common/query/traits.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/query/traits.hxx b/common/query/traits.hxx index dbef5ac..125929c 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -7,7 +7,8 @@ #define TRAITS_HXX #include -#include +#include // std::auto_ptr +#include // std::memcpy #include -- cgit v1.1 From 921c4c14c2999a03b9e649b5c9adec73b5cae0de Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 Sep 2010 14:26:25 +0200 Subject: Add automake build support --- Makefile.am | 13 +++ README | 0 bootstrap | 18 +++ build/bootstrap.make | 14 ++- build/mysql/configure | 2 +- common/Makefile.am | 10 ++ common/auto/makefile | 14 ++- common/lifecycle/makefile | 14 ++- common/makefile | 26 ++++- common/query/makefile | 17 ++- common/schema/makefile | 14 ++- common/template/Makefile.am | 24 ++++ common/template/makefile | 14 ++- common/threads/makefile | 15 ++- configure.ac | 67 +++++++++++ libcommon/Makefile.am | 12 ++ libcommon/common.cxx | 4 + libcommon/common.hxx | 4 +- libcommon/config.h.in | 15 +++ libcommon/export.hxx | 39 +++++++ libcommon/makefile | 53 +++++++-- m4/acx-pthread.m4 | 254 +++++++++++++++++++++++++++++++++++++++++ m4/database.m4 | 41 +++++++ m4/diff.m4 | 55 +++++++++ m4/libodb-mysql.m4 | 84 ++++++++++++++ m4/libodb-tracer.m4 | 84 ++++++++++++++ m4/libodb.m4 | 83 ++++++++++++++ m4/libtool-link.m4 | 31 +++++ m4/mysql.m4 | 270 ++++++++++++++++++++++++++++++++++++++++++++ m4/odb.m4 | 45 ++++++++ m4/static-lib.m4 | 19 ++++ m4/threads.m4 | 41 +++++++ makefile | 45 ++++++-- mysql/Makefile.am | 6 + mysql/makefile | 12 +- mysql/template/Makefile.am | 27 +++++ mysql/template/makefile | 13 ++- mysql/truncation/makefile | 13 ++- mysql/types/makefile | 17 ++- mysql/types/test.mk | 4 + tester.in | 31 +++++ tracer/Makefile.am | 6 + tracer/makefile | 9 ++ tracer/object/makefile | 13 ++- tracer/template/Makefile.am | 25 ++++ tracer/template/driver.cxx | 35 ++++++ tracer/template/makefile | 92 +++++++++++++++ tracer/template/test.hxx | 27 +++++ tracer/template/test.std | 3 + tracer/transaction/makefile | 11 ++ tracer/types/makefile | 13 ++- 51 files changed, 1754 insertions(+), 44 deletions(-) create mode 100644 Makefile.am create mode 100644 README create mode 100755 bootstrap create mode 100644 common/Makefile.am create mode 100644 common/template/Makefile.am create mode 100644 configure.ac create mode 100644 libcommon/Makefile.am create mode 100644 libcommon/config.h.in create mode 100644 libcommon/export.hxx create mode 100644 m4/acx-pthread.m4 create mode 100644 m4/database.m4 create mode 100644 m4/diff.m4 create mode 100644 m4/libodb-mysql.m4 create mode 100644 m4/libodb-tracer.m4 create mode 100644 m4/libodb.m4 create mode 100644 m4/libtool-link.m4 create mode 100644 m4/mysql.m4 create mode 100644 m4/odb.m4 create mode 100644 m4/static-lib.m4 create mode 100644 m4/threads.m4 create mode 100644 mysql/Makefile.am create mode 100644 mysql/template/Makefile.am create mode 100644 mysql/types/test.mk create mode 100755 tester.in create mode 100644 tracer/Makefile.am create mode 100644 tracer/template/Makefile.am create mode 100644 tracer/template/driver.cxx create mode 100644 tracer/template/makefile create mode 100644 tracer/template/test.hxx create mode 100644 tracer/template/test.std diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..600707e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,13 @@ +# file : Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = libcommon tracer common + +if DB_ID_MYSQL +SUBDIRS += mysql +endif + +EXTRA_DIST = __file__(extra_dist) +ACLOCAL_AMFLAGS = -I m4 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..ceb2ea7 --- /dev/null +++ b/bootstrap @@ -0,0 +1,18 @@ +#! /bin/sh + +# file : bootstrap +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# Bootstrap the automake build system. +# + +rm -f config.cache + +if test ! -d m4; then + mkdir m4 +fi + +autoreconf --install diff --git a/build/bootstrap.make b/build/bootstrap.make index 12d3425..59a62a2 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -32,17 +32,27 @@ $(call include,$(bld_root)/cxx/configuration.make) # .PHONY: $(out_base)/ \ $(out_base)/.test \ + $(out_base)/.dist \ $(out_base)/.clean ifdef %interactive% -.PHONY: test clean +.PHONY: test dist clean -test: $(out_base)/.test +test: $(out_base)/.test +dist: $(out_base)/.dist clean: $(out_base)/.clean endif +# Make sure the distribution prefix is set if the goal is dist. +# +ifneq ($(filter $(MAKECMDGOALS),dist),) +ifeq ($(dist_prefix),) +$(error dist_prefix is not set) +endif +endif + # If we don't have dependency auto-generation then we need to manually # make sure that ODB files are generated before C++ file are compiler. # To do this we make the object files ($2) depend in order-only on diff --git a/build/mysql/configure b/build/mysql/configure index e4bae87..c1d6382 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -39,7 +39,7 @@ $echo $echo "Please enter the MySQL database host." $echo -host=`read_value "localhost"` +host=`read_value ""` $echo $echo "Please enter the MySQL database port." diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000..a526e4c --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,10 @@ +# file : common/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) + +if ODB_TESTS_THREADS +SUBDIRS += __path__(thread_dirs) +endif diff --git a/common/auto/makefile b/common/auto/makefile index 31c7efb..b39759a 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -44,6 +45,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/common/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -72,6 +81,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 21278fc..73cc2e4 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -44,6 +45,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/common/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -72,6 +81,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/common/makefile b/common/makefile index 1e56ecb..ef085e9 100644 --- a/common/makefile +++ b/common/makefile @@ -12,14 +12,30 @@ template \ lifecycle \ query -tests += threads +thread_tests := threads + +all_tests := $(tests) $(thread_tests) +build_tests := $(tests) $(thread_tests) default := $(out_base)/ +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) + +$(dist): export dirs := $(tests) +$(dist): export thread_dirs := $(thread_tests) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) + $(call meta-automake) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) + +$(call include,$(bld_root)/dist.make) -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) +else +$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) +endif diff --git a/common/query/makefile b/common/query/makefile index 5389d55..27e19e8 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,8 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema \ ---generate-query --hxx-prologue '\\\#include "traits.hxx"' +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--generate-query --hxx-prologue '\#include "traits.hxx"' $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -45,6 +46,15 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) traits.hxx test.std +$(dist): export extra_headers := traits.hxx +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/common/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -73,6 +83,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/common/schema/makefile b/common/schema/makefile index 29cca5f..de22c01 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -44,6 +45,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/common/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -72,6 +81,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/common/template/Makefile.am b/common/template/Makefile.am new file mode 100644 index 0000000..b2fc122 --- /dev/null +++ b/common/template/Makefile.am @@ -0,0 +1,24 @@ +# file : common/template/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +noinst_PROGRAMS = driver +driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) +driver_LDADD = $(top_builddir)/libcommon/libcommon.la +driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); + +# ODB compilation. +# +driver_SOURCES += test.hxx test-odb.cxx +BUILT_SOURCES = test-odb.hxx +CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx + +ODB = @ODB@ +ODBFLAGS = @ODBFLAGS@ + +test-odb.hxx: test.hxx + $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< diff --git a/common/template/makefile b/common/template/makefile index c963659..cdc8f91 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -44,6 +45,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -72,6 +81,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/common/threads/makefile b/common/threads/makefile index af03a93..6a8c802 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -34,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema --generate-query +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--generate-query $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -44,6 +46,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): db_id := @database@ +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/common/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -72,6 +82,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..bdc5afa --- /dev/null +++ b/configure.ac @@ -0,0 +1,67 @@ +# file : configure.ac +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +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]) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) + +LT_INIT([win32-dll]) + +AC_CANONICAL_HOST + +# Check for C++ compiler and use it to compile the tests. +# +AC_PROG_CXX +AC_LANG(C++) + +# Create the libtool executable so that we can use it in further tests. +# +LT_OUTPUT + +# Check for threads. +# +THREADS + +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 which database we are using. +# +DATABASE + +case $database in + mysql) + LIBODB_MYSQL([], [AC_MSG_ERROR([libodb-mysql is not found; consider using --with-libodb-mysql=DIR])]) + MYSQL + ;; +esac + +# Check for the ODB compiler. +# +ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) + +# Check for diff. +# +DIFF_TOOL + +# Define LIBCOMMON_STATIC_LIB if we are build static library on certain +# platforms. +# +STATIC_LIB([LIBCOMMON_STATIC_LIB], [Static library interface.]) + +# Output. +# +AC_CONFIG_HEADERS([config.h libcommon/config.h]) +AC_CONFIG_FILES([__path__(config_files)]) +AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester]) +AC_OUTPUT diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am new file mode 100644 index 0000000..d42cff2 --- /dev/null +++ b/libcommon/Makefile.am @@ -0,0 +1,12 @@ +# file : libcommon/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +noinst_LTLIBRARIES = libcommon.la +libcommon_la_SOURCES = __path__(sources) __path__(headers) + +EXTRA_DIST = __file__(extra_dist) + +libcommon_la_CPPFLAGS= -I'$(builddir)' -I'$(srcdir)' -DLIBCOMMON_DYNAMIC_LIB +libcommon_la_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/libcommon/common.cxx b/libcommon/common.cxx index bfc3482..0c88818 100644 --- a/libcommon/common.cxx +++ b/libcommon/common.cxx @@ -6,6 +6,10 @@ #include // std::exit #include +#ifndef _MSC_VER +# include +#endif + #ifdef DB_ID_MYSQL # include #endif diff --git a/libcommon/common.hxx b/libcommon/common.hxx index 8e5bd4d..411ece5 100644 --- a/libcommon/common.hxx +++ b/libcommon/common.hxx @@ -10,7 +10,9 @@ #include -std::auto_ptr +#include + +LIBCOMMON_EXPORT std::auto_ptr create_database (int argc, char* argv[]); #endif // LIBCOMMON_COMMON_HXX diff --git a/libcommon/config.h.in b/libcommon/config.h.in new file mode 100644 index 0000000..9d18901 --- /dev/null +++ b/libcommon/config.h.in @@ -0,0 +1,15 @@ +/* file : libcommon/config.h.in + * author : Boris Kolpackov + * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* This file is automatically processed by configure. */ + +#ifndef LIBCOMMON_CONFIG_H +#define LIBCOMMON_CONFIG_H + +#undef DB_ID_MYSQL +#undef LIBCOMMON_STATIC_LIB + +#endif /* LIBCOMMON_CONFIG_H */ diff --git a/libcommon/export.hxx b/libcommon/export.hxx new file mode 100644 index 0000000..8bbb96c --- /dev/null +++ b/libcommon/export.hxx @@ -0,0 +1,39 @@ +// file : libcommon/export.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_EXPORT_HXX +#define LIBCOMMON_EXPORT_HXX + +#ifndef _MSC_VER +# include +#endif + +#ifdef LIBCOMMON_STATIC_LIB +# define LIBCOMMON_EXPORT +#else +# ifdef _WIN32 +# ifdef _MSC_VER +# ifdef LIBCOMMON_DYNAMIC_LIB +# define LIBCOMMON_EXPORT __declspec(dllexport) +# else +# define LIBCOMMON_EXPORT __declspec(dllimport) +# endif +# else +# ifdef LIBCOMMON_DYNAMIC_LIB +# ifdef DLL_EXPORT +# define LIBCOMMON_EXPORT __declspec(dllexport) +# else +# define LIBCOMMON_EXPORT +# endif +# else +# define LIBCOMMON_EXPORT __declspec(dllimport) +# endif +# endif +# else +# define LIBCOMMON_EXPORT +# endif +#endif + +#endif // LIBCOMMON_EXPORT_HXX diff --git a/libcommon/makefile b/libcommon/makefile index 44c789a..cdb57bc 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -16,8 +16,9 @@ cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_base)/common.l common.l.cpp-options := $(out_base)/common.l.cpp-options -default := $(out_base)/ -clean := $(out_base)/.clean +default := $(out_base)/ +dist := $(out_base)/.dist +clean := $(out_base)/.clean # Import. # @@ -43,14 +44,10 @@ endif # $(common.l): $(cxx_obj) $(odb.l) $(odb_db.l) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) -$(common.l.cpp-options): value := -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h +$(common.l.cpp-options): value := -I$(out_base) -I$(src_base) $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) -ifeq ($(db_id),mysql) -$(cxx_obj): cpp_options += -DDB_ID_MYSQL -endif - genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) gen := $(addprefix $(out_base)/,$(genf)) @@ -63,19 +60,59 @@ $(gen): cli_options += \ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) +$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make + @echo '// file : libcommon/config.h' >$@ + @echo '// author : automatically generated' >>$@ + @echo '' >>$@ + @echo '#ifndef LIBCOMMON_CONFIG_H' >>$@ + @echo '#define LIBCOMMON_CONFIG_H' >>$@ + @echo '' >>$@ +ifeq ($(db_id),mysql) + @echo '#define DB_ID_MYSQL 1' >>$@ +endif + @echo '' >>$@ + @echo '#endif // LIBCOMMON_CONFIG_H' >>$@ + # Convenience alias for default target. # $(out_base)/: $(common.l) +# Dist. +# +$(dist): export sources := $(cxx_tun) $(cli_tun:.cli=.cxx) +$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ +-name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) +$(dist): data_dist := $(cli_tun) +$(dist): export extra_dist := $(data_dist) + +$(dist): $(gen) + $(call dist-data,$(sources) $(headers) $(data_dist) config.h.in) + $(call meta-automake) + # Clean. # $(clean): $(common.l).o.clean \ $(common.l.cpp-options).clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) + $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(common.l): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := config.h +$(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/automake.make) + $(call include,$(cli_rules)) $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 new file mode 100644 index 0000000..feeb01d --- /dev/null +++ b/m4/acx-pthread.m4 @@ -0,0 +1,254 @@ +dnl +dnl NOTE: This file was modified. See the comments starting with 'CS:' +dnl for more information. In particular, it was changed to use C++ +dnl instead of C. +dnl +dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl @summary figure out how to build C++ programs using POSIX threads +dnl +dnl This macro figures out how to build C++ programs using POSIX threads. +dnl It sets the PTHREAD_LIBS output variable to the threads library and +dnl linker flags, and the PTHREAD_CXXFLAGS output variable to any special +dnl C++ compiler flags that are needed. (The user can also force certain +dnl compiler flags/libs to be tested by setting these environment +dnl variables.) +dnl +dnl Also sets PTHREAD_CXX to any special C++ compiler that is needed for +dnl multi-threaded programs (defaults to the value of CXX otherwise). +dnl (This is necessary on AIX to use the special xlC_r compiler alias.) +dnl +dnl NOTE: You are assumed to not only compile your program with these +dnl flags, but also link it with them as well. e.g. you should link +dnl with $PTHREAD_CXX $CXXFLAGS $PTHREAD_CXXFLAGS $LDFLAGS ... $PTHREAD_LIBS +dnl $LIBS +dnl +dnl If you are only building threads programs, you may wish to use +dnl these variables in your default LIBS, CXXFLAGS, and CXX: +dnl +dnl LIBS="$PTHREAD_LIBS $LIBS" +dnl CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" +dnl CXX="$PTHREAD_CXX" +dnl +dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to +dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a threads +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to +dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the +dnl default action will define HAVE_PTHREAD. +dnl +dnl Please let the authors know if this macro fails on any platform, or +dnl if you have any other suggestions or comments. This macro was based +dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with +dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros +dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. +dnl We are also grateful for the helpful feedback of numerous users. +dnl +dnl @category InstalledPackages +dnl @author Steven G. Johnson +dnl @version 2006-05-29 +dnl @license GPLWithACException + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG(C++) +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CXXFLAGS="" + fi + LIBS="$save_LIBS" + CXXFLAGS="$save_CXXFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +# CS: On GNU/Linux with gcc both -pthread and -lpthread are valid. +# However, libtool links libraries with -nostdlib which results in +# -pthread being stripped from the linker command line. To resolve +# this we move pthread from after -mthreads to after pthreads. +# +acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CXXFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CXXFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CXXFLAGS="$CXXFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + # + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0);], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CXXFLAGS="$save_CXXFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CXXFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + +dnl # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. +dnl AC_MSG_CHECKING([for joinable pthread attribute]) +dnl attr_name=unknown +dnl for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do +dnl AC_TRY_LINK([#include ], [int attr=$attr; return attr;], +dnl [attr_name=$attr; break]) +dnl done +dnl AC_MSG_RESULT($attr_name) +dnl if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then +dnl AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, +dnl [Define to necessary symbol if this constant +dnl uses a non-standard name on your system.]) +dnl fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS" + fi + + LIBS="$save_LIBS" + CXXFLAGS="$save_CXXFLAGS" + +dnl # More AIX lossage: must compile with xlC_r +dnl if test x"$GXX" != xyes; then +dnl AC_CHECK_PROGS(PTHREAD_CXX, xlC_r, ${CXX}) +dnl else +dnl PTHREAD_CXX=$CXX +dnl fi + +else + PTHREAD_CXX="$CXX" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CXXFLAGS) +AC_SUBST(PTHREAD_CXX) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff --git a/m4/database.m4 b/m4/database.m4 new file mode 100644 index 0000000..8fca493 --- /dev/null +++ b/m4/database.m4 @@ -0,0 +1,41 @@ +dnl file : m4/database.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl DATABASE +dnl +AC_DEFUN([DATABASE], [ +database=none + +AC_MSG_CHECKING([for database to use]) + +AC_ARG_WITH( + [database], + [AC_HELP_STRING([--with-database=db], + [database to use for tests; valid values are: 'mysql'])], + [case $withval in + no | yes) + AC_MSG_RESULT([]) + AC_MSG_ERROR([no database specified in the --with-database option]) + ;; + mysql) + database=mysql + AC_DEFINE([DB_ID_MYSQL], [1], [Using MySQL.]) + ;; + *) + AC_MSG_RESULT([]) + AC_MSG_ERROR([unknown database $withval]) + ;; + esac], + [ + AC_MSG_RESULT([]) + AC_MSG_ERROR([no database specified with the --with-database option]) + ]) + +AC_MSG_RESULT([$database]) +AC_SUBST([database]) + +AM_CONDITIONAL([DB_ID_MYSQL], [test x$database = xmysql]) + +])dnl diff --git a/m4/diff.m4 b/m4/diff.m4 new file mode 100644 index 0000000..5401748 --- /dev/null +++ b/m4/diff.m4 @@ -0,0 +1,55 @@ +dnl file : m4/diff.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl DIFF_TOOL +dnl +AC_DEFUN([DIFF_TOOL], [ +diff_found=no + +AC_ARG_VAR([DIFF],[diff command]) +AC_ARG_VAR([DIFFFLAGS],[diff flags]) + +AC_ARG_WITH( + [diff], + [AC_HELP_STRING([--with-diff=PATH],[path to the diff program])], + [diff_path=${withval}], + [diff_path=]) + +AC_MSG_CHECKING([for diff]) + +if test x"$DIFF" = x; then + if test x"$diff_path" != x; then + AS_SET_CATFILE([abs_diff_path], [$ac_pwd], [$diff_path]) + DIFF="$abs_diff_path" + else + DIFF=diff + fi +fi + +cat >conftest.txt + +$DIFF conftest.txt conftest.txt 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$DIFF]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([diff command is not found; consider setting the DIFF variable or using --with-diff=PATH]) +fi + +AC_MSG_CHECKING([whether $DIFF accepts -u]) + +$DIFF -u conftest.txt conftest.txt 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([yes]) + DIFFFLAGS="$DIFFFLAGS -u" +else + AC_MSG_RESULT([no]) +fi + +rm -f conftest.txt + +])dnl diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 new file mode 100644 index 0000000..13e3ff3 --- /dev/null +++ b/m4/libodb-mysql.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-mysql.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_MYSQL], [ +libodb_mysql_found=no + +AC_ARG_WITH( + [libodb-mysql], + [AC_HELP_STRING([--with-libodb-mysql=DIR],[location of libodb-mysql build directory])], + [libodb_mysql_dir=${withval}], + [libodb_mysql_dir=]) + +AC_MSG_CHECKING([for libodb-mysql]) + +# If libodb_mysql_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_mysql_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_mysql_dir], [$ac_pwd], [$libodb_mysql_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_mysql_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_mysql_dir/odb/mysql" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-mysql $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::mysql::database_exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_mysql_found=yes]) + +if test x"$libodb_mysql_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_mysql_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_mysql_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/libodb-tracer.m4 b/m4/libodb-tracer.m4 new file mode 100644 index 0000000..bd7a371 --- /dev/null +++ b/m4/libodb-tracer.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-tracer.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 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/m4/libodb.m4 b/m4/libodb.m4 new file mode 100644 index 0000000..a205afd --- /dev/null +++ b/m4/libodb.m4 @@ -0,0 +1,83 @@ +dnl file : m4/libodb.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB], [ +libodb_found=no + +AC_ARG_WITH( + [libodb], + [AC_HELP_STRING([--with-libodb=DIR],[location of libodb build directory])], + [libodb_dir=${withval}], + [libodb_dir=]) + +AC_MSG_CHECKING([for libodb]) + +# If libodb_dir was given, add the necessary preprocessor and linker flags. +# +if test x"$libodb_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_dir], [$ac_pwd], [$libodb_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_dir/odb" +fi + +save_LIBS="$LIBS" +LIBS="-lodb $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_found=yes]) + +if test x"$libodb_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 new file mode 100644 index 0000000..229b270 --- /dev/null +++ b/m4/libtool-link.m4 @@ -0,0 +1,31 @@ +dnl file : m4/libtool-link.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl +dnl CXX_LIBTOOL_LINK_IFELSE (input, [action-if-true], [action-if-false]) +dnl +dnl Similar to AC_LINK_IFELSE except it uses libtool to perform the +dnl linking and it does this using the C++ compiler. +dnl +AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[ +AC_LANG_SAVE +save_CXX="$CXX" +CXX="./libtool --tag=CXX --mode=link $CXX -no-install" +AC_LANG(C++) + +if test -d .libs; then + delete_libs_dir=no +else + delete_libs_dir=yes +fi + +AC_LINK_IFELSE([$1], [$2], [$3]) + +if test x"$delete_libs_dir" != xyes; then + rm -rf .libs +fi + +CXX="$save_CXX" +AC_LANG_RESTORE])dnl diff --git a/m4/mysql.m4 b/m4/mysql.m4 new file mode 100644 index 0000000..f40ba6d --- /dev/null +++ b/m4/mysql.m4 @@ -0,0 +1,270 @@ +dnl file : m4/mysql.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl MYSQL +dnl +AC_DEFUN([MYSQL], [ + +# Client. +# +AC_MSG_CHECKING([for mysql client program]) +AC_ARG_WITH( + [mysql-client], + [AC_HELP_STRING([--with-mysql-client=path], [MySQL client program path (mysql by default)])], + [case $withval in + yes) + mysql_client=mysql + ;; + no) + AC_MSG_RESULT([]) + AC_MSG_ERROR([need mysql client to run the tests]) + ;; + *) + mysql_client=$withval + ;; + esac], + [mysql_client=mysql]) + +$mysql_client --version 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$mysql_client]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([mysql client is not found; consider using --with-mysql-client=PATH]) +fi + +# User. +# +AC_MSG_CHECKING([for mysql database user]) +AC_ARG_WITH( + [mysql-user], + [AC_HELP_STRING([--with-mysql-user=login], [MySQL database user (odb_test by default)])], + [case $withval in + yes) + mysql_user=odb_test + mysql_user_set=yes + ;; + no) + mysql_user_set=no + ;; + *) + mysql_user=$withval + mysql_user_set=yes + ;; + esac], + [mysql_user=odb_test + mysql_user_set=yes]) + +if test x$mysql_user_set = xyes; then + AC_MSG_RESULT(['$mysql_user']) +else + AC_MSG_RESULT([none]) +fi + +# Password. +# +AC_MSG_CHECKING([for mysql database password]) +AC_ARG_WITH( + [mysql-password], + [AC_HELP_STRING([--with-mysql-password=login], [MySQL database password (no password by default)])], + [case $withval in + yes) + mysql_password= + mysql_password_set=yes + ;; + no) + mysql_password_set=no + ;; + *) + mysql_password=$withval + mysql_password_set=yes + ;; + esac], + [mysql_password_set=no]) + +if test x$mysql_password_set = xyes; then + AC_MSG_RESULT(['$mysql_password']) +else + AC_MSG_RESULT([none]) +fi + +# Database name. +# +AC_MSG_CHECKING([for mysql database name]) +AC_ARG_WITH( + [mysql-db], + [AC_HELP_STRING([--with-mysql-db=name], [MySQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], + [case $withval in + yes) + mysql_db=odb_test + mysql_db_set=yes + ;; + no) + mysql_db_set=no + ;; + *) + mysql_db=$withval + mysql_db_set=yes + ;; + esac], + [mysql_db=odb_test + mysql_db_set=yes]) + +if test x$mysql_db_set = xyes; then + AC_MSG_RESULT(['$mysql_db']) +else + AC_MSG_RESULT([none]) +fi + +# Host. +# +AC_MSG_CHECKING([for mysql database host]) +AC_ARG_WITH( + [mysql-host], + [AC_HELP_STRING([--with-mysql-host=host], [MySQL database host (localhost by default)])], + [case $withval in + yes) + mysql_host=localhost + mysql_host_set=yes + ;; + no) + mysql_host_set=no + ;; + *) + mysql_host=$withval + mysql_host_set=yes + ;; + esac], + [mysql_host_set=no]) + +if test x$mysql_host_set = xyes; then + AC_MSG_RESULT(['$mysql_host']) +else + AC_MSG_RESULT([localhost]) +fi + +# Port. +# +AC_MSG_CHECKING([for mysql database port]) +AC_ARG_WITH( + [mysql-port], + [AC_HELP_STRING([--with-mysql-port=port], [MySQL database port (standard MySQL port by default)])], + [case $withval in + yes) + mysql_port=0 + mysql_port_set=yes + ;; + no) + mysql_port_set=no + ;; + *) + mysql_port=$withval + mysql_port_set=yes + ;; + esac], + [mysql_port_set=no]) + +if test x$mysql_port_set = xyes; then + AC_MSG_RESULT(['$mysql_port']) +else + AC_MSG_RESULT([default]) +fi + +# Socket. +# +AC_MSG_CHECKING([for mysql database socket]) +AC_ARG_WITH( + [mysql-socket], + [AC_HELP_STRING([--with-mysql-socket=socket], [MySQL database socket (standard MySQL socket by default)])], + [case $withval in + yes) + mysql_socket= + mysql_socket_set=yes + ;; + no) + mysql_socket_set=no + ;; + *) + mysql_socket=$withval + mysql_socket_set=yes + ;; + esac], + [mysql_socket_set=no]) + +if test x$mysql_socket_set = xyes; then + AC_MSG_RESULT(['$mysql_socket']) +else + AC_MSG_RESULT([default]) +fi + +# Create options file. +# +AC_CONFIG_COMMANDS([db.options], + [ + rm -f db.options + echo '#! /bin/sh' >db-driver + + if test x$mysql_user_set = xyes; then + echo "--user '$mysql_user'" >>db.options + echo 'opt="$opt --user='"$mysql_user"'"' >>db-driver + fi + + if test x$mysql_password_set = xyes; then + echo "--passwd '$mysql_password'" >>db.options + echo 'opt="$opt --password='"$mysql_password"'"' >>db-driver + fi + + if test x$mysql_db_set = xyes; then + echo "--db-name '$mysql_db'" >>db.options + echo 'opt="$opt --database='"$mysql_db"'"' >>db-driver + fi + + if test x$mysql_host_set = xyes; then + echo "--host '$mysql_host'" >>db.options + echo 'opt="$opt --host='"$mysql_host"'"' >>db-driver + fi + + if test x$mysql_port_set = xyes; then + echo "--port '$mysql_port'" >>db.options + echo 'opt="$opt --port='"$mysql_port"'"' >>db-driver + fi + + if test x$mysql_socket_set = xyes; then + echo "--socket '$mysql_socket'" >>db.options + echo 'opt="$opt --socket='"$mysql_socket"'"' >>db-driver + fi + + echo 'if test x$[]1 != x; then' >>db-driver + echo " exec $mysql_client "'$opt <$[]1' >>db-driver + echo "else" >>db-driver + echo " exec $mysql_client "'$opt' >>db-driver + echo "fi" >>db-driver + + chmod +x db-driver + ], + [ + mysql_client="$mysql_client" + + mysql_user="$mysql_user" + mysql_user_set="$mysql_user_set" + + mysql_password="$mysql_password" + mysql_password_set="$mysql_password_set" + + mysql_db="$mysql_db" + mysql_db_set="$mysql_db_set" + + mysql_host="$mysql_host" + mysql_host_set="$mysql_host_set" + + mysql_port="$mysql_port" + mysql_port_set="$mysql_port_set" + + mysql_socket="$mysql_socket" + mysql_socket_set="$mysql_socket_set" + ]) + +])dnl diff --git a/m4/odb.m4 b/m4/odb.m4 new file mode 100644 index 0000000..b632f8c --- /dev/null +++ b/m4/odb.m4 @@ -0,0 +1,45 @@ +dnl file : m4/odb.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([ODB_COMPILER], [ +odb_found=no + +AC_ARG_VAR([ODB],[ODB compiler command]) +AC_ARG_VAR([ODBFLAGS],[ODB compiler flags]) +AC_ARG_VAR([ODBCPPFLAGS],[ODB-specific C++ preprocessor flags]) + +AC_ARG_WITH( + [odb], + [AC_HELP_STRING([--with-odb=DIR],[location of odb build directory])], + [odb_dir=${withval}], + [odb_dir=]) + +AC_MSG_CHECKING([for odb]) + +save_ODB="$ODB" + +if test x"$ODB" = x; then + if test x"$odb_dir" != x; then + AS_SET_CATFILE([abs_odb_dir], [$ac_pwd], [$odb_dir]) + ODB="$abs_odb_dir/odb/odb" + else + ODB=odb + fi +fi + +$ODB --version 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$ODB]) + $1 +else + AC_MSG_RESULT([no]) + ODB="$save_ODB" + $2 +fi + +])dnl diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 new file mode 100644 index 0000000..1c0af42 --- /dev/null +++ b/m4/static-lib.m4 @@ -0,0 +1,19 @@ +dnl file : m4/static-lib.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl STATIC_LIB(MACRO, DESCRIPTION) +dnl +dnl Define MACRO if we are on MinGW and are only building static library. +dnl +AC_DEFUN([STATIC_LIB], +[ +if test x$enable_shared = xno; then + case $host_os in + mingw*) + AC_DEFINE([$1], [1], [$2]) + ;; + esac +fi +])dnl diff --git a/m4/threads.m4 b/m4/threads.m4 new file mode 100644 index 0000000..7c32abe --- /dev/null +++ b/m4/threads.m4 @@ -0,0 +1,41 @@ +dnl file : m4/threads.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +AC_DEFUN([THREADS],[ + +AC_ARG_ENABLE( + [threads], + AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), + [AS_IF([test x"$enableval" = xno], [threads=none], [threads=check])], + [threads=check]) + +# If thread support is not disabled by the user, figure out what we can use. +# +if test x$threads = xcheck; then + case $host_os in + windows* | mingw*) + case $host_os in + mingw*) + CXXFLAGS="$CXXFLAGS -mthreads" + ;; + esac + threads=win32 + ;; + *) + ACX_PTHREAD + + if test x$acx_pthread_ok = xyes; then + threads=posix + LIBS="$LIBS $PTHREAD_LIBS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + fi + ;; + esac +fi + +if test x$threads = xcheck; then + AC_MSG_ERROR([thread support not available; use --disable-threads to force single-threaded mode]) +fi +])dnl diff --git a/makefile b/makefile index e3559a9..aba3aee 100644 --- a/makefile +++ b/makefile @@ -1,24 +1,45 @@ -# file : mysql/makefile +# file : makefile # author : Boris Kolpackov # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -tests := \ -common \ -tracer +all_dirs := libcommon common tracer mysql +dirs := common tracer ifeq ($(db_id),mysql) -tests += mysql +dirs += mysql endif -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) +$(dist): data_dist := GPLv2 LICENSE README version +$(dist): exec_dist := bootstrap tester.in +$(dist): export extra_dist := $(data_dist) $(exec_dist) +$(dist): export version = $(shell cat $(src_root)/version) + +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) + $(call dist-data,$(data_dist)) + $(call dist-exec,$(exec_dist)) + $(call dist-dir,m4) + $(call meta-automake) + $(call meta-autoconf) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) + +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/automake.make) +$(call include,$(bld_root)/meta/autoconf.make) + +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) +else +$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) +endif diff --git a/mysql/Makefile.am b/mysql/Makefile.am new file mode 100644 index 0000000..1e8c1c0 --- /dev/null +++ b/mysql/Makefile.am @@ -0,0 +1,6 @@ +# file : mysql/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) diff --git a/mysql/makefile b/mysql/makefile index ae1b83f..53dd049 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -6,16 +6,24 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ +template \ truncation \ -types \ -template +types default := $(out_base)/ +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): export dirs := $(tests) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) + $(call meta-automake) + $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/automake.make) + $(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am new file mode 100644 index 0000000..46c3bae --- /dev/null +++ b/mysql/template/Makefile.am @@ -0,0 +1,27 @@ +# file : mysql/template/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +noinst_PROGRAMS = driver +driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) +driver_LDADD = $(top_builddir)/libcommon/libcommon.la +driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); + +m4_ifelse(__value__(odb_options),,, + +# ODB compilation. +# +driver_SOURCES += test.hxx test-odb.cxx +BUILT_SOURCES = test-odb.hxx +CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx + +ODB = @ODB@ +ODBFLAGS = @ODBFLAGS@ + +test-odb.hxx: test.hxx + $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< +) diff --git a/mysql/template/makefile b/mysql/template/makefile index a614597..28146f4 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -40,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database mysql --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -50,6 +51,13 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -78,6 +86,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 84eb4f3..f0d475d 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -40,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database mysql --generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -50,6 +51,13 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -78,6 +86,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/mysql/types/makefile b/mysql/types/makefile index c7c8742..859ef29 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -14,6 +14,7 @@ common.l := $(out_root)/libcommon/common.l common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options driver := $(out_base)/driver +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean @@ -40,8 +41,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database $(db_id) --generate-schema \ ---generate-query --cxx-prologue '\\\#include "traits.hxx"' +$(gen) $(dist): export odb_options += --database mysql --generate-schema \ +--generate-query --cxx-prologue '\#include "traits.hxx"' + $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) @@ -51,6 +53,14 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) traits.hxx test.std +$(dist): export extra_headers := traits.hxx +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -79,6 +89,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/mysql/types/test.mk b/mysql/types/test.mk new file mode 100644 index 0000000..693fc71 --- /dev/null +++ b/mysql/types/test.mk @@ -0,0 +1,4 @@ +v = '\#include "foo.hxx"' + +all: + echo $v diff --git a/tester.in b/tester.in new file mode 100755 index 0000000..b34c6ab --- /dev/null +++ b/tester.in @@ -0,0 +1,31 @@ +#! /bin/sh + +# file : tester.in +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# Run an ODB test. The test driver is in the current directory. The +# data files, if any, are in $srcdir. +# + +if test -f test.sql; then + $top_builddir/db-driver test.sql + + if test $? -ne 0; then + exit 1 + fi +fi + +if test -f "$srcdir/test.std"; then + ./driver --options-file "$top_builddir/db.options" >test.out + + if test $? -ne 0; then + exit 1 + fi + + @DIFF@ @DIFFFLAGS@ "$srcdir/test.std" test.out +else + ./driver --options-file "$top_builddir/db.options" +fi diff --git a/tracer/Makefile.am b/tracer/Makefile.am new file mode 100644 index 0000000..32feb34 --- /dev/null +++ b/tracer/Makefile.am @@ -0,0 +1,6 @@ +# file : tracer/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) diff --git a/tracer/makefile b/tracer/makefile index 03b8747..731573a 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -6,16 +6,25 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ +template \ object \ transaction \ types default := $(out_base)/ +dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): export dirs := $(tests) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) + $(call meta-automake) + $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/automake.make) + $(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tracer/object/makefile b/tracer/object/makefile index ed7c562..1fd819b 100644 --- a/tracer/object/makefile +++ b/tracer/object/makefile @@ -11,6 +11,7 @@ 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 @@ -39,7 +40,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database tracer +$(gen) $(dist): export odb_options += --database tracer $(gen): cpp_options := -I$(out_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) @@ -49,6 +50,13 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -75,6 +83,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am new file mode 100644 index 0000000..09e4f09 --- /dev/null +++ b/tracer/template/Makefile.am @@ -0,0 +1,25 @@ +# file : tracer/template/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +noinst_PROGRAMS = driver +driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); + +m4_ifelse(__value__(odb_options),,, + +# ODB compilation. +# +driver_SOURCES += test.hxx test-odb.cxx +BUILT_SOURCES = test-odb.hxx +CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx + +ODB = @ODB@ +ODBFLAGS = @ODBFLAGS@ + +test-odb.hxx: test.hxx + $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< +) diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx new file mode 100644 index 0000000..c727fac --- /dev/null +++ b/tracer/template/driver.cxx @@ -0,0 +1,35 @@ +// file : tracer/template/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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; + +int +main () +{ + tracer::database db; + + // + // + cout << "test 001" << endl; + { + transaction t (db.begin_transaction ()); + t.commit (); + } +} diff --git a/tracer/template/makefile b/tracer/template/makefile new file mode 100644 index 0000000..b7b82b7 --- /dev/null +++ b/tracer/template/makefile @@ -0,0 +1,92 @@ +# file : tracer/template/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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$(out_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): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call message,test $<,$< | diff -u $(src_base)/test.std -) + +# 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)) + +# 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/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/test.hxx b/tracer/template/test.hxx new file mode 100644 index 0000000..06d7155 --- /dev/null +++ b/tracer/template/test.hxx @@ -0,0 +1,27 @@ +// file : tracer/template/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma odb object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma odb id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/tracer/template/test.std b/tracer/template/test.std new file mode 100644 index 0000000..ac654fc --- /dev/null +++ b/tracer/template/test.std @@ -0,0 +1,3 @@ +test 001 +begin transaction +commit transaction diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index 5919e6e..fd1d698 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -10,6 +10,7 @@ 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 @@ -35,6 +36,13 @@ $(call include-dep,$(cxx_od)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -60,6 +68,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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/types/makefile b/tracer/types/makefile index 382d1b5..f042476 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -11,6 +11,7 @@ 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 @@ -39,7 +40,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen): odb_options += --database tracer +$(gen) $(dist): export odb_options += --database tracer $(gen): cpp_options := -I$(out_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) @@ -49,6 +50,13 @@ $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # $(out_base)/: $(driver) +# Dist +# +$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): + $(call dist-data,$(data_dist)) + $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + # Test. # $(test): $(driver) $(src_base)/test.std @@ -75,6 +83,9 @@ endif # How to. # +$(call include,$(bld_root)/dist.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) -- cgit v1.1 From b3b1fac433a20e5ab6abb3729ecc5473a658718b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Sep 2010 21:06:09 +0200 Subject: Remove unneeded file --- mysql/types/test.mk | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 mysql/types/test.mk diff --git a/mysql/types/test.mk b/mysql/types/test.mk deleted file mode 100644 index 693fc71..0000000 --- a/mysql/types/test.mk +++ /dev/null @@ -1,4 +0,0 @@ -v = '\#include "foo.hxx"' - -all: - echo $v -- cgit v1.1 From ff5bb2accee87c24ee64e8fdcf5169e674c4b7b4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Sep 2010 21:23:37 +0200 Subject: Add suppor for VC++ build --- build/bootstrap.make | 45 +- common/Makefile.am | 2 + common/auto/driver.cxx | 2 +- common/auto/makefile | 21 +- common/common-vc10.sln | 15 + common/common-vc9.sln | 15 + common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 21 +- common/makefile | 11 +- common/query/driver.cxx | 2 +- common/query/makefile | 23 +- common/schema/driver.cxx | 2 +- common/schema/makefile | 21 +- common/template/Makefile.am | 6 +- common/template/driver.cxx | 2 +- common/template/makefile | 21 +- common/template/template-vc10.vcxproj | 173 +++++ common/template/template-vc10.vcxproj.filters | 24 + common/template/template-vc9.vcproj | 356 +++++++++++ common/test.bat | 48 ++ common/threads/driver.cxx | 2 +- common/threads/makefile | 21 +- configure.ac | 2 +- libcommon/Makefile.am | 7 +- libcommon/common.cxx | 49 -- libcommon/common.hxx | 18 - libcommon/common/Makefile.am | 12 + libcommon/common/common.cxx | 49 ++ libcommon/common/common.hxx | 18 + libcommon/common/config.h.in | 15 + libcommon/common/export.hxx | 39 ++ libcommon/common/libcommon-vc10.vcxproj | 174 ++++++ libcommon/common/libcommon-vc10.vcxproj.filters | 19 + libcommon/common/libcommon-vc9.vcproj | 359 +++++++++++ libcommon/common/makefile | 124 ++++ libcommon/common/options.cli | 58 ++ libcommon/common/options.cxx | 796 ++++++++++++++++++++++++ libcommon/common/options.hxx | 396 ++++++++++++ libcommon/common/options.ixx | 256 ++++++++ libcommon/config.h.in | 15 - libcommon/export.hxx | 39 -- libcommon/libcommon-vc10.sln | 26 + libcommon/libcommon-vc9.sln | 26 + libcommon/makefile | 121 +--- libcommon/options.cli | 58 -- libcommon/options.cxx | 796 ------------------------ libcommon/options.hxx | 396 ------------ libcommon/options.ixx | 256 -------- makefile | 2 +- mysql/Makefile.am | 1 + mysql/makefile | 8 + mysql/mysql-vc10.sln | 15 + mysql/mysql-vc9.sln | 15 + mysql/template/Makefile.am | 6 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 25 +- mysql/template/template-vc10.vcxproj | 176 ++++++ mysql/template/template-vc10.vcxproj.filters | 25 + mysql/template/template-vc9.vcproj | 357 +++++++++++ mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 25 +- mysql/types/driver.cxx | 4 +- mysql/types/makefile | 25 +- test.bat | 48 ++ tester.bat | 54 ++ tester.in | 3 + tracer/Makefile.am | 1 + tracer/makefile | 9 + tracer/object/makefile | 15 +- tracer/template/Makefile.am | 4 +- tracer/template/makefile | 15 +- tracer/template/template-vc10.vcxproj | 172 +++++ tracer/template/template-vc10.vcxproj.filters | 25 + tracer/template/template-vc9.vcproj | 353 +++++++++++ tracer/tracer-vc10.sln | 15 + tracer/tracer-vc9.sln | 15 + tracer/transaction/makefile | 14 +- tracer/types/makefile | 15 +- 78 files changed, 4571 insertions(+), 1834 deletions(-) create mode 100644 common/common-vc10.sln create mode 100644 common/common-vc9.sln create mode 100644 common/template/template-vc10.vcxproj create mode 100644 common/template/template-vc10.vcxproj.filters create mode 100644 common/template/template-vc9.vcproj create mode 100644 common/test.bat delete mode 100644 libcommon/common.cxx delete mode 100644 libcommon/common.hxx create mode 100644 libcommon/common/Makefile.am create mode 100644 libcommon/common/common.cxx create mode 100644 libcommon/common/common.hxx create mode 100644 libcommon/common/config.h.in create mode 100644 libcommon/common/export.hxx create mode 100644 libcommon/common/libcommon-vc10.vcxproj create mode 100644 libcommon/common/libcommon-vc10.vcxproj.filters create mode 100644 libcommon/common/libcommon-vc9.vcproj create mode 100644 libcommon/common/makefile create mode 100644 libcommon/common/options.cli create mode 100644 libcommon/common/options.cxx create mode 100644 libcommon/common/options.hxx create mode 100644 libcommon/common/options.ixx delete mode 100644 libcommon/config.h.in delete mode 100644 libcommon/export.hxx create mode 100644 libcommon/libcommon-vc10.sln create mode 100644 libcommon/libcommon-vc9.sln delete mode 100644 libcommon/options.cli delete mode 100644 libcommon/options.cxx delete mode 100644 libcommon/options.hxx delete mode 100644 libcommon/options.ixx create mode 100644 mysql/mysql-vc10.sln create mode 100644 mysql/mysql-vc9.sln create mode 100644 mysql/template/template-vc10.vcxproj create mode 100644 mysql/template/template-vc10.vcxproj.filters create mode 100644 mysql/template/template-vc9.vcproj create mode 100644 test.bat create mode 100644 tester.bat create mode 100644 tracer/template/template-vc10.vcxproj create mode 100644 tracer/template/template-vc10.vcxproj.filters create mode 100644 tracer/template/template-vc9.vcproj create mode 100644 tracer/tracer-vc10.sln create mode 100644 tracer/tracer-vc9.sln diff --git a/build/bootstrap.make b/build/bootstrap.make index 59a62a2..8cff938 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -45,12 +45,53 @@ clean: $(out_base)/.clean endif -# Make sure the distribution prefix is set if the goal is dist. +# Dist setup. # ifneq ($(filter $(MAKECMDGOALS),dist),) + +# Make sure the distribution prefix is set if the goal is dist. +# ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif + +databases := mysql pgsql +$(dist): databases := $(databases) + +# $1 project template without the -vcN.vc[x]proj suffix. +# $2 project name without the -vcN.vc[x]proj suffix. +# +$(dist): meta-vc9projs = \ +$(foreach d,$(databases),$(call \ +meta-vc9proj,$1-vc9.vcproj,$(if $2,$2,$(notdir \ +$1))-$d-vc9.vcproj,database,$d)$(literal_newline)$(literal_tab))@: + +$(dist): meta-vc10projs = \ +$(foreach d,$(databases),$(call \ +meta-vc10proj,$1-vc10.vcxproj,$(if $2,$2,$(notdir \ +$1))-$d-vc10.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: + +# $1 project name without the -vcN.vc[x]proj suffix. +# +vc9projs = $(addprefix $1-,$(addsuffix -vc9.vcproj,$(databases))) +vc10projs = $(addprefix $1-,$(addsuffix -vc10.vcxproj,$(databases))) \ +$(addprefix $1-,$(addsuffix -vc10.vcxproj.filters,$(databases))) + +# $1 solution name without the -vcN.sln suffix. +# +$(dist): meta-vc9slns = \ +$(foreach d,$(databases),$(call \ +meta-vc9sln,$1-vc9.sln,$1-$d-vc9.sln,-$d-vc9.vcproj,database,$d)$(literal_newline)\ +$(literal_tab))@: + +$(dist): meta-vc10slns = \ +$(foreach d,$(databases),$(call \ +meta-vc10sln,$1-vc10.sln,$1-$d-vc10.sln,-$d-vc10.vcxproj,database,$d)$(literal_newline)\ +$(literal_tab))@: + +vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) +vc10slns = $(addprefix $1-,$(addsuffix -vc10.sln,$(databases))) + endif # If we don't have dependency auto-generation then we need to manually @@ -74,7 +115,7 @@ endif # Don't include dependency info for certain targets. # -ifneq ($(filter $(MAKECMDGOALS),clean disfigure),) +ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),) include-dep = endif diff --git a/common/Makefile.am b/common/Makefile.am index a526e4c..00c4ef0 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -8,3 +8,5 @@ SUBDIRS = __path__(dirs) if ODB_TESTS_THREADS SUBDIRS += __path__(thread_dirs) endif + +EXTRA_DIST = __file__(extra_dist) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 423254e..4a65725 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/auto/makefile b/common/auto/makefile index b39759a..e4cdffd 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -47,11 +47,20 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +name := $(notdir $(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,$(data_dist)) - $(call meta-automake,$(src_root)/common/template/Makefile.am) + $(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. # @@ -82,6 +91,8 @@ 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)) diff --git a/common/common-vc10.sln b/common/common-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/common/common-vc10.sln @@ -0,0 +1,15 @@ + +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/common/common-vc9.sln b/common/common-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/common/common-vc9.sln @@ -0,0 +1,15 @@ + +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/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index ef5a4aa..a7be6d4 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 73cc2e4..b2a6875 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -47,11 +47,20 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +name := $(notdir $(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,$(data_dist)) - $(call meta-automake,$(src_root)/common/template/Makefile.am) + $(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. # @@ -82,6 +91,8 @@ 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)) diff --git a/common/makefile b/common/makefile index ef085e9..f575f74 100644 --- a/common/makefile +++ b/common/makefile @@ -24,15 +24,24 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) +name := $(notdir $(src_base)) +$(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export thread_dirs := $(thread_tests) +$(dist): export extra_dist := $(call vc9slns,$(name)) $(call vc10slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) + $(call meta-vc9slns,$(name)) + $(call meta-vc10slns,$(name)) + $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) -$(call include,$(bld_root)/dist.make) +$(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) ifneq ($(filter $(MAKECMDGOALS),dist clean),) $(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 2573d7e..eede6d8 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/query/makefile b/common/query/makefile index 27e19e8..08eb33d 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -48,12 +48,21 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) traits.hxx test.std -$(dist): export extra_headers := traits.hxx +name := $(notdir $(src_base)) + $(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx +$(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,$(data_dist)) - $(call meta-automake,$(src_root)/common/template/Makefile.am) + $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) # Test. # @@ -84,6 +93,8 @@ 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)) diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index 2647d8c..e189b23 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/schema/makefile b/common/schema/makefile index de22c01..5c71905 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -47,11 +47,20 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +name := $(notdir $(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,$(data_dist)) - $(call meta-automake,$(src_root)/common/template/Makefile.am) + $(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. # @@ -82,6 +91,8 @@ 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)) diff --git a/common/template/Makefile.am b/common/template/Makefile.am index b2fc122..ca3a3d5 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -3,13 +3,15 @@ # copyright : Copyright (c) 2009-2010 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) -driver_LDADD = $(top_builddir)/libcommon/libcommon.la +driver_LDADD = $(top_builddir)/libcommon/common/libcommon.la driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; # ODB compilation. # diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 08e4196..495365b 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/template/makefile b/common/template/makefile index cdc8f91..cff4185 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -47,11 +47,20 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +name := $(notdir $(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,$(data_dist)) - $(call meta-automake) + $(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. # @@ -82,6 +91,8 @@ 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)) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj new file mode 100644 index 0000000..5e1936f --- /dev/null +++ b/common/template/template-vc10.vcxproj @@ -0,0 +1,173 @@ + + + + + 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;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/common/template/template-vc10.vcxproj.filters b/common/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/common/template/template-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj new file mode 100644 index 0000000..0cf2bc4 --- /dev/null +++ b/common/template/template-vc9.vcproj @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) 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/common/test.bat b/common/test.bat new file mode 100644 index 0000000..678e678 --- /dev/null +++ b/common/test.bat @@ -0,0 +1,48 @@ +@echo off +rem file : common/test.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +setlocal + +set "tests=__path__(dirs) __path__(thread_dirs)" +set "confs=__path__(configurations)" +set "topdir=__path__(topdir)\.." + +goto start + +:run_test + cd %1 + + if exist %2\driver.exe ( + echo %1\%2 + call %topdir%\tester.bat tracer %2 + if errorlevel 1 ( + set "failed=%failed% %1\%2" + ) + ) + + cd .. +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + call :run_test %%t %%c + ) +) + +if not "_%failed%_" == "__" goto error + +echo ALL TESTS PASSED +goto end + +:error +for %%t in (%failed%) do echo FAILED: %%t +exit /b 1 +goto end + +:end +endlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index c883bba..dd2d9f6 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -17,7 +17,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/common/threads/makefile b/common/threads/makefile index 6a8c802..73174d9 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -10,8 +10,8 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 @@ -48,11 +48,20 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +name := $(notdir $(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,$(data_dist)) - $(call meta-automake,$(src_root)/common/template/Makefile.am) + $(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. # @@ -83,6 +92,8 @@ 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)) diff --git a/configure.ac b/configure.ac index bdc5afa..bb0932c 100644 --- a/configure.ac +++ b/configure.ac @@ -61,7 +61,7 @@ STATIC_LIB([LIBCOMMON_STATIC_LIB], [Static library interface.]) # Output. # -AC_CONFIG_HEADERS([config.h libcommon/config.h]) +AC_CONFIG_HEADERS([config.h libcommon/common/config.h]) AC_CONFIG_FILES([__path__(config_files)]) AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester]) AC_OUTPUT diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index d42cff2..e498e3b 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -3,10 +3,5 @@ # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -noinst_LTLIBRARIES = libcommon.la -libcommon_la_SOURCES = __path__(sources) __path__(headers) - +SUBDIRS = __path__(dirs) EXTRA_DIST = __file__(extra_dist) - -libcommon_la_CPPFLAGS= -I'$(builddir)' -I'$(srcdir)' -DLIBCOMMON_DYNAMIC_LIB -libcommon_la_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/libcommon/common.cxx b/libcommon/common.cxx deleted file mode 100644 index 0c88818..0000000 --- a/libcommon/common.cxx +++ /dev/null @@ -1,49 +0,0 @@ -// file : libcommon/common.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#include // std::exit -#include - -#ifndef _MSC_VER -# include -#endif - -#ifdef DB_ID_MYSQL -# include -#endif - -#include "common.hxx" -#include "options.hxx" - -using namespace std; -using namespace odb; - -auto_ptr -create_database (int argc, char* argv[]) -{ -#ifdef DB_ID_MYSQL - cli::argv_file_scanner scan (argc, argv, "--options-file"); - cli::mysql_options ops (scan); - - if (ops.help ()) - { - cerr << "Usage: " << argv[0] << " [options]" << endl - << "Options:" << endl; - cli::mysql_options::print_usage (cerr); - exit (0); - } - - return auto_ptr ( - new mysql::database ( - ops.user (), - ops.passwd_specified () ? &ops.passwd () : 0, - ops.db_name (), - ops.host (), - ops.port (), - ops.socket_specified () ? &ops.socket () : 0)); -#else - return auto_ptr (0); -#endif -} diff --git a/libcommon/common.hxx b/libcommon/common.hxx deleted file mode 100644 index 411ece5..0000000 --- a/libcommon/common.hxx +++ /dev/null @@ -1,18 +0,0 @@ -// file : libcommon/common.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_HXX -#define LIBCOMMON_COMMON_HXX - -#include // std::auto_ptr - -#include - -#include - -LIBCOMMON_EXPORT std::auto_ptr -create_database (int argc, char* argv[]); - -#endif // LIBCOMMON_COMMON_HXX diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am new file mode 100644 index 0000000..6712eaa --- /dev/null +++ b/libcommon/common/Makefile.am @@ -0,0 +1,12 @@ +# file : libcommon/common/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +noinst_LTLIBRARIES = libcommon.la +libcommon_la_SOURCES = __path__(sources) __path__(headers) + +EXTRA_DIST = __file__(extra_dist) + +libcommon_la_CPPFLAGS= -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -DLIBCOMMON_DYNAMIC_LIB +libcommon_la_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx new file mode 100644 index 0000000..d68d579 --- /dev/null +++ b/libcommon/common/common.cxx @@ -0,0 +1,49 @@ +// file : libcommon/common/common.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::exit +#include + +#ifndef _MSC_VER +# include +#endif + +#ifdef DB_ID_MYSQL +# include +#endif + +#include +#include + +using namespace std; +using namespace odb; + +auto_ptr +create_database (int argc, char* argv[]) +{ +#ifdef DB_ID_MYSQL + cli::argv_file_scanner scan (argc, argv, "--options-file"); + cli::mysql_options ops (scan); + + if (ops.help ()) + { + cerr << "Usage: " << argv[0] << " [options]" << endl + << "Options:" << endl; + cli::mysql_options::print_usage (cerr); + exit (0); + } + + return auto_ptr ( + new mysql::database ( + ops.user (), + ops.passwd_specified () ? &ops.passwd () : 0, + ops.db_name (), + ops.host (), + ops.port (), + ops.socket_specified () ? &ops.socket () : 0)); +#else + return auto_ptr (0); +#endif +} diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx new file mode 100644 index 0000000..87b08f0 --- /dev/null +++ b/libcommon/common/common.hxx @@ -0,0 +1,18 @@ +// file : libcommon/common/common.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_COMMON_HXX +#define LIBCOMMON_COMMON_COMMON_HXX + +#include // std::auto_ptr + +#include + +#include + +LIBCOMMON_EXPORT std::auto_ptr +create_database (int argc, char* argv[]); + +#endif // LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in new file mode 100644 index 0000000..06318c4 --- /dev/null +++ b/libcommon/common/config.h.in @@ -0,0 +1,15 @@ +/* file : libcommon/common/config.h.in + * author : Boris Kolpackov + * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* This file is automatically processed by configure. */ + +#ifndef LIBCOMMON_COMMON_CONFIG_H +#define LIBCOMMON_COMMON_CONFIG_H + +#undef DB_ID_MYSQL +#undef LIBCOMMON_STATIC_LIB + +#endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx new file mode 100644 index 0000000..4ea2d33 --- /dev/null +++ b/libcommon/common/export.hxx @@ -0,0 +1,39 @@ +// file : libcommon/common/export.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_EXPORT_HXX +#define LIBCOMMON_COMMON_EXPORT_HXX + +#ifndef _MSC_VER +# include +#endif + +#ifdef LIBCOMMON_STATIC_LIB +# define LIBCOMMON_EXPORT +#else +# ifdef _WIN32 +# ifdef _MSC_VER +# ifdef LIBCOMMON_DYNAMIC_LIB +# define LIBCOMMON_EXPORT __declspec(dllexport) +# else +# define LIBCOMMON_EXPORT __declspec(dllimport) +# endif +# else +# ifdef LIBCOMMON_DYNAMIC_LIB +# ifdef DLL_EXPORT +# define LIBCOMMON_EXPORT __declspec(dllexport) +# else +# define LIBCOMMON_EXPORT +# endif +# else +# define LIBCOMMON_EXPORT __declspec(dllimport) +# endif +# endif +# else +# define LIBCOMMON_EXPORT +# endif +#endif + +#endif // LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj new file mode 100644 index 0000000..74d704b --- /dev/null +++ b/libcommon/common/libcommon-vc10.vcxproj @@ -0,0 +1,174 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {019C2E51-BF41-4490-AB96-4156741B8CC9} + Win32Proj + libcommon + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\bin\ + common-d + + + true + ..\bin64\ + common-d + + + false + ..\bin\ + common + + + false + ..\bin64\ + common + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib\common-d.lib + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib64\common-d.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib\common.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib64\common.lib + + + +__header_entries__(headers) + + +__source_entries__(sources) + + + + + diff --git a/libcommon/common/libcommon-vc10.vcxproj.filters b/libcommon/common/libcommon-vc10.vcxproj.filters new file mode 100644 index 0000000..ecc3613 --- /dev/null +++ b/libcommon/common/libcommon-vc10.vcxproj.filters @@ -0,0 +1,19 @@ + + + + + {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} + cxx + + + {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} + h;hxx;ixx;txx + + + +__header_filter_entries__(headers) + + +__source_filter_entries__(sources) + + diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj new file mode 100644 index 0000000..412480b --- /dev/null +++ b/libcommon/common/libcommon-vc9.vcproj @@ -0,0 +1,359 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entries__(sources) + + +__file_entries__(headers) + + + + + diff --git a/libcommon/common/makefile b/libcommon/common/makefile new file mode 100644 index 0000000..2987959 --- /dev/null +++ b/libcommon/common/makefile @@ -0,0 +1,124 @@ +# file : libcommon/common/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +# Options file. +# +cli_tun := options.cli +cxx_tun := common.cxx + +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_base)/common.l +common.l.cpp-options := $(out_base)/common.l.cpp-options + +default := $(out_base)/ +dist := $(out_base)/.dist +clean := $(out_base)/.clean + +# Import. +# +$(call import,\ + $(scf_root)/import/cli/stub.make,\ + cli: cli,cli-rules: cli_rules) + +$(call import,\ + $(scf_root)/import/libodb/stub.make,\ + l: odb.l,cpp-options: odb.l.cpp-options) + +ifdef db_id +$(call import,\ + $(scf_root)/import/libodb-$(db_id)/stub.make,\ + l: odb_db.l,cpp-options: odb_db.l.cpp-options) +endif + +ifeq ($(odb_db.l.cpp-options),) +odb_db.l.cpp-options := $(out_base)/.unbuildable +endif + +# Build. +# +$(common.l): $(cxx_obj) $(odb.l) $(odb_db.l) + +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h +$(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon +$(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) + +genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(cli) +$(gen): cli := $(cli) +$(gen): cli_options += \ +--generate-specifier \ +--generate-file-scanner \ +--guard-prefix LIBCOMMON_COMMON + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make + @echo '// file : libcommon/config.h' >$@ + @echo '// author : automatically generated' >>$@ + @echo '' >>$@ + @echo '#ifndef LIBCOMMON_COMMON_CONFIG_H' >>$@ + @echo '#define LIBCOMMON_COMMON_CONFIG_H' >>$@ + @echo '' >>$@ +ifeq ($(db_id),mysql) + @echo '#define DB_ID_MYSQL 1' >>$@ +endif + @echo '' >>$@ + @echo '#endif // LIBCOMMON_COMMON_CONFIG_H' >>$@ + +# Convenience alias for default target. +# +$(out_base)/: $(common.l) + +# Dist. +# +$(dist): export sources := $(cxx_tun) $(cli_tun:.cli=.cxx) +$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ +-name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) +$(dist): data_dist := $(cli_tun) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ +$(call vc10projs,libcommon) + +$(dist): $(gen) + $(call dist-data,$(sources) $(headers) $(data_dist) config.h.in) + $(call meta-automake) + $(call meta-vc9projs,libcommon) + $(call meta-vc10projs,libcommon) + +# Clean. +# +$(clean): $(common.l).o.clean \ + $(common.l.cpp-options).clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) + $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(common.l): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := config.h +$(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,$(cli_rules)) +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-l.make) diff --git a/libcommon/common/options.cli b/libcommon/common/options.cli new file mode 100644 index 0000000..5b87d70 --- /dev/null +++ b/libcommon/common/options.cli @@ -0,0 +1,58 @@ +// file : libcommon/common/options.cli +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +include ; + +namespace cli +{ + class mysql_options + { + bool --help {"Print usage information and exit."}; + + std::string --user + { + "", + "MySQL database user." + }; + + std::string --passwd + { + "", + "MySQL database password" + }; + + std::string --db-name + { + "", + "MySQL database name." + }; + + std::string --host + { + "", + "MySQL database host name or address (localhost by default)." + }; + + unsigned int --port = 0 + { + "", + "MySQL database port number." + }; + + std::string --socket + { + "", + "MySQL database socket name." + }; + + std::string --options-file + { + "", + "Read additional options from . Each option appearing on a separate + line optionally followed by space and an option value. Empty lines and + lines starting with \cb{#} are ignored." + }; + }; +} diff --git a/libcommon/common/options.cxx b/libcommon/common/options.cxx new file mode 100644 index 0000000..9d15251 --- /dev/null +++ b/libcommon/common/options.cxx @@ -0,0 +1,796 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +#include "options.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cli +{ + // unknown_option + // + unknown_option:: + ~unknown_option () throw () + { + } + + void unknown_option:: + print (std::ostream& os) const + { + os << "unknown option '" << option () << "'"; + } + + const char* unknown_option:: + what () const throw () + { + return "unknown option"; + } + + // unknown_argument + // + unknown_argument:: + ~unknown_argument () throw () + { + } + + void unknown_argument:: + print (std::ostream& os) const + { + os << "unknown argument '" << argument () << "'"; + } + + const char* unknown_argument:: + what () const throw () + { + return "unknown argument"; + } + + // missing_value + // + missing_value:: + ~missing_value () throw () + { + } + + void missing_value:: + print (std::ostream& os) const + { + os << "missing value for option '" << option () << "'"; + } + + const char* missing_value:: + what () const throw () + { + return "missing option value"; + } + + // invalid_value + // + invalid_value:: + ~invalid_value () throw () + { + } + + void invalid_value:: + print (std::ostream& os) const + { + os << "invalid value '" << value () << "' for option '" + << option () << "'"; + } + + const char* invalid_value:: + what () const throw () + { + return "invalid option value"; + } + + // eos_reached + // + void eos_reached:: + print (std::ostream& os) const + { + os << what (); + } + + const char* eos_reached:: + what () const throw () + { + return "end of argument stream reached"; + } + + // file_io_failure + // + file_io_failure:: + ~file_io_failure () throw () + { + } + + void file_io_failure:: + print (std::ostream& os) const + { + os << "unable to open file '" << file () << "' or read failure"; + } + + const char* file_io_failure:: + what () const throw () + { + return "unable to open file or read failure"; + } + + // unmatched_quote + // + unmatched_quote:: + ~unmatched_quote () throw () + { + } + + void unmatched_quote:: + print (std::ostream& os) const + { + os << "unmatched quote in argument '" << argument () << "'"; + } + + const char* unmatched_quote:: + what () const throw () + { + return "unmatched quote"; + } + + // scanner + // + scanner:: + ~scanner () + { + } + + // argv_scanner + // + bool argv_scanner:: + more () + { + return i_ < argc_; + } + + const char* argv_scanner:: + peek () + { + if (i_ < argc_) + return argv_[i_]; + else + throw eos_reached (); + } + + const char* argv_scanner:: + next () + { + if (i_ < argc_) + { + const char* r (argv_[i_]); + + if (erase_) + { + for (int i (i_ + 1); i < argc_; ++i) + argv_[i - 1] = argv_[i]; + + --argc_; + argv_[argc_] = 0; + } + else + ++i_; + + return r; + } + else + throw eos_reached (); + } + + void argv_scanner:: + skip () + { + if (i_ < argc_) + ++i_; + else + throw eos_reached (); + } + + // argv_file_scanner + // + bool argv_file_scanner:: + more () + { + if (!args_.empty ()) + return true; + + while (base::more ()) + { + // See if the next argument is the file option. + // + const char* a (base::peek ()); + + if (!skip_ && a == option_) + { + base::next (); + + if (!base::more ()) + throw missing_value (option_); + + load (base::next ()); + + if (!args_.empty ()) + return true; + } + else + { + if (!skip_) + skip_ = (std::strcmp (a, "--") == 0); + + return true; + } + } + + return false; + } + + const char* argv_file_scanner:: + peek () + { + if (!more ()) + throw eos_reached (); + + return args_.empty () ? base::peek () : args_.front ().c_str (); + } + + const char* argv_file_scanner:: + next () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::next (); + else + { + hold_.swap (args_.front ()); + args_.pop_front (); + return hold_.c_str (); + } + } + + void argv_file_scanner:: + skip () + { + if (!more ()) + throw eos_reached (); + + if (args_.empty ()) + return base::skip (); + else + args_.pop_front (); + } + + void argv_file_scanner:: + load (const char* file) + { + using namespace std; + + ifstream is (file); + + if (!is.is_open ()) + throw file_io_failure (file); + + while (!is.eof ()) + { + string line; + getline (is, line); + + if (is.fail () && !is.eof ()) + throw file_io_failure (file); + + string::size_type n (line.size ()); + + // Trim the line from leading and trailing whitespaces. + // + if (n != 0) + { + const char* f (line.c_str ()); + const char* l (f + n); + + const char* of (f); + while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) + ++f; + + --l; + + const char* ol (l); + while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) + --l; + + if (f != of || l != ol) + line = f <= l ? string (f, l - f + 1) : string (); + } + + // Ignore empty lines, those that start with #. + // + if (line.empty () || line[0] == '#') + continue; + + string::size_type p (line.find (' ')); + + if (p == string::npos) + { + if (!skip_) + skip_ = (line == "--"); + + args_.push_back (line); + } + else + { + string s1 (line, 0, p); + + // Skip leading whitespaces in the argument. + // + n = line.size (); + for (++p; p < n; ++p) + { + char c (line[p]); + + if (c != ' ' && c != '\t' && c != '\r') + break; + } + + string s2 (line, p); + + // If the string is wrapped in quotes, remove them. + // + n = s2.size (); + char cf (s2[0]), cl (s2[n - 1]); + + if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') + { + if (n == 1 || cf != cl) + throw unmatched_quote (s2); + + s2 = string (s2, 1, n - 2); + } + + if (!skip_ && s1 == option_) + load (s2.c_str ()); + else + { + args_.push_back (s1); + args_.push_back (s2); + } + } + } + } + + template + struct parser + { + static void + parse (X& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + const char* v (s.next ()); + std::istringstream is (v); + if (!(is >> x && is.eof ())) + throw invalid_value (o, v); + } + else + throw missing_value (o); + + xs = true; + } + }; + + template <> + struct parser + { + static void + parse (bool& x, scanner& s) + { + s.next (); + x = true; + } + }; + + template <> + struct parser + { + static void + parse (std::string& x, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::vector& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser::parse (x, dummy, s); + c.push_back (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::set& c, bool& xs, scanner& s) + { + X x; + bool dummy; + parser::parse (x, dummy, s); + c.insert (x); + xs = true; + } + }; + + template + struct parser > + { + static void + parse (std::map& m, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + { + std::string ov (s.next ()); + std::string::size_type p = ov.find ('='); + + if (p == std::string::npos) + { + K k = K (); + + if (!ov.empty ()) + { + std::istringstream ks (ov); + + if (!(ks >> k && ks.eof ())) + throw invalid_value (o, ov); + } + + m[k] = V (); + } + else + { + K k = K (); + V v = V (); + std::string kstr (ov, 0, p); + std::string vstr (ov, p + 1); + + if (!kstr.empty ()) + { + std::istringstream ks (kstr); + + if (!(ks >> k && ks.eof ())) + throw invalid_value (o, ov); + } + + if (!vstr.empty ()) + { + std::istringstream vs (vstr); + + if (!(vs >> v && vs.eof ())) + throw invalid_value (o, ov); + } + + m[k] = v; + } + } + else + throw missing_value (o); + + xs = true; + } + }; + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, s); + } + + template + void + thunk (X& x, scanner& s) + { + parser::parse (x.*M, x.*S, s); + } +} + +#include +#include + +namespace cli +{ + // mysql_options + // + + mysql_options:: + mysql_options (int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + } + + mysql_options:: + mysql_options (int start, + int& argc, + char** argv, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + } + + mysql_options:: + mysql_options (int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + mysql_options:: + mysql_options (int start, + int& argc, + char** argv, + int& end, + bool erase, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + ::cli::argv_scanner s (start, argc, argv, erase); + _parse (s, opt, arg); + end = s.end (); + } + + mysql_options:: + mysql_options (::cli::scanner& s, + ::cli::unknown_mode opt, + ::cli::unknown_mode arg) + : help_ (), + user_ (), + user_specified_ (false), + passwd_ (), + passwd_specified_ (false), + db_name_ (), + db_name_specified_ (false), + host_ (), + host_specified_ (false), + port_ (0), + port_specified_ (false), + socket_ (), + socket_specified_ (false), + options_file_ (), + options_file_specified_ (false) + { + _parse (s, opt, arg); + } + + void mysql_options:: + print_usage (::std::ostream& os) + { + os << "--help Print usage information and exit." << ::std::endl; + + os << "--user MySQL database user." << ::std::endl; + + os << "--passwd MySQL database password" << ::std::endl; + + os << "--db-name MySQL database name." << ::std::endl; + + os << "--host MySQL database host name or address (localhost by" << ::std::endl + << " default)." << ::std::endl; + + os << "--port MySQL database port number." << ::std::endl; + + os << "--socket MySQL database socket name." << ::std::endl; + + os << "--options-file Read additional options from ." << ::std::endl; + } + + typedef + std::map + _cli_mysql_options_map; + + static _cli_mysql_options_map _cli_mysql_options_map_; + + struct _cli_mysql_options_map_init + { + _cli_mysql_options_map_init () + { + _cli_mysql_options_map_["--help"] = + &::cli::thunk< mysql_options, bool, &mysql_options::help_ >; + _cli_mysql_options_map_["--user"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::user_, + &mysql_options::user_specified_ >; + _cli_mysql_options_map_["--passwd"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::passwd_, + &mysql_options::passwd_specified_ >; + _cli_mysql_options_map_["--db-name"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::db_name_, + &mysql_options::db_name_specified_ >; + _cli_mysql_options_map_["--host"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::host_, + &mysql_options::host_specified_ >; + _cli_mysql_options_map_["--port"] = + &::cli::thunk< mysql_options, unsigned int, &mysql_options::port_, + &mysql_options::port_specified_ >; + _cli_mysql_options_map_["--socket"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::socket_, + &mysql_options::socket_specified_ >; + _cli_mysql_options_map_["--options-file"] = + &::cli::thunk< mysql_options, std::string, &mysql_options::options_file_, + &mysql_options::options_file_specified_ >; + } + } _cli_mysql_options_map_init_; + + void mysql_options:: + _parse (::cli::scanner& s, + ::cli::unknown_mode opt_mode, + ::cli::unknown_mode arg_mode) + { + bool opt = true; + + while (s.more ()) + { + const char* o = s.peek (); + + if (std::strcmp (o, "--") == 0) + { + s.skip (); + opt = false; + continue; + } + + _cli_mysql_options_map::const_iterator i ( + opt ? _cli_mysql_options_map_.find (o) : _cli_mysql_options_map_.end ()); + + if (i != _cli_mysql_options_map_.end ()) + { + (*(i->second)) (*this, s); + } + else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0') + { + switch (opt_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_option (o); + } + } + + break; + } + else + { + switch (arg_mode) + { + case ::cli::unknown_mode::skip: + { + s.skip (); + continue; + } + case ::cli::unknown_mode::stop: + { + break; + } + case ::cli::unknown_mode::fail: + { + throw ::cli::unknown_argument (o); + } + } + + break; + } + } + } +} + diff --git a/libcommon/common/options.hxx b/libcommon/common/options.hxx new file mode 100644 index 0000000..7d043a3 --- /dev/null +++ b/libcommon/common/options.hxx @@ -0,0 +1,396 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +#ifndef LIBCOMMON_COMMON_OPTIONS_HXX +#define LIBCOMMON_COMMON_OPTIONS_HXX + +#include +#include +#include +#include + +namespace cli +{ + class unknown_mode + { + public: + enum value + { + skip, + stop, + fail + }; + + unknown_mode (value v); + + operator value () const + { + return v_; + } + + private: + value v_; + }; + + // Exceptions. + // + + class exception: public std::exception + { + public: + virtual void + print (std::ostream&) const = 0; + }; + + std::ostream& + operator<< (std::ostream&, const exception&); + + class unknown_option: public exception + { + public: + virtual + ~unknown_option () throw (); + + unknown_option (const std::string& option); + + const std::string& + option () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class unknown_argument: public exception + { + public: + virtual + ~unknown_argument () throw (); + + unknown_argument (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + class missing_value: public exception + { + public: + virtual + ~missing_value () throw (); + + missing_value (const std::string& option); + + const std::string& + option () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + }; + + class invalid_value: public exception + { + public: + virtual + ~invalid_value () throw (); + + invalid_value (const std::string& option, + const std::string& value); + + const std::string& + option () const; + + const std::string& + value () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string option_; + std::string value_; + }; + + class eos_reached: public exception + { + public: + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + }; + + class file_io_failure: public exception + { + public: + virtual + ~file_io_failure () throw (); + + file_io_failure (const std::string& file); + + const std::string& + file () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string file_; + }; + + class unmatched_quote: public exception + { + public: + virtual + ~unmatched_quote () throw (); + + unmatched_quote (const std::string& argument); + + const std::string& + argument () const; + + virtual void + print (std::ostream&) const; + + virtual const char* + what () const throw (); + + private: + std::string argument_; + }; + + class scanner + { + public: + virtual + ~scanner (); + + virtual bool + more () = 0; + + virtual const char* + peek () = 0; + + virtual const char* + next () = 0; + + virtual void + skip () = 0; + }; + + class argv_scanner: public scanner + { + public: + argv_scanner (int& argc, char** argv, bool erase = false); + argv_scanner (int start, int& argc, char** argv, bool erase = false); + + int + end () const; + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + private: + int i_; + int& argc_; + char** argv_; + bool erase_; + }; + + class argv_file_scanner: public argv_scanner + { + public: + argv_file_scanner (int& argc, + char** argv, + const std::string& file_option, + bool erase = false); + + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& file_option, + bool erase = false); + + virtual bool + more (); + + virtual const char* + peek (); + + virtual const char* + next (); + + virtual void + skip (); + + private: + void + load (const char* file); + + typedef argv_scanner base; + + const std::string option_; + std::string hold_; + std::deque args_; + bool skip_; + }; +} + +#include + +namespace cli +{ + class mysql_options + { + public: + + mysql_options (int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int start, + int& argc, + char** argv, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + mysql_options (::cli::scanner&, + ::cli::unknown_mode option = ::cli::unknown_mode::fail, + ::cli::unknown_mode argument = ::cli::unknown_mode::stop); + + // Option accessors. + // + + const bool& + help () const; + + const std::string& + user () const; + + bool + user_specified () const; + + const std::string& + passwd () const; + + bool + passwd_specified () const; + + const std::string& + db_name () const; + + bool + db_name_specified () const; + + const std::string& + host () const; + + bool + host_specified () const; + + const unsigned int& + port () const; + + bool + port_specified () const; + + const std::string& + socket () const; + + bool + socket_specified () const; + + const std::string& + options_file () const; + + bool + options_file_specified () const; + + // Print usage information. + // + static void + print_usage (::std::ostream&); + + private: + void + _parse (::cli::scanner&, + ::cli::unknown_mode option, + ::cli::unknown_mode argument); + + public: + bool help_; + std::string user_; + bool user_specified_; + std::string passwd_; + bool passwd_specified_; + std::string db_name_; + bool db_name_specified_; + std::string host_; + bool host_specified_; + unsigned int port_; + bool port_specified_; + std::string socket_; + bool socket_specified_; + std::string options_file_; + bool options_file_specified_; + }; +} + +#include "options.ixx" + +#endif // LIBCOMMON_COMMON_OPTIONS_HXX diff --git a/libcommon/common/options.ixx b/libcommon/common/options.ixx new file mode 100644 index 0000000..0fa60e5 --- /dev/null +++ b/libcommon/common/options.ixx @@ -0,0 +1,256 @@ +// This code was generated by CLI, a command line interface +// compiler for C++. +// + +namespace cli +{ + // unknown_mode + // + inline unknown_mode:: + unknown_mode (value v) + : v_ (v) + { + } + + // exception + // + inline std::ostream& + operator<< (std::ostream& os, const exception& e) + { + e.print (os); + return os; + } + + // unknown_option + // + inline unknown_option:: + unknown_option (const std::string& option) + : option_ (option) + { + } + + inline const std::string& unknown_option:: + option () const + { + return option_; + } + + // unknown_argument + // + inline unknown_argument:: + unknown_argument (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unknown_argument:: + argument () const + { + return argument_; + } + + // missing_value + // + inline missing_value:: + missing_value (const std::string& option) + : option_ (option) + { + } + + inline const std::string& missing_value:: + option () const + { + return option_; + } + + // invalid_value + // + inline invalid_value:: + invalid_value (const std::string& option, + const std::string& value) + : option_ (option), value_ (value) + { + } + + inline const std::string& invalid_value:: + option () const + { + return option_; + } + + inline const std::string& invalid_value:: + value () const + { + return value_; + } + + // file_io_failure + // + inline file_io_failure:: + file_io_failure (const std::string& file) + : file_ (file) + { + } + + inline const std::string& file_io_failure:: + file () const + { + return file_; + } + + // unmatched_quote + // + inline unmatched_quote:: + unmatched_quote (const std::string& argument) + : argument_ (argument) + { + } + + inline const std::string& unmatched_quote:: + argument () const + { + return argument_; + } + + // argv_scanner + // + inline argv_scanner:: + argv_scanner (int& argc, char** argv, bool erase) + : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase) + { + } + + inline argv_scanner:: + argv_scanner (int start, int& argc, char** argv, bool erase) + : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase) + { + } + + inline int argv_scanner:: + end () const + { + return i_; + } + + // argv_file_scanner + // + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (argc, argv, erase), + option_ (option), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (start, argc, argv, erase), + option_ (option), + skip_ (false) + { + } +} + +namespace cli +{ + // mysql_options + // + + inline const bool& mysql_options:: + help () const + { + return this->help_; + } + + inline const std::string& mysql_options:: + user () const + { + return this->user_; + } + + inline bool mysql_options:: + user_specified () const + { + return this->user_specified_; + } + + inline const std::string& mysql_options:: + passwd () const + { + return this->passwd_; + } + + inline bool mysql_options:: + passwd_specified () const + { + return this->passwd_specified_; + } + + inline const std::string& mysql_options:: + db_name () const + { + return this->db_name_; + } + + inline bool mysql_options:: + db_name_specified () const + { + return this->db_name_specified_; + } + + inline const std::string& mysql_options:: + host () const + { + return this->host_; + } + + inline bool mysql_options:: + host_specified () const + { + return this->host_specified_; + } + + inline const unsigned int& mysql_options:: + port () const + { + return this->port_; + } + + inline bool mysql_options:: + port_specified () const + { + return this->port_specified_; + } + + inline const std::string& mysql_options:: + socket () const + { + return this->socket_; + } + + inline bool mysql_options:: + socket_specified () const + { + return this->socket_specified_; + } + + inline const std::string& mysql_options:: + options_file () const + { + return this->options_file_; + } + + inline bool mysql_options:: + options_file_specified () const + { + return this->options_file_specified_; + } +} + diff --git a/libcommon/config.h.in b/libcommon/config.h.in deleted file mode 100644 index 9d18901..0000000 --- a/libcommon/config.h.in +++ /dev/null @@ -1,15 +0,0 @@ -/* file : libcommon/config.h.in - * author : Boris Kolpackov - * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* This file is automatically processed by configure. */ - -#ifndef LIBCOMMON_CONFIG_H -#define LIBCOMMON_CONFIG_H - -#undef DB_ID_MYSQL -#undef LIBCOMMON_STATIC_LIB - -#endif /* LIBCOMMON_CONFIG_H */ diff --git a/libcommon/export.hxx b/libcommon/export.hxx deleted file mode 100644 index 8bbb96c..0000000 --- a/libcommon/export.hxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : libcommon/export.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_EXPORT_HXX -#define LIBCOMMON_EXPORT_HXX - -#ifndef _MSC_VER -# include -#endif - -#ifdef LIBCOMMON_STATIC_LIB -# define LIBCOMMON_EXPORT -#else -# ifdef _WIN32 -# ifdef _MSC_VER -# ifdef LIBCOMMON_DYNAMIC_LIB -# define LIBCOMMON_EXPORT __declspec(dllexport) -# else -# define LIBCOMMON_EXPORT __declspec(dllimport) -# endif -# else -# ifdef LIBCOMMON_DYNAMIC_LIB -# ifdef DLL_EXPORT -# define LIBCOMMON_EXPORT __declspec(dllexport) -# else -# define LIBCOMMON_EXPORT -# endif -# else -# define LIBCOMMON_EXPORT __declspec(dllimport) -# endif -# endif -# else -# define LIBCOMMON_EXPORT -# endif -#endif - -#endif // LIBCOMMON_EXPORT_HXX diff --git a/libcommon/libcommon-vc10.sln b/libcommon/libcommon-vc10.sln new file mode 100644 index 0000000..9042eed --- /dev/null +++ b/libcommon/libcommon-vc10.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc10.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libcommon/libcommon-vc9.sln b/libcommon/libcommon-vc9.sln new file mode 100644 index 0000000..e12c11d --- /dev/null +++ b/libcommon/libcommon-vc9.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc9.vcproj", "{8575F058-1BD6-4F97-8901-83D0110C2B6B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.ActiveCfg = Debug|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.Build.0 = Debug|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.ActiveCfg = Debug|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.Build.0 = Debug|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.ActiveCfg = Release|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.Build.0 = Release|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.ActiveCfg = Release|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libcommon/makefile b/libcommon/makefile index cdb57bc..8f72324 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,119 +1,30 @@ # file : libcommon/makefile # author : Boris Kolpackov # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -# Options file. -# -cli_tun := options.cli -cxx_tun := common.cxx +dirs := common -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) -cxx_od := $(cxx_obj:.o=.o.d) +default := $(out_base)/ +dist := $(out_base)/.dist +clean := $(out_base)/.clean -common.l := $(out_base)/common.l -common.l.cpp-options := $(out_base)/common.l.cpp-options +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) -default := $(out_base)/ -dist := $(out_base)/.dist -clean := $(out_base)/.clean - -# Import. -# -$(call import,\ - $(scf_root)/import/cli/stub.make,\ - cli: cli,cli-rules: cli_rules) - -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -ifdef db_id -$(call import,\ - $(scf_root)/import/libodb-$(db_id)/stub.make,\ - l: odb_db.l,cpp-options: odb_db.l.cpp-options) -endif - -ifeq ($(odb_db.l.cpp-options),) -odb_db.l.cpp-options := $(out_base)/.unbuildable -endif - -# Build. -# -$(common.l): $(cxx_obj) $(odb.l) $(odb_db.l) - -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h -$(common.l.cpp-options): value := -I$(out_base) -I$(src_base) -$(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) - -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(cli) -$(gen): cli := $(cli) -$(gen): cli_options += \ ---generate-specifier \ ---generate-file-scanner \ ---guard-prefix LIBCOMMON - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make - @echo '// file : libcommon/config.h' >$@ - @echo '// author : automatically generated' >>$@ - @echo '' >>$@ - @echo '#ifndef LIBCOMMON_CONFIG_H' >>$@ - @echo '#define LIBCOMMON_CONFIG_H' >>$@ - @echo '' >>$@ -ifeq ($(db_id),mysql) - @echo '#define DB_ID_MYSQL 1' >>$@ -endif - @echo '' >>$@ - @echo '#endif // LIBCOMMON_CONFIG_H' >>$@ - -# Convenience alias for default target. -# -$(out_base)/: $(common.l) - -# Dist. -# -$(dist): export sources := $(cxx_tun) $(cli_tun:.cli=.cxx) -$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ --name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): data_dist := $(cli_tun) -$(dist): export extra_dist := $(data_dist) - -$(dist): $(gen) - $(call dist-data,$(sources) $(headers) $(data_dist) config.h.in) +$(dist): export dirs := $(dirs) +$(dist): export extra_dist := $(call vc9slns,libcommon) \ +$(call vc10slns,libcommon) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) $(call meta-automake) + $(call meta-vc9slns,libcommon) + $(call meta-vc10slns,libcommon) -# Clean. -# -$(clean): $(common.l).o.clean \ - $(common.l.cpp-options).clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(common.l): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := config.h -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) -# How to. -# -$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc9sln.make) +$(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/automake.make) -$(call include,$(cli_rules)) -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-l.make) +$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/libcommon/options.cli b/libcommon/options.cli deleted file mode 100644 index a16c5b0..0000000 --- a/libcommon/options.cli +++ /dev/null @@ -1,58 +0,0 @@ -// file : libcommon/options.cli -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -include ; - -namespace cli -{ - class mysql_options - { - bool --help {"Print usage information and exit."}; - - std::string --user - { - "", - "MySQL database user." - }; - - std::string --passwd - { - "", - "MySQL database password" - }; - - std::string --db-name - { - "", - "MySQL database name." - }; - - std::string --host - { - "", - "MySQL database host name or address (localhost by default)." - }; - - unsigned int --port = 0 - { - "", - "MySQL database port number." - }; - - std::string --socket - { - "", - "MySQL database socket name." - }; - - std::string --options-file - { - "", - "Read additional options from . Each option appearing on a separate - line optionally followed by space and an option value. Empty lines and - lines starting with \cb{#} are ignored." - }; - }; -} diff --git a/libcommon/options.cxx b/libcommon/options.cxx deleted file mode 100644 index 9d15251..0000000 --- a/libcommon/options.cxx +++ /dev/null @@ -1,796 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -#include "options.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cli -{ - // unknown_option - // - unknown_option:: - ~unknown_option () throw () - { - } - - void unknown_option:: - print (std::ostream& os) const - { - os << "unknown option '" << option () << "'"; - } - - const char* unknown_option:: - what () const throw () - { - return "unknown option"; - } - - // unknown_argument - // - unknown_argument:: - ~unknown_argument () throw () - { - } - - void unknown_argument:: - print (std::ostream& os) const - { - os << "unknown argument '" << argument () << "'"; - } - - const char* unknown_argument:: - what () const throw () - { - return "unknown argument"; - } - - // missing_value - // - missing_value:: - ~missing_value () throw () - { - } - - void missing_value:: - print (std::ostream& os) const - { - os << "missing value for option '" << option () << "'"; - } - - const char* missing_value:: - what () const throw () - { - return "missing option value"; - } - - // invalid_value - // - invalid_value:: - ~invalid_value () throw () - { - } - - void invalid_value:: - print (std::ostream& os) const - { - os << "invalid value '" << value () << "' for option '" - << option () << "'"; - } - - const char* invalid_value:: - what () const throw () - { - return "invalid option value"; - } - - // eos_reached - // - void eos_reached:: - print (std::ostream& os) const - { - os << what (); - } - - const char* eos_reached:: - what () const throw () - { - return "end of argument stream reached"; - } - - // file_io_failure - // - file_io_failure:: - ~file_io_failure () throw () - { - } - - void file_io_failure:: - print (std::ostream& os) const - { - os << "unable to open file '" << file () << "' or read failure"; - } - - const char* file_io_failure:: - what () const throw () - { - return "unable to open file or read failure"; - } - - // unmatched_quote - // - unmatched_quote:: - ~unmatched_quote () throw () - { - } - - void unmatched_quote:: - print (std::ostream& os) const - { - os << "unmatched quote in argument '" << argument () << "'"; - } - - const char* unmatched_quote:: - what () const throw () - { - return "unmatched quote"; - } - - // scanner - // - scanner:: - ~scanner () - { - } - - // argv_scanner - // - bool argv_scanner:: - more () - { - return i_ < argc_; - } - - const char* argv_scanner:: - peek () - { - if (i_ < argc_) - return argv_[i_]; - else - throw eos_reached (); - } - - const char* argv_scanner:: - next () - { - if (i_ < argc_) - { - const char* r (argv_[i_]); - - if (erase_) - { - for (int i (i_ + 1); i < argc_; ++i) - argv_[i - 1] = argv_[i]; - - --argc_; - argv_[argc_] = 0; - } - else - ++i_; - - return r; - } - else - throw eos_reached (); - } - - void argv_scanner:: - skip () - { - if (i_ < argc_) - ++i_; - else - throw eos_reached (); - } - - // argv_file_scanner - // - bool argv_file_scanner:: - more () - { - if (!args_.empty ()) - return true; - - while (base::more ()) - { - // See if the next argument is the file option. - // - const char* a (base::peek ()); - - if (!skip_ && a == option_) - { - base::next (); - - if (!base::more ()) - throw missing_value (option_); - - load (base::next ()); - - if (!args_.empty ()) - return true; - } - else - { - if (!skip_) - skip_ = (std::strcmp (a, "--") == 0); - - return true; - } - } - - return false; - } - - const char* argv_file_scanner:: - peek () - { - if (!more ()) - throw eos_reached (); - - return args_.empty () ? base::peek () : args_.front ().c_str (); - } - - const char* argv_file_scanner:: - next () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::next (); - else - { - hold_.swap (args_.front ()); - args_.pop_front (); - return hold_.c_str (); - } - } - - void argv_file_scanner:: - skip () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::skip (); - else - args_.pop_front (); - } - - void argv_file_scanner:: - load (const char* file) - { - using namespace std; - - ifstream is (file); - - if (!is.is_open ()) - throw file_io_failure (file); - - while (!is.eof ()) - { - string line; - getline (is, line); - - if (is.fail () && !is.eof ()) - throw file_io_failure (file); - - string::size_type n (line.size ()); - - // Trim the line from leading and trailing whitespaces. - // - if (n != 0) - { - const char* f (line.c_str ()); - const char* l (f + n); - - const char* of (f); - while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) - ++f; - - --l; - - const char* ol (l); - while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) - --l; - - if (f != of || l != ol) - line = f <= l ? string (f, l - f + 1) : string (); - } - - // Ignore empty lines, those that start with #. - // - if (line.empty () || line[0] == '#') - continue; - - string::size_type p (line.find (' ')); - - if (p == string::npos) - { - if (!skip_) - skip_ = (line == "--"); - - args_.push_back (line); - } - else - { - string s1 (line, 0, p); - - // Skip leading whitespaces in the argument. - // - n = line.size (); - for (++p; p < n; ++p) - { - char c (line[p]); - - if (c != ' ' && c != '\t' && c != '\r') - break; - } - - string s2 (line, p); - - // If the string is wrapped in quotes, remove them. - // - n = s2.size (); - char cf (s2[0]), cl (s2[n - 1]); - - if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') - { - if (n == 1 || cf != cl) - throw unmatched_quote (s2); - - s2 = string (s2, 1, n - 2); - } - - if (!skip_ && s1 == option_) - load (s2.c_str ()); - else - { - args_.push_back (s1); - args_.push_back (s2); - } - } - } - } - - template - struct parser - { - static void - parse (X& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - const char* v (s.next ()); - std::istringstream is (v); - if (!(is >> x && is.eof ())) - throw invalid_value (o, v); - } - else - throw missing_value (o); - - xs = true; - } - }; - - template <> - struct parser - { - static void - parse (bool& x, scanner& s) - { - s.next (); - x = true; - } - }; - - template <> - struct parser - { - static void - parse (std::string& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - x = s.next (); - else - throw missing_value (o); - - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::vector& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.push_back (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::set& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.insert (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::map& m, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - std::string ov (s.next ()); - std::string::size_type p = ov.find ('='); - - if (p == std::string::npos) - { - K k = K (); - - if (!ov.empty ()) - { - std::istringstream ks (ov); - - if (!(ks >> k && ks.eof ())) - throw invalid_value (o, ov); - } - - m[k] = V (); - } - else - { - K k = K (); - V v = V (); - std::string kstr (ov, 0, p); - std::string vstr (ov, p + 1); - - if (!kstr.empty ()) - { - std::istringstream ks (kstr); - - if (!(ks >> k && ks.eof ())) - throw invalid_value (o, ov); - } - - if (!vstr.empty ()) - { - std::istringstream vs (vstr); - - if (!(vs >> v && vs.eof ())) - throw invalid_value (o, ov); - } - - m[k] = v; - } - } - else - throw missing_value (o); - - xs = true; - } - }; - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, s); - } - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, x.*S, s); - } -} - -#include -#include - -namespace cli -{ - // mysql_options - // - - mysql_options:: - mysql_options (int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); - } - - mysql_options:: - mysql_options (int start, - int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); - } - - mysql_options:: - mysql_options (int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); - } - - mysql_options:: - mysql_options (int start, - int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); - } - - mysql_options:: - mysql_options (::cli::scanner& s, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - _parse (s, opt, arg); - } - - void mysql_options:: - print_usage (::std::ostream& os) - { - os << "--help Print usage information and exit." << ::std::endl; - - os << "--user MySQL database user." << ::std::endl; - - os << "--passwd MySQL database password" << ::std::endl; - - os << "--db-name MySQL database name." << ::std::endl; - - os << "--host MySQL database host name or address (localhost by" << ::std::endl - << " default)." << ::std::endl; - - os << "--port MySQL database port number." << ::std::endl; - - os << "--socket MySQL database socket name." << ::std::endl; - - os << "--options-file Read additional options from ." << ::std::endl; - } - - typedef - std::map - _cli_mysql_options_map; - - static _cli_mysql_options_map _cli_mysql_options_map_; - - struct _cli_mysql_options_map_init - { - _cli_mysql_options_map_init () - { - _cli_mysql_options_map_["--help"] = - &::cli::thunk< mysql_options, bool, &mysql_options::help_ >; - _cli_mysql_options_map_["--user"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::user_, - &mysql_options::user_specified_ >; - _cli_mysql_options_map_["--passwd"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::passwd_, - &mysql_options::passwd_specified_ >; - _cli_mysql_options_map_["--db-name"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::db_name_, - &mysql_options::db_name_specified_ >; - _cli_mysql_options_map_["--host"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::host_, - &mysql_options::host_specified_ >; - _cli_mysql_options_map_["--port"] = - &::cli::thunk< mysql_options, unsigned int, &mysql_options::port_, - &mysql_options::port_specified_ >; - _cli_mysql_options_map_["--socket"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::socket_, - &mysql_options::socket_specified_ >; - _cli_mysql_options_map_["--options-file"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::options_file_, - &mysql_options::options_file_specified_ >; - } - } _cli_mysql_options_map_init_; - - void mysql_options:: - _parse (::cli::scanner& s, - ::cli::unknown_mode opt_mode, - ::cli::unknown_mode arg_mode) - { - bool opt = true; - - while (s.more ()) - { - const char* o = s.peek (); - - if (std::strcmp (o, "--") == 0) - { - s.skip (); - opt = false; - continue; - } - - _cli_mysql_options_map::const_iterator i ( - opt ? _cli_mysql_options_map_.find (o) : _cli_mysql_options_map_.end ()); - - if (i != _cli_mysql_options_map_.end ()) - { - (*(i->second)) (*this, s); - } - else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0') - { - switch (opt_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_option (o); - } - } - - break; - } - else - { - switch (arg_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_argument (o); - } - } - - break; - } - } - } -} - diff --git a/libcommon/options.hxx b/libcommon/options.hxx deleted file mode 100644 index d9e3ab8..0000000 --- a/libcommon/options.hxx +++ /dev/null @@ -1,396 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -#ifndef LIBCOMMON_OPTIONS_HXX -#define LIBCOMMON_OPTIONS_HXX - -#include -#include -#include -#include - -namespace cli -{ - class unknown_mode - { - public: - enum value - { - skip, - stop, - fail - }; - - unknown_mode (value v); - - operator value () const - { - return v_; - } - - private: - value v_; - }; - - // Exceptions. - // - - class exception: public std::exception - { - public: - virtual void - print (std::ostream&) const = 0; - }; - - std::ostream& - operator<< (std::ostream&, const exception&); - - class unknown_option: public exception - { - public: - virtual - ~unknown_option () throw (); - - unknown_option (const std::string& option); - - const std::string& - option () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class unknown_argument: public exception - { - public: - virtual - ~unknown_argument () throw (); - - unknown_argument (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - class missing_value: public exception - { - public: - virtual - ~missing_value () throw (); - - missing_value (const std::string& option); - - const std::string& - option () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class invalid_value: public exception - { - public: - virtual - ~invalid_value () throw (); - - invalid_value (const std::string& option, - const std::string& value); - - const std::string& - option () const; - - const std::string& - value () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - std::string value_; - }; - - class eos_reached: public exception - { - public: - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - }; - - class file_io_failure: public exception - { - public: - virtual - ~file_io_failure () throw (); - - file_io_failure (const std::string& file); - - const std::string& - file () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string file_; - }; - - class unmatched_quote: public exception - { - public: - virtual - ~unmatched_quote () throw (); - - unmatched_quote (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - class scanner - { - public: - virtual - ~scanner (); - - virtual bool - more () = 0; - - virtual const char* - peek () = 0; - - virtual const char* - next () = 0; - - virtual void - skip () = 0; - }; - - class argv_scanner: public scanner - { - public: - argv_scanner (int& argc, char** argv, bool erase = false); - argv_scanner (int start, int& argc, char** argv, bool erase = false); - - int - end () const; - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - private: - int i_; - int& argc_; - char** argv_; - bool erase_; - }; - - class argv_file_scanner: public argv_scanner - { - public: - argv_file_scanner (int& argc, - char** argv, - const std::string& file_option, - bool erase = false); - - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& file_option, - bool erase = false); - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - private: - void - load (const char* file); - - typedef argv_scanner base; - - const std::string option_; - std::string hold_; - std::deque args_; - bool skip_; - }; -} - -#include - -namespace cli -{ - class mysql_options - { - public: - - mysql_options (int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int start, - int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int start, - int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (::cli::scanner&, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - // Option accessors. - // - - const bool& - help () const; - - const std::string& - user () const; - - bool - user_specified () const; - - const std::string& - passwd () const; - - bool - passwd_specified () const; - - const std::string& - db_name () const; - - bool - db_name_specified () const; - - const std::string& - host () const; - - bool - host_specified () const; - - const unsigned int& - port () const; - - bool - port_specified () const; - - const std::string& - socket () const; - - bool - socket_specified () const; - - const std::string& - options_file () const; - - bool - options_file_specified () const; - - // Print usage information. - // - static void - print_usage (::std::ostream&); - - private: - void - _parse (::cli::scanner&, - ::cli::unknown_mode option, - ::cli::unknown_mode argument); - - public: - bool help_; - std::string user_; - bool user_specified_; - std::string passwd_; - bool passwd_specified_; - std::string db_name_; - bool db_name_specified_; - std::string host_; - bool host_specified_; - unsigned int port_; - bool port_specified_; - std::string socket_; - bool socket_specified_; - std::string options_file_; - bool options_file_specified_; - }; -} - -#include "options.ixx" - -#endif // LIBCOMMON_OPTIONS_HXX diff --git a/libcommon/options.ixx b/libcommon/options.ixx deleted file mode 100644 index 0fa60e5..0000000 --- a/libcommon/options.ixx +++ /dev/null @@ -1,256 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -namespace cli -{ - // unknown_mode - // - inline unknown_mode:: - unknown_mode (value v) - : v_ (v) - { - } - - // exception - // - inline std::ostream& - operator<< (std::ostream& os, const exception& e) - { - e.print (os); - return os; - } - - // unknown_option - // - inline unknown_option:: - unknown_option (const std::string& option) - : option_ (option) - { - } - - inline const std::string& unknown_option:: - option () const - { - return option_; - } - - // unknown_argument - // - inline unknown_argument:: - unknown_argument (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unknown_argument:: - argument () const - { - return argument_; - } - - // missing_value - // - inline missing_value:: - missing_value (const std::string& option) - : option_ (option) - { - } - - inline const std::string& missing_value:: - option () const - { - return option_; - } - - // invalid_value - // - inline invalid_value:: - invalid_value (const std::string& option, - const std::string& value) - : option_ (option), value_ (value) - { - } - - inline const std::string& invalid_value:: - option () const - { - return option_; - } - - inline const std::string& invalid_value:: - value () const - { - return value_; - } - - // file_io_failure - // - inline file_io_failure:: - file_io_failure (const std::string& file) - : file_ (file) - { - } - - inline const std::string& file_io_failure:: - file () const - { - return file_; - } - - // unmatched_quote - // - inline unmatched_quote:: - unmatched_quote (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unmatched_quote:: - argument () const - { - return argument_; - } - - // argv_scanner - // - inline argv_scanner:: - argv_scanner (int& argc, char** argv, bool erase) - : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase) - { - } - - inline argv_scanner:: - argv_scanner (int start, int& argc, char** argv, bool erase) - : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase) - { - } - - inline int argv_scanner:: - end () const - { - return i_; - } - - // argv_file_scanner - // - inline argv_file_scanner:: - argv_file_scanner (int& argc, - char** argv, - const std::string& option, - bool erase) - : argv_scanner (argc, argv, erase), - option_ (option), - skip_ (false) - { - } - - inline argv_file_scanner:: - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& option, - bool erase) - : argv_scanner (start, argc, argv, erase), - option_ (option), - skip_ (false) - { - } -} - -namespace cli -{ - // mysql_options - // - - inline const bool& mysql_options:: - help () const - { - return this->help_; - } - - inline const std::string& mysql_options:: - user () const - { - return this->user_; - } - - inline bool mysql_options:: - user_specified () const - { - return this->user_specified_; - } - - inline const std::string& mysql_options:: - passwd () const - { - return this->passwd_; - } - - inline bool mysql_options:: - passwd_specified () const - { - return this->passwd_specified_; - } - - inline const std::string& mysql_options:: - db_name () const - { - return this->db_name_; - } - - inline bool mysql_options:: - db_name_specified () const - { - return this->db_name_specified_; - } - - inline const std::string& mysql_options:: - host () const - { - return this->host_; - } - - inline bool mysql_options:: - host_specified () const - { - return this->host_specified_; - } - - inline const unsigned int& mysql_options:: - port () const - { - return this->port_; - } - - inline bool mysql_options:: - port_specified () const - { - return this->port_specified_; - } - - inline const std::string& mysql_options:: - socket () const - { - return this->socket_; - } - - inline bool mysql_options:: - socket_specified () const - { - return this->socket_specified_; - } - - inline const std::string& mysql_options:: - options_file () const - { - return this->options_file_; - } - - inline bool mysql_options:: - options_file_specified () const - { - return this->options_file_specified_; - } -} - diff --git a/makefile b/makefile index aba3aee..213bab2 100644 --- a/makefile +++ b/makefile @@ -19,7 +19,7 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) -$(dist): data_dist := GPLv2 LICENSE README version +$(dist): data_dist := GPLv2 LICENSE README version tester.bat $(dist): exec_dist := bootstrap tester.in $(dist): export extra_dist := $(data_dist) $(exec_dist) $(dist): export version = $(shell cat $(src_root)/version) diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 1e8c1c0..d07384b 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -4,3 +4,4 @@ # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) +EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/makefile b/mysql/makefile index 53dd049..4b94e4c 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -17,13 +17,21 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(dist): name := $(notdir $(src_base)) $(dist): export dirs := $(tests) +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln tests.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,$(src_root)/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/mysql/mysql-vc10.sln b/mysql/mysql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/mysql/mysql-vc10.sln @@ -0,0 +1,15 @@ + +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/mysql/mysql-vc9.sln b/mysql/mysql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/mysql/mysql-vc9.sln @@ -0,0 +1,15 @@ + +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/mysql/template/Makefile.am b/mysql/template/Makefile.am index 46c3bae..229e071 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -3,13 +3,15 @@ # copyright : Copyright (c) 2009-2010 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) -driver_LDADD = $(top_builddir)/libcommon/libcommon.la +driver_LDADD = $(top_builddir)/libcommon/common/libcommon.la driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; m4_ifelse(__value__(odb_options),,, diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 4f1bb52..45a73eb 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/mysql/template/makefile b/mysql/template/makefile index 28146f4..d634728 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -10,20 +10,14 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -53,10 +47,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake) + $(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. # @@ -87,6 +88,8 @@ 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)) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj new file mode 100644 index 0000000..a6f172c --- /dev/null +++ b/mysql/template/template-vc10.vcxproj @@ -0,0 +1,176 @@ + + + + + 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;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-mysql.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))) 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/mysql/template/template-vc10.vcxproj.filters b/mysql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/mysql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj new file mode 100644 index 0000000..a8dbd23 --- /dev/null +++ b/mysql/template/template-vc9.vcproj @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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))) 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/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 2117a9e..46350d6 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index f0d475d..a798c8d 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -10,20 +10,14 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -53,10 +47,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + $(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. # @@ -87,6 +88,8 @@ 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)) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index e0d6b42..2a6c94e 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" @@ -42,7 +42,7 @@ main (int argc, char* argv[]) o.long_long_ = -123456; o.ulong_long_ = 123456; - o.float_ = 1.123; + o.float_ = 1.123F; o.double_ = 1.123; o.decimal_ = "123.456"; diff --git a/mysql/types/makefile b/mysql/types/makefile index 859ef29..60ee402 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -10,20 +10,14 @@ 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.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +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 -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -55,11 +49,18 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) traits.hxx test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + $(call dist-data,$(sources) $(headers) $(extra_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. # @@ -90,6 +91,8 @@ 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)) diff --git a/test.bat b/test.bat new file mode 100644 index 0000000..9c72b2d --- /dev/null +++ b/test.bat @@ -0,0 +1,48 @@ +@echo off +rem file : test.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +setlocal + +set "tests=__path__(dirs)" +set "confs=__path__(configurations)" +set "topdir=__path__(topdir)\.." + +goto start + +:run_test + cd %1 + + if exist %2\driver.exe ( + echo %1\%2 + call %topdir%\tester.bat tracer %2 + if errorlevel 1 ( + set "failed=%failed% %1\%2" + ) + ) + + cd .. +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + call :run_test %%t %%c + ) +) + +if not "_%failed%_" == "__" goto error + +echo ALL TESTS PASSED +goto end + +:error +for %%t in (%failed%) do echo FAILED: %%t +exit /b 1 +goto end + +:end +endlocal diff --git a/tester.bat b/tester.bat new file mode 100644 index 0000000..9d812ac --- /dev/null +++ b/tester.bat @@ -0,0 +1,54 @@ +@echo off +rem file : tester.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem Run an ODB test. The test directory is the current directory. +rem %1 database id, for example, mysql +rem %2 configuration, for example, Debug or x64/Debug +rem topdir variable containing the path to top project directory + +rem clear errorlevel +rem setlocal & endlocal + +rem echo %1 +rem echo %2 +rem echo "%topdir%" + +if "_%DIFF%_" == "__" set DIFF=fc + +if exist test.sql ( + %topdir%\%1-driver test.sql + if errorlevel 1 goto error +) + +rem echo %2\driver.exe --options-file %topdir%\%1.options + +if exist test.std ( + %2\driver.exe --options-file %topdir%\%1.options >test.out + if errorlevel 1 goto error + %DIFF% test.std test.out + + if errorlevel 1 ( + del /f test.out + goto error + ) + + del /f test.out + goto end + +) else ( + + %2\driver.exe --options-file %topdir%\%1.options + if errorlevel 1 goto error +) + +goto end + + +:error +exit /b 1 +goto end + +:end diff --git a/tester.in b/tester.in index b34c6ab..34e31a5 100755 --- a/tester.in +++ b/tester.in @@ -26,6 +26,9 @@ if test -f "$srcdir/test.std"; then fi @DIFF@ @DIFFFLAGS@ "$srcdir/test.std" test.out + r=$? + rm -f test.out + exit $r else ./driver --options-file "$top_builddir/db.options" fi diff --git a/tracer/Makefile.am b/tracer/Makefile.am index 32feb34..395bd7c 100644 --- a/tracer/Makefile.am +++ b/tracer/Makefile.am @@ -4,3 +4,4 @@ # 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/makefile b/tracer/makefile index 731573a..3d40a9a 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -18,13 +18,22 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(dist): name := $(notdir $(src_base)) $(dist): export dirs := $(tests) +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln tests.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,$(src_root)/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/makefile b/tracer/object/makefile index 1fd819b..b74ece7 100644 --- a/tracer/object/makefile +++ b/tracer/object/makefile @@ -52,10 +52,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + $(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. # @@ -84,6 +91,8 @@ 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)) diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index 09e4f09..a3bed1e 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -3,11 +3,13 @@ # copyright : Copyright (c) 2009-2010 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) TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; m4_ifelse(__value__(odb_options),,, diff --git a/tracer/template/makefile b/tracer/template/makefile index b7b82b7..4403281 100644 --- a/tracer/template/makefile +++ b/tracer/template/makefile @@ -52,10 +52,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake) + $(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. # @@ -84,6 +91,8 @@ 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)) diff --git a/tracer/template/template-vc10.vcxproj b/tracer/template/template-vc10.vcxproj new file mode 100644 index 0000000..2be749a --- /dev/null +++ b/tracer/template/template-vc10.vcxproj @@ -0,0 +1,172 @@ + + + + + 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;%(PreprocessorDefinitions) + + + odb-tracer-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + odb-tracer-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + odb-tracer.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + 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))) 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 new file mode 100644 index 0000000..951015b --- /dev/null +++ b/tracer/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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 new file mode 100644 index 0000000..527a9d7 --- /dev/null +++ b/tracer/template/template-vc9.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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))) 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/tracer-vc10.sln b/tracer/tracer-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/tracer/tracer-vc10.sln @@ -0,0 +1,15 @@ + +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 new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/tracer/tracer-vc9.sln @@ -0,0 +1,15 @@ + +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/makefile b/tracer/transaction/makefile index fd1d698..12ca226 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -38,10 +38,16 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) test.std +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + $(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. # @@ -69,6 +75,8 @@ 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) diff --git a/tracer/types/makefile b/tracer/types/makefile index f042476..474681d 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -52,10 +52,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/tracer/template/Makefile.am) + $(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. # @@ -84,6 +91,8 @@ 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)) -- cgit v1.1 From 1f8fc982cc9fd3bcd9d7530fa609fca43b3e3087 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Sep 2010 10:06:23 +0200 Subject: Disable C4068 unknown pragma --- common/template/template-vc10.vcxproj | 4 ++++ common/template/template-vc9.vcproj | 4 ++++ mysql/template/template-vc10.vcxproj | 4 ++++ mysql/template/template-vc9.vcproj | 4 ++++ tracer/template/template-vc10.vcxproj | 4 ++++ tracer/template/template-vc9.vcproj | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index 5e1936f..9bc26b8 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -90,6 +90,7 @@ Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -105,6 +106,7 @@ Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -122,6 +124,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) @@ -141,6 +144,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index 0cf2bc4..a2ad712 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -43,6 +43,7 @@ /> Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -105,6 +106,7 @@ Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -122,6 +124,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) @@ -141,6 +144,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index a8dbd23..69dd184 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -43,6 +43,7 @@ /> Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4068;4355;4800;4290;%(DisableSpecificWarnings) odb-tracer-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -103,6 +104,7 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4068;4355;4800;4290;%(DisableSpecificWarnings) odb-tracer-d.lib;odb-d.lib;%(AdditionalDependencies) @@ -119,6 +121,7 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4068;4355;4800;4290;%(DisableSpecificWarnings) odb-tracer.lib;odb.lib;%(AdditionalDependencies) @@ -137,6 +140,7 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4068;4355;4800;4290;%(DisableSpecificWarnings) odb-tracer.lib;odb.lib;%(AdditionalDependencies) diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj index 527a9d7..2411a6f 100644 --- a/tracer/template/template-vc9.vcproj +++ b/tracer/template/template-vc9.vcproj @@ -43,6 +43,7 @@ /> Date: Thu, 9 Sep 2010 10:33:22 +0200 Subject: Use qualified name for shared_ptr to avoid conflicts Qualify a few other names for consistency. --- common/threads/driver.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index dd2d9f6..72f861c 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -25,10 +25,6 @@ using namespace std; using namespace odb; -using details::shared; -using details::shared_ptr; -using details::thread; - const size_t thread_count = 32; const size_t iteration_count = 100; @@ -121,17 +117,17 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - vector > threads; - vector > tasks; + vector > threads; + vector > tasks; for (size_t i (0); i < thread_count; ++i) { - shared_ptr t (new (shared) task (*db, i)); + details::shared_ptr t (new (details::shared) task (*db, i)); tasks.push_back (t); threads.push_back ( - shared_ptr ( - new (shared) thread (&task::execute, t.get ()))); + details::shared_ptr ( + new (details::shared) details::thread (&task::execute, t.get ()))); } for (size_t i (0); i < thread_count; ++i) -- cgit v1.1 From 4ff7dcb09bf5081fce3bca012ed94d61faefa281 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Sep 2010 11:32:42 +0200 Subject: Use space instead of ';' as library separator --- common/template/template-vc9.vcproj | 8 ++++---- libcommon/common/libcommon-vc9.vcproj | 8 ++++---- mysql/template/template-vc9.vcproj | 8 ++++---- tracer/template/template-vc9.vcproj | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index a2ad712..cc6d9cd 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Fri, 10 Sep 2010 11:33:42 +0200 Subject: Link to 64-bit libcommon in 64-bit builds --- common/template/template-vc10.vcxproj | 4 ++-- mysql/template/template-vc10.vcxproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index 9bc26b8..e2950f9 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + ..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + ..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) Console true true diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index f65f875..a22100c 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + ..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + ..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) Console true true -- cgit v1.1 From f8eea05c337019bdc669d786e50d015f0cca14a2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Sep 2010 11:34:36 +0200 Subject: Use unsigned long instead of size_t for consistency --- common/threads/driver.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 72f861c..e996dae 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -25,12 +25,12 @@ using namespace std; using namespace odb; -const size_t thread_count = 32; -const size_t iteration_count = 100; +const unsigned long thread_count = 32; +const unsigned long iteration_count = 100; struct task { - task (database& db, size_t n) + task (database& db, unsigned long n) : db_ (db), n_ (n) { } @@ -40,7 +40,7 @@ struct task { try { - for (size_t i (0); i < iteration_count; ++i) + for (unsigned long i (0); i < iteration_count; ++i) { unsigned long id ((n_ * iteration_count + i) * 3); @@ -106,7 +106,7 @@ struct task } database& db_; - size_t n_; + unsigned long n_; }; @@ -120,7 +120,7 @@ main (int argc, char* argv[]) vector > threads; vector > tasks; - for (size_t i (0); i < thread_count; ++i) + for (unsigned long i (0); i < thread_count; ++i) { details::shared_ptr t (new (details::shared) task (*db, i)); tasks.push_back (t); @@ -130,7 +130,7 @@ main (int argc, char* argv[]) new (details::shared) details::thread (&task::execute, t.get ()))); } - for (size_t i (0); i < thread_count; ++i) + for (unsigned long i (0); i < thread_count; ++i) threads[i]->join (); } catch (const odb::exception& e) -- cgit v1.1 From ed24158b4d247dff58162c97f04cbc4011579600 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Sep 2010 11:35:20 +0200 Subject: Add automated build and test scripts for Windows --- build.bat | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ build/bootstrap.make | 2 +- common/makefile | 3 +- common/test.bat | 46 +++++++++++++++++++---- makefile | 9 +++-- mysql-driver.bat | 48 ++++++++++++++++++++++++ mysql.options | 9 +++++ mysql/makefile | 4 +- mysql/test.bat | 70 +++++++++++++++++++++++++++++++++++ test.bat | 55 ++++++++++++++++++--------- tester.bat | 44 ++++++++++++---------- tracer/makefile | 4 +- tracer/test.bat | 69 ++++++++++++++++++++++++++++++++++ 13 files changed, 412 insertions(+), 53 deletions(-) create mode 100644 build.bat create mode 100644 mysql-driver.bat create mode 100644 mysql.options create mode 100644 mysql/test.bat create mode 100644 tracer/test.bat diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..a59c8bc --- /dev/null +++ b/build.bat @@ -0,0 +1,102 @@ +@echo off +rem file : build.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem build.bat database vc-version [/Build|/Clean|/Rebuild] +rem +rem Build tests using the VC++ batch mode compilation. +rem + +setlocal + +set "confs=__path__(configurations)" +set "plats=__path__(platforms)" +set "failed=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +if "_%2_" == "__" ( + echo no VC++ version specified + goto usage +) + +if "_%2_" == "_9_" set "vcver=9" +if "_%2_" == "_10_" set "vcver=10" + +if "_%vcver%_" == "__" ( + echo unknown VC++ version %2 + goto usage +) + +set "action=%3" +if "_%action%_" == "__" set "action=/Build" + +set "devenv=%DEVENV%" +if "_%devenv%_" == "__" set "devenv=devenv.com" + +goto start + +rem +rem %1 - solution name +rem %2 - configuration to build +rem %3 - platform to build +rem +:run_build + echo. + echo building %1 %3 %2 + "%devenv%" %1 %action% "%2|%3" 2>&1 + if errorlevel 1 set "failed=%failed% %1\%3\%2" +goto :eof + +:start + +for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_build libcommon/libcommon-%1-vc%vcver%.sln %%c %%p + ) +) + +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 + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL BUILDS SUCCEEDED +echo. +goto end + +:usage +echo. +echo usage: build.bat database vc-version [action] +echo valid actions are /Build, /Clean, and /Rebuild +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/build/bootstrap.make b/build/bootstrap.make index 8cff938..35e7a07 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -55,7 +55,7 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql pgsql +databases := mysql $(dist): databases := $(databases) # $1 project template without the -vcN.vc[x]proj suffix. diff --git a/common/makefile b/common/makefile index f575f74..346b8f8 100644 --- a/common/makefile +++ b/common/makefile @@ -28,7 +28,8 @@ name := $(notdir $(src_base)) $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export thread_dirs := $(thread_tests) -$(dist): export extra_dist := $(call vc9slns,$(name)) $(call vc10slns,$(name)) +$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ +$(call vc10slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc9slns,$(name)) diff --git a/common/test.bat b/common/test.bat index 678e678..74e935d 100644 --- a/common/test.bat +++ b/common/test.bat @@ -8,18 +8,37 @@ setlocal set "tests=__path__(dirs) __path__(thread_dirs)" set "confs=__path__(configurations)" +set "plats=__path__(platforms)" set "topdir=__path__(topdir)\.." +set "failed=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) goto start +rem +rem %1 - test directory +rem %2 - configuration +rem %3 - platform +rem %4 - database +rem :run_test cd %1 - if exist %2\driver.exe ( - echo %1\%2 - call %topdir%\tester.bat tracer %2 + if "_%3_" == "_Win32_" ( + set "dir=%2" + ) else ( + set "dir=%3\%2" + ) + + if exist %dir%\driver.exe ( + echo %1\%3\%2 + call %topdir%\tester.bat %4 %2 %3 if errorlevel 1 ( - set "failed=%failed% %1\%2" + set "failed=%failed% %1\%3\%2" ) ) @@ -30,19 +49,32 @@ goto :eof for %%t in (%tests%) do ( for %%c in (%confs%) do ( - call :run_test %%t %%c + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p %1 + ) ) ) if not "_%failed%_" == "__" goto error +echo. echo ALL TESTS PASSED +echo. goto end +:usage +echo. +echo usage: test.bat database +echo. + :error -for %%t in (%failed%) do echo FAILED: %%t +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal exit /b 1 -goto end :end endlocal diff --git a/makefile b/makefile index 213bab2..9748e4e 100644 --- a/makefile +++ b/makefile @@ -19,22 +19,25 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) -$(dist): data_dist := GPLv2 LICENSE README version tester.bat +$(dist): data_dist := GPLv2 LICENSE README version test.bat tester.bat \ +mysql-driver.bat mysql.options $(dist): exec_dist := bootstrap tester.in -$(dist): export extra_dist := $(data_dist) $(exec_dist) +$(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat $(dist): export version = $(shell cat $(src_root)/version) $(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-automake) - $(call meta-autoconf) + $(call meta-autoconf) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/meta/autoconf.make) diff --git a/mysql-driver.bat b/mysql-driver.bat new file mode 100644 index 0000000..f246e7b --- /dev/null +++ b/mysql-driver.bat @@ -0,0 +1,48 @@ +@echo off +rem file : mysql-driver.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem mysql-driver.bat sql-file +rem +rem Run the mysql client on the SQL file specified. Adjust the +rem option below to match your MySQL setup. +rem + +setlocal + +set "options=%MYSQL_OPTIONS%" +set "options=%options% --user=odb_test" +set "options=%options% --database=odb_test" +rem set "options=%options% --password=" +rem set "options=%options% --host=" +rem set "options=%options% --post=" +rem set "options=%options% --socket=" + +set "mysql=%MYSQL_CLIENT%" + +if "_%mysql%_" == "__" set "mysql=mysql" + +if "_%1_" == "__" ( + echo no sql file specified + goto usage +) + +%mysql% %options% < %1 + +if errorlevel 1 goto error +goto end + +:usage +echo. +echo usage: mysql-driver.bat sql-file +echo. + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/mysql.options b/mysql.options new file mode 100644 index 0000000..54fc174 --- /dev/null +++ b/mysql.options @@ -0,0 +1,9 @@ +# Sample MySQL options file used to run the tests. Adjust to +# match your MySQL setup. +# +--user 'odb_test' +--db-name 'odb_test' +# --password '' +# --host '' +# --port 0 +# --socket '' diff --git a/mysql/makefile b/mysql/makefile index 4b94e4c..fe6579e 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -19,12 +19,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := $(notdir $(src_base)) $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln tests.bat +$(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,$(src_root)/test.bat) + $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/mysql/test.bat b/mysql/test.bat new file mode 100644 index 0000000..694eef8 --- /dev/null +++ b/mysql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : mysql/test.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 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 "topdir=__path__(topdir)\.." +set "PATH=__path__(topdir)\libcommon\bin64;__path__(topdir)\libcommon\bin;%PATH%" +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 mysql %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd .. +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/test.bat b/test.bat index 9c72b2d..9d601cc 100644 --- a/test.bat +++ b/test.bat @@ -4,45 +4,64 @@ rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file +rem +rem test.bat database +rem +rem Run tests built with VC++. +rem + setlocal -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "topdir=__path__(topdir)\.." +set "failed=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + goto start +rem +rem %1 - directory +rem %2 - database +rem :run_test + echo. + echo testing %1 + echo. cd %1 - - if exist %2\driver.exe ( - echo %1\%2 - call %topdir%\tester.bat tracer %2 - if errorlevel 1 ( - set "failed=%failed% %1\%2" - ) - ) - + call test.bat %2 + if errorlevel 1 set "failed=%failed% %1" cd .. goto :eof :start -for %%t in (%tests%) do ( - for %%c in (%confs%) do ( - call :run_test %%t %%c - ) +for %%d in (tracer common %1) do ( + call :run_test %%d %1 ) if not "_%failed%_" == "__" goto error +echo. echo ALL TESTS PASSED +echo. goto end +:usage +echo. +echo usage: test.bat database +echo. + :error -for %%t in (%failed%) do echo FAILED: %%t +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal exit /b 1 -goto end :end endlocal diff --git a/tester.bat b/tester.bat index 9d812ac..fab0de2 100644 --- a/tester.bat +++ b/tester.bat @@ -4,51 +4,57 @@ rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file +rem rem Run an ODB test. The test directory is the current directory. -rem %1 database id, for example, mysql -rem %2 configuration, for example, Debug or x64/Debug +rem +rem %1 database +rem %2 configuration, for example, Debug or Release +rem %3 platform, for example Win32 or x64 rem topdir variable containing the path to top project directory +rem -rem clear errorlevel -rem setlocal & endlocal +setlocal -rem echo %1 -rem echo %2 -rem echo "%topdir%" +set "PATH=%topdir%\libcommon\bin64;%topdir%\libcommon\bin;%PATH%" if "_%DIFF%_" == "__" set DIFF=fc +if "_%3_" == "_Win32_" ( + set "dir=%2" +) else ( + set "dir=%3\%2" +) + if exist test.sql ( - %topdir%\%1-driver test.sql + call %topdir%\%1-driver.bat test.sql if errorlevel 1 goto error ) -rem echo %2\driver.exe --options-file %topdir%\%1.options - if exist test.std ( - %2\driver.exe --options-file %topdir%\%1.options >test.out + %dir%\driver.exe --options-file %topdir%\%1.options >test.out if errorlevel 1 goto error %DIFF% test.std test.out - + if errorlevel 1 ( del /f test.out goto error - ) - - del /f test.out + ) + + del /f test.out goto end - + ) else ( - %2\driver.exe --options-file %topdir%\%1.options + %dir%\driver.exe --options-file %topdir%\%1.options if errorlevel 1 goto error ) goto end - :error +endlocal exit /b 1 -goto end :end +endlocal + diff --git a/tracer/makefile b/tracer/makefile index 3d40a9a..3e94d91 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -20,12 +20,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := $(notdir $(src_base)) $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln tests.bat +$(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,$(src_root)/test.bat) + $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/tracer/test.bat b/tracer/test.bat new file mode 100644 index 0000000..4c04576 --- /dev/null +++ b/tracer/test.bat @@ -0,0 +1,69 @@ +@echo off +rem file : tracer/test.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2010 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 "topdir=__path__(topdir)\.." +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 .. +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 -- cgit v1.1 From 49148af30f42baf101e32581c48acdf4540b6442 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Sep 2010 12:58:24 +0200 Subject: Allow the test to specify max number of connections Use this in common/threads. --- common/threads/driver.cxx | 58 ++++++++++++++++++++++++++++++--------------- libcommon/common/common.cxx | 12 ++++++++-- libcommon/common/common.hxx | 5 ++-- 3 files changed, 52 insertions(+), 23 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index e996dae..539db5f 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -8,6 +8,7 @@ #include #include // std::auto_ptr +#include // std::size_t #include #include @@ -109,35 +110,54 @@ struct task unsigned long n_; }; - -int -main (int argc, char* argv[]) +void +test (int argc, char* argv[], size_t max_connections) { - try + auto_ptr db (create_database (argc, argv, max_connections)); + + vector > threads; + vector > tasks; + + for (unsigned long i (0); i < thread_count; ++i) { - auto_ptr db (create_database (argc, argv)); + details::shared_ptr t (new (details::shared) task (*db, i)); + tasks.push_back (t); - vector > threads; - vector > tasks; + threads.push_back ( + details::shared_ptr ( + new (details::shared) details::thread (&task::execute, t.get ()))); + } - for (unsigned long i (0); i < thread_count; ++i) - { - details::shared_ptr t (new (details::shared) task (*db, i)); - tasks.push_back (t); + for (unsigned long i (0); i < thread_count; ++i) + threads[i]->join (); - threads.push_back ( - details::shared_ptr ( - new (details::shared) details::thread (&task::execute, t.get ()))); - } + { + typedef odb::result result; + + transaction t (db->begin_transaction ()); + result r (db->query ()); + r.cache (); - for (unsigned long i (0); i < thread_count; ++i) - threads[i]->join (); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + db->erase (i->id_); + + t.commit (); + } +} + +int +main (int argc, char* argv[]) +{ + try + { + test (argc, argv, 0); + test (argc, argv, thread_count - 1); + test (argc, argv, thread_count / 2); + test (argc, argv, thread_count / 4); } catch (const odb::exception& e) { cerr << e.what () << endl; return 1; } - - // pthread_exit (0); } diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index d68d579..960a946 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -12,6 +12,7 @@ #ifdef DB_ID_MYSQL # include +# include #endif #include @@ -21,7 +22,7 @@ using namespace std; using namespace odb; auto_ptr -create_database (int argc, char* argv[]) +create_database (int argc, char* argv[], size_t max_connections) { #ifdef DB_ID_MYSQL cli::argv_file_scanner scan (argc, argv, "--options-file"); @@ -35,6 +36,11 @@ create_database (int argc, char* argv[]) exit (0); } + auto_ptr f; + + if (max_connections != 0) + f.reset (new mysql::connection_pool_factory (max_connections)); + return auto_ptr ( new mysql::database ( ops.user (), @@ -42,7 +48,9 @@ create_database (int argc, char* argv[]) ops.db_name (), ops.host (), ops.port (), - ops.socket_specified () ? &ops.socket () : 0)); + ops.socket_specified () ? &ops.socket () : 0, + 0, + f)); #else return auto_ptr (0); #endif diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 87b08f0..57069dc 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -6,13 +6,14 @@ #ifndef LIBCOMMON_COMMON_COMMON_HXX #define LIBCOMMON_COMMON_COMMON_HXX -#include // std::auto_ptr +#include // std::auto_ptr +#include // std::size_t #include #include LIBCOMMON_EXPORT std::auto_ptr -create_database (int argc, char* argv[]); +create_database (int argc, char* argv[], std::size_t max_connections = 0); #endif // LIBCOMMON_COMMON_COMMON_HXX -- cgit v1.1 From fdc38359247829a4664e539fd3cbba41067cb694 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Sep 2010 17:26:28 +0200 Subject: Do not distribute generated test-odb.cxx --- common/template/Makefile.am | 3 ++- mysql/template/Makefile.am | 3 ++- tracer/template/Makefile.am | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/template/Makefile.am b/common/template/Makefile.am index ca3a3d5..ccfe5f0 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -15,7 +15,8 @@ TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; # ODB compilation. # -driver_SOURCES += test.hxx test-odb.cxx +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 diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 229e071..bfb3327 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -17,7 +17,8 @@ m4_ifelse(__value__(odb_options),,, # ODB compilation. # -driver_SOURCES += test.hxx test-odb.cxx +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 diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index a3bed1e..6edccff 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -15,7 +15,8 @@ m4_ifelse(__value__(odb_options),,, # ODB compilation. # -driver_SOURCES += test.hxx test-odb.cxx +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 -- cgit v1.1 From 70ab4cae25550bcab13ea6193e315a124e2cc763 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 12 Sep 2010 16:00:23 +0200 Subject: Update README files --- README | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README b/README index e69de29..38d4c87 100644 --- a/README +++ b/README @@ -0,0 +1,18 @@ +ODB is an object-relational mapping (ORM) system for C++. + +@@ + +For more information see: + +http://www.codesynthesis.com/products/odb/ + +This package contains the ODB test suite. + +See the NEWS file for the user-visible changes from the previous release. + +See the LICENSE file for distribution conditions. + +See the INSTALL file for prerequisites and installation instructions. + +Send questions, bug reports, or any other feedback to the +odb-users@codesynthesis.com mailing list. -- cgit v1.1 From 2026ac6d0c0eb59248583632b4fa9e78c0bdbdfc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 12 Sep 2010 17:03:45 +0200 Subject: Don't version-control generated code --- libcommon/common/makefile | 5 +- libcommon/common/options.cxx | 796 ------------------------------------------- libcommon/common/options.hxx | 396 --------------------- libcommon/common/options.ixx | 256 -------------- 4 files changed, 3 insertions(+), 1450 deletions(-) delete mode 100644 libcommon/common/options.cxx delete mode 100644 libcommon/common/options.hxx delete mode 100644 libcommon/common/options.ixx diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 2987959..7349690 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -97,7 +97,8 @@ $(dist): $(gen) $(clean): $(common.l).o.clean \ $(common.l.cpp-options).clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) # Generated .gitignore. @@ -105,7 +106,7 @@ $(clean): $(common.l).o.clean \ ifeq ($(out_base),$(src_base)) $(common.l): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := config.h +$(out_base)/.gitignore: files := config.h $(genf) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/libcommon/common/options.cxx b/libcommon/common/options.cxx deleted file mode 100644 index 9d15251..0000000 --- a/libcommon/common/options.cxx +++ /dev/null @@ -1,796 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -#include "options.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cli -{ - // unknown_option - // - unknown_option:: - ~unknown_option () throw () - { - } - - void unknown_option:: - print (std::ostream& os) const - { - os << "unknown option '" << option () << "'"; - } - - const char* unknown_option:: - what () const throw () - { - return "unknown option"; - } - - // unknown_argument - // - unknown_argument:: - ~unknown_argument () throw () - { - } - - void unknown_argument:: - print (std::ostream& os) const - { - os << "unknown argument '" << argument () << "'"; - } - - const char* unknown_argument:: - what () const throw () - { - return "unknown argument"; - } - - // missing_value - // - missing_value:: - ~missing_value () throw () - { - } - - void missing_value:: - print (std::ostream& os) const - { - os << "missing value for option '" << option () << "'"; - } - - const char* missing_value:: - what () const throw () - { - return "missing option value"; - } - - // invalid_value - // - invalid_value:: - ~invalid_value () throw () - { - } - - void invalid_value:: - print (std::ostream& os) const - { - os << "invalid value '" << value () << "' for option '" - << option () << "'"; - } - - const char* invalid_value:: - what () const throw () - { - return "invalid option value"; - } - - // eos_reached - // - void eos_reached:: - print (std::ostream& os) const - { - os << what (); - } - - const char* eos_reached:: - what () const throw () - { - return "end of argument stream reached"; - } - - // file_io_failure - // - file_io_failure:: - ~file_io_failure () throw () - { - } - - void file_io_failure:: - print (std::ostream& os) const - { - os << "unable to open file '" << file () << "' or read failure"; - } - - const char* file_io_failure:: - what () const throw () - { - return "unable to open file or read failure"; - } - - // unmatched_quote - // - unmatched_quote:: - ~unmatched_quote () throw () - { - } - - void unmatched_quote:: - print (std::ostream& os) const - { - os << "unmatched quote in argument '" << argument () << "'"; - } - - const char* unmatched_quote:: - what () const throw () - { - return "unmatched quote"; - } - - // scanner - // - scanner:: - ~scanner () - { - } - - // argv_scanner - // - bool argv_scanner:: - more () - { - return i_ < argc_; - } - - const char* argv_scanner:: - peek () - { - if (i_ < argc_) - return argv_[i_]; - else - throw eos_reached (); - } - - const char* argv_scanner:: - next () - { - if (i_ < argc_) - { - const char* r (argv_[i_]); - - if (erase_) - { - for (int i (i_ + 1); i < argc_; ++i) - argv_[i - 1] = argv_[i]; - - --argc_; - argv_[argc_] = 0; - } - else - ++i_; - - return r; - } - else - throw eos_reached (); - } - - void argv_scanner:: - skip () - { - if (i_ < argc_) - ++i_; - else - throw eos_reached (); - } - - // argv_file_scanner - // - bool argv_file_scanner:: - more () - { - if (!args_.empty ()) - return true; - - while (base::more ()) - { - // See if the next argument is the file option. - // - const char* a (base::peek ()); - - if (!skip_ && a == option_) - { - base::next (); - - if (!base::more ()) - throw missing_value (option_); - - load (base::next ()); - - if (!args_.empty ()) - return true; - } - else - { - if (!skip_) - skip_ = (std::strcmp (a, "--") == 0); - - return true; - } - } - - return false; - } - - const char* argv_file_scanner:: - peek () - { - if (!more ()) - throw eos_reached (); - - return args_.empty () ? base::peek () : args_.front ().c_str (); - } - - const char* argv_file_scanner:: - next () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::next (); - else - { - hold_.swap (args_.front ()); - args_.pop_front (); - return hold_.c_str (); - } - } - - void argv_file_scanner:: - skip () - { - if (!more ()) - throw eos_reached (); - - if (args_.empty ()) - return base::skip (); - else - args_.pop_front (); - } - - void argv_file_scanner:: - load (const char* file) - { - using namespace std; - - ifstream is (file); - - if (!is.is_open ()) - throw file_io_failure (file); - - while (!is.eof ()) - { - string line; - getline (is, line); - - if (is.fail () && !is.eof ()) - throw file_io_failure (file); - - string::size_type n (line.size ()); - - // Trim the line from leading and trailing whitespaces. - // - if (n != 0) - { - const char* f (line.c_str ()); - const char* l (f + n); - - const char* of (f); - while (f < l && (*f == ' ' || *f == '\t' || *f == '\r')) - ++f; - - --l; - - const char* ol (l); - while (l > f && (*l == ' ' || *l == '\t' || *l == '\r')) - --l; - - if (f != of || l != ol) - line = f <= l ? string (f, l - f + 1) : string (); - } - - // Ignore empty lines, those that start with #. - // - if (line.empty () || line[0] == '#') - continue; - - string::size_type p (line.find (' ')); - - if (p == string::npos) - { - if (!skip_) - skip_ = (line == "--"); - - args_.push_back (line); - } - else - { - string s1 (line, 0, p); - - // Skip leading whitespaces in the argument. - // - n = line.size (); - for (++p; p < n; ++p) - { - char c (line[p]); - - if (c != ' ' && c != '\t' && c != '\r') - break; - } - - string s2 (line, p); - - // If the string is wrapped in quotes, remove them. - // - n = s2.size (); - char cf (s2[0]), cl (s2[n - 1]); - - if (cf == '"' || cf == '\'' || cl == '"' || cl == '\'') - { - if (n == 1 || cf != cl) - throw unmatched_quote (s2); - - s2 = string (s2, 1, n - 2); - } - - if (!skip_ && s1 == option_) - load (s2.c_str ()); - else - { - args_.push_back (s1); - args_.push_back (s2); - } - } - } - } - - template - struct parser - { - static void - parse (X& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - const char* v (s.next ()); - std::istringstream is (v); - if (!(is >> x && is.eof ())) - throw invalid_value (o, v); - } - else - throw missing_value (o); - - xs = true; - } - }; - - template <> - struct parser - { - static void - parse (bool& x, scanner& s) - { - s.next (); - x = true; - } - }; - - template <> - struct parser - { - static void - parse (std::string& x, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - x = s.next (); - else - throw missing_value (o); - - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::vector& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.push_back (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::set& c, bool& xs, scanner& s) - { - X x; - bool dummy; - parser::parse (x, dummy, s); - c.insert (x); - xs = true; - } - }; - - template - struct parser > - { - static void - parse (std::map& m, bool& xs, scanner& s) - { - const char* o (s.next ()); - - if (s.more ()) - { - std::string ov (s.next ()); - std::string::size_type p = ov.find ('='); - - if (p == std::string::npos) - { - K k = K (); - - if (!ov.empty ()) - { - std::istringstream ks (ov); - - if (!(ks >> k && ks.eof ())) - throw invalid_value (o, ov); - } - - m[k] = V (); - } - else - { - K k = K (); - V v = V (); - std::string kstr (ov, 0, p); - std::string vstr (ov, p + 1); - - if (!kstr.empty ()) - { - std::istringstream ks (kstr); - - if (!(ks >> k && ks.eof ())) - throw invalid_value (o, ov); - } - - if (!vstr.empty ()) - { - std::istringstream vs (vstr); - - if (!(vs >> v && vs.eof ())) - throw invalid_value (o, ov); - } - - m[k] = v; - } - } - else - throw missing_value (o); - - xs = true; - } - }; - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, s); - } - - template - void - thunk (X& x, scanner& s) - { - parser::parse (x.*M, x.*S, s); - } -} - -#include -#include - -namespace cli -{ - // mysql_options - // - - mysql_options:: - mysql_options (int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); - } - - mysql_options:: - mysql_options (int start, - int& argc, - char** argv, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); - } - - mysql_options:: - mysql_options (int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); - } - - mysql_options:: - mysql_options (int start, - int& argc, - char** argv, - int& end, - bool erase, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - ::cli::argv_scanner s (start, argc, argv, erase); - _parse (s, opt, arg); - end = s.end (); - } - - mysql_options:: - mysql_options (::cli::scanner& s, - ::cli::unknown_mode opt, - ::cli::unknown_mode arg) - : help_ (), - user_ (), - user_specified_ (false), - passwd_ (), - passwd_specified_ (false), - db_name_ (), - db_name_specified_ (false), - host_ (), - host_specified_ (false), - port_ (0), - port_specified_ (false), - socket_ (), - socket_specified_ (false), - options_file_ (), - options_file_specified_ (false) - { - _parse (s, opt, arg); - } - - void mysql_options:: - print_usage (::std::ostream& os) - { - os << "--help Print usage information and exit." << ::std::endl; - - os << "--user MySQL database user." << ::std::endl; - - os << "--passwd MySQL database password" << ::std::endl; - - os << "--db-name MySQL database name." << ::std::endl; - - os << "--host MySQL database host name or address (localhost by" << ::std::endl - << " default)." << ::std::endl; - - os << "--port MySQL database port number." << ::std::endl; - - os << "--socket MySQL database socket name." << ::std::endl; - - os << "--options-file Read additional options from ." << ::std::endl; - } - - typedef - std::map - _cli_mysql_options_map; - - static _cli_mysql_options_map _cli_mysql_options_map_; - - struct _cli_mysql_options_map_init - { - _cli_mysql_options_map_init () - { - _cli_mysql_options_map_["--help"] = - &::cli::thunk< mysql_options, bool, &mysql_options::help_ >; - _cli_mysql_options_map_["--user"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::user_, - &mysql_options::user_specified_ >; - _cli_mysql_options_map_["--passwd"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::passwd_, - &mysql_options::passwd_specified_ >; - _cli_mysql_options_map_["--db-name"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::db_name_, - &mysql_options::db_name_specified_ >; - _cli_mysql_options_map_["--host"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::host_, - &mysql_options::host_specified_ >; - _cli_mysql_options_map_["--port"] = - &::cli::thunk< mysql_options, unsigned int, &mysql_options::port_, - &mysql_options::port_specified_ >; - _cli_mysql_options_map_["--socket"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::socket_, - &mysql_options::socket_specified_ >; - _cli_mysql_options_map_["--options-file"] = - &::cli::thunk< mysql_options, std::string, &mysql_options::options_file_, - &mysql_options::options_file_specified_ >; - } - } _cli_mysql_options_map_init_; - - void mysql_options:: - _parse (::cli::scanner& s, - ::cli::unknown_mode opt_mode, - ::cli::unknown_mode arg_mode) - { - bool opt = true; - - while (s.more ()) - { - const char* o = s.peek (); - - if (std::strcmp (o, "--") == 0) - { - s.skip (); - opt = false; - continue; - } - - _cli_mysql_options_map::const_iterator i ( - opt ? _cli_mysql_options_map_.find (o) : _cli_mysql_options_map_.end ()); - - if (i != _cli_mysql_options_map_.end ()) - { - (*(i->second)) (*this, s); - } - else if (opt && std::strncmp (o, "-", 1) == 0 && o[1] != '\0') - { - switch (opt_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_option (o); - } - } - - break; - } - else - { - switch (arg_mode) - { - case ::cli::unknown_mode::skip: - { - s.skip (); - continue; - } - case ::cli::unknown_mode::stop: - { - break; - } - case ::cli::unknown_mode::fail: - { - throw ::cli::unknown_argument (o); - } - } - - break; - } - } - } -} - diff --git a/libcommon/common/options.hxx b/libcommon/common/options.hxx deleted file mode 100644 index 7d043a3..0000000 --- a/libcommon/common/options.hxx +++ /dev/null @@ -1,396 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -#ifndef LIBCOMMON_COMMON_OPTIONS_HXX -#define LIBCOMMON_COMMON_OPTIONS_HXX - -#include -#include -#include -#include - -namespace cli -{ - class unknown_mode - { - public: - enum value - { - skip, - stop, - fail - }; - - unknown_mode (value v); - - operator value () const - { - return v_; - } - - private: - value v_; - }; - - // Exceptions. - // - - class exception: public std::exception - { - public: - virtual void - print (std::ostream&) const = 0; - }; - - std::ostream& - operator<< (std::ostream&, const exception&); - - class unknown_option: public exception - { - public: - virtual - ~unknown_option () throw (); - - unknown_option (const std::string& option); - - const std::string& - option () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class unknown_argument: public exception - { - public: - virtual - ~unknown_argument () throw (); - - unknown_argument (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - class missing_value: public exception - { - public: - virtual - ~missing_value () throw (); - - missing_value (const std::string& option); - - const std::string& - option () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - }; - - class invalid_value: public exception - { - public: - virtual - ~invalid_value () throw (); - - invalid_value (const std::string& option, - const std::string& value); - - const std::string& - option () const; - - const std::string& - value () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string option_; - std::string value_; - }; - - class eos_reached: public exception - { - public: - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - }; - - class file_io_failure: public exception - { - public: - virtual - ~file_io_failure () throw (); - - file_io_failure (const std::string& file); - - const std::string& - file () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string file_; - }; - - class unmatched_quote: public exception - { - public: - virtual - ~unmatched_quote () throw (); - - unmatched_quote (const std::string& argument); - - const std::string& - argument () const; - - virtual void - print (std::ostream&) const; - - virtual const char* - what () const throw (); - - private: - std::string argument_; - }; - - class scanner - { - public: - virtual - ~scanner (); - - virtual bool - more () = 0; - - virtual const char* - peek () = 0; - - virtual const char* - next () = 0; - - virtual void - skip () = 0; - }; - - class argv_scanner: public scanner - { - public: - argv_scanner (int& argc, char** argv, bool erase = false); - argv_scanner (int start, int& argc, char** argv, bool erase = false); - - int - end () const; - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - private: - int i_; - int& argc_; - char** argv_; - bool erase_; - }; - - class argv_file_scanner: public argv_scanner - { - public: - argv_file_scanner (int& argc, - char** argv, - const std::string& file_option, - bool erase = false); - - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& file_option, - bool erase = false); - - virtual bool - more (); - - virtual const char* - peek (); - - virtual const char* - next (); - - virtual void - skip (); - - private: - void - load (const char* file); - - typedef argv_scanner base; - - const std::string option_; - std::string hold_; - std::deque args_; - bool skip_; - }; -} - -#include - -namespace cli -{ - class mysql_options - { - public: - - mysql_options (int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int start, - int& argc, - char** argv, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (int start, - int& argc, - char** argv, - int& end, - bool erase = false, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - mysql_options (::cli::scanner&, - ::cli::unknown_mode option = ::cli::unknown_mode::fail, - ::cli::unknown_mode argument = ::cli::unknown_mode::stop); - - // Option accessors. - // - - const bool& - help () const; - - const std::string& - user () const; - - bool - user_specified () const; - - const std::string& - passwd () const; - - bool - passwd_specified () const; - - const std::string& - db_name () const; - - bool - db_name_specified () const; - - const std::string& - host () const; - - bool - host_specified () const; - - const unsigned int& - port () const; - - bool - port_specified () const; - - const std::string& - socket () const; - - bool - socket_specified () const; - - const std::string& - options_file () const; - - bool - options_file_specified () const; - - // Print usage information. - // - static void - print_usage (::std::ostream&); - - private: - void - _parse (::cli::scanner&, - ::cli::unknown_mode option, - ::cli::unknown_mode argument); - - public: - bool help_; - std::string user_; - bool user_specified_; - std::string passwd_; - bool passwd_specified_; - std::string db_name_; - bool db_name_specified_; - std::string host_; - bool host_specified_; - unsigned int port_; - bool port_specified_; - std::string socket_; - bool socket_specified_; - std::string options_file_; - bool options_file_specified_; - }; -} - -#include "options.ixx" - -#endif // LIBCOMMON_COMMON_OPTIONS_HXX diff --git a/libcommon/common/options.ixx b/libcommon/common/options.ixx deleted file mode 100644 index 0fa60e5..0000000 --- a/libcommon/common/options.ixx +++ /dev/null @@ -1,256 +0,0 @@ -// This code was generated by CLI, a command line interface -// compiler for C++. -// - -namespace cli -{ - // unknown_mode - // - inline unknown_mode:: - unknown_mode (value v) - : v_ (v) - { - } - - // exception - // - inline std::ostream& - operator<< (std::ostream& os, const exception& e) - { - e.print (os); - return os; - } - - // unknown_option - // - inline unknown_option:: - unknown_option (const std::string& option) - : option_ (option) - { - } - - inline const std::string& unknown_option:: - option () const - { - return option_; - } - - // unknown_argument - // - inline unknown_argument:: - unknown_argument (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unknown_argument:: - argument () const - { - return argument_; - } - - // missing_value - // - inline missing_value:: - missing_value (const std::string& option) - : option_ (option) - { - } - - inline const std::string& missing_value:: - option () const - { - return option_; - } - - // invalid_value - // - inline invalid_value:: - invalid_value (const std::string& option, - const std::string& value) - : option_ (option), value_ (value) - { - } - - inline const std::string& invalid_value:: - option () const - { - return option_; - } - - inline const std::string& invalid_value:: - value () const - { - return value_; - } - - // file_io_failure - // - inline file_io_failure:: - file_io_failure (const std::string& file) - : file_ (file) - { - } - - inline const std::string& file_io_failure:: - file () const - { - return file_; - } - - // unmatched_quote - // - inline unmatched_quote:: - unmatched_quote (const std::string& argument) - : argument_ (argument) - { - } - - inline const std::string& unmatched_quote:: - argument () const - { - return argument_; - } - - // argv_scanner - // - inline argv_scanner:: - argv_scanner (int& argc, char** argv, bool erase) - : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase) - { - } - - inline argv_scanner:: - argv_scanner (int start, int& argc, char** argv, bool erase) - : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase) - { - } - - inline int argv_scanner:: - end () const - { - return i_; - } - - // argv_file_scanner - // - inline argv_file_scanner:: - argv_file_scanner (int& argc, - char** argv, - const std::string& option, - bool erase) - : argv_scanner (argc, argv, erase), - option_ (option), - skip_ (false) - { - } - - inline argv_file_scanner:: - argv_file_scanner (int start, - int& argc, - char** argv, - const std::string& option, - bool erase) - : argv_scanner (start, argc, argv, erase), - option_ (option), - skip_ (false) - { - } -} - -namespace cli -{ - // mysql_options - // - - inline const bool& mysql_options:: - help () const - { - return this->help_; - } - - inline const std::string& mysql_options:: - user () const - { - return this->user_; - } - - inline bool mysql_options:: - user_specified () const - { - return this->user_specified_; - } - - inline const std::string& mysql_options:: - passwd () const - { - return this->passwd_; - } - - inline bool mysql_options:: - passwd_specified () const - { - return this->passwd_specified_; - } - - inline const std::string& mysql_options:: - db_name () const - { - return this->db_name_; - } - - inline bool mysql_options:: - db_name_specified () const - { - return this->db_name_specified_; - } - - inline const std::string& mysql_options:: - host () const - { - return this->host_; - } - - inline bool mysql_options:: - host_specified () const - { - return this->host_specified_; - } - - inline const unsigned int& mysql_options:: - port () const - { - return this->port_; - } - - inline bool mysql_options:: - port_specified () const - { - return this->port_specified_; - } - - inline const std::string& mysql_options:: - socket () const - { - return this->socket_; - } - - inline bool mysql_options:: - socket_specified () const - { - return this->socket_specified_; - } - - inline const std::string& mysql_options:: - options_file () const - { - return this->options_file_; - } - - inline bool mysql_options:: - options_file_specified () const - { - return this->options_file_specified_; - } -} - -- cgit v1.1 From c85f0af82c3abf2e7d2dfa76351a59d9884395c0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 12 Sep 2010 17:25:13 +0200 Subject: Distribute generated code from out_base --- libcommon/common/makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 7349690..dc1a324 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -79,15 +79,20 @@ $(out_base)/: $(common.l) # Dist. # -$(dist): export sources := $(cxx_tun) $(cli_tun:.cli=.cxx) -$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ +$(dist): sources_dist := $(cxx_tun) +$(dist): export sources := $(sources_dist) $(cli_tun:.cli=.cxx) +$(dist): headers_dist = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): data_dist := $(cli_tun) +$(dist): gen_headers := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) +$(dist): export headers = $(headers_dist) $(gen_headers) +$(dist): gen_dist := $(gen) +$(dist): data_dist := $(cli_tun) config.h.in $(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ $(call vc10projs,libcommon) $(dist): $(gen) - $(call dist-data,$(sources) $(headers) $(data_dist) config.h.in) + $(call dist-data,$(sources_dist) $(headers_dist) $(data_dist)) + $(call dist-data,$(gen_dist)) $(call meta-automake) $(call meta-vc9projs,libcommon) $(call meta-vc10projs,libcommon) -- cgit v1.1 From a9d527ffd7e4a2222d5e80c8110f092af0cb5a74 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 10:42:46 +0200 Subject: Change pragma syntax Change odb pragma namespace to db. Use qualifiers (object, value, and member) to specify type/member name. Add support for mapping C++ types to db types. --- common/auto/test.hxx | 4 +- common/lifecycle/test.hxx | 4 +- common/query/test.hxx | 10 ++--- common/schema/test.hxx | 22 +++++----- common/template/test.hxx | 4 +- common/threads/test.hxx | 4 +- mysql/template/test.hxx | 4 +- mysql/truncation/test.hxx | 8 ++-- mysql/types/test.hxx | 76 +++++++++++++++++----------------- tracer/makefile | 1 + tracer/object/test.hxx | 4 +- tracer/pragma/driver.cxx | 26 ++++++++++++ tracer/pragma/makefile | 101 ++++++++++++++++++++++++++++++++++++++++++++++ tracer/pragma/test.hxx | 42 +++++++++++++++++++ tracer/pragma/test.std | 0 tracer/template/test.hxx | 4 +- tracer/types/test.hxx | 8 ++-- 17 files changed, 247 insertions(+), 75 deletions(-) create mode 100644 tracer/pragma/driver.cxx create mode 100644 tracer/pragma/makefile create mode 100644 tracer/pragma/test.hxx create mode 100644 tracer/pragma/test.std diff --git a/common/auto/test.hxx b/common/auto/test.hxx index c23027e..8c16a21 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -10,7 +10,7 @@ #include -#pragma odb object +#pragma db object struct object { object (const std::string& str) @@ -18,7 +18,7 @@ struct object { } - #pragma odb auto id + #pragma db auto id unsigned long id_; std::string str_; diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 268678c..6db1c7e 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -9,7 +9,7 @@ #include #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -21,7 +21,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; }; diff --git a/common/query/test.hxx b/common/query/test.hxx index 59655f6..3d10cc2 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -12,7 +12,7 @@ #include -#pragma odb object +#pragma db object struct person { person (unsigned long id, @@ -32,17 +32,17 @@ struct person { } - #pragma odb id + #pragma db id unsigned long id_; - #pragma odb column ("first") + #pragma db column ("first") std::string first_name_; typedef std::auto_ptr string_ptr; // @@ tmp - #pragma odb column ("middle") type ("TEXT") + #pragma db column ("middle") type ("TEXT") string_ptr middle_name_; - #pragma odb column ("last") + #pragma db column ("last") std::string last_name_; unsigned short age_; diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 14c5113..d770d8f 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -11,29 +11,29 @@ // Table names. // -#pragma odb object table ("TABLE_EXPLICIT") +#pragma db object table ("TABLE_EXPLICIT") struct table_explicit { - #pragma odb id + #pragma db id unsigned long id_; }; -#pragma odb object +#pragma db object struct table_implicit { - #pragma odb id + #pragma db id unsigned long id_; }; // Column names. // -#pragma odb object +#pragma db object struct column { - #pragma odb id + #pragma db id int m1; - #pragma odb column ("foo") + #pragma db column ("foo") int m2; int m_m3; @@ -45,10 +45,10 @@ struct column // Column types. // -#pragma odb object +#pragma db object struct type { - #pragma odb id + #pragma db id std::string id; // Test default C++ to DB type mapping. @@ -69,10 +69,10 @@ struct type double d; std::string str; - #pragma odb type ("INTEGER UNSIGNED") + #pragma db type ("INTEGER UNSIGNED") bool m1; - #pragma odb transient + #pragma db transient char* m2; }; diff --git a/common/template/test.hxx b/common/template/test.hxx index cb25360..1b945a6 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -8,7 +8,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -20,7 +20,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; }; diff --git a/common/threads/test.hxx b/common/threads/test.hxx index d02fdfd..b9f7777 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -10,7 +10,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id, const std::string& str) @@ -22,7 +22,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index c71a962..abac96e 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -8,7 +8,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -20,7 +20,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; }; diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 4e1c1bc..05cd028 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -9,7 +9,7 @@ #include #include -#pragma odb object table ("test") +#pragma db object table ("test") struct object1 { object1 (unsigned long id) @@ -21,13 +21,13 @@ struct object1 { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; }; -#pragma odb object table ("test") +#pragma db object table ("test") struct object2 { object2 (unsigned long id) @@ -39,7 +39,7 @@ struct object2 { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index f156506..8f3c632 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -154,10 +154,12 @@ operator== (bitfield x, bitfield y) x.d == y.d; } +#pragma db value(bitfield) type ("BIT(4) NOT NULL") + typedef std::set set; typedef std::auto_ptr string_ptr; -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -169,124 +171,124 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; // Integral types. // - #pragma odb type ("BOOL NOT NULL") + #pragma db type ("BOOL NOT NULL") bool bool_; - #pragma odb type ("TINYINT NOT NULL") + #pragma db type ("TINYINT NOT NULL") signed char schar_; - #pragma odb type ("TINYINT UNSIGNED NOT NULL") + #pragma db type ("TINYINT UNSIGNED NOT NULL") unsigned char uchar_; - #pragma odb type ("SMALLINT NOT NULL") + #pragma db type ("SMALLINT NOT NULL") short short_; - #pragma odb type ("SMALLINT UNSIGNED NOT NULL") + #pragma db type ("SMALLINT UNSIGNED NOT NULL") unsigned short ushort_; - #pragma odb type ("MEDIUMINT NOT NULL") + #pragma db type ("MEDIUMINT NOT NULL") int mint_; - #pragma odb type ("MEDIUMINT UNSIGNED NOT NULL") + #pragma db type ("MEDIUMINT UNSIGNED NOT NULL") unsigned int umint_; - #pragma odb type ("INT NOT NULL") + #pragma db type ("INT NOT NULL") int int_; - #pragma odb type ("INT UNSIGNED NOT NULL") + #pragma db type ("INT UNSIGNED NOT NULL") unsigned int uint_; - #pragma odb type ("BIGINT NOT NULL") + #pragma db type ("BIGINT NOT NULL") long long long_long_; - #pragma odb type ("BIGINT UNSIGNED NOT NULL") + #pragma db type ("BIGINT UNSIGNED NOT NULL") unsigned long long ulong_long_; // Float types. // - #pragma odb type ("FLOAT NOT NULL") + #pragma db type ("FLOAT NOT NULL") float float_; - #pragma odb type ("DOUBLE NOT NULL") + #pragma db type ("DOUBLE NOT NULL") double double_; - #pragma odb type ("DECIMAL(6,3) NOT NULL") + #pragma db type ("DECIMAL(6,3) NOT NULL") std::string decimal_; // Data-time types. // - #pragma odb type ("DATE NOT NULL") + #pragma db type ("DATE NOT NULL") date_time date_; - #pragma odb type ("TIME NOT NULL") + #pragma db type ("TIME NOT NULL") date_time time_; - #pragma odb type ("DATETIME NOT NULL") + #pragma db type ("DATETIME NOT NULL") date_time date_time_; - #pragma odb type ("TIMESTAMP NOT NULL") + #pragma db type ("TIMESTAMP NOT NULL") date_time timestamp_; - #pragma odb type ("YEAR NOT NULL") + #pragma db type ("YEAR NOT NULL") short year_; // String and binary types. // - #pragma odb type ("CHAR(128) NOT NULL") + #pragma db type ("CHAR(128) NOT NULL") std::string char_; - #pragma odb type ("BINARY(128) NOT NULL") + #pragma db type ("BINARY(128) NOT NULL") buffer binary_; - #pragma odb type ("VARCHAR(256) NOT NULL") + #pragma db type ("VARCHAR(256) NOT NULL") std::string varchar_; - #pragma odb type ("VARBINARY(256) NOT NULL") + #pragma db type ("VARBINARY(256) NOT NULL") buffer varbinary_; - #pragma odb type ("TINYTEXT NOT NULL") + #pragma db type ("TINYTEXT NOT NULL") std::string tinytext_; - #pragma odb type ("TINYBLOB NOT NULL") + #pragma db type ("TINYBLOB NOT NULL") buffer tinyblob_; - #pragma odb type ("TEXT NOT NULL") + #pragma db type ("TEXT NOT NULL") std::string text_; - #pragma odb type ("BLOB NOT NULL") + #pragma db type ("BLOB NOT NULL") buffer blob_; - #pragma odb type ("MEDIUMTEXT NOT NULL") + #pragma db type ("MEDIUMTEXT NOT NULL") std::string mediumtext_; - #pragma odb type ("MEDIUMBLOB NOT NULL") + #pragma db type ("MEDIUMBLOB NOT NULL") buffer mediumblob_; - #pragma odb type ("LONGTEXT NOT NULL") + #pragma db type ("LONGTEXT NOT NULL") std::string longtext_; - #pragma odb type ("LONGBLOB NOT NULL") + #pragma db type ("LONGBLOB NOT NULL") buffer longblob_; // Other types. // - #pragma odb type ("BIT(4) NOT NULL") + // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value bitfield bit_; - #pragma odb type ("ENUM('red', 'green', 'blue') NOT NULL") + #pragma db type ("ENUM('red', 'green', 'blue') NOT NULL") std::string enum_; - #pragma odb type ("SET('red', 'green', 'blue') NOT NULL") + #pragma db type ("SET('red', 'green', 'blue') NOT NULL") set set_; // Test NULL value. // - #pragma odb type ("TEXT") + #pragma db type ("TEXT") string_ptr null_; bool diff --git a/tracer/makefile b/tracer/makefile index 3e94d91..c94af17 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -8,6 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ object \ +pragma \ transaction \ types diff --git a/tracer/object/test.hxx b/tracer/object/test.hxx index dfa6603..e7adee3 100644 --- a/tracer/object/test.hxx +++ b/tracer/object/test.hxx @@ -8,7 +8,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -20,7 +20,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; }; diff --git a/tracer/pragma/driver.cxx b/tracer/pragma/driver.cxx new file mode 100644 index 0000000..c227d4e --- /dev/null +++ b/tracer/pragma/driver.cxx @@ -0,0 +1,26 @@ +// file : tracer/pragma/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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; + +int +main () +{ +} diff --git a/tracer/pragma/makefile b/tracer/pragma/makefile new file mode 100644 index 0000000..1994267 --- /dev/null +++ b/tracer/pragma/makefile @@ -0,0 +1,101 @@ +# file : tracer/pragma/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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$(out_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 := $(notdir $(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 $<,$< | diff -u $(src_base)/test.std -) + +# 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)) + +# 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 new file mode 100644 index 0000000..2dc499d --- /dev/null +++ b/tracer/pragma/test.hxx @@ -0,0 +1,42 @@ +// file : tracer/template/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 {}; +#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 new file mode 100644 index 0000000..e69de29 diff --git a/tracer/template/test.hxx b/tracer/template/test.hxx index 06d7155..c85ddde 100644 --- a/tracer/template/test.hxx +++ b/tracer/template/test.hxx @@ -8,7 +8,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -20,7 +20,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; }; diff --git a/tracer/types/test.hxx b/tracer/types/test.hxx index 965f133..8537e16 100644 --- a/tracer/types/test.hxx +++ b/tracer/types/test.hxx @@ -15,19 +15,19 @@ typedef int num_t; typedef num_t num_type; -#pragma odb object +#pragma db object struct object1 { typedef int int_type; - #pragma odb id + #pragma db id int_type id_; }; -#pragma odb object +#pragma db object struct object2 { - #pragma odb id + #pragma db id num_type num_; }; -- cgit v1.1 From 3fe2f0f8570ad9b6db2a550d2c313e5367e61fd1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 11:43:09 +0200 Subject: Handle buffer growth in cached result --- mysql/truncation/driver.cxx | 165 ++++++++++++++++++++++++++++++-------------- mysql/truncation/makefile | 3 +- 2 files changed, 116 insertions(+), 52 deletions(-) diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 46350d6..76985f0 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -24,72 +24,135 @@ using namespace odb; int main (int argc, char* argv[]) { + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + try { - auto_ptr db (create_database (argc, argv)); - - // The default pre-allocated buffer is 512 bytes long. + // Test basic operations. // - string long_str (640, 'c'); // This will get the buffer to 1024 - string longer_str (1025, 'b'); + { + auto_ptr db (create_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin_transaction ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin_transaction ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin_transaction ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin_transaction ()); + db->store (o); + t.commit (); + } + + { + transaction t (db->begin_transaction ()); + auto_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } - // Run persist/load so that the initial bindings are established - // (version == 0). + // Test query. // { - object1 o (1); - o.str_ = "test string"; + typedef odb::query query; + typedef odb::result result; - transaction t (db->begin_transaction ()); - db->persist (o); - db->load (1, o); - t.commit (); - } + auto_ptr db (create_database (argc, argv)); - { - object2 o (2); - o.str_ = "test string"; + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; - transaction t (db->begin_transaction ()); - db->persist (o); - db->load (2, o); - t.commit (); - } + transaction t (db->begin_transaction ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); - // Store/load the long string which should trigger buffer growth. - // - { - object1 o (3); - o.str_ = long_str; + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } - transaction t (db->begin_transaction ()); - db->persist (o); - t.commit (); - } + // Test buffer growth with cached result. + // + { + object1 o; - { - transaction t (db->begin_transaction ()); - auto_ptr o (db->load (3)); - assert (o->str_ == long_str); - t.commit (); - } + transaction t (db->begin_transaction ()); - // Store/load longer string. - // - { - object1 o (3); - o.str_ = longer_str; + result r (db->query (query::id >= 20)); + r.cache (); + result::iterator i (r.begin ()); - transaction t (db->begin_transaction ()); - db->store (o); - t.commit (); - } + o.id_ = i->id_; + o.str_ = long_str; - { - transaction t (db->begin_transaction ()); - auto_ptr o (db->load (3)); - assert (o->str_ == longer_str); - t.commit (); + // This forces buffer growth in the middle of result iteration. + // + db->store (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->store (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } } } catch (const odb::exception& e) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index a798c8d..331bc34 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema +$(gen) $(dist): export odb_options += --database mysql --generate-query \ +--generate-schema $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From ec8ce55942fd4a978be36aa14e4efcf804c908ce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 15:08:01 +0200 Subject: Make test options consistent with MySQL --- build/mysql/configure | 4 ++-- build/mysql/mysql | 4 ++-- libcommon/common/common.cxx | 4 ++-- libcommon/common/options.cli | 4 ++-- m4/mysql.m4 | 4 ++-- mysql.options | 13 +++++++------ 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/build/mysql/configure b/build/mysql/configure index c1d6382..a454fc0 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -60,10 +60,10 @@ drv=$dcf_root/db-driver echo "--user '$user'" >$opt if [ "$passwd" != "NULL" ]; then -echo "--passwd '$passwd'" >>$opt +echo "--password '$passwd'" >>$opt fi -echo "--db-name '$db'" >>$opt +echo "--database '$db'" >>$opt echo "--host '$host'" >>$opt echo "--port $port" >>$opt diff --git a/build/mysql/mysql b/build/mysql/mysql index 766e580..c273d56 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -19,11 +19,11 @@ while [ $# -gt 0 ]; do opt="$opt --user=$2" shift 2 ;; - --passwd) + --password) opt="$opt --password=$2" shift 2 ;; - --db-name) + --database) opt="$opt --database=$2" shift 2 ;; diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 960a946..4d2d5f0 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -44,8 +44,8 @@ create_database (int argc, char* argv[], size_t max_connections) return auto_ptr ( new mysql::database ( ops.user (), - ops.passwd_specified () ? &ops.passwd () : 0, - ops.db_name (), + ops.password_specified () ? &ops.password () : 0, + ops.database (), ops.host (), ops.port (), ops.socket_specified () ? &ops.socket () : 0, diff --git a/libcommon/common/options.cli b/libcommon/common/options.cli index 5b87d70..b5db026 100644 --- a/libcommon/common/options.cli +++ b/libcommon/common/options.cli @@ -17,13 +17,13 @@ namespace cli "MySQL database user." }; - std::string --passwd + std::string --password { "", "MySQL database password" }; - std::string --db-name + std::string --database { "", "MySQL database name." diff --git a/m4/mysql.m4 b/m4/mysql.m4 index f40ba6d..b1a9d6a 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -213,12 +213,12 @@ AC_CONFIG_COMMANDS([db.options], fi if test x$mysql_password_set = xyes; then - echo "--passwd '$mysql_password'" >>db.options + echo "--password '$mysql_password'" >>db.options echo 'opt="$opt --password='"$mysql_password"'"' >>db-driver fi if test x$mysql_db_set = xyes; then - echo "--db-name '$mysql_db'" >>db.options + echo "--database '$mysql_db'" >>db.options echo 'opt="$opt --database='"$mysql_db"'"' >>db-driver fi diff --git a/mysql.options b/mysql.options index 54fc174..fe79a7c 100644 --- a/mysql.options +++ b/mysql.options @@ -1,9 +1,10 @@ # Sample MySQL options file used to run the tests. Adjust to # match your MySQL setup. # ---user 'odb_test' ---db-name 'odb_test' -# --password '' -# --host '' -# --port 0 -# --socket '' + +--user odb_test +--database odb_test +# --password +# --host +# --port +# --socket -- cgit v1.1 From 2e69d645360ca3355341762da2087342b06ac5a8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 15:21:57 +0200 Subject: Filter out duplicate files --- libcommon/common/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/makefile b/libcommon/common/makefile index dc1a324..27e0bf2 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -84,7 +84,7 @@ $(dist): export sources := $(sources_dist) $(cli_tun:.cli=.cxx) $(dist): headers_dist = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) $(dist): gen_headers := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) -$(dist): export headers = $(headers_dist) $(gen_headers) +$(dist): export headers = $(sort $(headers_dist) $(gen_headers)) $(dist): gen_dist := $(gen) $(dist): data_dist := $(cli_tun) config.h.in $(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ -- cgit v1.1 From fc667bc8ffe5a2a73d39cfc05e3f403a73bddfac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 17:04:22 +0200 Subject: Handle option parsing exception --- libcommon/common/common.cxx | 58 ++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 4d2d5f0..ed8be69 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -24,34 +24,44 @@ using namespace odb; auto_ptr create_database (int argc, char* argv[], size_t max_connections) { + try + { #ifdef DB_ID_MYSQL - cli::argv_file_scanner scan (argc, argv, "--options-file"); - cli::mysql_options ops (scan); + cli::argv_file_scanner scan (argc, argv, "--options-file"); + cli::mysql_options ops (scan); + + if (ops.help ()) + { + cerr << "Usage: " << argv[0] << " [options]" << endl + << "Options:" << endl; + cli::mysql_options::print_usage (cerr); + exit (0); + } + + auto_ptr f; - if (ops.help ()) + if (max_connections != 0) + f.reset (new mysql::connection_pool_factory (max_connections)); + + return auto_ptr ( + new mysql::database ( + ops.user (), + ops.password_specified () ? &ops.password () : 0, + ops.database (), + ops.host (), + ops.port (), + ops.socket_specified () ? &ops.socket () : 0, + 0, + f)); +#else + return auto_ptr (0); +#endif + } + catch (const cli::exception& e) { - cerr << "Usage: " << argv[0] << " [options]" << endl - << "Options:" << endl; - cli::mysql_options::print_usage (cerr); - exit (0); + cerr << e.what () << endl; + exit (1); } - auto_ptr f; - - if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); - - return auto_ptr ( - new mysql::database ( - ops.user (), - ops.password_specified () ? &ops.password () : 0, - ops.database (), - ops.host (), - ops.port (), - ops.socket_specified () ? &ops.socket () : 0, - 0, - f)); -#else return auto_ptr (0); -#endif } -- cgit v1.1 From 71a46a05f30f6f02186ba2a03b29fae37bf9e585 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 11:59:23 +0200 Subject: Update ODB import stub --- build/import/odb/hxx-cxx.make | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 4d16e5a..c9f3325 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,7 +1,7 @@ # file : build/import/odb/hxx-cxx.make # author : Boris Kolpackov # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. # @@ -51,6 +51,10 @@ endif .PHONY: $(out_base)/%-odb.cxx.hxx.clean +$(out_base)/%-odb.cxx.hxx.clean: cxx_s_suffix := $(cxx_s_suffix) +$(out_base)/%-odb.cxx.hxx.clean: cxx_h_suffix := $(cxx_h_suffix) +$(out_base)/%-odb.cxx.hxx.clean: cxx_i_suffix := $(cxx_i_suffix) + $(out_base)/%-odb.cxx.hxx.clean: $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_s_suffix))) $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_h_suffix))) -- cgit v1.1 From 0c370d056fe0848c8a9cf11c48e423f3f2e97264 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 12:00:03 +0200 Subject: Use options parsing from database instead of our own --- build/import/cli/LICENSE | 21 ----------- build/import/cli/cli-cxx.make | 45 ------------------------ build/import/cli/configuration-rules.make | 15 -------- build/import/cli/configure | 55 ----------------------------- build/import/cli/stub.make | 30 ---------------- libcommon/common/common.cxx | 55 ++++++++++------------------- libcommon/common/common.hxx | 2 +- libcommon/common/makefile | 42 +++++----------------- libcommon/common/options.cli | 58 ------------------------------- 9 files changed, 28 insertions(+), 295 deletions(-) delete mode 100644 build/import/cli/LICENSE delete mode 100644 build/import/cli/cli-cxx.make delete mode 100644 build/import/cli/configuration-rules.make delete mode 100755 build/import/cli/configure delete mode 100644 build/import/cli/stub.make delete mode 100644 libcommon/common/options.cli diff --git a/build/import/cli/LICENSE b/build/import/cli/LICENSE deleted file mode 100644 index db16aa3..0000000 --- a/build/import/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2009-2010 Code Synthesis Tools CC. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/build/import/cli/cli-cxx.make b/build/import/cli/cli-cxx.make deleted file mode 100644 index cb60d37..0000000 --- a/build/import/cli/cli-cxx.make +++ /dev/null @@ -1,45 +0,0 @@ -# file : build/import/cli/cli-cxx.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -# Here we are operating in the importing project's space, not in -# cli's. -# - -# Get the C++ file extensions. -# -$(call include,$(bld_root)/cxx/configuration-static.make) - -cli_pattern := \ -$(out_base)/%.$(cxx_s_suffix) \ -$(out_base)/%.$(cxx_h_suffix) \ -$(out_base)/%.$(cxx_i_suffix) - -$(cli_pattern): cli_options := \ ---hxx-suffix .$(cxx_h_suffix) \ ---ixx-suffix .$(cxx_i_suffix) \ ---cxx-suffix .$(cxx_s_suffix) - -.PRECIOUS: $(cli_pattern) - -ifeq ($(out_base),$(src_base)) - -$(cli_pattern): $(src_base)/%.cli - $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) - -else - -$(cli_pattern): $(src_base)/%.cli | $$(dir $$@). - $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) - -$(cli_pattern): $(out_base)/%.cli | $$(dir $$@). - $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<) -endif - -.PHONY: $(out_base)/%.cxx.cli.clean - -$(out_base)/%.cxx.cli.clean: - $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_s_suffix))) - $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_h_suffix))) - $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_i_suffix))) diff --git a/build/import/cli/configuration-rules.make b/build/import/cli/configuration-rules.make deleted file mode 100644 index 52c334d..0000000 --- a/build/import/cli/configuration-rules.make +++ /dev/null @@ -1,15 +0,0 @@ -# file : build/import/cli/configuration-rules.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -$(dcf_root)/import/cli/configuration-dynamic.make: | $(dcf_root)/import/cli/. - $(call message,,$(scf_root)/import/cli/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/cli/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/cli/configuration-dynamic.make) - -endif diff --git a/build/import/cli/configure b/build/import/cli/configure deleted file mode 100755 index 21a09c5..0000000 --- a/build/import/cli/configure +++ /dev/null @@ -1,55 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/cli/configure -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : MIT; 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 'cli' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed " -$echo "version of 'cli' 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 'cli'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'cli'." -$eche - -out_root=`read_path --directory $src_root` - -fi - -echo cli_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/cli/stub.make b/build/import/cli/stub.make deleted file mode 100644 index 250a5ee..0000000 --- a/build/import/cli/stub.make +++ /dev/null @@ -1,30 +0,0 @@ -# file : build/import/cli/stub.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/cli/configuration-rules.make,$(dcf_root)) - -cli_installed := - -$(call -include,$(dcf_root)/import/cli/configuration-dynamic.make) - -ifdef cli_installed - -ifeq ($(cli_installed),y) - -$(call export,cli: cli,cli-rules: $(scf_root)/import/cli/cli-cxx.make) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/cli/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index ed8be69..730b8ce 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -10,58 +10,39 @@ # include #endif -#ifdef DB_ID_MYSQL +#if defined(DB_ID_MYSQL) # include # include +#else +# error unknown database #endif #include -#include using namespace std; using namespace odb; auto_ptr -create_database (int argc, char* argv[], size_t max_connections) +create_database (int& argc, char* argv[], size_t max_connections) { - try + if (argc > 1 && argv[1] == string ("--help")) { -#ifdef DB_ID_MYSQL - cli::argv_file_scanner scan (argc, argv, "--options-file"); - cli::mysql_options ops (scan); + cerr << "Usage: " << argv[0] << " [options]" << endl + << "Options:" << endl; - if (ops.help ()) - { - cerr << "Usage: " << argv[0] << " [options]" << endl - << "Options:" << endl; - cli::mysql_options::print_usage (cerr); - exit (0); - } +#if defined(DB_ID_MYSQL) + mysql::database::print_usage (cerr); +#endif - auto_ptr f; + exit (0); + } - if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); +#if defined(DB_ID_MYSQL) + auto_ptr f; - return auto_ptr ( - new mysql::database ( - ops.user (), - ops.password_specified () ? &ops.password () : 0, - ops.database (), - ops.host (), - ops.port (), - ops.socket_specified () ? &ops.socket () : 0, - 0, - f)); -#else - return auto_ptr (0); -#endif - } - catch (const cli::exception& e) - { - cerr << e.what () << endl; - exit (1); - } + if (max_connections != 0) + f.reset (new mysql::connection_pool_factory (max_connections)); - return auto_ptr (0); + return auto_ptr (new mysql::database (argc, argv, false, 0, f)); +#endif } diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 57069dc..2a02a12 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -14,6 +14,6 @@ #include LIBCOMMON_EXPORT std::auto_ptr -create_database (int argc, char* argv[], std::size_t max_connections = 0); +create_database (int& argc, char* argv[], std::size_t max_connections = 0); #endif // LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 27e0bf2..41bb776 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -5,12 +5,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -# Options file. -# -cli_tun := options.cli cxx_tun := common.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_base)/common.l @@ -23,10 +20,6 @@ clean := $(out_base)/.clean # Import. # $(call import,\ - $(scf_root)/import/cli/stub.make,\ - cli: cli,cli-rules: cli_rules) - -$(call import,\ $(scf_root)/import/libodb/stub.make,\ l: odb.l,cpp-options: odb.l.cpp-options) @@ -48,18 +41,6 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) -genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(cli) -$(gen): cli := $(cli) -$(gen): cli_options += \ ---generate-specifier \ ---generate-file-scanner \ ---guard-prefix LIBCOMMON_COMMON - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make @echo '// file : libcommon/config.h' >$@ @echo '// author : automatically generated' >>$@ @@ -73,26 +54,23 @@ endif @echo '' >>$@ @echo '#endif // LIBCOMMON_COMMON_CONFIG_H' >>$@ +$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) + # Convenience alias for default target. # $(out_base)/: $(common.l) # Dist. # -$(dist): sources_dist := $(cxx_tun) -$(dist): export sources := $(sources_dist) $(cli_tun:.cli=.cxx) -$(dist): headers_dist = $(subst $(src_base)/,,$(shell find $(src_base) \ +$(dist): export sources := $(cxx_tun) +$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): gen_headers := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) -$(dist): export headers = $(sort $(headers_dist) $(gen_headers)) -$(dist): gen_dist := $(gen) -$(dist): data_dist := $(cli_tun) config.h.in +$(dist): data_dist := config.h.in $(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ $(call vc10projs,libcommon) -$(dist): $(gen) - $(call dist-data,$(sources_dist) $(headers_dist) $(data_dist)) - $(call dist-data,$(gen_dist)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake) $(call meta-vc9projs,libcommon) $(call meta-vc10projs,libcommon) @@ -103,7 +81,6 @@ $(clean): $(common.l).o.clean \ $(common.l.cpp-options).clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean)) $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) # Generated .gitignore. @@ -111,7 +88,7 @@ $(clean): $(common.l).o.clean \ ifeq ($(out_base),$(src_base)) $(common.l): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := config.h $(genf) +$(out_base)/.gitignore: files := config.h $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) @@ -124,7 +101,6 @@ $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/automake.make) -$(call include,$(cli_rules)) $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-l.make) diff --git a/libcommon/common/options.cli b/libcommon/common/options.cli deleted file mode 100644 index b5db026..0000000 --- a/libcommon/common/options.cli +++ /dev/null @@ -1,58 +0,0 @@ -// file : libcommon/common/options.cli -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -include ; - -namespace cli -{ - class mysql_options - { - bool --help {"Print usage information and exit."}; - - std::string --user - { - "", - "MySQL database user." - }; - - std::string --password - { - "", - "MySQL database password" - }; - - std::string --database - { - "", - "MySQL database name." - }; - - std::string --host - { - "", - "MySQL database host name or address (localhost by default)." - }; - - unsigned int --port = 0 - { - "", - "MySQL database port number." - }; - - std::string --socket - { - "", - "MySQL database socket name." - }; - - std::string --options-file - { - "", - "Read additional options from . Each option appearing on a separate - line optionally followed by space and an option value. Empty lines and - lines starting with \cb{#} are ignored." - }; - }; -} -- cgit v1.1 From 0bafcbe779a9e0a3de17a13277e5170e3dc6cce5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 15:16:31 +0200 Subject: Use global flags to get tidier object file names --- common/template/Makefile.am | 4 ++-- libcommon/common/Makefile.am | 4 ++-- mysql/template/Makefile.am | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/template/Makefile.am b/common/template/Makefile.am index ccfe5f0..7338a85 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -7,8 +7,8 @@ EXTRA_DIST = __file__(extra_dist) noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -driver_LDADD = $(top_builddir)/libcommon/common/libcommon.la -driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 6712eaa..67ebcef 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -8,5 +8,5 @@ libcommon_la_SOURCES = __path__(sources) __path__(headers) EXTRA_DIST = __file__(extra_dist) -libcommon_la_CPPFLAGS= -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -DLIBCOMMON_DYNAMIC_LIB -libcommon_la_LDFLAGS = -no-undefined -rpath '$(libdir)' +AM_CPPFLAGS= -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -DLIBCOMMON_DYNAMIC_LIB +AM_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index bfb3327..7f33a6c 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -7,8 +7,8 @@ EXTRA_DIST = __file__(extra_dist) noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -driver_LDADD = $(top_builddir)/libcommon/common/libcommon.la -driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -- cgit v1.1 From 4720008142260ce4f7ff38d815a48334168b8cfb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 15:16:43 +0200 Subject: Update test --- m4/threads.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/m4/threads.m4 b/m4/threads.m4 index 7c32abe..ea547c0 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -5,6 +5,8 @@ dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ +threads_thread_keyword=no + AC_ARG_ENABLE( [threads], AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), @@ -30,6 +32,24 @@ if test x$threads = xcheck; then threads=posix LIBS="$LIBS $PTHREAD_LIBS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" + + # Check if we can use the __thread keyword. + # + AC_MSG_CHECKING([for __thread keyword]) + + CXX_LIBTOOL_LINK_IFELSE( + AC_LANG_SOURCE([[ + __thread int tls_var; + + int + main () + { + tls_var = 0; + } + ]]), + [threads_thread_keyword=yes]) + + AC_MSG_RESULT([$threads_thread_keyword]) fi ;; esac -- cgit v1.1 From b2c0b8afb22134164926d6668e5116cdac115f7d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 15:17:17 +0200 Subject: Print test command --- tester.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tester.in b/tester.in index 34e31a5..2e6ed32 100755 --- a/tester.in +++ b/tester.in @@ -18,6 +18,8 @@ if test -f test.sql; then fi fi +echo ./driver --options-file "$top_builddir/db.options" + if test -f "$srcdir/test.std"; then ./driver --options-file "$top_builddir/db.options" >test.out -- cgit v1.1 From d5fcf4c978ee0a8c4c6cc926ff02ab9d944f12b8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 15:17:37 +0200 Subject: Rename DB_ID_MYSQL to DATABASE_MYSQL --- Makefile.am | 2 +- libcommon/common/common.cxx | 6 +++--- libcommon/common/config.h.in | 2 +- libcommon/common/libcommon-vc10.vcxproj | 8 ++++---- libcommon/common/libcommon-vc9.vcproj | 8 ++++---- libcommon/common/makefile | 2 +- m4/database.m4 | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index 600707e..cfe641c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ SUBDIRS = libcommon tracer common -if DB_ID_MYSQL +if DATABASE_MYSQL SUBDIRS += mysql endif diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 730b8ce..a2a2e64 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -10,7 +10,7 @@ # include #endif -#if defined(DB_ID_MYSQL) +#if defined(DATABASE_MYSQL) # include # include #else @@ -30,14 +30,14 @@ create_database (int& argc, char* argv[], size_t max_connections) cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; -#if defined(DB_ID_MYSQL) +#if defined(DATABASE_MYSQL) mysql::database::print_usage (cerr); #endif exit (0); } -#if defined(DB_ID_MYSQL) +#if defined(DATABASE_MYSQL) auto_ptr f; if (max_connections != 0) diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 06318c4..d0b2bd9 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -9,7 +9,7 @@ #ifndef LIBCOMMON_COMMON_CONFIG_H #define LIBCOMMON_COMMON_CONFIG_H -#undef DB_ID_MYSQL +#undef DATABASE_MYSQL #undef LIBCOMMON_STATIC_LIB #endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj index 74d704b..44034da 100644 --- a/libcommon/common/libcommon-vc10.vcxproj +++ b/libcommon/common/libcommon-vc10.vcxproj @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -106,7 +106,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -126,7 +126,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -148,7 +148,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj index fd7c323..c7ef766 100644 --- a/libcommon/common/libcommon-vc9.vcproj +++ b/libcommon/common/libcommon-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -124,7 +124,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));__upcase__(db_id_)__upcase__(__value__(database));__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -203,7 +203,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -284,7 +284,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(db_id_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 41bb776..fccce1a 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -49,7 +49,7 @@ $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make @echo '#define LIBCOMMON_COMMON_CONFIG_H' >>$@ @echo '' >>$@ ifeq ($(db_id),mysql) - @echo '#define DB_ID_MYSQL 1' >>$@ + @echo '#define DATABASE_MYSQL 1' >>$@ endif @echo '' >>$@ @echo '#endif // LIBCOMMON_COMMON_CONFIG_H' >>$@ diff --git a/m4/database.m4 b/m4/database.m4 index 8fca493..d49c7d2 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -21,7 +21,7 @@ AC_ARG_WITH( ;; mysql) database=mysql - AC_DEFINE([DB_ID_MYSQL], [1], [Using MySQL.]) + AC_DEFINE([DATABASE_MYSQL], [1], [Using MySQL.]) ;; *) AC_MSG_RESULT([]) @@ -36,6 +36,6 @@ AC_ARG_WITH( AC_MSG_RESULT([$database]) AC_SUBST([database]) -AM_CONDITIONAL([DB_ID_MYSQL], [test x$database = xmysql]) +AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) ])dnl -- cgit v1.1 From 7743e389865f12decea06eb11380f5b0e53a283b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Sep 2010 14:24:18 +0200 Subject: Cache result by default --- common/threads/driver.cxx | 3 +-- mysql/truncation/driver.cxx | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 539db5f..9703e29 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -71,7 +71,7 @@ struct task typedef odb::result result; transaction t (db_.begin_transaction ()); - result r (db_.query (query::str == "another value")); + result r (db_.query (query::str == "another value", false)); bool found (false); for (result::iterator i (r.begin ()); i != r.end (); ++i) @@ -136,7 +136,6 @@ test (int argc, char* argv[], size_t max_connections) transaction t (db->begin_transaction ()); result r (db->query ()); - r.cache (); for (result::iterator i (r.begin ()); i != r.end (); ++i) db->erase (i->id_); diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 76985f0..eca11cd 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -131,7 +131,6 @@ main (int argc, char* argv[]) transaction t (db->begin_transaction ()); result r (db->query (query::id >= 20)); - r.cache (); result::iterator i (r.begin ()); o.id_ = i->id_; -- cgit v1.1 From 27f66487bc50ee5086c22f5831d72e4669fba084 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Sep 2010 14:47:07 +0200 Subject: Rename store() to update() --- common/lifecycle/driver.cxx | 2 +- common/threads/driver.cxx | 2 +- libcommon/common/makefile | 2 +- mysql/truncation/driver.cxx | 6 +++--- tracer/object/driver.cxx | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index a7be6d4..5518a40 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -76,7 +76,7 @@ main (int argc, char* argv[]) transaction t (db->begin_transaction ()); auto_ptr o (db->load (1)); o->str_ = "value 2"; - db->store (*o); + db->update (*o); t.commit (); } diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 9703e29..14ca172 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -62,7 +62,7 @@ struct task auto_ptr o (db_.load (id)); assert (o->str_ == "frist object"); o->str_ = "another value"; - db_.store (*o); + db_.update (*o); t.commit (); } diff --git a/libcommon/common/makefile b/libcommon/common/makefile index fccce1a..c9ecdaf 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -80,7 +80,7 @@ $(dist): $(clean): $(common.l).o.clean \ $(common.l.cpp-options).clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .cxx.clean,$(cxx_od)) $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) # Generated .gitignore. diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index eca11cd..d4e50c6 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -84,7 +84,7 @@ main (int argc, char* argv[]) o.str_ = longer_str; transaction t (db->begin_transaction ()); - db->store (o); + db->update (o); t.commit (); } @@ -138,14 +138,14 @@ main (int argc, char* argv[]) // This forces buffer growth in the middle of result iteration. // - db->store (o); + db->update (o); ++i; assert (i->str_ == "test string"); o.id_ = i->id_; o.str_ = longer_str; - db->store (o); + db->update (o); ++i; assert (i->str_ == "test string"); diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index 0d84d0f..c8258b8 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -169,7 +169,7 @@ main () cout << "s 2" << endl; } - // store + // update // cout << "\ntest 010" << endl; { @@ -177,13 +177,13 @@ main () cout << "s 1" << endl; auto_ptr o1 (db.load (1)); cout << "s 2" << endl; - db.store (*o1); + db.update (*o1); cout << "s 3" << endl; t.commit (); cout << "s 4" << endl; } - // store (not exist) + // update (not exist) // cout << "\ntest 011" << endl; { @@ -192,7 +192,7 @@ main () cout << "s 1" << endl; try { - db.store (o1); + db.update (o1); } catch (const object_not_persistent&) { -- cgit v1.1 From e291e5d0661c7980a969a243f8a6512d1b9cf5df Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Sep 2010 18:00:14 +0200 Subject: Make result_iterator::operator* return reference Add load() version that returns the dynamically-allocated instance. --- common/query/driver.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index eede6d8..7e64ca3 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -26,7 +26,7 @@ print (result& r) { for (result::iterator i (r.begin ()); i != r.end (); ++i) { - auto_ptr o (*i); + auto_ptr o (i.load ()); cout << *o << endl; } cout << endl; @@ -112,7 +112,9 @@ main (int argc, char* argv[]) for (result::iterator i (r.begin ()); i != r.end (); ++i) { - cout << i->first_name_; + person& p (*i); + + cout << p.first_name_; if (i->middle_name_.get () != 0) cout << ' ' << *i->middle_name_; -- cgit v1.1 From 26d4b0a333e327d7ef42c67db4c06918bafb1d84 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Sep 2010 19:55:14 +0200 Subject: Redesign value_traits --- common/query/traits.hxx | 12 +++++----- mysql/types/traits.hxx | 61 +++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 39 deletions(-) diff --git a/common/query/traits.hxx b/common/query/traits.hxx index 125929c..43b1bcc 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -17,20 +17,20 @@ namespace odb namespace mysql { template <> - class value_traits > + class value_traits, details::buffer> { public: - typedef std::auto_ptr type; - typedef std::string value_type; - static const image_id_type image_id = id_string; + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; static void set_value (std::auto_ptr& v, - const char* s, + const details::buffer& b, std::size_t n, bool is_null) { - v.reset (is_null ? 0 : new std::string (s, n)); + v.reset (is_null ? 0 : new std::string (b.data (), n)); } static void diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index d113e7d..726135d 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -17,11 +17,12 @@ namespace odb namespace mysql { template <> - class value_traits + class value_traits { public: - typedef date_time type; typedef date_time value_type; + typedef date_time query_type; + typedef MYSQL_TIME image_type; static void set_value (date_time& v, const MYSQL_TIME& i, bool is_null) @@ -56,39 +57,26 @@ namespace odb }; template <> - class value_traits + class value_traits { public: - typedef buffer type; typedef buffer value_type; + typedef buffer query_type; + typedef details::buffer image_type; static void - set_value (buffer& v, const char* s, std::size_t n, bool is_null) + set_value (buffer& v, + const details::buffer& b, + std::size_t n, + bool is_null) { if (!is_null) - v.assign (s, n); + v.assign (b.data (), n); else v.assign (0, 0); } static void - set_image (char* s, - std::size_t c, - std::size_t& n, - bool& is_null, - const buffer& v) - { - is_null = false; - n = v.size (); - - if (n > c) - n = c; - - if (n != 0) - std::memcpy (s, v.data (), n); - } - - static void set_image (details::buffer& b, std::size_t& n, bool& is_null, @@ -106,11 +94,12 @@ namespace odb }; template <> - class value_traits + class value_traits { public: - typedef bitfield type; typedef bitfield value_type; + typedef bitfield query_type; + typedef unsigned char* image_type; static void set_value (bitfield& v, @@ -139,19 +128,24 @@ namespace odb }; template <> - class value_traits + class value_traits { public: - typedef set type; typedef set value_type; + typedef set query_type; + typedef details::buffer image_type; static void - set_value (set& v, const char* s, std::size_t n, bool is_null) + set_value (set& v, + const details::buffer& b, + std::size_t n, + bool is_null) { v.clear (); if (!is_null) { + const char* s (b.data ()); const char* e (s + n); while (s < e) @@ -196,19 +190,20 @@ namespace odb }; template <> - class value_traits > + class value_traits, details::buffer> { public: - typedef std::auto_ptr type; - typedef std::string value_type; + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; static void set_value (std::auto_ptr& v, - const char* s, + const details::buffer& b, std::size_t n, bool is_null) { - v.reset (is_null ? 0 : new std::string (s, n)); + v.reset (is_null ? 0 : new std::string (b.data (), n)); } static void -- cgit v1.1 From 4e540775abb7afa27f299b29943d9182fae445e7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 22 Sep 2010 18:40:58 +0200 Subject: Add database type id as value_traits template argument --- common/query/traits.hxx | 2 +- mysql/types/traits.hxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/query/traits.hxx b/common/query/traits.hxx index 43b1bcc..45c1dc2 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -17,7 +17,7 @@ namespace odb namespace mysql { template <> - class value_traits, details::buffer> + class value_traits, details::buffer, id_string> { public: typedef std::auto_ptr value_type; diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 726135d..250343a 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -16,8 +16,8 @@ namespace odb { namespace mysql { - template <> - class value_traits + template + class value_traits { public: typedef date_time value_type; @@ -57,7 +57,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef buffer value_type; @@ -94,7 +94,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef bitfield value_type; @@ -128,7 +128,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef set value_type; @@ -190,7 +190,7 @@ namespace odb }; template <> - class value_traits, details::buffer> + class value_traits, details::buffer, id_string> { public: typedef std::auto_ptr value_type; -- cgit v1.1 From 6aa83e7fae4be22e8b81aee60262258c6c2d6f0a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 23 Sep 2010 17:20:00 +0200 Subject: Add INSTALL file --- INSTALL | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 4 +- 2 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 INSTALL diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..1d25e7b --- /dev/null +++ b/INSTALL @@ -0,0 +1,133 @@ +In this document we use as the name of the database system you +would like to use. Valid values for are: + + 'mysql' - The MySQL database system + +Prerequisites +============= + + - 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/ + +Building on UNIX +================ + +The following build instructions are for the Linux/UNIX/Mac OS X +operating systems as well as for Cygwin and MinGW on Windows. + +The standard autotools-based build system is used on these platforms. +After unpacking the source code archive, change to the odb-tests +package directory (referred to as odb-tests/ from now on) and run +the configure script, for example: + +./configure --database + +To see the available configuration options run configure with --help: + +./configure --help + +The required --database option specify the database system you would +like to use. + +The configure script expects the directory where the ODB compiler +binary is installed to be in the executable search path (the PATH +environment variable). If that's not the case, you can use the ODB +configure variable to specify the path to the ODB compiler, for +example: + +./configure ODB=/opt/odb/bin/odb + +If the ODB compiler is not installed and you would like to run it +from its build directory instead, you can use the --with-odb configure +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: + +./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: + +./configure --with-libodb=/tmp/libodb + +For each value the configure script has a set of options in +the form --with--* that allow you to specify various database +system parameters, such as the login name, password, and database name, +that should be used when running the tests. Run configure with +--help to see the available options for your database. + +As another example, the following configure command uses the specified +C++ compiler and compiles with optimization and without the debug +information: + +./configure CXX=g++-4.5 CXXFLAGS=-O3 + +Once configuration is complete, run make to build the tests: + +make + +Once the build completes successfully you can run the tests using the check +target: + +make check + + +Building on Windows +=================== + +The following build instructions are for Windows using Microsoft Visual +Studio. If you would like to build odb-tests with GCC either using +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 VC++ Directories Include and Library search lists. See the INSTALL +files in the library packages for more information on how to setup the +VC++ Directories. + +There are two ways to build the tests with Visual Studio. After unpacking +the source code archive, you can manually open three solution files located +in the tracer\, common\, and \ directories in theodb-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\ directory it +is named common--vc.sln. And in the \ directory it +is named -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. + +Alternatively, you can use the build.bat batch file located in the +odb-tests\ directory to build all solutions, in all configurations and for +all platforms automatically. The build.bat file has the following command +line interface: + +build.bat [/Build|/Clean|/Rebuild] + +Where is the version of Visual Studio that you are using. If no action +is specified, the default is /Build. + +Once the build completes successfully, you can run all the tests using the +test.bat batch file located in the odb-tests\ directory. + +Before you can run test.bat, you may need to adjust the database system +parameters, such as the login name, password, and database name, that +should be used when running the tests. To do this edit the +.options and -driver.bat files located in the +odb-tests\ directory. Once this is done you can run the tests by +executing the following command from the command prompt: + +test.bat diff --git a/makefile b/makefile index 9748e4e..9cabb96 100644 --- a/makefile +++ b/makefile @@ -19,8 +19,8 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) -$(dist): data_dist := GPLv2 LICENSE README version test.bat tester.bat \ -mysql-driver.bat mysql.options +$(dist): data_dist := GPLv2 LICENSE README INSTALL version test.bat \ +tester.bat mysql-driver.bat mysql.options $(dist): exec_dist := bootstrap tester.in $(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat $(dist): export version = $(shell cat $(src_root)/version) -- cgit v1.1 From 8534cc970698d99c875cf6fc7be5cffbc4a5768a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 25 Sep 2010 01:21:06 +0200 Subject: Improve pthread test --- m4/acx-pthread.m4 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 index feeb01d..4be477f 100644 --- a/m4/acx-pthread.m4 +++ b/m4/acx-pthread.m4 @@ -128,8 +128,15 @@ case "${host_cpu}-${host_os}" in # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + # CS: Move -mt to the front of the list; Sun CC will use -mt, + # gcc will use -pthreads. + # + acx_pthread_flags="-mt -pthreads pthread -pthread $acx_pthread_flags" ;; + + *-darwin*) + acx_pthread_flags="-pthread $acx_pthread_flags" + ;; esac if test x"$acx_pthread_ok" = xno; then -- cgit v1.1 From fc1dda8b6cf5be67beac3ba387c646a26238bc66 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Sep 2010 10:17:49 +0200 Subject: More fixes to pthread test --- m4/acx-pthread.m4 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 index 4be477f..ffa3dfa 100644 --- a/m4/acx-pthread.m4 +++ b/m4/acx-pthread.m4 @@ -133,10 +133,6 @@ case "${host_cpu}-${host_os}" in # acx_pthread_flags="-mt -pthreads pthread -pthread $acx_pthread_flags" ;; - - *-darwin*) - acx_pthread_flags="-pthread $acx_pthread_flags" - ;; esac if test x"$acx_pthread_ok" = xno; then -- cgit v1.1 From 0bda919deabcca2769088b90496538ea37393630 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 18:34:45 +0200 Subject: Use libtool only to link --- m4/libtool-link.m4 | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 229b270..d73c508 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -11,8 +11,6 @@ dnl linking and it does this using the C++ compiler. dnl AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[ AC_LANG_SAVE -save_CXX="$CXX" -CXX="./libtool --tag=CXX --mode=link $CXX -no-install" AC_LANG(C++) if test -d .libs; then @@ -21,11 +19,29 @@ else delete_libs_dir=yes fi -AC_LINK_IFELSE([$1], [$2], [$3]) +AC_COMPILE_IFELSE([$1], +[ + ac_try='./libtool --tag=CXX --mode=link $CXX -no-install $CXXFLAGS $LDFLAGS -o conftest conftest.$OBJEXT $LIBS >&AS_MESSAGE_LOG_FD' + if _AC_DO_VAR(ac_try); then + libtool_link_ok=yes + else + libtool_link_ok=no + fi +], +[ + libtool_link_ok=no +]) -if test x"$delete_libs_dir" != xyes; then +if test x"$delete_libs_dir" = xyes; then rm -rf .libs fi -CXX="$save_CXX" +if test x"$libtool_link_ok" = xyes; then +[$2] +: +else +[$3] +: +fi + AC_LANG_RESTORE])dnl -- cgit v1.1 From 473739b257dc50522a514ec5595eb47b94d01d9b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 18:36:11 +0200 Subject: Extract bit-field in endian-portable manner --- mysql/types/test.hxx | 6 +++--- mysql/types/traits.hxx | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 8f3c632..d950a9a 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -38,7 +38,7 @@ struct date_time } bool - operator== (const date_time& y) + operator== (const date_time& y) const { return negative == y.negative && @@ -126,7 +126,7 @@ struct buffer } bool - operator== (const buffer& y) + operator== (const buffer& y) const { return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; } @@ -292,7 +292,7 @@ struct object string_ptr null_; bool - operator== (const object& y) + operator== (const object& y) const { return id_ == y.id_ && diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 250343a..7d42798 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -108,9 +108,14 @@ namespace odb bool is_null) { if (!is_null) - std::memcpy (&v, s, 1); + { + v.a = *s & 1; + v.b = (*s >> 1) & 1; + v.c = (*s >> 2) & 1; + v.d = (*s >> 3) & 1; + } else - std::memset (&v, 0, sizeof (bitfield)); + v.a = v.b = v.c = v.d = 0; } static void @@ -122,8 +127,7 @@ namespace odb { is_null = false; n = 1; - std::memcpy (s, &v, 1); - s[0] &= 0x0F; // Clear unused bits -- MySQL is sensitive about that. + *s = v.a | (v.b << 1) | (v.c << 2) | (v.d << 3); } }; -- cgit v1.1 From f302456dbb4ad531251235c550cfc4ba7cad0db7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 18:44:47 +0200 Subject: Update README file --- README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README b/README index 38d4c87..b6705b9 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ -ODB is an object-relational mapping (ORM) system for C++. - -@@ - +ODB is an object-relational mapping (ORM) system for C++. It provides +tools, APIs, and library support that allow you to persist C++ objects +to a relational database (RDBMS) without having to deal with tables, +columns, or SQL and without manually writing any of the mapping code. For more information see: http://www.codesynthesis.com/products/odb/ -- cgit v1.1 From 094c3506f328aa5ab541116a917bf687d98ba2ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 19:11:42 +0200 Subject: Minor documentation fixes --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 1d25e7b..b35e2c5 100644 --- a/INSTALL +++ b/INSTALL @@ -101,7 +101,7 @@ VC++ Directories. There are two ways to build the tests with Visual Studio. After unpacking the source code archive, you can manually open three solution files located -in the tracer\, common\, and \ directories in theodb-tests package +in the tracer\, common\, and \ 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\ directory it is named common--vc.sln. And in the \ directory it -- cgit v1.1 From 125f9cbb22ab368f40b93bc3013846b812124b02 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 19:58:06 +0200 Subject: Minor documentation fixes --- INSTALL | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/INSTALL b/INSTALL index b35e2c5..5eac30f 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ -In this document we use as the name of the database system you -would like to use. Valid values for are: +In this document we use to refer to the name of the database +system you would like to use. Valid values for are: 'mysql' - The MySQL database system @@ -28,7 +28,7 @@ To see the available configuration options run configure with --help: ./configure --help -The required --database option specify the database system you would +The required --database option specifies the database system you would like to use. The configure script expects the directory where the ODB compiler @@ -68,8 +68,7 @@ that should be used when running the tests. Run configure with --help to see the available options for your database. As another example, the following configure command uses the specified -C++ compiler and compiles with optimization and without the debug -information: +C++ compiler and compiles with optimization and without debug information: ./configure CXX=g++-4.5 CXXFLAGS=-O3 @@ -77,8 +76,8 @@ Once configuration is complete, run make to build the tests: make -Once the build completes successfully you can run the tests using the check -target: +Once the build is completed successfully you can run the tests using +the check target: make check @@ -110,9 +109,9 @@ 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. -Alternatively, you can use the build.bat batch file located in the -odb-tests\ directory to build all solutions, in all configurations and for -all platforms automatically. The build.bat file has the following command +Alternatively, you can use the build.bat batch file located in the odb-tests\ +directory to build all the solutions, for all the configurations and for all +the platforms automatically. The build.bat file has the following command line interface: build.bat [/Build|/Clean|/Rebuild] @@ -120,14 +119,14 @@ build.bat [/Build|/Clean|/Rebuild] Where is the version of Visual Studio that you are using. If no action is specified, the default is /Build. -Once the build completes successfully, you can run all the tests using the -test.bat batch file located in the odb-tests\ directory. +Once the build is completeed successfully, you can run all the tests using +the test.bat batch file located in the odb-tests\ directory. Before you can run test.bat, you may need to adjust the database system parameters, such as the login name, password, and database name, that -should be used when running the tests. To do this edit the +should be used when running the tests. To do this, edit the .options and -driver.bat files located in the -odb-tests\ directory. Once this is done you can run the tests by +odb-tests\ directory. Once this is, done you can run the tests by executing the following command from the command prompt: test.bat -- cgit v1.1 From 23bdd06c5ec17206d2dfb75ad55b3c613921dce7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Sep 2010 20:14:08 +0200 Subject: Rename begin_transaction() to begin() --- common/auto/driver.cxx | 4 ++-- common/lifecycle/driver.cxx | 16 ++++++++-------- common/query/driver.cxx | 28 ++++++++++++++-------------- common/schema/driver.cxx | 2 +- common/template/driver.cxx | 2 +- common/threads/driver.cxx | 10 +++++----- mysql/template/driver.cxx | 2 +- mysql/truncation/driver.cxx | 16 ++++++++-------- mysql/types/driver.cxx | 4 ++-- tracer/object/driver.cxx | 24 ++++++++++++------------ tracer/template/driver.cxx | 2 +- tracer/transaction/driver.cxx | 14 +++++++------- 12 files changed, 62 insertions(+), 62 deletions(-) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 4a65725..d912ad9 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -34,7 +34,7 @@ main (int argc, char* argv[]) object o2 ("two"); object o3 ("three"); - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o1); db->persist (o2); db->persist (o3); @@ -50,7 +50,7 @@ main (int argc, char* argv[]) } { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o1 (db->load (id1)); auto_ptr o2 (db->load (id2)); auto_ptr o3 (db->load (id3)); diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 5518a40..f836a2b 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -32,7 +32,7 @@ main (int argc, char* argv[]) // try { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); assert (false); t.commit (); @@ -47,13 +47,13 @@ main (int argc, char* argv[]) object o (1); o.str_ = "value 1"; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); t.commit (); try { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); assert (false); t.commit (); @@ -64,7 +64,7 @@ main (int argc, char* argv[]) } { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); assert (o->str_ == "value 1"); t.commit (); @@ -73,7 +73,7 @@ main (int argc, char* argv[]) // modified // { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); o->str_ = "value 2"; db->update (*o); @@ -81,7 +81,7 @@ main (int argc, char* argv[]) } { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); assert (o->str_ == "value 2"); t.commit (); @@ -90,7 +90,7 @@ main (int argc, char* argv[]) // transient // { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); db->erase (*o); t.commit (); @@ -98,7 +98,7 @@ main (int argc, char* argv[]) try { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (1)); assert (false); t.commit (); diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 7e64ca3..0c299f2 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -55,7 +55,7 @@ main (int argc, char* argv[]) person p4 (4, "Johansen", "Johansen", 32, false); p4.middle_name_.reset (new string ("J")); - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (p1); db->persist (p2); db->persist (p3); @@ -90,7 +90,7 @@ main (int argc, char* argv[]) // cout << "test 001" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query ()); for (result::iterator i (r.begin ()); i != r.end (); ++i) @@ -107,7 +107,7 @@ main (int argc, char* argv[]) // cout << "test 002" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query ("ORDER BY age")); for (result::iterator i (r.begin ()); i != r.end (); ++i) @@ -131,7 +131,7 @@ main (int argc, char* argv[]) // cout << "test 003" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query ("age >= 30 AND last = 'Doe'")); print (r); t.commit (); @@ -141,7 +141,7 @@ main (int argc, char* argv[]) // cout << "test 004" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); const char* name = "Doe"; @@ -158,7 +158,7 @@ main (int argc, char* argv[]) // cout << "test 005" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); string name; unsigned short age; @@ -236,7 +236,7 @@ main (int argc, char* argv[]) // cout << "test 006" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::middle_name.is_null ())); print (r); r = db->query (query::middle_name.is_not_null ()); @@ -248,7 +248,7 @@ main (int argc, char* argv[]) // cout << "test 007" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::married)); print (r); r = db->query (!query::married); @@ -262,7 +262,7 @@ main (int argc, char* argv[]) { string name ("Dirt"); - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::last_name == "Doe")); print (r); r = db->query (query::last_name == query::_val (name)); @@ -278,7 +278,7 @@ main (int argc, char* argv[]) // cout << "test 009" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); // == // @@ -317,7 +317,7 @@ main (int argc, char* argv[]) // cout << "test 010" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); // && // @@ -353,7 +353,7 @@ main (int argc, char* argv[]) // cout << "test 011" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::first_name.in ("John", "Jane"))); print (r); @@ -368,7 +368,7 @@ main (int argc, char* argv[]) // cout << "test 012" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::first_name == query::last_name)); print (r); t.commit (); @@ -378,7 +378,7 @@ main (int argc, char* argv[]) // cout << "test 013" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::middle_name == "Squeaky")); print (r); t.commit (); diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index e189b23..74321e3 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -32,7 +32,7 @@ main (int argc, char* argv[]) // cout << "test 001" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); t.commit (); } } diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 495365b..8fc92b8 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -32,7 +32,7 @@ main (int argc, char* argv[]) // cout << "test 001" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); t.commit (); } } diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 14ca172..bbd0ac0 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -50,7 +50,7 @@ struct task object o2 (id + 1, "second object"); object o3 (id + 2, "third object"); - transaction t (db_.begin_transaction ()); + transaction t (db_.begin ()); db_.persist (o1); db_.persist (o2); db_.persist (o3); @@ -58,7 +58,7 @@ struct task } { - transaction t (db_.begin_transaction ()); + transaction t (db_.begin ()); auto_ptr o (db_.load (id)); assert (o->str_ == "frist object"); o->str_ = "another value"; @@ -70,7 +70,7 @@ struct task typedef odb::query query; typedef odb::result result; - transaction t (db_.begin_transaction ()); + transaction t (db_.begin ()); result r (db_.query (query::str == "another value", false)); bool found (false); @@ -87,7 +87,7 @@ struct task } { - transaction t (db_.begin_transaction ()); + transaction t (db_.begin ()); db_.erase (id); t.commit (); } @@ -134,7 +134,7 @@ test (int argc, char* argv[], size_t max_connections) { typedef odb::result result; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query ()); for (result::iterator i (r.begin ()); i != r.end (); ++i) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 45a73eb..5e4d6b3 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -32,7 +32,7 @@ main (int argc, char* argv[]) // cout << "test 001" << endl; { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); t.commit (); } } diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index d4e50c6..97c7b94 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -43,7 +43,7 @@ main (int argc, char* argv[]) object1 o (1); o.str_ = "test string"; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); db->load (1, o); t.commit (); @@ -53,7 +53,7 @@ main (int argc, char* argv[]) object2 o (2); o.str_ = "test string"; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); db->load (2, o); t.commit (); @@ -65,13 +65,13 @@ main (int argc, char* argv[]) object1 o (3); o.str_ = long_str; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); t.commit (); } { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (3)); assert (o->str_ == long_str); t.commit (); @@ -83,13 +83,13 @@ main (int argc, char* argv[]) object1 o (3); o.str_ = longer_str; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->update (o); t.commit (); } { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o (db->load (3)); assert (o->str_ == longer_str); t.commit (); @@ -111,7 +111,7 @@ main (int argc, char* argv[]) object1 o (20); o.str_ = "test string"; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); o.id_++; db->persist (o); @@ -128,7 +128,7 @@ main (int argc, char* argv[]) { object1 o; - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); result r (db->query (query::id >= 20)); result::iterator i (r.begin ()); diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 2a6c94e..ef87afd 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -83,7 +83,7 @@ main (int argc, char* argv[]) o.set_.insert ("blue"); { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); db->persist (o); t.commit (); } @@ -91,7 +91,7 @@ main (int argc, char* argv[]) // // { - transaction t (db->begin_transaction ()); + transaction t (db->begin ()); auto_ptr o1 (db->load (1)); t.commit (); diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index c8258b8..085c6a3 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -47,7 +47,7 @@ main () cout << "\ntest 002" << endl; { object o1 (1); - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; db.persist (o1); cout << "s 2" << endl; @@ -60,7 +60,7 @@ main () cout << "\ntest 003" << endl; { object o1 (0); - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; try { @@ -79,7 +79,7 @@ main () { object o1 (1); object o2 (2); - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; db.persist (o1); db.persist (o2); @@ -96,7 +96,7 @@ main () cout << "\ntest 005" << endl; { object o1 (0); - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; try { @@ -113,7 +113,7 @@ main () // cout << "\ntest 006" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; auto_ptr o1 (db.load (1)); cout << "s 2" << endl; @@ -125,7 +125,7 @@ main () // cout << "\ntest 007" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; try { @@ -143,7 +143,7 @@ main () cout << "\ntest 008" << endl; { object o1; - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; db.load (1, o1); cout << "s 2" << endl; @@ -156,7 +156,7 @@ main () cout << "\ntest 009" << endl; { object o1; - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; try { @@ -173,7 +173,7 @@ main () // cout << "\ntest 010" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; auto_ptr o1 (db.load (1)); cout << "s 2" << endl; @@ -188,7 +188,7 @@ main () cout << "\ntest 011" << endl; { object o1 (0); - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; try { @@ -205,7 +205,7 @@ main () // cout << "\ntest 012" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; auto_ptr o1 (db.find (1)); assert (o1.get () != 0); @@ -221,7 +221,7 @@ main () cout << "\ntest 013" << endl; { object o1; - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); cout << "s 1" << endl; bool r (db.find (1, o1)); assert (r); diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx index c727fac..3b92d4f 100644 --- a/tracer/template/driver.cxx +++ b/tracer/template/driver.cxx @@ -29,7 +29,7 @@ main () // cout << "test 001" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); t.commit (); } } diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index 2fd8e06..92ce0f0 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -28,7 +28,7 @@ main () // cout << "test 001" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); assert (&t.database () == &db); assert (transaction::has_current ()); assert (&transaction::current () == &t); @@ -38,7 +38,7 @@ main () // cout << "test 002" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); t.commit (); } @@ -46,7 +46,7 @@ main () // cout << "test 003" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); t.rollback (); } @@ -54,17 +54,17 @@ main () // cout << "test 004" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); } // Nested transaction. // cout << "test 005" << endl; { - transaction t (db.begin_transaction ()); + transaction t (db.begin ()); try { - transaction n (db.begin_transaction ()); + transaction n (db.begin ()); } catch (const already_in_transaction&) { @@ -78,7 +78,7 @@ main () { assert (sizeof (tracer::transaction) == sizeof (transaction)); - tracer::transaction t (db.begin_transaction ()); + tracer::transaction t (db.begin ()); tracer::transaction& r (tracer::transaction::current ()); assert (&t == &r); } -- cgit v1.1 From ea105c75201565e5da22ff561090c147aee5afe7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Sep 2010 12:49:44 +0200 Subject: Bump version to 1.0.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index ad6d2a9..afaf360 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.0.a1 \ No newline at end of file +1.0.0 \ No newline at end of file -- cgit v1.1 From cbe21006dde1501ccd1d9e28c2317f9346433be9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Oct 2010 14:40:48 +0200 Subject: Bump version to 1.1.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index afaf360..ce6122e 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.1.0.a1 \ No newline at end of file -- cgit v1.1 From c2bb4633ac31e1933908dc73476ce9ddffff8dad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2010 18:21:39 +0200 Subject: Add support for persistent classes without default ctors New test: common/ctor. --- common/ctor/driver.cxx | 80 +++++++++++++++++++++++++++++++++++++ common/ctor/makefile | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ common/ctor/test.hxx | 31 +++++++++++++++ common/ctor/test.std | 0 common/makefile | 1 + 5 files changed, 218 insertions(+) create mode 100644 common/ctor/driver.cxx create mode 100644 common/ctor/makefile create mode 100644 common/ctor/test.hxx create mode 100644 common/ctor/test.std diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx new file mode 100644 index 0000000..78d5b4b --- /dev/null +++ b/common/ctor/driver.cxx @@ -0,0 +1,80 @@ +// file : common/ctor/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test support for persistent objects without default constructors. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + typedef odb::result result; + + auto_ptr db (create_database (argc, argv)); + + person p1 ("John", "Doe", 30); + person p2 ("Jane", "Doe", 29); + person p3 ("Joe", "Dirt", 31); + + { + transaction t (db->begin ()); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + + t.commit (); + } + + { + person p ("", "", 0); + + transaction t (db->begin ()); + + db->load (p1.id_, p); + + assert (p.first_ == p1.first_); + assert (p.last_ == p1.last_); + assert (p.age_ == p1.age_); + + result r (db->query (query::age < 30)); + + assert (r.size () == 1); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + i.load (p); + + assert (p.first_ == "Jane"); + assert (p.last_ == "Doe"); + assert (p.age_ == 29); + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/ctor/makefile b/common/ctor/makefile new file mode 100644 index 0000000..4dcd10c --- /dev/null +++ b/common/ctor/makefile @@ -0,0 +1,106 @@ +# file : common/ctor/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema \ +--generate-query +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/ctor/test.hxx b/common/ctor/test.hxx new file mode 100644 index 0000000..3d08ed0 --- /dev/null +++ b/common/ctor/test.hxx @@ -0,0 +1,31 @@ +// file : common/ctor/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct person +{ + person (const std::string& first, + const std::string& last, + unsigned short age) + : first_ (first), last_ (last), age_ (age) + { + } + + #pragma db id auto + unsigned long id_; + + std::string first_; + std::string last_; + unsigned short age_; +}; + +#endif // TEST_HXX diff --git a/common/ctor/test.std b/common/ctor/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 346b8f8..6328cb1 100644 --- a/common/makefile +++ b/common/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ +ctor \ schema \ template \ lifecycle \ -- cgit v1.1 From f4c94ca015b123ec01037e521582d3a04f4c4b81 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Oct 2010 11:23:21 +0200 Subject: Implement inclusion of dependant -odb headers New test: tracer/include. --- tracer/include/driver.cxx | 41 ++++++++++++++++++++++ tracer/include/makefile | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 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 | 3 +- 15 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 tracer/include/driver.cxx create mode 100644 tracer/include/makefile create mode 100644 tracer/include/obj1.hxx create mode 100644 tracer/include/obj2.hxx create mode 100644 tracer/include/obj3.hxx create mode 100644 tracer/include/objs1.hxx create mode 100644 tracer/include/objs2.hxx create mode 100644 tracer/include/objs3.hxx create mode 100644 tracer/include/objs4.hxx create mode 100644 tracer/include/test.std create mode 100644 tracer/include/test1.hxx create mode 100644 tracer/include/test2.hxx create mode 100644 tracer/include/test3.hxx create mode 100644 tracer/include/test4.hxx diff --git a/tracer/include/driver.cxx b/tracer/include/driver.cxx new file mode 100644 index 0000000..111f542 --- /dev/null +++ b/tracer/include/driver.cxx @@ -0,0 +1,41 @@ +// file : tracer/include/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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; + +int +main () +{ +} diff --git a/tracer/include/makefile b/tracer/include/makefile new file mode 100644 index 0000000..8bb6914 --- /dev/null +++ b/tracer/include/makefile @@ -0,0 +1,87 @@ +# file : tracer/include/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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$(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 $<,$< | diff -u $(src_base)/test.std -) + +# 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)) + +# 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 new file mode 100644 index 0000000..f994c43 --- /dev/null +++ b/tracer/include/obj1.hxx @@ -0,0 +1,27 @@ +// file : tracer/include/obj1.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..d29cbad --- /dev/null +++ b/tracer/include/obj2.hxx @@ -0,0 +1,27 @@ +// file : tracer/include/obj2.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..0490176 --- /dev/null +++ b/tracer/include/obj3.hxx @@ -0,0 +1,27 @@ +// file : tracer/include/obj3.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..3df76ee --- /dev/null +++ b/tracer/include/objs1.hxx @@ -0,0 +1,15 @@ +// file : tracer/include/objs1.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..991fea1 --- /dev/null +++ b/tracer/include/objs2.hxx @@ -0,0 +1,15 @@ +// file : tracer/include/objs2.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..ed72d3c --- /dev/null +++ b/tracer/include/objs3.hxx @@ -0,0 +1,13 @@ +// file : tracer/include/objs3.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..d7d6d97 --- /dev/null +++ b/tracer/include/objs4.hxx @@ -0,0 +1,13 @@ +// file : tracer/include/objs1.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..e69de29 diff --git a/tracer/include/test1.hxx b/tracer/include/test1.hxx new file mode 100644 index 0000000..d3bc35c --- /dev/null +++ b/tracer/include/test1.hxx @@ -0,0 +1,18 @@ +// file : tracer/include/test1.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..9db23c4 --- /dev/null +++ b/tracer/include/test2.hxx @@ -0,0 +1,17 @@ +// file : tracer/include/test2.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..2ff8af7 --- /dev/null +++ b/tracer/include/test3.hxx @@ -0,0 +1,14 @@ +// file : tracer/include/test3.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 new file mode 100644 index 0000000..d6dc74b --- /dev/null +++ b/tracer/include/test4.hxx @@ -0,0 +1,14 @@ +// file : tracer/include/test3.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 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 index c94af17..ef393ad 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -8,6 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ object \ +include \ pragma \ transaction \ types @@ -20,7 +21,7 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := $(notdir $(src_base)) -$(dist): export dirs := $(tests) +$(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) -- cgit v1.1 From d07b467fba9030ddb6940e7c9451f15201faa23d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Oct 2010 17:36:59 +0200 Subject: Implement support for composite value types New test: common/composite. --- common/composite/driver.cxx | 117 ++++++++++++++++++++++++++++++++++++++++++++ common/composite/makefile | 106 +++++++++++++++++++++++++++++++++++++++ common/composite/test.hxx | 79 ++++++++++++++++++++++++++++++ common/composite/test.std | 0 common/makefile | 1 + tracer/pragma/test.hxx | 2 +- 6 files changed, 304 insertions(+), 1 deletion(-) create mode 100644 common/composite/driver.cxx create mode 100644 common/composite/makefile create mode 100644 common/composite/test.hxx create mode 100644 common/composite/test.std diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx new file mode 100644 index 0000000..b1221da --- /dev/null +++ b/common/composite/driver.cxx @@ -0,0 +1,117 @@ +// file : common/composite/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test composite value types. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + person p (1); + p.name_.first = "Joe"; + p.name_.last = "Dirt"; + p.name_.title = "Mr"; + p.name_.alias.first = "Anthony"; + p.name_.alias.last = "Clean"; + p.name_.nick = "Squeaky"; + p.name_.flags.nick = true; + p.name_.flags.alias = false; + p.age_ = 32; + + // + // + { + transaction t (db->begin ()); + db->persist (p); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + p.name_.title = "Mrs"; + p.name_.alias.first = "Anthonia"; + p.name_.flags.nick = false; + p.name_.flags.alias = true; + + // + // + { + transaction t (db->begin ()); + db->update (p); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + typedef odb::query query; + typedef odb::result result; + + // + // + { + transaction t (db->begin ()); + + result r (db->query (query::name::first == "Joe")); + + assert (r.size () == 1); + assert (*r.begin () == p); + + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + + result r (db->query (query::name::flags::alias)); + + assert (r.size () == 1); + assert (*r.begin () == p); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/composite/makefile b/common/composite/makefile new file mode 100644 index 0000000..577cad6 --- /dev/null +++ b/common/composite/makefile @@ -0,0 +1,106 @@ +# file : common/composite/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema \ +--generate-query +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/composite/test.hxx b/common/composite/test.hxx new file mode 100644 index 0000000..d70eefe --- /dev/null +++ b/common/composite/test.hxx @@ -0,0 +1,79 @@ +// file : common/composite/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db value +struct name +{ + std::string first; + std::string last; +}; + +#pragma db value +struct title +{ + std::string title; +}; + +#pragma db value +struct name_flags +{ + bool nick; + bool alias; +}; + +#pragma db value +struct name_ex: name, title +{ + name alias; + std::string nick; + + #pragma db column("show_") + name_flags flags; +}; + +#pragma db object +struct person +{ + person (unsigned long id) + : id_ (id) + { + } + + person () + { + } + + #pragma db id + unsigned long id_; + + #pragma db column("") + name_ex name_; + + unsigned short age_; +}; + +inline bool +operator== (person const& x, person const& y) +{ + return x.id_ == y.id_ && + x.name_.first == y.name_.first&& + x.name_.last == y.name_.last && + x.name_.title == y.name_.title && + x.name_.alias.first == y.name_.alias.first && + x.name_.alias.last == y.name_.alias.last && + x.name_.nick == y.name_.nick && + x.name_.flags.nick == y.name_.flags.nick && + x.name_.flags.alias == y.name_.flags.alias && + x.age_ == y.age_; +} + +#endif // TEST_HXX diff --git a/common/composite/test.std b/common/composite/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 6328cb1..f13d80b 100644 --- a/common/makefile +++ b/common/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ +composite \ ctor \ schema \ template \ diff --git a/tracer/pragma/test.hxx b/tracer/pragma/test.hxx index 2dc499d..c3daac7 100644 --- a/tracer/pragma/test.hxx +++ b/tracer/pragma/test.hxx @@ -10,7 +10,7 @@ #pragma db value(bool) type ("INT") -struct x {}; +struct x {int i;}; #pragma db value (x) namespace N -- cgit v1.1 From d10d9fb09bf53e088c3c54120763b650fd77acd8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 31 Oct 2010 17:40:15 +0200 Subject: Add instructions on building from repository --- INSTALL-GIT | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 INSTALL-GIT diff --git a/INSTALL-GIT b/INSTALL-GIT new file mode 100644 index 0000000..8899bd5 --- /dev/null +++ b/INSTALL-GIT @@ -0,0 +1,72 @@ +The following instructions describe how to work with the source code that was +checked out from the git repository. + +The major difference between using a released source code package and source +code from the repository is that the former does not contain autotools-based +makefiles or Visual Studio project files. Instead, it contains templates for +these files as well as its own, custom build system. This build system is +used for development as well as to automatically generate the autotools and +Visual Studio files. + +This file describes how to use this build system to build the package as well +as to create a release-ready source distribution which contains the autotools +build system and Visual Studio project files. + + +Prerequisites +============= + +Besides the prerequisites listed in the INSTALL file, you will need the +following additional packages: + + - GNU bash >= 2.0.0 http://www.gnu.org/software/bash/ + - GNU make >= 3.81 http://www.gnu.org/software/make/ + - build >= 0.3.8 http://www.codesynthesis.com/projects/build/ + +If you are planning to create the source code distributions, then you will +also need the following packages: + + - GNU m4 >= 1.4.0 http://www.gnu.org/software/m4/ + - GNU sed >= 4.0.0 http://www.gnu.org/software/sed/ + - tofrodos >= 1.7.0 http://www.thefreecountry.com/tofrodos/ + +Any reasonably up to date GNU/Linux installation would normally have all of +the above packages already present, except for build and maybe tofrodos. + + +Configuring and Building +======================== + +To build the source code simply run make in the root directory of the package. +The first time you run make, the build process will also configure the +package by asking you several questions. On the subsequent runs, make will +only rebuild what has changed. + +To run the automated test suite (if any), run 'make test'. To clean the object +files, executables, etc., run 'make clean'. To de-configure the package (that +is, to remove configuration files in addition to objects, executables, etc.), +run 'make disfigure'. + + +Creating Distribution +===================== + +To create the source code distribution, use the dist make target as well as +the dist_prefix variable to specify the directory where the distribution files +should be placed. For example: + +make dist dist_prefix=/tmp/package-1.1.0 + +Once the distribution files are ready, change to the distribution directory +and run the bootstrap script to bootstrap the autotools build system, for +example: + +cd /tmp/package-1.1.0 +./bootsrap + +To create the source code archives, use the autotools build system. First +configuring the package (see the INSTALL file for more information on this +step) and then use the dist target to make the archives, for example: + +./configure +make dist -- cgit v1.1 From 7c715b18cb0c675ba110921c28a94961b3ca481b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 6 Nov 2010 18:06:31 +0200 Subject: Perform two iterations of the test --- common/composite/driver.cxx | 168 ++++++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 78 deletions(-) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index b1221da..05d7298 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -28,85 +28,97 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - person p (1); - p.name_.first = "Joe"; - p.name_.last = "Dirt"; - p.name_.title = "Mr"; - p.name_.alias.first = "Anthony"; - p.name_.alias.last = "Clean"; - p.name_.nick = "Squeaky"; - p.name_.flags.nick = true; - p.name_.flags.alias = false; - p.age_ = 32; - - // - // + for (unsigned short i (0); i < 2; ++i) { - transaction t (db->begin ()); - db->persist (p); - t.commit (); - } - - // - // - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - t.commit (); - - assert (p == *p1); - } - - p.name_.title = "Mrs"; - p.name_.alias.first = "Anthonia"; - p.name_.flags.nick = false; - p.name_.flags.alias = true; - - // - // - { - transaction t (db->begin ()); - db->update (p); - t.commit (); - } - - // - // - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - t.commit (); - - assert (p == *p1); - } - - typedef odb::query query; - typedef odb::result result; - - // - // - { - transaction t (db->begin ()); - - result r (db->query (query::name::first == "Joe")); - - assert (r.size () == 1); - assert (*r.begin () == p); - - t.commit (); - } - - // - // - { - transaction t (db->begin ()); - - result r (db->query (query::name::flags::alias)); - - assert (r.size () == 1); - assert (*r.begin () == p); - - t.commit (); + person p (1); + p.name_.first = "Joe"; + p.name_.last = "Dirt"; + p.name_.title = "Mr"; + p.name_.alias.first = "Anthony"; + p.name_.alias.last = "Clean"; + p.name_.nick = "Squeaky"; + p.name_.flags.nick = true; + p.name_.flags.alias = false; + p.age_ = 32; + + // persist + // + { + transaction t (db->begin ()); + db->persist (p); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + p.name_.title = "Mrs"; + p.name_.alias.first = "Anthonia"; + p.name_.flags.nick = false; + p.name_.flags.alias = true; + + // update + // + { + transaction t (db->begin ()); + db->update (p); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + typedef odb::query query; + typedef odb::result result; + + // query + // + { + transaction t (db->begin ()); + + result r (db->query (query::name::first == "Joe")); + + assert (r.size () == 1); + assert (*r.begin () == p); + + t.commit (); + } + + // query + // + { + transaction t (db->begin ()); + + result r (db->query (query::name::flags::alias)); + + assert (r.size () == 1); + assert (*r.begin () == p); + + t.commit (); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase (1); + t.commit (); + } } } catch (const odb::exception& e) -- cgit v1.1 From 8bc349e2873fde75ecd82c03142ad592d068bddf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 6 Nov 2010 18:06:59 +0200 Subject: Add a test for container persistence --- common/container/driver.cxx | 299 ++++++++++++++++++++++++++++++++++++++++++++ common/container/makefile | 105 ++++++++++++++++ common/container/test.hxx | 152 ++++++++++++++++++++++ common/container/test.std | 0 common/makefile | 1 + 5 files changed, 557 insertions(+) create mode 100644 common/container/driver.cxx create mode 100644 common/container/makefile create mode 100644 common/container/test.hxx create mode 100644 common/container/test.std diff --git a/common/container/driver.cxx b/common/container/driver.cxx new file mode 100644 index 0000000..8355ab1 --- /dev/null +++ b/common/container/driver.cxx @@ -0,0 +1,299 @@ +// file : common/container/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test container persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + med.cs.insert (comp (123, "aaa")); + med.cs.insert (comp (234, "bbbb")); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + full.cs.insert (comp (1234, "aaaa")); + full.cs.insert (comp (2345, "bbbbb")); + full.cs.insert (comp (3456, "cccccc")); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbbb"] = 2345; + full.snm["cccccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbbb")] = "bbbbb"; + full.csm[comp (3456, "cccccc")] = "cccccc"; + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.sl.push_back ("aa"); + empty.ns.insert (12); + empty.ss.insert ("aa"); + empty.cs.insert (comp (12, "aa")); + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + + // + // med + // + + med.num = 0; + med.str = ""; + + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + + med.sl.clear (); + + med.ns.clear (); + med.ss.clear (); + med.cs.clear (); + + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + full.cs.insert (comp (4567, "ddddddd")); + + // map + // + full.nsm[3456] += 'c'; + full.nsm[4567] = "ddddddd"; + + full.snm["cccccc"]++; + full.snm["ddddddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += 'c'; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccccc")] += "c"; + full.csm[comp (4567, "ddddddd")] = "ddddddd"; + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/container/makefile b/common/container/makefile new file mode 100644 index 0000000..450da44 --- /dev/null +++ b/common/container/makefile @@ -0,0 +1,105 @@ +# file : common/container/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/container/test.hxx b/common/container/test.hxx new file mode 100644 index 0000000..cc402ef --- /dev/null +++ b/common/container/test.hxx @@ -0,0 +1,152 @@ +// file : common/container/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include + +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef std::list str_list; + +typedef std::vector num_vector; +typedef std::vector str_vector; +typedef std::vector comp_vector; + +typedef std::set num_set; +typedef std::set str_set; +typedef std::set comp_set; + +typedef std::map num_str_map; +typedef std::map str_num_map; +typedef std::map num_comp_map; +typedef std::map comp_str_map; + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflic" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + std::string str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const std::string& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + std::string id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + comp_vector cv; + + // list + // + #pragma db transient + str_list& sl; + + // set + // + num_set ns; + str_set ss; + comp_set cs; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + + std::string str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + + x.sl == y.sl && + + x.ns == y.ns && + x.ss == y.ss && + x.cs == y.cs && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + + x.str == y.str; +} + +//@@ tmp + +#include + +#endif // TEST_HXX diff --git a/common/container/test.std b/common/container/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index f13d80b..e6675bc 100644 --- a/common/makefile +++ b/common/makefile @@ -8,6 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ composite \ +container \ ctor \ schema \ template \ -- cgit v1.1 From 57653f406505d00c3aaae2c3ba4462ca65637da3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Nov 2010 14:53:59 +0200 Subject: Remove unnecessary inclusion --- common/container/test.hxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/container/test.hxx b/common/container/test.hxx index cc402ef..a12be5c 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -145,8 +145,4 @@ operator== (const object& x, const object& y) x.str == y.str; } -//@@ tmp - -#include - #endif // TEST_HXX -- cgit v1.1 From ebb443f0f2d0cbcb7cc2bc0b48aeef9ee314f7bb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Nov 2010 18:05:06 +0200 Subject: Add support for unidirectional object relationships New test: common/relationship. --- common/makefile | 7 +- common/relationship/driver.cxx | 129 +++++++++++++++++++ common/relationship/makefile | 105 ++++++++++++++++ common/relationship/test.hxx | 250 +++++++++++++++++++++++++++++++++++++ common/relationship/test.std | 0 common/relationship/tr1-memory.hxx | 44 +++++++ 6 files changed, 532 insertions(+), 3 deletions(-) create mode 100644 common/relationship/driver.cxx create mode 100644 common/relationship/makefile create mode 100644 common/relationship/test.hxx create mode 100644 common/relationship/test.std create mode 100644 common/relationship/tr1-memory.hxx diff --git a/common/makefile b/common/makefile index e6675bc..e7878e7 100644 --- a/common/makefile +++ b/common/makefile @@ -10,10 +10,11 @@ auto \ composite \ container \ ctor \ -schema \ -template \ lifecycle \ -query +query \ +relationship \ +schema \ +template thread_tests := threads diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx new file mode 100644 index 0000000..421b909 --- /dev/null +++ b/common/relationship/driver.cxx @@ -0,0 +1,129 @@ +// file : common/relationship/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object relationships. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + aggr a ("aggr"); + a.o1 = new obj1 ("o1", "obj1"); + a.o2.reset (new obj2 ("obj2")); +#ifdef HAVE_TR1_MEMORY + a.o3.reset (new obj3 ("obj3")); + + a.c.num = 123; + a.c.o3.reset (new obj3 ("c")); + + a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); + a.cv.push_back (comp (235, obj3_ptr ())); + a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); +#endif + + a.v1.push_back (new obj1 ("v1 0", "v1 0")); + a.v1.push_back (0); + a.v1.push_back (new obj1 ("v1 2", "v1 2")); + + a.s1.insert (new obj1 ("s1 0", "s1 0")); + a.s1.insert (0); + a.s1.insert (new obj1 ("s1 2", "s1 2")); + + a.m1[0] = new obj1 ("m1 0", "m1 0"); + a.m1[1] = 0; + a.m1[2] = new obj1 ("m1 2", "m1 2"); + + // persist + // + { + transaction t (db->begin ()); + db->persist (*a.o1); + db->persist (*a.o2); +#ifdef HAVE_TR1_MEMORY + db->persist (*a.o3); + + db->persist (*a.c.o3); + + for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) + if (i->o3) + db->persist (*i->o3); +#endif + + for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) + if (*i) + db->persist (**i); + + for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) + if (*i) + db->persist (**i); + + for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) + if (i->second) + db->persist (*i->second); + + db->persist (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + + // test NULL pointer + // + delete a.o1; + a.o1 = 0; + a.o2.reset (); +#ifdef HAVE_TR1_MEMORY + a.o3.reset (); +#endif + + { + transaction t (db->begin ()); + db->update (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/relationship/makefile b/common/relationship/makefile new file mode 100644 index 0000000..82f2f28 --- /dev/null +++ b/common/relationship/makefile @@ -0,0 +1,105 @@ +# file : common/relationship/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/relationship/test.hxx b/common/relationship/test.hxx new file mode 100644 index 0000000..3f624e5 --- /dev/null +++ b/common/relationship/test.hxx @@ -0,0 +1,250 @@ +// file : common/relationship/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include "tr1-memory.hxx" + +#include + +// Naked pointer. +// +struct obj1; +typedef obj1* obj1_ptr; + +#pragma db object pointer(obj1_ptr) +struct obj1 +{ + obj1 () {} + obj1 (const std::string& i, const std::string& s): id (i), str (s) {} + + #pragma db id + std::string id; + + std::string str; +}; + +inline bool +operator== (const obj1& x, const obj1& y) +{ + return x.id == y.id && x.str == y.str; +} + +// vector +// +typedef std::vector obj1_vec; + +inline bool +operator== (const obj1_vec& x, const obj1_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} + +// set +// +struct obj1_ptr_cmp +{ + bool + operator() (obj1_ptr x, obj1_ptr y) const + { + return (!x || !y) ? x < y : x->id < y->id; + } +}; + +typedef std::set obj1_set; + +inline bool +operator== (const obj1_set& x, const obj1_set& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_set::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_set::const_iterator j (y.find (*i)); + + if (j == y.end ()) + return false; + + obj1_ptr x (*i), y (*j); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// map +// +typedef std::map obj1_map; + +inline bool +operator== (const obj1_map& x, const obj1_map& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_map::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_map::const_iterator j (y.find (i->first)); + + if (j == y.end ()) + return false; + + obj1_ptr x (i->second), y (j->second); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// auto_ptr +// +struct obj2; +typedef std::auto_ptr obj2_ptr; + +#pragma db object pointer(obj2_ptr) +struct obj2 +{ + obj2 () {} + obj2 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj2& x, const obj2& y) +{ + return x.id == y.id && x.str == y.str; +} + +// tr1::shared_ptr +// +#ifdef HAVE_TR1_MEMORY +struct obj3; +typedef std::tr1::shared_ptr obj3_ptr; + +#pragma db object pointer(obj3_ptr) +struct obj3 +{ + obj3 () {} + obj3 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj3& x, const obj3& y) +{ + return x.id == y.id && x.str == y.str; +} + +// composite +// +#pragma db value +struct comp +{ + comp () {} + comp (int n, obj3_ptr o): num (n), o3 (o) {} + + int num; + obj3_ptr o3; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && + (x.o3 ? (y.o3 && *x.o3 == *y.o3) : !y.o3); +} + +typedef std::vector comp_vec; +#endif + +// +// +#pragma db object +struct aggr +{ + aggr (): o1 (0) {} + aggr (const std::string& s): o1 (0), str (s) {} + + ~aggr () + { + delete o1; + + for (obj1_vec::iterator i (v1.begin ()); i != v1.end (); ++i) + delete *i; + + for (obj1_set::iterator i (s1.begin ()); i != s1.end (); ++i) + delete *i; + + for (obj1_map::iterator i (m1.begin ()); i != m1.end (); ++i) + delete i->second; + } + + #pragma db id auto + unsigned long id; + + obj1_ptr o1; + obj2_ptr o2; +#ifdef HAVE_TR1_MEMORY + obj3_ptr o3; + comp c; + comp_vec cv; +#endif + + obj1_vec v1; + obj1_set s1; + obj1_map m1; + + std::string str; + +private: + aggr (const aggr&); + aggr& operator= (const aggr&); +}; + +inline bool +operator== (const aggr& x, const aggr& y) +{ + return + x.id == y.id && + (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && + (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && +#ifdef HAVE_TR1_MEMORY + (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && + x.c == y.c && + x.cv == y.cv && +#endif + x.v1 == y.v1 && + x.s1 == y.s1 && + x.m1 == y.m1 && + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/common/relationship/test.std b/common/relationship/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/relationship/tr1-memory.hxx b/common/relationship/tr1-memory.hxx new file mode 100644 index 0000000..27e9da8 --- /dev/null +++ b/common/relationship/tr1-memory.hxx @@ -0,0 +1,44 @@ +// file : common/relationship/tr1-memory.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TR1_MEMORY_HXX +#define TR1_MEMORY_HXX + +// Try to include TR1 in a compiler-specific manner. Define +// HAVE_TR1_MEMORY if successfull. If the compiler does not provide +// native TR1 support, fall-back on the Boost TR1 implementation if +// HAVE_BOOST_TR1 is defined. +// + +#include // __GLIBCXX__, _HAS_TR1 + +// GNU C++ or Intel C++ using libstd++. +// +#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) +# include +# define HAVE_TR1_MEMORY 1 +// +// IBM XL C++. +// +#elif defined (__xlC__) && __xlC__ >= 0x0900 +# define __IBMCPP_TR1__ +# include +# define HAVE_TR1_MEMORY 1 +// +// VC++ or Intel C++ using VC++ standard library. +// +#elif defined (_MSC_VER) && \ + (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) +# include +# define HAVE_TR1_MEMORY 1 +// +// Boost fall-back. +// +#elif defined (HAVE_BOOST_TR1) +# include +# define HAVE_TR1_MEMORY 1 +#endif + +#endif // TR1_MEMORY_HXX -- cgit v1.1 From 919c93546cd45cd7c4cf9df18e1758be51d55e7b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Nov 2010 12:14:01 +0200 Subject: Add missing template argument --- common/query/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 0c299f2..9ff596b 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -77,7 +77,7 @@ main (int argc, char* argv[]) query name_q ("first = " + query::_val (name)); query q (age_q + "AND" + name_q); - db->query (q); + db->query (q); db->query (age_q + "OR" + name_q + "OR" + "age < " + query::_ref (age)); -- cgit v1.1 From 7175c721318723fdcbdda97045c0defa51571f17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Nov 2010 12:14:24 +0200 Subject: Use new pointer-based database operation overloads --- common/relationship/driver.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 421b909..9266e2b 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -58,29 +58,29 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - db->persist (*a.o1); - db->persist (*a.o2); + db->persist (a.o1); + db->persist (a.o2); #ifdef HAVE_TR1_MEMORY - db->persist (*a.o3); + db->persist (a.o3); - db->persist (*a.c.o3); + db->persist (a.c.o3); for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) if (i->o3) - db->persist (*i->o3); + db->persist (i->o3); #endif for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) if (*i) - db->persist (**i); + db->persist (*i); for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) if (*i) - db->persist (**i); + db->persist (*i); for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) if (i->second) - db->persist (*i->second); + db->persist (i->second); db->persist (a); t.commit (); -- cgit v1.1 From ececaecd27d0a9f3d52a5886f68bc8eac4fc5227 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Nov 2010 12:16:22 +0200 Subject: Test const object operations --- common/const/driver.cxx | 212 ++++++++++++++++++++++++++++++++++++++++++++++++ common/const/makefile | 106 ++++++++++++++++++++++++ common/const/test.hxx | 61 ++++++++++++++ common/const/test.std | 0 common/makefile | 1 + 5 files changed, 380 insertions(+) create mode 100644 common/const/driver.cxx create mode 100644 common/const/makefile create mode 100644 common/const/test.hxx create mode 100644 common/const/test.std diff --git a/common/const/driver.cxx b/common/const/driver.cxx new file mode 100644 index 0000000..cc58cf8 --- /dev/null +++ b/common/const/driver.cxx @@ -0,0 +1,212 @@ +// file : common/const/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database operations with const objects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + aggr a (1); + aggr ca_ (2); // o1 and o2 are NULL + const aggr& ca (ca_); + + obj1_ptr o1 (new obj1 (1)); + obj1_ptr co1_ (new obj1 (2)); + obj1_cptr co1 (co1_); + a.o1 = co1; + + obj2_ptr o2 (new obj2 (1)); + obj2* co2_ (new obj2 (2)); + a.o2.reset (co2_); + obj2_cptr& co2 (a.o2); + + // persist via references + // + { + transaction t (db->begin ()); + db->persist (*o1); + db->persist (*co1); + db->persist (*o2); + db->persist (*co2); + db->persist (a); + db->persist (ca); + t.commit (); + } + + // persist via pointers + // + o1->id += 2; + co1_->id += 2; + o2->id += 2; + co2_->id += 2; + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (co1); + db->persist (o2); + db->persist (co2); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a (db->load (1)); + auto_ptr ca (db->load (2)); + t.commit (); + + assert (a->o1->id == 2); + assert (a->o2->id == 2); + + assert (ca->o1 == 0); + assert (ca->o2.get () == 0); + } + + // update via references + // + { + transaction t (db->begin ()); + db->update (*o1); + db->update (*co1); + db->update (*o2); + db->update (*co2); + db->update (a); + db->update (ca); + t.commit (); + } + + // update via pointers + // + { + transaction t (db->begin ()); + db->update (o1); + db->update (co1); + db->update (o2); + db->update (co2); + t.commit (); + } + + // query + // + typedef odb::query query1; + typedef odb::query query2; + + typedef odb::result result1; + typedef odb::result result2; + + { + transaction t (db->begin ()); + result1 r1 (db->query (query1::id < 3)); + + assert (r1.size () == 2); + + for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) + { + // i->f (); // error + i->cf (); + obj1_cptr p (i.load ()); + obj1 o (0); + i.load (o); + assert (p->id == o.id); + delete p; + } + + result2 r2 (db->query (query2::id < 3)); + + assert (r2.size () == 2); + + for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) + { + // i->f (); // error + i->cf (); + obj2_cptr p (i.load ()); + obj2 o (0); + i.load (o); + assert (p->id == o.id); + } + + t.commit (); + } + + // erase via references + // + { + transaction t (db->begin ()); + db->erase (*o1); + db->erase (*co1); + db->erase (*o2); + db->erase (*co2); + db->erase (a); + db->erase (ca); + t.commit (); + } + + // erase via pointers + // + o1->id -= 2; + co1_->id -= 2; + o2->id -= 2; + co2_->id -= 2; + + { + transaction t (db->begin ()); + db->erase (o1); + db->erase (co1); + db->erase (o2); + db->erase (co2); + t.commit (); + } + + // Test session and const/non-const object handling + // + { + session s; + transaction t (db->begin ()); + const obj1 o1 (1); + db->persist (o1); + + try + { + db->load (1); + assert (false); + } + catch (const odb::const_object&) + { + } + + t.commit (); + } + + delete o1; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/const/makefile b/common/const/makefile new file mode 100644 index 0000000..e8759bc --- /dev/null +++ b/common/const/makefile @@ -0,0 +1,106 @@ +# file : common/const/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema \ +--generate-query +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/const/test.hxx b/common/const/test.hxx new file mode 100644 index 0000000..7e8a718 --- /dev/null +++ b/common/const/test.hxx @@ -0,0 +1,61 @@ +// file : common/const/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +struct obj1; +struct obj2; + +typedef obj1* obj1_ptr; +typedef const obj1* obj1_cptr; + +typedef std::auto_ptr obj2_ptr; +typedef std::auto_ptr obj2_cptr; + +#pragma db object pointer (obj1_ptr) +struct obj1 +{ + obj1 () {} + obj1 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object pointer (obj2_ptr) +struct obj2 +{ + obj2 () {} + obj2 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object +struct aggr +{ + aggr (int i): id (i), o1 (0) {} + aggr (): o1 (0) {} + ~aggr () {delete o1;} + + #pragma db id + int id; + + obj1_cptr o1; + obj2_cptr o2; +}; + +#endif // TEST_HXX diff --git a/common/const/test.std b/common/const/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index e7878e7..455926f 100644 --- a/common/makefile +++ b/common/makefile @@ -8,6 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ composite \ +const \ container \ ctor \ lifecycle \ -- cgit v1.1 From 73bcedf1a812136d338da7f274a37b02d0b30b0a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Nov 2010 14:20:22 +0200 Subject: Test one-to-{one,many} inverse relationships --- common/inverse/driver.cxx | 163 ++++++++++++++++++++++++++++++++++++++++++ common/inverse/makefile | 106 +++++++++++++++++++++++++++ common/inverse/test.hxx | 132 ++++++++++++++++++++++++++++++++++ common/inverse/test.std | 0 common/inverse/tr1-memory.hxx | 44 ++++++++++++ common/makefile | 1 + 6 files changed, 446 insertions(+) create mode 100644 common/inverse/driver.cxx create mode 100644 common/inverse/makefile create mode 100644 common/inverse/test.hxx create mode 100644 common/inverse/test.std create mode 100644 common/inverse/tr1-memory.hxx diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx new file mode 100644 index 0000000..e3c8b22 --- /dev/null +++ b/common/inverse/driver.cxx @@ -0,0 +1,163 @@ +// file : common/inverse/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test bidirectional relationships with inverse sides. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Naked pointer version. + // + { + obj1_ptr o1 (new obj1); + obj2_ptr o2 (new obj2); + obj3_ptr o3_1 (new obj3); + obj3_ptr o3_2 (new obj3); + + o1->id = "obj1"; + o1->o2 = o2; + o1->o3.insert (o3_1); + o1->o3.insert (o3_2); + + o2->str = "obj2"; + o2->o1 = o1; + + o3_1->str = "obj3 1"; + o3_1->o1 = o1; + + o3_2->str = "obj3 3"; + o3_2->o1 = o1; + + // persist + // + { + transaction t (db->begin ()); + + // obj2 and obj3 come first to get object id assigned. + // + db->persist (o3_1); + db->persist (o3_2); + db->persist (o2); + db->persist (o1); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + obj2_ptr x2 (db->load (o2->id)); + obj3_ptr x3_1 (db->load (o3_1->id)); + obj3_ptr x3_2 (db->load (o3_2->id)); + t.commit (); + + assert (x2->str == o2->str); + assert (x2->o1->id == o1->id); + assert (x2->o1->o2 == x2); + + assert (x3_1->str == o3_1->str); + assert (x3_2->str == o3_2->str); + assert (x3_1->o1 == x3_2->o1); + assert (x3_1->o1->id == o1->id); + assert (x3_1->o1->o3.find (x3_1) != x3_1->o1->o3.end ()); + assert (x3_1->o1->o3.find (x3_2) != x3_1->o1->o3.end ()); + + delete x2->o1; + } + + delete o1; + } + + // TR1 pointer version. + // +#ifdef HAVE_TR1_MEMORY + { + tr1_obj1_ptr o1 (new tr1_obj1); + tr1_obj2_ptr o2 (new tr1_obj2); + tr1_obj3_ptr o3_1 (new tr1_obj3); + tr1_obj3_ptr o3_2 (new tr1_obj3); + + o1->id = "obj1"; + o1->o2 = o2; + o1->o3.push_back (o3_1); + o1->o3.push_back (o3_2); + + o2->str = "obj2"; + o2->o1 = o1; + + o3_1->str = "obj3 1"; + o3_1->o1 = o1; + + o3_2->str = "obj3 3"; + o3_2->o1 = o1; + + // persist + // + { + transaction t (db->begin ()); + + // obj2 and obj3 come first to get object id assigned. + // + db->persist (o3_1); + db->persist (o3_2); + db->persist (o2); + db->persist (o1); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + tr1_obj2_ptr x2 (db->load (o2->id)); + tr1_obj3_ptr x3_1 (db->load (o3_1->id)); + tr1_obj3_ptr x3_2 (db->load (o3_2->id)); + t.commit (); + + assert (x2->str == o2->str); + assert (x2->o1.lock ()->id == o1->id); + assert (x2->o1.lock ()->o2 == x2); + + assert (x3_1->str == o3_1->str); + assert (x3_2->str == o3_2->str); + assert (x3_1->o1.lock () == x3_2->o1.lock ()); + assert (x3_1->o1.lock ()->id == o1->id); + assert (x3_1->o1.lock ()->o3[0] == x3_1); + assert (x3_1->o1.lock ()->o3[1] == x3_2); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/inverse/makefile b/common/inverse/makefile new file mode 100644 index 0000000..0636dec --- /dev/null +++ b/common/inverse/makefile @@ -0,0 +1,106 @@ +# file : common/inverse/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema \ +--generate-query +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call message,test $<,$< --options-file $(dcf_root)/db.options \ +| diff -u $(src_base)/test.std -) + +# 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)) + +# 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/inverse/test.hxx b/common/inverse/test.hxx new file mode 100644 index 0000000..df93e5d --- /dev/null +++ b/common/inverse/test.hxx @@ -0,0 +1,132 @@ +// file : common/inverse/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include "tr1-memory.hxx" + +#include + +struct obj1; +struct obj2; +struct obj3; + +typedef obj1* obj1_ptr; +typedef obj2* obj2_ptr; +typedef obj3* obj3_ptr; + +typedef std::set obj3_ptr_set; + +#pragma db object +struct obj1 +{ + obj1 (): o2 (0) {} + ~obj1 (); + + #pragma db id + std::string id; + + obj2_ptr o2; + + #pragma db id_column("obj1_id") value_column("obj3_id") + obj3_ptr_set o3; +}; + +#pragma db object +struct obj2 +{ + #pragma db id auto + int id; + + std::string str; + + // one-to-one + // + #pragma db inverse(o2) + obj1_ptr o1; +}; + +#pragma db object +struct obj3 +{ + #pragma db id auto + int id; + + std::string str; + + // one-to-many + // + #pragma db inverse (o3) + obj1_ptr o1; +}; + +inline obj1:: +~obj1 () +{ + delete o2; + for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) + delete *i; +} + +// TR1 version +// +#ifdef HAVE_TR1_MEMORY +struct tr1_obj1; +struct tr1_obj2; +struct tr1_obj3; + +typedef std::tr1::shared_ptr tr1_obj1_ptr; +typedef std::tr1::shared_ptr tr1_obj2_ptr; +typedef std::tr1::shared_ptr tr1_obj3_ptr; + +typedef std::tr1::weak_ptr tr1_obj1_wptr; + +typedef std::vector tr1_obj3_ptr_vec; + +#pragma db object pointer(tr1_obj1_ptr) +struct tr1_obj1 +{ + #pragma db id + std::string id; + + tr1_obj2_ptr o2; + + #pragma db id_column("tr1_obj1_id") value_column("tr1_obj3_id") + tr1_obj3_ptr_vec o3; +}; + +#pragma db object pointer(tr1_obj2_ptr) +struct tr1_obj2 +{ + #pragma db id auto + int id; + + std::string str; + + #pragma db inverse(o2) + tr1_obj1_wptr o1; +}; + +#pragma db object pointer(tr1_obj3_ptr) +struct tr1_obj3 +{ + #pragma db id auto + int id; + + std::string str; + + // one-to-many + // + #pragma db inverse (o3) + tr1_obj1_wptr o1; +}; +#endif + +#endif // TEST_HXX diff --git a/common/inverse/test.std b/common/inverse/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/inverse/tr1-memory.hxx b/common/inverse/tr1-memory.hxx new file mode 100644 index 0000000..76ac932 --- /dev/null +++ b/common/inverse/tr1-memory.hxx @@ -0,0 +1,44 @@ +// file : common/inverse/tr1-memory.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TR1_MEMORY_HXX +#define TR1_MEMORY_HXX + +// Try to include TR1 in a compiler-specific manner. Define +// HAVE_TR1_MEMORY if successfull. If the compiler does not provide +// native TR1 support, fall-back on the Boost TR1 implementation if +// HAVE_BOOST_TR1 is defined. +// + +#include // __GLIBCXX__, _HAS_TR1 + +// GNU C++ or Intel C++ using libstd++. +// +#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) +# include +# define HAVE_TR1_MEMORY 1 +// +// IBM XL C++. +// +#elif defined (__xlC__) && __xlC__ >= 0x0900 +# define __IBMCPP_TR1__ +# include +# define HAVE_TR1_MEMORY 1 +// +// VC++ or Intel C++ using VC++ standard library. +// +#elif defined (_MSC_VER) && \ + (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) +# include +# define HAVE_TR1_MEMORY 1 +// +// Boost fall-back. +// +#elif defined (HAVE_BOOST_TR1) +# include +# define HAVE_TR1_MEMORY 1 +#endif + +#endif // TR1_MEMORY_HXX diff --git a/common/makefile b/common/makefile index 455926f..5794b15 100644 --- a/common/makefile +++ b/common/makefile @@ -11,6 +11,7 @@ composite \ const \ container \ ctor \ +inverse \ lifecycle \ query \ relationship \ -- cgit v1.1 From 73d61594c500352bc9785e08d799ba67d94baa3c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Nov 2010 08:48:31 +0200 Subject: Keep track of extra headers for the dist target --- common/inverse/makefile | 3 ++- common/relationship/makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/inverse/makefile b/common/inverse/makefile index 0636dec..e64cced 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -53,12 +53,13 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) +$(dist): export extra_headers := tr1-memory.hxx $(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 dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) diff --git a/common/relationship/makefile b/common/relationship/makefile index 82f2f28..a1c0a21 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -52,12 +52,13 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) +$(dist): export extra_headers := tr1-memory.hxx $(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 dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) -- cgit v1.1 From 17d444a90d5ab7e4333bf4d17a9a0a3d35104ba4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Nov 2010 08:53:08 +0200 Subject: Bump version to 1.1.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index ce6122e..7e03a1f 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.0.a1 \ No newline at end of file +1.1.0.a2 \ No newline at end of file -- cgit v1.1 From 0799760700c288939bc39ad43f3e167d42406df5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Nov 2010 10:18:09 +0200 Subject: Add support for unordered storage of ordered containers New pragma: unordered. --- common/container/driver.cxx | 12 ++++++++++++ common/container/test.hxx | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/common/container/driver.cxx b/common/container/driver.cxx index 8355ab1..9940c9a 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -57,6 +57,9 @@ main (int argc, char* argv[]) med.cv.push_back (comp (123, "aaa")); med.cv.push_back (comp (234, "bbbb")); + med.uv.push_back (123); + med.uv.push_back (234); + // list // med.sl.push_back ("aaa"); @@ -108,6 +111,10 @@ main (int argc, char* argv[]) full.cv.push_back (comp (2345, "bbbbb")); full.cv.push_back (comp (3456, "cccccc")); + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + // list // full.sl.push_back ("aaaa"); @@ -179,6 +186,7 @@ main (int argc, char* argv[]) empty.nv.push_back (12); empty.sv.push_back ("aa"); empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); empty.sl.push_back ("aa"); empty.ns.insert (12); empty.ss.insert ("aa"); @@ -198,6 +206,7 @@ main (int argc, char* argv[]) med.nv.clear (); med.sv.clear (); med.cv.clear (); + med.uv.clear (); med.sl.clear (); @@ -229,6 +238,9 @@ main (int argc, char* argv[]) full.cv.back ().str += "c"; full.cv.push_back (comp (4567, "ddddddd")); + full.uv.back ()++; + full.uv.push_back (4567); + // list // full.sl.back () += "c"; diff --git a/common/container/test.hxx b/common/container/test.hxx index a12be5c..1f565cd 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -10,7 +10,6 @@ #include #include #include - #include #include @@ -96,6 +95,9 @@ struct object #pragma db value_column("") comp_vector cv; + #pragma db unordered + num_vector uv; + // list // #pragma db transient @@ -120,6 +122,17 @@ struct object inline bool operator== (const object& x, const object& y) { + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + return x.id_ == y.id_ && x.num == y.num && @@ -130,6 +143,7 @@ operator== (const object& x, const object& y) x.nv == y.nv && x.sv == y.sv && x.cv == y.cv && + xs == ys && x.sl == y.sl && -- cgit v1.1 From 9e26a8a565aa4debe8b7eb86aa74ae39af9e7116 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Nov 2010 16:37:09 +0200 Subject: Implement support for many-to-{one,many} inverse relationships --- common/inverse/driver.cxx | 179 +++++++++++++++++++++++++++++++++++++++------- common/inverse/test.hxx | 86 +++++++++++++++++++++- 2 files changed, 235 insertions(+), 30 deletions(-) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index e3c8b22..e572be2 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -32,36 +32,78 @@ main (int argc, char* argv[]) // Naked pointer version. // { - obj1_ptr o1 (new obj1); + obj1_ptr o1_1 (new obj1); + obj1_ptr o1_2 (new obj1); obj2_ptr o2 (new obj2); obj3_ptr o3_1 (new obj3); obj3_ptr o3_2 (new obj3); + obj4_ptr o4_1 (new obj4); + obj4_ptr o4_2 (new obj4); + obj5_ptr o5_1 (new obj5); + obj5_ptr o5_2 (new obj5); + obj5_ptr o5_3 (new obj5); + obj5_ptr o5_4 (new obj5); - o1->id = "obj1"; - o1->o2 = o2; - o1->o3.insert (o3_1); - o1->o3.insert (o3_2); + o1_1->id = "obj1 1"; + o1_1->o2 = o2; + o1_1->o3.insert (o3_1); + o1_1->o3.insert (o3_2); + o1_1->o4 = o4_1; + o1_1->o5.insert (o5_1); + o1_1->o5.insert (o5_2); + + o1_2->id = "obj1 2"; + o1_2->o2 = 0; + o1_2->o3.clear (); + o1_2->o4 = o4_2; + o1_2->o5.insert (o5_3); + o1_2->o5.insert (o5_4); o2->str = "obj2"; - o2->o1 = o1; + o2->o1 = o1_1; o3_1->str = "obj3 1"; - o3_1->o1 = o1; + o3_1->o1 = o1_1; - o3_2->str = "obj3 3"; - o3_2->o1 = o1; + o3_2->str = "obj3 2"; + o3_2->o1 = o1_1; + + o4_1->str = "obj4 1"; + o4_1->o1.insert (o1_1); + + o4_2->str = "obj4 2"; + o4_2->o1.insert (o1_2); + + o5_1->str = "obj5 1"; + o5_1->o1.insert (o1_1); + + o5_2->str = "obj5 2"; + o5_2->o1.insert (o1_1); + + o5_3->str = "obj5 3"; + o5_3->o1.insert (o1_2); + + o5_4->str = "obj5 4"; + o5_4->o1.insert (o1_2); // persist // { transaction t (db->begin ()); - // obj2 and obj3 come first to get object id assigned. + // objN come before obj1 to get object id assigned. // + db->persist (o5_1); + db->persist (o5_2); + db->persist (o5_3); + db->persist (o5_4); + db->persist (o4_1); + db->persist (o4_2); db->persist (o3_1); db->persist (o3_2); db->persist (o2); - db->persist (o1); + db->persist (o1_1); + db->persist (o1_2); t.commit (); } @@ -74,59 +116,127 @@ main (int argc, char* argv[]) obj2_ptr x2 (db->load (o2->id)); obj3_ptr x3_1 (db->load (o3_1->id)); obj3_ptr x3_2 (db->load (o3_2->id)); + obj4_ptr x4_1 (db->load (o4_1->id)); + obj4_ptr x4_2 (db->load (o4_2->id)); + obj5_ptr x5_1 (db->load (o5_1->id)); + obj5_ptr x5_2 (db->load (o5_2->id)); + obj5_ptr x5_3 (db->load (o5_3->id)); + obj5_ptr x5_4 (db->load (o5_4->id)); t.commit (); assert (x2->str == o2->str); - assert (x2->o1->id == o1->id); + assert (x2->o1->id == o1_1->id); assert (x2->o1->o2 == x2); assert (x3_1->str == o3_1->str); assert (x3_2->str == o3_2->str); assert (x3_1->o1 == x3_2->o1); - assert (x3_1->o1->id == o1->id); + assert (x3_1->o1->id == o1_1->id); assert (x3_1->o1->o3.find (x3_1) != x3_1->o1->o3.end ()); assert (x3_1->o1->o3.find (x3_2) != x3_1->o1->o3.end ()); - delete x2->o1; + assert (x4_1->str == o4_1->str); + assert (x4_2->str == o4_2->str); + assert ((*x4_1->o1.begin ())->id == o1_1->id); + assert ((*x4_2->o1.begin ())->id == o1_2->id); + assert ((*x4_1->o1.begin ())->o4 == x4_1); + assert ((*x4_2->o1.begin ())->o4 == x4_2); + + assert (x5_1->str == o5_1->str); + assert (x5_2->str == o5_2->str); + assert ((*x5_1->o1.begin ())->id == o1_1->id); + assert ((*x5_2->o1.begin ())->id == o1_1->id); + assert ((*x5_3->o1.begin ())->id == o1_2->id); + assert ((*x5_4->o1.begin ())->id == o1_2->id); + assert ((*x5_1->o1.begin ())->o5.find (x5_1) != + (*x5_1->o1.begin ())->o5.end ()); + assert ((*x5_2->o1.begin ())->o5.find (x5_2) != + (*x5_2->o1.begin ())->o5.end ()); + assert ((*x5_3->o1.begin ())->o5.find (x5_3) != + (*x5_3->o1.begin ())->o5.end ()); + assert ((*x5_4->o1.begin ())->o5.find (x5_4) != + (*x5_4->o1.begin ())->o5.end ()); + + delete *x4_1->o1.begin (); + delete *x4_2->o1.begin (); } - delete o1; + delete o1_1; + delete o1_2; } // TR1 pointer version. // #ifdef HAVE_TR1_MEMORY { - tr1_obj1_ptr o1 (new tr1_obj1); + tr1_obj1_ptr o1_1 (new tr1_obj1); + tr1_obj1_ptr o1_2 (new tr1_obj1); tr1_obj2_ptr o2 (new tr1_obj2); tr1_obj3_ptr o3_1 (new tr1_obj3); tr1_obj3_ptr o3_2 (new tr1_obj3); + tr1_obj4_ptr o4 (new tr1_obj4); + tr1_obj5_ptr o5_1 (new tr1_obj5); + tr1_obj5_ptr o5_2 (new tr1_obj5); + tr1_obj5_ptr o5_3 (new tr1_obj5); + tr1_obj5_ptr o5_4 (new tr1_obj5); + + o1_1->id = "obj1 1"; + o1_1->o2 = o2; + o1_1->o3.push_back (o3_1); + o1_1->o3.push_back (o3_2); + o1_1->o4 = o4; + o1_1->o5.push_back (o5_1); + o1_1->o5.push_back (o5_2); - o1->id = "obj1"; - o1->o2 = o2; - o1->o3.push_back (o3_1); - o1->o3.push_back (o3_2); + o1_2->id = "obj1 2"; + o1_2->o2 = tr1_obj2_ptr (); + o1_2->o3.clear (); + //@@o1_2->o4 = o4; + o1_2->o5.push_back (o5_3); + o1_2->o5.push_back (o5_4); o2->str = "obj2"; - o2->o1 = o1; + o2->o1 = o1_1; o3_1->str = "obj3 1"; - o3_1->o1 = o1; + o3_1->o1 = o1_1; o3_2->str = "obj3 3"; - o3_2->o1 = o1; + o3_2->o1 = o1_1; + + o4->str = "obj4"; + o4->o1.push_back (o1_1); + //@@o4->o1.push_back (o1_2); + + o5_1->str = "obj5 1"; + o5_1->o1.push_back (o1_1); + + o5_2->str = "obj5 2"; + o5_2->o1.push_back (o1_1); + + o5_3->str = "obj5 3"; + o5_3->o1.push_back (o1_2); + + o5_4->str = "obj5 4"; + o5_4->o1.push_back (o1_2); // persist // { transaction t (db->begin ()); - // obj2 and obj3 come first to get object id assigned. + // objN come before obj1 to get object id assigned. // + db->persist (o5_1); + db->persist (o5_2); + db->persist (o5_3); + db->persist (o5_4); + db->persist (o4); db->persist (o3_1); db->persist (o3_2); db->persist (o2); - db->persist (o1); + db->persist (o1_1); + db->persist (o1_2); t.commit (); } @@ -139,18 +249,33 @@ main (int argc, char* argv[]) tr1_obj2_ptr x2 (db->load (o2->id)); tr1_obj3_ptr x3_1 (db->load (o3_1->id)); tr1_obj3_ptr x3_2 (db->load (o3_2->id)); + tr1_obj4_ptr x4 (db->load (o4->id)); + tr1_obj5_ptr x5_1 (db->load (o5_1->id)); + tr1_obj5_ptr x5_2 (db->load (o5_2->id)); + //@@ tr1_obj5_ptr x5_3 (db->load (o5_3->id)); + //@@ tr1_obj5_ptr x5_4 (db->load (o5_4->id)); t.commit (); assert (x2->str == o2->str); - assert (x2->o1.lock ()->id == o1->id); + assert (x2->o1.lock ()->id == o1_1->id); assert (x2->o1.lock ()->o2 == x2); assert (x3_1->str == o3_1->str); assert (x3_2->str == o3_2->str); assert (x3_1->o1.lock () == x3_2->o1.lock ()); - assert (x3_1->o1.lock ()->id == o1->id); + assert (x3_1->o1.lock ()->id == o1_1->id); assert (x3_1->o1.lock ()->o3[0] == x3_1); assert (x3_1->o1.lock ()->o3[1] == x3_2); + + assert (x4->str == o4->str); + /* + @@ + tr1_obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); + assert (t1->id == o1_1->id || t2->id == o1_1->id); + assert (t1->id == o1_2->id || t2->id == o1_2->id); + */ + + //@@ TODO: obj5 test } } #endif diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index df93e5d..e57cb78 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -17,17 +17,23 @@ struct obj1; struct obj2; struct obj3; +struct obj4; +struct obj5; typedef obj1* obj1_ptr; typedef obj2* obj2_ptr; typedef obj3* obj3_ptr; +typedef obj4* obj4_ptr; +typedef obj5* obj5_ptr; +typedef std::set obj1_ptr_set; typedef std::set obj3_ptr_set; +typedef std::set obj5_ptr_set; #pragma db object struct obj1 { - obj1 (): o2 (0) {} + obj1 (): o2 (0), o4 (0) {} ~obj1 (); #pragma db id @@ -37,6 +43,10 @@ struct obj1 #pragma db id_column("obj1_id") value_column("obj3_id") obj3_ptr_set o3; + + obj4_ptr o4; + + obj5_ptr_set o5; }; #pragma db object @@ -61,18 +71,49 @@ struct obj3 std::string str; - // one-to-many + // one(i)-to-many // #pragma db inverse (o3) obj1_ptr o1; }; +#pragma db object +struct obj4 +{ + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + obj1_ptr_set o1; +}; + +#pragma db object +struct obj5 +{ + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + obj1_ptr_set o1; +}; + inline obj1:: ~obj1 () { delete o2; for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) delete *i; + delete o4; + for (obj5_ptr_set::iterator i (o5.begin ()); i != o5.end (); ++i) + delete *i; } // TR1 version @@ -81,14 +122,20 @@ inline obj1:: struct tr1_obj1; struct tr1_obj2; struct tr1_obj3; +struct tr1_obj4; +struct tr1_obj5; typedef std::tr1::shared_ptr tr1_obj1_ptr; typedef std::tr1::shared_ptr tr1_obj2_ptr; typedef std::tr1::shared_ptr tr1_obj3_ptr; +typedef std::tr1::shared_ptr tr1_obj4_ptr; +typedef std::tr1::shared_ptr tr1_obj5_ptr; typedef std::tr1::weak_ptr tr1_obj1_wptr; +typedef std::vector tr1_obj1_wptr_vec; typedef std::vector tr1_obj3_ptr_vec; +typedef std::vector tr1_obj5_ptr_vec; #pragma db object pointer(tr1_obj1_ptr) struct tr1_obj1 @@ -100,6 +147,9 @@ struct tr1_obj1 #pragma db id_column("tr1_obj1_id") value_column("tr1_obj3_id") tr1_obj3_ptr_vec o3; + + tr1_obj4_ptr o4; + tr1_obj5_ptr_vec o5; }; #pragma db object pointer(tr1_obj2_ptr) @@ -110,6 +160,8 @@ struct tr1_obj2 std::string str; + // one(i)-to-one + // #pragma db inverse(o2) tr1_obj1_wptr o1; }; @@ -122,11 +174,39 @@ struct tr1_obj3 std::string str; - // one-to-many + // one(i)-to-many // #pragma db inverse (o3) tr1_obj1_wptr o1; }; + +#pragma db object pointer(tr1_obj4_ptr) +struct tr1_obj4 +{ + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + tr1_obj1_wptr_vec o1; +}; + +#pragma db object pointer(tr1_obj5_ptr) +struct tr1_obj5 +{ + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + tr1_obj1_wptr_vec o1; +}; #endif #endif // TEST_HXX -- cgit v1.1 From cd852a8be3a75b0be5bba9a7b6b454849231cd27 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Nov 2010 11:19:03 +0200 Subject: Add support for object pointers in query --- common/inverse/driver.cxx | 41 +++++++++++++++++++++++++++++++++++++++++ common/relationship/driver.cxx | 15 +++++++++++++++ common/relationship/makefile | 3 ++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index e572be2..139c2b6 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -161,6 +161,47 @@ main (int argc, char* argv[]) delete *x4_2->o1.begin (); } + // query + // + { + // one(i)-to-one + // + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::o1::id == "obj1 1")); + assert (r.size () == 1); + assert (r.begin ()->id == o2->id); + assert (r.begin ()->o1->id == o1_1->id); + + t.commit (); + } + + { + // one(i)-to-many + // + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::o1::id == "obj1 1")); + + assert (r.size () == 2); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + assert (i->id == o3_1->id || i->id == o3_2->id); + assert (i->o1->id == o1_1->id); + } + + t.commit (); + } + delete o1_1; delete o1_2; } diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 9266e2b..f7aa79e 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -96,6 +96,21 @@ main (int argc, char* argv[]) assert (*a1 == a); } + // query + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o1::str == "obj1")); + assert (r.size () == 1); + assert (r.begin ()->o1->id == a.o1->id); + + t.commit (); + } + // test NULL pointer // delete a.o1; diff --git a/common/relationship/makefile b/common/relationship/makefile index a1c0a21..a3857d4 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--generate-query $(gen): cpp_options := -I$(out_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 6ac4f59699084b7c3967286b7b1f26df9f9c053d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Nov 2010 13:24:00 +0200 Subject: Add support for recursive object loading If an object of a type needs to be loaded recursively, then it is addded to the delayed loading list which is processed once the statements are unlocked. --- common/inverse/driver.cxx | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 139c2b6..722e4e7 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -218,8 +218,6 @@ main (int argc, char* argv[]) tr1_obj4_ptr o4 (new tr1_obj4); tr1_obj5_ptr o5_1 (new tr1_obj5); tr1_obj5_ptr o5_2 (new tr1_obj5); - tr1_obj5_ptr o5_3 (new tr1_obj5); - tr1_obj5_ptr o5_4 (new tr1_obj5); o1_1->id = "obj1 1"; o1_1->o2 = o2; @@ -232,9 +230,8 @@ main (int argc, char* argv[]) o1_2->id = "obj1 2"; o1_2->o2 = tr1_obj2_ptr (); o1_2->o3.clear (); - //@@o1_2->o4 = o4; - o1_2->o5.push_back (o5_3); - o1_2->o5.push_back (o5_4); + o1_2->o4 = o4; + o1_2->o5.push_back (o5_1); o2->str = "obj2"; o2->o1 = o1_1; @@ -247,20 +244,15 @@ main (int argc, char* argv[]) o4->str = "obj4"; o4->o1.push_back (o1_1); - //@@o4->o1.push_back (o1_2); + o4->o1.push_back (o1_2); o5_1->str = "obj5 1"; o5_1->o1.push_back (o1_1); + o5_1->o1.push_back (o1_2); o5_2->str = "obj5 2"; o5_2->o1.push_back (o1_1); - o5_3->str = "obj5 3"; - o5_3->o1.push_back (o1_2); - - o5_4->str = "obj5 4"; - o5_4->o1.push_back (o1_2); - // persist // { @@ -270,8 +262,6 @@ main (int argc, char* argv[]) // db->persist (o5_1); db->persist (o5_2); - db->persist (o5_3); - db->persist (o5_4); db->persist (o4); db->persist (o3_1); db->persist (o3_2); @@ -293,8 +283,6 @@ main (int argc, char* argv[]) tr1_obj4_ptr x4 (db->load (o4->id)); tr1_obj5_ptr x5_1 (db->load (o5_1->id)); tr1_obj5_ptr x5_2 (db->load (o5_2->id)); - //@@ tr1_obj5_ptr x5_3 (db->load (o5_3->id)); - //@@ tr1_obj5_ptr x5_4 (db->load (o5_4->id)); t.commit (); assert (x2->str == o2->str); @@ -308,15 +296,26 @@ main (int argc, char* argv[]) assert (x3_1->o1.lock ()->o3[0] == x3_1); assert (x3_1->o1.lock ()->o3[1] == x3_2); - assert (x4->str == o4->str); - /* - @@ - tr1_obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); - assert (t1->id == o1_1->id || t2->id == o1_1->id); - assert (t1->id == o1_2->id || t2->id == o1_2->id); - */ + { + assert (x4->str == o4->str); + + tr1_obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); + + assert (t1->id == o1_1->id || t2->id == o1_1->id); + assert (t1->id == o1_2->id || t2->id == o1_2->id); + } - //@@ TODO: obj5 test + { + assert (x5_1->str == o5_1->str); + assert (x5_2->str == o5_2->str); + + tr1_obj1_ptr t1 (x5_1->o1[0].lock ()), t2 (x5_1->o1[1].lock ()), + t3 (x5_2->o1[0].lock ()); + + assert (t1->id == o1_1->id || t2->id == o1_1->id); + assert (t1->id == o1_2->id || t2->id == o1_2->id); + assert (t3->id == o1_1->id); + } } } #endif -- cgit v1.1 From 30895144f680a8b9a8b4b6313edb726361d36000 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Nov 2010 13:50:29 +0200 Subject: Save test result to a temp file instead of piping it to diff This makes tests more robust. --- .gitignore | 4 ++++ common/auto/makefile | 5 ++++- common/composite/makefile | 5 ++++- common/const/makefile | 5 ++++- common/container/makefile | 5 ++++- common/ctor/makefile | 5 ++++- common/inverse/makefile | 5 ++++- common/lifecycle/makefile | 5 ++++- common/query/makefile | 5 ++++- common/relationship/makefile | 5 ++++- common/schema/makefile | 5 ++++- common/template/makefile | 5 ++++- common/threads/makefile | 5 ++++- mysql/template/makefile | 5 ++++- mysql/truncation/makefile | 5 ++++- mysql/types/makefile | 5 ++++- tracer/include/makefile | 5 ++++- tracer/object/makefile | 5 ++++- tracer/pragma/makefile | 5 ++++- tracer/template/makefile | 5 ++++- tracer/transaction/makefile | 5 ++++- tracer/types/makefile | 5 ++++- 22 files changed, 88 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 53c48be..15db638 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ *.l *.l.cpp-options +# Test output +# +*.out + # Generated documentation. # *.pdf diff --git a/common/auto/makefile b/common/auto/makefile index e4cdffd..30d480a 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/common/composite/makefile b/common/composite/makefile index 577cad6..81f32f0 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -68,7 +68,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -77,6 +79,7 @@ $(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. # diff --git a/common/const/makefile b/common/const/makefile index e8759bc..d465721 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -68,7 +68,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -77,6 +79,7 @@ $(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. # diff --git a/common/container/makefile b/common/container/makefile index 450da44..9fe50af 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/common/ctor/makefile b/common/ctor/makefile index 4dcd10c..489ecdd 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -68,7 +68,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -77,6 +79,7 @@ $(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. # diff --git a/common/inverse/makefile b/common/inverse/makefile index e64cced..b7480fc 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -69,7 +69,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -78,6 +80,7 @@ $(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. # diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index b2a6875..e2f1f66 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/common/query/makefile b/common/query/makefile index 08eb33d..0775df6 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -69,7 +69,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -78,6 +80,7 @@ $(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. # diff --git a/common/relationship/makefile b/common/relationship/makefile index a3857d4..7ed60cf 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -69,7 +69,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -78,6 +80,7 @@ $(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. # diff --git a/common/schema/makefile b/common/schema/makefile index 5c71905..0cd51d6 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/common/template/makefile b/common/template/makefile index cff4185..02605ef 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/common/threads/makefile b/common/threads/makefile index 73174d9..71c522b 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -68,7 +68,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -77,6 +79,7 @@ $(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. # diff --git a/mysql/template/makefile b/mysql/template/makefile index d634728..05285ec 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -64,7 +64,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -73,6 +75,7 @@ $(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. # diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 331bc34..79de168 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -65,7 +65,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -74,6 +76,7 @@ $(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. # diff --git a/mysql/types/makefile b/mysql/types/makefile index 60ee402..d84614b 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -67,7 +67,9 @@ $(dist): $(test): $(driver) $(src_base)/test.std $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) $(call message,test $<,$< --options-file $(dcf_root)/db.options \ -| diff -u $(src_base)/test.std -) +>$(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/tracer/include/makefile b/tracer/include/makefile index 8bb6914..6e8f00a 100644 --- a/tracer/include/makefile +++ b/tracer/include/makefile @@ -58,7 +58,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -67,6 +69,7 @@ $(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. # diff --git a/tracer/object/makefile b/tracer/object/makefile index b74ece7..a812671 100644 --- a/tracer/object/makefile +++ b/tracer/object/makefile @@ -67,7 +67,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/tracer/pragma/makefile b/tracer/pragma/makefile index 1994267..b9da24c 100644 --- a/tracer/pragma/makefile +++ b/tracer/pragma/makefile @@ -67,7 +67,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/tracer/template/makefile b/tracer/template/makefile index 4403281..023f5f9 100644 --- a/tracer/template/makefile +++ b/tracer/template/makefile @@ -67,7 +67,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -76,6 +78,7 @@ $(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. # diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index 12ca226..2a3baee 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -52,7 +52,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -60,6 +62,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) + $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. # diff --git a/tracer/types/makefile b/tracer/types/makefile index 474681d..f7fe190 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -67,7 +67,9 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< | diff -u $(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. # @@ -76,6 +78,7 @@ $(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. # -- cgit v1.1 From 3b27ca96f2f4c2b76f65675a988482e19220fa66 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Nov 2010 15:48:28 +0200 Subject: Postpone fetching of the data for cached results This way if an object of the same type is loaded in between iteration, the fetched image won't be messed up. --- common/query/driver.cxx | 18 ++++++++++++++++++ common/query/test.std | 1 + 2 files changed, 19 insertions(+) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 9ff596b..5a77ae9 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -383,6 +383,24 @@ main (int argc, char* argv[]) print (r); t.commit (); } + + // Test that loading of the same object type during iteration does + // not invalidate the result. + // + cout << "test 014" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + + assert (r.size () == 2); + + result::iterator i (r.begin ()); + i++; + auto_ptr joe (db->load (3)); + assert (i->last_name_ == "Doe"); + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/query/test.std b/common/query/test.std index e065765..14f3205 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -91,3 +91,4 @@ Johansen J Johansen 32 single test 013 Joe Squeaky Dirt 31 single +test 014 -- cgit v1.1 From 0b4c59824e3b2b0411dd33835c67f6cd36d60a91 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Nov 2010 17:52:25 +0200 Subject: Simplify tests by using literal names --- common/const/driver.cxx | 14 +++++++------- common/const/test.hxx | 17 ++++------------- common/container/test.hxx | 9 +++------ common/query/test.hxx | 3 +-- common/relationship/test.hxx | 31 +++++++++++++------------------ 5 files changed, 28 insertions(+), 46 deletions(-) diff --git a/common/const/driver.cxx b/common/const/driver.cxx index cc58cf8..e26fb3c 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -33,15 +33,15 @@ main (int argc, char* argv[]) aggr ca_ (2); // o1 and o2 are NULL const aggr& ca (ca_); - obj1_ptr o1 (new obj1 (1)); - obj1_ptr co1_ (new obj1 (2)); - obj1_cptr co1 (co1_); + obj1* o1 (new obj1 (1)); + obj1* co1_ (new obj1 (2)); + const obj1* co1 (co1_); a.o1 = co1; - obj2_ptr o2 (new obj2 (1)); + auto_ptr o2 (new obj2 (1)); obj2* co2_ (new obj2 (2)); a.o2.reset (co2_); - obj2_cptr& co2 (a.o2); + auto_ptr& co2 (a.o2); // persist via references // @@ -129,7 +129,7 @@ main (int argc, char* argv[]) { // i->f (); // error i->cf (); - obj1_cptr p (i.load ()); + const obj1* p (i.load ()); obj1 o (0); i.load (o); assert (p->id == o.id); @@ -144,7 +144,7 @@ main (int argc, char* argv[]) { // i->f (); // error i->cf (); - obj2_cptr p (i.load ()); + auto_ptr p (i.load ()); obj2 o (0); i.load (o); assert (p->id == o.id); diff --git a/common/const/test.hxx b/common/const/test.hxx index 7e8a718..0164880 100644 --- a/common/const/test.hxx +++ b/common/const/test.hxx @@ -9,16 +9,7 @@ #include #include -struct obj1; -struct obj2; - -typedef obj1* obj1_ptr; -typedef const obj1* obj1_cptr; - -typedef std::auto_ptr obj2_ptr; -typedef std::auto_ptr obj2_cptr; - -#pragma db object pointer (obj1_ptr) +#pragma db object pointer (obj1*) struct obj1 { obj1 () {} @@ -31,7 +22,7 @@ struct obj1 void cf () const {} }; -#pragma db object pointer (obj2_ptr) +#pragma db object pointer (std::auto_ptr) struct obj2 { obj2 () {} @@ -54,8 +45,8 @@ struct aggr #pragma db id int id; - obj1_cptr o1; - obj2_cptr o2; + const obj1* o1; + std::auto_ptr o2; }; #endif // TEST_HXX diff --git a/common/container/test.hxx b/common/container/test.hxx index 1f565cd..22bcdda 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -41,16 +41,13 @@ typedef std::list str_list; typedef std::vector num_vector; typedef std::vector str_vector; -typedef std::vector comp_vector; typedef std::set num_set; typedef std::set str_set; -typedef std::set comp_set; typedef std::map num_str_map; typedef std::map str_num_map; typedef std::map num_comp_map; -typedef std::map comp_str_map; #pragma db value struct cont_comp1 @@ -93,7 +90,7 @@ struct object str_vector sv; #pragma db value_column("") - comp_vector cv; + std::vector cv; #pragma db unordered num_vector uv; @@ -107,14 +104,14 @@ struct object // num_set ns; str_set ss; - comp_set cs; + std::set cs; // map // num_str_map nsm; str_num_map snm; num_comp_map ncm; - comp_str_map csm; + std::map csm; std::string str; }; diff --git a/common/query/test.hxx b/common/query/test.hxx index 3d10cc2..883462e 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -38,9 +38,8 @@ struct person #pragma db column ("first") std::string first_name_; - typedef std::auto_ptr string_ptr; // @@ tmp #pragma db column ("middle") type ("TEXT") - string_ptr middle_name_; + std::auto_ptr middle_name_; #pragma db column ("last") std::string last_name_; diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 3f624e5..8305de4 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -17,10 +17,7 @@ // Naked pointer. // -struct obj1; -typedef obj1* obj1_ptr; - -#pragma db object pointer(obj1_ptr) +#pragma db object pointer(obj1*) struct obj1 { obj1 () {} @@ -28,7 +25,6 @@ struct obj1 #pragma db id std::string id; - std::string str; }; @@ -40,7 +36,7 @@ operator== (const obj1& x, const obj1& y) // vector // -typedef std::vector obj1_vec; +typedef std::vector obj1_vec; inline bool operator== (const obj1_vec& x, const obj1_vec& y) @@ -57,16 +53,16 @@ operator== (const obj1_vec& x, const obj1_vec& y) // set // -struct obj1_ptr_cmp +struct obj1_cmp { bool - operator() (obj1_ptr x, obj1_ptr y) const + operator() (obj1* x, obj1* y) const { return (!x || !y) ? x < y : x->id < y->id; } }; -typedef std::set obj1_set; +typedef std::set obj1_set; inline bool operator== (const obj1_set& x, const obj1_set& y) @@ -81,7 +77,8 @@ operator== (const obj1_set& x, const obj1_set& y) if (j == y.end ()) return false; - obj1_ptr x (*i), y (*j); + obj1* x (*i); + obj1* y (*j); if (!(x ? (y && *x == *y) : !y)) return false; @@ -92,7 +89,7 @@ operator== (const obj1_set& x, const obj1_set& y) // map // -typedef std::map obj1_map; +typedef std::map obj1_map; inline bool operator== (const obj1_map& x, const obj1_map& y) @@ -107,7 +104,8 @@ operator== (const obj1_map& x, const obj1_map& y) if (j == y.end ()) return false; - obj1_ptr x (i->second), y (j->second); + obj1* x (i->second); + obj1* y (j->second); if (!(x ? (y && *x == *y) : !y)) return false; @@ -118,10 +116,7 @@ operator== (const obj1_map& x, const obj1_map& y) // auto_ptr // -struct obj2; -typedef std::auto_ptr obj2_ptr; - -#pragma db object pointer(obj2_ptr) +#pragma db object pointer(std::auto_ptr) struct obj2 { obj2 () {} @@ -210,8 +205,8 @@ struct aggr #pragma db id auto unsigned long id; - obj1_ptr o1; - obj2_ptr o2; + obj1* o1; + std::auto_ptr o2; #ifdef HAVE_TR1_MEMORY obj3_ptr o3; comp c; -- cgit v1.1 From 68ca8ec3227d447c6898b7c75d8ea0fb82a4af36 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Dec 2010 10:36:15 +0200 Subject: Add lazy pointer support Built-in support is provided for raw, auto, and tr1 shared/weak pointers. New test: common/lazy-ptr. --- common/inverse/tr1-memory.hxx | 19 +-- common/lazy-ptr/driver.cxx | 341 +++++++++++++++++++++++++++++++++++++ common/lazy-ptr/makefile | 108 ++++++++++++ common/lazy-ptr/test.hxx | 144 ++++++++++++++++ common/lazy-ptr/test.std | 0 common/lazy-ptr/tr1-memory.hxx | 41 +++++ common/makefile | 1 + common/relationship/tr1-memory.hxx | 19 +-- 8 files changed, 651 insertions(+), 22 deletions(-) create mode 100644 common/lazy-ptr/driver.cxx create mode 100644 common/lazy-ptr/makefile create mode 100644 common/lazy-ptr/test.hxx create mode 100644 common/lazy-ptr/test.std create mode 100644 common/lazy-ptr/tr1-memory.hxx diff --git a/common/inverse/tr1-memory.hxx b/common/inverse/tr1-memory.hxx index 76ac932..44d369a 100644 --- a/common/inverse/tr1-memory.hxx +++ b/common/inverse/tr1-memory.hxx @@ -1,15 +1,16 @@ // file : common/inverse/tr1-memory.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file +// copyright : not copyrighted - public domain #ifndef TR1_MEMORY_HXX #define TR1_MEMORY_HXX -// Try to include TR1 in a compiler-specific manner. Define -// HAVE_TR1_MEMORY if successfull. If the compiler does not provide -// native TR1 support, fall-back on the Boost TR1 implementation if -// HAVE_BOOST_TR1 is defined. +//@@ tmp +#define HAVE_TR1_MEMORY + +// +// Try to include TR1 in a compiler-specific manner. Fall-back +// on the Boost TR1 implementation if the compiler does not support TR1. // #include // __GLIBCXX__, _HAS_TR1 @@ -18,27 +19,23 @@ // #if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) # include -# define HAVE_TR1_MEMORY 1 // // IBM XL C++. // #elif defined (__xlC__) && __xlC__ >= 0x0900 # define __IBMCPP_TR1__ # include -# define HAVE_TR1_MEMORY 1 // // VC++ or Intel C++ using VC++ standard library. // #elif defined (_MSC_VER) && \ (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) # include -# define HAVE_TR1_MEMORY 1 // // Boost fall-back. // -#elif defined (HAVE_BOOST_TR1) +#else # include -# define HAVE_TR1_MEMORY 1 #endif #endif // TR1_MEMORY_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx new file mode 100644 index 0000000..eceb515 --- /dev/null +++ b/common/lazy-ptr/driver.cxx @@ -0,0 +1,341 @@ +// file : common/lazy-ptr/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test lazy object pointers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +auto_ptr +create (unsigned int id) +{ + auto_ptr r (new obj2 (id)); + return r; +} + +lazy_auto_ptr +create (database& db, unsigned int id) +{ + lazy_auto_ptr r (db, id); + return r; +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Naked. + // + { + typedef cont1 cont; + typedef obj1 obj; + + // persist + // + obj* o1 (new obj (1)); + + { + transaction t (db->begin ()); + db->persist (o1); + t.commit (); + } + + auto_ptr c1 (new cont (1)); + auto_ptr c2 (new cont (2)); + + lazy_ptr lo1 (*db, 1); + obj* o2 (new obj (2)); + + obj* o3 (new obj (3)); + obj* o4 (new obj (4)); + + c1->o.push_back (lo1); + c1->o.push_back (o2); + c2->o.push_back (o3); + c2->o.push_back (o4); + + // Test pointer comparison. + // + assert (lazy_ptr () == lazy_ptr ()); + assert (lazy_ptr (o1) != lazy_ptr ()); + assert (lo1 != lazy_ptr ()); + assert (lazy_ptr (o1) == lazy_ptr (o1)); + assert (lo1 == lazy_ptr (*db, o1)); + assert (lo1 != lazy_ptr (*db, o2)); + + delete o1; + + { + transaction t (db->begin ()); + + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (*c1); + db->persist (*c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + auto_ptr c (db->load (1)); + obj* o (db->load (1)); + + // Not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + cont* lc (o->c.load ()); + obj* lo (c->o[0].load ()); + + assert (lc == c.get ()); + assert (lo == o); + + // Test unload/reload. + // + o->c.unload (); + assert (!o->c.loaded ()); + o->c.load (); + assert (o->c.loaded ()); + + t.commit (); + } + } + + // Auto pointer. + // + { + typedef cont2 cont; + typedef obj2 obj; + + // persist + // + { + auto_ptr o1 (new obj (1)); + transaction t (db->begin ()); + db->persist (*o1); + t.commit (); + } + + auto_ptr c1 (new cont (1)); + auto_ptr c2 (new cont (2)); + + lazy_auto_ptr lo1 = create (*db, 1); + lo1 = create (*db, 1); + + c1->o = lo1; + c2->o = create (2); + + { + transaction t (db->begin ()); + + db->persist (*c2->o); + + db->persist (*c1); + db->persist (*c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + auto_ptr c (db->load (1)); + obj* o (db->load (1)); + + // Not loaded. + // + assert (!c->o.loaded ()); + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o.object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + cont* lc (o->c.load ()); + const auto_ptr& lo (c->o.load ()); + + assert (lc == c.get ()); + assert (lo.get () == o); + + t.commit (); + } + + // unload/reload + // + { + // No session. + transaction t (db->begin ()); + auto_ptr c (db->load (1)); + + assert (!c->o.loaded ()); + c->o.load (); + assert (c->o.loaded ()); + c->o.unload (); + assert (!c->o.loaded ()); + c->o.load (); + assert (c->o.loaded ()); + + t.commit (); + } + + } + + // TR1. + // +#ifdef HAVE_TR1_MEMORY + { + using namespace ::tr1; + + // persist + // + shared_ptr c1 (new cont (1)); + + { + transaction t (db->begin ()); + db->persist (c1); + t.commit (); + } + + lazy_shared_ptr lc1 (*db, 1); + shared_ptr c2 (new cont (2)); + + shared_ptr o1 (new obj (1)); + shared_ptr o2 (new obj (2)); + + shared_ptr o3 (new obj (3)); + shared_ptr o4 (new obj (4)); + + o1->c = lc1; + o2->c = lc1; + o3->c = c2; + o4->c = c2; + + // Test pointer comparison. + // + assert (lazy_shared_ptr () == lazy_shared_ptr ()); + assert (lazy_shared_ptr (c1) != lazy_shared_ptr ()); + assert (lc1 != lazy_shared_ptr ()); + assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); + assert (lc1 == lazy_shared_ptr (*db, c1)); + assert (lc1 != lazy_shared_ptr (*db, c2)); + + { + transaction t (db->begin ()); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + shared_ptr o (db->load (1)); + + // Not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + shared_ptr lc (o->c.load ()); + shared_ptr lo (c->o[0].load ()); + + assert (lc == c); + assert (lo == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + lazy_shared_ptr l (c->o[1].lock ()); + assert (!l.loaded ()); + assert (l.object_id () == c->o[1].object_id ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + shared_ptr lo (c->o[1].load ()); + assert (c->o[1].loaded ()); + lo.reset (); + assert (!c->o[1].loaded ()); + lo = c->o[1].load (); + assert (c->o[1].loaded ()); + + t.commit (); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile new file mode 100644 index 0000000..78fe24b --- /dev/null +++ b/common/lazy-ptr/makefile @@ -0,0 +1,108 @@ +# file : common/lazy-ptr/makefile +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 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) +$(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) --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx new file mode 100644 index 0000000..4aa8b3a --- /dev/null +++ b/common/lazy-ptr/test.hxx @@ -0,0 +1,144 @@ +// file : common/lazy-ptr/test.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include + +#include "tr1-memory.hxx" + +#include +#include + +#ifdef HAVE_TR1_MEMORY +#include +#endif + +// Naked pointer. +// +using odb::lazy_ptr; +class obj1; + +#pragma db object +class cont1 +{ +public: + cont1 () {} + cont1 (unsigned long i): id (i) {} + ~cont1 (); + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db not_null + obj_list o; +}; + +#pragma db object +class obj1 +{ +public: + obj1 () {} + obj1 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) not_null + lazy_ptr c; // weak +}; + +inline cont1:: +~cont1 () +{ + for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) + if (i->loaded ()) + delete i->get (); +} + +// Auto pointer. +// +using std::auto_ptr; +using odb::lazy_auto_ptr; + +class obj2; + +#pragma db object +class cont2 +{ +public: + cont2 () {} + cont2 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_auto_ptr o; +}; + +#pragma db object +class obj2 +{ +public: + obj2 () {} + obj2 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) not_null + lazy_ptr c; // weak +}; + +// TR1. +// +#ifdef HAVE_TR1_MEMORY +namespace tr1 +{ + using std::tr1::shared_ptr; + using odb::tr1::lazy_shared_ptr; + using odb::tr1::lazy_weak_ptr; + + class obj; + + #pragma db object pointer(std::tr1::shared_ptr) // @@ tmp std::tr1:: + class cont + { + public: + cont () {} + cont (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) not_null + obj_list o; + }; + + #pragma db object pointer(std::tr1::shared_ptr) // @@ tmp std::tr1:: + class obj + { + public: + obj () {} + obj (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_shared_ptr c; + }; +} +#endif + +#endif // TEST_HXX diff --git a/common/lazy-ptr/test.std b/common/lazy-ptr/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/lazy-ptr/tr1-memory.hxx b/common/lazy-ptr/tr1-memory.hxx new file mode 100644 index 0000000..8965861 --- /dev/null +++ b/common/lazy-ptr/tr1-memory.hxx @@ -0,0 +1,41 @@ +// file : common/lazy-ptr/tr1-memory.hxx +// author : Boris Kolpackov +// copyright : not copyrighted - public domain + +#ifndef TR1_MEMORY_HXX +#define TR1_MEMORY_HXX + +//@@ tmp +#define HAVE_TR1_MEMORY + +// +// Try to include TR1 in a compiler-specific manner. Fall-back +// on the Boost TR1 implementation if the compiler does not support TR1. +// + +#include // __GLIBCXX__, _HAS_TR1 + +// GNU C++ or Intel C++ using libstd++. +// +#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) +# include +// +// IBM XL C++. +// +#elif defined (__xlC__) && __xlC__ >= 0x0900 +# define __IBMCPP_TR1__ +# include +// +// VC++ or Intel C++ using VC++ standard library. +// +#elif defined (_MSC_VER) && \ + (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) +# include +// +// Boost fall-back. +// +#else +# include +#endif + +#endif // TR1_MEMORY_HXX diff --git a/common/makefile b/common/makefile index 5794b15..6d95d8b 100644 --- a/common/makefile +++ b/common/makefile @@ -12,6 +12,7 @@ const \ container \ ctor \ inverse \ +lazy-ptr \ lifecycle \ query \ relationship \ diff --git a/common/relationship/tr1-memory.hxx b/common/relationship/tr1-memory.hxx index 27e9da8..a4ce28a 100644 --- a/common/relationship/tr1-memory.hxx +++ b/common/relationship/tr1-memory.hxx @@ -1,15 +1,16 @@ // file : common/relationship/tr1-memory.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file +// copyright : not copyrighted - public domain #ifndef TR1_MEMORY_HXX #define TR1_MEMORY_HXX -// Try to include TR1 in a compiler-specific manner. Define -// HAVE_TR1_MEMORY if successfull. If the compiler does not provide -// native TR1 support, fall-back on the Boost TR1 implementation if -// HAVE_BOOST_TR1 is defined. +//@@ tmp +#define HAVE_TR1_MEMORY + +// +// Try to include TR1 in a compiler-specific manner. Fall-back +// on the Boost TR1 implementation if the compiler does not support TR1. // #include // __GLIBCXX__, _HAS_TR1 @@ -18,27 +19,23 @@ // #if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) # include -# define HAVE_TR1_MEMORY 1 // // IBM XL C++. // #elif defined (__xlC__) && __xlC__ >= 0x0900 # define __IBMCPP_TR1__ # include -# define HAVE_TR1_MEMORY 1 // // VC++ or Intel C++ using VC++ standard library. // #elif defined (_MSC_VER) && \ (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) # include -# define HAVE_TR1_MEMORY 1 // // Boost fall-back. // -#elif defined (HAVE_BOOST_TR1) +#else # include -# define HAVE_TR1_MEMORY 1 #endif #endif // TR1_MEMORY_HXX -- cgit v1.1 From 938e8f4d3137018b97c26ca0dc3429c8e824358b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Dec 2010 12:00:24 +0200 Subject: Cosmetic change (rename naked pointer to raw pointer) --- common/inverse/driver.cxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/test.hxx | 2 +- common/relationship/test.hxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 722e4e7..34c9258 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -29,7 +29,7 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // Naked pointer version. + // Raw pointer version. // { obj1_ptr o1_1 (new obj1); diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index eceb515..712cbdf 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -42,7 +42,7 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // Naked. + // Raw. // { typedef cont1 cont; diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 4aa8b3a..242d925 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -19,7 +19,7 @@ #include #endif -// Naked pointer. +// Raw pointer. // using odb::lazy_ptr; class obj1; diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 8305de4..cafdc99 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -15,7 +15,7 @@ #include -// Naked pointer. +// Raw pointer. // #pragma db object pointer(obj1*) struct obj1 -- cgit v1.1 From b0badbfd0fdbbadef588a2b518cbfb49f34bf9fd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 10 Dec 2010 11:16:32 +0200 Subject: Cosmetic changes --- common/lazy-ptr/test.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 242d925..8b75c46 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -109,7 +109,7 @@ namespace tr1 class obj; - #pragma db object pointer(std::tr1::shared_ptr) // @@ tmp std::tr1:: + #pragma db object pointer(shared_ptr) class cont { public: @@ -125,7 +125,7 @@ namespace tr1 obj_list o; }; - #pragma db object pointer(std::tr1::shared_ptr) // @@ tmp std::tr1:: + #pragma db object pointer(shared_ptr) class obj { public: -- cgit v1.1 From 3fd22b7b86ebad8fbd4b66da3d63e6d9c1ca829c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Dec 2010 11:38:49 +0200 Subject: Detect TR1 availability Also use the wrapper header from libodb. --- common/inverse/makefile | 3 +-- common/inverse/test.hxx | 7 +++++- common/inverse/tr1-memory.hxx | 41 --------------------------------- common/lazy-ptr/test.hxx | 7 +++--- common/lazy-ptr/tr1-memory.hxx | 41 --------------------------------- common/relationship/makefile | 3 +-- common/relationship/test.hxx | 7 +++++- common/relationship/tr1-memory.hxx | 41 --------------------------------- common/template/Makefile.am | 3 ++- common/template/template-vc10.vcxproj | 12 +++++----- common/template/template-vc9.vcproj | 10 ++++---- configure.ac | 4 ++++ libcommon/common/common.cxx | 4 +--- libcommon/common/config-vc.h | 14 +++++++++++ libcommon/common/config.h.in | 1 + libcommon/common/config.hxx | 15 ++++++++++++ libcommon/common/export.hxx | 4 +--- libcommon/common/libcommon-vc10.vcxproj | 10 ++++---- libcommon/common/libcommon-vc9.vcproj | 8 +++---- libcommon/common/makefile | 8 ++++--- m4/tr1-memory.m4 | 40 ++++++++++++++++++++++++++++++++ mysql/template/Makefile.am | 3 ++- mysql/template/template-vc10.vcxproj | 12 +++++----- mysql/template/template-vc9.vcproj | 10 ++++---- tracer/template/Makefile.am | 4 +++- tracer/template/template-vc10.vcxproj | 16 ++++++++----- tracer/template/template-vc9.vcproj | 14 +++++++---- 27 files changed, 156 insertions(+), 186 deletions(-) delete mode 100644 common/inverse/tr1-memory.hxx delete mode 100644 common/lazy-ptr/tr1-memory.hxx delete mode 100644 common/relationship/tr1-memory.hxx create mode 100644 libcommon/common/config-vc.h create mode 100644 libcommon/common/config.hxx create mode 100644 m4/tr1-memory.m4 diff --git a/common/inverse/makefile b/common/inverse/makefile index b7480fc..05871d1 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -53,13 +53,12 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := tr1-memory.hxx $(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) $(extra_headers) $(data_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)) diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index e57cb78..7dcb17e 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -6,14 +6,19 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include #include -#include "tr1-memory.hxx" #include +#ifdef HAVE_TR1_MEMORY +# include +#endif + struct obj1; struct obj2; struct obj3; diff --git a/common/inverse/tr1-memory.hxx b/common/inverse/tr1-memory.hxx deleted file mode 100644 index 44d369a..0000000 --- a/common/inverse/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/inverse/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 8b75c46..9c671c1 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -6,17 +6,18 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include -#include "tr1-memory.hxx" - #include #include #ifdef HAVE_TR1_MEMORY -#include +# include +# include #endif // Raw pointer. diff --git a/common/lazy-ptr/tr1-memory.hxx b/common/lazy-ptr/tr1-memory.hxx deleted file mode 100644 index 8965861..0000000 --- a/common/lazy-ptr/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/lazy-ptr/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/relationship/makefile b/common/relationship/makefile index 7ed60cf..36c3c48 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -53,13 +53,12 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := tr1-memory.hxx $(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) $(extra_headers) $(data_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)) diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index cafdc99..486c417 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -6,15 +6,20 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include #include #include -#include "tr1-memory.hxx" #include +#ifdef HAVE_TR1_MEMORY +# include +#endif + // Raw pointer. // #pragma db object pointer(obj1*) diff --git a/common/relationship/tr1-memory.hxx b/common/relationship/tr1-memory.hxx deleted file mode 100644 index a4ce28a..0000000 --- a/common/relationship/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/relationship/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 7338a85..a51fddf 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -22,6 +22,7 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index e2950f9..e49d337 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index cc6d9cd..d6dbd3b 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/configure.ac b/configure.ac index bb0932c..b7eea10 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,10 @@ AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) 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. +# +TR1_MEMORY + # Check which database we are using. # DATABASE diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a2a2e64..a15ab93 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -6,9 +6,7 @@ #include // std::exit #include -#ifndef _MSC_VER -# include -#endif +#include #if defined(DATABASE_MYSQL) # include diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h new file mode 100644 index 0000000..fa739a4 --- /dev/null +++ b/libcommon/common/config-vc.h @@ -0,0 +1,14 @@ +/* file : libcommon/common/config-vc.h + * author : Boris Kolpackov + * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Configuration file for Windows/VC++. */ + +#ifndef LIBCOMMON_COMMON_CONFIG_VC_H +#define LIBCOMMON_COMMON_CONFIG_VC_H + +#define HAVE_TR1_MEMORY + +#endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index d0b2bd9..a1140e1 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -10,6 +10,7 @@ #define LIBCOMMON_COMMON_CONFIG_H #undef DATABASE_MYSQL +#undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB #endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx new file mode 100644 index 0000000..c08be65 --- /dev/null +++ b/libcommon/common/config.hxx @@ -0,0 +1,15 @@ +// file : libcommon/common/config.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_CONFIG_HXX +#define LIBCOMMON_COMMON_CONFIG_HXX + +#ifdef HAVE_CONFIG_VC_H +# include +#else +# include +#endif + +#endif // LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 4ea2d33..5a7fed1 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -6,9 +6,7 @@ #ifndef LIBCOMMON_COMMON_EXPORT_HXX #define LIBCOMMON_COMMON_EXPORT_HXX -#ifndef _MSC_VER -# include -#endif +#include #ifdef LIBCOMMON_STATIC_LIB # define LIBCOMMON_EXPORT diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj index 44034da..69494b0 100644 --- a/libcommon/common/libcommon-vc10.vcxproj +++ b/libcommon/common/libcommon-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -106,7 +106,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -126,7 +126,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -148,7 +148,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj index c7ef766..a7ec116 100644 --- a/libcommon/common/libcommon-vc9.vcproj +++ b/libcommon/common/libcommon-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -124,7 +124,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -203,7 +203,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -284,7 +284,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/libcommon/common/makefile b/libcommon/common/makefile index c9ecdaf..6259e69 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -42,8 +42,9 @@ $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommo $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make - @echo '// file : libcommon/config.h' >$@ - @echo '// author : automatically generated' >>$@ + @echo '/* file : libcommon/common/config.h' >$@ + @echo ' * author : automatically generated' >>$@ + @echo ' */' >>$@ @echo '' >>$@ @echo '#ifndef LIBCOMMON_COMMON_CONFIG_H' >>$@ @echo '#define LIBCOMMON_COMMON_CONFIG_H' >>$@ @@ -51,8 +52,9 @@ $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make ifeq ($(db_id),mysql) @echo '#define DATABASE_MYSQL 1' >>$@ endif + @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ - @echo '#endif // LIBCOMMON_COMMON_CONFIG_H' >>$@ + @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ $(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 new file mode 100644 index 0000000..7b78577 --- /dev/null +++ b/m4/tr1-memory.m4 @@ -0,0 +1,40 @@ +dnl file : m4/tr1-memory.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl TR1_MEMORY +dnl +dnl Check for TR1 availability. If successful, define HAVE_TR1_MEMORY +dnl as both a macro and conditional as well as set the tr1_memory variable +dnl to 'yes'. +dnl +AC_DEFUN([TR1_MEMORY], +[ +tr1_memory=no + +AC_MSG_CHECKING([for TR1 ]) + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +int +main () +{ + std::tr1::shared_ptr p (new int (10)); + *p = 11; +} +]]), +[tr1_memory=yes]) + +if test x"$tr1_memory" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_TR1_MEMORY], [1], [Have TR1 .]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL([HAVE_TR1_MEMORY], [test x$tr1_memory = xyes]) + +])dnl diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 7f33a6c..31eea41 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -24,7 +24,8 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index a22100c..a39d43a 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index a4e71d9..ac0810a 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -349,7 +349,7 @@ m4_ifelse(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index 6edccff..f594a51 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -7,6 +7,7 @@ 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' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; @@ -22,7 +23,8 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/tracer/template/template-vc10.vcxproj b/tracer/template/template-vc10.vcxproj index a385bad..d2e5ae0 100644 --- a/tracer/template/template-vc10.vcxproj +++ b/tracer/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,8 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -103,7 +104,8 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -120,7 +122,8 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -139,7 +142,8 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -156,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj index e12ab89..73649a4 100644 --- a/tracer/template/template-vc9.vcproj +++ b/tracer/template/template-vc9.vcproj @@ -45,7 +45,8 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -121,7 +122,8 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -197,7 +199,8 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -274,7 +277,8 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -345,7 +349,7 @@ m4_ifelse(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) -- cgit v1.1 From db5b409f5e6e5c5d3771febd8046240cdb3e06e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Jan 2011 16:57:28 +0200 Subject: Copyright update --- Makefile.am | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-tracer/configuration-rules.make | 2 +- build/import/libodb-tracer/configure | 2 +- build/import/libodb-tracer/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- common/Makefile.am | 2 +- common/auto/driver.cxx | 2 +- common/auto/makefile | 2 +- common/auto/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const/driver.cxx | 2 +- common/const/makefile | 2 +- common/const/test.hxx | 2 +- common/container/driver.cxx | 2 +- common/container/makefile | 2 +- common/container/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/query/driver.cxx | 2 +- common/query/makefile | 2 +- common/query/test.hxx | 2 +- common/query/traits.hxx | 2 +- common/relationship/driver.cxx | 2 +- common/relationship/makefile | 2 +- common/relationship/test.hxx | 2 +- common/schema/driver.cxx | 2 +- common/schema/makefile | 2 +- common/schema/test.hxx | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- configure.ac | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-tracer.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- tracer/Makefile.am | 2 +- tracer/include/driver.cxx | 2 +- tracer/include/makefile | 2 +- tracer/include/obj1.hxx | 2 +- tracer/include/obj2.hxx | 2 +- tracer/include/obj3.hxx | 2 +- tracer/include/objs1.hxx | 2 +- tracer/include/objs2.hxx | 2 +- tracer/include/objs3.hxx | 2 +- tracer/include/objs4.hxx | 2 +- tracer/include/test1.hxx | 2 +- tracer/include/test2.hxx | 2 +- tracer/include/test3.hxx | 2 +- tracer/include/test4.hxx | 2 +- tracer/makefile | 2 +- tracer/object/driver.cxx | 2 +- tracer/object/makefile | 2 +- tracer/object/test.hxx | 2 +- tracer/pragma/driver.cxx | 2 +- tracer/pragma/makefile | 2 +- tracer/pragma/test.hxx | 2 +- tracer/template/Makefile.am | 2 +- tracer/template/driver.cxx | 2 +- tracer/template/makefile | 2 +- tracer/template/test.hxx | 2 +- tracer/test.bat | 2 +- tracer/transaction/driver.cxx | 2 +- tracer/transaction/makefile | 2 +- tracer/types/driver.cxx | 2 +- tracer/types/makefile | 2 +- tracer/types/test.hxx | 2 +- 138 files changed, 138 insertions(+), 138 deletions(-) diff --git a/Makefile.am b/Makefile.am index cfe641c..96aee82 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # file : Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon tracer common diff --git a/bootstrap b/bootstrap index ceb2ea7..777bd86 100755 --- a/bootstrap +++ b/bootstrap @@ -2,7 +2,7 @@ # file : bootstrap # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index a59c8bc..319e70f 100644 --- a/build.bat +++ b/build.bat @@ -1,7 +1,7 @@ @echo off rem file : build.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 35e7a07..b598dc0 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,6 +1,6 @@ # file : build/bootstrap.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 19e7ef0..69048a8 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,6 +1,6 @@ # file : build/configuration-rules.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index fe27430..2cf8c9a 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,6 +1,6 @@ # file : build/configuration.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 0bb1e07..bc57e61 100755 --- a/build/configure +++ b/build/configure @@ -2,7 +2,7 @@ # file : build/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index b57907c..53e116c 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,6 +1,6 @@ # file : build/import/libodb-mysql/configuration-rules.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index b16cabe..cde10e2 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -2,7 +2,7 @@ # file : build/import/libodb-mysql/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index 259f1a1..c5162e2 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,6 +1,6 @@ # file : build/import/libodb-mysql/stub.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-tracer/configuration-rules.make b/build/import/libodb-tracer/configuration-rules.make index d5d2c21..2780987 100644 --- a/build/import/libodb-tracer/configuration-rules.make +++ b/build/import/libodb-tracer/configuration-rules.make @@ -1,6 +1,6 @@ # file : build/import/libodb-tracer/configuration-rules.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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/. diff --git a/build/import/libodb-tracer/configure b/build/import/libodb-tracer/configure index d02d7d6..644b804 100755 --- a/build/import/libodb-tracer/configure +++ b/build/import/libodb-tracer/configure @@ -2,7 +2,7 @@ # file : build/import/libodb-tracer/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-tracer/stub.make b/build/import/libodb-tracer/stub.make index a2c1798..8d4bb96 100644 --- a/build/import/libodb-tracer/stub.make +++ b/build/import/libodb-tracer/stub.make @@ -1,6 +1,6 @@ # file : build/import/libodb-tracer/stub.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 2c30e7f..9263bb0 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,6 +1,6 @@ # file : build/import/libodb/configuration-rules.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 792bb80..90e21d4 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -2,7 +2,7 @@ # file : build/import/libodb/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 9196552..97bb5ff 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,6 +1,6 @@ # file : build/import/libodb/stub.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 817f1b1..a16c36b 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,6 +1,6 @@ # file : build/import/odb/configuration-rules.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index 1ba2f09..43d6c70 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -2,7 +2,7 @@ # file : build/import/odb/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index c9f3325..e97443c 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,6 +1,6 @@ # file : build/import/odb/hxx-cxx.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 48585f0..ee7371e 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,6 +1,6 @@ # file : build/import/odb/stub.make # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mysql/configure b/build/mysql/configure index a454fc0..ac70779 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -2,7 +2,7 @@ # file : build/mysql/configure # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index c273d56..a6800a0 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -2,7 +2,7 @@ # file : build/mysql/mysql # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index 00c4ef0..2e6e958 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,6 +1,6 @@ # file : common/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index d912ad9..4388bbf 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -1,6 +1,6 @@ // file : common/auto/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/auto/makefile b/common/auto/makefile index 30d480a..896b19f 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -1,6 +1,6 @@ # file : common/auto/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 8c16a21..6f8106f 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -1,6 +1,6 @@ // file : common/auto/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 05d7298..bf8e668 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,6 +1,6 @@ // file : common/composite/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 81f32f0..48a1a17 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,6 +1,6 @@ # file : common/composite/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/composite/test.hxx b/common/composite/test.hxx index d70eefe..08497c8 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,6 +1,6 @@ // file : common/composite/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const/driver.cxx b/common/const/driver.cxx index e26fb3c..b4eb80e 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -1,6 +1,6 @@ // file : common/const/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const/makefile b/common/const/makefile index d465721..aeb4bdb 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -1,6 +1,6 @@ # file : common/const/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/const/test.hxx b/common/const/test.hxx index 0164880..341acb8 100644 --- a/common/const/test.hxx +++ b/common/const/test.hxx @@ -1,6 +1,6 @@ // file : common/const/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/driver.cxx b/common/container/driver.cxx index 9940c9a..b4f5b87 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -1,6 +1,6 @@ // file : common/container/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test container persistence. diff --git a/common/container/makefile b/common/container/makefile index 9fe50af..fe97426 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -1,6 +1,6 @@ # file : common/container/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/container/test.hxx b/common/container/test.hxx index 22bcdda..2e267f6 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -1,6 +1,6 @@ // file : common/container/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 78d5b4b..c8e418f 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,6 +1,6 @@ // file : common/ctor/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index 489ecdd..9949e59 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,6 +1,6 @@ # file : common/ctor/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 3d08ed0..09a3686 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,6 +1,6 @@ // file : common/ctor/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 34c9258..26ead16 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,6 +1,6 @@ // file : common/inverse/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index 05871d1..4025fee 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,6 +1,6 @@ # file : common/inverse/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 7dcb17e..ad7b108 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,6 +1,6 @@ // file : common/inverse/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 712cbdf..d03eaef 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,6 +1,6 @@ // file : common/lazy-ptr/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 78fe24b..8097d52 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,6 +1,6 @@ # file : common/lazy-ptr/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 9c671c1..b530316 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,6 +1,6 @@ // file : common/lazy-ptr/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index f836a2b..ae755a2 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,6 +1,6 @@ // file : common/lifecycle/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index e2f1f66..a6dd68b 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,6 +1,6 @@ # file : common/lifecycle/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 6db1c7e..4f591ec 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,6 +1,6 @@ // file : common/lifecycle/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index 6d95d8b..5a9b9cd 100644 --- a/common/makefile +++ b/common/makefile @@ -1,6 +1,6 @@ # file : common/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 5a77ae9..78f0bd4 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -1,6 +1,6 @@ // file : common/query/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support. diff --git a/common/query/makefile b/common/query/makefile index 0775df6..440a173 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -1,6 +1,6 @@ # file : common/query/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/query/test.hxx b/common/query/test.hxx index 883462e..124ee72 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -1,6 +1,6 @@ // file : common/query/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/traits.hxx b/common/query/traits.hxx index 45c1dc2..097f785 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -1,6 +1,6 @@ // file : common/query/traits.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index f7aa79e..44df17e 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -1,6 +1,6 @@ // file : common/relationship/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/makefile b/common/relationship/makefile index 36c3c48..94d70b8 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -1,6 +1,6 @@ # file : common/relationship/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 486c417..b9ad7c2 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -1,6 +1,6 @@ // file : common/relationship/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index 74321e3..344b4b6 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -1,6 +1,6 @@ // file : common/schema/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schema creation. diff --git a/common/schema/makefile b/common/schema/makefile index 0cd51d6..ae36fa4 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -1,6 +1,6 @@ # file : common/schema/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/schema/test.hxx b/common/schema/test.hxx index d770d8f..16875be 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -1,6 +1,6 @@ // file : common/schema/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/template/Makefile.am b/common/template/Makefile.am index a51fddf..758d015 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,6 +1,6 @@ # file : common/template/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 8fc92b8..9386784 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,6 +1,6 @@ // file : common/template/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 02605ef..b4c20fc 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,6 +1,6 @@ # file : common/template/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/template/test.hxx b/common/template/test.hxx index 1b945a6..6e528c7 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,6 +1,6 @@ // file : common/template/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 74e935d..8ea721c 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,7 +1,7 @@ @echo off rem file : common/test.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index bbd0ac0..6c64736 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,6 +1,6 @@ // file : common/threads/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index 71c522b..5ff53e8 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,6 +1,6 @@ # file : common/threads/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/common/threads/test.hxx b/common/threads/test.hxx index b9f7777..3f129f2 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,6 +1,6 @@ // file : common/template/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index b7eea10..18156dd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # file : configure.ac # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index e498e3b..f4904c1 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,6 +1,6 @@ # file : libcommon/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 67ebcef..f4886fe 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,6 +1,6 @@ # file : libcommon/common/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a15ab93..d451c4b 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,6 +1,6 @@ // file : libcommon/common/common.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 2a02a12..1862aae 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,6 +1,6 @@ // file : libcommon/common/common.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index fa739a4..e4a9397 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,6 +1,6 @@ /* file : libcommon/common/config-vc.h * author : Boris Kolpackov - * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index a1140e1..ad30893 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,6 +1,6 @@ /* file : libcommon/common/config.h.in * author : Boris Kolpackov - * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index c08be65..935f0bc 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,6 +1,6 @@ // file : libcommon/common/config.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 5a7fed1..1f1a229 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,6 +1,6 @@ // file : libcommon/common/export.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 6259e69..37b1f94 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,6 +1,6 @@ # file : libcommon/common/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/libcommon/makefile b/libcommon/makefile index 8f72324..cac6e2d 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,6 +1,6 @@ # file : libcommon/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/database.m4 b/m4/database.m4 index d49c7d2..6f75e27 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,6 +1,6 @@ dnl file : m4/database.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 5401748..0fcb62f 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,6 +1,6 @@ dnl file : m4/diff.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index 13e3ff3..e43ebff 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,6 +1,6 @@ dnl file : m4/libodb-mysql.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-tracer.m4 b/m4/libodb-tracer.m4 index bd7a371..4cc2265 100644 --- a/m4/libodb-tracer.m4 +++ b/m4/libodb-tracer.m4 @@ -1,6 +1,6 @@ dnl file : m4/libodb-tracer.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +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]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index a205afd..fb11859 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,6 +1,6 @@ dnl file : m4/libodb.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index d73c508..d8395d5 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,6 +1,6 @@ dnl file : m4/libtool-link.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mysql.m4 b/m4/mysql.m4 index b1a9d6a..5f35c91 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,6 +1,6 @@ dnl file : m4/mysql.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index b632f8c..a9f03c0 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,6 +1,6 @@ dnl file : m4/odb.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 1c0af42..f550b7b 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,6 +1,6 @@ dnl file : m4/static-lib.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index ea547c0..d4ed7cd 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,6 +1,6 @@ dnl file : m4/threads.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 7b78577..29966b3 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,6 +1,6 @@ dnl file : m4/tr1-memory.m4 dnl author : Boris Kolpackov -dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 9cabb96..25b5100 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ # file : makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mysql-driver.bat b/mysql-driver.bat index f246e7b..9edeaf8 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,7 +1,7 @@ @echo off rem file : mysql-driver.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index d07384b..8995e2d 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,6 +1,6 @@ # file : mysql/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/makefile b/mysql/makefile index fe6579e..c5af184 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,6 +1,6 @@ # file : mysql/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 31eea41..7571e28 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,6 +1,6 @@ # file : mysql/template/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 5e4d6b3..d7fecdf 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,6 +1,6 @@ // file : mysql/template/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 05285ec..6362ab2 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,6 +1,6 @@ # file : mysql/template/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index abac96e..e5a593f 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,6 +1,6 @@ // file : mysql/template/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index 694eef8..01659bc 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,7 +1,7 @@ @echo off rem file : mysql/test.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 97c7b94..7b8a11d 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,6 +1,6 @@ // file : mysql/truncation/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 79de168..aa216cd 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,6 +1,6 @@ # file : mysql/truncation/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 05cd028..f63b68b 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,6 +1,6 @@ // file : mysql/truncation/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index ef87afd..d4fa7ec 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,6 +1,6 @@ // file : mysql/types/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index d84614b..4d61eef 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,6 +1,6 @@ # file : mysql/types/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index d950a9a..80d1423 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,6 +1,6 @@ // file : mysql/types/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 7d42798..9ab0b32 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,6 +1,6 @@ // file : mysql/types/traits.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index 9d601cc..c3db132 100644 --- a/test.bat +++ b/test.bat @@ -1,7 +1,7 @@ @echo off rem file : test.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index fab0de2..23a0f8a 100644 --- a/tester.bat +++ b/tester.bat @@ -1,7 +1,7 @@ @echo off rem file : tester.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index 2e6ed32..fdf2b9c 100755 --- a/tester.in +++ b/tester.in @@ -2,7 +2,7 @@ # file : tester.in # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/tracer/Makefile.am b/tracer/Makefile.am index 395bd7c..acaf926 100644 --- a/tracer/Makefile.am +++ b/tracer/Makefile.am @@ -1,6 +1,6 @@ # file : tracer/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/tracer/include/driver.cxx b/tracer/include/driver.cxx index 111f542..70cdd99 100644 --- a/tracer/include/driver.cxx +++ b/tracer/include/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/include/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/tracer/include/makefile b/tracer/include/makefile index 6e8f00a..f5c9f32 100644 --- a/tracer/include/makefile +++ b/tracer/include/makefile @@ -1,6 +1,6 @@ # file : tracer/include/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/include/obj1.hxx b/tracer/include/obj1.hxx index f994c43..ef2429b 100644 --- a/tracer/include/obj1.hxx +++ b/tracer/include/obj1.hxx @@ -1,6 +1,6 @@ // file : tracer/include/obj1.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/tracer/include/obj2.hxx b/tracer/include/obj2.hxx index d29cbad..71018a8 100644 --- a/tracer/include/obj2.hxx +++ b/tracer/include/obj2.hxx @@ -1,6 +1,6 @@ // file : tracer/include/obj2.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/tracer/include/obj3.hxx b/tracer/include/obj3.hxx index 0490176..92bdc0b 100644 --- a/tracer/include/obj3.hxx +++ b/tracer/include/obj3.hxx @@ -1,6 +1,6 @@ // file : tracer/include/obj3.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/tracer/include/objs1.hxx b/tracer/include/objs1.hxx index 3df76ee..98c0f2f 100644 --- a/tracer/include/objs1.hxx +++ b/tracer/include/objs1.hxx @@ -1,6 +1,6 @@ // file : tracer/include/objs1.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/tracer/include/objs2.hxx b/tracer/include/objs2.hxx index 991fea1..c19811a 100644 --- a/tracer/include/objs2.hxx +++ b/tracer/include/objs2.hxx @@ -1,6 +1,6 @@ // file : tracer/include/objs2.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/tracer/include/objs3.hxx b/tracer/include/objs3.hxx index ed72d3c..b8828de 100644 --- a/tracer/include/objs3.hxx +++ b/tracer/include/objs3.hxx @@ -1,6 +1,6 @@ // file : tracer/include/objs3.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/tracer/include/objs4.hxx b/tracer/include/objs4.hxx index d7d6d97..7f76aea 100644 --- a/tracer/include/objs4.hxx +++ b/tracer/include/objs4.hxx @@ -1,6 +1,6 @@ // file : tracer/include/objs1.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/tracer/include/test1.hxx b/tracer/include/test1.hxx index d3bc35c..6f08900 100644 --- a/tracer/include/test1.hxx +++ b/tracer/include/test1.hxx @@ -1,6 +1,6 @@ // file : tracer/include/test1.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/tracer/include/test2.hxx b/tracer/include/test2.hxx index 9db23c4..74623d4 100644 --- a/tracer/include/test2.hxx +++ b/tracer/include/test2.hxx @@ -1,6 +1,6 @@ // file : tracer/include/test2.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/tracer/include/test3.hxx b/tracer/include/test3.hxx index 2ff8af7..3f1b762 100644 --- a/tracer/include/test3.hxx +++ b/tracer/include/test3.hxx @@ -1,6 +1,6 @@ // file : tracer/include/test3.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/tracer/include/test4.hxx b/tracer/include/test4.hxx index d6dc74b..8ea681a 100644 --- a/tracer/include/test4.hxx +++ b/tracer/include/test4.hxx @@ -1,6 +1,6 @@ // file : tracer/include/test3.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/tracer/makefile b/tracer/makefile index ef393ad..a549440 100644 --- a/tracer/makefile +++ b/tracer/makefile @@ -1,6 +1,6 @@ # file : tracer/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index 085c6a3..9c8d465 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/object/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object persistence operations. diff --git a/tracer/object/makefile b/tracer/object/makefile index a812671..428743d 100644 --- a/tracer/object/makefile +++ b/tracer/object/makefile @@ -1,6 +1,6 @@ # file : tracer/object/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/object/test.hxx b/tracer/object/test.hxx index e7adee3..38bbd7f 100644 --- a/tracer/object/test.hxx +++ b/tracer/object/test.hxx @@ -1,6 +1,6 @@ // file : tracer/object/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/tracer/pragma/driver.cxx b/tracer/pragma/driver.cxx index c227d4e..c463230 100644 --- a/tracer/pragma/driver.cxx +++ b/tracer/pragma/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/pragma/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/tracer/pragma/makefile b/tracer/pragma/makefile index b9da24c..caf5cd4 100644 --- a/tracer/pragma/makefile +++ b/tracer/pragma/makefile @@ -1,6 +1,6 @@ # file : tracer/pragma/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/pragma/test.hxx b/tracer/pragma/test.hxx index c3daac7..46f251e 100644 --- a/tracer/pragma/test.hxx +++ b/tracer/pragma/test.hxx @@ -1,6 +1,6 @@ // file : tracer/template/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index f594a51..c6cbb16 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -1,6 +1,6 @@ # file : tracer/template/Makefile.am # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx index 3b92d4f..616f966 100644 --- a/tracer/template/driver.cxx +++ b/tracer/template/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/template/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/tracer/template/makefile b/tracer/template/makefile index 023f5f9..0e5c780 100644 --- a/tracer/template/makefile +++ b/tracer/template/makefile @@ -1,6 +1,6 @@ # file : tracer/template/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/template/test.hxx b/tracer/template/test.hxx index c85ddde..93b7b93 100644 --- a/tracer/template/test.hxx +++ b/tracer/template/test.hxx @@ -1,6 +1,6 @@ // file : tracer/template/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/tracer/test.bat b/tracer/test.bat index 4c04576..705ce8d 100644 --- a/tracer/test.bat +++ b/tracer/test.bat @@ -1,7 +1,7 @@ @echo off rem file : tracer/test.bat rem author : Boris Kolpackov -rem copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index 92ce0f0..fcec91c 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/transaction/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction operations. diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index 2a3baee..fb02ee5 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -1,6 +1,6 @@ # file : tracer/transaction/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/types/driver.cxx b/tracer/types/driver.cxx index 3b28480..6847878 100644 --- a/tracer/types/driver.cxx +++ b/tracer/types/driver.cxx @@ -1,6 +1,6 @@ // file : tracer/types/driver.cxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/tracer/types/makefile b/tracer/types/makefile index f7fe190..c2da4c8 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -1,6 +1,6 @@ # file : tracer/types/makefile # author : Boris Kolpackov -# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# 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 diff --git a/tracer/types/test.hxx b/tracer/types/test.hxx index 8537e16..79a8f81 100644 --- a/tracer/types/test.hxx +++ b/tracer/types/test.hxx @@ -1,6 +1,6 @@ // file : tracer/types/test.hxx // author : Boris Kolpackov -// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX -- cgit v1.1 From 0c03d09050f35951b677ac30aa54ea3bc7be8e05 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Jan 2011 10:24:39 +0200 Subject: Remove always-empty variable --- tracer/transaction/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index fb02ee5..98d24b7 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -44,7 +44,7 @@ $(dist): export name := $(notdir $(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 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) -- cgit v1.1 From 4347819b7dc00b1bee19c754b32a0828aa6f50df Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Jan 2011 11:21:02 +0200 Subject: Add support for native SQL statement execution New test: mysql/native. New manual section: 3.9, "Executing Native SQL Statements". --- mysql/makefile | 1 + mysql/native/driver.cxx | 66 ++++++++++++++++++++++++++++++++++++++ mysql/native/makefile | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ mysql/native/test.std | 0 4 files changed, 152 insertions(+) create mode 100644 mysql/native/driver.cxx create mode 100644 mysql/native/makefile create mode 100644 mysql/native/test.std diff --git a/mysql/makefile b/mysql/makefile index c5af184..05400dc 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +native \ truncation \ types diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx new file mode 100644 index 0000000..1141860 --- /dev/null +++ b/mysql/native/driver.cxx @@ -0,0 +1,66 @@ +// file : mysql/native/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS test"); + db->execute ("CREATE TABLE test (n INT PRIMARY KEY) ENGINE=InnoDB"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); + assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); + assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/native/makefile b/mysql/native/makefile new file mode 100644 index 0000000..b3e616b --- /dev/null +++ b/mysql/native/makefile @@ -0,0 +1,85 @@ +# file : mysql/native/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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(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 $<,$< --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)) \ + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/native/test.std b/mysql/native/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 0dc3219453dbf9faee4a959947ab91d5fa92ba2f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Jan 2011 10:13:10 +0200 Subject: Bump version to 1.1.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7e03a1f..9084fa2 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.0.a2 \ No newline at end of file +1.1.0 -- cgit v1.1 From 8bddcc4ff986fdec0c4d3534adc0298f18355f55 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Jan 2011 10:39:54 +0200 Subject: Fix bug in makefile --- mysql/native/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/native/makefile b/mysql/native/makefile index b3e616b..c7c3fea 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -55,7 +55,7 @@ $(test): $(driver) $(src_base)/test.std $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .cxx.clean,$(cxx_od)) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. -- cgit v1.1 From 5b721648eb7cd159863f88f9e4a53298d790b1e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Jan 2011 14:39:27 +0200 Subject: Add missing header to distribution --- libcommon/common/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 37b1f94..1d78786 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -67,7 +67,7 @@ $(out_base)/: $(common.l) $(dist): export sources := $(cxx_tun) $(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): data_dist := config.h.in +$(dist): data_dist := config.h.in config-vc.h $(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ $(call vc10projs,libcommon) -- cgit v1.1 From af26563b3ea3a8b27cda930cc700893356353bb8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Jan 2011 14:39:49 +0200 Subject: Rename type to avoid conflict with member --- common/composite/test.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 08497c8..bd50cdc 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -18,7 +18,7 @@ struct name }; #pragma db value -struct title +struct name_title { std::string title; }; @@ -31,7 +31,7 @@ struct name_flags }; #pragma db value -struct name_ex: name, title +struct name_ex: name, name_title { name alias; std::string nick; -- cgit v1.1 From dfaf27b9ea913e3df21eb412bf371298af1f1570 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Jan 2011 14:55:03 +0200 Subject: Workaround VC 10 bug --- common/relationship/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 44df17e..637dfd0 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -47,7 +47,7 @@ main (int argc, char* argv[]) a.v1.push_back (new obj1 ("v1 2", "v1 2")); a.s1.insert (new obj1 ("s1 0", "s1 0")); - a.s1.insert (0); + a.s1.insert (static_cast (0)); // VC 10 a.s1.insert (new obj1 ("s1 2", "s1 2")); a.m1[0] = new obj1 ("m1 0", "m1 0"); -- cgit v1.1 From 8b4979c9e987e2d0510d8761f015148eabc285ec Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Feb 2011 09:18:11 +0200 Subject: Detect and ignore inner names in fq_*() functions --- tracer/types/test.hxx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tracer/types/test.hxx b/tracer/types/test.hxx index 79a8f81..c37692b 100644 --- a/tracer/types/test.hxx +++ b/tracer/types/test.hxx @@ -6,6 +6,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include + #ifdef ODB_COMPILER typedef int int_t; typedef short num_t; @@ -31,4 +33,37 @@ struct object2 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 -- cgit v1.1 From 534c93f60fdbf3e93e236cf71b3f10d88f3397e6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Feb 2011 13:54:07 +0200 Subject: Cosmetic changes --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 5eac30f..82a97fc 100644 --- a/INSTALL +++ b/INSTALL @@ -45,7 +45,7 @@ option to specify the build directory, for example: ./configure --with-odb=/tmp/odb -The configure script also expects the libodb , libodb-tracer, and +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 -- cgit v1.1 From 29e7db53cb1db2c4d743d4756b8ac3fee28ab8ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Feb 2011 16:53:22 +0200 Subject: Get rid of build version in INSTALL-GIT (just use latest) --- INSTALL-GIT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL-GIT b/INSTALL-GIT index 8899bd5..3276f45 100644 --- a/INSTALL-GIT +++ b/INSTALL-GIT @@ -21,7 +21,7 @@ following additional packages: - GNU bash >= 2.0.0 http://www.gnu.org/software/bash/ - GNU make >= 3.81 http://www.gnu.org/software/make/ - - build >= 0.3.8 http://www.codesynthesis.com/projects/build/ + - build >= latest http://www.codesynthesis.com/projects/build/ If you are planning to create the source code distributions, then you will also need the following packages: -- cgit v1.1 From 5aaec95bbfb066130ecac03eece3813cee61a3e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Feb 2011 14:50:11 +0200 Subject: Add test infrastructure for boost profile --- Makefile.am | 4 + boost/Makefile.am | 12 + boost/build.bat | 96 ++++++ boost/common/Makefile.am | 7 + boost/common/common-vc10.sln | 15 + boost/common/common-vc9.sln | 15 + boost/common/makefile | 44 +++ boost/common/template/Makefile.am | 28 ++ boost/common/template/driver.cxx | 44 +++ boost/common/template/makefile | 119 +++++++ boost/common/template/template-vc10.vcxproj | 177 ++++++++++ .../common/template/template-vc10.vcxproj.filters | 24 ++ boost/common/template/template-vc9.vcproj | 360 ++++++++++++++++++++ boost/common/template/test.hxx | 27 ++ boost/common/template/test.std | 1 + boost/common/test.bat | 81 +++++ boost/makefile | 38 +++ boost/mysql/Makefile.am | 7 + boost/mysql/makefile | 35 ++ boost/mysql/mysql-vc10.sln | 15 + boost/mysql/mysql-vc9.sln | 15 + boost/mysql/template/Makefile.am | 31 ++ boost/mysql/template/driver.cxx | 44 +++ boost/mysql/template/makefile | 116 +++++++ boost/mysql/template/template-vc10.vcxproj | 180 ++++++++++ boost/mysql/template/template-vc10.vcxproj.filters | 25 ++ boost/mysql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ boost/mysql/template/test.hxx | 27 ++ boost/mysql/template/test.std | 1 + boost/mysql/test.bat | 70 ++++ build/import/libboost/LICENSE | 340 +++++++++++++++++++ build/import/libboost/configuration-rules.make | 15 + build/import/libboost/configure | 74 +++++ build/import/libboost/date-time/rules.make | 51 +++ build/import/libboost/date-time/stub.make | 36 ++ build/import/libboost/header-only/rules.make | 18 + build/import/libboost/header-only/stub.make | 28 ++ build/import/libboost/version | 1 + build/import/libodb-boost/LICENSE | 12 + build/import/libodb-boost/configuration-rules.make | 15 + build/import/libodb-boost/configure | 55 ++++ build/import/libodb-boost/stub.make | 30 ++ common/test.bat | 5 +- configure.ac | 15 + m4/libboost.m4 | 186 +++++++++++ m4/libodb-boost.m4 | 84 +++++ makefile | 4 +- mysql/test.bat | 6 +- test.bat | 5 +- tracer/test.bat | 5 +- 50 files changed, 2993 insertions(+), 11 deletions(-) create mode 100644 boost/Makefile.am create mode 100644 boost/build.bat create mode 100644 boost/common/Makefile.am create mode 100644 boost/common/common-vc10.sln create mode 100644 boost/common/common-vc9.sln create mode 100644 boost/common/makefile create mode 100644 boost/common/template/Makefile.am create mode 100644 boost/common/template/driver.cxx create mode 100644 boost/common/template/makefile create mode 100644 boost/common/template/template-vc10.vcxproj create mode 100644 boost/common/template/template-vc10.vcxproj.filters create mode 100644 boost/common/template/template-vc9.vcproj create mode 100644 boost/common/template/test.hxx create mode 100644 boost/common/template/test.std create mode 100644 boost/common/test.bat create mode 100644 boost/makefile create mode 100644 boost/mysql/Makefile.am create mode 100644 boost/mysql/makefile create mode 100644 boost/mysql/mysql-vc10.sln create mode 100644 boost/mysql/mysql-vc9.sln create mode 100644 boost/mysql/template/Makefile.am create mode 100644 boost/mysql/template/driver.cxx create mode 100644 boost/mysql/template/makefile create mode 100644 boost/mysql/template/template-vc10.vcxproj create mode 100644 boost/mysql/template/template-vc10.vcxproj.filters create mode 100644 boost/mysql/template/template-vc9.vcproj create mode 100644 boost/mysql/template/test.hxx create mode 100644 boost/mysql/template/test.std create mode 100644 boost/mysql/test.bat create mode 100644 build/import/libboost/LICENSE create mode 100644 build/import/libboost/configuration-rules.make create mode 100755 build/import/libboost/configure create mode 100644 build/import/libboost/date-time/rules.make create mode 100644 build/import/libboost/date-time/stub.make create mode 100644 build/import/libboost/header-only/rules.make create mode 100644 build/import/libboost/header-only/stub.make create mode 100644 build/import/libboost/version create mode 100644 build/import/libodb-boost/LICENSE create mode 100644 build/import/libodb-boost/configuration-rules.make create mode 100755 build/import/libodb-boost/configure create mode 100644 build/import/libodb-boost/stub.make create mode 100644 m4/libboost.m4 create mode 100644 m4/libodb-boost.m4 diff --git a/Makefile.am b/Makefile.am index 96aee82..b0070f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,10 @@ SUBDIRS = libcommon tracer common +if ODB_TESTS_BOOST +SUBDIRS += boost +endif + if DATABASE_MYSQL SUBDIRS += mysql endif diff --git a/boost/Makefile.am b/boost/Makefile.am new file mode 100644 index 0000000..85915d2 --- /dev/null +++ b/boost/Makefile.am @@ -0,0 +1,12 @@ +# file : boost/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = common + +if DATABASE_MYSQL +SUBDIRS += mysql +endif + +EXTRA_DIST = __file__(extra_dist) diff --git a/boost/build.bat b/boost/build.bat new file mode 100644 index 0000000..4e4536c --- /dev/null +++ b/boost/build.bat @@ -0,0 +1,96 @@ +@echo off +rem file : boost/build.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem build.bat database vc-version [/Build|/Clean|/Rebuild] +rem +rem Build Boost tests using the VC++ batch mode compilation. +rem + +setlocal + +set "confs=__path__(configurations)" +set "plats=__path__(platforms)" +set "failed=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +if "_%2_" == "__" ( + echo no VC++ version specified + goto usage +) + +if "_%2_" == "_9_" set "vcver=9" +if "_%2_" == "_10_" set "vcver=10" + +if "_%vcver%_" == "__" ( + echo unknown VC++ version %2 + goto usage +) + +set "action=%3" +if "_%action%_" == "__" set "action=/Build" + +set "devenv=%DEVENV%" +if "_%devenv%_" == "__" set "devenv=devenv.com" + +goto start + +rem +rem %1 - solution name +rem %2 - configuration to build +rem %3 - platform to build +rem +:run_build + echo. + echo building boost/%1 %3 %2 + "%devenv%" %1 %action% "%2|%3" 2>&1 + if errorlevel 1 set "failed=%failed% boost/%1\%3\%2" +goto :eof + +:start + +for %%d in (%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 + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL BUILDS SUCCEEDED +echo. +goto end + +:usage +echo. +echo usage: build.bat database vc-version [action] +echo valid actions are /Build, /Clean, and /Rebuild +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am new file mode 100644 index 0000000..2b3806b --- /dev/null +++ b/boost/common/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/common/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) diff --git a/boost/common/common-vc10.sln b/boost/common/common-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/common/common-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/common/common-vc9.sln b/boost/common/common-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/common/common-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/common/makefile b/boost/common/makefile new file mode 100644 index 0000000..eeb083e --- /dev/null +++ b/boost/common/makefile @@ -0,0 +1,44 @@ +# file : boost/common/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 + +all_tests := $(tests) +build_tests := $(tests) + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) + +name := $(notdir $(src_base)) +$(dist): name := $(name) +$(dist): export dirs := $(tests) +$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ +$(call vc10slns,$(name)) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) + $(call meta-automake) + $(call meta-vc9slns,$(name)) + $(call meta-vc10slns,$(name)) + $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_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) + +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) +else +$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) +endif diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am new file mode 100644 index 0000000..4ab6efe --- /dev/null +++ b/boost/common/template/Makefile.am @@ -0,0 +1,28 @@ +# file : boost/common/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +# 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/boost/common/template/driver.cxx b/boost/common/template/driver.cxx new file mode 100644 index 0000000..19ce6d8 --- /dev/null +++ b/boost/common/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/common/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 // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/template/makefile b/boost/common/template/makefile new file mode 100644 index 0000000..d22654e --- /dev/null +++ b/boost/common/template/makefile @@ -0,0 +1,119 @@ +# file : boost/common/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) + +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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) --profile boost \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj new file mode 100644 index 0000000..44c2813 --- /dev/null +++ b/boost/common/template/template-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/boost/common/template/template-vc10.vcxproj.filters b/boost/common/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/boost/common/template/template-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj new file mode 100644 index 0000000..e024770 --- /dev/null +++ b/boost/common/template/template-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\..\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/boost/common/template/test.hxx b/boost/common/template/test.hxx new file mode 100644 index 0000000..ca19cba --- /dev/null +++ b/boost/common/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/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 object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/boost/common/template/test.std b/boost/common/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/common/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/boost/common/test.bat b/boost/common/test.bat new file mode 100644 index 0000000..a5f035a --- /dev/null +++ b/boost/common/test.bat @@ -0,0 +1,81 @@ +@echo off +rem file : boost/common/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=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +goto start + +rem +rem %1 - test directory +rem %2 - configuration +rem %3 - platform +rem %4 - database +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 %4 %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 %1 + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:usage +echo. +echo usage: test.bat database +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/boost/makefile b/boost/makefile new file mode 100644 index 0000000..8ab4602 --- /dev/null +++ b/boost/makefile @@ -0,0 +1,38 @@ +# file : boost/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 + +all_dirs := common mysql +dirs := common + +ifeq ($(db_id),mysql) +dirs += mysql +endif + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) + +$(dist): export extra_dist := build.bat +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) + $(call meta-vctest,common/common-mysql-vc10.sln,build.bat) + $(call meta-automake) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) + +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vctest.make) +$(call include,$(bld_root)/meta/automake.make) + +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) +else +$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) +endif diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am new file mode 100644 index 0000000..8d1c143 --- /dev/null +++ b/boost/mysql/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/mysql/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) diff --git a/boost/mysql/makefile b/boost/mysql/makefile new file mode 100644 index 0000000..0d3b7b4 --- /dev/null +++ b/boost/mysql/makefile @@ -0,0 +1,35 @@ +# file : boost/mysql/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 + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := $(notdir $(src_base)) +$(dist): export dirs := $(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/boost/mysql/mysql-vc10.sln b/boost/mysql/mysql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/mysql/mysql-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/mysql/mysql-vc9.sln b/boost/mysql/mysql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/mysql/mysql-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am new file mode 100644 index 0000000..29017fa --- /dev/null +++ b/boost/mysql/template/Makefile.am @@ -0,0 +1,31 @@ +# file : boost/mysql/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +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/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx new file mode 100644 index 0000000..8a65b0c --- /dev/null +++ b/boost/mysql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/mysql/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 // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile new file mode 100644 index 0000000..5abc8bc --- /dev/null +++ b/boost/mysql/template/makefile @@ -0,0 +1,116 @@ +# file : boost/mysql/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) + +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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 mysql --profile boost \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/boost/mysql/template/template-vc10.vcxproj b/boost/mysql/template/template-vc10.vcxproj new file mode 100644 index 0000000..53f73ab --- /dev/null +++ b/boost/mysql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + 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) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + ..\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.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..\..\..\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/boost/mysql/template/template-vc10.vcxproj.filters b/boost/mysql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/boost/mysql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj new file mode 100644 index 0000000..9d446a2 --- /dev/null +++ b/boost/mysql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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..\..\..\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/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx new file mode 100644 index 0000000..c89562b --- /dev/null +++ b/boost/mysql/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/mysql/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/boost/mysql/template/test.std b/boost/mysql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/mysql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat new file mode 100644 index 0000000..e9b2e5d --- /dev/null +++ b/boost/mysql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : boost/mysql/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 mysql %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/build/import/libboost/LICENSE b/build/import/libboost/LICENSE new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/build/import/libboost/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 more 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make new file mode 100644 index 0000000..df35c70 --- /dev/null +++ b/build/import/libboost/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libboost/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. + $(call message,,$(scf_root)/import/libboost/configure $@) + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libboost/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libboost/configuration-dynamic.make) + +endif diff --git a/build/import/libboost/configure b/build/import/libboost/configure new file mode 100755 index 0000000..7f78219 --- /dev/null +++ b/build/import/libboost/configure @@ -0,0 +1,74 @@ +#! /usr/bin/env bash + +# file : build/import/libboost/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + + +# $1 - out config file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + + +$echo +$echo "Configuring external dependency on 'boost libraries' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'boost libraries' as opposed to the development build?" +$echo + +installed=`read_y_n y` + +if [ "$installed" = "n" ]; then + + $echo + $echo "Please enter the 'boost' root directory." + $echo + + root=`read_path --directory --exist` + + $echo + $echo "Please select the library type you would like to use:" + $echo + $echo "(1) archive" + $echo "(2) shared object" + $echo + + type=`read_option "archive shared" "shared"` +fi + +$echo +$echo "Link explicitly to the boost system library? This library" +$echo "is available since boost 1.35.0 and linking to it explicitly" +$echo "may be required by newer linkers." +$echo + +link_system=`read_y_n y` + +$echo +$echo "Please enter optional suffix that may be embedded into the" +$echo "boost library names. For example, if your library names are in" +$echo "the libboost_regex-gcc41-mt-d.so form, then enter -gcc41-mt-d" +$echo "Otherwise leave this field blank." +$echo + +suffix= +read -e -p "[]: " suffix + +echo libboost_installed := $installed >$1 +echo libboost_suffix := $suffix >>$1 +echo libboost_system := $link_system >>$1 + +if [ "$installed" = "n" ]; then + + echo libboost_root := $root >>$1 + echo libboost_type := $type >>$1 + +fi diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make new file mode 100644 index 0000000..b9ea87b --- /dev/null +++ b/build/import/libboost/date-time/rules.make @@ -0,0 +1,51 @@ +# file : build/import/libboost/date-time/rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libboost/%: root := $(libboost_root) + +$(dcf_root)/import/libboost/date-time/date-time.l: \ + | $(dcf_root)/import/libboost/date-time/. + +ifeq ($(libboost_type),archive) + +ifeq ($(libboost_system),y) +$(dcf_root)/import/libboost/date-time/date-time.l: \ + $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).a \ + $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).a +else +$(dcf_root)/import/libboost/date-time/date-time.l: \ + $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).a +endif + @echo $^ >$@ + +else + +ifeq ($(libboost_system),y) +$(dcf_root)/import/libboost/date-time/date-time.l: \ + $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).so \ + $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).so +else +$(dcf_root)/import/libboost/date-time/date-time.l: \ + $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).so +endif + @echo $^ >$@ + @echo rpath:$(root)/stage/lib >>$@ + +endif + + +$(dcf_root)/import/libboost/date-time/date-time.l.cpp-options: \ + | $(dcf_root)/import/libboost/date-time/. + @echo include: -I$(root) >$@ + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libboost/date-time/date-time.l,\ +rm -f $(dcf_root)/import/libboost/date-time/date-time.l) + $(call message,,\ +rm -f $(dcf_root)/import/libboost/date-time/date-time.l.cpp-options) + +endif diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make new file mode 100644 index 0000000..66d1989 --- /dev/null +++ b/build/import/libboost/date-time/stub.make @@ -0,0 +1,36 @@ +# file : build/import/libboost/date-time/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) + +libboost_installed := + +$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make) + +ifdef libboost_installed + +ifeq ($(libboost_installed),y) + +ifeq ($(libboost_system),y) +$(call export,l: -lboost_date_time$(libboost_suffix) -lboost_system$(libboost_suffix),cpp_options: ) +else +$(call export,l: -lboost_date_time$(libboost_suffix),cpp_options: ) +endif + +else + +$(call include-once,$(scf_root)/import/libboost/date-time/rules.make,$(dcf_root)) + +$(call export,\ + l: $(dcf_root)/import/libboost/date-time/date-time.l,\ + cpp-options: $(dcf_root)/import/libboost/date-time/date-time.l.cpp-options) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make new file mode 100644 index 0000000..b966860 --- /dev/null +++ b/build/import/libboost/header-only/rules.make @@ -0,0 +1,18 @@ +# file : build/import/libboost/header-only/rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libboost/%: root := $(libboost_root) + +$(dcf_root)/import/libboost/header-only/header-only.l.cpp-options: \ + | $(dcf_root)/import/libboost/header-only/. + @echo include: -I$(root) >$@ + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libboost/header-only/header-only.l,\ +rm -f $(dcf_root)/import/libboost/header-only/header-only.l.cpp-options) + +endif diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make new file mode 100644 index 0000000..9c39397 --- /dev/null +++ b/build/import/libboost/header-only/stub.make @@ -0,0 +1,28 @@ +# file : build/import/libboost/header-only/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) + +libboost_installed := + +$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make) + +ifdef libboost_installed + +ifeq ($(libboost_installed),n) + +$(call include-once,$(scf_root)/import/libboost/header-only/rules.make,$(dcf_root)) + +$(call export,\ + l: ,\ + cpp-options: $(dcf_root)/import/libboost/header-only/header-only.l.cpp-options) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libboost/version b/build/import/libboost/version new file mode 100644 index 0000000..faef31a --- /dev/null +++ b/build/import/libboost/version @@ -0,0 +1 @@ +0.7.0 diff --git a/build/import/libodb-boost/LICENSE b/build/import/libodb-boost/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-boost/LICENSE @@ -0,0 +1,12 @@ +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-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make new file mode 100644 index 0000000..18de990 --- /dev/null +++ b/build/import/libodb-boost/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-boost/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-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. + $(call message,,$(scf_root)/import/libodb-boost/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-boost/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-boost/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure new file mode 100755 index 0000000..67699cd --- /dev/null +++ b/build/import/libodb-boost/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-boost/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-boost' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-boost' 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-boost'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-boost'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_boost_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-boost/stub.make b/build/import/libodb-boost/stub.make new file mode 100644 index 0000000..44abed4 --- /dev/null +++ b/build/import/libodb-boost/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-boost/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-boost/configuration-rules.make,$(dcf_root)) + +libodb_boost_installed := + +$(call -include,$(dcf_root)/import/libodb-boost/configuration-dynamic.make) + +ifdef libodb_boost_installed + +ifeq ($(libodb_boost_installed),y) + +$(call export,l: -lodb-boost -lodb,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-boost/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/common/test.bat b/common/test.bat index 8ea721c..4c6db0b 100644 --- a/common/test.bat +++ b/common/test.bat @@ -9,7 +9,8 @@ setlocal set "tests=__path__(dirs) __path__(thread_dirs)" set "confs=__path__(configurations)" set "plats=__path__(platforms)" -set "topdir=__path__(topdir)\.." +set "curdir=%CD%" +set "topdir=%curdir%\.." set "failed=" if "_%1_" == "__" ( @@ -42,7 +43,7 @@ rem ) ) - cd .. + cd %curdir% goto :eof :start diff --git a/configure.ac b/configure.ac index 18156dd..81d4a1a 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,21 @@ LIBODB_TRACER([], [AC_MSG_ERROR([libodb-tracer is not found; consider using --wi # TR1_MEMORY +# Check for boost. +# +odb_tests_boost=yes +LIBBOOST([], [odb_tests_boost=no]) +LIBBOOST_SYSTEM +LIBBOOST_SMART_PTR([], [odb_tests_boost=no]) +LIBBOOST_UNORDERED([], [odb_tests_boost=no]) +LIBBOOST_DATE_TIME([], [odb_tests_boost=no]) + +# Check for libodb-boost. +# +LIBODB_BOOST([], [odb_tests_boost=no]) + +AM_CONDITIONAL([ODB_TESTS_BOOST], [test x$odb_tests_boost != xno]) + # Check which database we are using. # DATABASE diff --git a/m4/libboost.m4 b/m4/libboost.m4 new file mode 100644 index 0000000..6ce9d79 --- /dev/null +++ b/m4/libboost.m4 @@ -0,0 +1,186 @@ +dnl file : m4/libboost.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 LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBBOOST], [ +libboost_found=no + +AC_MSG_CHECKING([for boost base headers]) + +AC_ARG_WITH( + [boost], + [AC_HELP_STRING([--with-boost=DIR],[location of boost build directory])], + [libboost_dir=${withval}], + [libboost_dir=]) + +# If libboost_dir was given, add the necessary preprocessor and linker flags. +# +if test x"$libboost_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libboost_dir], [$ac_pwd], [$libboost_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libboost_dir" + LDFLAGS="$LDFLAGS -L$abs_libboost_dir/stage/lib" +fi + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +#ifndef BOOST_VERSION +# error BOOST_VERSION not defined +#endif + +int +main () +{ +} +]]), +[ +libboost_found=yes +]) + +if test x"$libboost_found" = xno; then + if test x"$libboost_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libboost_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl +dnl +dnl LIBBOOST_HEADER_LIB(NAME, SOURCE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +AC_DEFUN([LIBBOOST_HEADER_LIB], [ +libboost_$1_found=no + +AC_MSG_CHECKING([for boost $1 library]) +CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) + +if test x"$libboost_$1_found" = xyes; then + AC_MSG_RESULT([yes]) + [$3] +else + AC_MSG_RESULT([no]) + [$4] +fi +])dnl +dnl +dnl LIBBOOST_LIB(NAME, SOURCE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) +dnl +AC_DEFUN([LIBBOOST_LIB], [ +libboost_$1_found=no + +AC_MSG_CHECKING([for boost $1 library]) + +save_LIBS="$LIBS" +LIBS="-lboost_$1 $LIBS" + +CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) + +# Try to fall back on the -mt version for backwards-compatibility. +# +if test x"$libboost_$1_found" = xno; then + LIBS="-lboost_$1-mt $save_LIBS" + CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) +fi + +if test x"$libboost_$1_found" = xno; then + LIBS="$save_LIBS" +fi + +if test x"$libboost_$1_found" = xyes; then + AC_MSG_RESULT([yes]) + [$3] +else + AC_MSG_RESULT([no]) + [$4] +fi +])dnl +dnl +dnl LIBBOOST_SMART_PTR([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([LIBBOOST_SMART_PTR], [ +LIBBOOST_HEADER_LIB([smart_ptr], +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + boost::shared_ptr sp (new int (10)); + boost::weak_ptr wp (sp); +} +]]), +[$1], +[$2]) +])dnl +dnl +dnl LIBBOOST_UNORDERED([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([LIBBOOST_UNORDERED], [ +LIBBOOST_HEADER_LIB([unordered], +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + boost::unordered_set s; + boost::unordered_map m; + + s.insert (1); + return m.find (1) != m.end (); +} +]]), +[$1], +[$2]) +])dnl +dnl +dnl LIBBOOST_SYSTEM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([LIBBOOST_SYSTEM], [ +LIBBOOST_LIB([system], +AC_LANG_SOURCE([[ +int +main () +{ +} +]]), +[$1], +[$2]) +])dnl +dnl +dnl LIBBOOST_DATE_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([LIBBOOST_DATE_TIME], [ +LIBBOOST_LIB([date_time], +AC_LANG_SOURCE([[ +#include + +int +main () +{ + boost::gregorian::greg_month m (1); + const char* s (m.as_short_string ()); + return s == 0; +} +]]), +[$1], +[$2]) +])dnl diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 new file mode 100644 index 0000000..323cc56 --- /dev/null +++ b/m4/libodb-boost.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-boost.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_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_BOOST], [ +libodb_boost_found=no + +AC_ARG_WITH( + [libodb-boost], + [AC_HELP_STRING([--with-libodb-boost=DIR],[location of libodb-boost build directory])], + [libodb_boost_dir=${withval}], + [libodb_boost_dir=]) + +AC_MSG_CHECKING([for libodb-boost]) + +# If libodb_boost_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_boost_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_boost_dir], [$ac_pwd], [$libodb_boost_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_boost_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_boost_dir/odb/boost" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-boost $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::boost::exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_boost_found=yes]) + +if test x"$libodb_boost_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_boost_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_boost_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/makefile b/makefile index 25b5100..038aec2 100644 --- a/makefile +++ b/makefile @@ -5,8 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql -dirs := common tracer +all_dirs := libcommon common tracer mysql boost +dirs := common tracer boost ifeq ($(db_id),mysql) dirs += mysql diff --git a/mysql/test.bat b/mysql/test.bat index 01659bc..66d0dcd 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -9,8 +9,8 @@ setlocal set "tests=__path__(dirs)" set "confs=__path__(configurations)" set "plats=__path__(platforms)" -set "topdir=__path__(topdir)\.." -set "PATH=__path__(topdir)\libcommon\bin64;__path__(topdir)\libcommon\bin;%PATH%" +set "curdir=%CD%" +set "topdir=%curdir%\.." set "failed=" goto start @@ -37,7 +37,7 @@ rem ) ) - cd .. + cd %curdir% goto :eof :start diff --git a/test.bat b/test.bat index c3db132..b672def 100644 --- a/test.bat +++ b/test.bat @@ -13,6 +13,7 @@ rem setlocal set "failed=" +set "curdir=%CD%" if "_%1_" == "__" ( echo no database specified @@ -33,12 +34,12 @@ rem cd %1 call test.bat %2 if errorlevel 1 set "failed=%failed% %1" - cd .. + cd %curdir% goto :eof :start -for %%d in (tracer common %1) do ( +for %%d in (tracer common %1 boost\common boost\%1) do ( call :run_test %%d %1 ) diff --git a/tracer/test.bat b/tracer/test.bat index 705ce8d..fcae726 100644 --- a/tracer/test.bat +++ b/tracer/test.bat @@ -9,7 +9,8 @@ setlocal set "tests=__path__(dirs)" set "confs=__path__(configurations)" set "plats=__path__(platforms)" -set "topdir=__path__(topdir)\.." +set "curdir=%CD%" +set "topdir=%curdir%\.." set "failed=" goto start @@ -36,7 +37,7 @@ rem ) ) - cd .. + cd %curdir% goto :eof :start -- cgit v1.1 From 4067bb225c7238d54b5a09ab4d3d23f60aef8a05 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Feb 2011 15:15:30 +0200 Subject: Update INSTALL with boost profile instructions --- INSTALL | 86 +++++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/INSTALL b/INSTALL index 82a97fc..10445a7 100644 --- a/INSTALL +++ b/INSTALL @@ -5,11 +5,13 @@ system you would like to use. Valid values for are: Prerequisites ============= - - - 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/ + + - 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/ + - libodb-boost (optional) http://www.codesynthesis.com/products/odb/ + - boost (optional) http://www.boost.org Building on UNIX ================ @@ -17,7 +19,7 @@ Building on UNIX The following build instructions are for the Linux/UNIX/Mac OS X operating systems as well as for Cygwin and MinGW on Windows. -The standard autotools-based build system is used on these platforms. +The standard autotools-based build system is used on these platforms. After unpacking the source code archive, change to the odb-tests package directory (referred to as odb-tests/ from now on) and run the configure script, for example: @@ -45,26 +47,30 @@ 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, libodb-tracer, +libodb-, and, if you would like to build the boost profile tests, +libodb-boost and boost 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: +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, --with-libodb-, --with-libodb-boost, and +--with-boost configure options to specify their locations, for example: ./configure --with-libodb=/tmp/libodb +For the boost build directory the configure script expects to find the +boost libraries in the stage/lib/ subdirectory. + For each value the configure script has a set of options in the form --with--* that allow you to specify various database system parameters, such as the login name, password, and database name, -that should be used when running the tests. Run configure with +that should be used when running the tests. Run configure with --help to see the available options for your database. As another example, the following configure command uses the specified @@ -93,38 +99,40 @@ 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 VC++ Directories Include and Library search lists. See the INSTALL -files in the library packages for more information on how to setup the -VC++ Directories. +libodb-, and, if you would like to build the boost profile tests, +libodb-boost and boost 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. For boost, refer to the boost documentation. There are two ways to build the tests with Visual Studio. After unpacking -the source code archive, you can manually open three solution files located -in the tracer\, common\, and \ 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\ directory it -is named common--vc.sln. And in the \ directory it -is named -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. - -Alternatively, you can use the build.bat batch file located in the odb-tests\ -directory to build all the solutions, for all the configurations and for all -the platforms automatically. The build.bat file has the following command -line interface: - -build.bat [/Build|/Clean|/Rebuild] +the source code archive, you can manually open solution files located in +the tracer\, common\, \, boost\common\, and boost\\ +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\ and boost\common\ directories they are +named common--vc.sln. And in the \ and boost\\ +directories they are named -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. + +Alternatively, you can use the build.bat batch files located in the odb-tests\ +and odb-tests\boost\ directories to build all the solutions, for all the +configurations and for all the platforms automatically. The build.bat file +has the following command line interface: + +build.bat [/Build|/Clean|/Rebuild] Where is the version of Visual Studio that you are using. If no action is specified, the default is /Build. -Once the build is completeed successfully, you can run all the tests using +Once the build is completed successfully, you can run all the tests using the test.bat batch file located in the odb-tests\ directory. Before you can run test.bat, you may need to adjust the database system parameters, such as the login name, password, and database name, that -should be used when running the tests. To do this, edit the +should be used when running the tests. To do this, edit the .options and -driver.bat files located in the odb-tests\ directory. Once this is, done you can run the tests by executing the following command from the command prompt: -- cgit v1.1 From 4a250a49537bf223b3665c0f5a017944531b3dfe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Feb 2011 10:42:41 +0200 Subject: Add odb::core namespace to be used in using-directives Port all the examples and tests. --- boost/common/template/driver.cxx | 2 +- boost/mysql/template/driver.cxx | 2 +- common/auto/driver.cxx | 2 +- common/composite/driver.cxx | 2 +- common/const/driver.cxx | 2 +- common/container/driver.cxx | 2 +- common/ctor/driver.cxx | 2 +- common/inverse/driver.cxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/query/driver.cxx | 2 +- common/relationship/driver.cxx | 2 +- common/schema/driver.cxx | 2 +- common/template/driver.cxx | 2 +- common/threads/driver.cxx | 3 ++- libcommon/common/common.cxx | 18 +++++++++--------- mysql/native/driver.cxx | 2 +- mysql/template/driver.cxx | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/types/driver.cxx | 2 +- tracer/include/driver.cxx | 2 +- tracer/object/driver.cxx | 4 ++-- tracer/pragma/driver.cxx | 2 +- tracer/template/driver.cxx | 4 ++-- tracer/transaction/driver.cxx | 3 ++- tracer/types/driver.cxx | 2 +- 26 files changed, 38 insertions(+), 36 deletions(-) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 19ce6d8..5865289 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index 8a65b0c..2a92ab4 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 4388bbf..9b863f8 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index bf8e668..51e6a26 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/const/driver.cxx b/common/const/driver.cxx index b4eb80e..10e3103 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -20,7 +20,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/container/driver.cxx b/common/container/driver.cxx index b4f5b87..0705794 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index c8e418f..23d2af1 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 26ead16..1f018e7 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -20,7 +20,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index d03eaef..c40eb92 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; auto_ptr create (unsigned int id) diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index ae755a2..8328700 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 78f0bd4..6bef996 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; void print (result& r) diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 637dfd0..cad17a0 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index 344b4b6..b53464c 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 9386784..ad95809 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 6c64736..212ff60 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -24,7 +24,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; +namespace details = odb::details; const unsigned long thread_count = 32; const unsigned long iteration_count = 100; diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index d451c4b..bffc0fc 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -18,9 +18,12 @@ #include using namespace std; -using namespace odb; -auto_ptr +#if defined(DATABASE_MYSQL) +using namespace odb::mysql; +#endif + +auto_ptr create_database (int& argc, char* argv[], size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) @@ -28,19 +31,16 @@ create_database (int& argc, char* argv[], size_t max_connections) cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; -#if defined(DATABASE_MYSQL) - mysql::database::print_usage (cerr); -#endif - + database::print_usage (cerr); exit (0); } #if defined(DATABASE_MYSQL) - auto_ptr f; + auto_ptr f; if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); + f.reset (new connection_pool_factory (max_connections)); - return auto_ptr (new mysql::database (argc, argv, false, 0, f)); + return auto_ptr (new database (argc, argv, false, 0, f)); #endif } diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 1141860..8854566 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -16,7 +16,7 @@ #include using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index d7fecdf..a305739 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 7b8a11d..b4f68b4 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index d4fa7ec..b675655 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -19,7 +19,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main (int argc, char* argv[]) diff --git a/tracer/include/driver.cxx b/tracer/include/driver.cxx index 70cdd99..f2f9382 100644 --- a/tracer/include/driver.cxx +++ b/tracer/include/driver.cxx @@ -33,7 +33,7 @@ #include "test4-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main () diff --git a/tracer/object/driver.cxx b/tracer/object/driver.cxx index 9c8d465..4ea6329 100644 --- a/tracer/object/driver.cxx +++ b/tracer/object/driver.cxx @@ -18,12 +18,12 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main () { - tracer::database db; + odb::tracer::database db; // database operation out of transaction // diff --git a/tracer/pragma/driver.cxx b/tracer/pragma/driver.cxx index c463230..2f89ad5 100644 --- a/tracer/pragma/driver.cxx +++ b/tracer/pragma/driver.cxx @@ -18,7 +18,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main () diff --git a/tracer/template/driver.cxx b/tracer/template/driver.cxx index 616f966..e63fae6 100644 --- a/tracer/template/driver.cxx +++ b/tracer/template/driver.cxx @@ -18,12 +18,12 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; int main () { - tracer::database db; + odb::tracer::database db; // // diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index fcec91c..f6945d4 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -15,7 +15,8 @@ #include using namespace std; -using namespace odb; +using namespace odb::core; +namespace tracer = odb::tracer; int main () diff --git a/tracer/types/driver.cxx b/tracer/types/driver.cxx index 6847878..9c1b97d 100644 --- a/tracer/types/driver.cxx +++ b/tracer/types/driver.cxx @@ -14,7 +14,7 @@ #include "test-odb.hxx" using namespace std; -using namespace odb; +using namespace odb::core; template struct same_p -- cgit v1.1 From bd09e3ff6f089bd3fc109fd054d30a099e2722ab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Feb 2011 10:56:47 +0200 Subject: Fix iteration over uncached query result --- common/query/driver.cxx | 11 +++++++++++ common/query/test.std | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 6bef996..9d948cc 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -401,6 +401,17 @@ main (int argc, char* argv[]) t.commit (); } + + // Test uncached result. + // + cout << "test 015" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe", false)); + print (r); + t.commit (); + } + } catch (const odb::exception& e) { diff --git a/common/query/test.std b/common/query/test.std index 14f3205..978282a 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -92,3 +92,7 @@ test 013 Joe Squeaky Dirt 31 single test 014 +test 015 +John Doe 30 married +Jane Doe 29 married + -- cgit v1.1 From dc4b2b20565a58f09c761b9affd6abdc7edb705b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Feb 2011 12:34:07 +0200 Subject: Add support for tests in subdirectories --- boost/build.bat | 4 ++-- boost/common/boost-common-vc10.sln | 15 +++++++++++++++ boost/common/boost-common-vc9.sln | 15 +++++++++++++++ boost/common/common-vc10.sln | 15 --------------- boost/common/common-vc9.sln | 15 --------------- boost/common/makefile | 2 +- boost/common/template/makefile | 2 +- boost/common/template/template-vc10.vcxproj | 18 +++++++++--------- boost/common/template/template-vc9.vcproj | 18 +++++++++--------- boost/makefile | 2 +- boost/mysql/boost-mysql-vc10.sln | 15 +++++++++++++++ boost/mysql/boost-mysql-vc9.sln | 15 +++++++++++++++ boost/mysql/makefile | 2 +- boost/mysql/mysql-vc10.sln | 15 --------------- boost/mysql/mysql-vc9.sln | 15 --------------- boost/mysql/template/makefile | 2 +- boost/mysql/template/template-vc10.vcxproj | 18 +++++++++--------- boost/mysql/template/template-vc9.vcproj | 18 +++++++++--------- common/auto/makefile | 2 +- common/composite/makefile | 2 +- common/const/makefile | 2 +- common/container/makefile | 2 +- common/ctor/makefile | 2 +- common/inverse/makefile | 2 +- common/lazy-ptr/makefile | 2 +- common/lifecycle/makefile | 2 +- common/makefile | 2 +- common/query/makefile | 2 +- common/relationship/makefile | 2 +- common/schema/makefile | 2 +- common/template/makefile | 2 +- common/template/template-vc10.vcxproj | 18 +++++++++--------- common/template/template-vc9.vcproj | 18 +++++++++--------- common/threads/makefile | 2 +- mysql/makefile | 2 +- mysql/native/makefile | 2 +- mysql/template/makefile | 2 +- mysql/template/template-vc10.vcxproj | 18 +++++++++--------- mysql/template/template-vc9.vcproj | 18 +++++++++--------- mysql/truncation/makefile | 2 +- mysql/types/makefile | 2 +- tracer/makefile | 2 +- tracer/object/makefile | 2 +- tracer/pragma/makefile | 2 +- tracer/template/makefile | 2 +- tracer/template/template-vc10.vcxproj | 10 +++++----- tracer/template/template-vc9.vcproj | 10 +++++----- tracer/transaction/makefile | 2 +- tracer/types/makefile | 2 +- 49 files changed, 174 insertions(+), 174 deletions(-) create mode 100644 boost/common/boost-common-vc10.sln create mode 100644 boost/common/boost-common-vc9.sln delete mode 100644 boost/common/common-vc10.sln delete mode 100644 boost/common/common-vc9.sln create mode 100644 boost/mysql/boost-mysql-vc10.sln create mode 100644 boost/mysql/boost-mysql-vc9.sln delete mode 100644 boost/mysql/mysql-vc10.sln delete mode 100644 boost/mysql/mysql-vc9.sln diff --git a/boost/build.bat b/boost/build.bat index 4e4536c..eb43d41 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -59,14 +59,14 @@ goto :eof for %%d in (%1) do ( for %%c in (%confs%) do ( for %%p in (%plats%) do ( - call :run_build %%d/%%d-vc%vcver%.sln %%c %%p + call :run_build %%d/boost-%%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 + call :run_build common/boost-common-%1-vc%vcver%.sln %%c %%p ) ) diff --git a/boost/common/boost-common-vc10.sln b/boost/common/boost-common-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/common/boost-common-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/common/boost-common-vc9.sln b/boost/common/boost-common-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/common/boost-common-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/common/common-vc10.sln b/boost/common/common-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/common/common-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/boost/common/common-vc9.sln b/boost/common/common-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/common/common-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/boost/common/makefile b/boost/common/makefile index eeb083e..4af0162 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -18,7 +18,7 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) -name := $(notdir $(src_base)) +name := boost-common $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ diff --git a/boost/common/template/makefile b/boost/common/template/makefile index d22654e..1a97660 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -58,7 +58,7 @@ $(out_base)/: $(driver) # Dist # -name := $(notdir $(src_base)) +name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj index 44c2813..e3c66a6 100644 --- a/boost/common/template/template-vc10.vcxproj +++ b/boost/common/template/template-vc10.vcxproj @@ -89,11 +89,11 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -105,11 +105,11 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -123,11 +123,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -143,11 +143,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj index e024770..b22262b 100644 --- a/boost/common/template/template-vc9.vcproj +++ b/boost/common/template/template-vc9.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -65,7 +65,7 @@ /> Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -105,11 +105,11 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -123,11 +123,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -143,11 +143,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\..\libcommon + $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\..\libcommon)) 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) ) diff --git a/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj index 9d446a2..0e8314b 100644 --- a/boost/mysql/template/template-vc9.vcproj +++ b/boost/mysql/template/template-vc9.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -65,7 +65,7 @@ /> Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -105,11 +105,11 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -123,11 +123,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) Console true true @@ -143,11 +143,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) Console true true @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index d6dbd3b..cd79624 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -65,7 +65,7 @@ /> Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -105,11 +105,11 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -123,11 +123,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -143,11 +143,11 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) - ..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) 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) ) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index ac0810a..a9b8038 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -65,7 +65,7 @@ /> Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -105,7 +105,7 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -123,7 +123,7 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -143,7 +143,7 @@ true true WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - ..\..\libcommon + $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) 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) ) diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj index 73649a4..da08589 100644 --- a/tracer/template/template-vc9.vcproj +++ b/tracer/template/template-vc9.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -122,7 +122,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -199,7 +199,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -277,7 +277,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories="..\..\libcommon" + AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -349,7 +349,7 @@ 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..\..\libcommon)) 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)) diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index 98d24b7..3979cf3 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -40,7 +40,7 @@ $(out_base)/: $(driver) # $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std -$(dist): export name := $(notdir $(src_base)) +$(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): diff --git a/tracer/types/makefile b/tracer/types/makefile index c2da4c8..ee24b4d 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -55,7 +55,7 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std -$(dist): export name := $(notdir $(src_base)) +$(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): -- cgit v1.1 From 76108c5211713934c20fdd8a78755e5b21697e1b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Mar 2011 16:13:25 +0200 Subject: Add support for building only certain configurations/platforms on Windows --- INSTALL | 12 ++++++++---- boost/build.bat | 37 ++++++++++++++++++++++++++++--------- build.bat | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/INSTALL b/INSTALL index 10445a7..5e87eb0 100644 --- a/INSTALL +++ b/INSTALL @@ -122,10 +122,14 @@ and odb-tests\boost\ directories to build all the solutions, for all the configurations and for all the platforms automatically. The build.bat file has the following command line interface: -build.bat [/Build|/Clean|/Rebuild] - -Where is the version of Visual Studio that you are using. If no action -is specified, the default is /Build. +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. 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/boost/build.bat b/boost/build.bat index eb43d41..9f1d742 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -5,17 +5,16 @@ rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem -rem build.bat database vc-version [/Build|/Clean|/Rebuild] -rem rem Build Boost tests using the VC++ batch mode compilation. rem +rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] +rem +rem conf: {Debug,Release}|all +rem plat: {Win32,x64}|all +rem setlocal -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "failed=" - if "_%1_" == "__" ( echo no database specified goto usage @@ -26,6 +25,18 @@ if "_%2_" == "__" ( goto usage ) +if "_%~3_" == "__" ( + echo no configuration specified + goto usage +) + +if "_%~4_" == "__" ( + echo no platform specified + goto usage +) + +set "failed=" + if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" @@ -34,7 +45,13 @@ if "_%vcver%_" == "__" ( goto usage ) -set "action=%3" +set "confs=%~3" +set "plats=%~4" + +if "_%confs%_" == "_all_" set "confs=__path__(configurations)" +if "_%plats%_" == "_all_" set "plats=__path__(platforms)" + +set "action=%5" if "_%action%_" == "__" set "action=/Build" set "devenv=%DEVENV%" @@ -79,8 +96,10 @@ goto end :usage echo. -echo usage: build.bat database vc-version [action] -echo valid actions are /Build, /Clean, and /Rebuild +echo usage: build.bat database vc-version conf plat [action] +echo valid configurations are: {Debug,Release}|all +echo valid platforms are: {Win32,x64}|all +echo valid actions are: /Build (default), /Clean, and /Rebuild echo. :error diff --git a/build.bat b/build.bat index 319e70f..23607c1 100644 --- a/build.bat +++ b/build.bat @@ -5,17 +5,16 @@ rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem -rem build.bat database vc-version [/Build|/Clean|/Rebuild] -rem rem Build tests using the VC++ batch mode compilation. rem +rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] +rem +rem conf: {Debug,Release}|all +rem plat: {Win32,x64}|all +rem setlocal -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "failed=" - if "_%1_" == "__" ( echo no database specified goto usage @@ -26,6 +25,18 @@ if "_%2_" == "__" ( goto usage ) +if "_%~3_" == "__" ( + echo no configuration specified + goto usage +) + +if "_%~4_" == "__" ( + echo no platform specified + goto usage +) + +set "failed=" + if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" @@ -34,7 +45,13 @@ if "_%vcver%_" == "__" ( goto usage ) -set "action=%3" +set "confs=%~3" +set "plats=%~4" + +if "_%confs%_" == "_all_" set "confs=__path__(configurations)" +if "_%plats%_" == "_all_" set "plats=__path__(platforms)" + +set "action=%5" if "_%action%_" == "__" set "action=/Build" set "devenv=%DEVENV%" @@ -85,8 +102,10 @@ goto end :usage echo. -echo usage: build.bat database vc-version [action] -echo valid actions are /Build, /Clean, and /Rebuild +echo usage: build.bat database vc-version conf plat [action] +echo valid configurations are: {Debug,Release}|all +echo valid platforms are: {Win32,x64}|all +echo valid actions are: /Build (default), /Clean, and /Rebuild echo. :error -- cgit v1.1 From 7772c7c6d6ee600095b394ddf2abf557aa53aacd Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 25 Feb 2011 13:19:52 +0200 Subject: Add support for boost date, ptime, and time_duration --- boost/mysql/date-time/driver.cxx | 183 +++++++++++++++++++++++++++++++++++++++ boost/mysql/date-time/makefile | 120 +++++++++++++++++++++++++ boost/mysql/date-time/test.hxx | 50 +++++++++++ boost/mysql/date-time/test.std | 0 boost/mysql/makefile | 1 + 5 files changed, 354 insertions(+) create mode 100644 boost/mysql/date-time/driver.cxx create mode 100644 boost/mysql/date-time/makefile create mode 100644 boost/mysql/date-time/test.hxx create mode 100644 boost/mysql/date-time/test.std diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx new file mode 100644 index 0000000..5dfd374 --- /dev/null +++ b/boost/mysql/date-time/driver.cxx @@ -0,0 +1,183 @@ +// file : boost/mysql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + + // MySQL time interface does not support fraction seconds. Construct + // with zero fractional seconds so that comparison test does not + // fail for invalid reasons. + // + o.times.push_back ( + ptime ( + date (max_date_time), + time_duration ( + ptime (max_date_time).time_of_day ().hours (), + ptime (max_date_time).time_of_day ().minutes (), + ptime (max_date_time).time_of_day ().seconds ()))); + + o.timestamps.push_back (second_clock::local_time ()); + o.timestamps.push_back (not_a_date_time); + + o.durations.push_back (time_duration (1, 2, 3)); + o.durations.push_back (time_duration (-1, 2, 3)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + + { + // Test invalid ptime (DATETIME) mappings. + // + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime (TIMESTAMP) mappings. + // + object or1, or2, sv1, sv2; + or1.timestamps.push_back (min_date_time); + or2.timestamps.push_back (max_date_time); + sv1.timestamps.push_back (neg_infin); + sv2.timestamps.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_out_of_range_value (or2, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid time_duration mappings. + // + object or1, or2, sv1, sv2; + or1.durations.push_back (time_duration (850, 0, 0)); + or2.durations.push_back (time_duration (-850, 0, 0)); + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_out_of_range_value (or2, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile new file mode 100644 index 0000000..c6de621 --- /dev/null +++ b/boost/mysql/date-time/makefile @@ -0,0 +1,120 @@ +# file : boost/mysql/date-time/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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 mysql --profile boost/date-time \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 := $(notdir $(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx new file mode 100644 index 0000000..235607f --- /dev/null +++ b/boost/mysql/date-time/test.hxx @@ -0,0 +1,50 @@ +// file : boost/mysql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + timestamps == x.timestamps && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + + // Specify NULL explicitly to suppress auto-initialization and + // auto-update characteristics of TIMESTAMP datatype, and to allow + // NULL values. + // + #pragma db value_type ("TIMESTAMP NULL") + std::vector timestamps; + + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/boost/mysql/date-time/test.std b/boost/mysql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 44853a6..6aa5a48 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ +date-time \ template default := $(out_base)/ -- cgit v1.1 From d131429888dd3f050c06feb2b24af9fb2734a54a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Mar 2011 11:22:15 +0200 Subject: Fix for tests in subdirectories support --- boost/mysql/date-time/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index c6de621..b979f3d 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -65,7 +65,7 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std -$(dist): export name := $(notdir $(src_base)) +$(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): -- cgit v1.1 From a236e04a281da3ce9b96418ed81a1dff85008da5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Mar 2011 10:57:43 +0200 Subject: Use more consistent naming convention --- common/lazy-ptr/driver.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index c40eb92..5f95c9a 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -119,11 +119,11 @@ main (int argc, char* argv[]) // Load. // - cont* lc (o->c.load ()); - obj* lo (c->o[0].load ()); + cont* cl (o->c.load ()); + obj* ol (c->o[0].load ()); - assert (lc == c.get ()); - assert (lo == o); + assert (cl == c.get ()); + assert (ol == o); // Test unload/reload. // @@ -191,11 +191,11 @@ main (int argc, char* argv[]) // Load. // - cont* lc (o->c.load ()); - const auto_ptr& lo (c->o.load ()); + cont* cl (o->c.load ()); + const auto_ptr& ol (c->o.load ()); - assert (lc == c.get ()); - assert (lo.get () == o); + assert (cl == c.get ()); + assert (ol.get () == o); t.commit (); } @@ -295,11 +295,11 @@ main (int argc, char* argv[]) // Load. // - shared_ptr lc (o->c.load ()); - shared_ptr lo (c->o[0].load ()); + shared_ptr cl (o->c.load ()); + shared_ptr ol (c->o[0].load ()); - assert (lc == c); - assert (lo == o); + assert (cl == c); + assert (ol == o); t.commit (); } @@ -321,11 +321,11 @@ main (int argc, char* argv[]) // Reload. // assert (!c->o[1].loaded ()); - shared_ptr lo (c->o[1].load ()); + shared_ptr ol (c->o[1].load ()); assert (c->o[1].loaded ()); - lo.reset (); + ol.reset (); assert (!c->o[1].loaded ()); - lo = c->o[1].load (); + ol = c->o[1].load (); assert (c->o[1].loaded ()); t.commit (); -- cgit v1.1 From 9bdf5bcbeb1b8748cdc269b04f9cbb5ca63630bf Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 2 Mar 2011 18:02:32 +0200 Subject: Add boost/common/smart-ptr and boost/common/unordered tests --- boost/common/makefile | 2 + boost/common/smart-ptr/driver.cxx | 178 +++++++++++++++++++++++++++++++ boost/common/smart-ptr/makefile | 119 +++++++++++++++++++++ boost/common/smart-ptr/test.hxx | 59 +++++++++++ boost/common/smart-ptr/test.std | 0 boost/common/unordered/driver.cxx | 214 ++++++++++++++++++++++++++++++++++++++ boost/common/unordered/makefile | 119 +++++++++++++++++++++ boost/common/unordered/test.hxx | 107 +++++++++++++++++++ boost/common/unordered/test.std | 0 9 files changed, 798 insertions(+) create mode 100644 boost/common/smart-ptr/driver.cxx create mode 100644 boost/common/smart-ptr/makefile create mode 100644 boost/common/smart-ptr/test.hxx create mode 100644 boost/common/smart-ptr/test.std create mode 100644 boost/common/unordered/driver.cxx create mode 100644 boost/common/unordered/makefile create mode 100644 boost/common/unordered/test.hxx create mode 100644 boost/common/unordered/test.std diff --git a/boost/common/makefile b/boost/common/makefile index 4af0162..5bb9732 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -6,6 +6,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ +unordered \ +smart-ptr \ template all_tests := $(tests) diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx new file mode 100644 index 0000000..478e4a9 --- /dev/null +++ b/boost/common/smart-ptr/driver.cxx @@ -0,0 +1,178 @@ +// file : boost/common/smart-ptr/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost smart pointers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace odb::boost; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + using boost::shared_ptr; + + try + { + auto_ptr db (create_database (argc, argv)); + + shared_ptr c1 (new cont (1)); + { + transaction t (db->begin ()); + db->persist (c1); + t.commit (); + } + + // Test comparison operators. + // + { + assert (lazy_shared_ptr () == lazy_shared_ptr ()); + assert (lazy_shared_ptr () != lazy_shared_ptr (c1)); + assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); + + lazy_shared_ptr lc1 (*db, 1); + assert (lc1 != lazy_shared_ptr ()); + assert (lc1 == lazy_shared_ptr (*db, c1)); + + shared_ptr c2 (new cont (2)); + assert (lc1 != lazy_shared_ptr (*db, c2)); + } + + // Test swap. + // + { + lazy_shared_ptr lx (*db, 1), ly; + assert (lx == lazy_shared_ptr (*db, c1)); + + swap (lx, ly); + assert (lx == lazy_shared_ptr ()); + assert (ly == lazy_shared_ptr (*db, c1)); + } + + // Test assignment from auto_ptr. + // + { + cont* p = new cont (3); + auto_ptr a (p); + lazy_shared_ptr l; + l = a; + + assert (l.get() == p); + assert (!a.get ()); + } + + shared_ptr o1 (new obj (1)); + shared_ptr o2 (new obj (2)); + shared_ptr o3 (new obj (3)); + shared_ptr o4 (new obj (4)); + shared_ptr c2 (new cont (2)); + + o1->c = c1; + o2->c = c1; + o3->c = c2; + o4->c = c2; + + // Persist. + // + { + transaction t (db->begin ()); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + db->persist (c2); + + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + + shared_ptr c (db->load (1)); + shared_ptr o (db->load (1)); + + // Ensure that lazy pointers are present but not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + assert (!o->c.loaded ()); + + // Ensure that the correct object IDs were loaded. + // + assert (c->o[0].object_id () == 1); + assert (c->o[1].object_id () == 2); + assert (o->c.object_id () == 1); + + // Load the lazy pointer targets ensuring that the loaded + // targets correspond to the cached session objects. + // + shared_ptr cl (o->c.load ()); + shared_ptr ol (c->o[0].load ()); + + assert (c->o[0].loaded ()); + assert (o->c.loaded ()); + + assert (cl == c); + assert (ol == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + // + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + lazy_shared_ptr l (c->o[1].lock ()); + assert (!l.loaded ()); + assert (l.object_id () == c->o[1].object_id ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + + shared_ptr ol (c->o[1].load ()); + assert (c->o[1].loaded ()); + + ol.reset (); + assert (!c->o[1].loaded ()); + + ol = c->o[1].load (); + assert (c->o[1].loaded ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile new file mode 100644 index 0000000..f18c095 --- /dev/null +++ b/boost/common/smart-ptr/makefile @@ -0,0 +1,119 @@ +# file : boost/common/smart-ptr/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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) \ +--profile boost/smart-ptr --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/boost/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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx new file mode 100644 index 0000000..ea158e7 --- /dev/null +++ b/boost/common/smart-ptr/test.hxx @@ -0,0 +1,59 @@ +// file : boost/common/smart-ptr/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +struct obj; + +using odb::boost::lazy_shared_ptr; +using odb::boost::lazy_weak_ptr; + +#pragma db object +struct cont +{ + cont () + { + } + + cont (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) not_null + obj_list o; +}; + +#pragma db object +struct obj +{ + obj () + { + } + + obj (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_shared_ptr c; +}; + +#endif // TEST_HXX diff --git a/boost/common/smart-ptr/test.std b/boost/common/smart-ptr/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx new file mode 100644 index 0000000..3750e58 --- /dev/null +++ b/boost/common/unordered/driver.cxx @@ -0,0 +1,214 @@ +// file : boost/common/unordered/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost container persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + // + // med + // + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + med.cms.insert (comp (123, "aaa")); + med.cms.insert (comp (234, "bbbb")); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csmm.insert ( + comp_str_multimap::value_type (comp (123, "aaa"), "aaa")); + med.csmm.insert ( + comp_str_multimap::value_type (comp (234, "bbbb"), "bbbb")); + + // + // full + // + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + full.cms.insert (comp (1234, "aaaa")); + full.cms.insert (comp (2345, "bbbbb")); + full.cms.insert (comp (3456, "cccccc")); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbbb"] = 2345; + full.snm["cccccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csmm.insert ( + comp_str_multimap::value_type (comp (1234, "aaaa"), "aaaa")); + full.csmm.insert ( + comp_str_multimap::value_type (comp (2345, "bbbbb"), "bbbbb")); + full.csmm.insert ( + comp_str_multimap::value_type (comp (3456, "cccccc"), "cccccc")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // empty + // + empty.ns.insert (12); + empty.ss.insert ("aa"); + empty.cms.insert (comp (12, "aa")); + + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csmm.insert ( + comp_str_multimap::value_type (comp (12, "aa"), "aa")); + + // med + // + med.ns.clear (); + med.ss.clear (); + med.cms.clear (); + + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csmm.clear (); + + // full + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + full.cms.insert (comp (4567, "ddddddd")); + + full.nsm[3456] += 'c'; + full.nsm[4567] = "ddddddd"; + full.snm["cccccc"]++; + full.snm["ddddddd"] = 4567; + full.ncm[3456].num++; + full.ncm[3456].str += 'c'; + full.ncm[4567] = comp (4567, "ddddddd"); + full.csmm.find (comp (3456, "cccccc"))->second += "c"; + full.csmm.insert ( + comp_str_multimap::value_type (comp (4567, "ddddddd"), "ddddddd")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile new file mode 100644 index 0000000..40ee870 --- /dev/null +++ b/boost/common/unordered/makefile @@ -0,0 +1,119 @@ +# file : boost/common/unordered/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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) \ +--profile boost/unordered --generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/boost/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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx new file mode 100644 index 0000000..02ed5bd --- /dev/null +++ b/boost/common/unordered/test.hxx @@ -0,0 +1,107 @@ +// file : boost/common/unordered/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +inline std::size_t +hash_value (const comp& x) +{ + std::size_t seed = 0; + boost::hash_combine (seed, x.num); + boost::hash_combine (seed, x.str); + return seed; +} + +using boost::unordered_set; +using boost::unordered_multiset; + +typedef unordered_set num_set; +typedef unordered_set str_set; +typedef unordered_multiset comp_multiset; + +using boost::unordered_map; +using boost::unordered_multimap; + +typedef unordered_map num_str_map; +typedef unordered_map str_num_map; +typedef unordered_map num_comp_map; +typedef unordered_multimap comp_str_multimap; + +#pragma db object +struct object +{ + object () + { + } + + object (const std::string& id) + : id (id) + { + } + + + #pragma db id + std::string id; + + // set + // + num_set ns; + str_set ss; + comp_multiset cms; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_multimap csmm; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id == y.id && + + x.ns == y.ns && + x.ss == y.ss && + x.cms == y.cms && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csmm == y.csmm; +} + +#endif // TEST_HXX diff --git a/boost/common/unordered/test.std b/boost/common/unordered/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 909b6ed207cc80d4bcac2ba56fc5a1769beac7dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Mar 2011 12:07:40 +0200 Subject: Bump version to 1.2.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 9084fa2..26aaba0 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.1.0 +1.2.0 -- cgit v1.1 From 939cffda799008298fd45344302d5e6c2889061d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Mar 2011 12:46:09 +0200 Subject: Link to threaded libmysqlclient in libodb-mysql import stub --- build/import/libodb-mysql/stub.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index c5162e2..d005fa5 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -13,7 +13,7 @@ ifdef libodb_mysql_installed ifeq ($(libodb_mysql_installed),y) -$(call export,l: -lodb-mysql -lodb -lmysqlclient,cpp-options: ) +$(call export,l: -lodb-mysql -lodb -lmysqlclient_r,cpp-options: ) else -- cgit v1.1 From 2b3b6f26e5125bdc23d07c88c369b5c6ce070a61 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 27 Mar 2011 15:13:09 +0200 Subject: Fix issues preventing building outside source directory --- boost/common/smart-ptr/makefile | 6 +++--- boost/common/template/makefile | 6 +++--- boost/common/unordered/makefile | 6 +++--- boost/mysql/date-time/makefile | 6 +++--- boost/mysql/template/makefile | 6 +++--- build/bootstrap.make | 5 +++++ common/auto/makefile | 6 +++--- common/composite/makefile | 6 +++--- common/const/makefile | 6 +++--- common/container/makefile | 6 +++--- common/ctor/makefile | 6 +++--- common/inverse/makefile | 6 +++--- common/lazy-ptr/makefile | 6 +++--- common/lifecycle/makefile | 6 +++--- common/query/makefile | 6 +++--- common/relationship/makefile | 6 +++--- common/schema/makefile | 6 +++--- common/template/makefile | 6 +++--- common/threads/makefile | 6 +++--- mysql/native/makefile | 2 +- mysql/template/makefile | 6 +++--- mysql/truncation/makefile | 6 +++--- mysql/types/makefile | 6 +++--- tracer/include/makefile | 4 ++-- tracer/object/makefile | 4 ++-- tracer/pragma/makefile | 4 ++-- tracer/template/makefile | 4 ++-- tracer/transaction/makefile | 2 +- tracer/types/makefile | 4 ++-- 29 files changed, 80 insertions(+), 75 deletions(-) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index f18c095..45983c9 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -35,7 +35,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/smart-ptr --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -76,7 +76,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 1a97660..4c4c4ad 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -35,7 +35,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --profile boost \ --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -76,7 +76,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 40ee870..f52e2a1 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -35,7 +35,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/unordered --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -76,7 +76,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index b979f3d..e80cf0b 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -39,7 +39,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -50,7 +50,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost/date-time \ --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -77,7 +77,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 2ad3a00..1e030fb 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -35,7 +35,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost \ --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) @@ -73,7 +73,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/build/bootstrap.make b/build/bootstrap.make index b598dc0..8ec887b 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -45,6 +45,11 @@ clean: $(out_base)/.clean endif +# Database schema creation. +# +$(out_base)/.test: schema = \ +$(call message,sql $$1,$(dcf_root)/db-driver $$1,$(out_base)/test.sql) + # Dist setup. # ifneq ($(filter $(MAKECMDGOALS),dist),) diff --git a/common/auto/makefile b/common/auto/makefile index 64e7d50..7907eb9 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/composite/makefile b/common/composite/makefile index 1ffb7c4..c7b21dc 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/const/makefile b/common/const/makefile index 0314fbe..d5a233e 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/container/makefile b/common/container/makefile index 2a95b15..115adb0 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/ctor/makefile b/common/ctor/makefile index 9eb8097..9c0c0ee 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/inverse/makefile b/common/inverse/makefile index d0185ad..4e393c8 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index f8c46af..ee599d2 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 346a6cd..9dc6dd6 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/query/makefile b/common/query/makefile index 2866b92..5e98970 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query --hxx-prologue '\#include "traits.hxx"' -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -67,7 +67,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/relationship/makefile b/common/relationship/makefile index 6b07c17..b60f0b2 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/schema/makefile b/common/schema/makefile index 9e6f616..7c67a8b 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/template/makefile b/common/template/makefile index 35da3c2..34d7faf 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/common/threads/makefile b/common/threads/makefile index 44c2a06..ddc97b9 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/mysql/native/makefile b/mysql/native/makefile index 035f72f..c58e56f 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -20,7 +20,7 @@ clean := $(out_base)/.clean # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(call include-dep,$(cxx_od)) diff --git a/mysql/template/makefile b/mysql/template/makefile index a492917..5964b0a 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -62,7 +62,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index adb015a..9a4f9b1 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-query \ --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -63,7 +63,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/mysql/types/makefile b/mysql/types/makefile index ed3674f..4114128 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -38,7 +38,7 @@ $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-schema \ --generate-query --cxx-prologue '\#include "traits.hxx"' -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) diff --git a/tracer/include/makefile b/tracer/include/makefile index f5c9f32..a7f7089 100644 --- a/tracer/include/makefile +++ b/tracer/include/makefile @@ -32,8 +32,8 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(out_base)/../.. \ --I$(src_base)/../.. +$(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)) diff --git a/tracer/object/makefile b/tracer/object/makefile index 9c4ef1f..bd0efca 100644 --- a/tracer/object/makefile +++ b/tracer/object/makefile @@ -32,7 +32,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -41,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) diff --git a/tracer/pragma/makefile b/tracer/pragma/makefile index 5ae74ef..688c6e1 100644 --- a/tracer/pragma/makefile +++ b/tracer/pragma/makefile @@ -32,7 +32,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -41,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) diff --git a/tracer/template/makefile b/tracer/template/makefile index ce99eb2..e527f3d 100644 --- a/tracer/template/makefile +++ b/tracer/template/makefile @@ -32,7 +32,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -41,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) diff --git a/tracer/transaction/makefile b/tracer/transaction/makefile index 3979cf3..5cc6ef5 100644 --- a/tracer/transaction/makefile +++ b/tracer/transaction/makefile @@ -27,7 +27,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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)) diff --git a/tracer/types/makefile b/tracer/types/makefile index ee24b4d..2a7ceb5 100644 --- a/tracer/types/makefile +++ b/tracer/types/makefile @@ -32,7 +32,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_tracer.l) $(odb.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(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) @@ -41,7 +41,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database tracer -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(odb_tracer.l.cpp-options) $(odb.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -- cgit v1.1 From cd1deec2f13b6976fb3aac0e5e8d42a79875aef1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 27 Mar 2011 15:38:42 +0200 Subject: Build infrastructure for SQLite --- build/bootstrap.make | 4 +- build/configure | 3 +- build/import/libodb-sqlite/LICENSE | 12 +++++ .../import/libodb-sqlite/configuration-rules.make | 15 ++++++ build/import/libodb-sqlite/configure | 55 ++++++++++++++++++++++ build/import/libodb-sqlite/stub.make | 30 ++++++++++++ build/sqlite/configure | 23 +++++++++ libcommon/common/common.cxx | 46 +++++++++++++++--- libcommon/common/makefile | 3 ++ makefile | 2 +- 10 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 build/import/libodb-sqlite/LICENSE create mode 100644 build/import/libodb-sqlite/configuration-rules.make create mode 100755 build/import/libodb-sqlite/configure create mode 100644 build/import/libodb-sqlite/stub.make create mode 100755 build/sqlite/configure diff --git a/build/bootstrap.make b/build/bootstrap.make index 8ec887b..07296c3 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -47,8 +47,10 @@ endif # Database schema creation. # +ifeq ($(filter $(db_id),sqlite),) $(out_base)/.test: schema = \ $(call message,sql $$1,$(dcf_root)/db-driver $$1,$(out_base)/test.sql) +endif # Dist setup. # @@ -60,7 +62,7 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql +databases := mysql sqlite $(dist): databases := $(databases) # $1 project template without the -vcN.vc[x]proj suffix. diff --git a/build/configure b/build/configure index bc57e61..2fc7846 100755 --- a/build/configure +++ b/build/configure @@ -23,9 +23,10 @@ $echo $echo "Please select the database you would like to use:" $echo $echo "(1) MySQL" +$echo "(2) SQLite" $echo -db_id=`read_option "mysql" "mysql"` +db_id=`read_option "mysql sqlite"` echo "db_id := $db_id" >$1 diff --git a/build/import/libodb-sqlite/LICENSE b/build/import/libodb-sqlite/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-sqlite/LICENSE @@ -0,0 +1,12 @@ +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-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make new file mode 100644 index 0000000..420f1ef --- /dev/null +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-sqlite/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-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. + $(call message,,$(scf_root)/import/libodb-sqlite/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure new file mode 100755 index 0000000..ee067ca --- /dev/null +++ b/build/import/libodb-sqlite/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-sqlite/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-sqlite' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-sqlite' 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-sqlite'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-sqlite'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_sqlite_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-sqlite/stub.make b/build/import/libodb-sqlite/stub.make new file mode 100644 index 0000000..43f0e11 --- /dev/null +++ b/build/import/libodb-sqlite/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-sqlite/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-sqlite/configuration-rules.make,$(dcf_root)) + +libodb_sqlite_installed := + +$(call -include,$(dcf_root)/import/libodb-sqlite/configuration-dynamic.make) + +ifdef libodb_sqlite_installed + +ifeq ($(libodb_sqlite_installed),y) + +$(call export,l: -lodb-sqlite -lodb -lsqlite3,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-sqlite/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/sqlite/configure b/build/sqlite/configure new file mode 100755 index 0000000..621d582 --- /dev/null +++ b/build/sqlite/configure @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +# file : build/sqlite/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +$echo +$echo "Please enter the SQLite database file name. Note that it WILL" +$echo "BE MODIFIED by the tests. If you do not specify a name, then a" +$echo "temporary on-disk database will be created. You can also specify" +$echo "':memory:' as a file name to use a temporary in-memory database." +$echo + +db=`read_value` + +opt=$dcf_root/db.options + +echo "--database '$db'" >$opt diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index bffc0fc..4ad169c 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -11,6 +11,11 @@ #if defined(DATABASE_MYSQL) # include # include +#elif defined(DATABASE_SQLITE) +# include +# include +# include +# include #else # error unknown database #endif @@ -18,12 +23,15 @@ #include using namespace std; +using namespace odb::core; #if defined(DATABASE_MYSQL) -using namespace odb::mysql; +namespace mysql = odb::mysql; +#elif defined(DATABASE_SQLITE) +namespace sqlite = odb::sqlite; #endif -auto_ptr +auto_ptr create_database (int& argc, char* argv[], size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) @@ -31,16 +39,42 @@ create_database (int& argc, char* argv[], size_t max_connections) cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; - database::print_usage (cerr); +#if defined(DATABASE_MYSQL) + mysql::database::print_usage (cerr); +#elif defined(DATABASE_SQLITE) + sqlite::database::print_usage (cerr); +#endif + exit (0); } + auto_ptr db; + #if defined(DATABASE_MYSQL) - auto_ptr f; + auto_ptr f; if (max_connections != 0) - f.reset (new connection_pool_factory (max_connections)); + f.reset (new mysql::connection_pool_factory (max_connections)); + + db.reset (new mysql::database (argc, argv, false, 0, f)); +#elif defined(DATABASE_SQLITE) + auto_ptr f; - return auto_ptr (new database (argc, argv, false, 0, f)); + if (max_connections != 0) + f.reset (new sqlite::connection_pool_factory (max_connections)); + + db.reset ( + new sqlite::database ( + argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, f)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + } #endif + + return db; } diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 1d78786..ae7d2ce 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -52,6 +52,9 @@ $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make ifeq ($(db_id),mysql) @echo '#define DATABASE_MYSQL 1' >>$@ endif +ifeq ($(db_id),sqlite) + @echo '#define DATABASE_SQLITE 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ diff --git a/makefile b/makefile index 038aec2..896f788 100644 --- a/makefile +++ b/makefile @@ -31,7 +31,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call dist-dir,m4) $(call meta-vctest,tracer/tracer-vc10.sln,build.bat) $(call meta-automake) - $(call meta-autoconf) + $(call meta-autoconf) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) -- cgit v1.1 From 3de8e4843bc85f9fc6e63c1a4fea6b57ff0351b6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 27 Mar 2011 15:53:16 +0200 Subject: Add traits implementation for SQLite --- common/query/traits-mysql.hxx | 59 ++++++++++++++++++++++++++++++++++++++++++ common/query/traits-sqlite.hxx | 59 ++++++++++++++++++++++++++++++++++++++++++ common/query/traits.hxx | 54 +++++--------------------------------- 3 files changed, 124 insertions(+), 48 deletions(-) create mode 100644 common/query/traits-mysql.hxx create mode 100644 common/query/traits-sqlite.hxx diff --git a/common/query/traits-mysql.hxx b/common/query/traits-mysql.hxx new file mode 100644 index 0000000..cce99db --- /dev/null +++ b/common/query/traits-mysql.hxx @@ -0,0 +1,59 @@ +// file : common/query/traits-mysql.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_MYSQL_HXX +#define TRAITS_MYSQL_HXX + +#include +#include // std::auto_ptr +#include // std::memcpy + +#include + +namespace odb +{ + namespace mysql + { + template <> + class value_traits, details::buffer, id_string> + { + public: + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (std::auto_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_MYSQL_HXX diff --git a/common/query/traits-sqlite.hxx b/common/query/traits-sqlite.hxx new file mode 100644 index 0000000..57cf9c2 --- /dev/null +++ b/common/query/traits-sqlite.hxx @@ -0,0 +1,59 @@ +// file : common/query/traits-sqlite.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_SQLITE_HXX +#define TRAITS_SQLITE_HXX + +#include +#include // std::auto_ptr +#include // std::memcpy + +#include + +namespace odb +{ + namespace sqlite + { + template <> + class value_traits, details::buffer, id_text> + { + public: + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (std::auto_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_SQLITE_HXX diff --git a/common/query/traits.hxx b/common/query/traits.hxx index 097f785..ce8b3e6 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -6,54 +6,12 @@ #ifndef TRAITS_HXX #define TRAITS_HXX -#include -#include // std::auto_ptr -#include // std::memcpy +#include -#include - -namespace odb -{ - namespace mysql - { - template <> - class value_traits, details::buffer, id_string> - { - public: - typedef std::auto_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (std::auto_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const std::auto_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} +#if defined(DATABASE_MYSQL) +# include "traits-mysql.hxx" +#elif defined(DATABASE_SQLITE) +# include "traits-sqlite.hxx" +#endif #endif // TRAITS_HXX -- cgit v1.1 From e61fb61f6406db4d1b3b33eb72007ba22efb44bd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 09:54:19 +0200 Subject: Recode tests to work with implementations lacking result::size() --- common/composite/driver.cxx | 6 ++++-- common/const/driver.cxx | 12 ++++++++---- common/ctor/driver.cxx | 15 +++++++-------- common/inverse/driver.cxx | 9 ++++++--- common/query/driver.cxx | 6 +++--- common/relationship/driver.cxx | 3 ++- libcommon/common/common.cxx | 2 ++ libcommon/common/common.hxx | 21 ++++++++++++++++++++- 8 files changed, 52 insertions(+), 22 deletions(-) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 51e6a26..e1dfef8 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -92,8 +92,9 @@ main (int argc, char* argv[]) result r (db->query (query::name::first == "Joe")); - assert (r.size () == 1); + assert (!r.empty ()); assert (*r.begin () == p); + assert (size (r) == 1); t.commit (); } @@ -105,8 +106,9 @@ main (int argc, char* argv[]) result r (db->query (query::name::flags::alias)); - assert (r.size () == 1); + assert (!r.empty ()); assert (*r.begin () == p); + assert (size (r) == 1); t.commit (); } diff --git a/common/const/driver.cxx b/common/const/driver.cxx index 10e3103..17c2edc 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -122,8 +122,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); result1 r1 (db->query (query1::id < 3)); - - assert (r1.size () == 2); + size_t n1 (0); for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) { @@ -134,11 +133,13 @@ main (int argc, char* argv[]) i.load (o); assert (p->id == o.id); delete p; + n1++; } - result2 r2 (db->query (query2::id < 3)); + assert (n1 == 2); - assert (r2.size () == 2); + result2 r2 (db->query (query2::id < 3)); + size_t n2 (0); for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) { @@ -148,8 +149,11 @@ main (int argc, char* argv[]) obj2 o (0); i.load (o); assert (p->id == o.id); + n2++; } + assert (n2 == 2); + t.commit (); } diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 23d2af1..a83724c 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -58,16 +58,15 @@ main (int argc, char* argv[]) result r (db->query (query::age < 30)); - assert (r.size () == 1); + assert (!r.empty ()); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - i.load (p); + result::iterator i (r.begin ()); + i.load (p); + assert (p.first_ == "Jane"); + assert (p.last_ == "Doe"); + assert (p.age_ == 29); - assert (p.first_ == "Jane"); - assert (p.last_ == "Doe"); - assert (p.age_ == 29); - } + assert (size (r) == 1); t.commit (); } diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 1f018e7..c07b751 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -173,9 +173,10 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::o1::id == "obj1 1")); - assert (r.size () == 1); + assert (!r.empty ()); assert (r.begin ()->id == o2->id); assert (r.begin ()->o1->id == o1_1->id); + assert (size (r) == 1); t.commit (); } @@ -190,15 +191,17 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::o1::id == "obj1 1")); - - assert (r.size () == 2); + size_t n (0); for (result::iterator i (r.begin ()); i != r.end (); ++i) { assert (i->id == o3_1->id || i->id == o3_2->id); assert (i->o1->id == o1_1->id); + n++; } + assert (n == 2); + t.commit (); } diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 9d948cc..2f97f2e 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -392,10 +392,10 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::last_name == "Doe")); - assert (r.size () == 2); - result::iterator i (r.begin ()); - i++; + assert (i != r.end ()); + ++i; + assert (i != r.end ()); auto_ptr joe (db->load (3)); assert (i->last_name_ == "Doe"); diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index cad17a0..abbae29 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -105,8 +105,9 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::o1::str == "obj1")); - assert (r.size () == 1); + assert (!r.empty ()); assert (r.begin ()->o1->id == a.o1->id); + assert (size (r) == 1); t.commit (); } diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 4ad169c..1ed65e3 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -8,6 +8,8 @@ #include +#include + #if defined(DATABASE_MYSQL) # include # include diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 1862aae..23e9d80 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -9,11 +9,30 @@ #include // std::auto_ptr #include // std::size_t -#include +#include // odb::database +#include +#include #include LIBCOMMON_EXPORT std::auto_ptr create_database (int& argc, char* argv[], std::size_t max_connections = 0); +// This function returns an accurate result only if the result iterator +// hasn't been advanced. +// +template +std::size_t +size (odb::result& r) +{ + std::size_t n (0); +#if defined(DATABASE_SQLITE) + for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) + n++; +#else + n = r.size (); +#endif + return n; +} + #endif // LIBCOMMON_COMMON_COMMON_HXX -- cgit v1.1 From 617ab182e622c7b59178fde32f38279984f44806 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:18:43 +0200 Subject: Use odb/ instead of odb/mysql/ headers --- boost/common/smart-ptr/driver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index 478e4a9..eaa4bbd 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include #include -- cgit v1.1 From 6dd8138b765b8533958bc23d39e95a17377d4f75 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:19:30 +0200 Subject: Use dummy boost/version instead of full boost profile The actual tests should use specific sub-profiles that they test. --- boost/common/template/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 4c4c4ad..85000d3 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -44,8 +44,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --profile boost \ ---generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) \ +--profile boost/version --generate-schema # CHANGE boost/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) -- cgit v1.1 From b6f2b4e1e924965d55e656992a48cc3cd19e64a2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:21:46 +0200 Subject: Add schema creation flag to create_database() --- common/threads/driver.cxx | 2 +- libcommon/common/common.cxx | 10 +++++++++- libcommon/common/common.hxx | 5 ++++- mysql/native/driver.cxx | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 212ff60..9aab254 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -114,7 +114,7 @@ struct task void test (int argc, char* argv[], size_t max_connections) { - auto_ptr db (create_database (argc, argv, max_connections)); + auto_ptr db (create_database (argc, argv, true, max_connections)); vector > threads; vector > tasks; diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 1ed65e3..a6fa4e1 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -34,7 +34,14 @@ namespace sqlite = odb::sqlite; #endif auto_ptr -create_database (int& argc, char* argv[], size_t max_connections) +create_database (int& argc, + char* argv[], +#if defined(DATABASE_SQLITE) + bool schema, +#else + bool, +#endif + size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) { @@ -71,6 +78,7 @@ create_database (int& argc, char* argv[], size_t max_connections) // Create the database schema. // + if (schema) { transaction t (db->begin ()); schema_catalog::create_schema (*db); diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 23e9d80..6ace845 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -16,7 +16,10 @@ #include LIBCOMMON_EXPORT std::auto_ptr -create_database (int& argc, char* argv[], std::size_t max_connections = 0); +create_database (int& argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0); // This function returns an accurate result only if the result iterator // hasn't been advanced. diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 8854566..437a160 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -23,7 +23,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); // Create the database schema. // -- cgit v1.1 From d2c8179bfef0503647c519f44401f29d8bddd122 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:22:38 +0200 Subject: Cosmetic changes --- mysql/types/traits.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 9ab0b32..df105e7 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -10,7 +10,7 @@ #include -#include "test.hxx" // date_time +#include "test.hxx" // date_time, buffer namespace odb { @@ -194,15 +194,15 @@ namespace odb }; template <> - class value_traits, details::buffer, id_string> + class value_traits { public: - typedef std::auto_ptr value_type; + typedef string_ptr value_type; typedef std::string query_type; typedef details::buffer image_type; static void - set_value (std::auto_ptr& v, + set_value (string_ptr& v, const details::buffer& b, std::size_t n, bool is_null) @@ -214,7 +214,7 @@ namespace odb set_image (details::buffer& b, std::size_t& n, bool& is_null, - const std::auto_ptr& v) + const string_ptr& v) { is_null = v.get () == 0; -- cgit v1.1 From 1ba1097cd1d71b945255d9401ffa4f04a036e94f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:22:59 +0200 Subject: Add SQLite-specific tests --- makefile | 4 + sqlite/Makefile.am | 7 + sqlite/makefile | 38 +++ sqlite/mysql-vc10.sln | 15 ++ sqlite/mysql-vc9.sln | 15 ++ sqlite/native/driver.cxx | 66 +++++ sqlite/native/makefile | 85 ++++++ sqlite/native/test.std | 0 sqlite/template/Makefile.am | 31 +++ sqlite/template/driver.cxx | 44 ++++ sqlite/template/makefile | 105 ++++++++ sqlite/template/template-vc10.vcxproj | 180 +++++++++++++ sqlite/template/template-vc10.vcxproj.filters | 25 ++ sqlite/template/template-vc9.vcproj | 361 ++++++++++++++++++++++++++ sqlite/template/test.hxx | 27 ++ sqlite/template/test.std | 1 + sqlite/test.bat | 70 +++++ sqlite/truncation/driver.cxx | 162 ++++++++++++ sqlite/truncation/makefile | 106 ++++++++ sqlite/truncation/test.hxx | 48 ++++ sqlite/truncation/test.std | 0 sqlite/types/driver.cxx | 64 +++++ sqlite/types/makefile | 108 ++++++++ sqlite/types/test.hxx | 145 +++++++++++ sqlite/types/test.std | 0 sqlite/types/traits.hxx | 96 +++++++ 26 files changed, 1803 insertions(+) create mode 100644 sqlite/Makefile.am create mode 100644 sqlite/makefile create mode 100644 sqlite/mysql-vc10.sln create mode 100644 sqlite/mysql-vc9.sln create mode 100644 sqlite/native/driver.cxx create mode 100644 sqlite/native/makefile create mode 100644 sqlite/native/test.std create mode 100644 sqlite/template/Makefile.am create mode 100644 sqlite/template/driver.cxx create mode 100644 sqlite/template/makefile create mode 100644 sqlite/template/template-vc10.vcxproj create mode 100644 sqlite/template/template-vc10.vcxproj.filters create mode 100644 sqlite/template/template-vc9.vcproj create mode 100644 sqlite/template/test.hxx create mode 100644 sqlite/template/test.std create mode 100644 sqlite/test.bat create mode 100644 sqlite/truncation/driver.cxx create mode 100644 sqlite/truncation/makefile create mode 100644 sqlite/truncation/test.hxx create mode 100644 sqlite/truncation/test.std create mode 100644 sqlite/types/driver.cxx create mode 100644 sqlite/types/makefile create mode 100644 sqlite/types/test.hxx create mode 100644 sqlite/types/test.std create mode 100644 sqlite/types/traits.hxx diff --git a/makefile b/makefile index 896f788..0eaf04d 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,10 @@ ifeq ($(db_id),mysql) dirs += mysql endif +ifeq ($(db_id),sqlite) +dirs += sqlite +endif + default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am new file mode 100644 index 0000000..7661bd9 --- /dev/null +++ b/sqlite/Makefile.am @@ -0,0 +1,7 @@ +# file : sqlite/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) diff --git a/sqlite/makefile b/sqlite/makefile new file mode 100644 index 0000000..b421807 --- /dev/null +++ b/sqlite/makefile @@ -0,0 +1,38 @@ +# file : sqlite/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 \ +native \ +truncation \ +types + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := sqlite +$(dist): export dirs := $(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/sqlite/mysql-vc10.sln b/sqlite/mysql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/sqlite/mysql-vc10.sln @@ -0,0 +1,15 @@ + +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/sqlite/mysql-vc9.sln b/sqlite/mysql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/sqlite/mysql-vc9.sln @@ -0,0 +1,15 @@ + +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/sqlite/native/driver.cxx b/sqlite/native/driver.cxx new file mode 100644 index 0000000..73e0450 --- /dev/null +++ b/sqlite/native/driver.cxx @@ -0,0 +1,66 @@ +// file : sqlite/native/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS test"); + db->execute ("CREATE TABLE test (n INTEGER PRIMARY KEY)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); + assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); + assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/native/makefile b/sqlite/native/makefile new file mode 100644 index 0000000..6a111e3 --- /dev/null +++ b/sqlite/native/makefile @@ -0,0 +1,85 @@ +# file : sqlite/native/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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/native/test.std b/sqlite/native/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am new file mode 100644 index 0000000..5591b10 --- /dev/null +++ b/sqlite/template/Makefile.am @@ -0,0 +1,31 @@ +# file : sqlite/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +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/sqlite/template/driver.cxx b/sqlite/template/driver.cxx new file mode 100644 index 0000000..d7847f7 --- /dev/null +++ b/sqlite/template/driver.cxx @@ -0,0 +1,44 @@ +// file : sqlite/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 // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/template/makefile b/sqlite/template/makefile new file mode 100644 index 0000000..bf2f178 --- /dev/null +++ b/sqlite/template/makefile @@ -0,0 +1,105 @@ +# file : sqlite/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) + +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 sqlite --generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 schema) + $(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/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj new file mode 100644 index 0000000..3f7ddf9 --- /dev/null +++ b/sqlite/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +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/sqlite/template/template-vc10.vcxproj.filters b/sqlite/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/sqlite/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj new file mode 100644 index 0000000..48516cd --- /dev/null +++ b/sqlite/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/sqlite/template/test.hxx b/sqlite/template/test.hxx new file mode 100644 index 0000000..45b1d82 --- /dev/null +++ b/sqlite/template/test.hxx @@ -0,0 +1,27 @@ +// file : sqlite/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/sqlite/template/test.std b/sqlite/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/sqlite/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/sqlite/test.bat b/sqlite/test.bat new file mode 100644 index 0000000..f653557 --- /dev/null +++ b/sqlite/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : sqlite/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 sqlite %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd %curdir% +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx new file mode 100644 index 0000000..a48bdc2 --- /dev/null +++ b/sqlite/truncation/driver.cxx @@ -0,0 +1,162 @@ +// file : sqlite/truncation/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + + try + { + // Test basic operations. + // + { + auto_ptr db (create_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + + // Test query. + // + { + typedef odb::query query; + typedef odb::result result; + + auto_ptr db (create_database (argc, argv)); + + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); + + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } + + // Test buffer growth with cached result. + // + { + object1 o; + + transaction t (db->begin ()); + + result r (db->query (query::id >= 20)); + result::iterator i (r.begin ()); + + o.id_ = i->id_; + o.str_ = long_str; + + // This forces buffer growth in the middle of result iteration. + // + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile new file mode 100644 index 0000000..8b00a1c --- /dev/null +++ b/sqlite/truncation/makefile @@ -0,0 +1,106 @@ +# file : sqlite/truncation/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 sqlite --generate-query \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 schema) + $(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/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx new file mode 100644 index 0000000..824c0e8 --- /dev/null +++ b/sqlite/truncation/test.hxx @@ -0,0 +1,48 @@ +// file : sqlite/truncation/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 +#include + +#pragma db object table ("test") +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object table ("test") +struct object2 +{ + object2 (unsigned long id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/sqlite/truncation/test.std b/sqlite/truncation/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx new file mode 100644 index 0000000..855cada --- /dev/null +++ b/sqlite/types/driver.cxx @@ -0,0 +1,64 @@ +// file : sqlite/types/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQLite type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + + o.bool_ = true; + o.integer_ = -123456; + o.real_ = 1.123; + + string long_str (2040, 'l'); + buffer long_buf (long_str.c_str (), long_str.size ()); + + o.text_ = long_str; + o.blob_ = long_buf; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/types/makefile b/sqlite/types/makefile new file mode 100644 index 0000000..7836a39 --- /dev/null +++ b/sqlite/types/makefile @@ -0,0 +1,108 @@ +# file : sqlite/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 sqlite --generate-schema \ +--generate-query --cxx-prologue '\#include "traits.hxx"' + +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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/sqlite/types/test.hxx b/sqlite/types/test.hxx new file mode 100644 index 0000000..971a89f --- /dev/null +++ b/sqlite/types/test.hxx @@ -0,0 +1,145 @@ +// file : sqlite/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 +#include +#include // std::auto_ptr +#include // std::size_t +#include // std::{memcmp,memcpy} + +#include + +struct buffer +{ + ~buffer () + { + delete[] data_; + } + + buffer () + : data_ (0), size_ (0) + { + } + + buffer (const void* data, std::size_t size) + : data_ (0), size_ (size) + { + data_ = new char[size_]; + std::memcpy (data_, data, size_); + } + + buffer (const buffer& y) + : data_ (0), size_ (0) + { + assign (y.data_, y.size_); + } + + buffer& + operator= (const buffer& y) + { + if (this != &y) + assign (y.data_, y.size_); + + return *this; + } + + void + assign (const void* data, std::size_t size) + { + if (size_ < size) + { + char* p (new char[size]); + delete[] data_; + data_ = p; + } + + std::memcpy (data_, data, size); + size_ = size; + } + + char* + data () + { + return data_; + } + + const char* + data () const + { + return data_; + } + + std::size_t + size () const + { + return size_; + } + + bool + operator== (const buffer& y) const + { + return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; + } + +private: + char* data_; + std::size_t size_; +}; + +typedef std::auto_ptr string_ptr; + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + #pragma db type ("BOOL NOT NULL") + bool bool_; + + #pragma db type ("INTEGER NOT NULL") + int integer_; + + #pragma db type ("REAL NOT NULL") + double real_; + + #pragma db type ("TEXT NOT NULL") + std::string text_; + + #pragma db type ("BLOB NOT NULL") + buffer blob_; + + // Test NULL value. + // + #pragma db type ("TEXT") + string_ptr null_; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bool_ == y.bool_ && + integer_ == y.integer_ && + real_ == y.real_ && + text_ == y.text_ && + blob_ == y.blob_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +#endif // TEST_HXX diff --git a/sqlite/types/test.std b/sqlite/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx new file mode 100644 index 0000000..0f9c253 --- /dev/null +++ b/sqlite/types/traits.hxx @@ -0,0 +1,96 @@ +// file : sqlite/types/traits.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::memcpy, std::memset + +#include + +#include "test.hxx" // buffer + +namespace odb +{ + namespace sqlite + { + template <> + class value_traits + { + public: + typedef buffer value_type; + typedef buffer query_type; + typedef details::buffer image_type; + + static void + set_value (buffer& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + v.assign (b.data (), n); + else + v.assign (0, 0); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const buffer& v) + { + is_null = false; + n = v.size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v.data (), n); + } + }; + + template <> + class value_traits + { + public: + typedef string_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (string_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const string_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX -- cgit v1.1 From 74bd3bbc7edf0c067ba9eafe51b463d2e0e121bd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Mar 2011 11:40:14 +0200 Subject: Factor out common buffer implementation --- libcommon/common/buffer.hxx | 89 +++++++++++++++++++++++++++++++++++++++++++++ mysql/types/test.hxx | 81 +---------------------------------------- mysql/types/traits.hxx | 2 +- sqlite/types/test.hxx | 79 +--------------------------------------- sqlite/types/traits.hxx | 2 +- 5 files changed, 94 insertions(+), 159 deletions(-) create mode 100644 libcommon/common/buffer.hxx diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx new file mode 100644 index 0000000..97e8962 --- /dev/null +++ b/libcommon/common/buffer.hxx @@ -0,0 +1,89 @@ +// file : libcommon/common/buffer.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_BUFFER_HXX +#define LIBCOMMON_COMMON_BUFFER_HXX + +#include // std::size_t +#include // std::{memcmp,memcpy} + +struct buffer +{ + ~buffer () + { + delete[] data_; + } + + buffer () + : data_ (0), size_ (0) + { + } + + buffer (const void* data, std::size_t size) + : data_ (0), size_ (size) + { + data_ = new char[size_]; + std::memcpy (data_, data, size_); + } + + buffer (const buffer& y) + : data_ (0), size_ (0) + { + assign (y.data_, y.size_); + } + + buffer& + operator= (const buffer& y) + { + if (this != &y) + assign (y.data_, y.size_); + + return *this; + } + + void + assign (const void* data, std::size_t size) + { + if (size_ < size) + { + char* p (new char[size]); + delete[] data_; + data_ = p; + } + + std::memcpy (data_, data, size); + size_ = size; + } + + char* + data () + { + return data_; + } + + const char* + data () const + { + return data_; + } + + std::size_t + size () const + { + return size_; + } + + bool + operator== (const buffer& y) const + { + return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; + } + +private: + char* data_; + std::size_t size_; +}; + +#endif // LIBCOMMON_COMMON_BUFFER_HXX diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 80d1423..207d8b3 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -9,11 +9,11 @@ #include #include #include // std::auto_ptr -#include // std::size_t -#include // std::{memcmp,memcpy} #include +#include + struct date_time { date_time () @@ -59,83 +59,6 @@ struct date_time unsigned int second; }; -struct buffer -{ - ~buffer () - { - delete[] data_; - } - - buffer () - : data_ (0), size_ (0) - { - } - - buffer (const void* data, std::size_t size) - : data_ (0), size_ (size) - { - data_ = new char[size_]; - std::memcpy (data_, data, size_); - } - - buffer (const buffer& y) - : data_ (0), size_ (0) - { - assign (y.data_, y.size_); - } - - buffer& - operator= (const buffer& y) - { - if (this != &y) - assign (y.data_, y.size_); - - return *this; - } - - void - assign (const void* data, std::size_t size) - { - if (size_ < size) - { - char* p (new char[size]); - delete[] data_; - data_ = p; - } - - std::memcpy (data_, data, size); - size_ = size; - } - - char* - data () - { - return data_; - } - - const char* - data () const - { - return data_; - } - - std::size_t - size () const - { - return size_; - } - - bool - operator== (const buffer& y) const - { - return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; - } - -private: - char* data_; - std::size_t size_; -}; - struct bitfield { unsigned int a: 1; diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index df105e7..b05b2c4 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -10,7 +10,7 @@ #include -#include "test.hxx" // date_time, buffer +#include "test.hxx" // date_time, buffer, string_ptr namespace odb { diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 971a89f..37190a0 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -9,87 +9,10 @@ #include #include #include // std::auto_ptr -#include // std::size_t -#include // std::{memcmp,memcpy} #include -struct buffer -{ - ~buffer () - { - delete[] data_; - } - - buffer () - : data_ (0), size_ (0) - { - } - - buffer (const void* data, std::size_t size) - : data_ (0), size_ (size) - { - data_ = new char[size_]; - std::memcpy (data_, data, size_); - } - - buffer (const buffer& y) - : data_ (0), size_ (0) - { - assign (y.data_, y.size_); - } - - buffer& - operator= (const buffer& y) - { - if (this != &y) - assign (y.data_, y.size_); - - return *this; - } - - void - assign (const void* data, std::size_t size) - { - if (size_ < size) - { - char* p (new char[size]); - delete[] data_; - data_ = p; - } - - std::memcpy (data_, data, size); - size_ = size; - } - - char* - data () - { - return data_; - } - - const char* - data () const - { - return data_; - } - - std::size_t - size () const - { - return size_; - } - - bool - operator== (const buffer& y) const - { - return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; - } - -private: - char* data_; - std::size_t size_; -}; +#include typedef std::auto_ptr string_ptr; diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 0f9c253..13eef34 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -10,7 +10,7 @@ #include -#include "test.hxx" // buffer +#include "test.hxx" // buffer, string_ptr namespace odb { -- cgit v1.1 From 27a6fdf4b5295281853254cfdde8730128038dd2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 Mar 2011 16:33:41 +0200 Subject: Handle deadlocks and SQLite-specific issues --- common/threads/driver.cxx | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 9aab254..192a3b7 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -18,8 +18,13 @@ #include #include +#include // DATABASE_SQLITE #include +#ifdef DATABASE_SQLITE +# include +#endif + #include "test.hxx" #include "test-odb.hxx" @@ -28,7 +33,8 @@ using namespace odb::core; namespace details = odb::details; const unsigned long thread_count = 32; -const unsigned long iteration_count = 100; +const unsigned long iteration_count = 50; +const unsigned long sub_iteration_count = 20; struct task { @@ -47,7 +53,7 @@ struct task unsigned long id ((n_ * iteration_count + i) * 3); { - object o1 (id, "frist object"); + object o1 (id, "first object"); object o2 (id + 1, "second object"); object o3 (id + 2, "third object"); @@ -58,15 +64,37 @@ struct task t.commit (); } + // The following transaction may lead to a deadlock in some database + // implementations (read to write lock upgrade). + // + while (true) { - transaction t (db_.begin ()); - auto_ptr o (db_.load (id)); - assert (o->str_ == "frist object"); - o->str_ = "another value"; - db_.update (*o); - t.commit (); + try + { +#ifndef DATABASE_SQLITE + transaction t (db_.begin ()); +#else + // SQLite has a peculiar table locking mode (shared cache) + // which can lead to any of the transactions in this test + // deadlocking even though they shouldn't from the user's + // perspective. One way to work around this problem is to + // start a "write" transaction as such right away. + // + transaction t ( + static_cast (db_).begin_immediate ()); +#endif + + auto_ptr o (db_.load (id)); + assert (o->str_ == "first object"); + o->str_ = "another value"; + db_.update (*o); + t.commit (); + break; + } + catch (deadlock const&) {} } + for (unsigned long j (0); j < sub_iteration_count; ++j) { typedef odb::query query; typedef odb::result result; -- cgit v1.1 From 18e0b8065af3b660a73af93dabb4767cbc64ec35 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Mar 2011 13:10:42 +0200 Subject: Autotools support for SQLite --- Makefile.am | 4 ++ boost/Makefile.am | 5 +++ boost/common/template/Makefile.am | 1 + boost/mysql/template/Makefile.am | 1 + common/query/makefile | 2 +- common/template/Makefile.am | 1 + configure.ac | 4 ++ libcommon/common/Makefile.am | 3 +- libcommon/common/config.h.in | 1 + m4/database.m4 | 7 +++- m4/libodb-sqlite.m4 | 84 +++++++++++++++++++++++++++++++++++++++ m4/mysql.m4 | 2 +- m4/sqlite.m4 | 61 ++++++++++++++++++++++++++++ makefile | 2 +- mysql/template/Makefile.am | 1 + sqlite/mysql-vc10.sln | 15 ------- sqlite/mysql-vc9.sln | 15 ------- sqlite/sqlite-vc10.sln | 15 +++++++ sqlite/sqlite-vc9.sln | 15 +++++++ sqlite/template/Makefile.am | 1 + tracer/template/Makefile.am | 1 + 21 files changed, 206 insertions(+), 35 deletions(-) create mode 100644 m4/libodb-sqlite.m4 create mode 100644 m4/sqlite.m4 delete mode 100644 sqlite/mysql-vc10.sln delete mode 100644 sqlite/mysql-vc9.sln create mode 100644 sqlite/sqlite-vc10.sln create mode 100644 sqlite/sqlite-vc9.sln diff --git a/Makefile.am b/Makefile.am index b0070f3..0a15f76 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,5 +13,9 @@ if DATABASE_MYSQL SUBDIRS += mysql endif +if DATABASE_SQLITE +SUBDIRS += sqlite +endif + EXTRA_DIST = __file__(extra_dist) ACLOCAL_AMFLAGS = -I m4 diff --git a/boost/Makefile.am b/boost/Makefile.am index 85915d2..9b08372 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -9,4 +9,9 @@ if DATABASE_MYSQL SUBDIRS += mysql endif +if DATABASE_SQLITE +# @@ enable +#SUBDIRS += sqlite +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 4ab6efe..6cd68eb 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 29017fa..6bab1d5 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/common/query/makefile b/common/query/makefile index 5e98970..c41b1d5 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -53,7 +53,7 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx +$(dist): export extra_headers := traits.hxx $(databases:%=traits-%.hxx) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 758d015..eb1ae97 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/configure.ac b/configure.ac index 81d4a1a..cea2bd2 100644 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,10 @@ case $database in LIBODB_MYSQL([], [AC_MSG_ERROR([libodb-mysql is not found; consider using --with-libodb-mysql=DIR])]) MYSQL ;; + sqlite) + LIBODB_SQLITE([], [AC_MSG_ERROR([libodb-sqlite is not found; consider using --with-libodb-sqlite=DIR])]) + SQLITE + ;; esac # Check for the ODB compiler. diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index f4886fe..405a2ed 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -8,5 +8,6 @@ libcommon_la_SOURCES = __path__(sources) __path__(headers) EXTRA_DIST = __file__(extra_dist) -AM_CPPFLAGS= -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -DLIBCOMMON_DYNAMIC_LIB +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -DLIBCOMMON_DYNAMIC_LIB AM_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index ad30893..8a504a0 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -10,6 +10,7 @@ #define LIBCOMMON_COMMON_CONFIG_H #undef DATABASE_MYSQL +#undef DATABASE_SQLITE #undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB diff --git a/m4/database.m4 b/m4/database.m4 index 6f75e27..9478016 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -13,7 +13,7 @@ AC_MSG_CHECKING([for database to use]) AC_ARG_WITH( [database], [AC_HELP_STRING([--with-database=db], - [database to use for tests; valid values are: 'mysql'])], + [database to use for tests; valid values are: 'mysql', 'sqlite'])], [case $withval in no | yes) AC_MSG_RESULT([]) @@ -23,6 +23,10 @@ AC_ARG_WITH( database=mysql AC_DEFINE([DATABASE_MYSQL], [1], [Using MySQL.]) ;; + sqlite) + database=sqlite + AC_DEFINE([DATABASE_SQLITE], [1], [Using SQLite.]) + ;; *) AC_MSG_RESULT([]) AC_MSG_ERROR([unknown database $withval]) @@ -37,5 +41,6 @@ AC_MSG_RESULT([$database]) AC_SUBST([database]) AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) +AM_CONDITIONAL([DATABASE_SQLITE], [test x$database = xsqlite]) ])dnl diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 new file mode 100644 index 0000000..b85614f --- /dev/null +++ b/m4/libodb-sqlite.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-sqlite.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_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_SQLITE], [ +libodb_sqlite_found=no + +AC_ARG_WITH( + [libodb-sqlite], + [AC_HELP_STRING([--with-libodb-sqlite=DIR],[location of libodb-sqlite build directory])], + [libodb_sqlite_dir=${withval}], + [libodb_sqlite_dir=]) + +AC_MSG_CHECKING([for libodb-sqlite]) + +# If libodb_sqlite_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_sqlite_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_sqlite_dir], [$ac_pwd], [$libodb_sqlite_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_sqlite_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_sqlite_dir/odb/sqlite" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-sqlite $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::sqlite::database_exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_sqlite_found=yes]) + +if test x"$libodb_sqlite_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_sqlite_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_sqlite_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 5f35c91..102f150 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -202,7 +202,7 @@ fi # Create options file. # -AC_CONFIG_COMMANDS([db.options], +AC_CONFIG_COMMANDS([mysql.options], [ rm -f db.options echo '#! /bin/sh' >db-driver diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 new file mode 100644 index 0000000..de5503e --- /dev/null +++ b/m4/sqlite.m4 @@ -0,0 +1,61 @@ +dnl file : m4/sqlite.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 SQLITE +dnl +AC_DEFUN([SQLITE], [ + +# Database file. +# +AC_MSG_CHECKING([for sqlite database file]) +AC_ARG_WITH( + [sqlite-db], + [AC_HELP_STRING([--with-sqlite-db=file], [SQLite database file (odb_test.db by default). Note that all data in this database WILL BE LOST!])], + [case $withval in + yes) + sqlite_db=odb_test.db + sqlite_db_set=yes + ;; + no) + sqlite_db_set=no + ;; + *) + sqlite_db=$withval + sqlite_db_set=yes + ;; + esac], + [sqlite_db=odb_test.db + sqlite_db_set=yes]) + +if test x$sqlite_db_set = xyes; then + + # Make it an absolute path unless it is one of the special values. + # + if test x$sqlite_db != x -a x$sqlite_db != x:memory:; then + AS_SET_CATFILE([abs_sqlite_db], [$ac_pwd], [$sqlite_db]) + sqlite_db=$abs_sqlite_db + fi + + AC_MSG_RESULT(['$sqlite_db']) +else + AC_MSG_RESULT([none]) +fi + +# Create options file. +# +AC_CONFIG_COMMANDS([sqlite.options], + [ + rm -f db.options + + if test x$sqlite_db_set = xyes; then + echo "--database '$sqlite_db'" >>db.options + fi + ], + [ + sqlite_db="$sqlite_db" + sqlite_db_set="$sqlite_db_set" + ]) + +])dnl diff --git a/makefile b/makefile index 0eaf04d..ad2f5b9 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql boost +all_dirs := libcommon common tracer mysql sqlite boost dirs := common tracer boost ifeq ($(db_id),mysql) diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 7571e28..af5895f 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/sqlite/mysql-vc10.sln b/sqlite/mysql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/sqlite/mysql-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/sqlite/mysql-vc9.sln b/sqlite/mysql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/sqlite/mysql-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/sqlite/sqlite-vc10.sln b/sqlite/sqlite-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/sqlite/sqlite-vc10.sln @@ -0,0 +1,15 @@ + +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/sqlite/sqlite-vc9.sln b/sqlite/sqlite-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/sqlite/sqlite-vc9.sln @@ -0,0 +1,15 @@ + +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/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 5591b10..ba169b3 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index c6cbb16..4305788 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -8,6 +8,7 @@ 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; -- cgit v1.1 From 5e30fe55e504c2fa9ddbb239150c237cb0230fcd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Mar 2011 16:11:41 +0200 Subject: VC++ build system support for SQLite --- boost/common/template/template-vc10.vcxproj | 8 ++++---- boost/common/template/template-vc9.vcproj | 8 ++++---- common/template/template-vc10.vcxproj | 8 ++++---- common/template/template-vc9.vcproj | 8 ++++---- sqlite-driver.bat | 2 ++ sqlite.options | 5 +++++ 6 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 sqlite-driver.bat create mode 100644 sqlite.options diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj index e3c66a6..2e4028b 100644 --- a/boost/common/template/template-vc10.vcxproj +++ b/boost/common/template/template-vc10.vcxproj @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj index b22262b..79d9084 100644 --- a/boost/common/template/template-vc9.vcproj +++ b/boost/common/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index b068c05..f9f82d0 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index cd79624..caa4567 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/sqlite-driver.bat b/sqlite-driver.bat new file mode 100644 index 0000000..c5f1187 --- /dev/null +++ b/sqlite-driver.bat @@ -0,0 +1,2 @@ +rem Client driver is not used for SQLite so you don't need to +rem change anything here. diff --git a/sqlite.options b/sqlite.options new file mode 100644 index 0000000..208a7d7 --- /dev/null +++ b/sqlite.options @@ -0,0 +1,5 @@ +# Sample SQLite options file used to run the tests. Adjust to +# match your SQLite setup. +# + +--database C:\Temp\odb_test.db -- cgit v1.1 From 8a3b63e055b0ef0f6f1366ae0388fee26d10ea2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 31 Mar 2011 15:37:53 +0200 Subject: Add SQLite as supported database --- INSTALL | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 5e87eb0..4efd0ca 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,8 @@ In this document we use to refer to the name of the database system you would like to use. Valid values for are: - 'mysql' - The MySQL database system + 'mysql' - The MySQL database system + 'sqlite' - The SQLite database system Prerequisites ============= -- cgit v1.1 From d2c7dda761658e45d150172991b5231d0e979007 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 31 Mar 2011 16:12:50 +0200 Subject: Bump version to 1.3.0.b1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 26aaba0..c92d778 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.2.0 +1.3.0.b1 -- cgit v1.1 From 14ca0adb63a48e5bc14a4a2b84e0d108be6dfdd1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 1 Apr 2011 18:08:51 +0200 Subject: Add SQLite-specific tests for Boost profile --- boost/Makefile.am | 3 +- boost/makefile | 4 +- boost/sqlite/Makefile.am | 7 + boost/sqlite/boost-sqlite-vc10.sln | 15 + boost/sqlite/boost-sqlite-vc9.sln | 15 + boost/sqlite/date-time/driver.cxx | 210 ++++++++++++ boost/sqlite/date-time/makefile | 120 +++++++ boost/sqlite/date-time/test.hxx | 59 ++++ boost/sqlite/date-time/test.std | 0 boost/sqlite/makefile | 36 ++ boost/sqlite/template/Makefile.am | 32 ++ boost/sqlite/template/driver.cxx | 44 +++ boost/sqlite/template/makefile | 120 +++++++ boost/sqlite/template/template-vc10.vcxproj | 180 ++++++++++ .../sqlite/template/template-vc10.vcxproj.filters | 25 ++ boost/sqlite/template/template-vc9.vcproj | 361 +++++++++++++++++++++ boost/sqlite/template/test.hxx | 27 ++ boost/sqlite/template/test.std | 1 + boost/sqlite/test.bat | 70 ++++ 19 files changed, 1326 insertions(+), 3 deletions(-) create mode 100644 boost/sqlite/Makefile.am create mode 100644 boost/sqlite/boost-sqlite-vc10.sln create mode 100644 boost/sqlite/boost-sqlite-vc9.sln create mode 100644 boost/sqlite/date-time/driver.cxx create mode 100644 boost/sqlite/date-time/makefile create mode 100644 boost/sqlite/date-time/test.hxx create mode 100644 boost/sqlite/date-time/test.std create mode 100644 boost/sqlite/makefile create mode 100644 boost/sqlite/template/Makefile.am create mode 100644 boost/sqlite/template/driver.cxx create mode 100644 boost/sqlite/template/makefile create mode 100644 boost/sqlite/template/template-vc10.vcxproj create mode 100644 boost/sqlite/template/template-vc10.vcxproj.filters create mode 100644 boost/sqlite/template/template-vc9.vcproj create mode 100644 boost/sqlite/template/test.hxx create mode 100644 boost/sqlite/template/test.std create mode 100644 boost/sqlite/test.bat diff --git a/boost/Makefile.am b/boost/Makefile.am index 9b08372..00d8fa9 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -10,8 +10,7 @@ SUBDIRS += mysql endif if DATABASE_SQLITE -# @@ enable -#SUBDIRS += sqlite +SUBDIRS += sqlite endif EXTRA_DIST = __file__(extra_dist) diff --git a/boost/makefile b/boost/makefile index a73ace3..71b7ecf 100644 --- a/boost/makefile +++ b/boost/makefile @@ -5,11 +5,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql +all_dirs := common mysql sqlite dirs := common ifeq ($(db_id),mysql) dirs += mysql +else ifeq ($(db_id),sqlite) +dirs += sqlite endif default := $(out_base)/ diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am new file mode 100644 index 0000000..d32821a --- /dev/null +++ b/boost/sqlite/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/sqlite/Makefile.am +# author : Constantin Michael +# 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) diff --git a/boost/sqlite/boost-sqlite-vc10.sln b/boost/sqlite/boost-sqlite-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/sqlite/boost-sqlite-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/sqlite/boost-sqlite-vc9.sln b/boost/sqlite/boost-sqlite-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/sqlite/boost-sqlite-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx new file mode 100644 index 0000000..e4c619f --- /dev/null +++ b/boost/sqlite/date-time/driver.cxx @@ -0,0 +1,210 @@ +// file : boost/sqlite/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (max_date_time); + + o.durations.push_back (time_duration (123, 4, 5)); + o.durations.push_back (not_a_date_time); + + o.u_dates.push_back (day_clock::local_day ()); + o.u_dates.push_back (date (not_a_date_time)); + + // Boost seems to handle 64 bit std::time_t incorrectly. + // Insert 32 bit minimum and maximum UNIX time values for now. + // + // o.u_dates.push_back (date (max_date_time)); + // o.u_dates.push_back (date (min_date_time)); + // + o.u_dates.push_back (date (2038, 1, 19)); + o.u_dates.push_back (date (1901, 12, 14)); + + o.u_times.push_back (second_clock::local_time ()); + o.u_times.push_back (not_a_date_time); + o.u_times.push_back (ptime (date (1930, 1, 1), time_duration (0, 0, 0))); + + o.s_durations.push_back (time_duration (123, 4, 5)); + o.s_durations.push_back (time_duration (-12, 3, 4)); + o.s_durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime mappings. + // + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid time_duration mappings. + // + object or1, sv1, sv2; + or1.durations.push_back (time_duration (0, 0, -1)); + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid UNIX date mappings. + // + object sv1, sv2; + sv1.u_dates.push_back (date (neg_infin)); + sv2.u_dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid UNIX times mappings. + // + { + object sv1, sv2; + sv1.u_times.push_back (pos_infin); + sv2.u_times.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid "seconds" duration mappings. + // + { + object sv1, sv2; + sv1.s_durations.push_back (pos_infin); + sv2.s_durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile new file mode 100644 index 0000000..84f4924 --- /dev/null +++ b/boost/sqlite/date-time/makefile @@ -0,0 +1,120 @@ +# file : boost/sqlite/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 sqlite --profile boost/date-time \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/sqlite/,,$(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 schema) + $(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/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx new file mode 100644 index 0000000..020bc7d --- /dev/null +++ b/boost/sqlite/date-time/test.hxx @@ -0,0 +1,59 @@ +// file : boost/sqlite/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + durations == x.durations && + u_dates == x.u_dates && + u_times == x.u_times && + s_durations == x.s_durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + std::vector durations; + + // Dates as UNIX time. + // + #pragma db value_type("INTEGER") + std::vector u_dates; + + // Times as UNIX time. + // + #pragma db value_type("INTEGER") + std::vector u_times; + + // Durations as seconds. + // + #pragma db value_type("INTEGER") + std::vector s_durations; +}; + +#endif // TEST_HXX diff --git a/boost/sqlite/date-time/test.std b/boost/sqlite/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile new file mode 100644 index 0000000..e23ec20 --- /dev/null +++ b/boost/sqlite/makefile @@ -0,0 +1,36 @@ +# file : boost/sqlite/makefile +# author : Constantin Michael +# 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 := \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := boost-sqlite +$(dist): export dirs := $(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/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am new file mode 100644 index 0000000..0203290 --- /dev/null +++ b/boost/sqlite/template/Makefile.am @@ -0,0 +1,32 @@ +# file : boost/sqlite/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx new file mode 100644 index 0000000..0878f2e --- /dev/null +++ b/boost/sqlite/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/sqlite/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile new file mode 100644 index 0000000..13f7699 --- /dev/null +++ b/boost/sqlite/template/makefile @@ -0,0 +1,120 @@ +# file : boost/sqlite/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 sqlite --profile boost \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/sqlite/,,$(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 schema) + $(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/boost/sqlite/template/template-vc10.vcxproj b/boost/sqlite/template/template-vc10.vcxproj new file mode 100644 index 0000000..a9d55eb --- /dev/null +++ b/boost/sqlite/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.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/boost/sqlite/template/template-vc10.vcxproj.filters b/boost/sqlite/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/boost/sqlite/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/boost/sqlite/template/template-vc9.vcproj b/boost/sqlite/template/template-vc9.vcproj new file mode 100644 index 0000000..82cd1eb --- /dev/null +++ b/boost/sqlite/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx new file mode 100644 index 0000000..b6cd18e --- /dev/null +++ b/boost/sqlite/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/sqlite/template/test.hxx +// author : Constantin Michael +// 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/boost/sqlite/template/test.std b/boost/sqlite/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/sqlite/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat new file mode 100644 index 0000000..dd6fe87 --- /dev/null +++ b/boost/sqlite/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : boost/sqlite/test.bat +rem author : Constantin Michael +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 sqlite %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd %curdir% +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal -- cgit v1.1 From 585260e6131d103fe75111402b1018a2a23e0a8e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Apr 2011 09:18:20 +0200 Subject: Bump version to 1.3.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c92d778..f0bb29e 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.3.0.b1 +1.3.0 -- cgit v1.1 From 2f0038a2aed44ce04200c09229921ae21861ccaa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Apr 2011 18:31:40 +0200 Subject: Get rid of image type argument in value_traits --- common/query/traits-mysql.hxx | 2 +- common/query/traits-sqlite.hxx | 2 +- mysql/types/traits.hxx | 10 +++++----- sqlite/types/traits.hxx | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/query/traits-mysql.hxx b/common/query/traits-mysql.hxx index cce99db..fb95bfd 100644 --- a/common/query/traits-mysql.hxx +++ b/common/query/traits-mysql.hxx @@ -17,7 +17,7 @@ namespace odb namespace mysql { template <> - class value_traits, details::buffer, id_string> + class value_traits, id_string> { public: typedef std::auto_ptr value_type; diff --git a/common/query/traits-sqlite.hxx b/common/query/traits-sqlite.hxx index 57cf9c2..4e58b34 100644 --- a/common/query/traits-sqlite.hxx +++ b/common/query/traits-sqlite.hxx @@ -17,7 +17,7 @@ namespace odb namespace sqlite { template <> - class value_traits, details::buffer, id_text> + class value_traits, id_text> { public: typedef std::auto_ptr value_type; diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index b05b2c4..2698afc 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -17,7 +17,7 @@ namespace odb namespace mysql { template - class value_traits + class value_traits { public: typedef date_time value_type; @@ -57,7 +57,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef buffer value_type; @@ -94,7 +94,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef bitfield value_type; @@ -132,7 +132,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef set value_type; @@ -194,7 +194,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef string_ptr value_type; diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 13eef34..70b7b26 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -17,7 +17,7 @@ namespace odb namespace sqlite { template <> - class value_traits + class value_traits { public: typedef buffer value_type; @@ -54,7 +54,7 @@ namespace odb }; template <> - class value_traits + class value_traits { public: typedef string_ptr value_type; -- cgit v1.1 From e305857bd0bd406ab91d31aaea0c1491d6e36b50 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Apr 2011 18:50:04 +0200 Subject: Implement automatic mapping for C++ enums --- common/enum/driver.cxx | 69 +++++++++++++++++++++++++++++++ common/enum/makefile | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ common/enum/test.hxx | 33 +++++++++++++++ common/enum/test.std | 0 common/makefile | 1 + mysql/types/driver.cxx | 3 +- mysql/types/test.hxx | 13 ++++-- 7 files changed, 224 insertions(+), 4 deletions(-) create mode 100644 common/enum/driver.cxx create mode 100644 common/enum/makefile create mode 100644 common/enum/test.hxx create mode 100644 common/enum/test.std diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx new file mode 100644 index 0000000..833eebb --- /dev/null +++ b/common/enum/driver.cxx @@ -0,0 +1,69 @@ +// file : common/enum/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test automatic C++ enum mapping. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + typedef odb::result result; + + auto_ptr db (create_database (argc, argv)); + + object o; + o.color_ = green; + o.taste_ = object::sweet; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (o.id_)); + t.commit (); + + assert (o == *o1); + } + + { + transaction t (db->begin ()); + + result r1 (db->query (query::color == blue)); + result r2 (db->query (query::taste == object::sweet)); + + assert (r1.empty ()); + assert (!r2.empty ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/enum/makefile b/common/enum/makefile new file mode 100644 index 0000000..a6b16e2 --- /dev/null +++ b/common/enum/makefile @@ -0,0 +1,109 @@ +# file : common/enum/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) --generate-schema \ +--generate-query +$(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 schema) + $(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/enum/test.hxx b/common/enum/test.hxx new file mode 100644 index 0000000..bb264d5 --- /dev/null +++ b/common/enum/test.hxx @@ -0,0 +1,33 @@ +// file : common/enum/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 + +enum color {red, green, blue}; + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + color color_; + enum taste {bitter, sweet, sour}; + taste taste_; +}; + +inline bool +operator == (const object& x, const object& y) +{ + return + x.id_ == y.id_ && + x.color_ == y.color_ && + x.taste_ == y.taste_; +} + +#endif // TEST_HXX diff --git a/common/enum/test.std b/common/enum/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index c3f02bf..317c49e 100644 --- a/common/makefile +++ b/common/makefile @@ -11,6 +11,7 @@ composite \ const \ container \ ctor \ +enum \ inverse \ lazy-ptr \ lifecycle \ diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index b675655..8a51dea 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -77,7 +77,8 @@ main (int argc, char* argv[]) o.bit_.c = 0; o.bit_.d = 1; - o.enum_ = "green"; + o.enum_ = green; + o.enum_str_ = "green"; o.set_.insert ("green"); o.set_.insert ("red"); o.set_.insert ("blue"); diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 207d8b3..3039a88 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -82,6 +82,8 @@ operator== (bitfield x, bitfield y) typedef std::set set; typedef std::auto_ptr string_ptr; +enum color {red, green, blue}; + #pragma db object struct object { @@ -203,10 +205,14 @@ struct object // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value bitfield bit_; - #pragma db type ("ENUM('red', 'green', 'blue') NOT NULL") - std::string enum_; + // Test ENUM representations (integer and string). + // + color enum_; + + #pragma db type ("ENUM ('red', 'green', 'blue') NOT NULL") + std::string enum_str_; - #pragma db type ("SET('red', 'green', 'blue') NOT NULL") + #pragma db type ("SET ('red', 'green', 'blue') NOT NULL") set set_; // Test NULL value. @@ -252,6 +258,7 @@ struct object longblob_ == y.longblob_ && bit_ == y.bit_ && enum_ == y.enum_ && + enum_str_ == y.enum_str_ && set_ == y.set_ && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); } -- cgit v1.1 From 6aca63b74d4fff54b89112bda3ec3ba258a073c1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Apr 2011 13:48:04 +0200 Subject: Test empty composite value type --- common/composite/test.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/composite/test.hxx b/common/composite/test.hxx index bd50cdc..120476a 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -24,6 +24,12 @@ struct name_title }; #pragma db value +struct name_title_ex: name_title +{ + // Test value types without data members. +}; + +#pragma db value struct name_flags { bool nick; @@ -31,7 +37,7 @@ struct name_flags }; #pragma db value -struct name_ex: name, name_title +struct name_ex: name, name_title_ex { name alias; std::string nick; -- cgit v1.1 From d0f0e168cac3d117f64fddcca638a18fc4309ba1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Apr 2011 14:07:33 +0200 Subject: Initial support for non-polymorphic inheritance Every class gets a separate table. New test: common/inheritance. --- common/inheritance/driver.cxx | 136 ++++++++++++++++++++++++++++++++++++++++++ common/inheritance/makefile | 109 +++++++++++++++++++++++++++++++++ common/inheritance/test.hxx | 88 +++++++++++++++++++++++++++ common/inheritance/test.std | 0 common/makefile | 1 + 5 files changed, 334 insertions(+) create mode 100644 common/inheritance/driver.cxx create mode 100644 common/inheritance/makefile create mode 100644 common/inheritance/test.hxx create mode 100644 common/inheritance/test.std diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx new file mode 100644 index 0000000..203e912 --- /dev/null +++ b/common/inheritance/driver.cxx @@ -0,0 +1,136 @@ +// file : common/inheritance/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object inheritance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + base b; + b.comp_.num = 10; + b.comp_.str = "comp bbb"; + b.comp_.nums.push_back (101); + b.comp_.nums.push_back (102); + b.num_ = 0; + b.str_ = "bbb"; + b.strs_.push_back ("bbb one"); + b.strs_.push_back ("bbb two"); + + object1 o1; + o1.comp_.num = 11; + o1.comp_.str = "comp o1o1o1"; + o1.comp_.nums.push_back (111); + o1.comp_.nums.push_back (112); + static_cast (o1).num_ = 1; + o1.num1_ = 21; + o1.str_ = "base o1o1o1"; + o1.strs_.push_back ("base o1o1o1 one"); + o1.strs_.push_back ("base o1o1o1 two"); + + object2 o2; + o2.comp_.num = 12; + o2.comp_.str = "comp o2o2o2"; + o2.comp_.nums.push_back (121); + o2.comp_.nums.push_back (122); + o2.num_ = 2; + static_cast (o2).str_ = "base o2o2o2"; + o2.str_ = "o2o2o2"; + o2.strs_.push_back ("base o2o2o2 one"); + o2.strs_.push_back ("base o2o2o2 two"); + + reference r; + r.o1_ = &o1; + + // persist + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (o1); + db->persist (o2); + db->persist (r); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr lb (db->load (b.id_)); + auto_ptr lo1 (db->load (o1.id_)); + auto_ptr lo2 (db->load (o2.id_)); + auto_ptr lr (db->load (r.id_)); + t.commit (); + + assert (b == *lb); + assert (o1 == *lo1); + assert (o2 == *lo2); + assert (lr->o1_->id_ == r.o1_->id_); + + delete lr->o1_; + } + + // query + // + { + typedef odb::query b_query; + typedef odb::result b_result; + + typedef odb::query o1_query; + typedef odb::result o1_result; + + typedef odb::query o2_query; + typedef odb::result o2_result; + + typedef odb::query r_query; + typedef odb::result r_result; + + transaction t (db->begin ()); + + assert (!db->query (b_query::comp::num == 10).empty ()); + assert (!db->query (o1_query::num1 == 21).empty ()); + assert (!db->query (o2_query::num == 2).empty ()); + + // Query condition with hidden members. + // + assert (!db->query (b_query::str == "base o2o2o2").empty ()); + + // Query condition with referenced composite member in base class. + // + { + r_result r (db->query (r_query::o1::comp::num == 11)); + assert (!r.empty ()); + delete r.begin ()->o1_; + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/inheritance/makefile b/common/inheritance/makefile new file mode 100644 index 0000000..b9715e3 --- /dev/null +++ b/common/inheritance/makefile @@ -0,0 +1,109 @@ +# file : common/inheritance/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) --generate-schema \ +--generate-query +$(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 schema) + $(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/inheritance/test.hxx b/common/inheritance/test.hxx new file mode 100644 index 0000000..e27ff7a --- /dev/null +++ b/common/inheritance/test.hxx @@ -0,0 +1,88 @@ +// file : common/inheritance/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 +#include + +#include + +#pragma db value +struct comp +{ + unsigned int num; + std::string str; + + std::vector nums; + + bool + operator== (const comp& y) const + { + return num == y.num && str == y.str && nums == y.nums; + } +}; + +#pragma db object +struct base +{ + #pragma db id auto + unsigned long id_; + + comp comp_; + + unsigned int num_; + std::string str_; + + std::vector strs_; + + bool + operator== (const base& y) const + { + return + id_ == y.id_ && + comp_ == y.comp_ && + num_ == y.num_ && + str_ == y.str_ && + strs_ == y.strs_; + } +}; + +#pragma db object +struct object1: base +{ + unsigned int num1_; + + bool + operator== (const object1& y) const + { + return static_cast (*this) == y && num1_ == y.num1_; + } +}; + +#pragma db object +struct object2: base +{ + #pragma db column ("derived_str") + std::string str_; + + bool + operator== (const object2& y) const + { + return static_cast (*this) == y && str_ == y.str_; + } +}; + +#pragma db object +struct reference +{ + #pragma db id auto + unsigned long id_; + + object1* o1_; +}; + +#endif // TEST_HXX diff --git a/common/inheritance/test.std b/common/inheritance/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 317c49e..394f261 100644 --- a/common/makefile +++ b/common/makefile @@ -12,6 +12,7 @@ const \ container \ ctor \ enum \ +inheritance \ inverse \ lazy-ptr \ lifecycle \ -- cgit v1.1 From 4b5fde5c42ed096f500a4005fbfba6b198739955 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 23 Mar 2011 15:29:00 +0200 Subject: Add Qt test boilerplate code --- build/import/libodb-qt/LICENSE | 12 + build/import/libodb-qt/configuration-rules.make | 15 ++ build/import/libodb-qt/configure | 55 ++++ build/import/libodb-qt/stub.make | 30 +++ build/import/libqt/LICENSE | 340 ++++++++++++++++++++++++ build/import/libqt/configuration-rules.make | 15 ++ build/import/libqt/configure | 73 +++++ build/import/libqt/core/rules.make | 28 ++ build/import/libqt/core/stub.make | 36 +++ build/import/libqt/version | 1 + makefile | 4 +- qt/makefile | 34 +++ qt/mysql/driver.cxx | 57 ++++ qt/mysql/makefile | 114 ++++++++ qt/mysql/test.hxx | 26 ++ qt/mysql/test.std | 0 16 files changed, 838 insertions(+), 2 deletions(-) create mode 100644 build/import/libodb-qt/LICENSE create mode 100644 build/import/libodb-qt/configuration-rules.make create mode 100755 build/import/libodb-qt/configure create mode 100644 build/import/libodb-qt/stub.make create mode 100644 build/import/libqt/LICENSE create mode 100644 build/import/libqt/configuration-rules.make create mode 100755 build/import/libqt/configure create mode 100644 build/import/libqt/core/rules.make create mode 100644 build/import/libqt/core/stub.make create mode 100644 build/import/libqt/version create mode 100644 qt/makefile create mode 100644 qt/mysql/driver.cxx create mode 100644 qt/mysql/makefile create mode 100644 qt/mysql/test.hxx create mode 100644 qt/mysql/test.std diff --git a/build/import/libodb-qt/LICENSE b/build/import/libodb-qt/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-qt/LICENSE @@ -0,0 +1,12 @@ +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-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make new file mode 100644 index 0000000..1116405 --- /dev/null +++ b/build/import/libodb-qt/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-qt/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-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. + $(call message,,$(scf_root)/import/libodb-qt/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-qt/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-qt/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure new file mode 100755 index 0000000..16d09fc --- /dev/null +++ b/build/import/libodb-qt/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-qt/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-qt' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-qt' 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-qt'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-qt'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_qt_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-qt/stub.make b/build/import/libodb-qt/stub.make new file mode 100644 index 0000000..fe6060d --- /dev/null +++ b/build/import/libodb-qt/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-qt/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-qt/configuration-rules.make,$(dcf_root)) + +libodb_qt_installed := + +$(call -include,$(dcf_root)/import/libodb-qt/configuration-dynamic.make) + +ifdef libodb_qt_installed + +ifeq ($(libodb_qt_installed),y) + +$(call export,l: -lodb-qt -lodb,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-qt/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libqt/LICENSE b/build/import/libqt/LICENSE new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/build/import/libqt/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 more 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make new file mode 100644 index 0000000..03a4774 --- /dev/null +++ b/build/import/libqt/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libqt/configuration-rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. + $(call message,,$(scf_root)/import/libqt/configure $@) + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libqt/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libqt/configuration-dynamic.make) + +endif diff --git a/build/import/libqt/configure b/build/import/libqt/configure new file mode 100755 index 0000000..1b67928 --- /dev/null +++ b/build/import/libqt/configure @@ -0,0 +1,73 @@ +#! /usr/bin/env bash + +# file : build/import/libqt/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + + +# $1 - out config file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + + +$echo +$echo "Configuring external dependency on 'Qt libraries' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'Qt libraries' as opposed to the development build?" +$echo + +installed=`read_y_n y` + +if [ "$installed" = "n" ]; then + + $echo + $echo "Please enter the 'Qt' root directory." + $echo + + root=`read_path --directory --exist` + + $echo + $echo "Please select the library type you would like to use:" + $echo + $echo "(1) archive" + $echo "(2) shared object" + $echo + + type=`read_option "archive shared" "shared"` + +else + if pkg-config --exists QtCore; then + + core_cppflags=`pkg-config --cflags QtCore` + core_libs=`pkg-config --libs QtCore` + + else + $echo + $echo "Unable to discover installed 'Qt libraries' using pkg-config." + $echo "Assuming the C++ compiler will find them automatically." + $echo + + core_cppflags= + core_libs=-lQtCore + + fi +fi + + +echo libqt_installed := $installed >$1 + +if [ "$installed" = "n" ]; then + echo libqt_root := $root >>$1 + echo libqt_type := $type >>$1 +else + echo libqt_core_cppflags := $core_cppflags >>$1 + echo libqt_core_libs := $core_libs >>$1 +fi diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make new file mode 100644 index 0000000..b0d5e2e --- /dev/null +++ b/build/import/libqt/core/rules.make @@ -0,0 +1,28 @@ +# file : build/import/libqt/core/rules.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libqt/%: root := $(libqt_root) +$(dcf_root)/import/libqt/core/core.l: | $(dcf_root)/import/libqt/core/. + +ifeq ($(libqt_type),archive) +$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.a + @echo $^ >$@ +else +$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.so + @echo $^ >$@ + @echo rpath:$(root)/lib >>$@ +endif + +$(dcf_root)/import/libqt/core/core.l.cpp-options: | $(dcf_root)/import/libqt/core/. + @echo include: -I$(root)/include -I$(root)/include/QtCore >$@ + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libqt/core/core.l,\ +rm -f $(dcf_root)/import/libqt/core/core.l) + $(call message,,rm -f $(dcf_root)/import/libqt/core/core.l.cpp-options) + +endif diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make new file mode 100644 index 0000000..821eab7 --- /dev/null +++ b/build/import/libqt/core/stub.make @@ -0,0 +1,36 @@ +# file : build/import/libqt/core/stub.make +# author : Boris Kolpackov +# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) + +libqt_installed := + +$(call -include,$(dcf_root)/import/libqt/configuration-dynamic.make) + +ifdef libqt_installed + +ifeq ($(libqt_installed),y) + +$(call export,\ + l: $(libqt_core_libs),\ + cpp-options: ,\ + cpp-options-inline: $(libqt_core_cppflags)) + +else + +$(call include-once,$(scf_root)/import/libqt/core/rules.make,$(dcf_root)) + +$(call export,\ + l: $(dcf_root)/import/libqt/core/core.l,\ + cpp-options: $(dcf_root)/import/libqt/core/core.l.cpp-options,\ + cpp-options-inline: ) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libqt/version b/build/import/libqt/version new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/build/import/libqt/version @@ -0,0 +1 @@ +0.1.0 diff --git a/makefile b/makefile index ad2f5b9..2942831 100644 --- a/makefile +++ b/makefile @@ -5,8 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql sqlite boost -dirs := common tracer boost +all_dirs := libcommon common tracer mysql sqlite boost qt +dirs := common tracer boost qt ifeq ($(db_id),mysql) dirs += mysql diff --git a/qt/makefile b/qt/makefile new file mode 100644 index 0000000..edbb5dc --- /dev/null +++ b/qt/makefile @@ -0,0 +1,34 @@ +# file : qt/makefile +# author : Constantin Michael +# 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 := mysql + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := qt +$(dist): export dirs := $(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/qt/mysql/driver.cxx b/qt/mysql/driver.cxx new file mode 100644 index 0000000..9ff3445 --- /dev/null +++ b/qt/mysql/driver.cxx @@ -0,0 +1,57 @@ +// file : qt/mysql/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt core type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + person p; + p.name = "John Doe"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (p); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + person* pl = db->load (p.id); + t.commit (); + + assert (*pl == p); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mysql/makefile b/qt/mysql/makefile new file mode 100644 index 0000000..69b70aa --- /dev/null +++ b/qt/mysql/makefile @@ -0,0 +1,114 @@ +# file : qt/mysql/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/qt/mysql/test.hxx b/qt/mysql/test.hxx new file mode 100644 index 0000000..bcbabfa --- /dev/null +++ b/qt/mysql/test.hxx @@ -0,0 +1,26 @@ +// file : qt/mysql/test.hxx +// author : Constantin Michael +// 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 person +{ + bool + operator== (const person& x) const + { + return id == x.id && name == x.name; + } + + #pragma db id auto + unsigned long id; + + QString name; +}; + +#endif // TEST_HXX diff --git a/qt/mysql/test.std b/qt/mysql/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 242363e630f2f541bcf1b7133f21ab2730587c4f Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 25 Mar 2011 17:52:14 +0200 Subject: Update directory structure for Qt test --- qt/Makefile.am | 12 + qt/build.bat | 109 +++++++ qt/makefile | 39 +-- qt/mysql/Makefile.am | 7 + qt/mysql/core/driver.cxx | 58 ++++ qt/mysql/core/makefile | 114 ++++++++ qt/mysql/core/test.hxx | 40 +++ qt/mysql/core/test.std | 0 qt/mysql/driver.cxx | 57 ---- qt/mysql/makefile | 124 ++------ qt/mysql/qt-mysql-vc10.sln | 15 + qt/mysql/qt-mysql-vc9.sln | 15 + qt/mysql/template/Makefile.am | 31 ++ qt/mysql/template/driver.cxx | 44 +++ qt/mysql/template/makefile | 110 ++++++++ qt/mysql/template/template-vc10.vcxproj | 180 ++++++++++++ qt/mysql/template/template-vc10.vcxproj.filters | 25 ++ qt/mysql/template/template-vc9.vcproj | 361 ++++++++++++++++++++++++ qt/mysql/template/test.hxx | 27 ++ qt/mysql/template/test.std | 1 + qt/mysql/test.bat | 70 +++++ qt/mysql/test.hxx | 26 -- qt/mysql/test.std | 0 23 files changed, 1263 insertions(+), 202 deletions(-) create mode 100644 qt/Makefile.am create mode 100644 qt/build.bat create mode 100644 qt/mysql/Makefile.am create mode 100644 qt/mysql/core/driver.cxx create mode 100644 qt/mysql/core/makefile create mode 100644 qt/mysql/core/test.hxx create mode 100644 qt/mysql/core/test.std delete mode 100644 qt/mysql/driver.cxx create mode 100644 qt/mysql/qt-mysql-vc10.sln create mode 100644 qt/mysql/qt-mysql-vc9.sln create mode 100644 qt/mysql/template/Makefile.am create mode 100644 qt/mysql/template/driver.cxx create mode 100644 qt/mysql/template/makefile create mode 100644 qt/mysql/template/template-vc10.vcxproj create mode 100644 qt/mysql/template/template-vc10.vcxproj.filters create mode 100644 qt/mysql/template/template-vc9.vcproj create mode 100644 qt/mysql/template/test.hxx create mode 100644 qt/mysql/template/test.std create mode 100644 qt/mysql/test.bat delete mode 100644 qt/mysql/test.hxx delete mode 100644 qt/mysql/test.std diff --git a/qt/Makefile.am b/qt/Makefile.am new file mode 100644 index 0000000..177f205 --- /dev/null +++ b/qt/Makefile.am @@ -0,0 +1,12 @@ +# file : qt/Makefile.am +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = + +if DATABASE_MYSQL +SUBDIRS += mysql +endif + +EXTRA_DIST = __file__(extra_dist) diff --git a/qt/build.bat b/qt/build.bat new file mode 100644 index 0000000..fd83e05 --- /dev/null +++ b/qt/build.bat @@ -0,0 +1,109 @@ +@echo off +rem file : qt/build.bat +rem author : Constantin Michael +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem Build Qt tests using the VC++ batch mode compilation. +rem +rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] +rem +rem conf: {Debug,Release}|all +rem plat: {Win32,x64}|all +rem + +setlocal + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +if "_%2_" == "__" ( + echo no VC++ version specified + goto usage +) + +if "_%~3_" == "__" ( + echo no configuration specified + goto usage +) + +if "_%~4_" == "__" ( + echo no platform specified + goto usage +) + +set "failed=" + +if "_%2_" == "_9_" set "vcver=9" +if "_%2_" == "_10_" set "vcver=10" + +if "_%vcver%_" == "__" ( + echo unknown VC++ version %2 + goto usage +) + +set "confs=%~3" +set "plats=%~4" + +if "_%confs%_" == "_all_" set "confs=__path__(configurations)" +if "_%plats%_" == "_all_" set "plats=__path__(platforms)" + +set "action=%5" +if "_%action%_" == "__" set "action=/Build" + +set "devenv=%DEVENV%" +if "_%devenv%_" == "__" set "devenv=devenv.com" + +goto start + +rem +rem %1 - solution name +rem %2 - configuration to build +rem %3 - platform to build +rem +:run_build + echo. + echo building qt/%1 %3 %2 + "%devenv%" %1 %action% "%2|%3" 2>&1 + if errorlevel 1 set "failed=%failed% qt/%1\%3\%2" +goto :eof + +:start + +for %%d in (%1) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_build %%d/qt-%%d-vc%vcver%.sln %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL BUILDS SUCCEEDED +echo. +goto end + +:usage +echo. +echo usage: build.bat database vc-version conf plat [action] +echo valid configurations are: {Debug,Release}|all +echo valid platforms are: {Win32,x64}|all +echo valid actions are: /Build (default), /Clean, and /Rebuild +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/qt/makefile b/qt/makefile index edbb5dc..5520b8a 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,30 +5,33 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := mysql +all_dirs := mysql +dirs := -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +ifeq ($(db_id),mysql) +dirs += mysql +endif -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean -$(dist): name := qt -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) + +$(dist): export extra_dist := build.bat +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(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))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/dist.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) +else +$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) +endif diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am new file mode 100644 index 0000000..dec2a28 --- /dev/null +++ b/qt/mysql/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/mysql/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/mysql/core/driver.cxx b/qt/mysql/core/driver.cxx new file mode 100644 index 0000000..3c693a0 --- /dev/null +++ b/qt/mysql/core/driver.cxx @@ -0,0 +1,58 @@ +// file : qt/mysql/core/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt core type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + person p1; + p1.name = "Constantin Michael"; + p1.date_of_birth.setDate (1979, 03, 07); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (p1); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + person* pl = db->load (p1.name); + t.commit (); + + assert (*pl == p1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mysql/core/makefile b/qt/mysql/core/makefile new file mode 100644 index 0000000..67f2e94 --- /dev/null +++ b/qt/mysql/core/makefile @@ -0,0 +1,114 @@ +# file : qt/mysql/core/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/qt/mysql/core/test.hxx b/qt/mysql/core/test.hxx new file mode 100644 index 0000000..cc8e02d --- /dev/null +++ b/qt/mysql/core/test.hxx @@ -0,0 +1,40 @@ +// file : qt/mysql/core/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct time_punchcard +{ + #pragma db id auto + unsigned long id; + + QDateTime date_time; +}; + +#pragma db object +struct person +{ + bool + operator== (const person& x) const + { + return name == x.name && + date_of_birth == x.date_of_birth && + time_of_birth == x.time_of_birth; + } + + #pragma db id + QString name; + + #pragma db type("DATE NOT NULL") + QDate date_of_birth; + QTime time_of_birth; +}; + +#endif // TEST_HXX diff --git a/qt/mysql/core/test.std b/qt/mysql/core/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/mysql/driver.cxx b/qt/mysql/driver.cxx deleted file mode 100644 index 9ff3445..0000000 --- a/qt/mysql/driver.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : qt/mysql/driver.cxx -// author : Constantin Michael -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt core type persistence. MySQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - person p; - p.name = "John Doe"; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (p); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - person* pl = db->load (p.id); - t.commit (); - - assert (*pl == p); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 69b70aa..5c7fffc 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,114 +1,36 @@ # file : qt/mysql/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : GNU GPL; 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) +tests := \ +core \ +template -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) +$(dist): name := qt-mysql +$(dist): export dirs := $(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) -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ ---generate-schema -$(gen): cpp_options := -I$(out_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) - $(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/vc9sln.make) +$(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vctest.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) +$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/mysql/qt-mysql-vc10.sln b/qt/mysql/qt-mysql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mysql/qt-mysql-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/qt-mysql-vc9.sln b/qt/mysql/qt-mysql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mysql/qt-mysql-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am new file mode 100644 index 0000000..1948cb1 --- /dev/null +++ b/qt/mysql/template/Makefile.am @@ -0,0 +1,31 @@ +# file : qt/mysql/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' + +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/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx new file mode 100644 index 0000000..c94096b --- /dev/null +++ b/qt/mysql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : qt/mysql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile new file mode 100644 index 0000000..fbe0460 --- /dev/null +++ b/qt/mysql/template/makefile @@ -0,0 +1,110 @@ +# file : qt/mysql/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +#Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ +--generate-schema +$(gen): cpp_options := -I$(out_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(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/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj new file mode 100644 index 0000000..be0135e --- /dev/null +++ b/qt/mysql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.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/qt/mysql/template/template-vc10.vcxproj.filters b/qt/mysql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/qt/mysql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj new file mode 100644 index 0000000..c679db9 --- /dev/null +++ b/qt/mysql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx new file mode 100644 index 0000000..e6ca8ba --- /dev/null +++ b/qt/mysql/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/mysql/template/test.hxx +// author : Constantin Michael +// 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/qt/mysql/template/test.std b/qt/mysql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/mysql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat new file mode 100644 index 0000000..96f88be --- /dev/null +++ b/qt/mysql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : qt/mysql/test.bat +rem author : Constantin Michael +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 mysql %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/qt/mysql/test.hxx b/qt/mysql/test.hxx deleted file mode 100644 index bcbabfa..0000000 --- a/qt/mysql/test.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : qt/mysql/test.hxx -// author : Constantin Michael -// 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 person -{ - bool - operator== (const person& x) const - { - return id == x.id && name == x.name; - } - - #pragma db id auto - unsigned long id; - - QString name; -}; - -#endif // TEST_HXX diff --git a/qt/mysql/test.std b/qt/mysql/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1 From 75f8ef2dcddea1260a31491c97a26d30a18fce6c Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 30 Mar 2011 15:54:27 +0200 Subject: Add code for Qt profile dist build --- Makefile.am | 4 ++ configure.ac | 11 +++++ m4/libodb-qt.m4 | 84 ++++++++++++++++++++++++++++++++ m4/libqt.m4 | 86 +++++++++++++++++++++++++++++++++ qt/makefile | 1 + qt/mysql/template/template-vc10.vcxproj | 8 +-- qt/mysql/template/template-vc9.vcproj | 8 +-- test.bat | 2 +- 8 files changed, 195 insertions(+), 9 deletions(-) create mode 100644 m4/libodb-qt.m4 create mode 100644 m4/libqt.m4 diff --git a/Makefile.am b/Makefile.am index 0a15f76..2631719 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,6 +9,10 @@ if ODB_TESTS_BOOST SUBDIRS += boost endif +if ODB_TESTS_QT +SUBDIRS += qt +endif + if DATABASE_MYSQL SUBDIRS += mysql endif diff --git a/configure.ac b/configure.ac index cea2bd2..632465c 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,17 @@ LIBODB_BOOST([], [odb_tests_boost=no]) AM_CONDITIONAL([ODB_TESTS_BOOST], [test x$odb_tests_boost != xno]) +# Check for Qt +# +odb_tests_qt=yes +LIBQTCORE([],[odb_tests_qt=no]) + +# Check for libodb-qt +# +LIBODB_QT([], [odb_tests_qt=no]) + +AM_CONDITIONAL([ODB_TESTS_QT], [test x$odb_tests_qt != xno]) + # Check which database we are using. # DATABASE diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 new file mode 100644 index 0000000..7e6b31e --- /dev/null +++ b/m4/libodb-qt.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-qt.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_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_QT], [ +libodb_qt_found=no + +AC_ARG_WITH( + [libodb-qt], + [AC_HELP_STRING([--with-libodb-qt=DIR],[location of libodb-qt build directory])], + [libodb_qt_dir=${withval}], + [libodb_qt_dir=]) + +AC_MSG_CHECKING([for libodb-qt]) + +# If libodb_qt_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_qt_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_qt_dir], [$ac_pwd], [$libodb_qt_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_qt_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_qt_dir/odb/qt" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-qt $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::qt::exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_qt_found=yes]) + +if test x"$libodb_qt_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_qt_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_qt_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/libqt.m4 b/m4/libqt.m4 new file mode 100644 index 0000000..b79e0a8 --- /dev/null +++ b/m4/libqt.m4 @@ -0,0 +1,86 @@ +dnl file : m4/libqt.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 LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBQTCORE], [ +libqt_found=no + +AC_PATH_PROG([pkg_config],[pkg-config]) + +AC_MSG_CHECKING([for QtCore]) + +# First check for QtCore using default CPPFLAGS/LDFLAGS. +# +save_LIBS="$LIBS" +LIBS="-lQtCore $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + +# If default CPPFLAGS/LDFLAGS didn't work, try to discover +# them using pkg-config. +# +if test x"$libqt_found" = xno; then + LIBS="$save_LIBS" + + if test x"$pkg_config" != x; then + if $pkg_config --exists QtCore; then + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + CPPFLAGS=`$pkg_config --cflags QtCore` + LIBS=`$pkg_config --libs QtCore` + + CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" + LIBS="$LIBS $save_LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + if test x"$libqt_found" = xno; then + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + fi + fi + fi +fi + +if test x"$libqt_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/qt/makefile b/qt/makefile index 5520b8a..b8758a5 100644 --- a/qt/makefile +++ b/qt/makefile @@ -21,6 +21,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export extra_dist := build.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) + $(call meta-vctest,mysql/qt-mysql-vc10.sln,build.bat) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj index be0135e..5981755 100644 --- a/qt/mysql/template/template-vc10.vcxproj +++ b/qt/mysql/template/template-vc10.vcxproj @@ -93,7 +93,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;QtCored4.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;QtCored4.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;QtCore4.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;QtCore4.lib;odb.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj index c679db9..8bd92cb 100644 --- a/qt/mysql/template/template-vc9.vcproj +++ b/qt/mysql/template/template-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Thu, 7 Apr 2011 12:54:04 +0200 Subject: Add qt/basic and qt/date-time MySQL tests --- qt/mysql/basic/driver.cxx | 58 ++++++++++++++++ qt/mysql/basic/makefile | 116 ++++++++++++++++++++++++++++++++ qt/mysql/basic/test.hxx | 29 ++++++++ qt/mysql/basic/test.std | 0 qt/mysql/core/driver.cxx | 58 ---------------- qt/mysql/core/makefile | 114 ------------------------------- qt/mysql/core/test.hxx | 40 ----------- qt/mysql/core/test.std | 0 qt/mysql/date-time/driver.cxx | 153 ++++++++++++++++++++++++++++++++++++++++++ qt/mysql/date-time/makefile | 116 ++++++++++++++++++++++++++++++++ qt/mysql/date-time/test.hxx | 55 +++++++++++++++ qt/mysql/date-time/test.std | 0 qt/mysql/makefile | 5 +- qt/mysql/template/Makefile.am | 1 + qt/mysql/template/makefile | 6 +- 15 files changed, 534 insertions(+), 217 deletions(-) create mode 100644 qt/mysql/basic/driver.cxx create mode 100644 qt/mysql/basic/makefile create mode 100644 qt/mysql/basic/test.hxx create mode 100644 qt/mysql/basic/test.std delete mode 100644 qt/mysql/core/driver.cxx delete mode 100644 qt/mysql/core/makefile delete mode 100644 qt/mysql/core/test.hxx delete mode 100644 qt/mysql/core/test.std create mode 100644 qt/mysql/date-time/driver.cxx create mode 100644 qt/mysql/date-time/makefile create mode 100644 qt/mysql/date-time/test.hxx create mode 100644 qt/mysql/date-time/test.std diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx new file mode 100644 index 0000000..ee1f69d --- /dev/null +++ b/qt/mysql/basic/driver.cxx @@ -0,0 +1,58 @@ +// file : qt/mysql/basic/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "Constantin Michael"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load.dob + // + { + transaction t (db->begin ()); + object* ol = db->load (o.str); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile new file mode 100644 index 0000000..6d48f0c --- /dev/null +++ b/qt/mysql/basic/makefile @@ -0,0 +1,116 @@ +# file : qt/mysql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 mysql --profile qt/basic \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/mysql/,,$(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 schema) + $(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/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx new file mode 100644 index 0000000..1e1f9e6 --- /dev/null +++ b/qt/mysql/basic/test.hxx @@ -0,0 +1,29 @@ +// file : qt/mysql/basic/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/qt/mysql/basic/test.std b/qt/mysql/basic/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/mysql/core/driver.cxx b/qt/mysql/core/driver.cxx deleted file mode 100644 index 3c693a0..0000000 --- a/qt/mysql/core/driver.cxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : qt/mysql/core/driver.cxx -// author : Constantin Michael -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt core type persistence. MySQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - person p1; - p1.name = "Constantin Michael"; - p1.date_of_birth.setDate (1979, 03, 07); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (p1); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - person* pl = db->load (p1.name); - t.commit (); - - assert (*pl == p1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mysql/core/makefile b/qt/mysql/core/makefile deleted file mode 100644 index 67f2e94..0000000 --- a/qt/mysql/core/makefile +++ /dev/null @@ -1,114 +0,0 @@ -# file : qt/mysql/core/makefile -# author : Constantin Michael -# 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) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ ---generate-schema -$(gen): cpp_options := -I$(out_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(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,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) - $(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/qt/mysql/core/test.hxx b/qt/mysql/core/test.hxx deleted file mode 100644 index cc8e02d..0000000 --- a/qt/mysql/core/test.hxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : qt/mysql/core/test.hxx -// author : Constantin Michael -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct time_punchcard -{ - #pragma db id auto - unsigned long id; - - QDateTime date_time; -}; - -#pragma db object -struct person -{ - bool - operator== (const person& x) const - { - return name == x.name && - date_of_birth == x.date_of_birth && - time_of_birth == x.time_of_birth; - } - - #pragma db id - QString name; - - #pragma db type("DATE NOT NULL") - QDate date_of_birth; - QTime time_of_birth; -}; - -#endif // TEST_HXX diff --git a/qt/mysql/core/test.std b/qt/mysql/core/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx new file mode 100644 index 0000000..ae0643b --- /dev/null +++ b/qt/mysql/date-time/driver.cxx @@ -0,0 +1,153 @@ +// file : qt/mysql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +bool +test_out_of_range_value (object&, database&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // Check valid dates and times. + // + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // + + // Create a QDateTime containing the current date and time + // but with the milliseconds zeroed. MySQL does not currently + // support millisecond times. + // + QDateTime t (QDateTime::currentDateTime ()); + + t.setTime (QTime (t.time ().hour (), + t.time ().minute (), + t.time ().second ())); + + o.date = t.date (); + o.date_time = t; + o.timestamp = t; + o.time = t.time (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + // + // Check invalid dates and times. + // + + { + // Test out of range dates. + // + object or1, or2; + or1.date = QDate (999, 12, 31); + or2.date = QDate (10000, 1, 1); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + + { + // Test out of range date-times. + // + object or1, or2; + or1.date_time = QDateTime (QDate (999, 12, 31), QTime (23, 59, 59)); + or2.date_time = QDateTime (QDate (10000, 1, 1)); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + + { + // Test out of range timestamps. + // + object or1, or2; + or1.timestamp = QDateTime (QDate (1970, 1, 1)); + or2.timestamp = QDateTime (QDate (2038, 1, 19), QTime (3, 14, 8)); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_out_of_range_value (object& x, database& db) +{ + try + { + db.persist (x); + return false; + } + catch (const odb::qt::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile new file mode 100644 index 0000000..ca8e79c --- /dev/null +++ b/qt/mysql/date-time/makefile @@ -0,0 +1,116 @@ +# file : qt/mysql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 mysql --profile qt/date-time \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/mysql/,,$(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 schema) + $(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/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx new file mode 100644 index 0000000..9eb328e --- /dev/null +++ b/qt/mysql/date-time/test.hxx @@ -0,0 +1,55 @@ +// file : qt/mysql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + timestamp == x.timestamp && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + timestamp.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QDateTime date_time; + + // Specify NULL explicitly to suppress auto-initialization and + // auto-update characteristics of TIMESTAMP datatype, and to allow + // NULL values. + // + #pragma db type("TIMESTAMP NULL") + QDateTime timestamp; + + QTime time; +}; + +#endif // TEST_HXX diff --git a/qt/mysql/date-time/test.std b/qt/mysql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 5c7fffc..c87e1ea 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -5,8 +5,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -tests := \ -core \ +tests := \ +basic \ +date-time \ template default := $(out_base)/ diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 1948cb1..1239fa7 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -9,6 +9,7 @@ noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index fbe0460..a76f0cc 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -31,7 +31,7 @@ $(call import,\ #Build. # $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) genf := $(addprefix $(odb_hdr:.hxx=-odb),.hxx .ixx .cxx) $(odb_hdr:.hxx=.sql) @@ -41,7 +41,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile qt \ --generate-schema -$(gen): cpp_options := -I$(out_base) +$(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -67,7 +67,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,sql $$1,$(dcf_root)/db-driver $$1, $(src_base)/test.sql) + $(call schema) $(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) -- cgit v1.1 From 3150aa68bf21483bbeb947030992fe8909efbc77 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 11 Apr 2011 18:22:24 +0200 Subject: Add qt/basic and qt/date-time SQLite tests --- qt/Makefile.am | 4 + qt/makefile | 4 +- qt/sqlite/Makefile.am | 7 + qt/sqlite/basic/driver.cxx | 58 ++++ qt/sqlite/basic/makefile | 116 ++++++++ qt/sqlite/basic/test.hxx | 29 ++ qt/sqlite/basic/test.std | 0 qt/sqlite/date-time/driver.cxx | 90 ++++++ qt/sqlite/date-time/makefile | 116 ++++++++ qt/sqlite/date-time/test.hxx | 57 ++++ qt/sqlite/date-time/test.std | 0 qt/sqlite/makefile | 37 +++ qt/sqlite/qt-sqlite-vc10.sln | 15 + qt/sqlite/qt-sqlite-vc9.sln | 15 + qt/sqlite/template/Makefile.am | 32 ++ qt/sqlite/template/driver.cxx | 44 +++ qt/sqlite/template/makefile | 110 +++++++ qt/sqlite/template/template-vc10.vcxproj | 180 +++++++++++ qt/sqlite/template/template-vc10.vcxproj.filters | 25 ++ qt/sqlite/template/template-vc9.vcproj | 361 +++++++++++++++++++++++ qt/sqlite/template/test.hxx | 27 ++ qt/sqlite/template/test.std | 1 + qt/sqlite/test.bat | 70 +++++ 23 files changed, 1397 insertions(+), 1 deletion(-) create mode 100644 qt/sqlite/Makefile.am create mode 100644 qt/sqlite/basic/driver.cxx create mode 100644 qt/sqlite/basic/makefile create mode 100644 qt/sqlite/basic/test.hxx create mode 100644 qt/sqlite/basic/test.std create mode 100644 qt/sqlite/date-time/driver.cxx create mode 100644 qt/sqlite/date-time/makefile create mode 100644 qt/sqlite/date-time/test.hxx create mode 100644 qt/sqlite/date-time/test.std create mode 100644 qt/sqlite/makefile create mode 100644 qt/sqlite/qt-sqlite-vc10.sln create mode 100644 qt/sqlite/qt-sqlite-vc9.sln create mode 100644 qt/sqlite/template/Makefile.am create mode 100644 qt/sqlite/template/driver.cxx create mode 100644 qt/sqlite/template/makefile create mode 100644 qt/sqlite/template/template-vc10.vcxproj create mode 100644 qt/sqlite/template/template-vc10.vcxproj.filters create mode 100644 qt/sqlite/template/template-vc9.vcproj create mode 100644 qt/sqlite/template/test.hxx create mode 100644 qt/sqlite/template/test.std create mode 100644 qt/sqlite/test.bat diff --git a/qt/Makefile.am b/qt/Makefile.am index 177f205..6ec850c 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -9,4 +9,8 @@ if DATABASE_MYSQL SUBDIRS += mysql endif +if DATABASE_SQLITE +SUBDIRS += sqlite +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/qt/makefile b/qt/makefile index b8758a5..9dc901a 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,11 +5,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := mysql +all_dirs := mysql sqlite dirs := ifeq ($(db_id),mysql) dirs += mysql +else ifeq ($(db_id), sqlite) +dirs += sqlite endif default := $(out_base)/ diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am new file mode 100644 index 0000000..98962a9 --- /dev/null +++ b/qt/sqlite/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/sqlite/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx new file mode 100644 index 0000000..1587679 --- /dev/null +++ b/qt/sqlite/basic/driver.cxx @@ -0,0 +1,58 @@ +// file : qt/sqlite/basic/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "Constantin Michael"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load.dob + // + { + transaction t (db->begin ()); + object* ol = db->load (o.str); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile new file mode 100644 index 0000000..e1b1af0 --- /dev/null +++ b/qt/sqlite/basic/makefile @@ -0,0 +1,116 @@ +# file : qt/sqlite/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 sqlite --profile qt/basic \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/sqlite/,,$(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 schema) + $(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/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx new file mode 100644 index 0000000..ca99d33 --- /dev/null +++ b/qt/sqlite/basic/test.hxx @@ -0,0 +1,29 @@ +// file : qt/sqlite/basic/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/qt/sqlite/basic/test.std b/qt/sqlite/basic/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx new file mode 100644 index 0000000..1f1a1bd --- /dev/null +++ b/qt/sqlite/date-time/driver.cxx @@ -0,0 +1,90 @@ +// file : qt/sqlite/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // Check valid dates and times. + // + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // + QDateTime t (QDateTime::currentDateTime ()); + o.date = t.date (); + o.julian_day = t.date (); + o.time = t.time (); + + // We do not take milliseconds into account when storing + // time as seconds. Zero the millisecond part to avoid a + // false negative. + // + o.seconds = QTime (t.time ().hour (), + t.time ().minute (), + t.time ().second ()); + o.date_time = t; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile new file mode 100644 index 0000000..261200a --- /dev/null +++ b/qt/sqlite/date-time/makefile @@ -0,0 +1,116 @@ +# file : qt/sqlite/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 sqlite --profile qt/date-time \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/sqlite/,,$(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 schema) + $(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/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx new file mode 100644 index 0000000..27ba341 --- /dev/null +++ b/qt/sqlite/date-time/test.hxx @@ -0,0 +1,57 @@ +// file : qt/sqlite/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + julian_day == x.julian_day && + time == x.time && + seconds == x.seconds && + date_time == x.date_time; + } + + bool + is_null () const + { + return + date.isNull () && + julian_day.isNull () && + time.isNull () && + seconds.isNull () && + date_time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + + #pragma db type ("INTEGER") + QDate julian_day; + + QTime time; + + #pragma db type ("INTEGER") + QTime seconds; + + QDateTime date_time; +}; + +#endif // TEST_HXX diff --git a/qt/sqlite/date-time/test.std b/qt/sqlite/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile new file mode 100644 index 0000000..3f40007 --- /dev/null +++ b/qt/sqlite/makefile @@ -0,0 +1,37 @@ +# file : qt/sqlite/makefile +# author : Constantin Michael +# 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 := \ +basic \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := qt-sqlite +$(dist): export dirs := $(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/qt/sqlite/qt-sqlite-vc10.sln b/qt/sqlite/qt-sqlite-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/sqlite/qt-sqlite-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/qt-sqlite-vc9.sln b/qt/sqlite/qt-sqlite-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/sqlite/qt-sqlite-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am new file mode 100644 index 0000000..fbf2e84 --- /dev/null +++ b/qt/sqlite/template/Makefile.am @@ -0,0 +1,32 @@ +# file : qt/sqlite/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx new file mode 100644 index 0000000..cce886a --- /dev/null +++ b/qt/sqlite/template/driver.cxx @@ -0,0 +1,44 @@ +// file : qt/sqlite/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile new file mode 100644 index 0000000..b19b8ef --- /dev/null +++ b/qt/sqlite/template/makefile @@ -0,0 +1,110 @@ +# file : qt/sqlite/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +#Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 sqlite --profile qt \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/sqlite/,,$(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 schema) + $(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/qt/sqlite/template/template-vc10.vcxproj b/qt/sqlite/template/template-vc10.vcxproj new file mode 100644 index 0000000..e9481f5 --- /dev/null +++ b/qt/sqlite/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.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/qt/sqlite/template/template-vc10.vcxproj.filters b/qt/sqlite/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/qt/sqlite/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/qt/sqlite/template/template-vc9.vcproj b/qt/sqlite/template/template-vc9.vcproj new file mode 100644 index 0000000..d03c0aa --- /dev/null +++ b/qt/sqlite/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx new file mode 100644 index 0000000..c823c0e --- /dev/null +++ b/qt/sqlite/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/sqlite/template/test.hxx +// author : Constantin Michael +// 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/qt/sqlite/template/test.std b/qt/sqlite/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/sqlite/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat new file mode 100644 index 0000000..997a329 --- /dev/null +++ b/qt/sqlite/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : qt/sqlite/test.bat +rem author : Constantin Michael +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 sqlite %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd %curdir% +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal -- cgit v1.1 From b5bdf60e53648972a5bc9c1d7b37be7dda026509 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 12 Apr 2011 15:47:55 +0200 Subject: Aesthetic changes to qt/mysql test --- qt/mysql/basic/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index ee1f69d..ed3165e 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -40,7 +40,7 @@ main (int argc, char* argv[]) t.commit (); } - // Load.dob + // Load. // { transaction t (db->begin ()); -- cgit v1.1 From da9dd6be1b0203c496af4aff16df60fedc64463a Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 12 Apr 2011 15:48:17 +0200 Subject: Add UNIX time tests for qt/date-time SQLite implementation --- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/date-time/driver.cxx | 132 +++++++++++++++++++++++++++++++++-------- qt/sqlite/date-time/test.hxx | 15 +++-- 3 files changed, 118 insertions(+), 31 deletions(-) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 1587679..f24053a 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -40,7 +40,7 @@ main (int argc, char* argv[]) t.commit (); } - // Load.dob + // Load. // { transaction t (db->begin ()); diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 1f1a1bd..277c29b 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -23,6 +23,9 @@ using namespace std; using namespace odb::core; +bool +test_out_of_range_value (object&, database&); + int main (int argc, char* argv[]) { @@ -30,56 +33,117 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // Check valid dates and times. - // - - object o; - // Check persistence of null values. // + object o1; { transaction t (db->begin ()); - db->persist (o); + db->persist (o1); t.commit (); } { transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); + auto_ptr ol1 (db->load (o1.id)); t.commit (); - assert (ol->is_null ()); + assert (ol1->is_null ()); } + QDateTime ct (QDateTime::currentDateTime ()); + QDateTime ct_no_ms = QDateTime (QDate (ct.date ().year (), + ct.date ().month (), + ct.date ().day ()), + QTime (ct.time ().hour (), + ct.time ().minute (), + ct.time ().second ())); + // Check persistence of valid dates and times. // - QDateTime t (QDateTime::currentDateTime ()); - o.date = t.date (); - o.julian_day = t.date (); - o.time = t.time (); - - // We do not take milliseconds into account when storing - // time as seconds. Zero the millisecond part to avoid a - // false negative. - // - o.seconds = QTime (t.time ().hour (), - t.time ().minute (), - t.time ().second ()); - o.date_time = t; + object o2; + { + o2.date = ct.date (); + o2.unix_day = ct.date (); + o2.time = ct.time (); + + // QTime stored as SQLite INTEGER has second resolution. + // The millsecond part is zeroed to avoid false negatives. + // + o2.seconds = ct_no_ms.time (); + + o2.date_time = ct; + + // UNIX time has second reolution. The millsecond part is + // zeroed to avoid false negatives. + // + o2.unix_time = ct_no_ms; + + transaction t (db->begin ()); + db->persist (o2); + t.commit (); + } { transaction t (db->begin ()); - db->persist (o); + auto_ptr ol2 (db->load (o2.id)); t.commit (); + + assert (*ol2 == o2); } + // Test different time zones are handled correctly by + // QDateTime traits UNIX time implementation. + // + object o3, o4, o5; { + // o3 is set to ct local time. o4 is set to ct UTC. o5 + // is set to o3's equivalent UTC time. + // + o3.unix_time = ct_no_ms; + + o4.unix_time = ct_no_ms; + o4.unix_time.setTimeSpec (Qt::UTC); + + o5.unix_time = ct_no_ms.toTimeSpec (Qt::UTC); + transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); + db->persist (o3); + db->persist (o4); + db->persist (o5); t.commit (); + } - assert (*ol == o); + { + transaction t (db->begin ()); + auto_ptr ol3 (db->load (o3.id)); + auto_ptr ol4 (db->load (o4.id)); + auto_ptr ol5 (db->load (o5.id)); + t.commit (); + + assert (ol3->unix_time != ol4->unix_time); + assert (ol3->unix_time == ol5->unix_time); + } + + // Test out of range values for QDateTime traits UNIX time + // implementation. + // + { + object o; + o.unix_time = QDateTime (QDate (1969, 12, 31), + QTime (23, 59, 59), + Qt::UTC); + + assert (test_out_of_range_value (o, *db)); + } + + // Test out of range values for QDate traits UNIX time + // implementation. + // + { + object o; + o.unix_day = QDate (QDate (1969, 12, 31)); + + assert (test_out_of_range_value (o, *db)); } } catch (const odb::exception& e) @@ -88,3 +152,21 @@ main (int argc, char* argv[]) return 1; } } + +bool +test_out_of_range_value (object& x, database& db) +{ + try + { + transaction t (db.begin ()); + db.persist (x); + t.rollback (); + + return false; + } + catch (const odb::qt::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 27ba341..0a140b7 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -21,10 +21,11 @@ struct object return id == x.id && date == x.date && - julian_day == x.julian_day && + unix_day == x.unix_day && time == x.time && seconds == x.seconds && - date_time == x.date_time; + date_time == x.date_time && + unix_time == x.unix_time; } bool @@ -32,10 +33,11 @@ struct object { return date.isNull () && - julian_day.isNull () && + unix_day.isNull () && time.isNull () && seconds.isNull () && - date_time.isNull (); + date_time.isNull () && + unix_time.isNull (); } #pragma db id auto @@ -44,7 +46,7 @@ struct object QDate date; #pragma db type ("INTEGER") - QDate julian_day; + QDate unix_day; QTime time; @@ -52,6 +54,9 @@ struct object QTime seconds; QDateTime date_time; + + #pragma db type ("INTEGER") + QDateTime unix_time; }; #endif // TEST_HXX -- cgit v1.1 From e08eeb9e5da87a729992c5a1d14bfd62f4ed2205 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 18 Apr 2011 12:56:18 +0200 Subject: Add tests for qt/smart-ptr --- qt/Makefile.am | 2 +- qt/build.bat | 6 + qt/common/Makefile.am | 7 + qt/common/makefile | 45 +++ qt/common/qt-common-vc10.sln | 15 + qt/common/qt-common-vc9.sln | 15 + qt/common/smart-ptr/driver.cxx | 53 ++++ qt/common/smart-ptr/makefile | 119 ++++++++ qt/common/smart-ptr/test.hxx | 56 ++++ qt/common/smart-ptr/test.std | 0 qt/common/template/Makefile.am | 29 ++ qt/common/template/driver.cxx | 44 +++ qt/common/template/makefile | 119 ++++++++ qt/common/template/template-vc10.vcxproj | 177 +++++++++++ qt/common/template/template-vc10.vcxproj.filters | 24 ++ qt/common/template/template-vc9.vcproj | 360 +++++++++++++++++++++++ qt/common/template/test.hxx | 27 ++ qt/common/template/test.std | 1 + qt/common/test.bat | 81 +++++ qt/makefile | 2 +- 20 files changed, 1180 insertions(+), 2 deletions(-) create mode 100644 qt/common/Makefile.am create mode 100644 qt/common/makefile create mode 100644 qt/common/qt-common-vc10.sln create mode 100644 qt/common/qt-common-vc9.sln create mode 100644 qt/common/smart-ptr/driver.cxx create mode 100644 qt/common/smart-ptr/makefile create mode 100644 qt/common/smart-ptr/test.hxx create mode 100644 qt/common/smart-ptr/test.std create mode 100644 qt/common/template/Makefile.am create mode 100644 qt/common/template/driver.cxx create mode 100644 qt/common/template/makefile create mode 100644 qt/common/template/template-vc10.vcxproj create mode 100644 qt/common/template/template-vc10.vcxproj.filters create mode 100644 qt/common/template/template-vc9.vcproj create mode 100644 qt/common/template/test.hxx create mode 100644 qt/common/template/test.std create mode 100644 qt/common/test.bat diff --git a/qt/Makefile.am b/qt/Makefile.am index 6ec850c..3b3e6f6 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -3,7 +3,7 @@ # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -SUBDIRS = +SUBDIRS = common if DATABASE_MYSQL SUBDIRS += mysql diff --git a/qt/build.bat b/qt/build.bat index fd83e05..e5401be 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -81,6 +81,12 @@ for %%d in (%1) do ( ) ) +for %%c in (%confs%) do + for %%p in (%plats%) do ( + call :run_build common/qt-common-%1-vc%vcver%.sln %%c %%p + ) +) + if not "_%failed%_" == "__" goto error echo. diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am new file mode 100644 index 0000000..20241a5 --- /dev/null +++ b/qt/common/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/common/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/common/makefile b/qt/common/makefile new file mode 100644 index 0000000..4912e3c --- /dev/null +++ b/qt/common/makefile @@ -0,0 +1,45 @@ +# file : qt/common/makefile +# author : Constantin Michael +# 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 := \ +smart-ptr \ +template + +all_tests := $(tests) +build_tests := $(tests) + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) + +name := qt-common +$(dist): name := $(name) +$(dist): export dirs := $(tests) +$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ +$(call vc10slns,$(name)) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) + $(call meta-automake) + $(call meta-vc9slns,$(name)) + $(call meta-vc10slns,$(name)) + $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_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) + +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) +else +$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) +endif diff --git a/qt/common/qt-common-vc10.sln b/qt/common/qt-common-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/common/qt-common-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/common/qt-common-vc9.sln b/qt/common/qt-common-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/common/qt-common-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx new file mode 100644 index 0000000..a7ca263 --- /dev/null +++ b/qt/common/smart-ptr/driver.cxx @@ -0,0 +1,53 @@ +// file : qt/common/smart-ptr/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt smart pointers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + QSharedPointer c1 (new cont (1)); + + // Test comparison operators. + // + { + assert (QLazySharedPointer () == QLazySharedPointer ()); + assert (QLazySharedPointer () != QLazySharedPointer (c1)); + assert (QLazySharedPointer (c1) == QLazySharedPointer (c1)); + + QLazySharedPointer lc1 (*db, 1); + assert (lc1 != QLazySharedPointer ()); + assert (lc1 == QLazySharedPointer (*db, c1)); + + QSharedPointer c2 (new cont (2)); + assert (lc1 != QLazySharedPointer (*db, c2)); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile new file mode 100644 index 0000000..f8e75d4 --- /dev/null +++ b/qt/common/smart-ptr/makefile @@ -0,0 +1,119 @@ +# file : qt/common/smart-ptr/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/smart-ptr --generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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 schema) + $(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/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx new file mode 100644 index 0000000..6b376b0 --- /dev/null +++ b/qt/common/smart-ptr/test.hxx @@ -0,0 +1,56 @@ +// file : qt/common/smart-ptr/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +struct obj; + +#pragma db object +struct cont +{ + cont () + { + } + + cont (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) not_null + obj_list o; +}; + +#pragma db object +struct obj +{ + obj () + { + } + + obj (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db not_null + QLazySharedPointer c; +}; + +#endif // TEST_HXX diff --git a/qt/common/smart-ptr/test.std b/qt/common/smart-ptr/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am new file mode 100644 index 0000000..e3cca0a --- /dev/null +++ b/qt/common/template/Makefile.am @@ -0,0 +1,29 @@ +# file : qt/common/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +# 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/qt/common/template/driver.cxx b/qt/common/template/driver.cxx new file mode 100644 index 0000000..7822aab --- /dev/null +++ b/qt/common/template/driver.cxx @@ -0,0 +1,44 @@ +// file : qt/common/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/template/makefile b/qt/common/template/makefile new file mode 100644 index 0000000..e3f52f0 --- /dev/null +++ b/qt/common/template/makefile @@ -0,0 +1,119 @@ +# file : qt/common/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/version --generate-schema # CHANGE qt/version +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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 schema) + $(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/qt/common/template/template-vc10.vcxproj b/qt/common/template/template-vc10.vcxproj new file mode 100644 index 0000000..e923ab1 --- /dev/null +++ b/qt/common/template/template-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-vc10.vcxproj.filters b/qt/common/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-vc9.vcproj b/qt/common/template/template-vc9.vcproj new file mode 100644 index 0000000..be74431 --- /dev/null +++ b/qt/common/template/template-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -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/qt/common/template/test.hxx b/qt/common/template/test.hxx new file mode 100644 index 0000000..ced88b2 --- /dev/null +++ b/qt/common/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/common/template/test.hxx +// author : Constantin Michael +// 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/qt/common/template/test.std b/qt/common/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/common/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/qt/common/test.bat b/qt/common/test.bat new file mode 100644 index 0000000..bd6c5b5 --- /dev/null +++ b/qt/common/test.bat @@ -0,0 +1,81 @@ +@echo off +rem file : qt/common/test.bat +rem author : Constantin Michael +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=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +goto start + +rem +rem %1 - test directory +rem %2 - configuration +rem %3 - platform +rem %4 - database +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 %4 %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 %1 + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:usage +echo. +echo usage: test.bat database +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/qt/makefile b/qt/makefile index 9dc901a..2fbc3ae 100644 --- a/qt/makefile +++ b/qt/makefile @@ -6,7 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make all_dirs := mysql sqlite -dirs := +dirs := common ifeq ($(db_id),mysql) dirs += mysql -- cgit v1.1 From cb7359cbe30940debf8137508cd987220c038081 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 19 Apr 2011 09:48:20 +0200 Subject: Update qt/smart-ptr implementation test --- qt/common/smart-ptr/driver.cxx | 180 +++++++++++++++++++++++++++++++++++++++-- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/makefile | 2 +- 4 files changed, 177 insertions(+), 9 deletions(-) diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index a7ca263..56eb6bf 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -21,6 +23,12 @@ using namespace std; using namespace odb::core; +// Force generation of code for all QLazySharedPointer and QLazyWeakPointer +// class template members. +// +template class QLazySharedPointer; +template class QLazyWeakPointer; + int main (int argc, char* argv[]) { @@ -29,20 +37,180 @@ main (int argc, char* argv[]) auto_ptr db (create_database (argc, argv)); QSharedPointer c1 (new cont (1)); + QSharedPointer c2 (new cont (2)); + + // Test boolean conversion operator. + // + { + assert (!QLazySharedPointer ()); + assert (!QLazyWeakPointer ()); + assert (QLazySharedPointer (c1)); + assert (QLazySharedPointer (*db, 1)); + assert (QLazyWeakPointer (c1)); + assert (QLazyWeakPointer (*db, 1)); + } + + // Test loaded () implementation. + // + { + assert (QLazySharedPointer ().loaded ()); + assert (!QLazySharedPointer (c1).loaded ()); + assert (!QLazySharedPointer (*db, 1).loaded ()); + assert (QLazySharedPointer (*db, c1).loaded ()); + assert (QLazyWeakPointer ().loaded ()); + assert (!QLazyWeakPointer (c1).loaded ()); + assert (!QLazyWeakPointer (*db, 1).loaded ()); + assert (QLazyWeakPointer (*db, c1).loaded ()); + } // Test comparison operators. // { + // Transient QLazySharedPointer. + // assert (QLazySharedPointer () == QLazySharedPointer ()); assert (QLazySharedPointer () != QLazySharedPointer (c1)); - assert (QLazySharedPointer (c1) == QLazySharedPointer (c1)); + assert (QLazySharedPointer (c1) != QLazySharedPointer (c2)); + assert (QLazySharedPointer (c2) == QLazySharedPointer (c2)); + + // Persistent QLazySharedPointer. + // + QLazySharedPointer ls1 (*db, 1), ls2 (*db, c2); + assert (ls1 != QLazySharedPointer ()); + assert (ls1 != QLazySharedPointer (c1)); + assert (ls1 == QLazySharedPointer (*db, c1)); + assert (ls1 != ls2); + assert (ls2 == QLazySharedPointer (c2)); + + // Transient QLazyWeakPointer. + // + assert (QLazyWeakPointer () == QLazyWeakPointer ()); + assert (QLazyWeakPointer () != QLazyWeakPointer (c1)); + assert (QLazyWeakPointer (c1) != QLazyWeakPointer (c2)); + assert (QLazyWeakPointer (c2) == QLazyWeakPointer (c2)); + assert (QLazyWeakPointer () == QLazySharedPointer ()); + assert (QLazyWeakPointer () != QLazySharedPointer (c1)); + assert (QLazyWeakPointer (c1) != QLazySharedPointer (c2)); + assert (QLazyWeakPointer (c2) == QLazySharedPointer (c2)); + + // Persistent QLazyWeakPointer. + // + QLazyWeakPointer lw1 (*db, 1), lw2 (*db, c2); + assert (lw1 != QLazyWeakPointer ()); + assert (lw1 != QLazyWeakPointer (c1)); + assert (lw1 == QLazyWeakPointer (*db, c1)); + assert (lw1 != lw2); + assert (lw2 == QLazyWeakPointer (c2)); + assert (ls1 == lw1); + assert (ls1 != QLazyWeakPointer (c1)); + assert (ls1 == QLazyWeakPointer (*db, c1)); + assert (ls1 != lw2); + assert (ls2 == QLazyWeakPointer (c2)); + } + + // Test swap. + // + { + QLazySharedPointer lx (*db, 1), ly; + swap (lx, ly); + + assert (lx.isNull ()); + assert (ly == QLazySharedPointer (*db, c1)); + } + + // Persist. + // + QSharedPointer o1 (new obj (1)); + QSharedPointer o2 (new obj (2)); + QSharedPointer o3 (new obj (3)); + QSharedPointer o4 (new obj (4)); + + o1->c = c1; + o2->c = c1; + o3->c = c2; + o4->c = c2; + + { + transaction t (db->begin ()); + + db->persist (c1); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (c2); + + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + + QSharedPointer c (db->load (1)); + QSharedPointer o (db->load (1)); + + // Ensure that lazy pointers are present but not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + assert (!o->c.loaded ()); + + // Ensure that the correct object IDs were loaded. + // + assert (c->o[0].objectId () == 1); + assert (c->o[1].objectId () == 2); + assert (o->c.objectId () == 1); + + // Load the lazy pointer targets ensuring that the loaded + // targets correspond to the cached session objects. + // + QSharedPointer cl (o->c.load ()); + QSharedPointer ol (c->o[0].load ()); + + assert (c->o[0].loaded ()); + assert (o->c.loaded ()); + + assert (cl == c); + assert (ol == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + // + transaction t (db->begin ()); + QSharedPointer c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + QLazySharedPointer l (c->o[1].toStrongRef ()); + assert (!l.loaded ()); + assert (l.objectId () == c->o[1].objectId ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + + QSharedPointer ol (c->o[1].load ()); + assert (c->o[1].loaded ()); + + ol.clear (); + assert (!c->o[1].loaded ()); - QLazySharedPointer lc1 (*db, 1); - assert (lc1 != QLazySharedPointer ()); - assert (lc1 == QLazySharedPointer (*db, c1)); + ol = c->o[1].load (); + assert (c->o[1].loaded ()); - QSharedPointer c2 (new cont (2)); - assert (lc1 != QLazySharedPointer (*db, c2)); + t.commit (); } } catch (const odb::exception& e) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index f8e75d4..a7742f2 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -35,7 +35,7 @@ $(call import,\ # Build. # $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -DQWEAKPOINTER_ENABLE_ARROW $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 6b376b0..06c05fa 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -28,7 +28,7 @@ struct cont #pragma db id unsigned long id; - typedef std::vector > obj_list; + typedef std::vector > obj_list; #pragma db inverse(c) not_null obj_list o; diff --git a/qt/makefile b/qt/makefile index 2fbc3ae..bcc54c4 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := mysql sqlite +all_dirs := common mysql sqlite dirs := common ifeq ($(db_id),mysql) -- cgit v1.1 From a14577f5ffba3db178387940b6cfc24869d02248 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 21 Apr 2011 09:31:17 +0200 Subject: Add qt/container implementation tests --- qt/common/containers/driver.cxx | 567 ++++++++++++++++++++++++++++++++++++++++ qt/common/containers/makefile | 119 +++++++++ qt/common/containers/test.hxx | 226 ++++++++++++++++ qt/common/containers/test.std | 0 qt/common/makefile | 1 + qt/common/smart-ptr/driver.cxx | 2 +- 6 files changed, 914 insertions(+), 1 deletion(-) create mode 100644 qt/common/containers/driver.cxx create mode 100644 qt/common/containers/makefile create mode 100644 qt/common/containers/test.hxx create mode 100644 qt/common/containers/test.std diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx new file mode 100644 index 0000000..507647b --- /dev/null +++ b/qt/common/containers/driver.cxx @@ -0,0 +1,567 @@ +// file : qt/common/containers/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt containers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + med.uv.push_back (123); + med.uv.push_back (234); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + med.nl.push_back (123); + med.nl.push_back (234); + + med.cl.push_back (comp (123, "aaa")); + med.cl.push_back (comp (234, "bbbb")); + + // linked list + // + med.sll.push_back ("aaa"); + med.sll.push_back ("bbbb"); + + med.nll.push_back (123); + med.nll.push_back (234); + + med.cll.push_back (comp (123, "aaa")); + med.cll.push_back (comp (234, "bbbb")); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + + // multimap + // + med.nsmm.insert (123, "aaa"); + med.nsmm.insert (123, "bbbb"); + med.nsmm.insert (234, "ccccc"); + + med.snmm.insert ("aaa", 123); + med.snmm.insert ("aaa", 234); + med.snmm.insert ("bbb", 345); + + med.ncmm.insert (123, comp (123, "aaa")); + med.ncmm.insert (123, comp (234, "bbbb")); + med.ncmm.insert (234, comp (345, "ccccc")); + + // hash + // + med.nsh[123] = "aaa"; + med.nsh[234] = "bbbb"; + + med.snh["aaa"] = 123; + med.snh["bbb"] = 234; + + med.sch["iii"] = comp (123, "aaa"); + med.sch["jjj"] = comp (234, "bbbb"); + + // multihash + // + med.nsmh.insert (123, "aaa"); + med.nsmh.insert (123, "bbbb"); + med.nsmh.insert (234, "ccccc"); + + med.snmh.insert ("aaa", 123); + med.snmh.insert ("aaa", 234); + med.snmh.insert ("bbb", 345); + + med.ncmh.insert (123, comp (123, "aaa")); + med.ncmh.insert (123, comp (234, "bbbb")); + med.ncmh.insert (234, comp (345, "ccccc")); + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + full.nl.push_back (1234); + full.nl.push_back (2345); + full.nl.push_back (3456); + + full.cl.push_back (comp (1234, "aaaa")); + full.cl.push_back (comp (2345, "bbbbb")); + full.cl.push_back (comp (3456, "cccccc")); + + // linked list + // + full.sll.push_back ("aaaa"); + full.sll.push_back ("bbbbb"); + full.sll.push_back ("cccccc"); + + full.nll.push_back (1234); + full.nll.push_back (2345); + full.nll.push_back (3456); + + full.cll.push_back (comp (1234, "aaaa")); + full.cll.push_back (comp (2345, "bbbbb")); + full.cll.push_back (comp (3456, "cccccc")); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbb"] = 2345; + full.snm["cccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbb")] = "bbbbb"; + full.csm[comp (3456, "cccc")] = "cccccc"; + + // multimap + // + full.nsmm.insert (1234, "aaaa"); + full.nsmm.insert (1234, "bbbbb"); + full.nsmm.insert (2345, "cccccc"); + full.nsmm.insert (2345, "ddddddd"); + + full.snmm.insert ("aaaa", 1234); + full.snmm.insert ("aaaa", 2345); + full.snmm.insert ("bbbb", 3456); + full.snmm.insert ("bbbb", 4567); + + full.ncmm.insert (1234, comp (1234, "aaaa")); + full.ncmm.insert (1234, comp (2345, "bbbbb")); + full.ncmm.insert (2345, comp (3456, "cccccc")); + full.ncmm.insert (2345, comp (4567, "ddddddd")); + + // hash + // + full.nsh[1234] = "aaaa"; + full.nsh[2345] = "bbbbb"; + full.nsh[3456] = "cccccc"; + + full.snh["aaaa"] = 1234; + full.snh["bbbb"] = 2345; + full.snh["cccc"] = 3456; + + full.sch["iiii"] = comp (1234, "aaaa"); + full.sch["jjjj"] = comp (2345, "bbbbb"); + full.sch["kkkk"] = comp (3456, "cccccc"); + + // multihash + // + full.nsmh.insert (1234, "aaaa"); + full.nsmh.insert (1234, "bbbbb"); + full.nsmh.insert (2345, "cccccc"); + full.nsmh.insert (2345, "ddddddd"); + + full.snmh.insert ("aaaa", 1234); + full.snmh.insert ("aaaa", 2345); + full.snmh.insert ("bbbb", 3456); + full.snmh.insert ("bbbb", 4567); + + full.ncmh.insert (1234, comp (1234, "aaaa")); + full.ncmh.insert (1234, comp (2345, "bbbbb")); + full.ncmh.insert (2345, comp (3456, "cccccc")); + full.ncmh.insert (2345, comp (4567, "ddddddd")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + + // vector + // + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); + + // list + // + empty.sl.push_back ("aa"); + empty.nl.push_back (12); + empty.cl.push_back (comp (12, "aa")); + + // linked list + // + empty.nll.push_back (12); + empty.sll.push_back ("aa"); + empty.cll.push_back (comp (12, "aa")); + + // set + // + empty.ns.insert (12); + empty.ss.insert ("aa"); + + // map + // + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + + // multimap + // + empty.nsmm.insert (12, "aa"); + empty.nsmm.insert (12, "bbb"); + empty.nsmm.insert (23, "cccc"); + empty.snmm.insert ("aa", 12); + empty.snmm.insert ("aa", 23); + empty.snmm.insert ("bb", 34); + empty.ncmm.insert (12, comp (12, "aa")); + empty.ncmm.insert (12, comp (23, "bb")); + empty.ncmm.insert (23, comp (34, "cc")); + + // hash + // + empty.nsh[12] = "aa"; + empty.snh["aa"] = 12; + empty.sch["ii"] = comp (12, "aa"); + + // multihash + // + empty.nsmh.insert (12, "aa"); + empty.nsmh.insert (12, "bbb"); + empty.nsmh.insert (23, "cccc"); + empty.snmh.insert ("aa", 12); + empty.snmh.insert ("aa", 23); + empty.snmh.insert ("bb", 34); + empty.ncmh.insert (12, comp (12, "aa")); + empty.ncmh.insert (12, comp (23, "bb")); + empty.ncmh.insert (23, comp (34, "cc")); + + // + // med + // + + med.num = 0; + med.str = ""; + + // vector + // + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + med.uv.clear (); + + // list + // + med.sl.clear (); + med.nl.clear (); + med.cl.clear (); + + // linked list + // + med.nll.clear (); + med.sll.clear (); + med.cll.clear (); + + // set + // + med.ns.clear (); + med.ss.clear (); + + // map + // + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + + // multimap + // + med.nsmm.clear (); + med.snmm.clear (); + med.ncmm.clear (); + + // hash + // + med.nsh.clear (); + med.snh.clear (); + med.sch.clear (); + + // multihash + // + med.nsmh.clear (); + med.snmh.clear (); + med.ncmh.clear (); + + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + full.uv.back ()++; + full.uv.push_back (4567); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + full.nl.back ()++; + full.nl.push_back (4567); + + full.cl.back ().num++; + full.cl.back ().str += "c"; + full.cl.push_back (comp (4567, "ddddddd")); + + // linked list + // + full.sll.back () += "c"; + full.sll.push_back ("ddddddd"); + + full.nll.back ()++; + full.nll.push_back (4567); + + full.cll.back ().num++; + full.cll.back ().str += "c"; + full.cll.push_back (comp (4567, "ddddddd")); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + + // map + // + full.nsm[3456] += "c"; + full.nsm[4567] = "ddddddd"; + + full.snm["cccc"]++; + full.snm["dddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += "c"; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccc")] += "c"; + full.csm[comp (4567, "dddd")] = "ddddddd"; + + // multimap + // + full.nsmm.find (2345).value () += "d"; + full.nsmm.insert (3456, "eeeeeeee"); + + full.snmm.find ("bbbb").value ()++; + full.snmm.insert ("cccc", 5678); + + full.ncmm.find (1234).value ().num++; + full.ncmm.find (2345).value ().str += "d"; + full.ncmm.insert (3456, comp (5678, "eeeeeeee")); + + // hash + // + full.nsh[3456] += "c"; + full.nsh[4567] = "ddddddd"; + + full.snh["cccc"]++; + full.snh["dddd"] = 4567; + + full.sch["iiii"].num++; + full.sch["jjjj"].str += "b"; + full.sch["kkkk"] = comp (4567, "dddddddd"); + + // multihash + // + full.nsmh.find (2345).value () += "d"; + full.nsmh.insert (3456, "eeeeeeee"); + + full.snmh.find ("bbbb").value ()++; + full.snmh.insert ("cccc", 5678); + + full.ncmh.find (1234).value ().num++; + full.ncmh.find (2345).value ().str += "d"; + full.ncmh.insert (3456, comp (5678, "eeeeeeee")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile new file mode 100644 index 0000000..85aec25 --- /dev/null +++ b/qt/common/containers/makefile @@ -0,0 +1,119 @@ +# file : qt/common/containers/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/containers --profile qt/basic --generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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 schema) + $(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/qt/common/containers/test.hxx b/qt/common/containers/test.hxx new file mode 100644 index 0000000..a85b540 --- /dev/null +++ b/qt/common/containers/test.hxx @@ -0,0 +1,226 @@ +// file : qt/common/containers/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const QString& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + QString str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef QVector num_vector; +typedef QVector str_vector; +typedef QVector comp_vector; + +typedef QList num_list; +typedef QList str_list; +typedef QList comp_list; + +typedef QLinkedList num_linked_list; +typedef QLinkedList str_linked_list; +typedef QLinkedList comp_linked_list; + +typedef QSet num_set; +typedef QSet str_set; + +typedef QMap num_str_map; +typedef QMap str_num_map; +typedef QMap num_comp_map; +typedef QMap comp_str_map; + +typedef QMultiMap num_str_multimap; +typedef QMultiMap str_num_multimap; +typedef QMultiMap num_comp_multimap; + +typedef QHash num_str_hash; +typedef QHash str_num_hash; +typedef QHash str_comp_hash; + +typedef QMultiHash num_str_multihash; +typedef QMultiHash str_num_multihash; +typedef QMultiHash num_comp_multihash; + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflict" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + QString str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const QString& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + QString id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + comp_vector cv; + + #pragma db unordered + num_vector uv; + + // list + // + #pragma db transient + str_list& sl; + + num_list nl; + comp_list cl; + + // linked list + // + str_linked_list sll; + num_linked_list nll; + comp_linked_list cll; + + // set + // + num_set ns; + str_set ss; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + + // multimap + // + num_str_multimap nsmm; + str_num_multimap snmm; + num_comp_multimap ncmm; + + // hash + // + num_str_hash nsh; + str_num_hash snh; + str_comp_hash sch; + + // multihash + // + num_str_multihash nsmh; + str_num_multihash snmh; + num_comp_multihash ncmh; + + QString str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + xs == ys && + + x.sl == y.sl && + x.nl == y.nl && + x.cl == y.cl && + + x.nll == y.nll && + x.sll == y.sll && + x.cll == y.cll && + + x.ns == y.ns && + x.ss == y.ss && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + + x.nsmm.uniqueKeys () == y.nsmm.uniqueKeys () && + x.snmm.uniqueKeys () == y.snmm.uniqueKeys () && + x.ncmm.uniqueKeys () == y.ncmm.uniqueKeys () && + + x.nsh == y.nsh && + x.snh == y.snh && + x.sch == y.sch && + + x.nsmh.uniqueKeys () == y.nsmh.uniqueKeys () && + x.snmh.uniqueKeys () == y.snmh.uniqueKeys () && + x.ncmh.uniqueKeys () == y.ncmh.uniqueKeys () && + + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/qt/common/containers/test.std b/qt/common/containers/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/common/makefile b/qt/common/makefile index 4912e3c..7c4c59c 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ +containers \ smart-ptr \ template diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 56eb6bf..1d51f9c 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -23,7 +23,7 @@ using namespace std; using namespace odb::core; -// Force generation of code for all QLazySharedPointer and QLazyWeakPointer +// Force instantiation of all QLazySharedPointer and QLazyWeakPointer // class template members. // template class QLazySharedPointer; -- cgit v1.1 From cdd4151de0a2a3f0f534ae3a74f35098d3d4916e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Apr 2011 17:32:12 +0200 Subject: Remove time zone handling tests --- qt/sqlite/date-time/driver.cxx | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 277c29b..48ab63d 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -91,39 +91,6 @@ main (int argc, char* argv[]) assert (*ol2 == o2); } - // Test different time zones are handled correctly by - // QDateTime traits UNIX time implementation. - // - object o3, o4, o5; - { - // o3 is set to ct local time. o4 is set to ct UTC. o5 - // is set to o3's equivalent UTC time. - // - o3.unix_time = ct_no_ms; - - o4.unix_time = ct_no_ms; - o4.unix_time.setTimeSpec (Qt::UTC); - - o5.unix_time = ct_no_ms.toTimeSpec (Qt::UTC); - - transaction t (db->begin ()); - db->persist (o3); - db->persist (o4); - db->persist (o5); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol3 (db->load (o3.id)); - auto_ptr ol4 (db->load (o4.id)); - auto_ptr ol5 (db->load (o5.id)); - t.commit (); - - assert (ol3->unix_time != ol4->unix_time); - assert (ol3->unix_time == ol5->unix_time); - } - // Test out of range values for QDateTime traits UNIX time // implementation. // -- cgit v1.1 From e79d2cd70e5187c5305f008195b1dd9848923835 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 09:23:26 +0200 Subject: Fix test description --- qt/common/containers/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx index 507647b..6010571 100644 --- a/qt/common/containers/driver.cxx +++ b/qt/common/containers/driver.cxx @@ -3,7 +3,7 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test Qt containers. +// Test Qt containers persistence. // #include // std::auto_ptr -- cgit v1.1 From da9511bcca2aa0e96883a543a36f39313f65a9d3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 12:44:20 +0200 Subject: Link to QtCore.lib last --- qt/mysql/template/template-vc10.vcxproj | 8 ++++---- qt/mysql/template/template-vc9.vcproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj index 5981755..6acca84 100644 --- a/qt/mysql/template/template-vc10.vcxproj +++ b/qt/mysql/template/template-vc10.vcxproj @@ -93,7 +93,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;QtCored4.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;QtCored4.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;QtCore4.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;QtCore4.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj index 8bd92cb..dfc2c51 100644 --- a/qt/mysql/template/template-vc9.vcproj +++ b/qt/mysql/template/template-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Sun, 24 Apr 2011 12:53:55 +0200 Subject: Add missing directory --- test.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.bat b/test.bat index b196fcc..97f52bb 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\%1) do ( +for %%d in (tracer common %1 boost\common boost\%1 qt\common qt\%1) do ( call :run_test %%d %1 ) -- cgit v1.1 From 925fd51d3ce9082d05d35acc80881d78b3f41b99 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 12:54:32 +0200 Subject: Cosmetic changes --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 632465c..43f8dc7 100644 --- a/configure.ac +++ b/configure.ac @@ -54,12 +54,12 @@ LIBODB_BOOST([], [odb_tests_boost=no]) AM_CONDITIONAL([ODB_TESTS_BOOST], [test x$odb_tests_boost != xno]) -# Check for Qt +# Check for Qt. # odb_tests_qt=yes -LIBQTCORE([],[odb_tests_qt=no]) +LIBQTCORE([], [odb_tests_qt=no]) -# Check for libodb-qt +# Check for libodb-qt. # LIBODB_QT([], [odb_tests_qt=no]) -- cgit v1.1 From f569a30ff390ee9fcd87dadae48978004f88f5bf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 12:59:34 +0200 Subject: Remove stray space, use project from common/ instead of mysql/ --- qt/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt/makefile b/qt/makefile index bcc54c4..f5209cb 100644 --- a/qt/makefile +++ b/qt/makefile @@ -10,7 +10,7 @@ dirs := common ifeq ($(db_id),mysql) dirs += mysql -else ifeq ($(db_id), sqlite) +else ifeq ($(db_id),sqlite) dirs += sqlite endif @@ -23,7 +23,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export extra_dist := build.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) - $(call meta-vctest,mysql/qt-mysql-vc10.sln,build.bat) + $(call meta-vctest,common/qt-common-mysql-vc10.sln,build.bat) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) -- cgit v1.1 From d3c90cc12103eec4cdd6eac1edd69481c479955f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 13:02:02 +0200 Subject: Add missing parenthesis --- qt/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/build.bat b/qt/build.bat index e5401be..3f6a647 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -81,7 +81,7 @@ for %%d in (%1) do ( ) ) -for %%c in (%confs%) do +for %%c in (%confs%) do ( for %%p in (%plats%) do ( call :run_build common/qt-common-%1-vc%vcver%.sln %%c %%p ) -- cgit v1.1 From abe0ec96ca2a24c10f055839a25211bbe3b73a90 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 14:02:03 +0200 Subject: Improve autoconf test for Qt --- m4/libqt.m4 | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index b79e0a8..2ab8272 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -13,11 +13,10 @@ AC_PATH_PROG([pkg_config],[pkg-config]) AC_MSG_CHECKING([for QtCore]) -# First check for QtCore using default CPPFLAGS/LDFLAGS. +# First check for QtCore using default CPPFLAGS/LDFLAGS/LIBS. This +# test allows the user to override the QtCore library name (e.g., +# QtCored4) via the LIBS variable. # -save_LIBS="$LIBS" -LIBS="-lQtCore $LIBS" - CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include @@ -35,11 +34,68 @@ main () libqt_found=yes ]) +# Then check for QtCore using default CPPFLAGS/LDFLAGS. +# +if test x"$libqt_found" = xno; then + + save_LIBS="$LIBS" + LIBS="-lQtCore $LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + + if test x"$libqt_found" = xno; then + LIBS="$save_LIBS" + fi +fi + +# If QtCore is not found, try its versioned variant, QtCore4. +# +if test x"$libqt_found" = xno; then + + save_LIBS="$LIBS" + LIBS="-lQtCore4 $LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + + if test x"$libqt_found" = xno; then + LIBS="$save_LIBS" + fi +fi + # If default CPPFLAGS/LDFLAGS didn't work, try to discover # them using pkg-config. # if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" if test x"$pkg_config" != x; then if $pkg_config --exists QtCore; then -- cgit v1.1 From bcdc344dbf45e16ed99960dcd6392bd325ee15c1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 24 Apr 2011 18:15:48 +0200 Subject: Update installation instructions with Qt information --- INSTALL | 70 +++++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/INSTALL b/INSTALL index 4efd0ca..80ab556 100644 --- a/INSTALL +++ b/INSTALL @@ -7,12 +7,17 @@ system you would like to use. Valid values for are: 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/ - - libodb-boost (optional) http://www.codesynthesis.com/products/odb/ - - boost (optional) http://www.boost.org + +Optional: + - libodb-boost http://www.codesynthesis.com/products/odb/ + - Boost http://www.boost.org + - libodb-qt http://www.codesynthesis.com/products/odb/ + - Qt http://qt.nokia.com Building on UNIX ================ @@ -48,9 +53,8 @@ option to specify the build directory, for example: ./configure --with-odb=/tmp/odb -The configure script also expects the libodb, libodb-tracer, -libodb-, and, if you would like to build the boost profile tests, -libodb-boost and boost headers and libraries to be installed in a directory +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 @@ -60,13 +64,18 @@ locations, for example: 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, --with-libodb-, --with-libodb-boost, and ---with-boost configure options to specify their locations, for example: +--with-libodb-tracer, and --with-libodb- configure options +to specify their locations, for example: ./configure --with-libodb=/tmp/libodb -For the boost build directory the configure script expects to find the -boost libraries in the stage/lib/ subdirectory. +If you would also like to build the boost profile tests, then the +configure script should be able to find headers and libraries for +libodb-boost and Boost. Similarly, if you would like to build the qt +profile tests, then the configure script should be able to find headers +and libraries for libodb-qt and Qt. The same mechanisms as described +above can be used to specify locations of these libraries if they +cannot be discovered automatically. For each value the configure script has a set of options in the form --with--* that allow you to specify various database @@ -100,28 +109,37 @@ 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, -libodb-, and, if you would like to build the boost profile tests, -libodb-boost and boost header and import library directories to be in the +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. For boost, refer to the boost documentation. +VC++ Directories. + +If you would also like to build the boost profile tests, then the header and +import library directories for libodb-boost and Boost must be in the VC++ +Directories Include and Library search lists. Similarly, if you would like +to build the qt profile tests, then the header and import library +directories for libodb-qt and Qt must 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. For Boost and +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\, and boost\\ -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\ and boost\common\ directories they are -named common--vc.sln. And in the \ and boost\\ -directories they are named -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. - -Alternatively, you can use the build.bat batch files located in the odb-tests\ -and odb-tests\boost\ directories to build all the solutions, for all the -configurations and for all the platforms automatically. The build.bat file -has the following command line interface: +the tracer\, 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 +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. + +Alternatively, you can use the build.bat batch files located in the +odb-tests\, odb-tests\boost\, and odb-tests\qt\ directories to build all +the solutions, for all the configurations and for all the platforms +automatically. The build.bat file has the following command line interface: build.bat [/Build|/Clean|/Rebuild] -- cgit v1.1 From 5f821d47f0ee08a3a08962d0dc641326618dbf50 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2011 12:30:05 +0200 Subject: Reuse container traits from composite values --- common/inheritance/driver.cxx | 4 ++++ common/inheritance/test.hxx | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index 203e912..99dc1c5 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -29,6 +29,7 @@ main (int argc, char* argv[]) auto_ptr db (create_database (argc, argv)); base b; + b.comp_.bools.push_back (true); b.comp_.num = 10; b.comp_.str = "comp bbb"; b.comp_.nums.push_back (101); @@ -39,6 +40,7 @@ main (int argc, char* argv[]) b.strs_.push_back ("bbb two"); object1 o1; + o1.comp_.bools.push_back (false); o1.comp_.num = 11; o1.comp_.str = "comp o1o1o1"; o1.comp_.nums.push_back (111); @@ -50,6 +52,8 @@ main (int argc, char* argv[]) o1.strs_.push_back ("base o1o1o1 two"); object2 o2; + o2.comp_.bools.push_back (true); + o2.comp_.bools.push_back (false); o2.comp_.num = 12; o2.comp_.str = "comp o2o2o2"; o2.comp_.nums.push_back (121); diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx index e27ff7a..31ef9c1 100644 --- a/common/inheritance/test.hxx +++ b/common/inheritance/test.hxx @@ -12,7 +12,19 @@ #include #pragma db value -struct comp +struct comp_base +{ + std::vector bools; + + bool + operator== (const comp_base& y) const + { + return bools == y.bools; + } +}; + +#pragma db value +struct comp: comp_base { unsigned int num; std::string str; @@ -22,7 +34,11 @@ struct comp bool operator== (const comp& y) const { - return num == y.num && str == y.str && nums == y.nums; + return + static_cast (*this) == y && + num == y.num && + str == y.str && + nums == y.nums; } }; -- cgit v1.1 From 804603f33868af0450f179f66e2ddb16b84bdb80 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2011 15:02:43 +0200 Subject: Add support for abstract object types --- common/inheritance/driver.cxx | 30 ++++++++++++++++++++++ common/inheritance/test.hxx | 59 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 82 insertions(+), 7 deletions(-) diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index 99dc1c5..9bb8477 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -64,9 +64,33 @@ main (int argc, char* argv[]) o2.strs_.push_back ("base o2o2o2 one"); o2.strs_.push_back ("base o2o2o2 two"); + object3 o3; + o3.comp_.bools.push_back (false); + o3.comp_.bools.push_back (false); + o3.comp_.num = 13; + o3.comp_.str = "comp o3o3o3"; + o3.comp_.nums.push_back (131); + o3.comp_.nums.push_back (132); + o3.num_ = 3; + o3.str_ = "base o3o3o3"; + o3.strs_.push_back ("base o3o3o3 one"); + o3.strs_.push_back ("base o3o3o3 two"); + reference r; r.o1_ = &o1; + empty e; + e.comp_.bools.push_back (true); + e.comp_.bools.push_back (true); + e.comp_.num = 14; + e.comp_.str = "comp eee"; + e.comp_.nums.push_back (141); + e.comp_.nums.push_back (142); + e.num_ = 4; + e.str_ = "base eee"; + e.strs_.push_back ("base eee one"); + e.strs_.push_back ("base eee two"); + // persist // { @@ -74,7 +98,9 @@ main (int argc, char* argv[]) db->persist (b); db->persist (o1); db->persist (o2); + db->persist (o3); db->persist (r); + db->persist (e); t.commit (); } @@ -85,13 +111,17 @@ main (int argc, char* argv[]) auto_ptr lb (db->load (b.id_)); auto_ptr lo1 (db->load (o1.id_)); auto_ptr lo2 (db->load (o2.id_)); + auto_ptr lo3 (db->load (o3.id_)); + auto_ptr le (db->load (e.id_)); auto_ptr lr (db->load (r.id_)); t.commit (); assert (b == *lb); assert (o1 == *lo1); assert (o2 == *lo2); + assert (o3 == *lo3); assert (lr->o1_->id_ == r.o1_->id_); + assert (e == *le); delete lr->o1_; } diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx index 31ef9c1..5ef2ea4 100644 --- a/common/inheritance/test.hxx +++ b/common/inheritance/test.hxx @@ -42,12 +42,9 @@ struct comp: comp_base } }; -#pragma db object -struct base +#pragma db object abstract +struct abstract_base { - #pragma db id auto - unsigned long id_; - comp comp_; unsigned int num_; @@ -56,10 +53,9 @@ struct base std::vector strs_; bool - operator== (const base& y) const + operator== (const abstract_base& y) const { return - id_ == y.id_ && comp_ == y.comp_ && num_ == y.num_ && str_ == y.str_ && @@ -68,6 +64,19 @@ struct base }; #pragma db object +struct base: abstract_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const base& y) const + { + return id_ == y.id_ && static_cast (*this) == y; + } +}; + +#pragma db object struct object1: base { unsigned int num1_; @@ -92,6 +101,8 @@ struct object2: base } }; +// Reference to derived object. +// #pragma db object struct reference { @@ -101,4 +112,38 @@ struct reference object1* o1_; }; +// Multiple inheritance. +// +#pragma db object abstract +struct id_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const id_base& y) const + { + return id_ == y.id_; + } +}; + +#pragma db object +struct object3: abstract_base, id_base +{ + bool + operator== (const object3& y) const + { + return + static_cast (*this) == y && + static_cast (*this) == y; + } +}; + +// Empty derived object. +// +#pragma db object +struct empty: base +{ +}; + #endif // TEST_HXX -- cgit v1.1 From cca7bfddb2ac380481cf4445c8727f006f16f4b8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Apr 2011 16:12:29 +0200 Subject: Bump version to 1.4.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index f0bb29e..88c5fb8 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.3.0 +1.4.0 -- cgit v1.1 From f8b4329205ff7a1b965ce35e99a7943d9a82f5d4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Apr 2011 12:34:57 +0200 Subject: Use QtCore prefix when including Qt headers This appears to be more portable. For example, on Mac OS X with -framework QtCore option include does not work while including does. --- m4/libqt.m4 | 41 +++++++++++++++++++++++++++++++++++++---- qt/common/containers/test.hxx | 18 +++++++++--------- qt/common/smart-ptr/driver.cxx | 2 +- qt/mysql/basic/test.hxx | 4 ++-- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/sqlite/basic/test.hxx | 4 ++-- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/test.hxx | 2 +- 9 files changed, 55 insertions(+), 22 deletions(-) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 2ab8272..bb7ffa5 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -20,7 +20,7 @@ AC_MSG_CHECKING([for QtCore]) CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -44,7 +44,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -63,6 +63,39 @@ libqt_found=yes fi fi +# Try framework in case we are on Mac OS X. +# +if test x"$libqt_found" = xno; then + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + CPPFLAGS="$CPPFLAGS -framework QtCore" + LIBS="-framework QtCore $LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include +#include + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + + if test x"$libqt_found" = xno; then + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + fi +fi + # If QtCore is not found, try its versioned variant, QtCore4. # if test x"$libqt_found" = xno; then @@ -73,7 +106,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () @@ -111,7 +144,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include -#include +#include int main () diff --git a/qt/common/containers/test.hxx b/qt/common/containers/test.hxx index a85b540..7953d14 100644 --- a/qt/common/containers/test.hxx +++ b/qt/common/containers/test.hxx @@ -6,15 +6,15 @@ #ifndef TEST_HXX #define TEST_HXX -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 1d51f9c..ee53c57 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index 1e1f9e6..83b1396 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -6,8 +6,8 @@ #ifndef TEST_HXX #define TEST_HXX -#include -#include +#include +#include #pragma db object struct object diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index ae0643b..a6637bb 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 9eb328e..b40f45f 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index ca99d33..847e8c1 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -6,8 +6,8 @@ #ifndef TEST_HXX #define TEST_HXX -#include -#include +#include +#include #pragma db object struct object diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 48ab63d..a095aa5 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 0a140b7..7531362 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -8,7 +8,7 @@ #include -#include +#include #include -- cgit v1.1 From 06e43da76a6173a72b0450e2dadcfa73f6c04964 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Jun 2011 11:33:36 +0200 Subject: Test updating of unmodified object --- common/lifecycle/driver.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 8328700..46d145b 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -28,7 +28,7 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // transient + // Transient. // try { @@ -41,7 +41,7 @@ main (int argc, char* argv[]) { } - // persistent + // Persistent. // { object o (1); @@ -70,7 +70,7 @@ main (int argc, char* argv[]) t.commit (); } - // modified + // Modified. // { transaction t (db->begin ()); @@ -87,7 +87,16 @@ main (int argc, char* argv[]) t.commit (); } - // transient + // Update of unmodified object. + // + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + db->update (*o); + t.commit (); + } + + // Transient. // { transaction t (db->begin ()); -- cgit v1.1 From ec1213138d592489175f2246201c5e65c90af0a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Jun 2011 11:57:53 +0200 Subject: Take into account precision in MySQL FLOAT type parsing --- mysql/types/driver.cxx | 1 + mysql/types/test.hxx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 8a51dea..31ccde1 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -43,6 +43,7 @@ main (int argc, char* argv[]) o.ulong_long_ = 123456; o.float_ = 1.123F; + o.float8_ = 1.123; o.double_ = 1.123; o.decimal_ = "123.456"; diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 3039a88..a4421b3 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -139,6 +139,9 @@ struct object #pragma db type ("FLOAT NOT NULL") float float_; + #pragma db type ("FLOAT(32) NOT NULL") + double float8_; + #pragma db type ("DOUBLE NOT NULL") double double_; @@ -237,6 +240,7 @@ struct object long_long_ == y.long_long_ && ulong_long_ == y.ulong_long_ && float_ == y.float_ && + float8_ == y.float8_ && double_ == y.double_ && decimal_ == y.decimal_ && date_ == y.date_ && -- cgit v1.1 From 683eccc6887a7fa34d58e873e19b48405ebf420a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Jul 2011 17:53:47 +0200 Subject: Implement support for database operations callbacks New object pragma: callback. New test: common/callback. New manual section: 10.1.4, "callback". --- common/callback/driver.cxx | 160 +++++++++++++++++++++++++++++++++++++++++++++ common/callback/makefile | 109 ++++++++++++++++++++++++++++++ common/callback/test.hxx | 32 +++++++++ common/callback/test.std | 52 +++++++++++++++ common/makefile | 1 + 5 files changed, 354 insertions(+) create mode 100644 common/callback/driver.cxx create mode 100644 common/callback/makefile create mode 100644 common/callback/test.hxx create mode 100644 common/callback/test.std diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx new file mode 100644 index 0000000..2934737 --- /dev/null +++ b/common/callback/driver.cxx @@ -0,0 +1,160 @@ +// file : common/callback/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database operation callbacks. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +const char* events[] = +{ + "pre_persist", + "post_persist", + "pre_load", + "post_load", + "pre_update", + "post_update", + "pre_erase", + "post_erase" +}; + +void object:: +db_callback (callback_event e, database&) +{ + cout << " " << events[e] << " " << id_ << endl; +} + +void object:: +db_callback (callback_event e, database&) const +{ + cout << " " << events[e] << " " << id_ << " const" << endl; +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Persist. + // + cout << "persist" << endl; + { + object o1 (1, 1); + object const o2 (2, 2); + transaction t (db->begin ()); + db->persist (o1); + db->persist (&o2); + t.commit (); + } + cout << "***" << endl; + + // Load. + // + cout << "load" << endl; + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + object o2; + db->load (2, o2); + t.commit (); + } + cout << "***" << endl; + + // Query. + // + cout << "query" << endl; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id < 3)); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->id_ > 3) // Load. + break; + } + + t.commit (); + } + cout << "***" << endl; + + // Update. + // + cout << "update" << endl; + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + auto_ptr o2 (db->load (2)); + o1->data++; + o2->data++; + db->update (o1.get ()); + db->update (static_cast (*o2)); + t.commit (); + } + cout << "***" << endl; + + // Erase. + // + cout << "erase" << endl; + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + auto_ptr o2 (db->load (2)); + db->erase (static_cast (o1.get ())); + db->erase (*o2); + t.commit (); + } + cout << "***" << endl; + + // Delayed (recursive) load. + // + cout << "delayed load" << endl; + { + { + object o1 (1, 1); + object o2 (2, 2); + object o3 (3, 2); + + o1.pobj = &o2; + o2.pobj = &o3; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + } + } + cout << "***" << endl; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/callback/makefile b/common/callback/makefile new file mode 100644 index 0000000..640e148 --- /dev/null +++ b/common/callback/makefile @@ -0,0 +1,109 @@ +# file : common/callback/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) --generate-schema \ +--generate-query +$(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 schema) + $(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/callback/test.hxx b/common/callback/test.hxx new file mode 100644 index 0000000..274e2b5 --- /dev/null +++ b/common/callback/test.hxx @@ -0,0 +1,32 @@ +// file : common/callback/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 +#include + +#pragma db object callback(db_callback) +struct object +{ + object (unsigned long id, unsigned long d): id_ (id), data (d), pobj (0) {} + object (): id_ (0) {}; + + #pragma db id + unsigned long id_; + + unsigned long data; + + object* pobj; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; +}; + +#endif // TEST_HXX diff --git a/common/callback/test.std b/common/callback/test.std new file mode 100644 index 0000000..05ae286 --- /dev/null +++ b/common/callback/test.std @@ -0,0 +1,52 @@ +persist + pre_persist 1 + post_persist 1 + pre_persist 2 const + post_persist 2 const +*** +load + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 +*** +query + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 +*** +update + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_update 1 + post_update 1 + pre_update 2 const + post_update 2 const +*** +erase + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_erase 1 const + post_erase 1 const + pre_erase 2 + post_erase 2 +*** +delayed load + pre_persist 1 + post_persist 1 + pre_persist 2 + post_persist 2 + pre_persist 3 + post_persist 3 + pre_load 0 + pre_load 0 + pre_load 0 + post_load 3 + post_load 2 + post_load 1 +*** diff --git a/common/makefile b/common/makefile index 394f261..d2e8b0f 100644 --- a/common/makefile +++ b/common/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ +callback \ composite \ const \ container \ -- cgit v1.1 From b8d88b289aca145edbf031adbe904d877d93f3ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Jul 2011 10:50:24 +0200 Subject: Fix memory leak --- common/callback/driver.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 2934737..9ffad22 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -147,6 +147,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); auto_ptr o1 (db->load (1)); + delete o1->pobj->pobj; + delete o1->pobj; t.commit (); } } -- cgit v1.1 From bc54b4bd56c757ec1279896b8b0639a4a9a7e0cd Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 4 May 2011 17:17:59 +0200 Subject: Add test infrastructure for libodb-pgsql --- build/configure | 3 +- build/import/libodb-pgsql/LICENSE | 12 + build/import/libodb-pgsql/configuration-rules.make | 15 + build/import/libodb-pgsql/configure | 55 ++++ build/import/libodb-pgsql/stub.make | 30 ++ build/import/libpq/LICENSE | 340 +++++++++++++++++++ build/import/libpq/configuration-rules.make | 15 + build/import/libpq/configure | 81 +++++ build/import/libpq/rules.make | 31 ++ build/import/libpq/stub.make | 35 ++ build/import/libpq/version | 1 + build/pgsql/configure | 62 ++++ build/pgsql/pgsql | 52 +++ makefile | 5 + pgsql/Makefile.am | 7 + pgsql/makefile | 36 ++ pgsql/native/driver.cxx | 22 ++ pgsql/native/makefile | 84 +++++ pgsql/native/test.std | 0 pgsql/pgsql-vc10.sln | 15 + pgsql/pgsql-vc9.sln | 15 + pgsql/template/Makefile.am | 32 ++ pgsql/template/driver.cxx | 26 ++ pgsql/template/makefile | 88 +++++ pgsql/template/template-vc10.vcxproj | 180 ++++++++++ pgsql/template/template-vc10.vcxproj.filters | 25 ++ pgsql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ pgsql/template/test.hxx | 9 + pgsql/template/test.std | 1 + pgsql/test.bat | 70 ++++ 30 files changed, 1707 insertions(+), 1 deletion(-) create mode 100644 build/import/libodb-pgsql/LICENSE create mode 100644 build/import/libodb-pgsql/configuration-rules.make create mode 100755 build/import/libodb-pgsql/configure create mode 100644 build/import/libodb-pgsql/stub.make create mode 100644 build/import/libpq/LICENSE create mode 100644 build/import/libpq/configuration-rules.make create mode 100755 build/import/libpq/configure create mode 100644 build/import/libpq/rules.make create mode 100644 build/import/libpq/stub.make create mode 100644 build/import/libpq/version create mode 100755 build/pgsql/configure create mode 100755 build/pgsql/pgsql create mode 100644 pgsql/Makefile.am create mode 100644 pgsql/makefile create mode 100644 pgsql/native/driver.cxx create mode 100644 pgsql/native/makefile create mode 100644 pgsql/native/test.std create mode 100644 pgsql/pgsql-vc10.sln create mode 100644 pgsql/pgsql-vc9.sln create mode 100644 pgsql/template/Makefile.am create mode 100644 pgsql/template/driver.cxx create mode 100644 pgsql/template/makefile create mode 100644 pgsql/template/template-vc10.vcxproj create mode 100644 pgsql/template/template-vc10.vcxproj.filters create mode 100644 pgsql/template/template-vc9.vcproj create mode 100644 pgsql/template/test.hxx create mode 100644 pgsql/template/test.std create mode 100644 pgsql/test.bat diff --git a/build/configure b/build/configure index 2fc7846..76d39a7 100755 --- a/build/configure +++ b/build/configure @@ -24,9 +24,10 @@ $echo "Please select the database you would like to use:" $echo $echo "(1) MySQL" $echo "(2) SQLite" +$echo "(3) PostgresSQL" $echo -db_id=`read_option "mysql sqlite"` +db_id=`read_option "mysql sqlite pgsql"` echo "db_id := $db_id" >$1 diff --git a/build/import/libodb-pgsql/LICENSE b/build/import/libodb-pgsql/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-pgsql/LICENSE @@ -0,0 +1,12 @@ +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-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make new file mode 100644 index 0000000..307a8f6 --- /dev/null +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-pgsql/configuration-rules.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. + $(call message,,$(scf_root)/import/libodb-pgsql/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure new file mode 100755 index 0000000..3315781 --- /dev/null +++ b/build/import/libodb-pgsql/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-pgsql/configure +# author : Constantin Michael +# 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-pgsql' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-pgsql' 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-pgsql'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-pgsql'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_pgsql_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-pgsql/stub.make b/build/import/libodb-pgsql/stub.make new file mode 100644 index 0000000..fed0f02 --- /dev/null +++ b/build/import/libodb-pgsql/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-pgsql/stub.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) + +libodb_pgsql_installed := + +$(call -include,$(dcf_root)/import/libodb-pgsql/configuration-dynamic.make) + +ifdef libodb_pgsql_installed + +ifeq ($(libodb_pgsql_installed),y) + +$(call export,l: -lodb-pgsql -lodb -lpq,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-pgsql/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libpq/LICENSE b/build/import/libpq/LICENSE new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/build/import/libpq/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 more 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/build/import/libpq/configuration-rules.make b/build/import/libpq/configuration-rules.make new file mode 100644 index 0000000..c4b1326 --- /dev/null +++ b/build/import/libpq/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libpq/configuration-rules.make +# author : Constantin Michael +# copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libpq/configuration-dynamic.make: | $(dcf_root)/import/libpq/. + $(call message,,$(scf_root)/import/libpq/configure $@) + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/libpq/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libpq/configuration-dynamic.make) + +endif diff --git a/build/import/libpq/configure b/build/import/libpq/configure new file mode 100755 index 0000000..8e2210f --- /dev/null +++ b/build/import/libpq/configure @@ -0,0 +1,81 @@ +#! /usr/bin/env bash + +# file : build/import/libpq/configure +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + + +# $1 - out config file +# +# bld_root - build root +# project_name - project name +# + +source $bld_root/dialog.bash + + +$echo +$echo "Configuring external dependency on 'PostgreSQL library' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'PostgreSQL library' as opposed to the development build?" +$echo + +installed=`read_y_n y` + +path= +type= + +if [ "$installed" = "n" ]; then + + $echo + $echo "Please enter the 'PostgreSQL' root directory." + $echo + + root=`read_path --directory --exist` + + $echo + $echo "Please select the library type you would like to use:" + $echo + $echo "(1) archive" + $echo "(2) shared object" + $echo + + type=`read_option "archive shared" "shared"` + +else + + pq_libs=-lpq + + if pg_config --version > /dev/null 2>&1; then + + pq_cppflags=-I`pg_config --includedir` + + else + $echo + $echo "Unable to discover installed 'PostgreSQL libraries' using pg_config." + $echo "Assuming the C++ compiler will find them automatically." + $echo + + pq_cppflags= + + fi + +fi + +echo libpq_installed := $installed >$1 + +if [ "$installed" = "n" ]; then + + echo libpq_root := $root >>$1 + echo libpq_type := $type >>$1 + +else + + echo pq_cppflags := $pq_cppflags >>$1 + echo pq_libs := $pq_libs >>$1 + +fi diff --git a/build/import/libpq/rules.make b/build/import/libpq/rules.make new file mode 100644 index 0000000..85cc659 --- /dev/null +++ b/build/import/libpq/rules.make @@ -0,0 +1,31 @@ +# file : build/import/libpq/rules.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(dcf_root)/import/libpq/%: root := $(libpq_root) + +ifeq ($(libpq_type),archive) + +$(dcf_root)/import/libpq/pq.l: $(libpq_root)/libpq/.libs/libpq.a + @echo $< >$@ +else + +$(dcf_root)/import/libpq/pq.l: $(libpq_root)/libpq/.libs/libpq.so + @echo $< >$@ + @echo rpath:$(root)/libpq/.libs >>$@ +endif + +$(dcf_root)/import/libpq/pq.l.cpp-options: + @ln -s $(root)/include $(dcf_root)/import/libpq/pq + @echo include: -I$(dcf_root)/import/libpq >$@ + +ifndef %foreign% + +disfigure:: + $(call message,rm $(dcf_root)/import/pq/pq.l,\ +rm -f $(dcf_root)/import/pq/pq.l) + $(call message,,rm -f $(dcf_root)/import/libpq/pq) + $(call message,,rm -f $(dcf_root)/import/libpq/pq.l.cpp-options) + +endif diff --git a/build/import/libpq/stub.make b/build/import/libpq/stub.make new file mode 100644 index 0000000..d12abaa --- /dev/null +++ b/build/import/libpq/stub.make @@ -0,0 +1,35 @@ +# file : build/import/libpq/stub.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libpq/configuration-rules.make,$(dcf_root)) + +libpq_installed := + +$(call -include,$(dcf_root)/import/libpq/configuration-dynamic.make) + +ifdef libpq_installed + +ifeq ($(libpq_installed),y) + +$(call export,\ + l: $(pq_libs),\ + cpp-options: ,\ + cpp-options-inline: $(pq_cppflags)) + +else + +$(call include-once,$(scf_root)/import/libpq/rules.make,$(dcf_root)) + +$(call export,\ + l: $(dcf_root)/import/libpq/pq.l,\ + cpp-options: $(dcf_root)/import/libpq/pq.l.cpp-options) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/import/libpq/version b/build/import/libpq/version new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/build/import/libpq/version @@ -0,0 +1 @@ +0.1.0 diff --git a/build/pgsql/configure b/build/pgsql/configure new file mode 100755 index 0000000..cd500a2 --- /dev/null +++ b/build/pgsql/configure @@ -0,0 +1,62 @@ +#! /usr/bin/env bash + +# file : build/pgsql/configure +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +$echo +$echo "Please enter the PostgreSQL client program path." +$echo + +driver=`read_path --command psql` + +$echo +$echo "Please enter the PostgreSQL database user." +$echo + +user=`read_value "odb_test"` + +$echo +$echo "Please enter the PostgreSQL database password." +$echo + +passwd=`read_value ""` + +$echo +$echo "Please enter the PostgreSQL database name. Note that it WILL BE" +$echo "MODIFIED by the tests." +$echo + +db=`read_value "odb_test"` + +$echo +$echo "Please enter the PostgreSQL database host." +$echo + +host=`read_value ""` + +$echo +$echo "Please enter the PostgreSQL database port or the socket file name" +$echo "extension for Unix-domain connections." +$echo + +port=`read_value "0"` + +opt=$dcf_root/db.options +drv=$dcf_root/db-driver + +echo "--user '$user'" >$opt +echo "--password '$passwd'" >>$opt +echo "--dbname '$db'" >>$opt +echo "--host '$host'" >>$opt +echo "--port $port" >>$opt + +echo "#!/bin/sh" >$drv +echo "opt=\`cat $opt\`" >>$drv +echo "eval $scf_root/pgsql/pgsql --driver $driver \$opt \$*" >>$drv +chmod 755 $drv diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql new file mode 100755 index 0000000..9e576ff --- /dev/null +++ b/build/pgsql/pgsql @@ -0,0 +1,52 @@ +#! /usr/bin/env bash + +# file : build/mysql/pgsql +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# PostgreSQL driver wrapper. +# + +while [ $# -gt 0 ]; do + case $1 in + --driver) + driver=$2 + shift 2 + ;; + --user) + opt="$opt --user=$2" + shift 2 + ;; + --password) + opt="$opt --password=$2" + shift 2 + ;; + --dbname) + opt="$opt --dbname=$2" + shift 2 + ;; + --host) + opt="$opt --host=$2" + shift 2 + ;; + --port) + opt="$opt --port=$2" + shift 2 + ;; + *) + break + ;; + esac +done + +if [ -z "$driver" ]; then + driver=psql +fi + +if [ -n "$1" ]; then + exec $driver $opt <$1 +else + exec $driver $opt +fi diff --git a/makefile b/makefile index 2942831..727e1a7 100644 --- a/makefile +++ b/makefile @@ -16,6 +16,11 @@ ifeq ($(db_id),sqlite) dirs += sqlite endif +ifeq ($(db_id),pgsql) +alldirs := pgsql +dirs := pgsql +endif + default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am new file mode 100644 index 0000000..11dd4cc --- /dev/null +++ b/pgsql/Makefile.am @@ -0,0 +1,7 @@ +# file : pgsql/Makefile.am +# author : Constantin Michael +# 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) diff --git a/pgsql/makefile b/pgsql/makefile new file mode 100644 index 0000000..34ac15f --- /dev/null +++ b/pgsql/makefile @@ -0,0 +1,36 @@ +# file : pgsql/makefile +# author : Constantin Michael +# 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 \ +native + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := pgsql +$(dist): export dirs := $(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/pgsql/native/driver.cxx b/pgsql/native/driver.cxx new file mode 100644 index 0000000..79ed08c --- /dev/null +++ b/pgsql/native/driver.cxx @@ -0,0 +1,22 @@ +// file : pgsql/native/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include + +using namespace std; + +int +main () +{ + return 0; +} + diff --git a/pgsql/native/makefile b/pgsql/native/makefile new file mode 100644 index 0000000..2e7900d --- /dev/null +++ b/pgsql/native/makefile @@ -0,0 +1,84 @@ +# file : pgsql/native/makefile +# author : Constantin Michael +# 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-pgsql/stub.make,\ + l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_pgsql.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 $<,$< --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)) + $(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/pgsql/native/test.std b/pgsql/native/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/pgsql-vc10.sln b/pgsql/pgsql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/pgsql/pgsql-vc10.sln @@ -0,0 +1,15 @@ + +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/pgsql/pgsql-vc9.sln b/pgsql/pgsql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/pgsql/pgsql-vc9.sln @@ -0,0 +1,15 @@ + +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/pgsql/template/Makefile.am b/pgsql/template/Makefile.am new file mode 100644 index 0000000..9781646 --- /dev/null +++ b/pgsql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : pgsql/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/pgsql/template/driver.cxx b/pgsql/template/driver.cxx new file mode 100644 index 0000000..1ebb890 --- /dev/null +++ b/pgsql/template/driver.cxx @@ -0,0 +1,26 @@ +// file : pgsql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +using namespace std; + +int +main () +{ + try + { + cout << "test 001" << endl; + } + catch (...) + { + return 1; + } +} diff --git a/pgsql/template/makefile b/pgsql/template/makefile new file mode 100644 index 0000000..b422eb7 --- /dev/null +++ b/pgsql/template/makefile @@ -0,0 +1,88 @@ +# file : pgsql/template/makefile +# author : Constantin Michael +# 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/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): + +$(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)/pgsql/,,$(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 schema) + $(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) diff --git a/pgsql/template/template-vc10.vcxproj b/pgsql/template/template-vc10.vcxproj new file mode 100644 index 0000000..6e5aa8a --- /dev/null +++ b/pgsql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.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/pgsql/template/template-vc10.vcxproj.filters b/pgsql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/pgsql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/pgsql/template/template-vc9.vcproj b/pgsql/template/template-vc9.vcproj new file mode 100644 index 0000000..835c472 --- /dev/null +++ b/pgsql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/pgsql/template/test.hxx b/pgsql/template/test.hxx new file mode 100644 index 0000000..a142b7f --- /dev/null +++ b/pgsql/template/test.hxx @@ -0,0 +1,9 @@ +// file : pgsql/template/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#endif // TEST_HXX diff --git a/pgsql/template/test.std b/pgsql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/pgsql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/pgsql/test.bat b/pgsql/test.bat new file mode 100644 index 0000000..4075d5c --- /dev/null +++ b/pgsql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : pgsql/test.bat +rem author : Constantin Michael +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 pgsql %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 -- cgit v1.1 From 5a33e95f54200e5a2cfbfd0f1584b45aa0a44105 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 12 May 2011 11:11:45 +0200 Subject: Add pgsql section to create_database --- libcommon/common/common.cxx | 14 ++++++++++++++ libcommon/common/makefile | 3 +++ 2 files changed, 17 insertions(+) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a6fa4e1..37f8424 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -18,6 +18,9 @@ # include # include # include +#elif defined(DATABASE_PGSQL) +# include +# include #else # error unknown database #endif @@ -31,6 +34,8 @@ using namespace odb::core; namespace mysql = odb::mysql; #elif defined(DATABASE_SQLITE) namespace sqlite = odb::sqlite; +#elif defined(DATABASE_PGSQL) +namespace pgsql = odb::pgsql; #endif auto_ptr @@ -52,6 +57,8 @@ create_database (int& argc, mysql::database::print_usage (cerr); #elif defined(DATABASE_SQLITE) sqlite::database::print_usage (cerr); +#elif defined(DATABASE_PGSQL) + pgsql::database::print_usage (cerr); #endif exit (0); @@ -84,6 +91,13 @@ create_database (int& argc, schema_catalog::create_schema (*db); t.commit (); } +#elif defined(DATABASE_PGSQL) + auto_ptr f; + + if (max_connections != 0) + f.reset (new pgsql::connection_pool_factory (max_connections)); + + db.reset (new pgsql::database (argc, argv, false, "", f)); #endif return db; diff --git a/libcommon/common/makefile b/libcommon/common/makefile index ae7d2ce..326f1f6 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -55,6 +55,9 @@ endif ifeq ($(db_id),sqlite) @echo '#define DATABASE_SQLITE 1' >>$@ endif +ifeq ($(db_id),pgsql) + @echo '#define DATABASE_PGSQL 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ -- cgit v1.1 From 1bea2748804e93f7b29c76a5504c27c0423e30b5 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 12 May 2011 11:12:27 +0200 Subject: Implement pgsql native test --- pgsql/native/driver.cxx | 51 ++++++++++++++++++++++++++++++++++++++++++++++--- pgsql/native/makefile | 7 +++++-- pgsql/template/makefile | 22 ++++++++++++++++++--- 3 files changed, 72 insertions(+), 8 deletions(-) diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 79ed08c..30e707c 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -3,7 +3,7 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test native SQL execution. +// Test PostgreSQL native SQL execution. // #include // std::auto_ptr @@ -12,11 +12,56 @@ #include +#include + using namespace std; +using namespace odb::core; int -main () +main (int argc, char* argv[]) { + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS test"); + db->execute ("CREATE TABLE test (n INT PRIMARY KEY)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); + assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + + t.commit (); + } + + // select a few rows. + // + { + transaction t (db->begin ()); + + assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); + assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } + return 0; } - diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 2e7900d..95eb060 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -9,6 +9,9 @@ cxx_tun := driver.cxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + driver := $(out_base)/driver dist := $(out_base)/.dist test := $(out_base)/.test @@ -22,9 +25,9 @@ $(call import,\ # Build. # -$(driver): $(cxx_obj) $(odb_pgsql.l) +$(driver): $(cxx_obj) $(odb_pgsql.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) +$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) $(common.l.cpp-options) $(call include-dep,$(cxx_od)) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index b422eb7..6dc0aad 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -6,9 +6,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx +odb_hdr := cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + driver := $(out_base)/driver dist := $(out_base)/.dist test := $(out_base)/.test @@ -22,9 +26,18 @@ $(call import,\ # Build. # -$(driver): $(cxx_obj) +$(driver): $(cxx_obj) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): +$(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 pgsql --generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -49,7 +62,6 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema) $(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) @@ -86,3 +98,7 @@ $(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) -- cgit v1.1 From 337446204c4b86b40ad83235cb956422158e7fec Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Jul 2011 19:55:31 +0200 Subject: Add traits for PostgreSQL query test --- common/query/traits-pgsql.hxx | 59 +++++++++++++++++++++++++++++++++++++++++++ common/query/traits.hxx | 2 ++ 2 files changed, 61 insertions(+) create mode 100644 common/query/traits-pgsql.hxx diff --git a/common/query/traits-pgsql.hxx b/common/query/traits-pgsql.hxx new file mode 100644 index 0000000..5b5c5d3 --- /dev/null +++ b/common/query/traits-pgsql.hxx @@ -0,0 +1,59 @@ +// file : common/query/traits-pgsql.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_PGSQL_HXX +#define TRAITS_PGSQL_HXX + +#include +#include // std::auto_ptr +#include // std::memcpy + +#include + +namespace odb +{ + namespace pgsql + { + template <> + class value_traits, id_string> + { + public: + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (std::auto_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_PGSQL_HXX diff --git a/common/query/traits.hxx b/common/query/traits.hxx index ce8b3e6..ccc279b 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -12,6 +12,8 @@ # include "traits-mysql.hxx" #elif defined(DATABASE_SQLITE) # include "traits-sqlite.hxx" +#elif defined(DATABASE_PGSQL) +# include "traits-pgsql.hxx" #endif #endif // TRAITS_HXX -- cgit v1.1 From de602975ce7b652c620b7888cf8ba2e59c6709f0 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Jul 2011 19:56:23 +0200 Subject: Remove UNSIGNED SQL qualifier to allow PostgreSQL to pass schema test --- common/schema/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 16875be..45ffe9a 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -69,7 +69,7 @@ struct type double d; std::string str; - #pragma db type ("INTEGER UNSIGNED") + #pragma db type ("INTEGER") bool m1; #pragma db transient -- cgit v1.1 From 8c6f77a8b0d499ce12322d6f4c67193b7d6f61c7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Jul 2011 19:59:34 +0200 Subject: Update PostgreSQL configuration script --- build/pgsql/configure | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build/pgsql/configure b/build/pgsql/configure index cd500a2..990472d 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -16,18 +16,14 @@ $echo driver=`read_path --command psql` $echo -$echo "Please enter the PostgreSQL database user." +$echo "Please enter the PostgreSQL database user. Note that the named" +$echo "user must be allowed to connect to the database server without" +$echo "specifying credentials." $echo user=`read_value "odb_test"` $echo -$echo "Please enter the PostgreSQL database password." -$echo - -passwd=`read_value ""` - -$echo $echo "Please enter the PostgreSQL database name. Note that it WILL BE" $echo "MODIFIED by the tests." $echo @@ -38,20 +34,19 @@ $echo $echo "Please enter the PostgreSQL database host." $echo -host=`read_value ""` +host=`read_value "localhost"` $echo $echo "Please enter the PostgreSQL database port or the socket file name" $echo "extension for Unix-domain connections." $echo -port=`read_value "0"` +port=`read_value "5432"` opt=$dcf_root/db.options drv=$dcf_root/db-driver echo "--user '$user'" >$opt -echo "--password '$passwd'" >>$opt echo "--dbname '$db'" >>$opt echo "--host '$host'" >>$opt echo "--port $port" >>$opt -- cgit v1.1 From 3538672b958f19ced5c4a1f6be3571171d4ae3f7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 8 Jul 2011 14:20:24 +0200 Subject: Remove password option processing from PostgreSQL test client driver --- build/pgsql/pgsql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 9e576ff..2cc04cd 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -19,10 +19,6 @@ while [ $# -gt 0 ]; do opt="$opt --user=$2" shift 2 ;; - --password) - opt="$opt --password=$2" - shift 2 - ;; --dbname) opt="$opt --dbname=$2" shift 2 -- cgit v1.1 From 0b2c1d180ebaa5916c4eea07729acd93335633a4 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 8 Jul 2011 14:21:25 +0200 Subject: Add quiet options to PostgreSQL test client driver --- build/pgsql/pgsql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 2cc04cd..299106b 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -41,6 +41,10 @@ if [ -z "$driver" ]; then driver=psql fi +opt="--quiet $opt" + +export PGOPTIONS=--client-min-messages=warning + if [ -n "$1" ]; then exec $driver $opt <$1 else -- cgit v1.1 From 53ff76c42ef5655445eaff8684dbb4b0bd83488e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 8 Jul 2011 14:22:06 +0200 Subject: Update makefile to include PostgreSQL tests --- makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 727e1a7..f05edb5 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql sqlite boost qt +all_dirs := libcommon common tracer mysql sqlite pgsql boost qt dirs := common tracer boost qt ifeq ($(db_id),mysql) @@ -17,8 +17,7 @@ dirs += sqlite endif ifeq ($(db_id),pgsql) -alldirs := pgsql -dirs := pgsql +dirs += pgsql endif default := $(out_base)/ -- cgit v1.1 From 05030f085ba2cc2f3df951ee454619bc236891a0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Jul 2011 12:11:17 +0200 Subject: Order results by id to get consistent test output order --- common/callback/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 9ffad22..3dfbc79 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -85,7 +85,7 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::id < 3)); + result r (db->query ((query::id < 3) + "ORDER BY id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { -- cgit v1.1 From e625e4211a28115075d75506ef3102601b4301f5 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 12 Jul 2011 15:27:20 +0200 Subject: Configure pgsql tests to use Unix-domain sockets by default --- build/pgsql/configure | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/pgsql/configure b/build/pgsql/configure index 990472d..31edb53 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -31,17 +31,19 @@ $echo db=`read_value "odb_test"` $echo -$echo "Please enter the PostgreSQL database host." -$echo +$echo "Please enter the PostgreSQL database host. Leaving this field" +$echo "results in connecting to a Unix-domain socket using the server's" +$echo "default location, usually /tmp. Machines without Unix-domain" +$echo "sockets will connect to localhost." -host=`read_value "localhost"` +host=`read_value ""` $echo $echo "Please enter the PostgreSQL database port or the socket file name" $echo "extension for Unix-domain connections." $echo -port=`read_value "5432"` +port=`read_value ""` opt=$dcf_root/db.options drv=$dcf_root/db-driver -- cgit v1.1 From e0ddbcc0aa0b9bf8f81efe5b017c66120f995547 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 12 Jul 2011 15:30:28 +0200 Subject: Aesthetic changes and spelling corrections to pgsql test configuration --- build/configure | 2 +- build/pgsql/pgsql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/configure b/build/configure index 76d39a7..70413fc 100755 --- a/build/configure +++ b/build/configure @@ -24,7 +24,7 @@ $echo "Please select the database you would like to use:" $echo $echo "(1) MySQL" $echo "(2) SQLite" -$echo "(3) PostgresSQL" +$echo "(3) PostgreSQL" $echo db_id=`read_option "mysql sqlite pgsql"` diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 299106b..c1c2482 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# file : build/mysql/pgsql +# file : build/pgsql/pgsql # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -19,7 +19,7 @@ while [ $# -gt 0 ]; do opt="$opt --user=$2" shift 2 ;; - --dbname) + --database) opt="$opt --dbname=$2" shift 2 ;; -- cgit v1.1 From 5ea55acce8ae8bc0361696ed2ff413eefaf89a8e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 12 Jul 2011 18:42:17 +0200 Subject: Add PostgreSQL types and truncation tests --- pgsql/makefile | 4 +- pgsql/truncation/driver.cxx | 163 ++++++++++++++++++++++++++++++++++ pgsql/truncation/makefile | 106 ++++++++++++++++++++++ pgsql/truncation/test.hxx | 49 +++++++++++ pgsql/truncation/test.std | 0 pgsql/types/driver.cxx | 90 +++++++++++++++++++ pgsql/types/makefile | 112 ++++++++++++++++++++++++ pgsql/types/test.hxx | 158 +++++++++++++++++++++++++++++++++ pgsql/types/test.std | 0 pgsql/types/traits.hxx | 208 ++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 889 insertions(+), 1 deletion(-) create mode 100644 pgsql/truncation/driver.cxx create mode 100644 pgsql/truncation/makefile create mode 100644 pgsql/truncation/test.hxx create mode 100644 pgsql/truncation/test.std create mode 100644 pgsql/types/driver.cxx create mode 100644 pgsql/types/makefile create mode 100644 pgsql/types/test.hxx create mode 100644 pgsql/types/test.std create mode 100644 pgsql/types/traits.hxx diff --git a/pgsql/makefile b/pgsql/makefile index 34ac15f..1fee285 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -7,7 +7,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ -native +native \ +truncation \ +types default := $(out_base)/ dist := $(out_base)/.dist diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx new file mode 100644 index 0000000..bbfa99e --- /dev/null +++ b/pgsql/truncation/driver.cxx @@ -0,0 +1,163 @@ +// file : pgsql/truncation/driver.cxx +// author : Boris Kolpackov +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + + try + { + // Test basic operations. + // + { + auto_ptr db (create_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + + // Test query. + // + { + typedef odb::query query; + typedef odb::result result; + + auto_ptr db (create_database (argc, argv)); + + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); + + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } + + // Test buffer growth with cached result. + // + { + object1 o; + + transaction t (db->begin ()); + + result r (db->query (query::id >= 20)); + result::iterator i (r.begin ()); + + o.id_ = i->id_; + o.str_ = long_str; + + // This forces buffer growth in the middle of result iteration. + // + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile new file mode 100644 index 0000000..a94639d --- /dev/null +++ b/pgsql/truncation/makefile @@ -0,0 +1,106 @@ +# file : pgsql/truncation/makefile +# author : Constantin Michael +# 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 pgsql --generate-query \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(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 schema) + $(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/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx new file mode 100644 index 0000000..0cd2852 --- /dev/null +++ b/pgsql/truncation/test.hxx @@ -0,0 +1,49 @@ +// file : mysql/truncation/test.hxx +// author : Boris Kolpackov +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object table ("test") +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object table ("test") +struct object2 +{ + object2 (unsigned long id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/pgsql/truncation/test.std b/pgsql/truncation/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx new file mode 100644 index 0000000..5c5145a --- /dev/null +++ b/pgsql/types/driver.cxx @@ -0,0 +1,90 @@ +// file : pgsql/types/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + + o.bool_ = true; + o.short_ = 12345; + o.int_ = -123456; + o.long_long_ = 123456; + + o.float_ = 1.123F; + o.float8_ = 1.123; + o.double_ = 1.123; + // o.numeric_ = "123.456"; + + o.date_ = 4015; + o.time_ = 48180000000; + o.timestamp_ = 346896000; + + string short_str (128, 's'); + string medium_str (250, 'm'); + string long_str (2040, 'l'); + buffer long_buf (long_str.c_str (), long_str.size ()); + + unsigned char varbit_buf[8] = {1, 2, 1, 2, 1, 1, 1, 1}; + + o.char_ = short_str; + o.varchar_ = medium_str; + o.text_ = long_str; + o.bytea_ = long_buf; + o.varbit_ = buffer (varbit_buf, 8); + + o.bit_.a = 0; + o.bit_.b = 1; + o.bit_.c = 0; + o.bit_.d = 1; + + o.enum_ = green; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/types/makefile b/pgsql/types/makefile new file mode 100644 index 0000000..88fdb4a --- /dev/null +++ b/pgsql/types/makefile @@ -0,0 +1,112 @@ +# file : pgsql/types/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-pgsql/stub.make,\ + l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_pgsql.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) $(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 pgsql --generate-schema \ +--generate-query --cxx-prologue '\#include "traits.hxx"' + +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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/pgsql/types/test.hxx b/pgsql/types/test.hxx new file mode 100644 index 0000000..39de674 --- /dev/null +++ b/pgsql/types/test.hxx @@ -0,0 +1,158 @@ +// file : pgsql/types/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::auto_ptr +#include // std::memcmp + +#include + +#include + +struct bitfield +{ + unsigned int a: 1; + unsigned int b: 1; + unsigned int c: 1; + unsigned int d: 1; +}; + +inline bool +operator== (bitfield x, bitfield y) +{ + return + x.a == y.a && + x.b == y.b && + x.c == y.c && + x.d == y.d; +} + +#pragma db value(bitfield) type ("BIT(4) NOT NULL") + +typedef std::auto_ptr string_ptr; + +enum color {red, green, blue}; + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + // Integral types. + // + #pragma db type ("BOOL NOT NULL") + bool bool_; + + #pragma db type ("SMALLINT NOT NULL") + short short_; + + #pragma db type ("INT NOT NULL") + int int_; + + #pragma db type ("BIGINT NOT NULL") + long long long_long_; + + // Float types. + // + #pragma db type ("REAL NOT NULL") + float float_; + + #pragma db type ("FLOAT(32) NOT NULL") + double float8_; + + #pragma db type ("DOUBLE PRECISION NOT NULL") + double double_; + + // #pragma db type ("NUMERIC(6,3) NOT NULL") + // std::string numeric_; + + // Data-time types. + // + #pragma db type ("DATE NOT NULL") + int date_; + + #pragma db type ("TIME NOT NULL") + long long time_; + + #pragma db type ("TIMESTAMP NOT NULL") + long long timestamp_; + + // String and binary types. + // + #pragma db type ("CHAR(128) NOT NULL") + std::string char_; + + #pragma db type ("VARCHAR(256) NOT NULL") + std::string varchar_; + + #pragma db type ("TEXT NOT NULL") + std::string text_; + + #pragma db type ("BYTEA NOT NULL") + buffer bytea_; + + #pragma db type ("VARBIT(1024) NOT NULL") + buffer varbit_; + + // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value + bitfield bit_; + + // Other types. + // + #pragma db type ("UUID NOT NULL") + unsigned char uuid_[16]; + + // Test ENUM representation. + // + color enum_; + + // Test NULL value. + // + #pragma db type ("TEXT") + string_ptr null_; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bool_ == y.bool_ && + short_ == y.short_ && + int_ == y.int_ && + long_long_ == y.long_long_ && + float_ == y.float_ && + float8_ == y.float8_ && + double_ == y.double_ && + // numeric__ == y.numeric_ && + date_ == y.date_ && + time_ == y.time_ && + timestamp_ == y.timestamp_ && + char_ == y.char_ && + varchar_ == y.varchar_ && + text_ == y.text_ && + bytea_ == y.bytea_ && + bit_ == y.bit_ && + varbit_ == y.varbit_ && + memcmp (uuid_, y.uuid_, 16) == 0 && + enum_ == y.enum_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +#endif // TEST_HXX diff --git a/pgsql/types/test.std b/pgsql/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx new file mode 100644 index 0000000..b7734b5 --- /dev/null +++ b/pgsql/types/traits.hxx @@ -0,0 +1,208 @@ +// file : pgsql/types/traits.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::memcpy, std::memset + +#include +#include + +#include "test.hxx" // date_time, buffer, string_ptr + +namespace odb +{ + namespace pgsql + { + template <> + class value_traits + { + public: + typedef buffer value_type; + typedef buffer query_type; + typedef details::buffer image_type; + + static void + set_value (buffer& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + v.assign (b.data (), n); + else + v.assign (0, 0); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const buffer& v) + { + is_null = false; + n = v.size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v.data (), n); + } + }; + + template <> + class value_traits + { + public: + typedef bitfield value_type; + typedef bitfield query_type; + typedef unsigned char* image_type; + + static void + set_value (bitfield& v, + const unsigned char* i, + std::size_t, + bool is_null) + { + if (!is_null) + { + unsigned char const* d = i + 4; + + v.a = *d >> 4 & 1; + v.b = (*d >> 5) & 1; + v.c = (*d >> 6) & 1; + v.d = (*d >> 7) & 1; + } + else + v.a = v.b = v.c = v.d = 0; + } + + static void + set_image (unsigned char* i, + std::size_t, + std::size_t& n, + bool& is_null, + bitfield v) + { + is_null = false; + n = 5; + + *reinterpret_cast (i) = details::endian_traits::hton (4); + *(i + 4) = v.a << 4 | (v.b << 5) | (v.c << 6) | (v.d << 7); + } + }; + + template <> + class value_traits + { + public: + typedef buffer value_type; + typedef buffer query_type; + typedef details::ubuffer image_type; + + static void + set_value (buffer& v, + const details::ubuffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + v.assign (b.data () + 4, n - 4); + else + v.assign (0, 0); + } + + static void + set_image (details::ubuffer& b, + std::size_t& n, + bool& is_null, + const buffer& v) + { + is_null = false; + n = v.size () + 4; + + if (n > b.capacity ()) + b.capacity (n); + + int bit_len = static_cast (v.size () * 8); + + *reinterpret_cast (b.data ()) = + details::endian_traits::hton (bit_len); + + if (bit_len != 0) + std::memcpy (b.data () + 4, v.data (), v.size ()); + } + }; + + template <> + class value_traits + { + public: + typedef unsigned char* value_type; + typedef details::ubuffer query_type; + typedef unsigned char* image_type; + + static void + set_value (unsigned char v[16], + unsigned char const* i, + bool is_null) + { + if (!is_null) + std::memcpy (v, i, 16); + else + std::memset (v, 0, 16); + } + + static void + set_image (unsigned char* i, bool& is_null, unsigned char const v[16]) + { + is_null = false; + std::memcpy (i, v, 16); + } + }; + + template <> + class value_traits + { + public: + typedef string_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (string_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const string_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX -- cgit v1.1 From 17ef17f80abf35c63add4152a3e9e067fffa40b7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 13 Jul 2011 09:57:57 +0200 Subject: Allow for selective building of profile tests dependent on database --- makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index f05edb5..d01f253 100644 --- a/makefile +++ b/makefile @@ -6,14 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make all_dirs := libcommon common tracer mysql sqlite pgsql boost qt -dirs := common tracer boost qt +dirs := common tracer ifeq ($(db_id),mysql) -dirs += mysql +dirs += boost qt mysql endif ifeq ($(db_id),sqlite) -dirs += sqlite +dirs += boost qt sqlite endif ifeq ($(db_id),pgsql) -- cgit v1.1 From 02608da1f2c313cf02eae3d589aa229b076caecd Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 13 Jul 2011 09:59:48 +0200 Subject: Correct configuration script --- build/pgsql/configure | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/pgsql/configure b/build/pgsql/configure index 31edb53..11f419e 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -32,9 +32,8 @@ db=`read_value "odb_test"` $echo $echo "Please enter the PostgreSQL database host. Leaving this field" -$echo "results in connecting to a Unix-domain socket using the server's" -$echo "default location, usually /tmp. Machines without Unix-domain" -$echo "sockets will connect to localhost." +$echo "blank results in using Unix-domain socket. Machines without" +$echo "Unix-domain sockets will connect to localhost." host=`read_value ""` @@ -49,9 +48,9 @@ opt=$dcf_root/db.options drv=$dcf_root/db-driver echo "--user '$user'" >$opt -echo "--dbname '$db'" >>$opt +echo "--database '$db'" >>$opt echo "--host '$host'" >>$opt -echo "--port $port" >>$opt +echo "--port '$port'" >>$opt echo "#!/bin/sh" >$drv echo "opt=\`cat $opt\`" >>$drv -- cgit v1.1 From 64578ff4df26b29d211d0ef07d0b6408cc320afd Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 13:35:18 +0200 Subject: Remove libpq import directory from tests --- build/import/libpq/LICENSE | 340 ---------------------------- build/import/libpq/configuration-rules.make | 15 -- build/import/libpq/configure | 81 ------- build/import/libpq/rules.make | 31 --- build/import/libpq/stub.make | 35 --- build/import/libpq/version | 1 - 6 files changed, 503 deletions(-) delete mode 100644 build/import/libpq/LICENSE delete mode 100644 build/import/libpq/configuration-rules.make delete mode 100755 build/import/libpq/configure delete mode 100644 build/import/libpq/rules.make delete mode 100644 build/import/libpq/stub.make delete mode 100644 build/import/libpq/version diff --git a/build/import/libpq/LICENSE b/build/import/libpq/LICENSE deleted file mode 100644 index 3912109..0000000 --- a/build/import/libpq/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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 more 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/build/import/libpq/configuration-rules.make b/build/import/libpq/configuration-rules.make deleted file mode 100644 index c4b1326..0000000 --- a/build/import/libpq/configuration-rules.make +++ /dev/null @@ -1,15 +0,0 @@ -# file : build/import/libpq/configuration-rules.make -# author : Constantin Michael -# copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libpq/configuration-dynamic.make: | $(dcf_root)/import/libpq/. - $(call message,,$(scf_root)/import/libpq/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libpq/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libpq/configuration-dynamic.make) - -endif diff --git a/build/import/libpq/configure b/build/import/libpq/configure deleted file mode 100755 index 8e2210f..0000000 --- a/build/import/libpq/configure +++ /dev/null @@ -1,81 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libpq/configure -# author : Constantin Michael -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out config file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'PostgreSQL library' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'PostgreSQL library' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -path= -type= - -if [ "$installed" = "n" ]; then - - $echo - $echo "Please enter the 'PostgreSQL' root directory." - $echo - - root=`read_path --directory --exist` - - $echo - $echo "Please select the library type you would like to use:" - $echo - $echo "(1) archive" - $echo "(2) shared object" - $echo - - type=`read_option "archive shared" "shared"` - -else - - pq_libs=-lpq - - if pg_config --version > /dev/null 2>&1; then - - pq_cppflags=-I`pg_config --includedir` - - else - $echo - $echo "Unable to discover installed 'PostgreSQL libraries' using pg_config." - $echo "Assuming the C++ compiler will find them automatically." - $echo - - pq_cppflags= - - fi - -fi - -echo libpq_installed := $installed >$1 - -if [ "$installed" = "n" ]; then - - echo libpq_root := $root >>$1 - echo libpq_type := $type >>$1 - -else - - echo pq_cppflags := $pq_cppflags >>$1 - echo pq_libs := $pq_libs >>$1 - -fi diff --git a/build/import/libpq/rules.make b/build/import/libpq/rules.make deleted file mode 100644 index 85cc659..0000000 --- a/build/import/libpq/rules.make +++ /dev/null @@ -1,31 +0,0 @@ -# file : build/import/libpq/rules.make -# author : Constantin Michael -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libpq/%: root := $(libpq_root) - -ifeq ($(libpq_type),archive) - -$(dcf_root)/import/libpq/pq.l: $(libpq_root)/libpq/.libs/libpq.a - @echo $< >$@ -else - -$(dcf_root)/import/libpq/pq.l: $(libpq_root)/libpq/.libs/libpq.so - @echo $< >$@ - @echo rpath:$(root)/libpq/.libs >>$@ -endif - -$(dcf_root)/import/libpq/pq.l.cpp-options: - @ln -s $(root)/include $(dcf_root)/import/libpq/pq - @echo include: -I$(dcf_root)/import/libpq >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/pq/pq.l,\ -rm -f $(dcf_root)/import/pq/pq.l) - $(call message,,rm -f $(dcf_root)/import/libpq/pq) - $(call message,,rm -f $(dcf_root)/import/libpq/pq.l.cpp-options) - -endif diff --git a/build/import/libpq/stub.make b/build/import/libpq/stub.make deleted file mode 100644 index d12abaa..0000000 --- a/build/import/libpq/stub.make +++ /dev/null @@ -1,35 +0,0 @@ -# file : build/import/libpq/stub.make -# author : Constantin Michael -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libpq/configuration-rules.make,$(dcf_root)) - -libpq_installed := - -$(call -include,$(dcf_root)/import/libpq/configuration-dynamic.make) - -ifdef libpq_installed - -ifeq ($(libpq_installed),y) - -$(call export,\ - l: $(pq_libs),\ - cpp-options: ,\ - cpp-options-inline: $(pq_cppflags)) - -else - -$(call include-once,$(scf_root)/import/libpq/rules.make,$(dcf_root)) - -$(call export,\ - l: $(dcf_root)/import/libpq/pq.l,\ - cpp-options: $(dcf_root)/import/libpq/pq.l.cpp-options) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libpq/version b/build/import/libpq/version deleted file mode 100644 index 6e8bf73..0000000 --- a/build/import/libpq/version +++ /dev/null @@ -1 +0,0 @@ -0.1.0 -- cgit v1.1 From e47e91e08a890cc0ac727985ba9352a579345ace Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 13:37:43 +0200 Subject: Remove duplicated libodb-pgsql import stubs --- pgsql/native/makefile | 10 ++-------- pgsql/types/makefile | 8 ++------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 95eb060..5b85f42 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -17,17 +17,11 @@ dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean -# Import -# -$(call import,\ - $(scf_root)/import/libodb-pgsql/stub.make,\ - l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) - # Build. # -$(driver): $(cxx_obj) $(odb_pgsql.l) $(common.l) +$(driver): $(cxx_obj) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) $(common.l.cpp-options) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(call include-dep,$(cxx_od)) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 88fdb4a..bdc00ea 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -24,15 +24,11 @@ $(call import,\ $(scf_root)/import/odb/stub.make,\ odb: odb,odb-rules: odb_rules) -$(call import,\ - $(scf_root)/import/libodb-pgsql/stub.make,\ - l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) - # Build. # -$(driver): $(cxx_obj) $(odb_pgsql.l) $(common.l) +$(driver): $(cxx_obj) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(odb_pgsql.l.cpp-options) $(common.l.cpp-options) +$(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)) -- cgit v1.1 From 65482585a1cb714bb90592b5aecc31e3fe260e43 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 13:38:50 +0200 Subject: Do not output empty PostgreSQL client configuration options --- build/pgsql/configure | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/build/pgsql/configure b/build/pgsql/configure index 11f419e..7eeadc9 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -31,9 +31,8 @@ $echo db=`read_value "odb_test"` $echo -$echo "Please enter the PostgreSQL database host. Leaving this field" -$echo "blank results in using Unix-domain socket. Machines without" -$echo "Unix-domain sockets will connect to localhost." +$echo "Please enter the PostgreSQL database host." +$echo host=`read_value ""` @@ -47,10 +46,16 @@ port=`read_value ""` opt=$dcf_root/db.options drv=$dcf_root/db-driver -echo "--user '$user'" >$opt -echo "--database '$db'" >>$opt -echo "--host '$host'" >>$opt -echo "--port '$port'" >>$opt +echo "--user '$user'" >$opt +echo "--database '$db'" >>$opt + +if [ -n "$host"]; then +echo "--host '$host'" >>$opt +fi + +if [ -n "$port"]; then +echo "--port '$port'" >>$opt +fi echo "#!/bin/sh" >$drv echo "opt=\`cat $opt\`" >>$drv -- cgit v1.1 From 92c6c45e7d3d95ef6241502824239a28a38dd7c2 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 17:08:34 +0200 Subject: Templatize buffer to avoid duplicate code in unsigned buffer implementation --- libcommon/common/buffer.hxx | 69 ++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 97e8962..ada73a1 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -6,36 +6,37 @@ #ifndef LIBCOMMON_COMMON_BUFFER_HXX #define LIBCOMMON_COMMON_BUFFER_HXX +#include #include // std::size_t #include // std::{memcmp,memcpy} -struct buffer +struct basic_buffer_base { - ~buffer () + ~basic_buffer_base () { - delete[] data_; + operator delete (data_); } - buffer () + basic_buffer_base () : data_ (0), size_ (0) { } - buffer (const void* data, std::size_t size) + basic_buffer_base (const void* data, std::size_t size) : data_ (0), size_ (size) { - data_ = new char[size_]; + data_ = operator new (size_); std::memcpy (data_, data, size_); } - buffer (const buffer& y) + basic_buffer_base (const basic_buffer_base& y) : data_ (0), size_ (0) { assign (y.data_, y.size_); } - buffer& - operator= (const buffer& y) + basic_buffer_base& + operator= (const basic_buffer_base& y) { if (this != &y) assign (y.data_, y.size_); @@ -48,8 +49,8 @@ struct buffer { if (size_ < size) { - char* p (new char[size]); - delete[] data_; + void *p (operator new (size)); + operator delete (data_); data_ = p; } @@ -57,18 +58,6 @@ struct buffer size_ = size; } - char* - data () - { - return data_; - } - - const char* - data () const - { - return data_; - } - std::size_t size () const { @@ -76,14 +65,42 @@ struct buffer } bool - operator== (const buffer& y) const + operator== (const basic_buffer_base& y) const { return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; } -private: - char* data_; +protected: + void* data_; std::size_t size_; }; +template +struct basic_buffer: basic_buffer_base +{ + basic_buffer () + { + } + + basic_buffer (const T* data, std::size_t size) + : basic_buffer_base (data, size) + { + } + + T* + data () + { + return static_cast (data_); + } + + const T* + data () const + { + return static_cast (data_); + } +}; + +typedef basic_buffer buffer; +typedef basic_buffer ubuffer; + #endif // LIBCOMMON_COMMON_BUFFER_HXX -- cgit v1.1 From e67830fa25b5cf42428d32b544b115fda44383a3 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 17:11:01 +0200 Subject: Test VARBIT bit length is handled correctly --- pgsql/types/driver.cxx | 10 ++++++---- pgsql/types/test.hxx | 39 ++++++++++++++++++++++++++++++++++++++- pgsql/types/traits.hxx | 47 ++++++++++++++++++++++++++++++++++------------- 3 files changed, 78 insertions(+), 18 deletions(-) diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 5c5145a..17f48f4 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -47,15 +47,17 @@ main (int argc, char* argv[]) string short_str (128, 's'); string medium_str (250, 'm'); string long_str (2040, 'l'); - buffer long_buf (long_str.c_str (), long_str.size ()); - - unsigned char varbit_buf[8] = {1, 2, 1, 2, 1, 1, 1, 1}; o.char_ = short_str; o.varchar_ = medium_str; o.text_ = long_str; + + buffer long_buf (long_str.c_str (), long_str.size ()); o.bytea_ = long_buf; - o.varbit_ = buffer (varbit_buf, 8); + + unsigned char varbit_buf[8] = {1, 3, 1, 3, 1, 3, 1, 3}; + o.varbit_.size = 52; + o.varbit_.ubuffer_ = ubuffer (varbit_buf, 8); o.bit_.a = 0; o.bit_.b = 1; diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 39de674..8b42aa1 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -10,6 +10,7 @@ #include #include // std::auto_ptr #include // std::memcmp +#include // std::size_t #include @@ -33,6 +34,42 @@ operator== (bitfield x, bitfield y) x.d == y.d; } +struct varbit +{ + std::size_t size; + ubuffer ubuffer_; + + bool + compare (const varbit& x) const + { + if (size != x.size) + return false; + + std::size_t byte_len = size / 8; + + if (std::memcmp (ubuffer_.data (), x.ubuffer_.data (), byte_len != 0)) + return false; + + std::size_t trailing_bits = size % 8; + + if (trailing_bits != 0) + { + unsigned char mask (0xFFU << (8 - trailing_bits)); + + return (ubuffer_.data ()[byte_len] & mask) == + (x.ubuffer_.data ()[byte_len] & mask); + } + + return true; + } +}; + +inline bool +operator== (const varbit& x, const varbit& y) +{ + return x.compare (y); +} + #pragma db value(bitfield) type ("BIT(4) NOT NULL") typedef std::auto_ptr string_ptr; @@ -108,7 +145,7 @@ struct object buffer bytea_; #pragma db type ("VARBIT(1024) NOT NULL") - buffer varbit_; + varbit varbit_; // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value bitfield bit_; diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index b7734b5..20d0445 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -6,12 +6,13 @@ #ifndef TRAITS_HXX #define TRAITS_HXX +#include #include // std::memcpy, std::memset #include #include -#include "test.hxx" // date_time, buffer, string_ptr +#include "test.hxx" // varbit, buffer, ubuffer, string_ptr namespace odb { @@ -96,45 +97,65 @@ namespace odb } }; + // The first 4 bytes of the image is a signed int specifying the + // number of significant bits contained by the VARBIT. The following + // bytes contain the VARBIT data. + // template <> - class value_traits + class value_traits { public: - typedef buffer value_type; - typedef buffer query_type; + typedef varbit value_type; + typedef varbit query_type; typedef details::ubuffer image_type; static void - set_value (buffer& v, + set_value (varbit& v, const details::ubuffer& b, std::size_t n, bool is_null) { if (!is_null) - v.assign (b.data () + 4, n - 4); + { + v.size = static_cast ( + details::endian_traits::ntoh ( + *reinterpret_cast (b.data ()))); + + std::size_t byte_len = v.size / 8 + v.size % 8 > 0 ? 1 : 0; + assert (n >= byte_len + 4); + + v.ubuffer_.assign (b.data () + 4, byte_len); + } + else - v.assign (0, 0); + { + v.size = 0; + v.ubuffer_.assign (0, 0); + } } static void set_image (details::ubuffer& b, std::size_t& n, bool& is_null, - const buffer& v) + const varbit& v) { is_null = false; - n = v.size () + 4; + n = 4 + v.size / 8 + (v.size % 8 > 0 ? 1 : 0); if (n > b.capacity ()) b.capacity (n); - int bit_len = static_cast (v.size () * 8); + // PostgreSQL requires all trailing bits of a varbit image + // be zero. + // + std::memset (b.data (), 0, b.capacity ()); *reinterpret_cast (b.data ()) = - details::endian_traits::hton (bit_len); + details::endian_traits::hton (static_cast (v.size)); - if (bit_len != 0) - std::memcpy (b.data () + 4, v.data (), v.size ()); + if (v.size != 0) + std::memcpy (b.data () + 4, v.ubuffer_.data (), n - 4); } }; -- cgit v1.1 From 2548ead4f4b740e96c093f07692a50e2bc776f89 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 23:13:46 +0200 Subject: Aesthetic changes to PostgreSQL BIT test --- pgsql/types/traits.hxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 20d0445..be45aa8 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -55,6 +55,10 @@ namespace odb } }; + // The first 4 bytes of the image is a signed int specifying the + // number of significant bits contained by the BIT. The following + // bytes contain the bit data. + // template <> class value_traits { @@ -71,7 +75,11 @@ namespace odb { if (!is_null) { - unsigned char const* d = i + 4; + assert ( + details::endian_traits::ntoh ( + *reinterpret_cast (i)) == 4); + + const unsigned char* d (i + 4); v.a = *d >> 4 & 1; v.b = (*d >> 5) & 1; @@ -146,8 +154,8 @@ namespace odb if (n > b.capacity ()) b.capacity (n); - // PostgreSQL requires all trailing bits of a varbit image - // be zero. + // PostgreSQL requires all trailing bits of a VARBIT image + // to be zero. // std::memset (b.data (), 0, b.capacity ()); -- cgit v1.1 From 5e7e5db01384b45cb751cfd5f0e3f23c1cdc7022 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 14 Jul 2011 23:14:37 +0200 Subject: Aesthetic changes --- build/pgsql/configure | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/pgsql/configure b/build/pgsql/configure index 7eeadc9..3e8a72c 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -31,7 +31,9 @@ $echo db=`read_value "odb_test"` $echo -$echo "Please enter the PostgreSQL database host." +$echo "Please enter the PostgreSQL database host. Leaving this field" +$echo "blank results in using Unix-domain sockets. Machines without" +$echo "Unix-domain sockets will connect to localhost." $echo host=`read_value ""` @@ -49,11 +51,11 @@ drv=$dcf_root/db-driver echo "--user '$user'" >$opt echo "--database '$db'" >>$opt -if [ -n "$host"]; then +if [ -n "$host" ]; then echo "--host '$host'" >>$opt fi -if [ -n "$port"]; then +if [ -n "$port" ]; then echo "--port '$port'" >>$opt fi -- cgit v1.1 From 533539cd0a445bb38ac574024361552188efa8e6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Jul 2011 17:20:00 +0200 Subject: Qualify id with table alias to help SQLite out This hack should go away once we have language-integrated support for ORDER BY. --- common/callback/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 3dfbc79..4179168 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -85,7 +85,7 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query ((query::id < 3) + "ORDER BY id")); + result r (db->query ((query::id < 3) + "ORDER BY _.id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { -- cgit v1.1 From b038ab0cd6335f3e4ec075d1e21f5d7bb89e3ffb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jul 2011 13:42:18 +0200 Subject: New design for NULL semantics Now, instead of being specified as part of the SQL type with the type pragma, there are separate null and not_null pragmas. The not_null pragma was used to control NULL-ness of object pointers. Now the two pragmas are used consistently for object pointers and simple values (and in the future will work for composite values and containers). --- boost/common/smart-ptr/test.hxx | 2 +- boost/mysql/date-time/test.hxx | 8 ++--- common/lazy-ptr/test.hxx | 4 +-- common/query/test.hxx | 2 +- common/relationship/driver.cxx | 5 +-- mysql/types/test.hxx | 74 ++++++++++++++++++++--------------------- pgsql/types/test.hxx | 40 +++++++++++----------- qt/common/smart-ptr/test.hxx | 2 +- qt/mysql/date-time/test.hxx | 8 ++--- sqlite/types/test.hxx | 12 +++---- 10 files changed, 79 insertions(+), 78 deletions(-) diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index ea158e7..575c2e2 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -33,7 +33,7 @@ struct cont typedef std::vector > obj_list; - #pragma db inverse(c) not_null + #pragma db inverse(c) value_not_null obj_list o; }; diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index 235607f..b84bf0f 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -37,11 +37,11 @@ struct object std::vector dates; std::vector times; - // Specify NULL explicitly to suppress auto-initialization and - // auto-update characteristics of TIMESTAMP datatype, and to allow - // NULL values. + // Make timestamp NULL-able to suppress the auto-initialization and + // auto-update characteristics of the TIMESTAMP datatype, and to + // allow NULL values. // - #pragma db value_type ("TIMESTAMP NULL") + #pragma db value_type ("TIMESTAMP") value_null std::vector timestamps; std::vector durations; diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index b530316..32f6a43 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -38,7 +38,7 @@ public: typedef std::vector > obj_list; - #pragma db not_null + #pragma db value_not_null obj_list o; }; @@ -122,7 +122,7 @@ namespace tr1 typedef std::vector > obj_list; - #pragma db inverse(c) not_null + #pragma db inverse(c) value_not_null obj_list o; }; diff --git a/common/query/test.hxx b/common/query/test.hxx index 124ee72..21acb84 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -38,7 +38,7 @@ struct person #pragma db column ("first") std::string first_name_; - #pragma db column ("middle") type ("TEXT") + #pragma db column ("middle") type ("TEXT") null std::auto_ptr middle_name_; #pragma db column ("last") diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index abbae29..3ce7e8c 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -46,8 +46,9 @@ main (int argc, char* argv[]) a.v1.push_back (0); a.v1.push_back (new obj1 ("v1 2", "v1 2")); + // Set cannot contain NULL pointers. + // a.s1.insert (new obj1 ("s1 0", "s1 0")); - a.s1.insert (static_cast (0)); // VC 10 a.s1.insert (new obj1 ("s1 2", "s1 2")); a.m1[0] = new obj1 ("m1 0", "m1 0"); @@ -112,7 +113,7 @@ main (int argc, char* argv[]) t.commit (); } - // test NULL pointer + // Test NULL pointer. // delete a.o1; a.o1 = 0; diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index a4421b3..fa1d7b3 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -77,7 +77,7 @@ operator== (bitfield x, bitfield y) x.d == y.d; } -#pragma db value(bitfield) type ("BIT(4) NOT NULL") +#pragma db value(bitfield) type ("BIT(4)") typedef std::set set; typedef std::auto_ptr string_ptr; @@ -101,126 +101,126 @@ struct object // Integral types. // - #pragma db type ("BOOL NOT NULL") + #pragma db type ("BOOL") bool bool_; - #pragma db type ("TINYINT NOT NULL") + #pragma db type ("TINYINT") signed char schar_; - #pragma db type ("TINYINT UNSIGNED NOT NULL") + #pragma db type ("TINYINT UNSIGNED") unsigned char uchar_; - #pragma db type ("SMALLINT NOT NULL") + #pragma db type ("SMALLINT") short short_; - #pragma db type ("SMALLINT UNSIGNED NOT NULL") + #pragma db type ("SMALLINT UNSIGNED") unsigned short ushort_; - #pragma db type ("MEDIUMINT NOT NULL") + #pragma db type ("MEDIUMINT") int mint_; - #pragma db type ("MEDIUMINT UNSIGNED NOT NULL") + #pragma db type ("MEDIUMINT UNSIGNED") unsigned int umint_; - #pragma db type ("INT NOT NULL") + #pragma db type ("INT") int int_; - #pragma db type ("INT UNSIGNED NOT NULL") + #pragma db type ("INT UNSIGNED") unsigned int uint_; - #pragma db type ("BIGINT NOT NULL") + #pragma db type ("BIGINT") long long long_long_; - #pragma db type ("BIGINT UNSIGNED NOT NULL") + #pragma db type ("BIGINT UNSIGNED") unsigned long long ulong_long_; // Float types. // - #pragma db type ("FLOAT NOT NULL") + #pragma db type ("FLOAT") float float_; - #pragma db type ("FLOAT(32) NOT NULL") + #pragma db type ("FLOAT(32)") double float8_; - #pragma db type ("DOUBLE NOT NULL") + #pragma db type ("DOUBLE") double double_; - #pragma db type ("DECIMAL(6,3) NOT NULL") + #pragma db type ("DECIMAL(6,3)") std::string decimal_; // Data-time types. // - #pragma db type ("DATE NOT NULL") + #pragma db type ("DATE") date_time date_; - #pragma db type ("TIME NOT NULL") + #pragma db type ("TIME") date_time time_; - #pragma db type ("DATETIME NOT NULL") + #pragma db type ("DATETIME") date_time date_time_; - #pragma db type ("TIMESTAMP NOT NULL") + #pragma db type ("TIMESTAMP") date_time timestamp_; - #pragma db type ("YEAR NOT NULL") + #pragma db type ("YEAR") short year_; // String and binary types. // - #pragma db type ("CHAR(128) NOT NULL") + #pragma db type ("CHAR(128)") std::string char_; - #pragma db type ("BINARY(128) NOT NULL") + #pragma db type ("BINARY(128)") buffer binary_; - #pragma db type ("VARCHAR(256) NOT NULL") + #pragma db type ("VARCHAR(256)") std::string varchar_; - #pragma db type ("VARBINARY(256) NOT NULL") + #pragma db type ("VARBINARY(256)") buffer varbinary_; - #pragma db type ("TINYTEXT NOT NULL") + #pragma db type ("TINYTEXT") std::string tinytext_; - #pragma db type ("TINYBLOB NOT NULL") + #pragma db type ("TINYBLOB") buffer tinyblob_; - #pragma db type ("TEXT NOT NULL") + #pragma db type ("TEXT") std::string text_; - #pragma db type ("BLOB NOT NULL") + #pragma db type ("BLOB") buffer blob_; - #pragma db type ("MEDIUMTEXT NOT NULL") + #pragma db type ("MEDIUMTEXT") std::string mediumtext_; - #pragma db type ("MEDIUMBLOB NOT NULL") + #pragma db type ("MEDIUMBLOB") buffer mediumblob_; - #pragma db type ("LONGTEXT NOT NULL") + #pragma db type ("LONGTEXT") std::string longtext_; - #pragma db type ("LONGBLOB NOT NULL") + #pragma db type ("LONGBLOB") buffer longblob_; // Other types. // - // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value + // #pragma db type ("BIT(4)") - assigned by #pragma db value bitfield bit_; // Test ENUM representations (integer and string). // color enum_; - #pragma db type ("ENUM ('red', 'green', 'blue') NOT NULL") + #pragma db type ("ENUM ('red', 'green', 'blue')") std::string enum_str_; - #pragma db type ("SET ('red', 'green', 'blue') NOT NULL") + #pragma db type ("SET ('red', 'green', 'blue')") set set_; // Test NULL value. // - #pragma db type ("TEXT") + #pragma db type ("TEXT") null string_ptr null_; bool diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 8b42aa1..ac1ed11 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -70,7 +70,7 @@ operator== (const varbit& x, const varbit& y) return x.compare (y); } -#pragma db value(bitfield) type ("BIT(4) NOT NULL") +#pragma db value(bitfield) type ("BIT(4)") typedef std::auto_ptr string_ptr; @@ -93,66 +93,66 @@ struct object // Integral types. // - #pragma db type ("BOOL NOT NULL") + #pragma db type ("BOOL") bool bool_; - #pragma db type ("SMALLINT NOT NULL") + #pragma db type ("SMALLINT") short short_; - #pragma db type ("INT NOT NULL") + #pragma db type ("INT") int int_; - #pragma db type ("BIGINT NOT NULL") + #pragma db type ("BIGINT") long long long_long_; // Float types. // - #pragma db type ("REAL NOT NULL") + #pragma db type ("REAL") float float_; - #pragma db type ("FLOAT(32) NOT NULL") + #pragma db type ("FLOAT(32)") double float8_; - #pragma db type ("DOUBLE PRECISION NOT NULL") + #pragma db type ("DOUBLE PRECISION") double double_; - // #pragma db type ("NUMERIC(6,3) NOT NULL") + // #pragma db type ("NUMERIC(6,3)") // std::string numeric_; // Data-time types. // - #pragma db type ("DATE NOT NULL") + #pragma db type ("DATE") int date_; - #pragma db type ("TIME NOT NULL") + #pragma db type ("TIME") long long time_; - #pragma db type ("TIMESTAMP NOT NULL") + #pragma db type ("TIMESTAMP") long long timestamp_; // String and binary types. // - #pragma db type ("CHAR(128) NOT NULL") + #pragma db type ("CHAR(128)") std::string char_; - #pragma db type ("VARCHAR(256) NOT NULL") + #pragma db type ("VARCHAR(256)") std::string varchar_; - #pragma db type ("TEXT NOT NULL") + #pragma db type ("TEXT") std::string text_; - #pragma db type ("BYTEA NOT NULL") + #pragma db type ("BYTEA") buffer bytea_; - #pragma db type ("VARBIT(1024) NOT NULL") + #pragma db type ("VARBIT(1024)") varbit varbit_; - // #pragma db type ("BIT(4) NOT NULL") - assigned by #pragma db value + // #pragma db type ("BIT(4)") - assigned by #pragma db value bitfield bit_; // Other types. // - #pragma db type ("UUID NOT NULL") + #pragma db type ("UUID") unsigned char uuid_[16]; // Test ENUM representation. @@ -161,7 +161,7 @@ struct object // Test NULL value. // - #pragma db type ("TEXT") + #pragma db type ("TEXT") null string_ptr null_; bool diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 06c05fa..0a4ce03 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -30,7 +30,7 @@ struct cont typedef std::vector > obj_list; - #pragma db inverse(c) not_null + #pragma db inverse(c) value_not_null obj_list o; }; diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index b40f45f..dd0f640 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -42,11 +42,11 @@ struct object QDate date; QDateTime date_time; - // Specify NULL explicitly to suppress auto-initialization and - // auto-update characteristics of TIMESTAMP datatype, and to allow - // NULL values. + // Make timestamp NULL-able to suppress the auto-initialization and + // auto-update characteristics of the TIMESTAMP datatype, and to + // allow NULL values. // - #pragma db type("TIMESTAMP NULL") + #pragma db type("TIMESTAMP") null QDateTime timestamp; QTime time; diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 37190a0..22cde8e 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -31,24 +31,24 @@ struct object #pragma db id unsigned long id_; - #pragma db type ("BOOL NOT NULL") + #pragma db type ("BOOL") bool bool_; - #pragma db type ("INTEGER NOT NULL") + #pragma db type ("INTEGER") int integer_; - #pragma db type ("REAL NOT NULL") + #pragma db type ("REAL") double real_; - #pragma db type ("TEXT NOT NULL") + #pragma db type ("TEXT") std::string text_; - #pragma db type ("BLOB NOT NULL") + #pragma db type ("BLOB") buffer blob_; // Test NULL value. // - #pragma db type ("TEXT") + #pragma db type ("TEXT") null string_ptr null_; bool -- cgit v1.1 From f5a9d565dad28df86490b392cd5b4d763ab2a248 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 21 Jul 2011 23:17:02 +0200 Subject: Add Boost profile tests for PostgreSQL --- boost/pgsql/Makefile.am | 7 + boost/pgsql/boost-pgsql-vc10.sln | 15 + boost/pgsql/boost-pgsql-vc9.sln | 15 + boost/pgsql/date-time/driver.cxx | 163 ++++++++++ boost/pgsql/date-time/makefile | 120 +++++++ boost/pgsql/date-time/test.hxx | 41 +++ boost/pgsql/date-time/test.std | 0 boost/pgsql/makefile | 36 ++ boost/pgsql/template/Makefile.am | 32 ++ boost/pgsql/template/driver.cxx | 44 +++ boost/pgsql/template/makefile | 120 +++++++ boost/pgsql/template/template-vc10.vcxproj | 180 ++++++++++ boost/pgsql/template/template-vc10.vcxproj.filters | 25 ++ boost/pgsql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ boost/pgsql/template/test.hxx | 27 ++ boost/pgsql/template/test.std | 1 + boost/pgsql/test.bat | 70 ++++ 17 files changed, 1257 insertions(+) create mode 100644 boost/pgsql/Makefile.am create mode 100644 boost/pgsql/boost-pgsql-vc10.sln create mode 100644 boost/pgsql/boost-pgsql-vc9.sln create mode 100644 boost/pgsql/date-time/driver.cxx create mode 100644 boost/pgsql/date-time/makefile create mode 100644 boost/pgsql/date-time/test.hxx create mode 100644 boost/pgsql/date-time/test.std create mode 100644 boost/pgsql/makefile create mode 100644 boost/pgsql/template/Makefile.am create mode 100644 boost/pgsql/template/driver.cxx create mode 100644 boost/pgsql/template/makefile create mode 100644 boost/pgsql/template/template-vc10.vcxproj create mode 100644 boost/pgsql/template/template-vc10.vcxproj.filters create mode 100644 boost/pgsql/template/template-vc9.vcproj create mode 100644 boost/pgsql/template/test.hxx create mode 100644 boost/pgsql/template/test.std create mode 100644 boost/pgsql/test.bat diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am new file mode 100644 index 0000000..cf1cda7 --- /dev/null +++ b/boost/pgsql/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/pgsql/Makefile.am +# author : Constantin Michael +# 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) diff --git a/boost/pgsql/boost-pgsql-vc10.sln b/boost/pgsql/boost-pgsql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/pgsql/boost-pgsql-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/pgsql/boost-pgsql-vc9.sln b/boost/pgsql/boost-pgsql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/pgsql/boost-pgsql-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx new file mode 100644 index 0000000..d261add --- /dev/null +++ b/boost/pgsql/date-time/driver.cxx @@ -0,0 +1,163 @@ +// file : boost/pgsql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (pos_infin); + o.times.push_back (neg_infin); + + // Boost seems to handle 64 bit std::time_t incorrectly. + // Insert 32 bit minimum and maximum UNIX time values for now. + // + // o.times.push_back (date (max_date_time)); + // o.times.push_back (date (min_date_time)); + // + + o.times.push_back (ptime (date (1901, 12, 14), time_duration (0, 0, 0))); + o.times.push_back (ptime (date (2038, 1, 19), time_duration (3, 14, 7))); + + o.durations.push_back (time_duration (0, 0, 0)); + o.durations.push_back (time_duration (12, 3, 4)); + o.durations.push_back (time_duration (23, 59, 59)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime mappings. + // + // object sv1, sv2; + // sv1.times.push_back (neg_infin); + // sv2.times.push_back (pos_infin); + + // transaction t (db->begin ()); + // assert (test_invalid_special_value (sv1, db)); + // assert (test_invalid_special_value (sv2, db)); + // t.commit (); + } + + { + // Test invalid time_duration mappings. + // + // object or1, sv1, sv2; + // or1.durations.push_back (time_duration (0, 0, -1)); + // sv1.durations.push_back (pos_infin); + // sv2.durations.push_back (neg_infin); + + // transaction t (db->begin ()); + // assert (test_out_of_range_value (or1, db)); + // assert (test_invalid_special_value (sv1, db)); + // assert (test_invalid_special_value (sv2, db)); + // t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile new file mode 100644 index 0000000..74e2093 --- /dev/null +++ b/boost/pgsql/date-time/makefile @@ -0,0 +1,120 @@ +# file : boost/pgsql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 pgsql --profile boost/date-time \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/pgsql/,,$(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 schema) + $(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/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx new file mode 100644 index 0000000..9f6746e --- /dev/null +++ b/boost/pgsql/date-time/test.hxx @@ -0,0 +1,41 @@ +// file : boost/pgsql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/boost/pgsql/date-time/test.std b/boost/pgsql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile new file mode 100644 index 0000000..9b69e32 --- /dev/null +++ b/boost/pgsql/makefile @@ -0,0 +1,36 @@ +# file : boost/pgsql/makefile +# author : Constantin Michael +# 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 := \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := boost-pgsql +$(dist): export dirs := $(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/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am new file mode 100644 index 0000000..2c9f50a --- /dev/null +++ b/boost/pgsql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : boost/pgsql/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx new file mode 100644 index 0000000..e670008 --- /dev/null +++ b/boost/pgsql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/pgsql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile new file mode 100644 index 0000000..0d62ab6 --- /dev/null +++ b/boost/pgsql/template/makefile @@ -0,0 +1,120 @@ +# file : boost/pgsql/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 pgsql --profile boost \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/pgsql/,,$(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 schema) + $(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/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj new file mode 100644 index 0000000..a9d55eb --- /dev/null +++ b/boost/pgsql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.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/boost/pgsql/template/template-vc10.vcxproj.filters b/boost/pgsql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/boost/pgsql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj new file mode 100644 index 0000000..82cd1eb --- /dev/null +++ b/boost/pgsql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx new file mode 100644 index 0000000..fd4a879 --- /dev/null +++ b/boost/pgsql/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/pgsql/template/test.hxx +// author : Constantin Michael +// 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/boost/pgsql/template/test.std b/boost/pgsql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/pgsql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat new file mode 100644 index 0000000..50322cd --- /dev/null +++ b/boost/pgsql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : boost/pgsql/test.bat +rem author : Constantin Michael +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 sqlite %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd %curdir% +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal -- cgit v1.1 From 702df9ae55150c8b8671a9fb200793b78d75aa78 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 21 Jul 2011 23:17:37 +0200 Subject: Add Qt profile tests for PostgreSQL --- qt/pgsql/Makefile.am | 7 + qt/pgsql/basic/driver.cxx | 58 ++++ qt/pgsql/basic/makefile | 116 ++++++++ qt/pgsql/basic/test.hxx | 29 ++ qt/pgsql/basic/test.std | 0 qt/pgsql/date-time/driver.cxx | 116 ++++++++ qt/pgsql/date-time/makefile | 116 ++++++++ qt/pgsql/date-time/test.hxx | 45 +++ qt/pgsql/date-time/test.std | 0 qt/pgsql/makefile | 37 +++ qt/pgsql/qt-pgsql-vc10.sln | 15 + qt/pgsql/qt-pgsql-vc9.sln | 15 + qt/pgsql/template/Makefile.am | 32 +++ qt/pgsql/template/driver.cxx | 44 +++ qt/pgsql/template/makefile | 110 ++++++++ qt/pgsql/template/template-vc10.vcxproj | 180 ++++++++++++ qt/pgsql/template/template-vc10.vcxproj.filters | 25 ++ qt/pgsql/template/template-vc9.vcproj | 361 ++++++++++++++++++++++++ qt/pgsql/template/test.hxx | 27 ++ qt/pgsql/template/test.std | 1 + qt/pgsql/test.bat | 70 +++++ 21 files changed, 1404 insertions(+) create mode 100644 qt/pgsql/Makefile.am create mode 100644 qt/pgsql/basic/driver.cxx create mode 100644 qt/pgsql/basic/makefile create mode 100644 qt/pgsql/basic/test.hxx create mode 100644 qt/pgsql/basic/test.std create mode 100644 qt/pgsql/date-time/driver.cxx create mode 100644 qt/pgsql/date-time/makefile create mode 100644 qt/pgsql/date-time/test.hxx create mode 100644 qt/pgsql/date-time/test.std create mode 100644 qt/pgsql/makefile create mode 100644 qt/pgsql/qt-pgsql-vc10.sln create mode 100644 qt/pgsql/qt-pgsql-vc9.sln create mode 100644 qt/pgsql/template/Makefile.am create mode 100644 qt/pgsql/template/driver.cxx create mode 100644 qt/pgsql/template/makefile create mode 100644 qt/pgsql/template/template-vc10.vcxproj create mode 100644 qt/pgsql/template/template-vc10.vcxproj.filters create mode 100644 qt/pgsql/template/template-vc9.vcproj create mode 100644 qt/pgsql/template/test.hxx create mode 100644 qt/pgsql/template/test.std create mode 100644 qt/pgsql/test.bat diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am new file mode 100644 index 0000000..3073fef --- /dev/null +++ b/qt/pgsql/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/pgsql/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx new file mode 100644 index 0000000..1c89430 --- /dev/null +++ b/qt/pgsql/basic/driver.cxx @@ -0,0 +1,58 @@ +// file : qt/pgsql/basic/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "Constantin Michael"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + object* ol = db->load (o.str); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile new file mode 100644 index 0000000..ef1057f --- /dev/null +++ b/qt/pgsql/basic/makefile @@ -0,0 +1,116 @@ +# file : qt/pgsql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 pgsql --profile qt/basic \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/pgsql/,,$(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 schema) + $(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/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx new file mode 100644 index 0000000..4633b2c --- /dev/null +++ b/qt/pgsql/basic/test.hxx @@ -0,0 +1,29 @@ +// file : qt/pgsql/basic/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/qt/pgsql/basic/test.std b/qt/pgsql/basic/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx new file mode 100644 index 0000000..e81fcf3 --- /dev/null +++ b/qt/pgsql/date-time/driver.cxx @@ -0,0 +1,116 @@ +// file : qt/pgsql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +bool +test_out_of_range_value (object&, database&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Check persistence of null values. + // + object o1; + { + transaction t (db->begin ()); + db->persist (o1); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol1 (db->load (o1.id)); + t.commit (); + + assert (ol1->is_null ()); + } + + QDateTime ct (QDateTime::currentDateTime ()); + QDateTime ct_no_ms = QDateTime (QDate (ct.date ().year (), + ct.date ().month (), + ct.date ().day ()), + QTime (ct.time ().hour (), + ct.time ().minute (), + ct.time ().second ())); + + // Check persistence of valid dates and times. + // + object o2; + { + o2.date = ct.date (); + o2.time = ct_no_ms.time (); + o2.date_time = ct_no_ms; + + transaction t (db->begin ()); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol2 (db->load (o2.id)); + t.commit (); + + assert (*ol2 == o2); + } + + // Test out of range values for QDateTime traits. + // + { + object o; + o.date_time = QDateTime (QDate (1969, 12, 31), + QTime (23, 59, 59), + Qt::UTC); + + assert (test_out_of_range_value (o, *db)); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_out_of_range_value (object& x, database& db) +{ + try + { + transaction t (db.begin ()); + db.persist (x); + t.rollback (); + + return false; + } + catch (const odb::qt::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile new file mode 100644 index 0000000..9d63918 --- /dev/null +++ b/qt/pgsql/date-time/makefile @@ -0,0 +1,116 @@ +# file : qt/pgsql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 pgsql --profile qt/date-time \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/pgsql/,,$(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 schema) + $(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/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx new file mode 100644 index 0000000..6560e0c --- /dev/null +++ b/qt/pgsql/date-time/test.hxx @@ -0,0 +1,45 @@ +// file : qt/pgsql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + time == x.time && + date_time == x.date_time; + } + + bool + is_null () const + { + return + date.isNull () && + time.isNull () && + date_time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QTime time; + QDateTime date_time; +}; + +#endif // TEST_HXX diff --git a/qt/pgsql/date-time/test.std b/qt/pgsql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile new file mode 100644 index 0000000..21f4fd3 --- /dev/null +++ b/qt/pgsql/makefile @@ -0,0 +1,37 @@ +# file : qt/pgsql/makefile +# author : Constantin Michael +# 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 := \ +basic \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := qt-pgsql +$(dist): export dirs := $(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/qt/pgsql/qt-pgsql-vc10.sln b/qt/pgsql/qt-pgsql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/pgsql/qt-pgsql-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/qt-pgsql-vc9.sln b/qt/pgsql/qt-pgsql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/pgsql/qt-pgsql-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am new file mode 100644 index 0000000..94f3474 --- /dev/null +++ b/qt/pgsql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : qt/pgsql/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx new file mode 100644 index 0000000..a478c35 --- /dev/null +++ b/qt/pgsql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : qt/pgsql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile new file mode 100644 index 0000000..9905b4c --- /dev/null +++ b/qt/pgsql/template/makefile @@ -0,0 +1,110 @@ +# file : qt/pgsql/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +#Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 pgsql --profile qt \ +--generate-schema +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/pgsql/,,$(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 schema) + $(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/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj new file mode 100644 index 0000000..e9481f5 --- /dev/null +++ b/qt/pgsql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.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/qt/pgsql/template/template-vc10.vcxproj.filters b/qt/pgsql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/qt/pgsql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj new file mode 100644 index 0000000..d03c0aa --- /dev/null +++ b/qt/pgsql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx new file mode 100644 index 0000000..7d285b7 --- /dev/null +++ b/qt/pgsql/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/pgsql/template/test.hxx +// author : Constantin Michael +// 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/qt/pgsql/template/test.std b/qt/pgsql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/pgsql/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat new file mode 100644 index 0000000..f56125e --- /dev/null +++ b/qt/pgsql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : qt/pgsql/test.bat +rem author : Constantin Michael +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 sqlite %2 %3 + if errorlevel 1 ( + set "failed=%failed% %1\%3\%2" + ) + ) + + cd %curdir% +goto :eof + +:start + +for %%t in (%tests%) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_test %%t %%c %%p + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal -- cgit v1.1 From de71cad748dcc3105a50741e71a5958780b43c61 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 21 Jul 2011 23:18:39 +0200 Subject: Enable Qt and Boost profile tests for PostgreSQL --- boost/Makefile.am | 4 ++++ boost/makefile | 4 +++- makefile | 6 +++--- qt/Makefile.am | 4 ++++ qt/makefile | 2 ++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/boost/Makefile.am b/boost/Makefile.am index 00d8fa9..2e6565f 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -13,4 +13,8 @@ if DATABASE_SQLITE SUBDIRS += sqlite endif +if DATABASE_PGSQL +SUBDIRS += pgsql +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/boost/makefile b/boost/makefile index 71b7ecf..4bb2793 100644 --- a/boost/makefile +++ b/boost/makefile @@ -5,13 +5,15 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite +all_dirs := common mysql sqlite pgsql dirs := common ifeq ($(db_id),mysql) dirs += mysql else ifeq ($(db_id),sqlite) dirs += sqlite +else ifeq ($(db_id),pgsql) +dirs += pgsql endif default := $(out_base)/ diff --git a/makefile b/makefile index d01f253..f05edb5 100644 --- a/makefile +++ b/makefile @@ -6,14 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make all_dirs := libcommon common tracer mysql sqlite pgsql boost qt -dirs := common tracer +dirs := common tracer boost qt ifeq ($(db_id),mysql) -dirs += boost qt mysql +dirs += mysql endif ifeq ($(db_id),sqlite) -dirs += boost qt sqlite +dirs += sqlite endif ifeq ($(db_id),pgsql) diff --git a/qt/Makefile.am b/qt/Makefile.am index 3b3e6f6..fc38fc6 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -13,4 +13,8 @@ if DATABASE_SQLITE SUBDIRS += sqlite endif +if DATABASE_PGSQL +SUBDIRS += pgsql +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/qt/makefile b/qt/makefile index f5209cb..a631f24 100644 --- a/qt/makefile +++ b/qt/makefile @@ -12,6 +12,8 @@ ifeq ($(db_id),mysql) dirs += mysql else ifeq ($(db_id),sqlite) dirs += sqlite +else ifeq ($(db_id),pgsql) +dirs += pgsql endif default := $(out_base)/ -- cgit v1.1 From 321aaee205aee9035497b32c9087fabe325a7696 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 16:00:49 +0200 Subject: MAke automake scripts PostgreSQL aware --- Makefile.am | 4 ++ configure.ac | 4 ++ m4/database.m4 | 5 ++ m4/libodb-pgsql.m4 | 84 ++++++++++++++++++++++ m4/pgsql.m4 | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 m4/libodb-pgsql.m4 create mode 100644 m4/pgsql.m4 diff --git a/Makefile.am b/Makefile.am index 2631719..09198da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,5 +21,9 @@ if DATABASE_SQLITE SUBDIRS += sqlite endif +if DATABASE_PGSQL +SUBDIRS += pgsql +endif + EXTRA_DIST = __file__(extra_dist) ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index 43f8dc7..ff877d8 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,10 @@ case $database in LIBODB_SQLITE([], [AC_MSG_ERROR([libodb-sqlite is not found; consider using --with-libodb-sqlite=DIR])]) SQLITE ;; + pgsql) + LIBODB_PGSQL([], [AC_MSG_ERROR([libodb-pgsql is not found; consider using --with-libodb-pgsql=DIR])]) + PGSQL + ;; esac # Check for the ODB compiler. diff --git a/m4/database.m4 b/m4/database.m4 index 9478016..476ec19 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -27,6 +27,10 @@ AC_ARG_WITH( database=sqlite AC_DEFINE([DATABASE_SQLITE], [1], [Using SQLite.]) ;; + pgsql) + database=pgsql + AC_DEFINE([DATABASE_PGSQL], [1], [Using PostgreSQL.]) + ;; *) AC_MSG_RESULT([]) AC_MSG_ERROR([unknown database $withval]) @@ -42,5 +46,6 @@ AC_SUBST([database]) AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) AM_CONDITIONAL([DATABASE_SQLITE], [test x$database = xsqlite]) +AM_CONDITIONAL([DATABASE_PGSQL], [test x$database = xpgsql]) ])dnl diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 new file mode 100644 index 0000000..0e92478 --- /dev/null +++ b/m4/libodb-pgsql.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-pgsql.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_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_PGSQL], [ +libodb_pgsql_found=no + +AC_ARG_WITH( + [libodb-pgsql], + [AC_HELP_STRING([--with-libodb-pgsql=DIR],[location of libodb-pgsql build directory])], + [libodb_pgsql_dir=${withval}], + [libodb_pgsql_dir=]) + +AC_MSG_CHECKING([for libodb-pgsql]) + +# If libodb_pgsql_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_pgsql_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_pgsql_dir], [$ac_pwd], [$libodb_pgsql_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_pgsql_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_pgsql_dir/odb/pgsql" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-pgsql $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::pgsql::database_exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_pgsql_found=yes]) + +if test x"$libodb_pgsql_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_pgsql_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_pgsql_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 new file mode 100644 index 0000000..0646fec --- /dev/null +++ b/m4/pgsql.m4 @@ -0,0 +1,200 @@ +dnl file : m4/pgsql.m4 +dnl author : Constantin Michael +dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl PGSQL +dnl +AC_DEFUN([PGSQL], [ + +# Client. +# +AC_MSG_CHECKING([for pgsql client program]) +AC_ARG_WITH( + [pgsql-client], + [AC_HELP_STRING([--with-pgsql-client=path], [PostgreSQL client program path (psql by default)])], + [case $withval in + yes) + pgsql_client=psql + ;; + no) + AC_MSG_RESULT([]) + AC_MSG_ERROR([need pgsql client to run the tests]) + ;; + *) + pgsql_client=$withval + ;; + esac], + [pgsql_client=psql]) + +$pgsql_client --version 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$psql_client]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([pgsql client is not found; consider using --with-pgsql-client=PATH]) +fi + +# User. +# +AC_MSG_CHECKING([for pgsql database user]) +AC_ARG_WITH( + [pgsql-user], + [AC_HELP_STRING([--with-pgsql-user=login], [PostgreSQL database user (odb_test by default)])], + [case $withval in + yes) + pgsql_user=odb_test + pgsql_user_set=yes + ;; + no) + pgsql_user_set=no + ;; + *) + pgsql_user=$withval + pgsql_user_set=yes + ;; + esac], + [pgsql_user=odb_test + pgsql_user_set=yes]) + +if test x$pgsql_user_set = xyes; then + AC_MSG_RESULT(['$pgsql_user']) +else + AC_MSG_RESULT([none]) +fi + +# Database name. +# +AC_MSG_CHECKING([for pgsql database name]) +AC_ARG_WITH( + [pgsql-db], + [AC_HELP_STRING([--with-pgsql-db=name], [PostgreSQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], + [case $withval in + yes) + pgsql_db=odb_test + pgsql_db_set=yes + ;; + no) + pgsql_db_set=no + ;; + *) + pgsql_db=$withval + pgsql_db_set=yes + ;; + esac], + [pgsql_db=odb_test + pgsql_db_set=yes]) + +if test x$pgsql_db_set = xyes; then + AC_MSG_RESULT(['$pgsql_db']) +else + AC_MSG_RESULT([none]) +fi + +# Host. +# +AC_MSG_CHECKING([for pgsql database host]) +AC_ARG_WITH( + [pgsql-host], + [AC_HELP_STRING([--with-pgsql-host=host], [PostgreSQL database host (standard PostgreSQL host by default)])], + [case $withval in + yes) + pgsql_host= + pgsql_host_set=yes + ;; + no) + pgsql_host_set=no + ;; + *) + pgsql_host=$withval + pgsql_host_set=yes + ;; + esac], + [pgsql_host_set=no]) + +if test x$pgsql_host_set = xyes; then + AC_MSG_RESULT(['$pgsql_host']) +else + AC_MSG_RESULT([localhost]) +fi + +# Port. +# +AC_MSG_CHECKING([for pgsql database port]) +AC_ARG_WITH( + [pgsql-port], + [AC_HELP_STRING([--with-pgsql-port=port], [PostgreSQL database port (standard PostgreSQL port by default)])], + [case $withval in + yes) + pgsql_port=0 + pgsql_port_set=yes + ;; + no) + pgsql_port_set=no + ;; + *) + pgsql_port=$withval + pgsql_port_set=yes + ;; + esac], + [pgsql_port_set=no]) + +if test x$pgsql_port_set = xyes; then + AC_MSG_RESULT(['$pgsql_port']) +else + AC_MSG_RESULT([default]) +fi + +# Create options file. +# +AC_CONFIG_COMMANDS([pgsql.options], + [ + rm -f db.options + echo '#! /bin/sh' >db-driver + + if test x$pgsql_user_set = xyes; then + echo "--user '$pgsql_user'" >>db.options + echo 'opt="$opt --user='"$pgsql_user"'"' >>db-driver + fi + + if test x$pgsql_db_set = xyes; then + echo "--database '$pgsql_db'" >>db.options + echo 'opt="$opt --database='"$pgsql_db"'"' >>db-driver + fi + + if test x$pgsql_host_set = xyes; then + echo "--host '$pgsql_host'" >>db.options + echo 'opt="$opt --host='"$pgsql_host"'"' >>db-driver + fi + + if test x$pgsql_port_set = xyes; then + echo "--port '$pgsql_port'" >>db.options + echo 'opt="$opt --port='"$pgsql_port"'"' >>db-driver + fi + + echo 'if test x$[]1 != x; then' >>db-driver + echo " exec $pgsql_client "'$opt <$[]1' >>db-driver + echo "else" >>db-driver + echo " exec $pgsql_client "'$opt' >>db-driver + echo "fi" >>db-driver + + chmod +x db-driver + ], + [ + pgsql_client="$pgsql_client" + + pgsql_user="$pgsql_user" + pgsql_user_set="$pgsql_user_set" + + pgsql_db="$pgsql_db" + pgsql_db_set="$pgsql_db_set" + + pgsql_host="$pgsql_host" + pgsql_host_set="$pgsql_host_set" + + pgsql_port="$pgsql_port" + pgsql_port_set="$pgsql_port_set" + ]) + +])dnl -- cgit v1.1 From b7ca2b519294846af507f3af1aeb6244b981710d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 16:01:57 +0200 Subject: Correct makefile ommissions --- pgsql/template/makefile | 2 +- qt/makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 6dc0aad..518cab0 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -6,7 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := +odb_hdr := test.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) diff --git a/qt/makefile b/qt/makefile index a631f24..a835d49 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite +all_dirs := common mysql sqlite pgsql dirs := common ifeq ($(db_id),mysql) -- cgit v1.1 From 2d35fd6888551bc67fedcc82c46d581493fa8e0d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 16:02:44 +0200 Subject: Update INSTALL to include PostgreSQL --- INSTALL | 1 + 1 file changed, 1 insertion(+) diff --git a/INSTALL b/INSTALL index 80ab556..0eaa492 100644 --- a/INSTALL +++ b/INSTALL @@ -3,6 +3,7 @@ system you would like to use. Valid values for are: 'mysql' - The MySQL database system 'sqlite' - The SQLite database system + 'pgsql' - The PostgreSQL database system Prerequisites ============= -- cgit v1.1 From 2444bf9614be69133caf8a09730f4443f1bf4f8d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 16:05:58 +0200 Subject: Add PostgreSQL driver and options for Windows --- pgsql-driver.bat | 46 ++++++++++++++++++++++++++++++++++++++++++++++ pgsql.options | 8 ++++++++ 2 files changed, 54 insertions(+) create mode 100644 pgsql-driver.bat create mode 100644 pgsql.options diff --git a/pgsql-driver.bat b/pgsql-driver.bat new file mode 100644 index 0000000..821a17e --- /dev/null +++ b/pgsql-driver.bat @@ -0,0 +1,46 @@ +@echo off +rem file : pgsql-driver.bat +rem author : Constantin Michael +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem pgsql-driver.bat sql-file +rem +rem Run the pgsql client on the SQL file specified. Adjust the +rem option below to match your PostgreSQL setup. +rem + +setlocal + +set "options=%PGSQL_OPTIONS%" +set "options=%options% --user=odb_test" +set "options=%options% --database=odb_test" +rem set "options=%options% --host=" +rem set "options=%options% --post=" + +set "pgsql=%PGSQL_CLIENT%" + +if "_%pgsql%_" == "__" set "pgsql=psql" + +if "_%1_" == "__" ( + echo no sql file specified + goto usage +) + +%pgsql% %options% < %1 + +if errorlevel 1 goto error +goto end + +:usage +echo. +echo usage: pgsql-driver.bat sql-file +echo. + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/pgsql.options b/pgsql.options new file mode 100644 index 0000000..355b64c --- /dev/null +++ b/pgsql.options @@ -0,0 +1,8 @@ +# Sample PostgreSQL options file used to run the tests. Adjust to +# match your PostgreSQL setup. +# + +--user odb_test +--database odb_test +# --host +# --port -- cgit v1.1 From fd9aeac5a068a1fe6c9c91724003e68dc3aa13c2 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 16:06:45 +0200 Subject: Link PostgreSQL template Visual Studio solutions to libodb-pgsql runtime --- qt/pgsql/template/template-vc10.vcxproj | 8 ++++---- qt/pgsql/template/template-vc9.vcproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj index e9481f5..f34826c 100644 --- a/qt/pgsql/template/template-vc10.vcxproj +++ b/qt/pgsql/template/template-vc10.vcxproj @@ -93,7 +93,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) Console true true diff --git a/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj index d03c0aa..7bd0e4a 100644 --- a/qt/pgsql/template/template-vc9.vcproj +++ b/qt/pgsql/template/template-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Fri, 22 Jul 2011 17:22:28 +0200 Subject: Correct linker options to import pgsql runtime --- boost/pgsql/template/template-vc10.vcxproj | 8 ++++---- boost/pgsql/template/template-vc9.vcproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj index a9d55eb..4706add 100644 --- a/boost/pgsql/template/template-vc10.vcxproj +++ b/boost/pgsql/template/template-vc10.vcxproj @@ -93,7 +93,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) Console true true diff --git a/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj index 82cd1eb..64463ef 100644 --- a/boost/pgsql/template/template-vc9.vcproj +++ b/boost/pgsql/template/template-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Fri, 22 Jul 2011 17:24:53 +0200 Subject: Correct typo in file info header --- pgsql/truncation/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 0cd2852..d472b52 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,4 +1,4 @@ -// file : mysql/truncation/test.hxx +// file : pgsql/truncation/test.hxx // author : Boris Kolpackov // author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -- cgit v1.1 From 5444c6e9632ffc4233589c633eac756d0a49759a Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 17:26:51 +0200 Subject: Correct the database identifier being used in pgsql test batch files --- boost/pgsql/test.bat | 2 +- qt/pgsql/test.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 50322cd..bcbab16 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -31,7 +31,7 @@ rem if exist %dir%\driver.exe ( echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 + call %topdir%\tester.bat pgsql %2 %3 if errorlevel 1 ( set "failed=%failed% %1\%3\%2" ) diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index f56125e..02da4cd 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -31,7 +31,7 @@ rem if exist %dir%\driver.exe ( echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 + call %topdir%\tester.bat pgsql %2 %3 if errorlevel 1 ( set "failed=%failed% %1\%3\%2" ) -- cgit v1.1 From 2d3eaea64ddeae9c550e4b84c0faa74c9dde22b7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 17:28:31 +0200 Subject: Correct typo --- m4/pgsql.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 0646fec..2a488ec 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -30,7 +30,7 @@ AC_ARG_WITH( $pgsql_client --version 2>/dev/null 1>&2 if test x"$?" = x0; then - AC_MSG_RESULT([$psql_client]) + AC_MSG_RESULT([$pgsql_client]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([pgsql client is not found; consider using --with-pgsql-client=PATH]) -- cgit v1.1 From 7ce4326acc1580f5d02ef5c54656364aa50b3494 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 17:30:40 +0200 Subject: Include messages regarding trusted test database user in automake messages --- m4/pgsql.m4 | 4 ++-- pgsql-driver.bat | 4 ++++ pgsql.options | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 2a488ec..b050ce1 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -41,7 +41,7 @@ fi AC_MSG_CHECKING([for pgsql database user]) AC_ARG_WITH( [pgsql-user], - [AC_HELP_STRING([--with-pgsql-user=login], [PostgreSQL database user (odb_test by default)])], + [AC_HELP_STRING([--with-pgsql-user=login], [PostgreSQL database user (odb_test by default). The user must be able to login without specifying a password.])], [case $withval in yes) pgsql_user=odb_test @@ -97,7 +97,7 @@ fi AC_MSG_CHECKING([for pgsql database host]) AC_ARG_WITH( [pgsql-host], - [AC_HELP_STRING([--with-pgsql-host=host], [PostgreSQL database host (standard PostgreSQL host by default)])], + [AC_HELP_STRING([--with-pgsql-host=host], [PostgreSQL database host (localhost by default)])], [case $withval in yes) pgsql_host= diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 821a17e..8851e69 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -14,7 +14,11 @@ rem setlocal set "options=%PGSQL_OPTIONS%" + +rem This user must be able to login without specifying a password +rem set "options=%options% --user=odb_test" + set "options=%options% --database=odb_test" rem set "options=%options% --host=" rem set "options=%options% --post=" diff --git a/pgsql.options b/pgsql.options index 355b64c..841de56 100644 --- a/pgsql.options +++ b/pgsql.options @@ -2,6 +2,8 @@ # match your PostgreSQL setup. # +# This use must be able to login without specifying a password. +# --user odb_test --database odb_test # --host -- cgit v1.1 From 6b224b9b316fd3c3d7642ba7ace2dd6b2cdcf953 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jul 2011 17:50:49 +0200 Subject: Cosmetic changes --- pgsql-driver.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 8851e69..d2affdd 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -15,7 +15,7 @@ setlocal set "options=%PGSQL_OPTIONS%" -rem This user must be able to login without specifying a password +rem This user must be able to login without specifying a password. rem set "options=%options% --user=odb_test" -- cgit v1.1 From aa82673655e7aecd7cf2e7e9b5fd407eee2b01f2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jul 2011 14:06:22 +0200 Subject: Test automatic and custom ENUM mappings --- mysql/types/driver.cxx | 3 ++- mysql/types/test.hxx | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 31ccde1..6625adf 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -78,7 +78,8 @@ main (int argc, char* argv[]) o.bit_.c = 0; o.bit_.d = 1; - o.enum_ = green; + o.enum_def_ = green; + o.enum_cst_ = blue; o.enum_str_ = "green"; o.set_.insert ("green"); o.set_.insert ("red"); diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index fa1d7b3..209782e 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -210,12 +210,17 @@ struct object // Test ENUM representations (integer and string). // - color enum_; + color enum_def_; - #pragma db type ("ENUM ('red', 'green', 'blue')") + // Map to a custom MySQL ENUM type. + // + #pragma db type ("ENUM('R', 'G', 'B')") + color enum_cst_; + + #pragma db type ("ENUM('red', 'green', 'blue')") std::string enum_str_; - #pragma db type ("SET ('red', 'green', 'blue')") + #pragma db type ("SET('red', 'green', 'blue')") set set_; // Test NULL value. @@ -261,7 +266,8 @@ struct object longtext_ == y.longtext_ && longblob_ == y.longblob_ && bit_ == y.bit_ && - enum_ == y.enum_ && + enum_def_ == y.enum_def_ && + enum_cst_ == y.enum_cst_ && enum_str_ == y.enum_str_ && set_ == y.set_ && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); -- cgit v1.1 From b8fe0a2a11f3d51e969128c7f02a83cf9b9d65df Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jul 2011 14:49:29 +0200 Subject: Add pragma for setting type's or member's default value New pragma: default. New test: default. --- common/default/driver.cxx | 76 ++++++++++++++++++++++++++++++++ common/default/makefile | 109 ++++++++++++++++++++++++++++++++++++++++++++++ common/default/test.hxx | 70 +++++++++++++++++++++++++++++ common/default/test.std | 0 common/makefile | 1 + 5 files changed, 256 insertions(+) create mode 100644 common/default/driver.cxx create mode 100644 common/default/makefile create mode 100644 common/default/test.hxx create mode 100644 common/default/test.std diff --git a/common/default/driver.cxx b/common/default/driver.cxx new file mode 100644 index 0000000..32c1923 --- /dev/null +++ b/common/default/driver.cxx @@ -0,0 +1,76 @@ +// file : common/default/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test default values. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Insert an object using an ad-hoc SQL statement. This way + // we get all the default values. + // + { + transaction t (db->begin ()); + db->execute ("INSERT INTO object (obj_id) VALUES (1)"); + t.commit (); + } + + // Now load the object and check all the values. + // + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + t.commit (); + + assert (o->b); + assert (o->pi == 1234); + assert (o->ni == -1234); + assert (o->zi == 0); + assert (o->pf == 1.234); + assert (o->nf == -1.234); + assert (o->zf == 0.0); + assert (o->sf == 1.123e+10); + assert (o->str == "Someone's string"); + assert (o->e == green); + } + + // Check the NULL default value using a query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::null.is_null ())); + assert (!r.empty ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/default/makefile b/common/default/makefile new file mode 100644 index 0000000..fd77d01 --- /dev/null +++ b/common/default/makefile @@ -0,0 +1,109 @@ +# file : common/default/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) --generate-schema \ +--generate-query +$(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 schema) + $(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/default/test.hxx b/common/default/test.hxx new file mode 100644 index 0000000..a676753 --- /dev/null +++ b/common/default/test.hxx @@ -0,0 +1,70 @@ +// file : common/default/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 +#include + +enum color {red, green, blue}; + +typedef unsigned long ulong; +#pragma db value(ulong) default(0) // @@ Can't do value(unsigned long). + +#pragma db object +struct object +{ + #pragma db id + unsigned long obj_id; + + // NULL. + // + #pragma db null default(null) + unsigned long null; + + // Boolean. + // + #pragma db default(true) + bool b; + + // Integers. + // + #pragma db default(1234) + unsigned long pi; + + #pragma db default(-1234) + long ni; + + // 0 default taken from the type. + unsigned long zi; + + // Floats. + // + #pragma db default(1.234) + double pf; + + #pragma db default(-1.234) + double nf; + + #pragma db default(0.0) + double zf; + + #pragma db default(1.123e+10) + double sf; + + // Strings. MySQL doesn't support default values on TEXT + // columns, so make the type VARCHAR. + // + #pragma db type("VARCHAR(64)") default("Someone's string") + std::string str; + + // Enums. + // + #pragma db default(green) + color e; +}; + +#endif // TEST_HXX diff --git a/common/default/test.std b/common/default/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index d2e8b0f..a27d212 100644 --- a/common/makefile +++ b/common/makefile @@ -12,6 +12,7 @@ composite \ const \ container \ ctor \ +default \ enum \ inheritance \ inverse \ -- cgit v1.1 From 410dc35736fe8065ac3d4a5fb3a736cc77349d79 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jul 2011 21:12:40 +0200 Subject: Add mising database macro --- libcommon/common/config.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 8a504a0..dba0b12 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -11,6 +11,7 @@ #undef DATABASE_MYSQL #undef DATABASE_SQLITE +#undef DATABASE_PGSQL #undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB -- cgit v1.1 From b862c7f3c88db5647981fb2c3cc158c6158b34a4 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 21:12:39 +0200 Subject: Add pgsql to list of databases in bootstrap makefile --- build/bootstrap.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index 07296c3..3c5ca1e 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -62,7 +62,7 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql sqlite +databases := mysql sqlite pgsql $(dist): databases := $(databases) # $1 project template without the -vcN.vc[x]proj suffix. -- cgit v1.1 From e5cc731b88d46b66973a658dc4861edc9c672781 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 21:13:21 +0200 Subject: Disable notifications and warnings in Windows psql --- pgsql-driver.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pgsql-driver.bat b/pgsql-driver.bat index d2affdd..aa58dc9 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -22,6 +22,8 @@ set "options=%options% --user=odb_test" set "options=%options% --database=odb_test" rem set "options=%options% --host=" rem set "options=%options% --post=" +set "options=%options% --quiet" +set "PGOPTIONS=--client-min-messages=warning" set "pgsql=%PGSQL_CLIENT%" -- cgit v1.1 From 88ddb093213111e35373806cfd360b7db5176858 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 21:13:59 +0200 Subject: Correct psql option from --database to --dbname --- m4/pgsql.m4 | 4 ++-- pgsql-driver.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index b050ce1..f9e0a8e 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -159,8 +159,8 @@ AC_CONFIG_COMMANDS([pgsql.options], fi if test x$pgsql_db_set = xyes; then - echo "--database '$pgsql_db'" >>db.options - echo 'opt="$opt --database='"$pgsql_db"'"' >>db-driver + echo "--dbname '$pgsql_db'" >>db.options + echo 'opt="$opt --dbname='"$pgsql_db"'"' >>db-driver fi if test x$pgsql_host_set = xyes; then diff --git a/pgsql-driver.bat b/pgsql-driver.bat index aa58dc9..40cfedf 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -19,7 +19,7 @@ rem This user must be able to login without specifying a password. rem set "options=%options% --user=odb_test" -set "options=%options% --database=odb_test" +set "options=%options% --dbname=odb_test" rem set "options=%options% --host=" rem set "options=%options% --post=" set "options=%options% --quiet" -- cgit v1.1 From 5b78516b5cda14a6c059091f3f2d4b3eb3b32cb8 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 21:45:26 +0200 Subject: Add db.options and db-driver.bat files to dist --- makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index f05edb5..cbbfa78 100644 --- a/makefile +++ b/makefile @@ -28,7 +28,8 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): data_dist := GPLv2 LICENSE README INSTALL version test.bat \ -tester.bat mysql-driver.bat mysql.options +tester.bat mysql-driver.bat mysql.options sqlite-driver.bat \ +sqlite.options pgsql-driver.bat pgsql.options $(dist): exec_dist := bootstrap tester.in $(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat $(dist): export version = $(shell cat $(src_root)/version) -- cgit v1.1 From 8342d9b882bd93c1c5934280cf319feb822e66c1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 21:45:41 +0200 Subject: Quieten psql notifications and warnings for dist build tests --- m4/pgsql.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index f9e0a8e..f8680f6 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -173,6 +173,9 @@ AC_CONFIG_COMMANDS([pgsql.options], echo 'opt="$opt --port='"$pgsql_port"'"' >>db-driver fi + echo 'opt=$opt --quiet' >>db-driver + echo 'export PGOPTIONS=--client-min-messages=warning' >>db-driver + echo 'if test x$[]1 != x; then' >>db-driver echo " exec $pgsql_client "'$opt <$[]1' >>db-driver echo "else" >>db-driver -- cgit v1.1 From d08c9fde0a20073cafd86e14983702eb84bd0626 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sat, 23 Jul 2011 22:04:38 +0200 Subject: Correct misquoted variable during driver generation --- m4/pgsql.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index f8680f6..4941e5e 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -173,7 +173,7 @@ AC_CONFIG_COMMANDS([pgsql.options], echo 'opt="$opt --port='"$pgsql_port"'"' >>db-driver fi - echo 'opt=$opt --quiet' >>db-driver + echo 'opt="$opt --quiet"' >>db-driver echo 'export PGOPTIONS=--client-min-messages=warning' >>db-driver echo 'if test x$[]1 != x; then' >>db-driver -- cgit v1.1 From ecc8b93c2378988d8c13285eb02d4dc3e977c2ea Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sun, 24 Jul 2011 19:36:35 +0200 Subject: Correct bug in calculation of varbit byte length --- pgsql/types/traits.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index be45aa8..de56dc0 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -129,7 +129,7 @@ namespace odb details::endian_traits::ntoh ( *reinterpret_cast (b.data ()))); - std::size_t byte_len = v.size / 8 + v.size % 8 > 0 ? 1 : 0; + std::size_t byte_len = v.size / 8 + (v.size % 8 > 0 ? 1 : 0); assert (n >= byte_len + 4); v.ubuffer_.assign (b.data () + 4, byte_len); -- cgit v1.1 From 7c7b082d362aa3d7ebdedf190a7e6a683c484a35 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sun, 24 Jul 2011 19:38:36 +0200 Subject: Remove all references to NUMERIC --- pgsql/types/driver.cxx | 1 - pgsql/types/test.hxx | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 17f48f4..aba7220 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -38,7 +38,6 @@ main (int argc, char* argv[]) o.float_ = 1.123F; o.float8_ = 1.123; o.double_ = 1.123; - // o.numeric_ = "123.456"; o.date_ = 4015; o.time_ = 48180000000; diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index ac1ed11..48c30ee 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -47,7 +47,7 @@ struct varbit std::size_t byte_len = size / 8; - if (std::memcmp (ubuffer_.data (), x.ubuffer_.data (), byte_len != 0)) + if (std::memcmp (ubuffer_.data (), x.ubuffer_.data (), byte_len) != 0) return false; std::size_t trailing_bits = size % 8; @@ -116,9 +116,6 @@ struct object #pragma db type ("DOUBLE PRECISION") double double_; - // #pragma db type ("NUMERIC(6,3)") - // std::string numeric_; - // Data-time types. // #pragma db type ("DATE") @@ -176,7 +173,6 @@ struct object float_ == y.float_ && float8_ == y.float8_ && double_ == y.double_ && - // numeric__ == y.numeric_ && date_ == y.date_ && time_ == y.time_ && timestamp_ == y.timestamp_ && -- cgit v1.1 From 49a3db4b58ce47f78662faf4aad1ea54fd804bdf Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sun, 24 Jul 2011 19:42:10 +0200 Subject: Correct misspelt psql option from --post to --port --- pgsql-driver.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 40cfedf..e87db4f 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -21,7 +21,7 @@ set "options=%options% --user=odb_test" set "options=%options% --dbname=odb_test" rem set "options=%options% --host=" -rem set "options=%options% --post=" +rem set "options=%options% --port=" set "options=%options% --quiet" set "PGOPTIONS=--client-min-messages=warning" -- cgit v1.1 From 92cdbe070aa7c78bc330c5b3d2cf00a7cf5f13a3 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sun, 24 Jul 2011 19:42:29 +0200 Subject: Correct invalid psql option from --user to --username --- m4/pgsql.m4 | 4 ++-- pgsql-driver.bat | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 4941e5e..ab580e2 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -154,8 +154,8 @@ AC_CONFIG_COMMANDS([pgsql.options], echo '#! /bin/sh' >db-driver if test x$pgsql_user_set = xyes; then - echo "--user '$pgsql_user'" >>db.options - echo 'opt="$opt --user='"$pgsql_user"'"' >>db-driver + echo "--username '$pgsql_user'" >>db.options + echo 'opt="$opt --username='"$pgsql_user"'"' >>db-driver fi if test x$pgsql_db_set = xyes; then diff --git a/pgsql-driver.bat b/pgsql-driver.bat index e87db4f..338d00d 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -17,7 +17,7 @@ set "options=%PGSQL_OPTIONS%" rem This user must be able to login without specifying a password. rem -set "options=%options% --user=odb_test" +set "options=%options% --username=odb_test" set "options=%options% --dbname=odb_test" rem set "options=%options% --host=" -- cgit v1.1 From d96a16459bd00bcb48ce10f7d5e7352b9c786908 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 08:43:25 +0200 Subject: Correct spelling mistake in option name --- mysql-driver.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-driver.bat b/mysql-driver.bat index 9edeaf8..b11b1e6 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -18,7 +18,7 @@ set "options=%options% --user=odb_test" set "options=%options% --database=odb_test" rem set "options=%options% --password=" rem set "options=%options% --host=" -rem set "options=%options% --post=" +rem set "options=%options% --port=" rem set "options=%options% --socket=" set "mysql=%MYSQL_CLIENT%" -- cgit v1.1 From cf9075cb45b67c8c8c5075a089fc0bf12c7215c9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 08:43:36 +0200 Subject: Add missing pgsql value --- m4/database.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/database.m4 b/m4/database.m4 index 476ec19..968f764 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -13,7 +13,7 @@ AC_MSG_CHECKING([for database to use]) AC_ARG_WITH( [database], [AC_HELP_STRING([--with-database=db], - [database to use for tests; valid values are: 'mysql', 'sqlite'])], + [database to use for tests; valid values are: 'mysql', 'sqlite', and 'pgsql'])], [case $withval in no | yes) AC_MSG_RESULT([]) -- cgit v1.1 From ee488775180691f067304629242094bd65770bac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 08:47:05 +0200 Subject: Use initialization syntax instead of assignment --- pgsql/types/traits.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index de56dc0..b3aec70 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -129,7 +129,7 @@ namespace odb details::endian_traits::ntoh ( *reinterpret_cast (b.data ()))); - std::size_t byte_len = v.size / 8 + (v.size % 8 > 0 ? 1 : 0); + std::size_t byte_len (v.size / 8 + (v.size % 8 > 0 ? 1 : 0)); assert (n >= byte_len + 4); v.ubuffer_.assign (b.data () + 4, byte_len); -- cgit v1.1 From fbcc669bfbef709ebd26de18d41cfae47918221e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 09:25:48 +0200 Subject: Bump version to 1.5.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 88c5fb8..bc80560 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.4.0 +1.5.0 -- cgit v1.1 From 0c99ca62128b333b95a3e0289f94affaf6f499f6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 21:52:57 +0200 Subject: Add type qualifier to large integer literals --- pgsql/types/driver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index aba7220..745d2ee 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -40,8 +40,8 @@ main (int argc, char* argv[]) o.double_ = 1.123; o.date_ = 4015; - o.time_ = 48180000000; - o.timestamp_ = 346896000; + o.time_ = 48180000000LL; + o.timestamp_ = 346896000LL; string short_str (128, 's'); string medium_str (250, 'm'); -- cgit v1.1 From 7c492394108c5af6a29cd78aa5881b579d30a514 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Jul 2011 21:54:12 +0200 Subject: Export variable separately to be compatible with POSIX shell --- m4/pgsql.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index ab580e2..a75a95e 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -174,7 +174,8 @@ AC_CONFIG_COMMANDS([pgsql.options], fi echo 'opt="$opt --quiet"' >>db-driver - echo 'export PGOPTIONS=--client-min-messages=warning' >>db-driver + echo 'PGOPTIONS=--client-min-messages=warning' >>db-driver + echo 'export PGOPTIONS' >>db-driver echo 'if test x$[]1 != x; then' >>db-driver echo " exec $pgsql_client "'$opt <$[]1' >>db-driver -- cgit v1.1 From a461f6d8bc6c314249057ad48fa8dd1cea1d8b40 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jul 2011 17:00:12 +0200 Subject: Bump version to 1.6.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index bc80560..dc1e644 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.5.0 +1.6.0 -- cgit v1.1 From ab1487672afb5180bd17c9d26b35196bd06f6cda Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Jul 2011 09:45:36 +0200 Subject: Add value_traits specializations for std::vector This allows using it as a buffer for BLOB mapping. --- mysql/types/driver.cxx | 19 ++++++++++--------- mysql/types/test.hxx | 3 ++- mysql/types/traits.hxx | 39 +-------------------------------------- pgsql/types/driver.cxx | 3 +-- pgsql/types/test.hxx | 3 ++- pgsql/types/traits.hxx | 39 +-------------------------------------- sqlite/types/driver.cxx | 4 ++-- sqlite/types/test.hxx | 5 ++--- sqlite/types/traits.hxx | 39 +-------------------------------------- 9 files changed, 22 insertions(+), 132 deletions(-) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 6625adf..f397084 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -54,24 +54,25 @@ main (int argc, char* argv[]) o.year_ = 2010; string short_str (128, 's'); - buffer short_buf (short_str.c_str (), short_str.size ()); string medium_str (250, 'm'); - buffer medium_buf (medium_str.c_str (), medium_str.size ()); string long_str (2040, 'l'); - buffer long_buf (long_str.c_str (), long_str.size ()); + + const char* sb (short_str.c_str ()), *se (sb + short_str.size ()); + const char* mb (medium_str.c_str ()), *me (mb + medium_str.size ()); + const char* lb (long_str.c_str ()), *le (lb + long_str.size ()); o.char_ = short_str; - o.binary_ = short_buf; + o.binary_.assign (sb, se); o.varchar_ = medium_str; - o.varbinary_ = medium_buf; + o.varbinary_.assign (mb, me); o.tinytext_ = short_str; - o.tinyblob_ = short_buf; + o.tinyblob_.assign (sb, se); o.text_ = long_str; - o.blob_ = long_buf; + o.blob_.assign (lb, le); o.mediumtext_ = long_str; - o.mediumblob_ = long_buf; + o.mediumblob_.assign (lb, le); o.longtext_ = long_str; - o.longblob_ = long_buf; + o.longblob_.assign (lb, le); o.bit_.a = 1; o.bit_.b = 0; diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 209782e..1f6b771 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -8,11 +8,12 @@ #include #include +#include #include // std::auto_ptr #include -#include +typedef std::vector buffer; struct date_time { diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 2698afc..09d50a1 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -10,7 +10,7 @@ #include -#include "test.hxx" // date_time, buffer, string_ptr +#include "test.hxx" // date_time, string_ptr namespace odb { @@ -57,43 +57,6 @@ namespace odb }; template <> - class value_traits - { - public: - typedef buffer value_type; - typedef buffer query_type; - typedef details::buffer image_type; - - static void - set_value (buffer& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - v.assign (b.data (), n); - else - v.assign (0, 0); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const buffer& v) - { - is_null = false; - n = v.size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v.data (), n); - } - }; - - template <> class value_traits { public: diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 745d2ee..d6d675c 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -51,8 +51,7 @@ main (int argc, char* argv[]) o.varchar_ = medium_str; o.text_ = long_str; - buffer long_buf (long_str.c_str (), long_str.size ()); - o.bytea_ = long_buf; + o.bytea_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); unsigned char varbit_buf[8] = {1, 3, 1, 3, 1, 3, 1, 3}; o.varbit_.size = 52; diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 48c30ee..500887a 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -8,6 +8,7 @@ #include #include +#include #include // std::auto_ptr #include // std::memcmp #include // std::size_t @@ -139,7 +140,7 @@ struct object std::string text_; #pragma db type ("BYTEA") - buffer bytea_; + std::vector bytea_; #pragma db type ("VARBIT(1024)") varbit varbit_; diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index b3aec70..9852727 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -12,49 +12,12 @@ #include #include -#include "test.hxx" // varbit, buffer, ubuffer, string_ptr +#include "test.hxx" // varbit, ubuffer, string_ptr namespace odb { namespace pgsql { - template <> - class value_traits - { - public: - typedef buffer value_type; - typedef buffer query_type; - typedef details::buffer image_type; - - static void - set_value (buffer& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - v.assign (b.data (), n); - else - v.assign (0, 0); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const buffer& v) - { - is_null = false; - n = v.size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v.data (), n); - } - }; - // The first 4 bytes of the image is a signed int specifying the // number of significant bits contained by the BIT. The following // bytes contain the bit data. diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 855cada..3c14c7a 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include #include #include "test.hxx" @@ -35,10 +36,9 @@ main (int argc, char* argv[]) o.real_ = 1.123; string long_str (2040, 'l'); - buffer long_buf (long_str.c_str (), long_str.size ()); o.text_ = long_str; - o.blob_ = long_buf; + o.blob_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); { transaction t (db->begin ()); diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 22cde8e..79b0a33 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -8,12 +8,11 @@ #include #include +#include #include // std::auto_ptr #include -#include - typedef std::auto_ptr string_ptr; #pragma db object @@ -44,7 +43,7 @@ struct object std::string text_; #pragma db type ("BLOB") - buffer blob_; + std::vector blob_; // Test NULL value. // diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 70b7b26..486e608 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -10,50 +10,13 @@ #include -#include "test.hxx" // buffer, string_ptr +#include "test.hxx" // string_ptr namespace odb { namespace sqlite { template <> - class value_traits - { - public: - typedef buffer value_type; - typedef buffer query_type; - typedef details::buffer image_type; - - static void - set_value (buffer& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - v.assign (b.data (), n); - else - v.assign (0, 0); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const buffer& v) - { - is_null = false; - n = v.size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v.data (), n); - } - }; - - template <> class value_traits { public: -- cgit v1.1 From 84b6d8488a2415c1c6c91b2234993497ab8f792b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Aug 2011 13:23:54 +0200 Subject: Style changes --- pgsql/types/traits.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 9852727..ae3bd9e 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -140,7 +140,7 @@ namespace odb static void set_value (unsigned char v[16], - unsigned char const* i, + const unsigned char* i, bool is_null) { if (!is_null) @@ -150,7 +150,7 @@ namespace odb } static void - set_image (unsigned char* i, bool& is_null, unsigned char const v[16]) + set_image (unsigned char* i, bool& is_null, const unsigned char v[16]) { is_null = false; std::memcpy (i, v, 16); -- cgit v1.1 From 18ef14486e46064f4317ab407c5fe0afa3209d4b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Aug 2011 13:29:43 +0200 Subject: Add support for value wrappers Wrapper is a class that wraps another type. Examples of wrappers are various smart pointers, holders, etc. A wrapper can be transparent or it can handle the NULL semantics. The new odb::nullable class template is a NULL wrapper that helps to add the NULL semantics to a value type. New test: common/wrapper. --- common/makefile | 3 +- common/wrapper/driver.cxx | 73 +++++++++++++++++++++++++++++++ common/wrapper/makefile | 108 ++++++++++++++++++++++++++++++++++++++++++++++ common/wrapper/test.hxx | 53 +++++++++++++++++++++++ common/wrapper/test.std | 0 mysql/types/makefile | 2 +- 6 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 common/wrapper/driver.cxx create mode 100644 common/wrapper/makefile create mode 100644 common/wrapper/test.hxx create mode 100644 common/wrapper/test.std diff --git a/common/makefile b/common/makefile index a27d212..522cc4c 100644 --- a/common/makefile +++ b/common/makefile @@ -21,7 +21,8 @@ lifecycle \ query \ relationship \ schema \ -template +template \ +wrapper thread_tests := threads diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx new file mode 100644 index 0000000..ed4d83f --- /dev/null +++ b/common/wrapper/driver.cxx @@ -0,0 +1,73 @@ +// file : common/wrapper/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test wrapper machinery. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + unsigned long id; + { + object o; + o.num.reset (new unsigned long (123)); + o.nstrs.push_back (nullable_string ()); + o.nstrs.push_back (nullable_string ("123")); +#ifdef HAVE_TR1_MEMORY + o.tr1_strs.push_back (tr1_nullable_string ()); + o.tr1_strs.push_back (tr1_nullable_string (new string ("123"))); +#endif + + transaction t (db->begin ()); + id = db->persist (o); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + auto_ptr o (db->load (id)); + t.commit (); + + assert (*o->num == 123); + assert (o->str.get () == 0); + assert (o->nstr.null ()); + assert (o->nstrs[0].null ()); + assert (o->nstrs[1].get () == "123"); +#ifdef HAVE_TR1_MEMORY + assert (!o->tr1_str); + assert (!o->tr1_strs[0]); + assert (*o->tr1_strs[1] == "123"); +#endif + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/wrapper/makefile b/common/wrapper/makefile new file mode 100644 index 0000000..3a9b98d --- /dev/null +++ b/common/wrapper/makefile @@ -0,0 +1,108 @@ +# file : common/wrapper/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) --generate-schema +$(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 schema) + $(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/wrapper/test.hxx b/common/wrapper/test.hxx new file mode 100644 index 0000000..68a8750 --- /dev/null +++ b/common/wrapper/test.hxx @@ -0,0 +1,53 @@ +// file : common/wrapper/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 // HAVE_TR1_MEMORY + +#include +#include // std::auto_ptr +#include + +#include +#include + +#ifdef HAVE_TR1_MEMORY +# include +#endif + +using odb::nullable; + +typedef nullable nullable_string; + +#ifdef HAVE_TR1_MEMORY +typedef std::tr1::shared_ptr tr1_nullable_string; +#endif + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + std::auto_ptr num; + + #pragma db null + std::auto_ptr str; + + nullable_string nstr; + std::vector nstrs; + +#ifdef HAVE_TR1_MEMORY + #pragma db null + tr1_nullable_string tr1_str; + + #pragma db value_null + std::vector tr1_strs; +#endif +}; + +#endif // TEST_HXX diff --git a/common/wrapper/test.std b/common/wrapper/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/types/makefile b/mysql/types/makefile index 4114128..2b17653 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' +--generate-query --hxx-prologue '\#include "traits.hxx"' $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 0b641f182c0b89b0c903f8756aa14b6b3a2f60f2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Aug 2011 13:32:25 +0200 Subject: Add support for boost::optional and boost::shared_ptr as value wrappers New test: boost/common/optional. --- boost/common/makefile | 5 +- boost/common/optional/driver.cxx | 76 ++++++++++++++++++++++++ boost/common/optional/makefile | 119 ++++++++++++++++++++++++++++++++++++++ boost/common/optional/test.hxx | 33 +++++++++++ boost/common/optional/test.std | 0 boost/common/smart-ptr/driver.cxx | 25 ++++++++ boost/common/smart-ptr/test.hxx | 25 ++++++++ 7 files changed, 281 insertions(+), 2 deletions(-) create mode 100644 boost/common/optional/driver.cxx create mode 100644 boost/common/optional/makefile create mode 100644 boost/common/optional/test.hxx create mode 100644 boost/common/optional/test.std diff --git a/boost/common/makefile b/boost/common/makefile index 5bb9732..8b44c63 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -6,9 +6,10 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ -unordered \ +optional \ smart-ptr \ -template +template \ +unordered all_tests := $(tests) build_tests := $(tests) diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx new file mode 100644 index 0000000..7673e68 --- /dev/null +++ b/boost/common/optional/driver.cxx @@ -0,0 +1,76 @@ +// file : boost/common/optional/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost::optional persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + object o1 (1); + object o2 (2); + o2.str = "abc"; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + auto_ptr o2 (db->load (2)); + t.commit (); + + assert (!o1->str); + assert (o2->str && *o2->str == "abc"); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::str.is_null ())); + assert (!r.empty ()); + } + + { + result r (db->query (query::str == "abc")); + assert (!r.empty ()); + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile new file mode 100644 index 0000000..1b4bf2b --- /dev/null +++ b/boost/common/optional/makefile @@ -0,0 +1,119 @@ +# file : boost/common/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) + +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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) \ +--profile boost/optional --generate-schema --generate-query +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/boost/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 schema) + $(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/boost/common/optional/test.hxx b/boost/common/optional/test.hxx new file mode 100644 index 0000000..519ed94 --- /dev/null +++ b/boost/common/optional/test.hxx @@ -0,0 +1,33 @@ +// file : boost/common/optional/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 + +#include + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + boost::optional str; +}; + +#endif // TEST_HXX diff --git a/boost/common/optional/test.std b/boost/common/optional/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index eaa4bbd..af5767c 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -169,6 +169,31 @@ main (int argc, char* argv[]) t.commit (); } + + // + // Test shared_ptr as a value wrapper. + // + + { + obj2 o1 (1); + obj2 o2 (2); + o2.str.reset (new string ("abc")); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + shared_ptr o1 (db->load (1)); + shared_ptr o2 (db->load (2)); + t.commit (); + + assert (!o1->str); + assert (o2->str && *o2->str == "abc"); + } } catch (const odb::exception& e) { diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 575c2e2..62a9ae6 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -6,13 +6,17 @@ #ifndef TEST_HXX #define TEST_HXX +#include #include +#include + #include #include struct obj; +using boost::shared_ptr; using odb::boost::lazy_shared_ptr; using odb::boost::lazy_weak_ptr; @@ -56,4 +60,25 @@ struct obj lazy_shared_ptr c; }; +// Test shared_ptr as a value wrapper. +// +#pragma db object +struct obj2 +{ + obj2 () + { + } + + obj2 (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db null + shared_ptr str; +}; + #endif // TEST_HXX -- cgit v1.1 From 839a84b996d89dcf3d553af23e4ed5e0e4fa60e2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Aug 2011 13:33:21 +0200 Subject: Add support for Qt QSharedPointer as value wrapper --- qt/common/smart-ptr/driver.cxx | 25 +++++++++++++++++++++++++ qt/common/smart-ptr/test.hxx | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index ee53c57..49e2ae1 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -212,6 +212,31 @@ main (int argc, char* argv[]) t.commit (); } + + // + // Test QSharedPointer as a value wrapper. + // + + { + obj2 o1 (1); + obj2 o2 (2); + o2.num = QSharedPointer (new unsigned long (123)); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + QSharedPointer o1 (db->load (1)); + QSharedPointer o2 (db->load (2)); + t.commit (); + + assert (!o1->num); + assert (o2->num && *o2->num == 123); + } } catch (const odb::exception& e) { diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 0a4ce03..86e4fba 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -8,6 +8,8 @@ #include +#include + #include #include @@ -53,4 +55,25 @@ struct obj QLazySharedPointer c; }; +// Test QSharedPointer as a value wrapper. +// +#pragma db object +struct obj2 +{ + obj2 () + { + } + + obj2 (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db null + QSharedPointer num; +}; + #endif // TEST_HXX -- cgit v1.1 From 458296a902060900487f80219a8762142bb7800e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Aug 2011 11:38:40 +0200 Subject: Fix custom recursive loading in post_load callback Before we called the callback while holding the statements locked. As a result, if the callback tried to load another object of this type, it failed. Now we unlock the statements (since we have completely loaded the object from ODB's point of view) and then call the callback. The callback test has been updated to test this situation. --- common/callback/driver.cxx | 29 +++++++++++++++++++++++++---- common/callback/test.hxx | 17 +++++++++++++++-- common/callback/test.std | 10 ++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 4179168..fc67aac 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -34,9 +34,17 @@ const char* events[] = }; void object:: -db_callback (callback_event e, database&) +db_callback (callback_event e, database& db) { cout << " " << events[e] << " " << id_ << endl; + + // Test custom recursive loading. + // + if (e == callback_event::post_load && ref != 0) + { + robj = db.load (ref); + cout << " " << id_ << ' ' << ref << ' ' << robj->id_ << endl; + } } void object:: @@ -132,23 +140,36 @@ main (int argc, char* argv[]) { object o1 (1, 1); object o2 (2, 2); - object o3 (3, 2); + object o3 (3, 3); + object o4 (4, 4); o1.pobj = &o2; + o1.ref = 4; + o2.pobj = &o3; + o2.ref = 4; transaction t (db->begin ()); db->persist (o1); db->persist (o2); db->persist (o3); + db->persist (o4); t.commit (); } { transaction t (db->begin ()); auto_ptr o1 (db->load (1)); - delete o1->pobj->pobj; - delete o1->pobj; + object* o2 (o1->pobj); + + cout << o1->id_ << ' ' << o1->ref << ' ' << o1->robj->id_ << endl; + cout << o2->id_ << ' ' << o2->ref << ' ' << o2->robj->id_ << endl; + + delete o1->robj; + delete o2->robj; + + delete o2->pobj; + delete o2; t.commit (); } } diff --git a/common/callback/test.hxx b/common/callback/test.hxx index 274e2b5..058a327 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -12,8 +12,15 @@ #pragma db object callback(db_callback) struct object { - object (unsigned long id, unsigned long d): id_ (id), data (d), pobj (0) {} - object (): id_ (0) {}; + object (unsigned long id, unsigned long d) + : id_ (id), data (d), pobj (0), robj (0), ref (0) + { + } + + object () + : id_ (0), pobj (0), robj (0) + { + } #pragma db id unsigned long id_; @@ -22,6 +29,12 @@ struct object object* pobj; + // Test custom recursive loading. + // + #pragma db transient + object* robj; + unsigned long ref; // Unless 0, reference to another object. + void db_callback (odb::callback_event, odb::database&); diff --git a/common/callback/test.std b/common/callback/test.std index 05ae286..c1afa36 100644 --- a/common/callback/test.std +++ b/common/callback/test.std @@ -43,10 +43,20 @@ delayed load post_persist 2 pre_persist 3 post_persist 3 + pre_persist 4 + post_persist 4 pre_load 0 pre_load 0 pre_load 0 post_load 3 post_load 2 + pre_load 0 + post_load 4 + 2 4 4 post_load 1 + pre_load 0 + post_load 4 + 1 4 4 +1 4 4 +2 4 4 *** -- cgit v1.1 From 4cb83ca74184b364b3d03df3d13b175c965f3559 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 Aug 2011 14:08:16 +0200 Subject: Rework query machinery not to use '_' as primary table alias Now we always qualify with the actual table name and use the '_' alias for situations where an object is referencing itself. --- common/callback/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index fc67aac..afd6fb3 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -93,7 +93,7 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query ((query::id < 3) + "ORDER BY _.id")); + result r (db->query ((query::id < 3) + "ORDER BY object.id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { -- cgit v1.1 From ab0fb8ac7e097dcdd3111dc2865f0de14ab27118 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2011 10:47:30 +0200 Subject: Enable foreign key constraints checking in SQLite Due to bugs in SQLite DDL foreign key support, we have to temporarily disable foreign keys when re-creating the schema. New manual section: 12.5.3, "Foreign Key Constraints". --- libcommon/common/common.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 37f8424..47dee81 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -14,6 +14,7 @@ # include # include #elif defined(DATABASE_SQLITE) +# include # include # include # include @@ -81,15 +82,23 @@ create_database (int& argc, db.reset ( new sqlite::database ( - argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, f)); + argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, true, f)); - // Create the database schema. + // Create the database schema. Due to bugs in SQLite foreign key + // support for DDL statements, we need to temporarily disable + // foreign keys. // if (schema) { - transaction t (db->begin ()); + connection_ptr c (db->connection ()); + + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); schema_catalog::create_schema (*db); t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); } #elif defined(DATABASE_PGSQL) auto_ptr f; -- cgit v1.1 From 70a28c298dfe7f047c1390d097c18d5bb0618d07 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2011 11:47:55 +0200 Subject: Add database::erase_query() function New test: common/erase-query. Documentation is in Section 3.9, "Deleting Persistent Objects". The current implementation does not work well with the session (no removal of the erased objects from the cache). --- common/erase-query/driver.cxx | 117 ++++++++++++++++++++++++++++++++++++++++++ common/erase-query/makefile | 109 +++++++++++++++++++++++++++++++++++++++ common/erase-query/test.hxx | 31 +++++++++++ common/erase-query/test.std | 0 common/makefile | 1 + 5 files changed, 258 insertions(+) create mode 100644 common/erase-query/driver.cxx create mode 100644 common/erase-query/makefile create mode 100644 common/erase-query/test.hxx create mode 100644 common/erase-query/test.std diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx new file mode 100644 index 0000000..67d4e8d --- /dev/null +++ b/common/erase-query/driver.cxx @@ -0,0 +1,117 @@ +// file : common/erase-query/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query-based erase. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include // @@ DATABASE_MYSQL +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +void +persist (database& db) +{ + object o1 (1); + object o2 (2); + object o3 (3); + object o4 (4); + + transaction t (db.begin ()); + db.persist (o1); + db.persist (o2); + db.persist (o3); + db.persist (o4); + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + + auto_ptr db (create_database (argc, argv)); + + // erase_query() + // + persist (*db); + + { + transaction t (db->begin ()); + assert (db->erase_query () == 4); + t.commit (); + } + + // erase_query(const char*) + // + persist (*db); + + { + transaction t (db->begin ()); + assert (db->erase_query ("id < 3") == 2); + db->erase_query (); + t.commit (); + } + + // erase_query(query) + // + persist (*db); + + { + transaction t (db->begin ()); + assert (db->erase_query (query::id == 2 || query::id == 4) == 2); + db->erase_query (); + t.commit (); + } + + // Make sure container data is deleted. + // + { + object o (1); + o.v.push_back (1); + o.v.push_back (2); + o.v.push_back (3); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query () == 1); + t.commit (); + } + + // @@ Temporarily disabled until we have out-of-line constraints + // in MySQL (coming with evolution support). + // +#ifndef DATABASE_MYSQL + { + transaction t (db->begin ()); + assert (db->execute ("SELECT * FROM object_v WHERE object_id = 1") == 0); + t.commit (); + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/erase-query/makefile b/common/erase-query/makefile new file mode 100644 index 0000000..a31aeab --- /dev/null +++ b/common/erase-query/makefile @@ -0,0 +1,109 @@ +# file : common/erase-query/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) --generate-schema \ +--generate-query +$(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 schema) + $(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/erase-query/test.hxx b/common/erase-query/test.hxx new file mode 100644 index 0000000..be5539f --- /dev/null +++ b/common/erase-query/test.hxx @@ -0,0 +1,31 @@ +// file : common/erase-query/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 + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + std::vector v; +}; + +#endif // TEST_HXX diff --git a/common/erase-query/test.std b/common/erase-query/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 522cc4c..b3af876 100644 --- a/common/makefile +++ b/common/makefile @@ -14,6 +14,7 @@ container \ ctor \ default \ enum \ +erase-query \ inheritance \ inverse \ lazy-ptr \ -- cgit v1.1 From 4fe60ba39a3aeb9d386132506d3baac736c32881 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2011 14:59:11 +0200 Subject: Bump version to 1.6.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index dc1e644..f715635 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.0 +1.6.0.a1 -- cgit v1.1 From 1fca8273447e0048941bbfe8ca23466f103c42f3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Aug 2011 13:42:05 +0200 Subject: Add support for transaction multiplexing Also delay getting a connection until after we do all the sanity checks (e.g., that there is no active transaction). Otherwise we are running risk of getting blocked rather than throwing an exception. --- tracer/transaction/driver.cxx | 6 ++++++ tracer/transaction/test.std | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tracer/transaction/driver.cxx b/tracer/transaction/driver.cxx index f6945d4..e1c7849 100644 --- a/tracer/transaction/driver.cxx +++ b/tracer/transaction/driver.cxx @@ -33,6 +33,12 @@ main () 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. diff --git a/tracer/transaction/test.std b/tracer/transaction/test.std index 8083774..792010c 100644 --- a/tracer/transaction/test.std +++ b/tracer/transaction/test.std @@ -1,5 +1,7 @@ test 001 begin transaction +begin transaction +rollback transaction rollback transaction test 002 begin transaction -- cgit v1.1 From ff3950866c0f756a5b6f379b9f95f01fff4a9ec7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Aug 2011 17:13:55 +0200 Subject: Make tests use unique table prefixes --- boost/common/optional/makefile | 5 +++-- boost/common/smart-ptr/makefile | 3 ++- boost/common/template/makefile | 3 ++- boost/common/unordered/makefile | 3 ++- boost/mysql/date-time/makefile | 2 +- boost/mysql/template/makefile | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/template/makefile | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/template/makefile | 2 +- common/auto/makefile | 3 ++- common/callback/driver.cxx | 3 ++- common/callback/makefile | 2 +- common/composite/makefile | 2 +- common/const/makefile | 2 +- common/container/makefile | 3 ++- common/ctor/makefile | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/enum/makefile | 2 +- common/erase-query/makefile | 2 +- common/inheritance/makefile | 2 +- common/inverse/makefile | 2 +- common/lazy-ptr/makefile | 3 ++- common/lifecycle/makefile | 3 ++- common/query/makefile | 3 ++- common/relationship/makefile | 2 +- common/schema/makefile | 3 ++- common/template/makefile | 3 ++- common/threads/makefile | 2 +- common/wrapper/makefile | 3 ++- mysql/native/driver.cxx | 20 ++++++++++++++------ mysql/template/makefile | 3 ++- mysql/truncation/makefile | 2 +- mysql/types/makefile | 4 ++-- pgsql/native/driver.cxx | 18 ++++++++++++------ pgsql/template/makefile | 3 ++- pgsql/truncation/makefile | 2 +- pgsql/types/makefile | 4 ++-- qt/common/containers/makefile | 3 ++- qt/common/smart-ptr/makefile | 2 +- qt/common/template/makefile | 3 ++- qt/mysql/basic/makefile | 4 ++-- qt/mysql/date-time/makefile | 2 +- qt/mysql/template/makefile | 2 +- qt/pgsql/basic/makefile | 4 ++-- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/template/makefile | 2 +- qt/sqlite/basic/makefile | 4 ++-- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/template/makefile | 2 +- sqlite/native/driver.cxx | 18 ++++++++++++------ sqlite/template/makefile | 3 ++- sqlite/truncation/makefile | 2 +- sqlite/types/makefile | 4 ++-- 55 files changed, 115 insertions(+), 77 deletions(-) diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 1b4bf2b..6145a2d 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,4 +1,4 @@ -# file : boost/common/template/makefile +# file : boost/common/optional/makefile # author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/optional --generate-schema --generate-query +--profile boost/optional --generate-schema --generate-query \ +--table-prefix boost_common_optional_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 45983c9..6d875db 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/smart-ptr --generate-schema +--profile boost/smart-ptr --generate-schema \ +--table-prefix boost_common_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 85000d3..eb2c5f6 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/version --generate-schema # CHANGE boost/version +--profile boost/version --generate-schema \ +--table-prefix boost_common_template_ #@@ CHANGE table prefix, boost/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index f52e2a1..0dd69de 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/unordered --generate-schema +--profile boost/unordered --generate-schema \ +--table-prefix boost_common_unordered_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index e80cf0b..204743e 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost/date-time \ ---generate-schema +--generate-schema --table-prefix boost_mysql_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 1e030fb..0cba62b 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost \ ---generate-schema +--generate-schema --table-prefix boost_mysql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 74e2093..3e64e60 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile boost/date-time \ ---generate-schema +--generate-schema --table-prefix boost_pgsql_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 0d62ab6..986926b 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile boost \ ---generate-schema +--generate-schema --table-prefix boost_pgsql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 84f4924..1f87856 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile boost/date-time \ ---generate-schema +--generate-schema --table-prefix boost_sqlite_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 13f7699..9c107ff 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile boost \ ---generate-schema +--generate-schema --table-prefix boost_sqlite_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/common/auto/makefile b/common/auto/makefile index 7907eb9..1d5b66a 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index afd6fb3..bc5b4f0 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -93,7 +93,8 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query ((query::id < 3) + "ORDER BY object.id")); + result r (db->query ( + (query::id < 3) + "ORDER BY common_callback_object.id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { diff --git a/common/callback/makefile b/common/callback/makefile index 640e148..b24b9ae 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_callback_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/composite/makefile b/common/composite/makefile index c7b21dc..9c4a29d 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_composite_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/const/makefile b/common/const/makefile index d5a233e..d8a1410 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_const_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index 115adb0..fb14cb0 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_container_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/ctor/makefile b/common/ctor/makefile index 9c0c0ee..8271074 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_ctor_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 32c1923..a47051c 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - db->execute ("INSERT INTO object (obj_id) VALUES (1)"); + db->execute ("INSERT INTO common_default_object (obj_id) VALUES (1)"); t.commit (); } diff --git a/common/default/makefile b/common/default/makefile index fd77d01..ce5f9e9 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_default_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/enum/makefile b/common/enum/makefile index a6b16e2..03c4915 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_enum_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/erase-query/makefile b/common/erase-query/makefile index a31aeab..27ac281 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_erase_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index b9715e3..8afa961 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_inheritance_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inverse/makefile b/common/inverse/makefile index 4e393c8..08c02e9 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index ee599d2..24e6e43 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 9dc6dd6..a47d6bf 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/query/makefile b/common/query/makefile index c41b1d5..bcdc9c4 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -36,7 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--table-prefix common_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship/makefile b/common/relationship/makefile index b60f0b2..fa00a78 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_relationship_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/schema/makefile b/common/schema/makefile index 7c67a8b..a0e81eb 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/template/makefile b/common/template/makefile index 34d7faf..eec13b5 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/threads/makefile b/common/threads/makefile index ddc97b9..dd07155 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query +--generate-query --table-prefix common_threads_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 3a9b98d..a8477de 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix common_wrapper_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 437a160..9472cf3 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -30,8 +30,10 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->execute ("DROP TABLE IF EXISTS test"); - db->execute ("CREATE TABLE test (n INT PRIMARY KEY) ENGINE=InnoDB"); + db->execute ("DROP TABLE IF EXISTS mysql_native_test"); + + db->execute ("CREATE TABLE mysql_native_test (n INT PRIMARY KEY) " + "ENGINE=InnoDB"); t.commit (); } @@ -41,8 +43,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); - assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + assert ( + db->execute ("INSERT INTO mysql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO mysql_native_test (n) VALUES (2)") == 1); t.commit (); } @@ -52,8 +57,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); - assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + assert ( + db->execute ("SELECT n FROM mysql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM mysql_native_test WHERE n > 3") == 0); t.commit (); } diff --git a/mysql/template/makefile b/mysql/template/makefile index 5964b0a..e51c862 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema +$(gen) $(dist): export odb_options += --database mysql --generate-schema \ +--table-prefix mysql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 9a4f9b1..def31ba 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-query \ ---generate-schema +--generate-schema --table-prefix mysql_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/types/makefile b/mysql/types/makefile index 2b17653..dab5489 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -36,8 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' - +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--table-prefix mysql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 30e707c..7fc63f6 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -29,8 +29,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->execute ("DROP TABLE IF EXISTS test"); - db->execute ("CREATE TABLE test (n INT PRIMARY KEY)"); + db->execute ("DROP TABLE IF EXISTS pgsql_native_test"); + db->execute ("CREATE TABLE pgsql_native_test (n INT PRIMARY KEY)"); t.commit (); } @@ -40,8 +40,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); - assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (2)") == 1); t.commit (); } @@ -51,8 +54,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); - assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n > 3") == 0); t.commit (); } diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 518cab0..bf6b9c3 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema +$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ +--table-prefix pgsql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index a94639d..6bfe835 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --generate-query \ ---generate-schema +--generate-schema --table-prefix pgsql_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index bdc00ea..0ba6bec 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -36,8 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' - +--generate-query --cxx-prologue '\#include "traits.hxx"' \ +--table-prefix pgsql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index 85aec25..f675c37 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/containers --profile qt/basic --generate-schema +--profile qt/containers --profile qt/basic --generate-schema \ +--table-prefix qt_common_containers_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index a7742f2..21ba8b8 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/smart-ptr --generate-schema +--profile qt/smart-ptr --generate-schema --table-prefix qt_common_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index e3f52f0..d0cb3d8 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -45,7 +45,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/version --generate-schema # CHANGE qt/version +--profile qt/version --generate-schema \ +--table-prefix qt_common_template_ #@@ CHANGE table prefix, qt/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 6d48f0c..dcfac13 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,4 +1,4 @@ -# file : qt/mysql/date-time/makefile +# file : qt/mysql/basic/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile qt/basic \ ---generate-schema +--generate-schema --table-prefix qt_mysql_basic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index ca8e79c..ef50f46 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile qt/date-time \ ---generate-schema +--generate-schema --table-prefix qt_mysql_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index a76f0cc..aa5381d 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -40,7 +40,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile qt \ ---generate-schema +--generate-schema --table-prefix qt_mysql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index ef1057f..977cdca 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,4 +1,4 @@ -# file : qt/pgsql/date-time/makefile +# file : qt/pgsql/basic/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile qt/basic \ ---generate-schema +--generate-schema --table-prefix qt_pgsql_basic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 9d63918..51f8375 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile qt/date-time \ ---generate-schema +--generate-schema --table-prefix qt_pgsql_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 9905b4c..c599c3e 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -40,7 +40,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile qt \ ---generate-schema +--generate-schema --table-prefix qt_pgsql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index e1b1af0..aeede6a 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,4 +1,4 @@ -# file : qt/sqlite/date-time/makefile +# file : qt/sqlite/basic/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile qt/basic \ ---generate-schema +--generate-schema --table-prefix qt_sqlite_basic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 261200a..a105859 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile qt/date-time \ ---generate-schema +--generate-schema --table-prefix qt_sqlite_date_time_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index b19b8ef..b86ba6e 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -40,7 +40,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile qt \ ---generate-schema +--generate-schema --table-prefix qt_sqlite_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 73e0450..7f1d319 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -30,8 +30,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->execute ("DROP TABLE IF EXISTS test"); - db->execute ("CREATE TABLE test (n INTEGER PRIMARY KEY)"); + db->execute ("DROP TABLE IF EXISTS sqlitex_native_test"); + db->execute ("CREATE TABLE sqlitex_native_test (n INTEGER PRIMARY KEY)"); t.commit (); } @@ -41,8 +41,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("INSERT INTO test (n) VALUES (1)") == 1); - assert (db->execute ("INSERT INTO test (n) VALUES (2)") == 1); + assert ( + db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (2)") == 1); t.commit (); } @@ -52,8 +55,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->execute ("SELECT n FROM test WHERE n < 3") == 2); - assert (db->execute ("SELECT n FROM test WHERE n > 3") == 0); + assert ( + db->execute ("SELECT n FROM sqlitex_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM sqlitex_native_test WHERE n > 3") == 0); t.commit (); } diff --git a/sqlite/template/makefile b/sqlite/template/makefile index bf2f178..bb63095 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --generate-schema +$(gen) $(dist): export odb_options += --database sqlite --generate-schema \ +--table-prefix sqlitex_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 8b00a1c..33c7f46 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --generate-query \ ---generate-schema +--generate-schema --table-prefix sqlitex_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 7836a39..bf6235f 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -36,8 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' - +--generate-query --cxx-prologue '\#include "traits.hxx"' \ +--table-prefix sqlitex_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 18dc4c5a4cb46f01ebdd49fbb6baa3c48d8f3b3d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Aug 2011 11:02:20 +0200 Subject: Add experimental code (commented out) for DELETE JOIN support This would be needed to support object relationships in the erase_query() functionality. --- common/erase-query/driver.cxx | 35 ++++++++++++++++++++++++++++++++++- common/erase-query/test.hxx | 19 ++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 67d4e8d..2137377 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -63,7 +63,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - assert (db->erase_query ("id < 3") == 2); + assert (db->erase_query ( + "common_erase_query_object.id < 3") == 2); db->erase_query (); t.commit (); } @@ -79,6 +80,38 @@ main (int argc, char* argv[]) t.commit (); } + // Test predicates involving object pointers (DELETE JOIN). + // + /* + { + object o11 (1); + object o12 (2); + object o13 (3); + object2 o2; + + o11.o2 = &o2; + o2.num = 123; + + o12.o1 = &o13; + o13.num = 123; + + transaction t (db->begin ()); + db->persist (o2); + db->persist (o13); + db->persist (o12); + db->persist (o11); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query (query::o1::num == 123) == 1); + assert (db->erase_query (query::o2::num == 123) == 1); + db->erase_query (); + t.commit (); + } + */ + // Make sure container data is deleted. // { diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index be5539f..781eedd 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -10,15 +10,18 @@ #include +struct object2; + #pragma db object struct object { object (unsigned long id) - : id_ (id) + : id_ (id), o1 (0), o2 (0) { } object () + : o1 (0), o2 (0) { } @@ -26,6 +29,20 @@ struct object unsigned long id_; std::vector v; + + int num; + + object* o1; + object2* o2; +}; + +#pragma db object +struct object2 +{ + #pragma db id auto + unsigned long id_; + + int num; }; #endif // TEST_HXX -- cgit v1.1 From 70ed1235b68bf7a36cfefabf0aa078608c83dfd1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Aug 2011 13:40:20 +0200 Subject: Add support for specifying client character set for MySQL database --- libcommon/common/common.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 47dee81..384d945 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -73,7 +73,7 @@ create_database (int& argc, if (max_connections != 0) f.reset (new mysql::connection_pool_factory (max_connections)); - db.reset (new mysql::database (argc, argv, false, 0, f)); + db.reset (new mysql::database (argc, argv, false, "", 0, f)); #elif defined(DATABASE_SQLITE) auto_ptr f; -- cgit v1.1 From 0e4095ffecdc1f65a48d21730b0c8a0d96bc0c93 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Aug 2011 12:13:19 +0200 Subject: Add wrapper support for composite values NULL semantics for composite values is not yet supported. --- common/wrapper/driver.cxx | 39 ++++++++++++++++++++++++- common/wrapper/test.hxx | 74 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index ed4d83f..32ac412 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -29,11 +29,15 @@ main (int argc, char* argv[]) auto_ptr db (create_database (argc, argv)); // + // Simple values. + // + + // // unsigned long id; { object o; - o.num.reset (new unsigned long (123)); + o.num.reset (new int (123)); o.nstrs.push_back (nullable_string ()); o.nstrs.push_back (nullable_string ("123")); #ifdef HAVE_TR1_MEMORY @@ -64,6 +68,39 @@ main (int argc, char* argv[]) assert (*o->tr1_strs[1] == "123"); #endif } + + // + // Composite values. + // + { + comp_object co; + + co.c1.reset (new comp1 ("123", 123)); + co.vc1.push_back (comp1 ("1", 1)); + co.vc1.push_back (comp1 ("2", 2)); + co.vc1.push_back (comp1 ("3", 3)); + + co.c2.reset (new comp2 ("123", 123)); + co.c2->strs.push_back ("1"); + co.c2->strs.push_back ("2"); + co.c2->strs.push_back ("3"); + + { + transaction t (db->begin ()); + id = db->persist (co); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (id)); + t.commit (); + + assert (*o->c1 == *co.c1); + assert (o->vc1 == co.vc1); + assert (*o->c2 == *co.c2); + } + } } catch (const odb::exception& e) { diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 68a8750..b28d7a0 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -21,6 +21,10 @@ using odb::nullable; +// +// Simple values. +// + typedef nullable nullable_string; #ifdef HAVE_TR1_MEMORY @@ -33,7 +37,7 @@ struct object #pragma db id auto unsigned long id_; - std::auto_ptr num; + std::auto_ptr num; #pragma db null std::auto_ptr str; @@ -50,4 +54,72 @@ struct object #endif }; +// +// Composite values. +// + +#pragma db value +struct comp1 +{ + comp1 () {} + comp1 (const std::string& s, int n): str (s), num (n) {} + + std::string str; + int num; +}; + +inline bool +operator== (const comp1& x, const comp1 y) +{ + return x.str == y.str && x.num == y.num; +} + + +#pragma db value +struct comp2 +{ + comp2 () {} + comp2 (const std::string& s, int n): str (s), num (n) {} + + std::string str; + int num; + + std::vector strs; +}; + +inline bool +operator== (const comp2& x, const comp2 y) +{ + return x.str == y.str && x.num == y.num && x.strs == y.strs; +} + +#pragma db object +struct comp_object +{ + #pragma db id auto + unsigned long id_; + + std::auto_ptr c1; // Wrapped comp value. + std::vector > vc1; // Container of wrapped comp values. + std::auto_ptr c2; // Container inside wrapped comp value. +}; + +// This one is just a compilation test to cover more convolute cases. +// +#pragma db value +struct comp3: comp2 +{ + std::auto_ptr c1; + std::vector > vc1; +}; + +#pragma db object +struct comp_object2 +{ + #pragma db id auto + unsigned long id_; + + std::auto_ptr c3; +}; + #endif // TEST_HXX -- cgit v1.1 From 83550874e5e879f5e213522dbbe645e9137be8b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Aug 2011 11:39:17 +0200 Subject: Add wrapper support for containers --- common/wrapper/driver.cxx | 38 +++++++++++++++++++++++++++++++++----- common/wrapper/test.hxx | 31 +++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 32ac412..af6a3d1 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) // // Simple values. // - - // - // unsigned long id; { object o; @@ -50,8 +47,6 @@ main (int argc, char* argv[]) t.commit (); } - // - // { transaction t (db->begin ()); auto_ptr o (db->load (id)); @@ -101,6 +96,39 @@ main (int argc, char* argv[]) assert (*o->c2 == *co.c2); } } + + // + // Containers. + // + { + cont_object co; + + co.vi.reset (new vector); + co.vi->push_back (1); + co.vi->push_back (2); + co.vi->push_back (3); + + co.c.num = 123; + co.c.strs.reset (new vector); + co.c.strs->push_back ("1"); + co.c.strs->push_back ("2"); + co.c.strs->push_back ("3"); + + { + transaction t (db->begin ()); + id = db->persist (co); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (id)); + t.commit (); + + assert (*o->vi == *co.vi); + assert (o->c == co.c); + } + } } catch (const odb::exception& e) { diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index b28d7a0..6a1e0a9 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -69,7 +69,7 @@ struct comp1 }; inline bool -operator== (const comp1& x, const comp1 y) +operator== (const comp1& x, const comp1& y) { return x.str == y.str && x.num == y.num; } @@ -88,7 +88,7 @@ struct comp2 }; inline bool -operator== (const comp2& x, const comp2 y) +operator== (const comp2& x, const comp2& y) { return x.str == y.str && x.num == y.num && x.strs == y.strs; } @@ -122,4 +122,31 @@ struct comp_object2 std::auto_ptr c3; }; +// +// Containers. +// + +#pragma db value +struct cont_comp +{ + int num; + std::auto_ptr > strs; +}; + +inline bool +operator== (const cont_comp& x, const cont_comp& y) +{ + return x.num == y.num && *x.strs == *y.strs; +} + +#pragma db object +struct cont_object +{ + #pragma db id auto + unsigned long id_; + + std::auto_ptr > vi; // Wrapped container. + cont_comp c; // Wrapped container in comp value. +}; + #endif // TEST_HXX -- cgit v1.1 From 8bf752fc2354af4e98a43e208d1eb18c8a71e48b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Sep 2011 10:36:33 +0200 Subject: Support for views; native part --- common/makefile | 1 + common/view/driver.cxx | 185 +++++++++++++++++++++++++++++++++++++++++++++++++ common/view/makefile | 109 +++++++++++++++++++++++++++++ common/view/test.hxx | 114 ++++++++++++++++++++++++++++++ common/view/test.std | 0 5 files changed, 409 insertions(+) create mode 100644 common/view/driver.cxx create mode 100644 common/view/makefile create mode 100644 common/view/test.hxx create mode 100644 common/view/test.std diff --git a/common/makefile b/common/makefile index b3af876..a2f4962 100644 --- a/common/makefile +++ b/common/makefile @@ -23,6 +23,7 @@ query \ relationship \ schema \ template \ +view \ wrapper thread_tests := threads diff --git a/common/view/driver.cxx b/common/view/driver.cxx new file mode 100644 index 0000000..89ef304 --- /dev/null +++ b/common/view/driver.cxx @@ -0,0 +1,185 @@ +// file : common/view/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test views. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + { + country* ca (new country ("CA", "Canada")); + country* za (new country ("ZA", "South Africa")); + country* us (new country ("US", "United States")); + country* se (new country ("SE", "Sweden")); + + person p1 (1, "John", "Doe", 30, ca); + person p2 (2, "Jane", "Doe", 29, za); + person p3 (3, "Joe", "Dirt", 31, us); + person p4 (4, "Johansen", "Johansen", 32, se); + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + t.commit (); + } + + // view1 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + assert (size (r) == 4); + } + + { + result r (db->query ("ORDER BY age")); + assert (size (r) == 4); + } + + { + result r (db->query ("age < 31 ORDER BY age")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); + + assert (++i != r.end ()); + view1 v; + i.load (v); + assert (v.first == "John" && v.last == "Doe" && v.age == 30); + } + + t.commit (); + } + } + + // view2 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 4); + } + + { + result r (db->query ("age < 31")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + t.commit (); + } + } + + // view3 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + size_t count (0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->last == "Doe") + assert (i->count == 2); + else if (i->last == "Dirt" || + i->last == "Johansen") + assert (i->count == 1); + else + assert (false); + + count++; + } + + assert (count == 3); + } + + t.commit (); + } + } + + // view4 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ("age > 30 ORDER BY age")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Joe" && i->last == "Dirt" && + i->location == "United States"); + + assert (++i != r.end ()); + assert (i->first == "Johansen" && i->last == "Johansen" && + i->location == "Sweden"); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/view/makefile b/common/view/makefile new file mode 100644 index 0000000..098baeb --- /dev/null +++ b/common/view/makefile @@ -0,0 +1,109 @@ +# file : common/view/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) --generate-schema \ +--generate-query --table-prefix common_view_ +$(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 schema) + $(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/view/test.hxx b/common/view/test.hxx new file mode 100644 index 0000000..9ceed60 --- /dev/null +++ b/common/view/test.hxx @@ -0,0 +1,114 @@ +// file : common/view/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 +#include +#include // std::size_t +#include + +#include + +#pragma db object +struct country +{ + country (const std::string& c, std::string const& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +#pragma db object +struct person +{ + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + country* l) + : id (i), first_name (fn), last_name (ln), age (a), location (l) + { + } + + ~person () + { + delete location; + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column ("first") + std::string first_name; + + #pragma db column ("last") + std::string last_name; + + unsigned short age; + + #pragma db not_null + country* location; +}; + +// General view with a custom query. +// +#pragma db view query("SELECT first, last, age FROM common_view_person") +struct view1 +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Count view. +// +#pragma db view query("SELECT count(id) FROM common_view_person") +struct view2 +{ + std::size_t count; +}; + +// Aggregate view. +// +#pragma db view query("SELECT last, count(last) " \ + "FROM common_view_person " \ + "GROUP BY last") +struct view3 +{ + std::string last; + std::size_t count; + unsigned short age; +}; + +// JOIN view. +// +#pragma db view query("SELECT first, last, common_view_country.name " \ + "FROM common_view_person " \ + "LEFT JOIN common_view_country " \ + "ON common_view_person.location = " \ + "common_view_country.code") +struct view4 +{ + std::string first; + std::string last; + std::string location; +}; + +#endif // TEST_HXX diff --git a/common/view/test.std b/common/view/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 2ef121a6df140969f3f722981e4fd74360345e44 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 6 Sep 2011 16:49:39 +0200 Subject: Correct view test --- common/view/test.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/common/view/test.hxx b/common/view/test.hxx index 9ceed60..5eba5d5 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -94,7 +94,6 @@ struct view3 { std::string last; std::size_t count; - unsigned short age; }; // JOIN view. -- cgit v1.1 From 30fad82ff3afc8315dcea7988525fd057d07d9ca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Sep 2011 10:51:36 +0200 Subject: Vary members order to improve coverage In particular, the test now catches a bug in PG type oid generation. --- common/inverse/test.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index ad7b108..12eddfb 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -60,26 +60,26 @@ struct obj2 #pragma db id auto int id; - std::string str; - // one-to-one // #pragma db inverse(o2) obj1_ptr o1; + + std::string str; }; #pragma db object struct obj3 { - #pragma db id auto - int id; - std::string str; // one(i)-to-many // #pragma db inverse (o3) obj1_ptr o1; + + #pragma db id auto + int id; }; #pragma db object -- cgit v1.1 From b3f53fedcabb90c0b7e9b8ab002b35aab0861336 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Sep 2011 12:18:39 +0200 Subject: New templated query_columns architecture We also now use the correct separate "role"-base join approach instead of having a single merged join for each table. --- common/inheritance/driver.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index 9bb8477..ce72863 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -149,7 +149,8 @@ main (int argc, char* argv[]) // Query condition with hidden members. // - assert (!db->query (b_query::str == "base o2o2o2").empty ()); + assert ( + !db->query (o2_query::base::str == "base o2o2o2").empty ()); // Query condition with referenced composite member in base class. // -- cgit v1.1 From 86f71bd8525302519d1ec22ab135e662c43e8af3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Sep 2011 12:20:26 +0200 Subject: Add test for queries involving object relationships --- common/makefile | 39 ++++---- common/relationship-query/driver.cxx | 175 +++++++++++++++++++++++++++++++++++ common/relationship-query/makefile | 109 ++++++++++++++++++++++ common/relationship-query/test.hxx | 140 ++++++++++++++++++++++++++++ common/relationship-query/test.std | 0 5 files changed, 444 insertions(+), 19 deletions(-) create mode 100644 common/relationship-query/driver.cxx create mode 100644 common/relationship-query/makefile create mode 100644 common/relationship-query/test.hxx create mode 100644 common/relationship-query/test.std diff --git a/common/makefile b/common/makefile index a2f4962..371ad13 100644 --- a/common/makefile +++ b/common/makefile @@ -5,25 +5,26 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -auto \ -callback \ -composite \ -const \ -container \ -ctor \ -default \ -enum \ -erase-query \ -inheritance \ -inverse \ -lazy-ptr \ -lifecycle \ -query \ -relationship \ -schema \ -template \ -view \ +tests := \ +auto \ +callback \ +composite \ +const \ +container \ +ctor \ +default \ +enum \ +erase-query \ +inheritance \ +inverse \ +lazy-ptr \ +lifecycle \ +query \ +relationship \ +relationship-query \ +schema \ +template \ +view \ wrapper thread_tests := threads diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx new file mode 100644 index 0000000..57a6215 --- /dev/null +++ b/common/relationship-query/driver.cxx @@ -0,0 +1,175 @@ +// file : common/relationship-query/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test relationship queries. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // HAVE_TR1_MEMORY +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + +#ifdef HAVE_TR1_MEMORY + + using std::tr1::shared_ptr; + + // + // + { + shared_ptr ca (new country ("CA", "Canada")); + shared_ptr za (new country ("ZA", "South Africa")); + shared_ptr us (new country ("US", "United States")); + shared_ptr se (new country ("SE", "Sweden")); + + shared_ptr st (new employer ("Simple Tech, Inc")); + shared_ptr ct (new employer ("Complex Tech, Inc")); + + // person + // + shared_ptr p1 ( + new person (1, "John", "Doe", 30, ca, true, za)); + + shared_ptr p2 ( + new person (2, "Jane", "Doe", 29, za, false, us)); + p2->husband = p1; + + shared_ptr p3 ( + new person (3, "Joe", "Dirt", 31, us, true, us)); + + shared_ptr p4 ( + new person (4, "Johan", "Johansen", 32, se, false, ca)); + + // employee + // + shared_ptr e1 ( + new employee (1, "John", "Doe", 30, ca, true, za, st)); + + shared_ptr e2 ( + new employee (2, "Jane", "Doe", 29, za, false, us, ct)); + e2->husband = p1; + + shared_ptr e3 ( + new employee (3, "Joe", "Dirt", 31, us, true, us, st)); + + shared_ptr e4 ( + new employee (4, "Johan", "Johansen", 32, se, false, ca, ct)); + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (st); + db->persist (ct); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + + db->persist (e1); + db->persist (e2); + db->persist (e3); + db->persist (e4); + t.commit (); + } + + typedef odb::query p_query; + typedef odb::result p_result; + + typedef odb::query e_query; + typedef odb::result e_result; + + // Make sure we have an independent JOIN for each relationship. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query ( + p_query::residence::location::code == "ZA")); + assert (size (pr) == 1); + + e_result er (db->query ( + e_query::residence::location::code == "ZA")); + assert (size (er) == 1); + + t.commit (); + } + + // Test Self-JOIN. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query (p_query::husband::last_name == "Doe")); + assert (size (pr) == 1); + + e_result er (db->query (e_query::husband::last_name == "Doe")); + assert (size (er) == 1); + + t.commit (); + } + + // Test query conditions from both base and derived. + // + { + session s; + transaction t (db->begin ()); + + e_result r ( + db->query ( + e_query::employed_by::name == "Simple Tech, Inc" && + e_query::nationality::code == "US")); + + assert (size (r) == 1); + + t.commit (); + } + + // Test second-level pointers. + // + { + session s; + transaction t (db->begin ()); + + p_result r ( + db->query ( + p_query::husband::residence::location == "CA")); + + assert (size (r) == 1); + + t.commit (); + } + +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile new file mode 100644 index 0000000..f422a8a --- /dev/null +++ b/common/relationship-query/makefile @@ -0,0 +1,109 @@ +# file : common/relationship-query/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) --generate-schema \ +--generate-query --table-prefix common_relationship_query_ +$(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 schema) + $(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/relationship-query/test.hxx b/common/relationship-query/test.hxx new file mode 100644 index 0000000..c832405 --- /dev/null +++ b/common/relationship-query/test.hxx @@ -0,0 +1,140 @@ +// file : common/relationship-query/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 // HAVE_TR1_MEMORY + +#ifdef HAVE_TR1_MEMORY + +#include + +#include +#include + +struct country; + +#pragma db value +struct residence_info +{ + residence_info (bool p, std::tr1::shared_ptr l) + : permanent (p), location (l) + { + } + + residence_info () + { + } + + bool permanent; + + #pragma db not_null + std::tr1::shared_ptr location; +}; + +#pragma db object pointer(std::tr1::shared_ptr) +struct person +{ + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + std::tr1::shared_ptr r, + bool p, + std::tr1::shared_ptr n) + : id (i), + first_name (fn), + last_name (ln), + age (a), + residence (p, r), + nationality (n) + { + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column ("first") + std::string first_name; + + #pragma db column ("last") + std::string last_name; + + unsigned short age; + + residence_info residence; + + #pragma db not_null + std::tr1::shared_ptr nationality; + + std::tr1::shared_ptr husband; // Self-join. +}; + +struct employer; + +#pragma db object pointer(std::tr1::shared_ptr) +struct employee: person +{ + employee (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + std::tr1::shared_ptr r, + bool p, + std::tr1::shared_ptr n, + std::tr1::shared_ptr e) + : person (i, fn, ln, a, r, p, n), + employed_by (e) + { + } + + employee () + { + } + + std::tr1::shared_ptr employed_by; +}; + +#pragma db object pointer(std::tr1::shared_ptr) +struct employer +{ + employer (const std::string& n) + : name (n) + { + } + + employer () + { + } + + #pragma db id + std::string name; +}; + +#pragma db object pointer(std::tr1::shared_ptr) +struct country +{ + country (const std::string& c, std::string const& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +#endif // HAVE_TR1_MEMORY +#endif // TEST_HXX diff --git a/common/relationship-query/test.std b/common/relationship-query/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From f70b64e2c4f9861d7013492b609212ed78e840f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Sep 2011 16:03:26 +0200 Subject: Support for views; integrated part --- common/view/driver.cxx | 449 +++++++++++++++++++++++++++++++++++++++++++++---- common/view/test.hxx | 339 +++++++++++++++++++++++++++++++++---- 2 files changed, 723 insertions(+), 65 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 89ef304..8450b34 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -21,6 +21,148 @@ using namespace std; using namespace odb::core; +template +void +view1_check (odb::result& r) +{ + typedef odb::result result; + + typename result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); + + assert (++i != r.end ()); + V v; + i.load (v); + assert (v.first == "John" && v.last == "Doe" && v.age == 30); + + assert (++i == r.end ()); +} + +template +void +view2_test (const auto_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query ()); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 4); + } + + { + result r (db->query ("age < 31")); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + { + result r (db->query (query::age < 31)); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + t.commit (); +} + +template +void +view4_test (const auto_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query ("age > 30 ORDER BY age")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query ( + (query::person::age > 30) + "ORDER BY age")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query (query::residence::code == "US")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i == r.end ()); + } + + t.commit (); +} + +template +void +view6_test (const auto_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r ( + db->query ( + query::employer::name == "Simple Tech, Inc")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->employer == "Simple Tech, Inc"); + + assert (++i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->employer == "Simple Tech, Inc"); + + assert (++i == r.end ()); + } + + t.commit (); +} + int main (int argc, char* argv[]) { @@ -31,15 +173,32 @@ main (int argc, char* argv[]) // // { - country* ca (new country ("CA", "Canada")); - country* za (new country ("ZA", "South Africa")); - country* us (new country ("US", "United States")); - country* se (new country ("SE", "Sweden")); + country ca ("CA", "Canada"); + country za ("ZA", "South Africa"); + country us ("US", "United States"); + country se ("SE", "Sweden"); + + person p1 (1, "John", "Doe", 30, male, measures (60, 160), &ca, &ca); + person p2 (2, "Jane", "Doe", 29, female, measures (70, 170), &za, &us); + person p3 (3, "Joe", "Dirt", 31, male, measures (80, 180), &us, &za); + person p4 (4, "Johan", "Johansen", 32, male, measures (90, 190), &se, + &se); + + p2.husband = &p1; + + employer st ("Simple Tech, Inc"); + employer ct ("Complex Tech, Inc"); - person p1 (1, "John", "Doe", 30, ca); - person p2 (2, "Jane", "Doe", 29, za); - person p3 (3, "Joe", "Dirt", 31, us); - person p4 (4, "Johansen", "Johansen", 32, se); + p2.previous_employer = st.name; + p3.previous_employer = ct.name; + + st.employees.push_back (&p1); + st.employees.push_back (&p3); + st.head_count = 2; + + ct.employees.push_back (&p2); + ct.employees.push_back (&p4); + ct.head_count = 2; transaction t (db->begin ()); db->persist (ca); @@ -51,6 +210,9 @@ main (int argc, char* argv[]) db->persist (p2); db->persist (p3); db->persist (p4); + + db->persist (st); + db->persist (ct); t.commit (); } @@ -75,48 +237,88 @@ main (int argc, char* argv[]) { result r (db->query ("age < 31 ORDER BY age")); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); - - assert (++i != r.end ()); - view1 v; - i.load (v); - assert (v.first == "John" && v.last == "Doe" && v.age == 30); + view1_check (r); } t.commit (); } } - // view2 + // view1a // { - typedef odb::query query; - typedef odb::result result; + typedef odb::query query; + typedef odb::result result; { transaction t (db->begin ()); + result r (db->query ()); + view1_check (r); + + t.commit (); + } + } + + // view1b + // + { + typedef odb::query query; + typedef odb::result result; + + { { - result r (db->query ()); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 4); + transaction t (db->begin ()); + + result r (db->query (query (true))); + view1_check (r); + + t.commit (); } { - result r (db->query ("age < 31")); + transaction t (db->begin ()); + + result r (db->query ("first = " + query::_val ("Jane"))); result::iterator i (r.begin ()); + assert (i != r.end ()); - assert (i->count == 2); + assert (i->first == "Jane" && i->last == "Doe"); + assert (++i == r.end ()); + + t.commit (); } + } + } + + // view1c + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r ( + db->query ( + "SELECT first, last, age " + "FROM common_view_person " + "WHERE age < 31 ORDER BY age")); + + view1_check (r); t.commit (); } } + // view2 + // + view2_test (db); + view2_test (db); + view2_test (db); + view2_test (db); + // view3 // { @@ -132,10 +334,10 @@ main (int argc, char* argv[]) size_t count (0); for (result::iterator i (r.begin ()); i != r.end (); ++i) { - if (i->last == "Doe") + if (i->last_name == "Doe") assert (i->count == 2); - else if (i->last == "Dirt" || - i->last == "Johansen") + else if (i->last_name == "Dirt" || + i->last_name == "Johansen") assert (i->count == 1); else assert (false); @@ -150,27 +352,202 @@ main (int argc, char* argv[]) } } + // view3a + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Doe")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->count == 2); + assert (++i == r.end ()); + } + + t.commit (); + } + } + // view4 // + view4_test (db); + view4_test (db); + + // view5 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r ( + db->query ( + query::residence::name == query::nationality::name)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->rname == "Canada" && i->rname == "Canada"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->rname == "Sweden" && i->rname == "Sweden"); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view6 + // + view6_test (db); + view6_test (db); + view6_test (db); + + // view7 + // { - typedef odb::query query; - typedef odb::result result; + typedef odb::query query; + typedef odb::result result; { transaction t (db->begin ()); { - result r (db->query ("age > 30 ORDER BY age")); + result r (db->query (query::person::last_name == "Doe")); result::iterator i (r.begin ()); assert (i != r.end ()); - assert (i->first == "Joe" && i->last == "Dirt" && - i->location == "United States"); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + !i->head_count.null () && *i->head_count == 2); assert (++i != r.end ()); - assert (i->first == "Johansen" && i->last == "Johansen" && - i->location == "Sweden"); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->head_count.null ()); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view8 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->wife_name == "Jane" && i->husb_name == "John"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view9 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + // Test case-insensitive clause prefix detection. + // + result r (db->query ("where" + (query::gender == female))); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + i->gender == female); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view10 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + query::measures::weight > 60 && + query::measures::hight < 190)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && + i->measures.weight == 70 && i->measures.hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && + i->measures.weight == 80 && i->measures.hight == 180); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view11 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + query::measures::weight > 60 && + query::measures::hight < 190)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && i->hight == 180); + + assert (++i == r.end ()); } t.commit (); diff --git a/common/view/test.hxx b/common/view/test.hxx index 5eba5d5..3ba6745 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -7,11 +7,13 @@ #define TEST_HXX #include -#include +#include #include // std::size_t -#include #include +#include + +struct employer; #pragma db object struct country @@ -31,23 +33,43 @@ struct country std::string name; }; +enum gender_type {male, female}; + +#pragma db value +struct measures +{ + measures (unsigned short w, unsigned short h) : weight (w), hight (h) {} + measures () {} + + unsigned short weight; + unsigned short hight; +}; + #pragma db object struct person { + typedef ::measures measures_type; + person (unsigned long i, const std::string& fn, const std::string& ln, unsigned short a, - country* l) - : id (i), first_name (fn), last_name (ln), age (a), location (l) + gender_type g, + const measures_type m, + country* r, + country* n) + : id (i), + first_name_ (fn), + last_name_ (ln), + age (a), + gender (g), + measures (m), + residence (r), + nationality (n), + husband (0) { } - ~person () - { - delete location; - } - person () { } @@ -56,18 +78,57 @@ struct person unsigned long id; #pragma db column ("first") - std::string first_name; + std::string first_name_; #pragma db column ("last") - std::string last_name; + std::string last_name_; unsigned short age; + // #pragma db type("INT") - in MySQL test type pragma copying + gender_type gender; + + measures_type measures; + + #pragma db not_null + country* residence; + #pragma db not_null - country* location; + country* nationality; + + #pragma db inverse(employees) + employer* employed_by; + + // A non-pointer relationship. + // + odb::nullable previous_employer; + + person* husband; // Self-reference. +}; + +#pragma db object +struct employer +{ + employer (const std::string& n) + : name (n) + { + } + + employer () + { + } + + #pragma db id + std::string name; + std::size_t head_count; + std::vector employees; }; -// General view with a custom query. +// +// General view with no associated objects. +// + +// Complete suffix query template. // #pragma db view query("SELECT first, last, age FROM common_view_person") struct view1 @@ -77,37 +138,257 @@ struct view1 unsigned short age; }; -// Count view. +// Complete query. +// +#pragma db view query("SELECT first, last, age " \ + "FROM common_view_person " \ + "WHERE age < 31 ORDER BY age") +struct view1a +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Complete placeholder query template. +// +#pragma db view query("SELECT first, last, age " \ + "FROM common_view_person " \ + "WHERE age < 31 AND (?) ORDER BY age") +struct view1b +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Runtime query. // -#pragma db view query("SELECT count(id) FROM common_view_person") +#pragma db view query() +struct view1c +{ + std::string first; + std::string last; + unsigned short age; +}; + +// +// Count view plus associated object. +// + +// Complete suffix query. +// +#pragma db view object(person) \ + query("SELECT count(id) FROM common_view_person") struct view2 { std::size_t count; }; -// Aggregate view. +// Generated query, literal column. +// +#pragma db view object(person) +struct view2a +{ + #pragma db column("count(id)") + std::size_t count; +}; + +// Generated query, qualified literal column. // -#pragma db view query("SELECT last, count(last) " \ - "FROM common_view_person " \ - "GROUP BY last") +#pragma db view object(person) +struct view2b +{ + #pragma db column("count(common_view_person.id)") + std::size_t count; +}; + +// Generated query, expression column. +// +#pragma db view object(person) +struct view2c +{ + #pragma db column("count(" + person::id + ")") + std::size_t count; +}; + +// +// Aggregate view plus associated object with a custom alias. +// + +// Complete suffix query. +// +#pragma db view object(person = test) \ + query("SELECT last, count(last) " \ + "FROM common_view_person " \ + "GROUP BY last") struct view3 { - std::string last; + std::string last_name; std::size_t count; }; -// JOIN view. +// Generated query with integrated query condition and placeholder. // -#pragma db view query("SELECT first, last, common_view_country.name " \ - "FROM common_view_person " \ - "LEFT JOIN common_view_country " \ - "ON common_view_person.location = " \ - "common_view_country.code") +#pragma db view object(person = test) \ + query((?) + "GROUP BY" + test::last_name_) +struct view3a +{ + // Automatically resolved to test::last_name_. + // + std::string last_name; + + #pragma db column("count(" + test::last_name_ + ")") + std::size_t count; +}; + +// +// JOIN view plus associated objects, some with custom aliases. +// + +// Complete suffix query. +// +#pragma db view object(person) object(country = residence) \ + query("SELECT first, last, residence.name " \ + "FROM common_view_person " \ + "LEFT JOIN common_view_country AS residence " \ + "ON common_view_person.residence = residence.code") struct view4 { - std::string first; - std::string last; - std::string location; + std::string first_name; + std::string last_name; + std::string name; +}; + +// Generated query. +// +#pragma db view object(person) \ + object(country = residence: person::residence) +struct view4a +{ + std::string first_name; + std::string last_name; + std::string name; +}; + +// +// JOIN the same object twice. +// +#pragma db view object(person) \ + object(country = residence: person::residence) \ + object(country = nationality: person::nationality) \ + query((?) + "ORDER BY" + person::age) +struct view5 +{ + std::string first_name; + std::string last_name; + + #pragma db column(residence::name) + std::string rname; + + #pragma db column(nationality::name) + std::string nname; +}; + +// +// JOIN via one(i)-to-many relationship. +// + +// Automatic relationship discovery. +// +#pragma db view object(person) object(employer) +struct view6 +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, left side. +// +#pragma db view object(person) object(employer: person::employed_by) +struct view6a +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, right side. +// +#pragma db view object(person) object(employer: employer::employees) +struct view6b +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// +// JOIN via a custom condition. +// +#pragma db view object(person) \ + object(employer: person::previous_employer == employer::name)\ + query((?) + "ORDER BY" + person::age) +struct view7 +{ + std::string first_name; + std::string last_name; + + odb::nullable head_count; +}; + +// +// Self-JOIN. +// +#pragma db view object(person = wife) object(person = husb) \ + query (wife::husband.is_not_null ()) +struct view8 +{ + #pragma db column (wife::first_name_) + std::string wife_name; + + #pragma db column (husb::first_name_) + std::string husb_name; +}; + +// +// Enum mapping. +// +#pragma db view object(person) +struct view9 +{ + std::string first_name; + std::string last_name; + gender_type gender; +}; + +// +// Composite in view. +// +#pragma db view object(person) query((?) + "ORDER BY" + person::age) +struct view10 +{ + std::string last_name; + ::measures measures; +}; + +// +// Composite in object. +// +#pragma db view object(person) query((?) + "ORDER BY" + person::age) +struct view11 +{ + std::string last_name; + + #pragma db column (person::measures.hight) + unsigned short hight; }; #endif // TEST_HXX -- cgit v1.1 From 18a040773c389de7be48111efc0f3cf7252ffc68 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Sep 2011 11:53:04 +0200 Subject: Change query syntax to use . for composite and -> for object pointer access Also make non-inverse query columns act as both an object pointer and a normal column. The latter allows us to use natural expressions such as query::employer.is_null (). --- common/composite/driver.cxx | 4 ++-- common/erase-query/driver.cxx | 25 +++++++++++++++++++++++++ common/inheritance/driver.cxx | 4 ++-- common/inverse/driver.cxx | 4 ++-- common/relationship-query/driver.cxx | 14 +++++++------- common/relationship/driver.cxx | 2 +- common/view/driver.cxx | 8 +++----- common/view/test.hxx | 4 +++- 8 files changed, 45 insertions(+), 20 deletions(-) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index e1dfef8..606f367 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -90,7 +90,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result r (db->query (query::name::first == "Joe")); + result r (db->query (query::name.first == "Joe")); assert (!r.empty ()); assert (*r.begin () == p); @@ -104,7 +104,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result r (db->query (query::name::flags::alias)); + result r (db->query (query::name.flags.alias)); assert (!r.empty ()); assert (*r.begin () == p); diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 2137377..5085207 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -112,6 +112,31 @@ main (int argc, char* argv[]) } */ + // For now we can only do column-based tests, like is_null(). + // + { + object o11 (1); + object o12 (2); + object o13 (3); + object2 o2; + + o12.o2 = &o2; + + transaction t (db->begin ()); + db->persist (o2); + db->persist (o13); + db->persist (o12); + db->persist (o11); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query (query::o2.is_null ()) == 2); + db->erase_query (); + t.commit (); + } + // Make sure container data is deleted. // { diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index ce72863..0106b5b 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -143,7 +143,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - assert (!db->query (b_query::comp::num == 10).empty ()); + assert (!db->query (b_query::comp.num == 10).empty ()); assert (!db->query (o1_query::num1 == 21).empty ()); assert (!db->query (o2_query::num == 2).empty ()); @@ -155,7 +155,7 @@ main (int argc, char* argv[]) // Query condition with referenced composite member in base class. // { - r_result r (db->query (r_query::o1::comp::num == 11)); + r_result r (db->query (r_query::o1->comp.num == 11)); assert (!r.empty ()); delete r.begin ()->o1_; } diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index c07b751..17fc5d6 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -172,7 +172,7 @@ main (int argc, char* argv[]) session s; transaction t (db->begin ()); - result r (db->query (query::o1::id == "obj1 1")); + result r (db->query (query::o1->id == "obj1 1")); assert (!r.empty ()); assert (r.begin ()->id == o2->id); assert (r.begin ()->o1->id == o1_1->id); @@ -190,7 +190,7 @@ main (int argc, char* argv[]) session s; transaction t (db->begin ()); - result r (db->query (query::o1::id == "obj1 1")); + result r (db->query (query::o1->id == "obj1 1")); size_t n (0); for (result::iterator i (r.begin ()); i != r.end (); ++i) diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 57a6215..2e0068e 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -109,11 +109,11 @@ main (int argc, char* argv[]) transaction t (db->begin ()); p_result pr (db->query ( - p_query::residence::location::code == "ZA")); + p_query::residence.location->code == "ZA")); assert (size (pr) == 1); e_result er (db->query ( - e_query::residence::location::code == "ZA")); + e_query::residence.location->code == "ZA")); assert (size (er) == 1); t.commit (); @@ -125,10 +125,10 @@ main (int argc, char* argv[]) session s; transaction t (db->begin ()); - p_result pr (db->query (p_query::husband::last_name == "Doe")); + p_result pr (db->query (p_query::husband->last_name == "Doe")); assert (size (pr) == 1); - e_result er (db->query (e_query::husband::last_name == "Doe")); + e_result er (db->query (e_query::husband->last_name == "Doe")); assert (size (er) == 1); t.commit (); @@ -142,8 +142,8 @@ main (int argc, char* argv[]) e_result r ( db->query ( - e_query::employed_by::name == "Simple Tech, Inc" && - e_query::nationality::code == "US")); + e_query::employed_by->name == "Simple Tech, Inc" && + e_query::nationality->code == "US")); assert (size (r) == 1); @@ -158,7 +158,7 @@ main (int argc, char* argv[]) p_result r ( db->query ( - p_query::husband::residence::location == "CA")); + p_query::husband->residence.location == "CA")); assert (size (r) == 1); diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 3ce7e8c..e2ac749 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -105,7 +105,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result r (db->query (query::o1::str == "obj1")); + result r (db->query (query::o1->str == "obj1")); assert (!r.empty ()); assert (r.begin ()->o1->id == a.o1->id); assert (size (r) == 1); diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 8450b34..847d21b 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -505,8 +505,8 @@ main (int argc, char* argv[]) { result r (db->query ( - query::measures::weight > 60 && - query::measures::hight < 190)); + query::measures.weight > 60 && + query::measures.hight < 190)); result::iterator i (r.begin ()); @@ -535,9 +535,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); { - result r (db->query ( - query::measures::weight > 60 && - query::measures::hight < 190)); + result r (db->query ()); result::iterator i (r.begin ()); diff --git a/common/view/test.hxx b/common/view/test.hxx index 3ba6745..dc3439c 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -382,7 +382,9 @@ struct view10 // // Composite in object. // -#pragma db view object(person) query((?) + "ORDER BY" + person::age) +#pragma db view object(person) \ + query((person::measures.weight > 60 && person::measures.hight < 190) \ + + "ORDER BY" + person::age) struct view11 { std::string last_name; -- cgit v1.1 From 6c12bdfccb4f8323599c13d3e585e33b4720cda5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 20 Sep 2011 16:43:14 +0200 Subject: Bump version to 1.6.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index f715635..be9a4ff 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.0.a1 +1.6.0.a2 -- cgit v1.1 From 0da4038d5047d83f3dbc86a06740d83b4fbf2ae5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Sep 2011 08:39:30 +0200 Subject: Add prefix to table name --- common/erase-query/driver.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 5085207..baa66f4 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -162,7 +162,8 @@ main (int argc, char* argv[]) #ifndef DATABASE_MYSQL { transaction t (db->begin ()); - assert (db->execute ("SELECT * FROM object_v WHERE object_id = 1") == 0); + assert (db->execute ("SELECT * FROM common_erase_query_object_v " + "WHERE object_id = 1") == 0); t.commit (); } #endif -- cgit v1.1 From b434d9d0245aa03879155fb830613f471af12976 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Sep 2011 13:00:34 +0200 Subject: Rework const object handling Now objects are always loaded as non-const and the object cache in session treats all objects as non-const. --- common/const/driver.cxx | 24 +++++++++++------------- common/view/driver.cxx | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/common/const/driver.cxx b/common/const/driver.cxx index 17c2edc..dd0a2b6 100644 --- a/common/const/driver.cxx +++ b/common/const/driver.cxx @@ -77,7 +77,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); auto_ptr a (db->load (1)); - auto_ptr ca (db->load (2)); + auto_ptr ca (db->load (2)); t.commit (); assert (a->o1->id == 2); @@ -121,13 +121,15 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result1 r1 (db->query (query1::id < 3)); + result1 r1 (db->query (query1::id < 3)); + // odb::result ur (r1); // error size_t n1 (0); for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) { // i->f (); // error i->cf (); + // obj1* p (i.load ()); // error const obj1* p (i.load ()); obj1 o (0); i.load (o); @@ -138,13 +140,14 @@ main (int argc, char* argv[]) assert (n1 == 2); - result2 r2 (db->query (query2::id < 3)); + result2 r2 (db->query (query2::id < 3)); size_t n2 (0); for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) { // i->f (); // error i->cf (); + // auto_ptr p (i.load ()); // error auto_ptr p (i.load ()); obj2 o (0); i.load (o); @@ -191,17 +194,12 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - const obj1 o1 (1); - db->persist (o1); - try - { - db->load (1); - assert (false); - } - catch (const odb::const_object&) - { - } + obj1 o1 (1); + const obj1& co1 (o1); + db->persist (co1); + + assert (db->load (1) == &o1); t.commit (); } diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 847d21b..7d921cd 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -323,7 +323,7 @@ main (int argc, char* argv[]) // { typedef odb::query query; - typedef odb::result result; + typedef odb::result result; // Test const result. { transaction t (db->begin ()); -- cgit v1.1 From ff17239429f51559fcfd84118a9518f69e82be04 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Sep 2011 15:07:11 +0200 Subject: Use int instead of size_t for NULL-able value In case of nullable the ODB compiler is unable to determine that the wrapped type is size_t. This results in 64-bit integer being stored and 32-bit being loaded. This interacts badly with PG for some reason. --- common/view/test.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/view/test.hxx b/common/view/test.hxx index dc3439c..37486aa 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -120,7 +120,7 @@ struct employer #pragma db id std::string name; - std::size_t head_count; + unsigned int head_count; std::vector employees; }; @@ -341,7 +341,7 @@ struct view7 std::string first_name; std::string last_name; - odb::nullable head_count; + odb::nullable head_count; }; // -- cgit v1.1 From 01e8ab839b1a08b227972b07567e9611ae8148f0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Sep 2011 13:20:59 +0200 Subject: Remove NDEBUG macro from VC project; tests always need enabled assert() --- boost/common/template/template-vc10.vcxproj | 4 ++-- boost/common/template/template-vc9.vcproj | 4 ++-- boost/mysql/template/template-vc10.vcxproj | 4 ++-- boost/mysql/template/template-vc9.vcproj | 4 ++-- boost/pgsql/template/template-vc10.vcxproj | 4 ++-- boost/pgsql/template/template-vc9.vcproj | 4 ++-- boost/sqlite/template/template-vc10.vcxproj | 4 ++-- boost/sqlite/template/template-vc9.vcproj | 4 ++-- common/template/template-vc10.vcxproj | 4 ++-- common/template/template-vc9.vcproj | 4 ++-- libcommon/common/libcommon-vc10.vcxproj | 4 ++-- libcommon/common/libcommon-vc9.vcproj | 4 ++-- mysql/template/template-vc10.vcxproj | 4 ++-- mysql/template/template-vc9.vcproj | 4 ++-- pgsql/template/template-vc10.vcxproj | 4 ++-- pgsql/template/template-vc9.vcproj | 4 ++-- qt/common/template/template-vc10.vcxproj | 4 ++-- qt/common/template/template-vc9.vcproj | 4 ++-- qt/mysql/template/template-vc10.vcxproj | 4 ++-- qt/mysql/template/template-vc9.vcproj | 4 ++-- qt/pgsql/template/template-vc10.vcxproj | 4 ++-- qt/pgsql/template/template-vc9.vcproj | 4 ++-- qt/sqlite/template/template-vc10.vcxproj | 4 ++-- qt/sqlite/template/template-vc9.vcproj | 4 ++-- sqlite/template/template-vc10.vcxproj | 4 ++-- sqlite/template/template-vc9.vcproj | 4 ++-- tracer/template/template-vc10.vcxproj | 4 ++-- tracer/template/template-vc9.vcproj | 4 ++-- 28 files changed, 56 insertions(+), 56 deletions(-) diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj index 2e4028b..55ceffc 100644 --- a/boost/common/template/template-vc10.vcxproj +++ b/boost/common/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj index 79d9084..235bd3c 100644 --- a/boost/common/template/template-vc9.vcproj +++ b/boost/common/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/boost/mysql/template/template-vc10.vcxproj b/boost/mysql/template/template-vc10.vcxproj index 6003968..e6475bb 100644 --- a/boost/mysql/template/template-vc10.vcxproj +++ b/boost/mysql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj index 0e8314b..316ea86 100644 --- a/boost/mysql/template/template-vc9.vcproj +++ b/boost/mysql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj index 4706add..b344095 100644 --- a/boost/pgsql/template/template-vc10.vcxproj +++ b/boost/pgsql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj index 64463ef..2639ffb 100644 --- a/boost/pgsql/template/template-vc9.vcproj +++ b/boost/pgsql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/boost/sqlite/template/template-vc10.vcxproj b/boost/sqlite/template/template-vc10.vcxproj index a9d55eb..14e3fb8 100644 --- a/boost/sqlite/template/template-vc10.vcxproj +++ b/boost/sqlite/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/boost/sqlite/template/template-vc9.vcproj b/boost/sqlite/template/template-vc9.vcproj index 82cd1eb..b8fab03 100644 --- a/boost/sqlite/template/template-vc9.vcproj +++ b/boost/sqlite/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index f9f82d0..4a2711c 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index caa4567..49e95ec 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj index 69494b0..a07a9a6 100644 --- a/libcommon/common/libcommon-vc10.vcxproj +++ b/libcommon/common/libcommon-vc10.vcxproj @@ -126,7 +126,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -148,7 +148,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj index a7ec116..afec31a 100644 --- a/libcommon/common/libcommon-vc9.vcproj +++ b/libcommon/common/libcommon-vc9.vcproj @@ -203,7 +203,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -284,7 +284,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index 0619da6..6e43f64 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index a9b8038..e6a253a 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/pgsql/template/template-vc10.vcxproj b/pgsql/template/template-vc10.vcxproj index 6e5aa8a..f0ac852 100644 --- a/pgsql/template/template-vc10.vcxproj +++ b/pgsql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/pgsql/template/template-vc9.vcproj b/pgsql/template/template-vc9.vcproj index 835c472..ff1cbb9 100644 --- a/pgsql/template/template-vc9.vcproj +++ b/pgsql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/qt/common/template/template-vc10.vcxproj b/qt/common/template/template-vc10.vcxproj index e923ab1..5283a7e 100644 --- a/qt/common/template/template-vc10.vcxproj +++ b/qt/common/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/qt/common/template/template-vc9.vcproj b/qt/common/template/template-vc9.vcproj index be74431..1ad9a61 100644 --- a/qt/common/template/template-vc9.vcproj +++ b/qt/common/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj index 6acca84..d366643 100644 --- a/qt/mysql/template/template-vc10.vcxproj +++ b/qt/mysql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj index dfc2c51..a9b474a 100644 --- a/qt/mysql/template/template-vc9.vcproj +++ b/qt/mysql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj index f34826c..37ce9a0 100644 --- a/qt/pgsql/template/template-vc10.vcxproj +++ b/qt/pgsql/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj index 7bd0e4a..fa20737 100644 --- a/qt/pgsql/template/template-vc9.vcproj +++ b/qt/pgsql/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/qt/sqlite/template/template-vc10.vcxproj b/qt/sqlite/template/template-vc10.vcxproj index e9481f5..c299610 100644 --- a/qt/sqlite/template/template-vc10.vcxproj +++ b/qt/sqlite/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/qt/sqlite/template/template-vc9.vcproj b/qt/sqlite/template/template-vc9.vcproj index d03c0aa..c4c3b95 100644 --- a/qt/sqlite/template/template-vc9.vcproj +++ b/qt/sqlite/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj index 3f7ddf9..1b70509 100644 --- a/sqlite/template/template-vc10.vcxproj +++ b/sqlite/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj index 48516cd..9d54cbb 100644 --- a/sqlite/template/template-vc9.vcproj +++ b/sqlite/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/tracer/template/template-vc10.vcxproj b/tracer/template/template-vc10.vcxproj index 523fb79..1bcb4ac 100644 --- a/tracer/template/template-vc10.vcxproj +++ b/tracer/template/template-vc10.vcxproj @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj index da08589..8e52acb 100644 --- a/tracer/template/template-vc9.vcproj +++ b/tracer/template/template-vc9.vcproj @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$(SolutionDir)\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" + PreprocessorDefinitions="WIN32;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" -- cgit v1.1 From adbf41f849da186057edfbd1873f49433dc5efd2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Sep 2011 13:43:20 +0200 Subject: Make sure NDEBUG is not defined --- libcommon/common/common.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 6ace845..6ae33d4 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -15,6 +15,12 @@ #include #include +// Make sure assert() is not diabled. +// +#ifdef NDEBUG +# error ODB tests require enabled assert(); un-define the NDEBUG macro +#endif + LIBCOMMON_EXPORT std::auto_ptr create_database (int& argc, char* argv[], -- cgit v1.1 From 7a1be868574beb4843d189a7d9d758d608da65c9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Sep 2011 11:20:31 +0200 Subject: Add support for associating tables with views --- common/view/driver.cxx | 38 +++++++++++++++++++++++++++++++------- common/view/test.hxx | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 7d921cd..cd734bd 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -134,7 +134,7 @@ view4_test (const auto_ptr& db) template void -view6_test (const auto_ptr& db) +view6_test (const auto_ptr& db, const odb::query& q) { typedef odb::query query; typedef odb::result result; @@ -143,9 +143,7 @@ view6_test (const auto_ptr& db) transaction t (db->begin ()); { - result r ( - db->query ( - query::employer::name == "Simple Tech, Inc")); + result r (db->query (q)); iterator i (r.begin ()); @@ -312,6 +310,24 @@ main (int argc, char* argv[]) } } + // view1d + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ("age < 31 ORDER BY age")); + view1_check (r); + } + + t.commit (); + } + } + // view2 // view2_test (db); @@ -412,9 +428,17 @@ main (int argc, char* argv[]) // view6 // - view6_test (db); - view6_test (db); - view6_test (db); + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); // view7 // diff --git a/common/view/test.hxx b/common/view/test.hxx index 37486aa..2497097 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -172,6 +172,21 @@ struct view1c unsigned short age; }; +// Assembled SELECT and FROM-lists. +// +#pragma db view table("common_view_person") +struct view1d +{ + #pragma db column("first") + std::string first; + + #pragma db column("last") + std::string last; + + #pragma db column("age") + unsigned short age; +}; + // // Count view plus associated object. // @@ -330,6 +345,23 @@ struct view6b std::string employer; }; +// The same using tables. +// +#pragma db view table("common_view_person" = "p") \ + table("common_view_employer_employees" = "ee": "ee.value = p.id") \ + table("common_view_employer" = "e": "ee.object_id = e.name") +struct view6c +{ + #pragma db column("p.first") + std::string first_name; + + #pragma db column("p"."last") + std::string last_name; + + #pragma db column("e.name") + std::string employer; +}; + // // JOIN via a custom condition. // -- cgit v1.1 From 8c858f038f9ae213d962d49d5c5ca085a73e588f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Sep 2011 11:44:42 +0200 Subject: Fix invalid configure option name --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 0eaa492..719b6c1 100644 --- a/INSTALL +++ b/INSTALL @@ -31,7 +31,7 @@ After unpacking the source code archive, change to the odb-tests package directory (referred to as odb-tests/ from now on) and run the configure script, for example: -./configure --database +./configure --with-database To see the available configuration options run configure with --help: -- cgit v1.1 From a06b917d661a61aad88dbf4351494b7c84273dc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 2 Oct 2011 17:07:21 +0200 Subject: If query substituting placeholder is empty, pass true expression instead This allows uniform usage of views both with and without any extra conditions. Also optimize some common cases so that we don't have useless WHERE TRUE clauses or (...) AND (TRUE) expressions. --- common/view/driver.cxx | 2 +- common/view/test.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index cd734bd..a3ef34f 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -268,7 +268,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - result r (db->query (query (true))); + result r (db->query ()); view1_check (r); t.commit (); diff --git a/common/view/test.hxx b/common/view/test.hxx index 2497097..b5b9d65 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -164,7 +164,7 @@ struct view1b // Runtime query. // -#pragma db view query() +#pragma db view //query() struct view1c { std::string first; @@ -415,7 +415,7 @@ struct view10 // Composite in object. // #pragma db view object(person) \ - query((person::measures.weight > 60 && person::measures.hight < 190) \ + query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ + "ORDER BY" + person::age) struct view11 { -- cgit v1.1 From 6465f0b9cf542cfd1fb77687cdad47fde28c9fad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 2 Oct 2011 19:12:47 +0200 Subject: Handle object pointers when comparing view and object data member types Also issues an error if an object member associated with a view member is transient or inverse. --- common/view/driver.cxx | 23 +++++++++++++++++++++++ common/view/test.hxx | 19 ++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index a3ef34f..a6048dd 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -575,6 +575,29 @@ main (int argc, char* argv[]) t.commit (); } } + + // view12 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->residence == "US"); + assert (++i == r.end ()); + } + + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/view/test.hxx b/common/view/test.hxx index b5b9d65..3812662 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -77,10 +77,10 @@ struct person #pragma db id unsigned long id; - #pragma db column ("first") + #pragma db column("first") std::string first_name_; - #pragma db column ("last") + #pragma db column("last") std::string last_name_; unsigned short age; @@ -383,10 +383,10 @@ struct view7 query (wife::husband.is_not_null ()) struct view8 { - #pragma db column (wife::first_name_) + #pragma db column(wife::first_name_) std::string wife_name; - #pragma db column (husb::first_name_) + #pragma db column(husb::first_name_) std::string husb_name; }; @@ -421,8 +421,17 @@ struct view11 { std::string last_name; - #pragma db column (person::measures.hight) + #pragma db column(person::measures.hight) unsigned short hight; }; +// +// Extract object pointer as object id. +// +#pragma db view object(person) +struct view12 +{ + std::string residence; +}; + #endif // TEST_HXX -- cgit v1.1 From 50106d982ae360038f8be04f9f78198f6caeaa65 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Oct 2011 09:59:54 +0200 Subject: Bump version to 1.6.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index be9a4ff..dc1e644 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.0.a2 +1.6.0 -- cgit v1.1 From 198ecf92fbca04cc5a03c94de6aa8a72744a39d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Oct 2011 18:02:09 +0200 Subject: Don't add -framework OS X option to CPPFLAGS It is only necessary in LDFLAGS and adding it to CPPFLAGS causes warnings. --- m4/libqt.m4 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index bb7ffa5..a094643 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -67,10 +67,7 @@ fi # if test x"$libqt_found" = xno; then - save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" - - CPPFLAGS="$CPPFLAGS -framework QtCore" LIBS="-framework QtCore $LIBS" CXX_LIBTOOL_LINK_IFELSE( @@ -91,7 +88,6 @@ libqt_found=yes ]) if test x"$libqt_found" = xno; then - CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" fi fi -- cgit v1.1 From 7e70aa043b7a2482590b0e5459284d2c848eb474 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2011 14:20:19 +0200 Subject: Mention autotools as prerequisite in INSTALL-GIT --- INSTALL-GIT | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/INSTALL-GIT b/INSTALL-GIT index 3276f45..f917af5 100644 --- a/INSTALL-GIT +++ b/INSTALL-GIT @@ -4,9 +4,9 @@ checked out from the git repository. The major difference between using a released source code package and source code from the repository is that the former does not contain autotools-based makefiles or Visual Studio project files. Instead, it contains templates for -these files as well as its own, custom build system. This build system is +these files as well as its own, custom build system. This build system is used for development as well as to automatically generate the autotools and -Visual Studio files. +Visual Studio files. This file describes how to use this build system to build the package as well as to create a release-ready source distribution which contains the autotools @@ -30,6 +30,12 @@ also need the following packages: - GNU sed >= 4.0.0 http://www.gnu.org/software/sed/ - tofrodos >= 1.7.0 http://www.thefreecountry.com/tofrodos/ +As we as the GNU autotools: + + - GNU libtool >= 2.2.6b http://www.gnu.org/software/libtool/ + - GNU autoconf >= 2.67 http://www.gnu.org/software/autoconf/ + - GNU automake >= 1.11.1 http://www.gnu.org/software/automake/ + Any reasonably up to date GNU/Linux installation would normally have all of the above packages already present, except for build and maybe tofrodos. @@ -39,7 +45,7 @@ Configuring and Building To build the source code simply run make in the root directory of the package. The first time you run make, the build process will also configure the -package by asking you several questions. On the subsequent runs, make will +package by asking you several questions. On the subsequent runs, make will only rebuild what has changed. To run the automated test suite (if any), run 'make test'. To clean the object -- cgit v1.1 From 84f9ce9150abfb5f4424d8e94fefa932af3172fa Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 2 Sep 2011 14:15:46 +0200 Subject: Add infrastructure for oracle development testing and implement native test --- INSTALL | 1 + build/bootstrap.make | 2 +- build/configure | 3 +- build/import/libodb-oracle/LICENSE | 12 +++ .../import/libodb-oracle/configuration-rules.make | 15 +++ build/import/libodb-oracle/configure | 55 +++++++++++ build/import/libodb-oracle/stub.make | 30 ++++++ build/oracle/configure | 75 +++++++++++++++ build/oracle/oracle | 73 ++++++++++++++ libcommon/common/common.cxx | 14 +++ libcommon/common/config.h.in | 1 + libcommon/common/makefile | 3 + makefile | 9 +- oracle/makefile | 35 +++++++ oracle/native/driver.cxx | 78 +++++++++++++++ oracle/native/makefile | 85 +++++++++++++++++ oracle/native/test.std | 0 oracle/template/driver.cxx | 44 +++++++++ oracle/template/makefile | 106 +++++++++++++++++++++ oracle/template/test.hxx | 27 ++++++ oracle/template/test.std | 1 + 21 files changed, 666 insertions(+), 3 deletions(-) create mode 100644 build/import/libodb-oracle/LICENSE create mode 100644 build/import/libodb-oracle/configuration-rules.make create mode 100755 build/import/libodb-oracle/configure create mode 100644 build/import/libodb-oracle/stub.make create mode 100755 build/oracle/configure create mode 100755 build/oracle/oracle create mode 100644 oracle/makefile create mode 100644 oracle/native/driver.cxx create mode 100644 oracle/native/makefile create mode 100644 oracle/native/test.std create mode 100644 oracle/template/driver.cxx create mode 100644 oracle/template/makefile create mode 100644 oracle/template/test.hxx create mode 100644 oracle/template/test.std diff --git a/INSTALL b/INSTALL index 719b6c1..7d87da3 100644 --- a/INSTALL +++ b/INSTALL @@ -4,6 +4,7 @@ system you would like to use. Valid values for are: 'mysql' - The MySQL database system 'sqlite' - The SQLite database system 'pgsql' - The PostgreSQL database system + 'oracle' - The Oracle database system Prerequisites ============= diff --git a/build/bootstrap.make b/build/bootstrap.make index 3c5ca1e..f59e809 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -62,7 +62,7 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql sqlite pgsql +databases := mysql sqlite pgsql oracle $(dist): databases := $(databases) # $1 project template without the -vcN.vc[x]proj suffix. diff --git a/build/configure b/build/configure index 70413fc..9aee64a 100755 --- a/build/configure +++ b/build/configure @@ -25,9 +25,10 @@ $echo $echo "(1) MySQL" $echo "(2) SQLite" $echo "(3) PostgreSQL" +$echo "(4) Oracle" $echo -db_id=`read_option "mysql sqlite pgsql"` +db_id=`read_option "mysql sqlite pgsql oracle"` echo "db_id := $db_id" >$1 diff --git a/build/import/libodb-oracle/LICENSE b/build/import/libodb-oracle/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-oracle/LICENSE @@ -0,0 +1,12 @@ +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-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make new file mode 100644 index 0000000..a4a8c99 --- /dev/null +++ b/build/import/libodb-oracle/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-oracle/configuration-rules.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +$(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. + $(call message,,$(scf_root)/import/libodb-oracle/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-oracle/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-oracle/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure new file mode 100755 index 0000000..9934d03 --- /dev/null +++ b/build/import/libodb-oracle/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-oracle/configure +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; 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-oracle' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-oracle' 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-oracle'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-oracle'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_oracle_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-oracle/stub.make b/build/import/libodb-oracle/stub.make new file mode 100644 index 0000000..2432246 --- /dev/null +++ b/build/import/libodb-oracle/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-oracle/stub.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) + +libodb_oracle_installed := + +$(call -include,$(dcf_root)/import/libodb-oracle/configuration-dynamic.make) + +ifdef libodb_oracle_installed + +ifeq ($(libodb_oracle_installed),y) + +$(call export,l: -lodb-oracle -lodb -lclntsh,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-oracle/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/oracle/configure b/build/oracle/configure new file mode 100755 index 0000000..46e5061 --- /dev/null +++ b/build/oracle/configure @@ -0,0 +1,75 @@ +#! /usr/bin/env bash + +# file : build/oracle/configure +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +$echo +$echo "Please enter the Oracle client program path." +$echo + +driver=`read_path --command sqlplus` + +$echo +$echo "Please enter the Oracle database user." +$echo + +user=`read_value "odb_test"` + +$echo +$echo "Please enter the Oracle database password." +$echo + +passwd=`read_value ""` + +$echo +$echo "Please enter the Oracle listener host." +$echo + +host=`read_value ""` + +$echo +$echo "Please enter the Oracle listener port." +$echo + +port=`read_value ""` + +$echo +$echo "Please enter the Oracle service to use. Note that the associated" +$echo "database WILL BE MODIFIED." +$echo + +service=`read_value ""` + +opt=$dcf_root/db.options +drv=$dcf_root/db-driver + +if [ -n "$user" ]; then +echo "--user '$user'" >$opt +fi + +if [ -n "$passwd" ]; then +echo "--password '$passwd'" >>$opt +fi + +if [ -n "$service" ]; then +echo "--service '$service'" >>$opt +fi + +if [ -n "$host" ]; then +echo "--host '$host'" >>$opt +fi + +if [ -n "$port" ]; then +echo "--port '$port'" >>$opt +fi + +echo "#!/bin/sh" >$drv +echo "opt=\`cat $opt\`" >>$drv +echo "eval $scf_root/oracle/oracle --driver $driver \$opt \$*" >>$drv +chmod 755 $drv diff --git a/build/oracle/oracle b/build/oracle/oracle new file mode 100755 index 0000000..76badcb --- /dev/null +++ b/build/oracle/oracle @@ -0,0 +1,73 @@ +#! /usr/bin/env bash + +# file : build/oracle/oracle +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +# +# Oracle driver wrapper. +# + +while [ $# -gt 0 ]; do + case $1 in + --driver) + driver=$2 + shift 2 + ;; + --user) + user="$2" + shift 2 + ;; + --password) + passwd="$2" + shift 2 + ;; + --service) + service="$2" + shift 2 + ;; + --host) + host="$2" + shift 2 + ;; + --port) + port="$2" + shift 2 + ;; + *) + break + ;; + esac +done + +if [ -z "$driver" ]; then + driver=sqlplus +fi + +opt="-L" +conn=$user + +if [ -n "$passwd" ]; then + conn="$conn/$passwd" +fi + +if [ -n "$host" ]; then + conn="$conn@//$host" + + if [ -n "$port" ]; then + conn="$conn:$port" + fi + + if [ -n "$service" ]; then + conn="$conn/$service" + fi +elif [ -n "$service" ]; then + conn="$conn@$service" +fi + +if [ -n "$1" ]; then + exec $driver $opt $conn <$1 +else + exec $driver $opt $conn +fi diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 384d945..d09c14b 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -22,6 +22,9 @@ #elif defined(DATABASE_PGSQL) # include # include +#elif defined(DATABASE_ORACLE) +# include +# include #else # error unknown database #endif @@ -37,6 +40,8 @@ namespace mysql = odb::mysql; namespace sqlite = odb::sqlite; #elif defined(DATABASE_PGSQL) namespace pgsql = odb::pgsql; +#elif defined(DATABASE_ORACLE) +namespace oracle = odb::oracle; #endif auto_ptr @@ -60,6 +65,8 @@ create_database (int& argc, sqlite::database::print_usage (cerr); #elif defined(DATABASE_PGSQL) pgsql::database::print_usage (cerr); +#elif defined(DATABASE_ORAClE) + oracle::database::print_usage (cerr); #endif exit (0); @@ -107,6 +114,13 @@ create_database (int& argc, f.reset (new pgsql::connection_pool_factory (max_connections)); db.reset (new pgsql::database (argc, argv, false, "", f)); +#elif defined(DATABASE_ORACLE) + auto_ptr f; + + if (max_connections != 0) + f.reset (new oracle::connection_pool_factory (max_connections)); + + db.reset (new oracle::database (argc, argv, false, 0, f)); #endif return db; diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index dba0b12..b7cc545 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -12,6 +12,7 @@ #undef DATABASE_MYSQL #undef DATABASE_SQLITE #undef DATABASE_PGSQL +#undef DATABASE_ORACLE #undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 326f1f6..885b55d 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -58,6 +58,9 @@ endif ifeq ($(db_id),pgsql) @echo '#define DATABASE_PGSQL 1' >>$@ endif +ifeq ($(db_id),oracle) + @echo '#define DATABASE_ORACLE 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ diff --git a/makefile b/makefile index cbbfa78..9bb125d 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql sqlite pgsql boost qt +all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt dirs := common tracer boost qt ifeq ($(db_id),mysql) @@ -20,6 +20,13 @@ ifeq ($(db_id),pgsql) dirs += pgsql endif +# @@ Remove overrides when Oracle implementation is complete. +# +ifeq ($(db_id),oracle) +all_dirs := libcommon oracle +dirs := libcommon oracle +endif + default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test diff --git a/oracle/makefile b/oracle/makefile new file mode 100644 index 0000000..7b7453b --- /dev/null +++ b/oracle/makefile @@ -0,0 +1,35 @@ +# file : oracle/makefile +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +tests := \ +native + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := oracle +$(dist): export dirs := $(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/oracle/native/driver.cxx b/oracle/native/driver.cxx new file mode 100644 index 0000000..ab1138a --- /dev/null +++ b/oracle/native/driver.cxx @@ -0,0 +1,78 @@ +// file : oracle/native/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : ODB NCUEL; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("BEGIN " + " EXECUTE IMMEDIATE 'DROP TABLE oracle_native_test'; " + " EXCEPTION " + " WHEN OTHERS THEN " + " IF SQLCODE != -942 THEN RAISE; END IF; " + "END;"); + + db->execute ("CREATE TABLE oracle_native_test (n NUMERIC(10,0))"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO oracle_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO oracle_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM oracle_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM oracle_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/oracle/native/makefile b/oracle/native/makefile new file mode 100644 index 0000000..cea60ae --- /dev/null +++ b/oracle/native/makefile @@ -0,0 +1,85 @@ +# file : oracle/native/makefile +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +driver := $(out_base)/driver +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/native/test.std b/oracle/native/test.std new file mode 100644 index 0000000..e69de29 diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx new file mode 100644 index 0000000..b5c9f71 --- /dev/null +++ b/oracle/template/driver.cxx @@ -0,0 +1,44 @@ +// file : oracle/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : ODB NCUEL; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/oracle/template/makefile b/oracle/template/makefile new file mode 100644 index 0000000..47315d9 --- /dev/null +++ b/oracle/template/makefile @@ -0,0 +1,106 @@ +# file : oracle/template/makefile +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; 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 oracle --generate-schema \ +--table-prefix oracle_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(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 schema) + $(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/oracle/template/test.hxx b/oracle/template/test.hxx new file mode 100644 index 0000000..7e8f699 --- /dev/null +++ b/oracle/template/test.hxx @@ -0,0 +1,27 @@ +// file : oracle/template/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : ODB NCUEL; 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/oracle/template/test.std b/oracle/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/oracle/template/test.std @@ -0,0 +1 @@ +test 001 -- cgit v1.1 From bdeee8eabc02e01f57c2fc43415ef8813ed69814 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 17 Oct 2011 09:12:58 +0200 Subject: Add -S option when invoking SQLPlus to suppress some output --- build/oracle/oracle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/oracle/oracle b/build/oracle/oracle index 76badcb..7c53922 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -66,6 +66,8 @@ elif [ -n "$service" ]; then conn="$conn@$service" fi +opt="-S $opt" + if [ -n "$1" ]; then exec $driver $opt $conn <$1 else -- cgit v1.1 From 8295852a42e7dc178ee9cf94df746a85dda48b05 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 17 Oct 2011 09:13:48 +0200 Subject: Add Oracle create_database code allowing for specification of character sets --- libcommon/common/common.cxx | 10 +++++++++- libcommon/common/common.hxx | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index d09c14b..c4cc667 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -49,8 +49,16 @@ create_database (int& argc, char* argv[], #if defined(DATABASE_SQLITE) bool schema, + unsigned short, + unsigned short, +#elif defined(DATABASE_ORACLE) + bool, + unsigned short charset, + unsigned short ncharset, #else bool, + unsigned short, + unsigned short, #endif size_t max_connections) { @@ -120,7 +128,7 @@ create_database (int& argc, if (max_connections != 0) f.reset (new oracle::connection_pool_factory (max_connections)); - db.reset (new oracle::database (argc, argv, false, 0, f)); + db.reset (new oracle::database (argc, argv, false, charset, ncharset, 0, f)); #endif return db; diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 6ae33d4..71715d7 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -25,6 +25,8 @@ LIBCOMMON_EXPORT std::auto_ptr create_database (int& argc, char* argv[], bool create_schema = true, + unsigned short charset = 0, + unsigned short ncharset = 0, std::size_t max_connections = 0); // This function returns an accurate result only if the result iterator -- cgit v1.1 From 049aa1e88958815a61e779f65e4c601fec104a10 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 17 Oct 2011 09:54:14 +0200 Subject: Add Oracle types test --- oracle/makefile | 3 +- oracle/types/driver.cxx | 85 +++++++++++++++++++++++++ oracle/types/makefile | 107 +++++++++++++++++++++++++++++++ oracle/types/test.hxx | 163 ++++++++++++++++++++++++++++++++++++++++++++++++ oracle/types/test.std | 0 oracle/types/traits.hxx | 57 +++++++++++++++++ 6 files changed, 414 insertions(+), 1 deletion(-) create mode 100644 oracle/types/driver.cxx create mode 100644 oracle/types/makefile create mode 100644 oracle/types/test.hxx create mode 100644 oracle/types/test.std create mode 100644 oracle/types/traits.hxx diff --git a/oracle/makefile b/oracle/makefile index 7b7453b..8073a94 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -6,7 +6,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ -native +native \ +types default := $(out_base)/ dist := $(out_base)/.dist diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx new file mode 100644 index 0000000..aa7a2cf --- /dev/null +++ b/oracle/types/driver.cxx @@ -0,0 +1,85 @@ +// file : oracle/types/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Oracle type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + // Create an Oracle database instance, setting both the client database + // and national character set to UTF-8. + // + auto_ptr db (create_database (argc, argv, false, 873, 873)); + + object o (1); + + o.int_ = -123456; + o.uint_ = 123456; + o.long_long_ = -123456; + o.ulong_long_ = 123456; + + o.float_ = 1.123F; + o.double_ = 1.123; + o.binary_float_ = 1.123F; + o.binary_double_ = 1.123; + + o.date_ = date_time (2010, 8, 29, 15, 33, 18); + + string short_str (32, 's'); + string medium_str (104, 'm'); + string long_str (1018, 'l'); + string vlong_str (15000, 'v'); + + o.char_ = short_str; + o.varchar2_ = medium_str; + o.nchar_ = short_str; + o.nvarchar2_ = medium_str;o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); + o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + + const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + + o.clob_ = unicode_str; + o.nclob_ = unicode_str; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/oracle/types/makefile b/oracle/types/makefile new file mode 100644 index 0000000..7f01dd6 --- /dev/null +++ b/oracle/types/makefile @@ -0,0 +1,107 @@ +# file : oracle/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 oracle --generate-schema \ +--table-prefix oracle_types_ --hxx-prologue '\#include "traits.hxx"' +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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/oracle/types/test.hxx b/oracle/types/test.hxx new file mode 100644 index 0000000..0d9f5f7 --- /dev/null +++ b/oracle/types/test.hxx @@ -0,0 +1,163 @@ +// file : oracle/types/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +struct date_time +{ + date_time () + { + } + + date_time (unsigned short y, + unsigned char m, + unsigned char d, + unsigned char h, + unsigned char min, + unsigned char sec) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec) + { + } + + bool + operator== (const date_time& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second; + } + + unsigned short year; + unsigned char month; + unsigned char day; + unsigned char hour; + unsigned char minute; + unsigned char second; +}; + +#pragma db object +struct object +{ + object (unsigned int id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned int id_; + + // Integral types. + // + #pragma db type ("NUMBER(10)") + int int_; + + #pragma db type ("NUMBER(10)") + unsigned uint_; + + #pragma db type ("NUMBER(19)") + long long long_long_; + + #pragma db type ("NUMBER(20)") + unsigned long long ulong_long_; + + // Float types. + // + #pragma db type ("FLOAT(24)") + float float_; + + #pragma db type ("FLOAT(53)") + double double_; + + #pragma db type ("BINARY_FLOAT") + float binary_float_; + + #pragma db type ("BINARY_DOUBLE") + double binary_double_; + + // Data-time types. + // + #pragma db type ("DATE") + date_time date_; + + // @@ + // #pragma db type ("TIMESTAMP(6)") + // date_time timestamp_; + + // String and binary types. + // + #pragma db type ("CHAR(32)") + std::string char_; + + #pragma db type ("VARCHAR2(512)") + std::string varchar2_; + + #pragma db type ("NCHAR(32)") + std::string nchar_; + + #pragma db type ("NVARCHAR2(512)") + std::string nvarchar2_; + + #pragma db type ("RAW(1024)") + std::vector raw_; + + // LOB types. + // + #pragma db type ("BLOB") + std::vector blob_; + + #pragma db type ("CLOB") + std::string clob_; + + #pragma db type ("NCLOB") + std::string nclob_; + + // Test NULL value. + // + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + int_ == y.int_ && + uint_ == y.uint_ && + long_long_ == y.long_long_ && + ulong_long_ == y.ulong_long_ && + float_ == y.float_ && + double_ == y.double_ && + binary_float_ == y.binary_float_ && + binary_double_ == y.binary_double_ && + date_ == y.date_ && + char_ == y.char_ && + varchar2_ == y.varchar2_ && + nchar_ == y.nchar_ && + nvarchar2_ == y.nvarchar2_ && + raw_ == y.raw_ && + blob_ == y.blob_ && + clob_ == y.clob_ && + nclob_ == y.nclob_; + } +}; + +#endif // TEST_HXX diff --git a/oracle/types/test.std b/oracle/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx new file mode 100644 index 0000000..521bc9c --- /dev/null +++ b/oracle/types/traits.hxx @@ -0,0 +1,57 @@ +// file : oracle/types/traits.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include + +#include "test.hxx" // date_time + +namespace odb +{ + namespace oracle + { + template <> + class value_traits + { + public: + typedef long long value_type; + typedef long long query_type; + typedef char* image_type; + + static void + set_value (date_time& v, const char* i, bool is_null) + { + if (!is_null) + { + v.year = (i[0] - 100) * 100; + v.year += (i[1] - 100); + v.month = i[2]; + v.day = i[3]; + v.hour = i[4] - 1; + v.minute = i[5] - 1; + v.second = i[6] - 1; + } + } + + static void + set_image (char* i, bool& is_null, const date_time& v) + { + is_null = false; + + i[0] = static_cast (v.year / 100 + 100); + i[1] = static_cast (v.year % 100 + 100); + i[2] = static_cast (v.month); + i[3] = static_cast (v.day); + i[4] = static_cast (v.hour + 1); + i[5] = static_cast (v.minute + 1); + i[6] = static_cast (v.second + 1); + } + }; + } +} + +#endif // TRAITS_HXX -- cgit v1.1 From 621a91328ba7f552ddcd05f3680184cd56357830 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 11:02:34 +0200 Subject: Correct create_database implementation for Oracle --- libcommon/common/common.cxx | 13 ++++--------- libcommon/common/common.hxx | 2 -- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index c4cc667..285ef68 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -49,16 +49,8 @@ create_database (int& argc, char* argv[], #if defined(DATABASE_SQLITE) bool schema, - unsigned short, - unsigned short, -#elif defined(DATABASE_ORACLE) - bool, - unsigned short charset, - unsigned short ncharset, #else bool, - unsigned short, - unsigned short, #endif size_t max_connections) { @@ -128,7 +120,10 @@ create_database (int& argc, if (max_connections != 0) f.reset (new oracle::connection_pool_factory (max_connections)); - db.reset (new oracle::database (argc, argv, false, charset, ncharset, 0, f)); + // Set client database character set and client national character set + // to UTF-8. + // + db.reset (new oracle::database (argc, argv, false, 873, 873, 0, f)); #endif return db; diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 71715d7..6ae33d4 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -25,8 +25,6 @@ LIBCOMMON_EXPORT std::auto_ptr create_database (int& argc, char* argv[], bool create_schema = true, - unsigned short charset = 0, - unsigned short ncharset = 0, std::size_t max_connections = 0); // This function returns an accurate result only if the result iterator -- cgit v1.1 From 5fae6bf3eaf7301b0ecf89783ca6cd4e63acec67 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 11:03:09 +0200 Subject: Add character set conversion tests to Oracle types test --- oracle/types/driver.cxx | 72 +++++++++++++++++++++++++++++++++++++++++++------ oracle/types/test.hxx | 41 ++++++++++++++++++++++++++-- 2 files changed, 103 insertions(+), 10 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index aa7a2cf..55918af 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -29,7 +29,7 @@ main (int argc, char* argv[]) // Create an Oracle database instance, setting both the client database // and national character set to UTF-8. // - auto_ptr db (create_database (argc, argv, false, 873, 873)); + auto_ptr db (create_database (argc, argv, false)); object o (1); @@ -45,29 +45,62 @@ main (int argc, char* argv[]) o.date_ = date_time (2010, 8, 29, 15, 33, 18); - string short_str (32, 's'); + string vshort_str (8, 's'); + string short_str (13, 's'); string medium_str (104, 'm'); string long_str (1018, 'l'); string vlong_str (15000, 'v'); o.char_ = short_str; o.varchar2_ = medium_str; - o.nchar_ = short_str; - o.nvarchar2_ = medium_str;o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); - o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + o.clob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); - const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + o.nchar_ = vshort_str; + o.nvarchar2_ = medium_str; + o.nclob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); - o.clob_ = unicode_str; - o.nclob_ = unicode_str; + o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); + o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + // Persist. + // { transaction t (db->begin ()); db->persist (o); t.commit (); } + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Test character set conversion. // + // const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + + // o.char_ = unicode_str; + // o.varchar2_ = unicode_str; + // o.clob_ = unicode_str; + + // o.nchar_ = unicode_str; + // o.nvarchar2_ = unicode_str; + // o.nclob_ = unicode_str; + + // Persist. + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Load. // { transaction t (db->begin ()); @@ -76,6 +109,29 @@ main (int argc, char* argv[]) assert (o == *o1); } + + // Test 64 bit integers. + // + big_ints bi (true); + bi.id = 1; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (bi); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr bi1 (db->load (1)); + t.commit (); + + assert (bi == *bi1); + } } catch (const odb::exception& e) { diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 0d9f5f7..d137a1d 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -106,13 +106,13 @@ struct object // String and binary types. // - #pragma db type ("CHAR(32)") + #pragma db type ("CHAR(13)") std::string char_; #pragma db type ("VARCHAR2(512)") std::string varchar2_; - #pragma db type ("NCHAR(32)") + #pragma db type ("NCHAR(8)") std::string nchar_; #pragma db type ("NVARCHAR2(512)") @@ -160,4 +160,41 @@ struct object } }; +#pragma db object +struct big_ints +{ + big_ints (bool init = false) + { + if (init) + { + signed_zero = 0; + signed_min = 0x8000000000000000; // –9223372036854775808 + signed_max = 0x7FFFFFFFFFFFFFFFLL; // 9223372036854775807 + unsigned_zero = 0; + unsigned_max = 0xFFFFFFFFFFFFFFFFULL; + } + } + + #pragma db id + unsigned int id; + + long long signed_zero; + long long signed_min; + long long signed_max; + + unsigned long long unsigned_zero; + unsigned long long unsigned_max; + + bool + operator== (const big_ints& y) const + { + return id == y.id && + signed_zero == y.signed_zero && + signed_min == y.signed_min && + signed_max == y.signed_max && + unsigned_zero == y.unsigned_zero && + unsigned_max == y.unsigned_max; + } +}; + #endif // TEST_HXX -- cgit v1.1 From 33615c685523e5f282bc585efa0ff31df7dd3742 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 11:04:13 +0200 Subject: Add common tests for Oracle Due to the 30 character limit imposed by Oracle on identifiers, some of the common tests code and/or makefiles had to be modified. --- common/auto/makefile | 2 +- common/container/makefile | 2 +- common/container/test.hxx | 6 +++++- common/lazy-ptr/driver.cxx | 1 - common/lazy-ptr/makefile | 2 +- common/lifecycle/makefile | 2 +- common/makefile | 40 +++++++++++++++++++++++++--------------- common/schema/makefile | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 21 ++++++++++++++------- makefile | 4 ++-- 11 files changed, 52 insertions(+), 32 deletions(-) diff --git a/common/auto/makefile b/common/auto/makefile index 1d5b66a..1880cba 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_auto_ +--table-prefix cmn_auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index fb14cb0..c1b1124 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_container_ +--table-prefix cmn_ctnr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/test.hxx b/common/container/test.hxx index 2e267f6..ec392ec 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -54,6 +54,7 @@ struct cont_comp1 { // This composite value does not have any columns. // + #pragma db id_column("obj_id") num_vector sv; // Have the name "conflic" with the one in the object. }; @@ -63,11 +64,14 @@ struct cont_comp2 cont_comp2 (): num (777), str ("ggg") {} int num; + + #pragma db id_column("obj_id") str_list sl; + std::string str; }; -#pragma db object +#pragma db object table("obj") struct object { object (): nv (comp1_.sv), sl (comp2_.sl) {} diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 5f95c9a..d215240 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -217,7 +217,6 @@ main (int argc, char* argv[]) t.commit (); } - } // TR1. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 24e6e43..45a6779 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_lazy_ptr_ +--table-prefix cmn_lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index a47d6bf..3fcafce 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_lifecycle_ +--table-prefix cmn_lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/makefile b/common/makefile index 371ad13..603ea60 100644 --- a/common/makefile +++ b/common/makefile @@ -5,29 +5,39 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make +# @@ Uncomment all tests once Oracle tests have been fully +# implemented +# tests := \ auto \ -callback \ -composite \ -const \ container \ -ctor \ -default \ -enum \ -erase-query \ -inheritance \ -inverse \ lazy-ptr \ lifecycle \ -query \ -relationship \ -relationship-query \ schema \ -template \ -view \ wrapper -thread_tests := threads +#auto \ +#callback \ +#composite \ +#const \ +#container \ +#ctor \ +#default \ +#enum \ +#erase-query \ +#inheritance \ +#inverse \ +#lazy-ptr \ +#lifecycle \ +#query \ +#relationship \ +#relationship-query \ +#schema \ +#template \ +#view \ +#wrapper + +#thread_tests := threads all_tests := $(tests) $(thread_tests) build_tests := $(tests) $(thread_tests) diff --git a/common/schema/makefile b/common/schema/makefile index a0e81eb..e6e36e9 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_schema_ +--table-prefix cmn_schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index a8477de..7cb4171 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_wrapper_ +--table-prefix cmn_wpr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 6a1e0a9..70bb682 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -31,7 +31,7 @@ typedef nullable nullable_string; typedef std::tr1::shared_ptr tr1_nullable_string; #endif -#pragma db object +#pragma db object table("obj") struct object { #pragma db id auto @@ -39,17 +39,17 @@ struct object std::auto_ptr num; - #pragma db null std::auto_ptr str; - nullable_string nstr; + + #pragma db id_column ("id") std::vector nstrs; #ifdef HAVE_TR1_MEMORY #pragma db null tr1_nullable_string tr1_str; - #pragma db value_null + #pragma db value_null id_column("id") std::vector tr1_strs; #endif }; @@ -84,6 +84,7 @@ struct comp2 std::string str; int num; + #pragma db id_column("id") index_column("i") std::vector strs; }; @@ -93,14 +94,17 @@ operator== (const comp2& x, const comp2& y) return x.str == y.str && x.num == y.num && x.strs == y.strs; } -#pragma db object +#pragma db object table("comp_obj") struct comp_object { #pragma db id auto unsigned long id_; std::auto_ptr c1; // Wrapped comp value. + + #pragma db id_column("id") index_column("i") std::vector > vc1; // Container of wrapped comp values. + std::auto_ptr c2; // Container inside wrapped comp value. }; @@ -110,10 +114,12 @@ struct comp_object struct comp3: comp2 { std::auto_ptr c1; + + #pragma db id_column("id") index_column("i") std::vector > vc1; }; -#pragma db object +#pragma db object table("comp_obj2") struct comp_object2 { #pragma db id auto @@ -130,6 +136,7 @@ struct comp_object2 struct cont_comp { int num; + #pragma db id_column("id") std::auto_ptr > strs; }; @@ -139,7 +146,7 @@ operator== (const cont_comp& x, const cont_comp& y) return x.num == y.num && *x.strs == *y.strs; } -#pragma db object +#pragma db object table("cont_obj") struct cont_object { #pragma db id auto diff --git a/makefile b/makefile index 9bb125d..66fe55b 100644 --- a/makefile +++ b/makefile @@ -23,8 +23,8 @@ endif # @@ Remove overrides when Oracle implementation is complete. # ifeq ($(db_id),oracle) -all_dirs := libcommon oracle -dirs := libcommon oracle +all_dirs := libcommon common tracer mysql sqlite oracle +dirs := common tracer oracle endif default := $(out_base)/ -- cgit v1.1 From 77012915e5755f82982ceb18035bb8e56878848d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 20:49:42 +0200 Subject: Add 64 bit integer tests to Oracle types test --- oracle/types/driver.cxx | 51 ++++++++++++++++++++++++++++++++++++++++--------- oracle/types/test.hxx | 49 +++++++++++++++++++++++++---------------------- 2 files changed, 68 insertions(+), 32 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 55918af..2eeb2e8 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -82,15 +82,20 @@ main (int argc, char* argv[]) // Test character set conversion. // - // const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + // Testing of character set conversion to and from the client's database + // character set is disabled as the server database character set may + // not be able to represent some Unicode characters. If this were the case + // the test outcome be a false negative. + // // o.char_ = unicode_str; // o.varchar2_ = unicode_str; // o.clob_ = unicode_str; - // o.nchar_ = unicode_str; - // o.nvarchar2_ = unicode_str; - // o.nclob_ = unicode_str; + o.nchar_ = unicode_str; + o.nvarchar2_ = unicode_str; + o.nclob_ = unicode_str; // Persist. // @@ -112,14 +117,28 @@ main (int argc, char* argv[]) // Test 64 bit integers. // - big_ints bi (true); - bi.id = 1; + big_int bi1 (1, 0x8000000000000000LL); + big_int bi2 (2, -123456); + big_int bi3 (3, 0); + big_int bi4 (4, 123456); + big_int bi5 (5, 0xFFFFFFFFFFFFFFFFULL); + + big_uint bui1 (1, 0); + big_uint bui2 (2, 123456); + big_uint bui3 (3, 0xFFFFFFFFFFFFFFFFULL); // Persist. // { transaction t (db->begin ()); - db->persist (bi); + db->persist (bi1); + db->persist (bi2); + db->persist (bi3); + db->persist (bi4); + db->persist (bi5); + db->persist (bui1); + db->persist (bui2); + db->persist (bui3); t.commit (); } @@ -127,10 +146,24 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr bi1 (db->load (1)); + auto_ptr bil1 (db->load (1)); + auto_ptr bil2 (db->load (2)); + auto_ptr bil3 (db->load (3)); + auto_ptr bil4 (db->load (4)); + auto_ptr bil5 (db->load (5)); + auto_ptr buil1 (db->load (1)); + auto_ptr buil2 (db->load (2)); + auto_ptr buil3 (db->load (3)); t.commit (); - assert (bi == *bi1); + assert (bi1 == *bil1); + assert (bi2 == *bil2); + assert (bi3 == *bil3); + assert (bi4 == *bil4); + assert (bi5 == *bil5); + assert (bui1 == *buil1); + assert (bui2 == *buil2); + assert (bui3 == *buil3); } } catch (const odb::exception& e) diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index d137a1d..bfb06f9 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -161,39 +161,42 @@ struct object }; #pragma db object -struct big_ints +struct big_uint { - big_ints (bool init = false) + big_uint (unsigned int id = 0, unsigned long long v = 0) + : id_ (id), value (v) { - if (init) - { - signed_zero = 0; - signed_min = 0x8000000000000000; // –9223372036854775808 - signed_max = 0x7FFFFFFFFFFFFFFFLL; // 9223372036854775807 - unsigned_zero = 0; - unsigned_max = 0xFFFFFFFFFFFFFFFFULL; - } } #pragma db id - unsigned int id; + unsigned int id_; + + unsigned long long value; + + bool + operator== (const big_uint& y) const + { + return id_ == y.id_ && value == y.value; + } +}; - long long signed_zero; - long long signed_min; - long long signed_max; +#pragma db object +struct big_int +{ + big_int (unsigned int id = 0, long long v = 0) + : id_ (id), value (v) + { + } + + #pragma db id + unsigned int id_; - unsigned long long unsigned_zero; - unsigned long long unsigned_max; + long long value; bool - operator== (const big_ints& y) const + operator== (const big_int& y) const { - return id == y.id && - signed_zero == y.signed_zero && - signed_min == y.signed_min && - signed_max == y.signed_max && - unsigned_zero == y.unsigned_zero && - unsigned_max == y.unsigned_max; + return id_ == y.id_ && value == y.value; } }; -- cgit v1.1 From 42467152acbac9d4604e448694cf5943c8c194fe Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 20 Oct 2011 21:24:30 +0200 Subject: Improve temporary makefile layout --- common/makefile | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/common/makefile b/common/makefile index 603ea60..ce73bd5 100644 --- a/common/makefile +++ b/common/makefile @@ -5,39 +5,43 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -# @@ Uncomment all tests once Oracle tests have been fully -# implemented -# tests := \ auto \ +callback \ +composite \ +const \ container \ +ctor \ +default \ +enum \ +erase-query \ +inheritance \ +inverse \ lazy-ptr \ lifecycle \ +query \ +relationship \ +relationship-query \ schema \ +template \ +view \ wrapper -#auto \ -#callback \ -#composite \ -#const \ -#container \ -#ctor \ -#default \ -#enum \ -#erase-query \ -#inheritance \ -#inverse \ -#lazy-ptr \ -#lifecycle \ -#query \ -#relationship \ -#relationship-query \ -#schema \ -#template \ -#view \ -#wrapper +thread_tests := threads -#thread_tests := threads +# @@ Remove overrides once Oracle has been fully integrated. +# +ifeq ($(db_id),oracle) +tests := \ +auto \ +container \ +lazy-ptr \ +lifecycle \ +schema \ +wrapper + +thread_tests := +endif all_tests := $(tests) $(thread_tests) build_tests := $(tests) $(thread_tests) -- cgit v1.1 From f4f07fb437a28d1d9899607e3200d6732e627036 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 21 Oct 2011 08:35:27 +0200 Subject: Remove common_ from all table_prefix arguments in common tests --- boost/common/optional/makefile | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/template/makefile | 2 +- boost/common/unordered/makefile | 2 +- common/auto/makefile | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/composite/makefile | 2 +- common/const/makefile | 2 +- common/container/makefile | 2 +- common/container/test.hxx | 6 +----- common/ctor/makefile | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/enum/makefile | 2 +- common/erase-query/driver.cxx | 4 ++-- common/erase-query/makefile | 2 +- common/inheritance/makefile | 2 +- common/inverse/makefile | 2 +- common/lazy-ptr/makefile | 2 +- common/lifecycle/makefile | 2 +- common/relationship-query/makefile | 2 +- common/relationship/makefile | 2 +- common/schema/makefile | 2 +- common/template/makefile | 2 +- common/threads/makefile | 2 +- common/view/driver.cxx | 2 +- common/view/makefile | 2 +- common/view/test.hxx | 26 +++++++++++++------------- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 19 ++++++------------- qt/common/containers/makefile | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/template/makefile | 2 +- 34 files changed, 52 insertions(+), 63 deletions(-) diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 6145a2d..ca0a94d 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/optional --generate-schema --generate-query \ ---table-prefix boost_common_optional_ +--table-prefix boost_optional_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 6d875db..79c943a 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/smart-ptr --generate-schema \ ---table-prefix boost_common_smart_ptr_ +--table-prefix boost_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index eb2c5f6..8fe2fa6 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/version --generate-schema \ ---table-prefix boost_common_template_ #@@ CHANGE table prefix, boost/version +--table-prefix boost_template_ #@@ CHANGE table prefix, boost/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 0dd69de..7ea4e60 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/unordered --generate-schema \ ---table-prefix boost_common_unordered_ +--table-prefix boost_unordered_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/common/auto/makefile b/common/auto/makefile index 1880cba..da798c6 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_auto_ +--table-prefix auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index bc5b4f0..5f2c258 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -94,7 +94,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query ( - (query::id < 3) + "ORDER BY common_callback_object.id")); + (query::id < 3) + "ORDER BY callback_object.id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { diff --git a/common/callback/makefile b/common/callback/makefile index b24b9ae..6dca289 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_callback_ +--generate-query --table-prefix callback_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/composite/makefile b/common/composite/makefile index 9c4a29d..1813080 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_composite_ +--generate-query --table-prefix composite_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/const/makefile b/common/const/makefile index d8a1410..fd55611 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_const_ +--generate-query --table-prefix const_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index c1b1124..51dd456 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_ctnr_ +--table-prefix container_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/test.hxx b/common/container/test.hxx index ec392ec..2e267f6 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -54,7 +54,6 @@ struct cont_comp1 { // This composite value does not have any columns. // - #pragma db id_column("obj_id") num_vector sv; // Have the name "conflic" with the one in the object. }; @@ -64,14 +63,11 @@ struct cont_comp2 cont_comp2 (): num (777), str ("ggg") {} int num; - - #pragma db id_column("obj_id") str_list sl; - std::string str; }; -#pragma db object table("obj") +#pragma db object struct object { object (): nv (comp1_.sv), sl (comp2_.sl) {} diff --git a/common/ctor/makefile b/common/ctor/makefile index 8271074..98e9e3a 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_ctor_ +--generate-query --table-prefix ctor_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/default/driver.cxx b/common/default/driver.cxx index a47051c..846619b 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - db->execute ("INSERT INTO common_default_object (obj_id) VALUES (1)"); + db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); t.commit (); } diff --git a/common/default/makefile b/common/default/makefile index ce5f9e9..2f66e7a 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_default_ +--generate-query --table-prefix default_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/enum/makefile b/common/enum/makefile index 03c4915..bbfb1e1 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_enum_ +--generate-query --table-prefix enum_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index baa66f4..0b2d7f5 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -64,7 +64,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); assert (db->erase_query ( - "common_erase_query_object.id < 3") == 2); + "erase_query_object.id < 3") == 2); db->erase_query (); t.commit (); } @@ -162,7 +162,7 @@ main (int argc, char* argv[]) #ifndef DATABASE_MYSQL { transaction t (db->begin ()); - assert (db->execute ("SELECT * FROM common_erase_query_object_v " + assert (db->execute ("SELECT * FROM erase_query_object_v " "WHERE object_id = 1") == 0); t.commit (); } diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 27ac281..4ea31a2 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_erase_query_ +--generate-query --table-prefix erase_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 8afa961..47ffcaa 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_inheritance_ +--generate-query --table-prefix inheritance_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inverse/makefile b/common/inverse/makefile index 08c02e9..6b33f10 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_inverse_ +--generate-query --table-prefix inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 45a6779..d11a87b 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_lazy_ptr_ +--table-prefix lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 3fcafce..d1cd9ad 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_lifecycle_ +--table-prefix lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index f422a8a..2097823 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_relationship_query_ +--generate-query --table-prefix relationship_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship/makefile b/common/relationship/makefile index fa00a78..d9f77e6 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_relationship_ +--generate-query --table-prefix relationship_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/schema/makefile b/common/schema/makefile index e6e36e9..bc04d16 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_schema_ +--table-prefix schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/template/makefile b/common/template/makefile index eec13b5..820fcb3 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_template_ #@@ CHANGE THIS +--table-prefix template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/threads/makefile b/common/threads/makefile index dd07155..e9aef66 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_threads_ +--generate-query --table-prefix threads_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index a6048dd..8d62830 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -301,7 +301,7 @@ main (int argc, char* argv[]) result r ( db->query ( "SELECT first, last, age " - "FROM common_view_person " + "FROM view_person " "WHERE age < 31 ORDER BY age")); view1_check (r); diff --git a/common/view/makefile b/common/view/makefile index 098baeb..24f60bf 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_view_ +--generate-query --table-prefix view_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/test.hxx b/common/view/test.hxx index 3812662..103439d 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -130,7 +130,7 @@ struct employer // Complete suffix query template. // -#pragma db view query("SELECT first, last, age FROM common_view_person") +#pragma db view query("SELECT first, last, age FROM view_person") struct view1 { std::string first; @@ -141,7 +141,7 @@ struct view1 // Complete query. // #pragma db view query("SELECT first, last, age " \ - "FROM common_view_person " \ + "FROM view_person " \ "WHERE age < 31 ORDER BY age") struct view1a { @@ -153,7 +153,7 @@ struct view1a // Complete placeholder query template. // #pragma db view query("SELECT first, last, age " \ - "FROM common_view_person " \ + "FROM view_person " \ "WHERE age < 31 AND (?) ORDER BY age") struct view1b { @@ -174,7 +174,7 @@ struct view1c // Assembled SELECT and FROM-lists. // -#pragma db view table("common_view_person") +#pragma db view table("view_person") struct view1d { #pragma db column("first") @@ -194,7 +194,7 @@ struct view1d // Complete suffix query. // #pragma db view object(person) \ - query("SELECT count(id) FROM common_view_person") + query("SELECT count(id) FROM view_person") struct view2 { std::size_t count; @@ -214,7 +214,7 @@ struct view2a #pragma db view object(person) struct view2b { - #pragma db column("count(common_view_person.id)") + #pragma db column("count(view_person.id)") std::size_t count; }; @@ -235,7 +235,7 @@ struct view2c // #pragma db view object(person = test) \ query("SELECT last, count(last) " \ - "FROM common_view_person " \ + "FROM view_person " \ "GROUP BY last") struct view3 { @@ -265,9 +265,9 @@ struct view3a // #pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ - "FROM common_view_person " \ - "LEFT JOIN common_view_country AS residence " \ - "ON common_view_person.residence = residence.code") + "FROM view_person " \ + "LEFT JOIN view_country AS residence " \ + "ON view_person.residence = residence.code") struct view4 { std::string first_name; @@ -347,9 +347,9 @@ struct view6b // The same using tables. // -#pragma db view table("common_view_person" = "p") \ - table("common_view_employer_employees" = "ee": "ee.value = p.id") \ - table("common_view_employer" = "e": "ee.object_id = e.name") +#pragma db view table("view_person" = "p") \ + table("view_employer_employees" = "ee": "ee.value = p.id") \ + table("view_employer" = "e": "ee.object_id = e.name") struct view6c { #pragma db column("p.first") diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 7cb4171..a6c82b1 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_wpr_ +--table-prefix wrapper_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 70bb682..baf6346 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -39,17 +39,17 @@ struct object std::auto_ptr num; + #pragma db null std::auto_ptr str; - nullable_string nstr; - #pragma db id_column ("id") + nullable_string nstr; std::vector nstrs; #ifdef HAVE_TR1_MEMORY #pragma db null tr1_nullable_string tr1_str; - #pragma db value_null id_column("id") + #pragma db value_null std::vector tr1_strs; #endif }; @@ -84,7 +84,6 @@ struct comp2 std::string str; int num; - #pragma db id_column("id") index_column("i") std::vector strs; }; @@ -94,17 +93,14 @@ operator== (const comp2& x, const comp2& y) return x.str == y.str && x.num == y.num && x.strs == y.strs; } -#pragma db object table("comp_obj") +#pragma db object struct comp_object { #pragma db id auto unsigned long id_; std::auto_ptr c1; // Wrapped comp value. - - #pragma db id_column("id") index_column("i") std::vector > vc1; // Container of wrapped comp values. - std::auto_ptr c2; // Container inside wrapped comp value. }; @@ -114,12 +110,10 @@ struct comp_object struct comp3: comp2 { std::auto_ptr c1; - - #pragma db id_column("id") index_column("i") std::vector > vc1; }; -#pragma db object table("comp_obj2") +#pragma db object struct comp_object2 { #pragma db id auto @@ -136,7 +130,6 @@ struct comp_object2 struct cont_comp { int num; - #pragma db id_column("id") std::auto_ptr > strs; }; @@ -146,7 +139,7 @@ operator== (const cont_comp& x, const cont_comp& y) return x.num == y.num && *x.strs == *y.strs; } -#pragma db object table("cont_obj") +#pragma db object struct cont_object { #pragma db id auto diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index f675c37..c95a1a6 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_common_containers_ +--table-prefix qt_containers_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 21ba8b8..12514f7 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/smart-ptr --generate-schema --table-prefix qt_common_smart_ptr_ +--profile qt/smart-ptr --generate-schema --table-prefix qt_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index d0cb3d8..84a63eb 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile qt/version --generate-schema \ ---table-prefix qt_common_template_ #@@ CHANGE table prefix, qt/version +--table-prefix qt_template_ #@@ CHANGE table prefix, qt/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) -- cgit v1.1 From c0c77f312bebfb274fd919d49d6f3f4ebd50f746 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 21 Oct 2011 11:24:12 +0200 Subject: Use @ to specify SQL file to Oracle SQLPlus SQLPlus scripted commands, such as SET FEEDBACK OFF, are not recognized when OS redirection is employed. --- build/oracle/oracle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/oracle/oracle b/build/oracle/oracle index 7c53922..6eedb14 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -69,7 +69,7 @@ fi opt="-S $opt" if [ -n "$1" ]; then - exec $driver $opt $conn <$1 + exec $driver $opt $conn @$1 else exec $driver $opt $conn fi -- cgit v1.1 From 86efa49eec74c114b023d532b3e953017a99b9ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Oct 2011 15:58:22 +0200 Subject: Add extra explanations for certain Oracle parameters Also default to the odb_user password if the user is odb_user. This seems to be a common idiom since Oracle doesn't support no-password logins. --- build/oracle/configure | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/build/oracle/configure b/build/oracle/configure index 46e5061..6e59a3d 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -25,23 +25,33 @@ $echo $echo "Please enter the Oracle database password." $echo -passwd=`read_value ""` +# If the user is odb_test then default to odb_test as a password since +# it is unlikely there is the odb_test user with external authentication. +# +if [ "$user" = "odb_test" ]; then + def_passwd=odb_test +else + def_passwd= +fi + +passwd=`read_value "$def_passwd"` $echo -$echo "Please enter the Oracle listener host." +$echo "Please enter the Oracle listener host (localhost if left empty)." $echo host=`read_value ""` $echo -$echo "Please enter the Oracle listener port." +$echo "Please enter the Oracle listener port (default port if left empty)." $echo port=`read_value ""` $echo -$echo "Please enter the Oracle service to use. Note that the associated" -$echo "database WILL BE MODIFIED." +$echo "Please enter the Oracle service to use (default service if left" +$echo "empty). Note that the database associated with user $user on this" +$echo "service WILL BE MODIFIED." $echo service=`read_value ""` -- cgit v1.1 From 2d10422daab4b63307f3c1d9a6c08ee2c1b7c72e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 15 Oct 2011 11:33:40 +0200 Subject: Add support for readonly members New pragma: readonly. New test: readonly. --- common/makefile | 2 + common/readonly/driver.cxx | 230 +++++++++++++++++++++++++++++++++++++++++++++ common/readonly/makefile | 109 +++++++++++++++++++++ common/readonly/test.hxx | 163 ++++++++++++++++++++++++++++++++ common/readonly/test.std | 0 5 files changed, 504 insertions(+) create mode 100644 common/readonly/driver.cxx create mode 100644 common/readonly/makefile create mode 100644 common/readonly/test.hxx create mode 100644 common/readonly/test.std diff --git a/common/makefile b/common/makefile index ce73bd5..547e764 100644 --- a/common/makefile +++ b/common/makefile @@ -20,6 +20,7 @@ inverse \ lazy-ptr \ lifecycle \ query \ +readonly \ relationship \ relationship-query \ schema \ @@ -37,6 +38,7 @@ auto \ container \ lazy-ptr \ lifecycle \ +readonly \ schema \ wrapper diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx new file mode 100644 index 0000000..2ad40a1 --- /dev/null +++ b/common/readonly/driver.cxx @@ -0,0 +1,230 @@ +// file : common/readonly/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test readonly members/objects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Simple. + // + { + simple o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro++; + // const_cast (o.co)++; + o.rw++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro == 1 && /*o.co == 1 &&*/ o.rw == 2); + } + + // Pointer. + // + { + pointer p (1, new pointer (2)); + auto_ptr p1 (new pointer (3)); + + { + transaction t (db->begin ()); + db->persist (p); + db->persist (p.ro); + db->persist (*p1); + t.commit (); + } + + delete p.ro; + p.ro = p1.release (); + p.rw = p.ro; + + { + transaction t (db->begin ()); + db->update (p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + + assert (p->ro->id == 2 && p->rw->id == 3); + } + } + + // Composite. + // + { + composite o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro.v++; + o.ro.ro++; + o.ro.rw++; + + o.rw.v++; + o.rw.ro++; + o.rw.rw++; + + o.v.v++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro.v == 1 && + o.ro.ro == 1 && + o.ro.rw == 1 && + + o.rw.v == 1 && + o.rw.ro == 1 && + o.rw.rw == 2 && + + o.v.v == 1); + } + + // Container. + // + { + container o (1); + + o.ro.push_back (1); + o.ro.push_back (2); + + o.rw.push_back (1); + o.rw.push_back (2); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro[0]++; + o.ro.pop_back (); + + o.rw[0]++; + o.rw.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro.size () == 2 && o.ro[0] == 1 && o.ro[1] == 2 && + o.rw.size () == 1 && o.rw[0] == 2); + } + + // Readonly object. + // + { + typedef odb::object_traits ro_traits; + typedef odb::object_traits rw_traits; + + assert (ro_traits::column_count == + ro_traits::id_column_count + ro_traits::readonly_column_count); + + assert (rw_traits::column_count != + rw_traits::id_column_count + rw_traits::readonly_column_count); + + ro_object ro_o (1, 1); + rw_object rw_o (1, 1); + + ro_o.cr.push_back (1); + ro_o.cr.push_back (2); + + rw_o.cr.push_back (1); + rw_o.cr.push_back (2); + + { + transaction t (db->begin ()); + db->persist (ro_o); + db->persist (rw_o); + t.commit (); + } + + rw_o.sv++; + rw_o.rw_sv++; + + { + transaction t (db->begin ()); + //db->update (ro_o); // Compile error. + db->update (rw_o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, ro_o); + db->load (1, rw_o); + t.commit (); + } + + assert (rw_o.sv == 1 && rw_o.rw_sv == 2); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/readonly/makefile b/common/readonly/makefile new file mode 100644 index 0000000..d8fd474 --- /dev/null +++ b/common/readonly/makefile @@ -0,0 +1,109 @@ +# file : common/readonly/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) --generate-schema \ +--table-prefix readonly_ +$(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 schema) + $(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/readonly/test.hxx b/common/readonly/test.hxx new file mode 100644 index 0000000..a4cc55b --- /dev/null +++ b/common/readonly/test.hxx @@ -0,0 +1,163 @@ +// file : common/readonly/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 + +#include + +// Simple readonly value. +// +#pragma db object +struct simple +{ + simple (unsigned long i, unsigned long x) + : id (i), ro (x), /*co (x),*/ rw (x) + { + } + + simple ()/*: co (0)*/ {} + + #pragma db id + unsigned long id; + + #pragma db readonly + unsigned long ro; + + //const unsigned long co; + + unsigned long rw; +}; + +// Readonly pointer. +// +#pragma db object +struct pointer +{ + pointer (unsigned long i, pointer* p = 0): id (i), ro (p), rw (p) {} + pointer (): ro (0), rw (0) {} + + ~pointer () + { + delete ro; + + if (ro != rw) + delete rw; + } + + #pragma db id + unsigned long id; + + #pragma db readonly + pointer* ro; + + pointer* rw; +}; + +// Composite readonly value as well as simple readonly value inside +// a composite. +// +#pragma db value readonly +struct ro_value +{ + ro_value () {} + ro_value (unsigned long x): v (x) {} + + unsigned long v; +}; + +#pragma db value +struct value: ro_value +{ + value () {} + value (unsigned long x): ro_value (x), ro (x), rw (x) {} + + #pragma db readonly + unsigned long ro; + + unsigned long rw; +}; + +#pragma db object +struct composite +{ + composite (unsigned long i, unsigned long x) + : id (i), ro (x), rw (x), v (x) + { + } + + composite () {} + + #pragma db id + unsigned long id; + + #pragma db readonly + value ro; + + value rw; + ro_value v; +}; + +// Readonly container. +// +#pragma db object +struct container +{ + container (unsigned long i): id (i) {} + container () {} + + #pragma db id + unsigned long id; + + #pragma db readonly + std::vector ro; + + std::vector rw; +}; + +// Readonly object. +// +#pragma db object +struct object +{ + object (unsigned long i, unsigned long x): id (i), sv (x) {} + object () {} + + #pragma db id + unsigned long id; + + unsigned long sv; +}; + +#pragma db object readonly +struct ro_object: object +{ + ro_object (unsigned long i, unsigned long x) + : object (i, x), cv (x) + { + } + + ro_object () {} + + value cv; + std::vector cr; +}; + +#pragma db object +struct rw_object: ro_object +{ + rw_object (unsigned long i, unsigned long x) + : ro_object (i, x), rw_sv (x) + { + } + + rw_object () {} + + unsigned long rw_sv; +}; + +#endif // TEST_HXX diff --git a/common/readonly/test.std b/common/readonly/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From bceb06251cdb572850b2e6e4d15cfb2ac32da417 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2011 10:47:41 +0200 Subject: Add support for const data members Const data members are automatically treated as readonly. New test: const-member. --- common/const-member/driver.cxx | 119 +++++++++++++++++++++++++++++++++++++++++ common/const-member/makefile | 109 +++++++++++++++++++++++++++++++++++++ common/const-member/test.hxx | 111 ++++++++++++++++++++++++++++++++++++++ common/const-member/test.std | 0 common/makefile | 2 + common/readonly/driver.cxx | 67 +++++++++++++++++++++-- common/readonly/test.hxx | 56 +++++++++++++++---- 7 files changed, 451 insertions(+), 13 deletions(-) create mode 100644 common/const-member/driver.cxx create mode 100644 common/const-member/makefile create mode 100644 common/const-member/test.hxx create mode 100644 common/const-member/test.std diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx new file mode 100644 index 0000000..8cd815e --- /dev/null +++ b/common/const-member/driver.cxx @@ -0,0 +1,119 @@ +// file : common/const-member/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test const data members. The readonly test tests that const +// members are automatically treated as read-only. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Const ids. + // + { + const_id o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + assert (o.id == 1); + } + } + + { + { + const_auto_id o; + transaction t (db->begin ()); + db->persist (o); + t.commit (); + assert (o.id == 1); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + t.commit (); + assert (o->id == 1); + } + } + + // Container. + // + { + container o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + t.commit (); + + assert (o->ccom.vec.size () == 1 && o->ccom.vec[0] == 1 && + o->ccom.cvec.size () == 1 && o->ccom.cvec[0] == 1 && + o->cvec.size () == 1 && o->cvec[0] == 1); + } + } + + // Wrapper. + // + { + wrapper o (1, "abc", 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + t.commit (); + + assert (*o->str == "abc" && + o->com->str == "abc" && o->com->num == 1 && + o->com->vec.size () == 1 && o->com->vec[0] == 1 && + o->vec->size () == 1 && (*o->vec)[0] == 1); + } + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/const-member/makefile b/common/const-member/makefile new file mode 100644 index 0000000..33d135b --- /dev/null +++ b/common/const-member/makefile @@ -0,0 +1,109 @@ +# file : common/const-member/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) --generate-schema \ +--table-prefix common_const_member_ +$(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 schema) + $(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/const-member/test.hxx b/common/const-member/test.hxx new file mode 100644 index 0000000..c987cf8 --- /dev/null +++ b/common/const-member/test.hxx @@ -0,0 +1,111 @@ +// file : common/const-member/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 +#include +#include // std::auto_ptr + +#include + +// Const ids. +// +#pragma db object +struct const_id +{ + const_id (unsigned long i): id (i) {} + const_id (): id (0) {} + + #pragma db id + const unsigned long id; +}; + +#pragma db object +struct const_auto_id +{ + const_auto_id (): id (0) {} + + #pragma db id auto + const unsigned long id; +}; + +// Container. +// +#pragma db value +struct container_value +{ + container_value (unsigned long x) + { + vec.push_back (x); + const_cast&> (cvec).push_back (x); + } + + container_value () {} + + std::vector vec; + const std::vector cvec; +}; + +#pragma db object +struct container +{ + container (unsigned long i, unsigned long x) + : id (i), ccom (x) + { + const_cast&> (cvec).push_back (x); + } + + container () {} + + #pragma db id + unsigned long id; + + const container_value ccom; + const std::vector cvec; +}; + +// Wrapper. +// +#pragma db value +struct wrapped_value +{ + wrapped_value (const std::string& s, unsigned long n) + : str (s), num (n) + { + vec.push_back (n); + } + + wrapped_value () {} + + const std::string str; + unsigned long num; + std::vector vec; +}; + +#pragma db object +struct wrapper +{ + wrapper (unsigned long i, const std::string& s, unsigned long n) + : id (i), + str (new std::string (s)), + com (new wrapped_value (s, n)), + vec (new std::vector) + { + const_cast&> (*vec).push_back (n); + } + + wrapper () {} + + #pragma db id + unsigned long id; + + const std::auto_ptr str; + const std::auto_ptr com; + const std::auto_ptr< const std::vector > vec; +}; + +#endif // TEST_HXX diff --git a/common/const-member/test.std b/common/const-member/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 547e764..e5065cd 100644 --- a/common/makefile +++ b/common/makefile @@ -10,6 +10,7 @@ auto \ callback \ composite \ const \ +const-member \ container \ ctor \ default \ @@ -35,6 +36,7 @@ thread_tests := threads ifeq ($(db_id),oracle) tests := \ auto \ +const-member \ container \ lazy-ptr \ lifecycle \ diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 2ad40a1..0432c69 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -3,7 +3,9 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test readonly members/objects. +// Test readonly members/objects. Also test that const members are +// treated as readonly. For other const member tests, see the const- +// member test. // #include // std::auto_ptr @@ -40,7 +42,7 @@ main (int argc, char* argv[]) } o.ro++; - // const_cast (o.co)++; + const_cast (o.co)++; o.rw++; { @@ -55,7 +57,7 @@ main (int argc, char* argv[]) t.commit (); } - assert (o.ro == 1 && /*o.co == 1 &&*/ o.rw == 2); + assert (o.ro == 1 && o.co == 1 && o.rw == 2); } // Pointer. @@ -74,6 +76,7 @@ main (int argc, char* argv[]) delete p.ro; p.ro = p1.release (); + const_cast (p.co) = p.ro; p.rw = p.ro; { @@ -87,7 +90,7 @@ main (int argc, char* argv[]) auto_ptr p (db->load (1)); t.commit (); - assert (p->ro->id == 2 && p->rw->id == 3); + assert (p->ro->id == 2 && p->co->id == 2 && p->rw->id == 3); } } @@ -104,10 +107,18 @@ main (int argc, char* argv[]) o.ro.v++; o.ro.ro++; + const_cast (o.ro.co)++; o.ro.rw++; + value& co (const_cast (o.co)); + co.v++; + co.ro++; + const_cast (co.co)++; + co.rw++; + o.rw.v++; o.rw.ro++; + const_cast (o.rw.co)++; o.rw.rw++; o.v.v++; @@ -126,10 +137,17 @@ main (int argc, char* argv[]) assert (o.ro.v == 1 && o.ro.ro == 1 && + o.ro.co == 1 && o.ro.rw == 1 && + o.co.v == 1 && + o.co.ro == 1 && + o.co.co == 1 && + o.co.rw == 1 && + o.rw.v == 1 && o.rw.ro == 1 && + o.rw.co == 1 && o.rw.rw == 2 && o.v.v == 1); @@ -138,11 +156,17 @@ main (int argc, char* argv[]) // Container. // { + typedef vector ulongs; + container o (1); o.ro.push_back (1); o.ro.push_back (2); + ulongs& co (const_cast (o.co)); + co.push_back (1); + co.push_back (2); + o.rw.push_back (1); o.rw.push_back (2); @@ -155,6 +179,9 @@ main (int argc, char* argv[]) o.ro[0]++; o.ro.pop_back (); + co[0]++; + co.pop_back (); + o.rw[0]++; o.rw.pop_back (); @@ -171,6 +198,7 @@ main (int argc, char* argv[]) } assert (o.ro.size () == 2 && o.ro[0] == 1 && o.ro[1] == 2 && + o.co.size () == 2 && o.co[0] == 1 && o.co[1] == 2 && o.rw.size () == 1 && o.rw[0] == 2); } @@ -221,6 +249,37 @@ main (int argc, char* argv[]) assert (rw_o.sv == 1 && rw_o.rw_sv == 2); } + + // Readonly object. + // + { + wrapper o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + *o.pl = 2; + *o.cpl = 2; + o.pcl.reset (new unsigned long (2)); + const_cast (*o.cpcl) = 2; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (*o.pl == 2 && *o.cpl == 2 && *o.pcl == 2 && *o.cpcl == 1); + } } catch (const odb::exception& e) { diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index a4cc55b..3a0095f 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -7,6 +7,7 @@ #define TEST_HXX #include +#include // std::auto_ptr #include @@ -16,11 +17,11 @@ struct simple { simple (unsigned long i, unsigned long x) - : id (i), ro (x), /*co (x),*/ rw (x) + : id (i), ro (x), co (x), rw (x) { } - simple ()/*: co (0)*/ {} + simple (): co (0) {} #pragma db id unsigned long id; @@ -28,7 +29,7 @@ struct simple #pragma db readonly unsigned long ro; - //const unsigned long co; + const unsigned long co; unsigned long rw; }; @@ -38,14 +39,17 @@ struct simple #pragma db object struct pointer { - pointer (unsigned long i, pointer* p = 0): id (i), ro (p), rw (p) {} - pointer (): ro (0), rw (0) {} + pointer (unsigned long i, pointer* p = 0): id (i), ro (p), co (p), rw (p) {} + pointer (): ro (0), co (0), rw (0) {} ~pointer () { delete ro; - if (ro != rw) + if (co != ro) + delete co; + + if (rw != ro && rw != co) delete rw; } @@ -55,6 +59,8 @@ struct pointer #pragma db readonly pointer* ro; + pointer* const co; + pointer* rw; }; @@ -73,12 +79,14 @@ struct ro_value #pragma db value struct value: ro_value { - value () {} - value (unsigned long x): ro_value (x), ro (x), rw (x) {} + value (): co (0) {} + value (unsigned long x): ro_value (x), ro (x), co (x), rw (x) {} #pragma db readonly unsigned long ro; + const unsigned long co; + unsigned long rw; }; @@ -86,7 +94,7 @@ struct value: ro_value struct composite { composite (unsigned long i, unsigned long x) - : id (i), ro (x), rw (x), v (x) + : id (i), ro (x), co (x), rw (x), v (x) { } @@ -98,6 +106,8 @@ struct composite #pragma db readonly value ro; + const value co; + value rw; ro_value v; }; @@ -116,6 +126,8 @@ struct container #pragma db readonly std::vector ro; + const std::vector co; + std::vector rw; }; @@ -160,4 +172,30 @@ struct rw_object: ro_object unsigned long rw_sv; }; +// Readonly wrappers. Here we make sure that only const wrappers with +// const wrapped types are automatically treated as readonly. +// +#pragma db object +struct wrapper +{ + wrapper (unsigned long i, unsigned long x) + : id (i), + pl (new unsigned long (x)), + cpl (new unsigned long (x)), + pcl (new unsigned long (x)), + cpcl (new unsigned long (x)) + { + } + + wrapper () {} + + #pragma db id + unsigned long id; + + std::auto_ptr pl; + const std::auto_ptr cpl; + std::auto_ptr pcl; + const std::auto_ptr cpcl; +}; + #endif // TEST_HXX -- cgit v1.1 From e39f1cf9f0c3f520c61e0b832cca78df715d658d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Oct 2011 10:58:44 +0200 Subject: Rename common/const test to common/const-object --- common/const-object/driver.cxx | 214 +++++++++++++++++++++++++++++++++++++++++ common/const-object/makefile | 109 +++++++++++++++++++++ common/const-object/test.hxx | 52 ++++++++++ common/const-object/test.std | 0 common/const/driver.cxx | 214 ----------------------------------------- common/const/makefile | 109 --------------------- common/const/test.hxx | 52 ---------- common/const/test.std | 0 common/makefile | 2 +- 9 files changed, 376 insertions(+), 376 deletions(-) create mode 100644 common/const-object/driver.cxx create mode 100644 common/const-object/makefile create mode 100644 common/const-object/test.hxx create mode 100644 common/const-object/test.std delete mode 100644 common/const/driver.cxx delete mode 100644 common/const/makefile delete mode 100644 common/const/test.hxx delete mode 100644 common/const/test.std diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx new file mode 100644 index 0000000..6fb4cde --- /dev/null +++ b/common/const-object/driver.cxx @@ -0,0 +1,214 @@ +// file : common/const-object/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database operations with const objects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + aggr a (1); + aggr ca_ (2); // o1 and o2 are NULL + const aggr& ca (ca_); + + obj1* o1 (new obj1 (1)); + obj1* co1_ (new obj1 (2)); + const obj1* co1 (co1_); + a.o1 = co1; + + auto_ptr o2 (new obj2 (1)); + obj2* co2_ (new obj2 (2)); + a.o2.reset (co2_); + auto_ptr& co2 (a.o2); + + // persist via references + // + { + transaction t (db->begin ()); + db->persist (*o1); + db->persist (*co1); + db->persist (*o2); + db->persist (*co2); + db->persist (a); + db->persist (ca); + t.commit (); + } + + // persist via pointers + // + o1->id += 2; + co1_->id += 2; + o2->id += 2; + co2_->id += 2; + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (co1); + db->persist (o2); + db->persist (co2); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a (db->load (1)); + auto_ptr ca (db->load (2)); + t.commit (); + + assert (a->o1->id == 2); + assert (a->o2->id == 2); + + assert (ca->o1 == 0); + assert (ca->o2.get () == 0); + } + + // update via references + // + { + transaction t (db->begin ()); + db->update (*o1); + db->update (*co1); + db->update (*o2); + db->update (*co2); + db->update (a); + db->update (ca); + t.commit (); + } + + // update via pointers + // + { + transaction t (db->begin ()); + db->update (o1); + db->update (co1); + db->update (o2); + db->update (co2); + t.commit (); + } + + // query + // + typedef odb::query query1; + typedef odb::query query2; + + typedef odb::result result1; + typedef odb::result result2; + + { + transaction t (db->begin ()); + result1 r1 (db->query (query1::id < 3)); + // odb::result ur (r1); // error + size_t n1 (0); + + for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) + { + // i->f (); // error + i->cf (); + // obj1* p (i.load ()); // error + const obj1* p (i.load ()); + obj1 o (0); + i.load (o); + assert (p->id == o.id); + delete p; + n1++; + } + + assert (n1 == 2); + + result2 r2 (db->query (query2::id < 3)); + size_t n2 (0); + + for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) + { + // i->f (); // error + i->cf (); + // auto_ptr p (i.load ()); // error + auto_ptr p (i.load ()); + obj2 o (0); + i.load (o); + assert (p->id == o.id); + n2++; + } + + assert (n2 == 2); + + t.commit (); + } + + // erase via references + // + { + transaction t (db->begin ()); + db->erase (*o1); + db->erase (*co1); + db->erase (*o2); + db->erase (*co2); + db->erase (a); + db->erase (ca); + t.commit (); + } + + // erase via pointers + // + o1->id -= 2; + co1_->id -= 2; + o2->id -= 2; + co2_->id -= 2; + + { + transaction t (db->begin ()); + db->erase (o1); + db->erase (co1); + db->erase (o2); + db->erase (co2); + t.commit (); + } + + // Test session and const/non-const object handling + // + { + session s; + transaction t (db->begin ()); + + obj1 o1 (1); + const obj1& co1 (o1); + db->persist (co1); + + assert (db->load (1) == &o1); + + t.commit (); + } + + delete o1; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/const-object/makefile b/common/const-object/makefile new file mode 100644 index 0000000..768bd98 --- /dev/null +++ b/common/const-object/makefile @@ -0,0 +1,109 @@ +# file : common/const-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) + +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) --generate-schema \ +--generate-query --table-prefix const_object_ +$(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 schema) + $(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/const-object/test.hxx b/common/const-object/test.hxx new file mode 100644 index 0000000..82635f0 --- /dev/null +++ b/common/const-object/test.hxx @@ -0,0 +1,52 @@ +// file : common/const-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 +#include + +#pragma db object pointer (obj1*) +struct obj1 +{ + obj1 () {} + obj1 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object pointer (std::auto_ptr) +struct obj2 +{ + obj2 () {} + obj2 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object +struct aggr +{ + aggr (int i): id (i), o1 (0) {} + aggr (): o1 (0) {} + ~aggr () {delete o1;} + + #pragma db id + int id; + + const obj1* o1; + std::auto_ptr o2; +}; + +#endif // TEST_HXX diff --git a/common/const-object/test.std b/common/const-object/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/const/driver.cxx b/common/const/driver.cxx deleted file mode 100644 index dd0a2b6..0000000 --- a/common/const/driver.cxx +++ /dev/null @@ -1,214 +0,0 @@ -// file : common/const/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test database operations with const objects. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - aggr a (1); - aggr ca_ (2); // o1 and o2 are NULL - const aggr& ca (ca_); - - obj1* o1 (new obj1 (1)); - obj1* co1_ (new obj1 (2)); - const obj1* co1 (co1_); - a.o1 = co1; - - auto_ptr o2 (new obj2 (1)); - obj2* co2_ (new obj2 (2)); - a.o2.reset (co2_); - auto_ptr& co2 (a.o2); - - // persist via references - // - { - transaction t (db->begin ()); - db->persist (*o1); - db->persist (*co1); - db->persist (*o2); - db->persist (*co2); - db->persist (a); - db->persist (ca); - t.commit (); - } - - // persist via pointers - // - o1->id += 2; - co1_->id += 2; - o2->id += 2; - co2_->id += 2; - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (co1); - db->persist (o2); - db->persist (co2); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - auto_ptr a (db->load (1)); - auto_ptr ca (db->load (2)); - t.commit (); - - assert (a->o1->id == 2); - assert (a->o2->id == 2); - - assert (ca->o1 == 0); - assert (ca->o2.get () == 0); - } - - // update via references - // - { - transaction t (db->begin ()); - db->update (*o1); - db->update (*co1); - db->update (*o2); - db->update (*co2); - db->update (a); - db->update (ca); - t.commit (); - } - - // update via pointers - // - { - transaction t (db->begin ()); - db->update (o1); - db->update (co1); - db->update (o2); - db->update (co2); - t.commit (); - } - - // query - // - typedef odb::query query1; - typedef odb::query query2; - - typedef odb::result result1; - typedef odb::result result2; - - { - transaction t (db->begin ()); - result1 r1 (db->query (query1::id < 3)); - // odb::result ur (r1); // error - size_t n1 (0); - - for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) - { - // i->f (); // error - i->cf (); - // obj1* p (i.load ()); // error - const obj1* p (i.load ()); - obj1 o (0); - i.load (o); - assert (p->id == o.id); - delete p; - n1++; - } - - assert (n1 == 2); - - result2 r2 (db->query (query2::id < 3)); - size_t n2 (0); - - for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) - { - // i->f (); // error - i->cf (); - // auto_ptr p (i.load ()); // error - auto_ptr p (i.load ()); - obj2 o (0); - i.load (o); - assert (p->id == o.id); - n2++; - } - - assert (n2 == 2); - - t.commit (); - } - - // erase via references - // - { - transaction t (db->begin ()); - db->erase (*o1); - db->erase (*co1); - db->erase (*o2); - db->erase (*co2); - db->erase (a); - db->erase (ca); - t.commit (); - } - - // erase via pointers - // - o1->id -= 2; - co1_->id -= 2; - o2->id -= 2; - co2_->id -= 2; - - { - transaction t (db->begin ()); - db->erase (o1); - db->erase (co1); - db->erase (o2); - db->erase (co2); - t.commit (); - } - - // Test session and const/non-const object handling - // - { - session s; - transaction t (db->begin ()); - - obj1 o1 (1); - const obj1& co1 (o1); - db->persist (co1); - - assert (db->load (1) == &o1); - - t.commit (); - } - - delete o1; - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/const/makefile b/common/const/makefile deleted file mode 100644 index fd55611..0000000 --- a/common/const/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : common/const/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) --generate-schema \ ---generate-query --table-prefix const_ -$(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 schema) - $(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/const/test.hxx b/common/const/test.hxx deleted file mode 100644 index 341acb8..0000000 --- a/common/const/test.hxx +++ /dev/null @@ -1,52 +0,0 @@ -// file : common/const/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 -#include - -#pragma db object pointer (obj1*) -struct obj1 -{ - obj1 () {} - obj1 (int i): id (i) {} - - #pragma db id - int id; - - void f () {} - void cf () const {} -}; - -#pragma db object pointer (std::auto_ptr) -struct obj2 -{ - obj2 () {} - obj2 (int i): id (i) {} - - #pragma db id - int id; - - void f () {} - void cf () const {} -}; - -#pragma db object -struct aggr -{ - aggr (int i): id (i), o1 (0) {} - aggr (): o1 (0) {} - ~aggr () {delete o1;} - - #pragma db id - int id; - - const obj1* o1; - std::auto_ptr o2; -}; - -#endif // TEST_HXX diff --git a/common/const/test.std b/common/const/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/makefile b/common/makefile index e5065cd..c066ce1 100644 --- a/common/makefile +++ b/common/makefile @@ -9,7 +9,7 @@ tests := \ auto \ callback \ composite \ -const \ +const-object \ const-member \ container \ ctor \ -- cgit v1.1 From c8b6dcc696dc416658cc6ecdd51b64bd7dce9aed Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Oct 2011 19:08:54 +0200 Subject: Shorten table prefixes --- common/const-member/makefile | 2 +- common/const-object/makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/const-member/makefile b/common/const-member/makefile index 33d135b..40516dd 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_const_member_ +--table-prefix constm_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/const-object/makefile b/common/const-object/makefile index 768bd98..73d6715 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix const_object_ +--generate-query --table-prefix consto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 373f69ea28c47a4e2b75f897359f74913c34ca1e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Oct 2011 19:50:05 +0200 Subject: Add test_ prefix to view test since it conflicts with view example --- common/view/driver.cxx | 2 +- common/view/makefile | 2 +- common/view/test.hxx | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 8d62830..24768f6 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -301,7 +301,7 @@ main (int argc, char* argv[]) result r ( db->query ( "SELECT first, last, age " - "FROM view_person " + "FROM test_view_person " "WHERE age < 31 ORDER BY age")); view1_check (r); diff --git a/common/view/makefile b/common/view/makefile index 24f60bf..17f9543 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix view_ +--generate-query --table-prefix test_view_ # view_ conflicts with example $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/test.hxx b/common/view/test.hxx index 103439d..8358b9e 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -130,7 +130,7 @@ struct employer // Complete suffix query template. // -#pragma db view query("SELECT first, last, age FROM view_person") +#pragma db view query("SELECT first, last, age FROM test_view_person") struct view1 { std::string first; @@ -141,7 +141,7 @@ struct view1 // Complete query. // #pragma db view query("SELECT first, last, age " \ - "FROM view_person " \ + "FROM test_view_person " \ "WHERE age < 31 ORDER BY age") struct view1a { @@ -153,7 +153,7 @@ struct view1a // Complete placeholder query template. // #pragma db view query("SELECT first, last, age " \ - "FROM view_person " \ + "FROM test_view_person " \ "WHERE age < 31 AND (?) ORDER BY age") struct view1b { @@ -174,7 +174,7 @@ struct view1c // Assembled SELECT and FROM-lists. // -#pragma db view table("view_person") +#pragma db view table("test_view_person") struct view1d { #pragma db column("first") @@ -194,7 +194,7 @@ struct view1d // Complete suffix query. // #pragma db view object(person) \ - query("SELECT count(id) FROM view_person") + query("SELECT count(id) FROM test_view_person") struct view2 { std::size_t count; @@ -214,7 +214,7 @@ struct view2a #pragma db view object(person) struct view2b { - #pragma db column("count(view_person.id)") + #pragma db column("count(test_view_person.id)") std::size_t count; }; @@ -235,7 +235,7 @@ struct view2c // #pragma db view object(person = test) \ query("SELECT last, count(last) " \ - "FROM view_person " \ + "FROM test_view_person " \ "GROUP BY last") struct view3 { @@ -265,9 +265,9 @@ struct view3a // #pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ - "FROM view_person " \ - "LEFT JOIN view_country AS residence " \ - "ON view_person.residence = residence.code") + "FROM test_view_person " \ + "LEFT JOIN test_view_country AS residence " \ + "ON test_view_person.residence = residence.code") struct view4 { std::string first_name; @@ -347,9 +347,9 @@ struct view6b // The same using tables. // -#pragma db view table("view_person" = "p") \ - table("view_employer_employees" = "ee": "ee.value = p.id") \ - table("view_employer" = "e": "ee.object_id = e.name") +#pragma db view table("test_view_person" = "p") \ + table("test_view_employer_employees" = "ee": "ee.value = p.id") \ + table("test_view_employer" = "e": "ee.object_id = e.name") struct view6c { #pragma db column("p.first") -- cgit v1.1 From 3a951b92f1a4da2779b503e15130663429ca0d6d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Oct 2011 16:23:14 +0200 Subject: Add t_ prefix to all the common tests that conflict with examples --- common/composite/makefile | 2 +- common/container/makefile | 2 +- common/inheritance/makefile | 2 +- common/inverse/makefile | 2 +- common/relationship/makefile | 2 +- common/view/driver.cxx | 2 +- common/view/makefile | 2 +- common/view/test.hxx | 26 +++++++++++++------------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common/composite/makefile b/common/composite/makefile index 1813080..1a4ceb7 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix composite_ +--generate-query --table-prefix t_composite_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index 51dd456..a482d9b 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix container_ +--table-prefix t_container_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 47ffcaa..6f6675e 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inheritance_ +--generate-query --table-prefix t_inheritance_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inverse/makefile b/common/inverse/makefile index 6b33f10..3b5fa1b 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inverse_ +--generate-query --table-prefix t_inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship/makefile b/common/relationship/makefile index d9f77e6..71ab773 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix relationship_ +--generate-query --table-prefix t_relationship_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 24768f6..2ede99c 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -301,7 +301,7 @@ main (int argc, char* argv[]) result r ( db->query ( "SELECT first, last, age " - "FROM test_view_person " + "FROM t_view_person " "WHERE age < 31 ORDER BY age")); view1_check (r); diff --git a/common/view/makefile b/common/view/makefile index 17f9543..3b7c03d 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix test_view_ # view_ conflicts with example +--generate-query --table-prefix t_view_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/test.hxx b/common/view/test.hxx index 8358b9e..5efbd1c 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -130,7 +130,7 @@ struct employer // Complete suffix query template. // -#pragma db view query("SELECT first, last, age FROM test_view_person") +#pragma db view query("SELECT first, last, age FROM t_view_person") struct view1 { std::string first; @@ -141,7 +141,7 @@ struct view1 // Complete query. // #pragma db view query("SELECT first, last, age " \ - "FROM test_view_person " \ + "FROM t_view_person " \ "WHERE age < 31 ORDER BY age") struct view1a { @@ -153,7 +153,7 @@ struct view1a // Complete placeholder query template. // #pragma db view query("SELECT first, last, age " \ - "FROM test_view_person " \ + "FROM t_view_person " \ "WHERE age < 31 AND (?) ORDER BY age") struct view1b { @@ -174,7 +174,7 @@ struct view1c // Assembled SELECT and FROM-lists. // -#pragma db view table("test_view_person") +#pragma db view table("t_view_person") struct view1d { #pragma db column("first") @@ -194,7 +194,7 @@ struct view1d // Complete suffix query. // #pragma db view object(person) \ - query("SELECT count(id) FROM test_view_person") + query("SELECT count(id) FROM t_view_person") struct view2 { std::size_t count; @@ -214,7 +214,7 @@ struct view2a #pragma db view object(person) struct view2b { - #pragma db column("count(test_view_person.id)") + #pragma db column("count(t_view_person.id)") std::size_t count; }; @@ -235,7 +235,7 @@ struct view2c // #pragma db view object(person = test) \ query("SELECT last, count(last) " \ - "FROM test_view_person " \ + "FROM t_view_person " \ "GROUP BY last") struct view3 { @@ -265,9 +265,9 @@ struct view3a // #pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ - "FROM test_view_person " \ - "LEFT JOIN test_view_country AS residence " \ - "ON test_view_person.residence = residence.code") + "FROM t_view_person " \ + "LEFT JOIN t_view_country AS residence " \ + "ON t_view_person.residence = residence.code") struct view4 { std::string first_name; @@ -347,9 +347,9 @@ struct view6b // The same using tables. // -#pragma db view table("test_view_person" = "p") \ - table("test_view_employer_employees" = "ee": "ee.value = p.id") \ - table("test_view_employer" = "e": "ee.object_id = e.name") +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "ee.object_id = e.name") struct view6c { #pragma db column("p.first") -- cgit v1.1 From 69f67b942a1dd30a38d79743220c73be0c382852 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Oct 2011 16:38:31 +0200 Subject: Enable ON DELETE CASCADE-based checks for MySQL Now that we generate proper foreign keys for containers. --- common/erase-query/driver.cxx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 0b2d7f5..40290ec 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -13,7 +13,6 @@ #include #include -#include // @@ DATABASE_MYSQL #include #include "test.hxx" @@ -156,17 +155,12 @@ main (int argc, char* argv[]) t.commit (); } - // @@ Temporarily disabled until we have out-of-line constraints - // in MySQL (coming with evolution support). - // -#ifndef DATABASE_MYSQL { transaction t (db->begin ()); assert (db->execute ("SELECT * FROM erase_query_object_v " "WHERE object_id = 1") == 0); t.commit (); } -#endif } catch (const odb::exception& e) { -- cgit v1.1 From 82c04419fe56ef491c40a02c316338bfc380787f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Oct 2011 08:35:21 +0200 Subject: Get rid of common_ prefix in query test --- common/query/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/query/makefile b/common/query/makefile index bcdc9c4..f1f2fa9 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -37,7 +37,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ --generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix common_query_ +--table-prefix t_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 1f14eecfed1303d5d7bf5febcba29e06c2d19d9e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:05:25 +0200 Subject: Quote schema object identifiers for Oracle where necessary Oracle converts all alphabetical characters in unquoted schema object identifiers to uppercase. This behaviour cannot be disabled. --- common/callback/driver.cxx | 7 +++ common/default/driver.cxx | 6 +++ common/erase-query/driver.cxx | 15 +++++++ common/query/driver.cxx | 20 +++++---- common/view/driver.cxx | 42 ++++++++++++++++-- common/view/test.hxx | 99 +++++++++++++++++++++++++++++++++++-------- 6 files changed, 161 insertions(+), 28 deletions(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 5f2c258..76dbda4 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -14,6 +14,7 @@ #include #include +#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" @@ -93,8 +94,14 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); + +#ifndef DATABASE_ORACLE result r (db->query ( (query::id < 3) + "ORDER BY callback_object.id")); +#else + result r (db->query ( + (query::id < 3) + "ORDER BY \"callback_object\".\"id\"")); +#endif for (result::iterator i (r.begin ()); i != r.end (); ++i) { diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 846619b..5fef85c 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -14,6 +14,7 @@ #include #include +#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" @@ -33,7 +34,12 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifndef DATABASE_ORACLE db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); +#else + db->execute ("INSERT INTO \"default_object\" (\"obj_id\") VALUES (1)"); +#endif t.commit (); } diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 40290ec..a80a252 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include // DATABASE_XXX #include #include "test.hxx" @@ -62,8 +63,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); +#ifndef DATABASE_ORACLE assert (db->erase_query ( "erase_query_object.id < 3") == 2); +#else + assert (db->erase_query ( + "\"erase_query_object\".\"id\" < 3") == 2); +#endif db->erase_query (); t.commit (); } @@ -155,12 +161,21 @@ main (int argc, char* argv[]) t.commit (); } +#ifndef DATABASE_ORACLE { transaction t (db->begin ()); assert (db->execute ("SELECT * FROM erase_query_object_v " "WHERE object_id = 1") == 0); t.commit (); } +#else + { + transaction t (db->begin ()); + assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " + "WHERE \"object_id\" = 1") == 0); + t.commit (); + } +#endif } catch (const odb::exception& e) { diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 2f97f2e..283ea12 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -108,7 +108,7 @@ main (int argc, char* argv[]) cout << "test 002" << endl; { transaction t (db->begin ()); - result r (db->query ("ORDER BY age")); + result r (db->query ("ORDER BY" + query::age)); for (result::iterator i (r.begin ()); i != r.end (); ++i) { @@ -132,7 +132,10 @@ main (int argc, char* argv[]) cout << "test 003" << endl; { transaction t (db->begin ()); - result r (db->query ("age >= 30 AND last = 'Doe'")); + result r ( + db->query (query::age + " >= 30 AND " + + query::last_name + " = 'Doe'")); + print (r); t.commit (); } @@ -146,9 +149,8 @@ main (int argc, char* argv[]) const char* name = "Doe"; result r ( - db->query ( - "age >= " + query::_ref (30) + "AND" + - "last = " + query::_val (name))); + db->query (query::age + " >= " + query::_ref (30) + "AND " + + query::last_name + " = " + query::_val (name))); print (r); t.commit (); @@ -163,8 +165,8 @@ main (int argc, char* argv[]) string name; unsigned short age; - query q ("age >= " + query::_ref (age) + "AND" + - "last = " + query::_ref (name)); + query q (query::age + " >= " + query::_ref (age) + "AND" + + query::last_name + " = " + query::_ref (name)); name = "Doe"; age = 30; @@ -343,7 +345,9 @@ main (int argc, char* argv[]) // + // - r = db->query ((query::last_name == "Doe") + "ORDER BY age"); + r = db->query ((query::last_name == "Doe") + + "ORDER BY" + + query::age); print (r); t.commit (); diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 2ede99c..b671e46 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -14,6 +14,7 @@ #include #include +#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" @@ -58,7 +59,8 @@ view2_test (const auto_ptr& db) } { - result r (db->query ("age < 31")); + result r (db->query (query::age + " < 31")); + iterator i (r.begin ()); assert (i != r.end ()); assert (i->count == 2); @@ -85,7 +87,10 @@ view4_test (const auto_ptr& db) transaction t (db->begin ()); { - result r (db->query ("age > 30 ORDER BY age")); + result r (db->query ( + (query::person::age > 30) + + "ORDER BY " + + query::person::age)); iterator i (r.begin ()); @@ -102,7 +107,9 @@ view4_test (const auto_ptr& db) { result r (db->query ( - (query::person::age > 30) + "ORDER BY age")); + (query::person::age > 30) + + "ORDER BY " + + query::person::age)); iterator i (r.begin ()); @@ -229,12 +236,20 @@ main (int argc, char* argv[]) } { +#ifndef DATABASE_ORACLE result r (db->query ("ORDER BY age")); +#else + result r (db->query ("ORDER BY \"age\"")); +#endif assert (size (r) == 4); } { +#ifndef DATABASE_ORACLE result r (db->query ("age < 31 ORDER BY age")); +#else + result r (db->query ("\"age\" < 31 ORDER BY \"age\"")); +#endif view1_check (r); } @@ -277,7 +292,12 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); +#ifndef DATABASE_ORACLE result r (db->query ("first = " + query::_val ("Jane"))); +#else + result r (db->query ("\"first\" = " + query::_val ("Jane"))); +#endif + result::iterator i (r.begin ()); assert (i != r.end ()); @@ -298,11 +318,19 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); +#ifndef DATABASE_ORACLE result r ( db->query ( "SELECT first, last, age " "FROM t_view_person " "WHERE age < 31 ORDER BY age")); +#else + result r ( + db->query ( + "SELECT \"first\", \"last\", \"age\" " + "FROM \"t_view_person\" " + "WHERE \"age\" < 31 ORDER BY \"age\"")); +#endif view1_check (r); @@ -320,7 +348,11 @@ main (int argc, char* argv[]) transaction t (db->begin ()); { +#ifndef DATABASE_ORACLE result r (db->query ("age < 31 ORDER BY age")); +#else + result r (db->query ("\"age\" < 31 ORDER BY \"age\"")); +#endif view1_check (r); } @@ -438,7 +470,11 @@ main (int argc, char* argv[]) db, odb::query::employer::name == "Simple Tech, Inc"); view6_test ( +#ifndef DATABASE_ORACLE db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); +#else + db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); +#endif // view7 // diff --git a/common/view/test.hxx b/common/view/test.hxx index 5efbd1c..dee121c 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -13,6 +13,8 @@ #include #include +#include // DATABASE_XXX + struct employer; #pragma db object @@ -130,7 +132,12 @@ struct employer // Complete suffix query template. // -#pragma db view query("SELECT first, last, age FROM t_view_person") +#ifndef DATABASE_ORACLE +# pragma db view query("SELECT first, last, age FROM t_view_person") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_person\"") +#endif struct view1 { std::string first; @@ -140,9 +147,15 @@ struct view1 // Complete query. // -#pragma db view query("SELECT first, last, age " \ - "FROM t_view_person " \ - "WHERE age < 31 ORDER BY age") +#ifndef DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_person " \ + "WHERE age < 31 ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_person\" " \ + "WHERE \"age\" < 31 ORDER BY \"age\"") +#endif struct view1a { std::string first; @@ -152,9 +165,15 @@ struct view1a // Complete placeholder query template. // -#pragma db view query("SELECT first, last, age " \ - "FROM t_view_person " \ - "WHERE age < 31 AND (?) ORDER BY age") +#ifndef DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_person " \ + "WHERE age < 31 AND (?) ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_person\" " \ + "WHERE \"age\" < 31 AND (?) ORDER BY \"age\"") +#endif struct view1b { std::string first; @@ -193,8 +212,13 @@ struct view1d // Complete suffix query. // -#pragma db view object(person) \ +#ifndef DATABASE_ORACLE +# pragma db view object(person) \ query("SELECT count(id) FROM t_view_person") +#else +# pragma db view object(person) \ + query("SELECT count(\"id\") FROM \"t_view_person\"") +#endif struct view2 { std::size_t count; @@ -205,7 +229,11 @@ struct view2 #pragma db view object(person) struct view2a { +#ifndef DATABASE_ORACLE #pragma db column("count(id)") +#else + #pragma db column("count(\"id\")") +#endif std::size_t count; }; @@ -214,7 +242,11 @@ struct view2a #pragma db view object(person) struct view2b { +#ifndef DATABASE_ORACLE #pragma db column("count(t_view_person.id)") +#else + #pragma db column("count(\"t_view_person\".\"id\")") +#endif std::size_t count; }; @@ -233,10 +265,17 @@ struct view2c // Complete suffix query. // -#pragma db view object(person = test) \ - query("SELECT last, count(last) " \ - "FROM t_view_person " \ +#ifndef DATABASE_ORACLE +# pragma db view object(person = test) \ + query("SELECT last, count(last) " \ + "FROM t_view_person " \ "GROUP BY last") +#else +# pragma db view object(person = test) \ + query("SELECT \"last\", count(\"last\") " \ + "FROM \"t_view_person\" " \ + "GROUP BY \"last\"") +#endif struct view3 { std::string last_name; @@ -263,11 +302,19 @@ struct view3a // Complete suffix query. // -#pragma db view object(person) object(country = residence) \ - query("SELECT first, last, residence.name " \ - "FROM t_view_person " \ - "LEFT JOIN t_view_country AS residence " \ +#ifndef DATABASE_ORACLE +# pragma db view object(person) object(country = residence) \ + query("SELECT first, last, residence.name " \ + "FROM t_view_person " \ + "LEFT JOIN t_view_country AS residence " \ "ON t_view_person.residence = residence.code") +#else +# pragma db view object(person) object(country = residence) \ + query("SELECT \"first\", \"last\", \"residence\".\"name\" " \ + "FROM \"t_view_person\" " \ + "LEFT JOIN \"t_view_country\" \"residence\" " \ + "ON \"t_view_person\".\"residence\" = \"residence\".\"code\"") +#endif struct view4 { std::string first_name; @@ -347,18 +394,36 @@ struct view6b // The same using tables. // -#pragma db view table("t_view_person" = "p") \ +#ifndef DATABASE_ORACLE +# pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "ee.value = p.id") \ table("t_view_employer" = "e": "ee.object_id = e.name") +#else +# pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ + table("t_view_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") +#endif struct view6c { +#ifndef DATABASE_ORACLE #pragma db column("p.first") +#else + #pragma db column("\"p\".\"first\"") +#endif std::string first_name; - #pragma db column("p"."last") +#ifndef DATABASE_ORACLE + #pragma db column("p.last") +#else + #pragma db column("\"p\".\"last\"") +#endif std::string last_name; +#ifndef DATABASE_ORACLE #pragma db column("e.name") +#else + #pragma db column("\"e\".\"name\"") +#endif std::string employer; }; -- cgit v1.1 From 80b07458047bfc73281a25747198df6c6a6f9875 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:09:36 +0200 Subject: Add Oracle traits implementation for query test --- common/query/traits-oracle.hxx | 60 ++++++++++++++++++++++++++++++++++++++++++ common/query/traits.hxx | 2 ++ 2 files changed, 62 insertions(+) create mode 100644 common/query/traits-oracle.hxx diff --git a/common/query/traits-oracle.hxx b/common/query/traits-oracle.hxx new file mode 100644 index 0000000..9f9c71b --- /dev/null +++ b/common/query/traits-oracle.hxx @@ -0,0 +1,60 @@ +// file : common/query/traits-oracle.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_ORACLE_HXX +#define TRAITS_ORACLE_HXX + +#include +#include // std::auto_ptr +#include // std::memcpy +#include + +#include + +namespace odb +{ + namespace oracle + { + template <> + class value_traits, id_string> + { + public: + typedef std::auto_ptr value_type; + typedef std::string query_type; + typedef char* image_type; + + static void + set_value (std::auto_ptr& v, + const char* b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b, n)); + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const std::auto_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + assert (c >= n); + + if (n != 0) + std::memcpy (b, v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_ORACLE_HXX diff --git a/common/query/traits.hxx b/common/query/traits.hxx index ccc279b..ea142c9 100644 --- a/common/query/traits.hxx +++ b/common/query/traits.hxx @@ -10,6 +10,8 @@ #if defined(DATABASE_MYSQL) # include "traits-mysql.hxx" +#elif defined(DATABASE_ORACLE) +# include "traits-oracle.hxx" #elif defined(DATABASE_SQLITE) # include "traits-sqlite.hxx" #elif defined(DATABASE_PGSQL) -- cgit v1.1 From c8465048b378c7e162ba8e00f0226a5a0ab5281b Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:11:15 +0200 Subject: Disable use of result::size for Oracle tests --- libcommon/common/common.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 6ae33d4..b3ab40c 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -35,7 +35,7 @@ std::size_t size (odb::result& r) { std::size_t n (0); -#if defined(DATABASE_SQLITE) +#if defined(DATABASE_SQLITE) || defined(DATABASE_ORACLE) for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) n++; #else -- cgit v1.1 From 9f65908d7de63c151ff988105232cbf3c331a80d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:14:32 +0200 Subject: Use CLOB instead of TEXT for Oracle query test --- common/query/test.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/query/test.hxx b/common/query/test.hxx index 21acb84..74f5f73 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -11,6 +11,7 @@ #include #include +#include // DATABASE_XXX #pragma db object struct person @@ -37,8 +38,11 @@ struct person #pragma db column ("first") std::string first_name_; - +#ifndef DATABASE_ORACLE #pragma db column ("middle") type ("TEXT") null +#else + #pragma db column ("middle") type ("CLOB") null +#endif std::auto_ptr middle_name_; #pragma db column ("last") -- cgit v1.1 From 899732d4e111e0144d3e3bbaa91c054950361e1c Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 10:53:19 +0200 Subject: Temporarily disable query test 14 --- common/query/driver.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 283ea12..bc8fd1d 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -392,19 +392,19 @@ main (int argc, char* argv[]) // not invalidate the result. // cout << "test 014" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - ++i; - assert (i != r.end ()); - auto_ptr joe (db->load (3)); - assert (i->last_name_ == "Doe"); - - t.commit (); - } + // { + // transaction t (db->begin ()); + // result r (db->query (query::last_name == "Doe")); + + // result::iterator i (r.begin ()); + // assert (i != r.end ()); + // ++i; + // assert (i != r.end ()); + // auto_ptr joe (db->load (3)); + // assert (i->last_name_ == "Doe"); + + // t.commit (); + // } // Test uncached result. // -- cgit v1.1 From 06712594f44e8300570103c05f54d686dfc4fb53 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 15:37:32 +0200 Subject: Add BLOB comparison and null predicate test cases to query test --- common/query/driver.cxx | 44 +++++++++++++++++++++-- common/query/test.hxx | 35 +++++++++++++++---- common/query/test.std | 93 ++++++++++++++++++++++++++----------------------- 3 files changed, 119 insertions(+), 53 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index bc8fd1d..1d19860 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include // DATABASE_XXX #include #include "test.hxx" @@ -35,9 +36,16 @@ print (result& r) const char* names[] = { "John", "Jane", "Joe" }; const char** names_end = names + sizeof (names)/sizeof (names[0]); +const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; + int main (int argc, char* argv[]) { + vector + key1 (key_data[0], key_data[0] + 3), + key2 (key_data[1], key_data[1] + 3), + key3 (key_data[2], key_data[2] + 3); + try { auto_ptr db (create_database (argc, argv)); @@ -48,9 +56,9 @@ main (int argc, char* argv[]) // // { - person p1 (1, "John", "Doe", 30, true); - person p2 (2, "Jane", "Doe", 29, true); - person p3 (3, "Joe", "Dirt", 31, false); + person p1 (1, "John", "Doe", 30, true, key1); + person p2 (2, "Jane", "Doe", 29, true, key2); + person p3 (3, "Joe", "Dirt", 31, false, key3); p3.middle_name_.reset (new string ("Squeaky")); person p4 (4, "Johansen", "Johansen", 32, false); p4.middle_name_.reset (new string ("J")); @@ -416,6 +424,36 @@ main (int argc, char* argv[]) t.commit (); } + // Test BLOB column operations. + // + cout << "test 016" << endl; + { + transaction t (db->begin ()); + + result r; + +#ifndef DATABASE_ORACLE + // == + // + r = db->query (query::public_key == key2); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->public_key_ == key2); +#endif + + // is_null + // + r = db->query (query::public_key.is_null ()); + print (r); + + // is_not_null + // + r = db->query (query::public_key.is_not_null ()); + print (r); + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/query/test.hxx b/common/query/test.hxx index 74f5f73..db09f32 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -7,12 +7,17 @@ #define TEST_HXX #include +#include #include #include #include +#include + #include // DATABASE_XXX +typedef odb::nullable > nullable_vector; + #pragma db object struct person { @@ -20,12 +25,14 @@ struct person const std::string& fn, const std::string& ln, unsigned short age, - bool married) + bool married, + const nullable_vector& public_key = nullable_vector ()) : id_ (id), first_name_ (fn), last_name_ (ln), age_ (age), - married_ (married) + married_ (married), + public_key_ (public_key) { } @@ -38,11 +45,8 @@ struct person #pragma db column ("first") std::string first_name_; -#ifndef DATABASE_ORACLE - #pragma db column ("middle") type ("TEXT") null -#else - #pragma db column ("middle") type ("CLOB") null -#endif + + #pragma db column ("middle") null std::auto_ptr middle_name_; #pragma db column ("last") @@ -50,6 +54,13 @@ struct person unsigned short age_; bool married_; + +#ifdef DATABASE_PGSQL + #pragma db column ("key") type ("BYTEA") null +#else + #pragma db column ("key") type ("BLOB") null +#endif + nullable_vector public_key_; }; inline std::ostream& @@ -63,6 +74,16 @@ operator<< (std::ostream& os, const person& p) os << ' ' << p.last_name_ << ' ' << p.age_ << (p.married_ ? " married" : " single"); + if (p.public_key_ && p.public_key_->size () > 0) + { + os << ' '; + + for (std::size_t i (0), e (p.public_key_->size () - 1); i < e; ++i) + os << (unsigned int)(*p.public_key_)[i] << '-'; + + os << (unsigned int)p.public_key_->back (); + } + return os; } diff --git a/common/query/test.std b/common/query/test.std index 978282a..f351eab 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -1,7 +1,7 @@ test 001 -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single test 002 Jane Doe 29 married @@ -10,89 +10,96 @@ Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 003 -John Doe 30 married +John Doe 30 married 35-3-21 test 004 -John Doe 30 married +John Doe 30 married 35-3-21 test 005 -John Doe 30 married +John Doe 30 married 35-3-21 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 test 006 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single test 007 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single test 008 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 test 009 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single test 010 -Jane Doe 29 married +Jane Doe 29 married 19-19-84 -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 +Joe Squeaky Dirt 31 single 8-98-53 -Jane Doe 29 married +Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 Johansen J Johansen 32 single -Jane Doe 29 married -John Doe 30 married +Jane Doe 29 married 19-19-84 +John Doe 30 married 35-3-21 test 011 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 +Joe Squeaky Dirt 31 single 8-98-53 test 012 Johansen J Johansen 32 single test 013 -Joe Squeaky Dirt 31 single +Joe Squeaky Dirt 31 single 8-98-53 test 014 test 015 -John Doe 30 married -Jane Doe 29 married +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 + +test 016 +Johansen J Johansen 32 single + +John Doe 30 married 35-3-21 +Jane Doe 29 married 19-19-84 +Joe Squeaky Dirt 31 single 8-98-53 -- cgit v1.1 From 979a4e0b2112e274de1281615672d97c36a48de9 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 15:46:25 +0200 Subject: Remove temporary makefile overrides for Oracle --- common/makefile | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/common/makefile b/common/makefile index c066ce1..dee0b72 100644 --- a/common/makefile +++ b/common/makefile @@ -31,22 +31,6 @@ wrapper thread_tests := threads -# @@ Remove overrides once Oracle has been fully integrated. -# -ifeq ($(db_id),oracle) -tests := \ -auto \ -const-member \ -container \ -lazy-ptr \ -lifecycle \ -readonly \ -schema \ -wrapper - -thread_tests := -endif - all_tests := $(tests) $(thread_tests) build_tests := $(tests) $(thread_tests) -- cgit v1.1 From 0bedf6c2353027436a40a385f16847c3a37d406b Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 26 Oct 2011 17:13:31 +0200 Subject: Shorten inheritance test table prefix to avoid name collisions --- common/inheritance/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 6f6675e..4e95c68 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_inheritance_ +--generate-query --table-prefix inherit_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 9862cef1421bdc08a99c06f08de2dc5396832185 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:26:23 +0200 Subject: Simplify Oracle driver --- build/oracle/oracle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/oracle/oracle b/build/oracle/oracle index 6eedb14..276ac4d 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -45,7 +45,6 @@ if [ -z "$driver" ]; then driver=sqlplus fi -opt="-L" conn=$user if [ -n "$passwd" ]; then @@ -66,7 +65,7 @@ elif [ -n "$service" ]; then conn="$conn@$service" fi -opt="-S $opt" +opt="-L -S $opt" if [ -n "$1" ]; then exec $driver $opt $conn @$1 -- cgit v1.1 From 87fd08a98063303d4d97e2bdac7b212ae5248914 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:36:03 +0200 Subject: Revert to manually quoting Oracle identifiers where necessary --- common/callback/driver.cxx | 8 +------- common/query/driver.cxx | 33 +++++++++++++++++++++++---------- common/view/driver.cxx | 18 +++++++++++------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 76dbda4..b22d543 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -95,13 +95,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - result r (db->query ( - (query::id < 3) + "ORDER BY callback_object.id")); -#else - result r (db->query ( - (query::id < 3) + "ORDER BY \"callback_object\".\"id\"")); -#endif + result r (db->query ((query::id < 3) + "ORDER BY" + query::id)); for (result::iterator i (r.begin ()); i != r.end (); ++i) { diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 1d19860..b94bed6 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -140,10 +140,11 @@ main (int argc, char* argv[]) cout << "test 003" << endl; { transaction t (db->begin ()); - result r ( - db->query (query::age + " >= 30 AND " + - query::last_name + " = 'Doe'")); - +#ifndef DATABASE_ORACLE + result r (db->query ("age >= 30 AND last = 'Doe'")); +#else + result r (db->query ("\"age\" >= 30 AND \"last\" = 'Doe'")); +#endif print (r); t.commit (); } @@ -156,9 +157,17 @@ main (int argc, char* argv[]) const char* name = "Doe"; +#ifndef DATABASE_ORACLE result r ( - db->query (query::age + " >= " + query::_ref (30) + "AND " + - query::last_name + " = " + query::_val (name))); + db->query ( + "age >= " + query::_ref (30) + "AND" + + "last = " + query::_val (name))); +#else + result r ( + db->query ( + "\"age\" >= " + query::_ref (30) + "AND" + + "\"last\" = " + query::_val (name))); +#endif print (r); t.commit (); @@ -173,8 +182,13 @@ main (int argc, char* argv[]) string name; unsigned short age; - query q (query::age + " >= " + query::_ref (age) + "AND" + - query::last_name + " = " + query::_ref (name)); +#ifndef DATABASE_ORACLE + query q ("age >= " + query::_ref (age) + "AND" + + "last = " + query::_ref (name)); +#else + query q ("\"age\" >= " + query::_ref (age) + "AND" + + "\"last\" = " + query::_ref (name)); +#endif name = "Doe"; age = 30; @@ -354,8 +368,7 @@ main (int argc, char* argv[]) // + // r = db->query ((query::last_name == "Doe") + - "ORDER BY" + - query::age); + "ORDER BY" + query::age); print (r); t.commit (); diff --git a/common/view/driver.cxx b/common/view/driver.cxx index b671e46..f6dd613 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -59,7 +59,11 @@ view2_test (const auto_ptr& db) } { - result r (db->query (query::age + " < 31")); +#ifndef DATABASE_ORACLE + result r (db->query ("age < 31")); +#else + result r (db->query ("\"age\" < 31")); +#endif iterator i (r.begin ()); assert (i != r.end ()); @@ -87,10 +91,11 @@ view4_test (const auto_ptr& db) transaction t (db->begin ()); { - result r (db->query ( - (query::person::age > 30) + - "ORDER BY " + - query::person::age)); +#ifndef DATABASE_ORACLE + result r (db->query ((query::person::age > 30) + "ORDER BY age")); +#else + result r (db->query ((query::person::age > 30) + "ORDER BY \"age\"")); +#endif iterator i (r.begin ()); @@ -108,8 +113,7 @@ view4_test (const auto_ptr& db) { result r (db->query ( (query::person::age > 30) + - "ORDER BY " + - query::person::age)); + "ORDER BY " + query::person::age)); iterator i (r.begin ()); -- cgit v1.1 From e22a5890b984603a0b55a53b95bdf3c8378f9f23 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:38:15 +0200 Subject: Refactor pre-processor directives used to realize Oracle identifier quoting --- common/erase-query/driver.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index a80a252..adbdb76 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -161,22 +161,18 @@ main (int argc, char* argv[]) t.commit (); } -#ifndef DATABASE_ORACLE { transaction t (db->begin ()); +#ifndef DATABASE_ORACLE assert (db->execute ("SELECT * FROM erase_query_object_v " "WHERE object_id = 1") == 0); - t.commit (); - } #else - { - transaction t (db->begin ()); assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " "WHERE \"object_id\" = 1") == 0); +#endif t.commit (); } -#endif - } +} catch (const odb::exception& e) { cerr << e.what () << endl; -- cgit v1.1 From 5586f85d5542b9552e59e555206e2e355f00864e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:43:45 +0200 Subject: Simplify LOB column query tests --- common/query/driver.cxx | 27 +++++++++++++-- common/query/test.hxx | 10 ------ common/query/test.std | 92 +++++++++++++++++++++++-------------------------- 3 files changed, 67 insertions(+), 62 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index b94bed6..df631f4 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -444,26 +444,47 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r; + result::iterator i; + // Oracle does not support LOB comparisons. + // #ifndef DATABASE_ORACLE // == // r = db->query (query::public_key == key2); - result::iterator i (r.begin ()); + i = r.begin (); assert (i != r.end ()); + assert (i->public_key_ == key2); + assert (++i == r.end ()); #endif // is_null // r = db->query (query::public_key.is_null ()); - print (r); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen"); + assert (++i == r.end ()); // is_not_null // r = db->query (query::public_key.is_not_null ()); - print (r); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "John" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Jane" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt"); + assert (++i == r.end ()); t.commit (); } diff --git a/common/query/test.hxx b/common/query/test.hxx index db09f32..eab7048 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -74,16 +74,6 @@ operator<< (std::ostream& os, const person& p) os << ' ' << p.last_name_ << ' ' << p.age_ << (p.married_ ? " married" : " single"); - if (p.public_key_ && p.public_key_->size () > 0) - { - os << ' '; - - for (std::size_t i (0), e (p.public_key_->size () - 1); i < e; ++i) - os << (unsigned int)(*p.public_key_)[i] << '-'; - - os << (unsigned int)p.public_key_->back (); - } - return os; } diff --git a/common/query/test.std b/common/query/test.std index f351eab..23f9029 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -1,7 +1,7 @@ test 001 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single 8-98-53 +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 002 Jane Doe 29 married @@ -10,96 +10,90 @@ Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 003 -John Doe 30 married 35-3-21 +John Doe 30 married test 004 -John Doe 30 married 35-3-21 +John Doe 30 married test 005 -John Doe 30 married 35-3-21 +John Doe 30 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single test 006 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 007 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 008 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married test 009 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single test 010 -Jane Doe 29 married 19-19-84 +Jane Doe 29 married -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single 8-98-53 +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single -Jane Doe 29 married 19-19-84 +Jane Doe 29 married -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single Johansen J Johansen 32 single -Jane Doe 29 married 19-19-84 -John Doe 30 married 35-3-21 +Jane Doe 29 married +John Doe 30 married test 011 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single 8-98-53 +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single test 012 Johansen J Johansen 32 single test 013 -Joe Squeaky Dirt 31 single 8-98-53 +Joe Squeaky Dirt 31 single test 014 test 015 -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 +John Doe 30 married +Jane Doe 29 married test 016 -Johansen J Johansen 32 single - -John Doe 30 married 35-3-21 -Jane Doe 29 married 19-19-84 -Joe Squeaky Dirt 31 single 8-98-53 - -- cgit v1.1 From 4ee1a059a013beb224e9461f119b23c4dffa2615 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:52:23 +0200 Subject: Temporarily exclude query test 14 from Oracle test suite --- common/query/driver.cxx | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index df631f4..3108158 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -413,19 +413,21 @@ main (int argc, char* argv[]) // not invalidate the result. // cout << "test 014" << endl; - // { - // transaction t (db->begin ()); - // result r (db->query (query::last_name == "Doe")); - - // result::iterator i (r.begin ()); - // assert (i != r.end ()); - // ++i; - // assert (i != r.end ()); - // auto_ptr joe (db->load (3)); - // assert (i->last_name_ == "Doe"); - - // t.commit (); - // } +#ifndef DATABASE_ORACLE + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + auto_ptr joe (db->load (3)); + assert (i->last_name_ == "Doe"); + + t.commit (); + } +#endif // Test uncached result. // -- cgit v1.1 From 5a6e85d92fa0f46a329ea8603e150c7e8da4097f Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:52:41 +0200 Subject: Rename typedef type for clarity --- common/query/driver.cxx | 2 +- common/query/test.hxx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 3108158..6d41297 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -41,7 +41,7 @@ const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; int main (int argc, char* argv[]) { - vector + buffer key1 (key_data[0], key_data[0] + 3), key2 (key_data[1], key_data[1] + 3), key3 (key_data[2], key_data[2] + 3); diff --git a/common/query/test.hxx b/common/query/test.hxx index eab7048..d2d28d2 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -16,7 +16,8 @@ #include // DATABASE_XXX -typedef odb::nullable > nullable_vector; +typedef std::vector buffer; +typedef odb::nullable nullable_buffer; #pragma db object struct person @@ -26,7 +27,7 @@ struct person const std::string& ln, unsigned short age, bool married, - const nullable_vector& public_key = nullable_vector ()) + const nullable_buffer& public_key = nullable_buffer ()) : id_ (id), first_name_ (fn), last_name_ (ln), @@ -60,7 +61,7 @@ struct person #else #pragma db column ("key") type ("BLOB") null #endif - nullable_vector public_key_; + nullable_buffer public_key_; }; inline std::ostream& -- cgit v1.1 From 23e2378ec92457368d59ab3837d828545c1de31f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Oct 2011 13:22:55 +0200 Subject: Dereference nullable --- common/query/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 6d41297..db95a85 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -458,7 +458,7 @@ main (int argc, char* argv[]) i = r.begin (); assert (i != r.end ()); - assert (i->public_key_ == key2); + assert (*i->public_key_ == key2); assert (++i == r.end ()); #endif -- cgit v1.1 From c12e7cba18fe4163563f1428626950a68a5d01d6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Oct 2011 15:16:49 +0200 Subject: Add support for persistent classes without object ids New pragma id (object). New test: common/no-id. --- common/makefile | 1 + common/no-id/driver.cxx | 102 ++++++++++++++++++++++++++++++++++++++++++++ common/no-id/makefile | 109 ++++++++++++++++++++++++++++++++++++++++++++++++ common/no-id/test.hxx | 23 ++++++++++ common/no-id/test.std | 0 5 files changed, 235 insertions(+) create mode 100644 common/no-id/driver.cxx create mode 100644 common/no-id/makefile create mode 100644 common/no-id/test.hxx create mode 100644 common/no-id/test.std diff --git a/common/makefile b/common/makefile index dee0b72..ac977cf 100644 --- a/common/makefile +++ b/common/makefile @@ -20,6 +20,7 @@ inheritance \ inverse \ lazy-ptr \ lifecycle \ +no-id \ query \ readonly \ relationship \ diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx new file mode 100644 index 0000000..a2171a0 --- /dev/null +++ b/common/no-id/driver.cxx @@ -0,0 +1,102 @@ +// file : common/no-id/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test persistent classes without id. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o1 (1, "aaa"); + object o2 (2, "bbb"); + object o3 (3, "ccc"); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o2); // Ok, since there is no id. + db->persist (o3); + t.commit (); + } + + // Compile errors. + // + { + //db->load (1); + //db->find (1); + //db->update (o1); + //db->erase (1); + } + + typedef odb::query query; + typedef odb::result result; + + // Query. + // + { + transaction t (db->begin ()); + + { + result r (db->query ()); + assert (size (r) == 4); + } + + { + result r (db->query (query::str == "aaa")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + object o; + i.load (o); + //i.id (); // Compile-time error. + assert (o.num == 1 && o.str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::num < 3)); + assert (size (r) == 3); + } + + t.commit (); + } + + // Erase (query). + // + { + transaction t (db->begin ()); + assert (db->erase_query (query::num == 2) == 2); + assert (db->erase_query () == 2); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/no-id/makefile b/common/no-id/makefile new file mode 100644 index 0000000..11cd2e2 --- /dev/null +++ b/common/no-id/makefile @@ -0,0 +1,109 @@ +# file : common/no-id/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) --generate-schema \ +--generate-query --table-prefix no_id_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +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 schema) + $(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/no-id/test.hxx b/common/no-id/test.hxx new file mode 100644 index 0000000..3508d88 --- /dev/null +++ b/common/no-id/test.hxx @@ -0,0 +1,23 @@ +// file : common/no-id/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 + +#include + +#pragma db object id() +struct object +{ + object () {} + object (unsigned long n, const std::string& s): num (n), str (s) {} + + unsigned long num; + std::string str; +}; + +#endif // TEST_HXX diff --git a/common/no-id/test.std b/common/no-id/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From d1195999bfd67ca5aac2b0b5257a3538582f41e6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Oct 2011 17:55:04 +0200 Subject: Make sure output directory exist before generating config.h --- libcommon/common/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 885b55d..6bc7a88 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -41,7 +41,7 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) -$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make +$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/. @echo '/* file : libcommon/common/config.h' >$@ @echo ' * author : automatically generated' >>$@ @echo ' */' >>$@ -- cgit v1.1 From 1f84261ffcb3c6efbe450bf904e3e8c63f9f80e0 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 13:36:03 +0200 Subject: Only pass -S option to sqlplus when the Oracle driver is passed a file --- build/oracle/oracle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/oracle/oracle b/build/oracle/oracle index 276ac4d..9228025 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -65,9 +65,10 @@ elif [ -n "$service" ]; then conn="$conn@$service" fi -opt="-L -S $opt" +opt="-L $opt" if [ -n "$1" ]; then + opt="-S $opt" exec $driver $opt $conn @$1 else exec $driver $opt $conn -- cgit v1.1 From 627e8761562fc2a622856c328706a94dca692186 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 28 Oct 2011 13:58:16 +0200 Subject: Enable query test 14 for Oracle --- common/query/driver.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index db95a85..d9d0f12 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -413,7 +413,6 @@ main (int argc, char* argv[]) // not invalidate the result. // cout << "test 014" << endl; -#ifndef DATABASE_ORACLE { transaction t (db->begin ()); result r (db->query (query::last_name == "Doe")); @@ -427,7 +426,6 @@ main (int argc, char* argv[]) t.commit (); } -#endif // Test uncached result. // -- cgit v1.1 From 6215f11fafd416316293333c8f8fc421aa90a7c4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Nov 2011 12:41:02 +0200 Subject: Implement support for optimistic concurrency New pragmas: optimistic, version. New test: optimistic. New database function: reload(). --- common/makefile | 1 + common/optimistic/driver.cxx | 300 +++++++++++++++++++++++++++++++++++++++++++ common/optimistic/makefile | 109 ++++++++++++++++ common/optimistic/test.hxx | 78 +++++++++++ common/optimistic/test.std | 0 5 files changed, 488 insertions(+) create mode 100644 common/optimistic/driver.cxx create mode 100644 common/optimistic/makefile create mode 100644 common/optimistic/test.hxx create mode 100644 common/optimistic/test.std diff --git a/common/makefile b/common/makefile index ac977cf..c17bedc 100644 --- a/common/makefile +++ b/common/makefile @@ -21,6 +21,7 @@ inverse \ lazy-ptr \ lifecycle \ no-id \ +optimistic \ query \ readonly \ relationship \ diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx new file mode 100644 index 0000000..46929d4 --- /dev/null +++ b/common/optimistic/driver.cxx @@ -0,0 +1,300 @@ +// file : common/optimistic/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test optimistic concurrency support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +unsigned long +version (const auto_ptr& db, unsigned long id) +{ + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::id == id)); + return r.empty () ? 0 : r.begin ()->ver; +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.num = 123; + o.str = "abc"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Verify initial version in the instance and database. + // + assert (o.ver == 1); + { + transaction t (db->begin ()); + assert (version (db, 1) == 1); + t.commit (); + } + + object c (o); + o.num++; + o.str += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Verify updated version in the instance and database. + // + assert (o.ver == 2); + { + transaction t (db->begin ()); + assert (version (db, 1) == 2); + t.commit (); + } + + // Verify the data has been updated. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); + } + + // Try to update using outdated object. + // + c.num--; + c.str += 'z'; + + { + transaction t (db->begin ()); + + try + { + db->update (c); + assert (false); + } + catch (const object_changed&) {} + + // Verify the data hasn't changed. + // + auto_ptr o1 (db->load (1)); + assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); + + // Reload the object. + // + db->reload (c); + assert (c.ver == 2 && c.num == 124); + + // Check that we don't reload an object that is up-to-date. + // + c.num--; + db->reload (c); + assert (c.ver == 2 && c.num == 123); + + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + // Try to update deleted object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + assert (false); + } + catch (const object_not_persistent&) + { + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Optimistic delete of objects with container requires + // extra logic. Test it here. + // + { + container o ("abc"); + o.nums.push_back (1); + o.nums.push_back (2); + o.nums.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + container c (o); + o.nums.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + // Verify the container data hasn't changed. + // + auto_ptr o1 (db->load ("abc")); + assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test optimistic class inheritance. This is a shortened version + // of the object test. + // + { + derived o; + o.num = 123; + o.str = "abc"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + derived c (o); + o.num++; + o.str += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Try to update using outdated object. + // + c.num--; + c.str += 'z'; + + { + transaction t (db->begin ()); + + try + { + db->update (c); + assert (false); + } + catch (const object_changed&) {} + + // Reload the object. + // + db->reload (c); + assert (c.ver == 2 && c.num == 124); + + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/optimistic/makefile b/common/optimistic/makefile new file mode 100644 index 0000000..955cc2f --- /dev/null +++ b/common/optimistic/makefile @@ -0,0 +1,109 @@ +# file : common/optimistic/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) --generate-schema \ +--generate-query --table-prefix optimistic_ +$(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 schema) + $(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/optimistic/test.hxx b/common/optimistic/test.hxx new file mode 100644 index 0000000..06dadff --- /dev/null +++ b/common/optimistic/test.hxx @@ -0,0 +1,78 @@ +// file : common/optimistic/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 +#include + +#include + +#pragma db object optimistic +struct object +{ + object (): ver (123) {} + object (unsigned long id): id_ (id), ver (123) {} + + #pragma db id + unsigned long id_; + + #pragma db version + unsigned long ver; + + unsigned int num; + std::string str; +}; + +#pragma db view object(object) +struct object_version +{ + unsigned long ver; +}; + +// Optimistic class with a container. +// +#pragma db object optimistic +struct container +{ + container (): ver (123) {} + container (std::string const& id): id_ (id), ver (123) {} + + #pragma db id + std::string id_; + + #pragma db version + unsigned long ver; + + std::vector nums; +}; + +// Optimistic class inheritance. +// +#pragma db object abstract optimistic +struct base +{ + base (): ver (123) {} + + #pragma db id auto + unsigned long id_; + + #pragma db version + unsigned long ver; + + std::string str; + + #pragma db readonly + std::string ro; +}; + +#pragma db object +struct derived: base +{ + unsigned int num; +}; + +#endif // TEST_HXX diff --git a/common/optimistic/test.std b/common/optimistic/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 0f4004313121397fbd5375d663b24ed0dee23616 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Nov 2011 14:51:06 +0200 Subject: Fix bug in view column parsing --- common/view/test.hxx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/common/view/test.hxx b/common/view/test.hxx index dee121c..4492600 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -405,25 +405,13 @@ struct view6b #endif struct view6c { -#ifndef DATABASE_ORACLE #pragma db column("p.first") -#else - #pragma db column("\"p\".\"first\"") -#endif std::string first_name; -#ifndef DATABASE_ORACLE #pragma db column("p.last") -#else - #pragma db column("\"p\".\"last\"") -#endif std::string last_name; -#ifndef DATABASE_ORACLE - #pragma db column("e.name") -#else - #pragma db column("\"e\".\"name\"") -#endif + #pragma db column("e"."name") std::string employer; }; -- cgit v1.1 From 15f718bbf874a77b1079a55f29335447aeba17dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2011 10:18:25 +0200 Subject: Prevent potential image overwrite in MySQL query result --- common/query/driver.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index d9d0f12..45392b8 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -422,7 +422,12 @@ main (int argc, char* argv[]) ++i; assert (i != r.end ()); auto_ptr joe (db->load (3)); - assert (i->last_name_ == "Doe"); + assert (i->last_name_ == "Doe"); // Actual load. + + person p; + joe.reset (db->load (3)); // Overwrite object image again. + i.load (p); + assert (p.last_name_ == "Doe"); t.commit (); } -- cgit v1.1 From 62ef9782b05e7edb8e391232c97c95a0dc9b34c3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2011 11:04:55 +0200 Subject: Add result_iterator::id() function that returns id without loading object --- common/query/driver.cxx | 14 ++++++++++++++ common/query/test.std | 1 + 2 files changed, 15 insertions(+) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 45392b8..e019fe5 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -493,6 +493,20 @@ main (int argc, char* argv[]) t.commit (); } + + // Test iterator::id(). + // + cout << "test 017" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i.id () == 3); + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/query/test.std b/common/query/test.std index 23f9029..58a2aa0 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -97,3 +97,4 @@ John Doe 30 married Jane Doe 29 married test 016 +test 017 -- cgit v1.1 From 7930679bf077dd593ff7e138843adb7f8ba40c25 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2011 14:29:23 +0200 Subject: Add example for optimistic concurrency support --- common/optimistic/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 955cc2f..9945ca5 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix optimistic_ +--generate-query --table-prefix t_optimistic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From cee18c8947e5d0ecae1c1daf2c003737da5f4305 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2011 15:08:26 +0200 Subject: Bump version to 1.7.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index dc1e644..38a3807 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.0 +1.7.0.a1 -- cgit v1.1 From 1bbe6fe0d6269851ac69a383189b0809d86ef40f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2011 10:11:24 +0200 Subject: Add support for mapping char[N] and unsigned char[N] types to BLOB New test: common/blob. --- common/blob/driver.cxx | 71 ++++++++++++++++++++++++++++++++ common/blob/makefile | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ common/blob/test.hxx | 55 +++++++++++++++++++++++++ common/blob/test.std | 0 common/makefile | 1 + 5 files changed, 236 insertions(+) create mode 100644 common/blob/driver.cxx create mode 100644 common/blob/makefile create mode 100644 common/blob/test.hxx create mode 100644 common/blob/test.std diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx new file mode 100644 index 0000000..0c58deb --- /dev/null +++ b/common/blob/driver.cxx @@ -0,0 +1,71 @@ +// file : common/blob/driver.cxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test BLOB mapping. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + const char data[] = + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "cccccccccccccccccccccccccccccccccccccccccccccccc" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "dddddddddddddddddddddddddddddddddddddddddddddddd" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "ffffffffffffffffffffffffffffffffffffffffffffffff"; + + const unsigned char* udata = reinterpret_cast (data); + + object o (1); + o.vc.assign (data, data + sizeof (data)); + o.vuc.assign (udata, udata + sizeof (data)); + memcpy (o.c, data, sizeof (data)); + memcpy (o.uc, udata, sizeof (data)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/blob/makefile b/common/blob/makefile new file mode 100644 index 0000000..ae0ea11 --- /dev/null +++ b/common/blob/makefile @@ -0,0 +1,109 @@ +# file : common/blob/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) --generate-schema \ +--table-prefix blob_ +$(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 schema) + $(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/blob/test.hxx b/common/blob/test.hxx new file mode 100644 index 0000000..5fb501e --- /dev/null +++ b/common/blob/test.hxx @@ -0,0 +1,55 @@ +// file : common/blob/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 +#include // std::memcmp + +#include + +#ifdef ODB_COMPILER +# ifdef ODB_DATABASE_PGSQL +# define BLOB_TYPE "BYTEA" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db type(BLOB_TYPE) + std::vector vc; + + #pragma db type(BLOB_TYPE) + std::vector vuc; + + #pragma db type(BLOB_TYPE) + char c[1024]; + + #pragma db type(BLOB_TYPE) + unsigned char uc[1024]; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id_ == y.id_ && + x.vc == y.vc && + x.vuc == y.vuc && + std::memcmp (x.c, y.c, sizeof (x.c)) == 0 && + std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0; +} + +#endif // TEST_HXX diff --git a/common/blob/test.std b/common/blob/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index c17bedc..37d50d3 100644 --- a/common/makefile +++ b/common/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ auto \ +blob \ callback \ composite \ const-object \ -- cgit v1.1 From e54acedef205100136524ea99e18c554a7d4b027 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2011 13:57:57 +0200 Subject: Temporarily remove oracle sub-directory from all_dirs This is for the 1.7.0.a1 release, which doesn't include Oracle support. --- makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 66fe55b..254e749 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt +#all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt +all_dirs := libcommon common tracer mysql sqlite pgsql boost qt dirs := common tracer boost qt ifeq ($(db_id),mysql) -- cgit v1.1 From 353516802d727ab57811171f09f21f6f9ba6237f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2011 14:12:42 +0200 Subject: Use ODB_DATABASE_XXX macros instead DATABASE_XXX in ODB-compiled headers DATABASE_XXX macros are not defined when building from VC++ project. --- common/query/test.hxx | 4 +--- common/view/test.hxx | 20 +++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/common/query/test.hxx b/common/query/test.hxx index d2d28d2..b69be3c 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -14,8 +14,6 @@ #include #include -#include // DATABASE_XXX - typedef std::vector buffer; typedef odb::nullable nullable_buffer; @@ -56,7 +54,7 @@ struct person unsigned short age_; bool married_; -#ifdef DATABASE_PGSQL +#ifdef ODB_DATABASE_PGSQL #pragma db column ("key") type ("BYTEA") null #else #pragma db column ("key") type ("BLOB") null diff --git a/common/view/test.hxx b/common/view/test.hxx index 4492600..5cbd171 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -13,8 +13,6 @@ #include #include -#include // DATABASE_XXX - struct employer; #pragma db object @@ -132,7 +130,7 @@ struct employer // Complete suffix query template. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age FROM t_view_person") #else # pragma db view query("SELECT \"first\", \"last\", \"age\" " \ @@ -147,7 +145,7 @@ struct view1 // Complete query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age " \ "FROM t_view_person " \ "WHERE age < 31 ORDER BY age") @@ -165,7 +163,7 @@ struct view1a // Complete placeholder query template. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view query("SELECT first, last, age " \ "FROM t_view_person " \ "WHERE age < 31 AND (?) ORDER BY age") @@ -212,7 +210,7 @@ struct view1d // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person) \ query("SELECT count(id) FROM t_view_person") #else @@ -229,7 +227,7 @@ struct view2 #pragma db view object(person) struct view2a { -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE #pragma db column("count(id)") #else #pragma db column("count(\"id\")") @@ -242,7 +240,7 @@ struct view2a #pragma db view object(person) struct view2b { -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE #pragma db column("count(t_view_person.id)") #else #pragma db column("count(\"t_view_person\".\"id\")") @@ -265,7 +263,7 @@ struct view2c // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person = test) \ query("SELECT last, count(last) " \ "FROM t_view_person " \ @@ -302,7 +300,7 @@ struct view3a // Complete suffix query. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ "FROM t_view_person " \ @@ -394,7 +392,7 @@ struct view6b // The same using tables. // -#ifndef DATABASE_ORACLE +#ifndef ODB_DATABASE_ORACLE # pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "ee.value = p.id") \ table("t_view_employer" = "e": "ee.object_id = e.name") -- cgit v1.1 From 37a2585ce1d0801bab5d0aba50012c3bcd451739 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2011 14:58:48 +0200 Subject: Restore oracle sub-directory in all_dirs --- makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefile b/makefile index 254e749..66fe55b 100644 --- a/makefile +++ b/makefile @@ -5,8 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -#all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt -all_dirs := libcommon common tracer mysql sqlite pgsql boost qt +all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost qt dirs := common tracer boost qt ifeq ($(db_id),mysql) -- cgit v1.1 From 28a08724fc9e2ac494596711990206c64ca36b1d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Nov 2011 13:40:31 +0200 Subject: Get rid of custom value_traits specialization in query test auto_ptr is now handled automatically as a wrapper. --- common/query/driver.cxx | 2 +- common/query/makefile | 6 ++--- common/query/traits-mysql.hxx | 59 ----------------------------------------- common/query/traits-oracle.hxx | 60 ------------------------------------------ common/query/traits-pgsql.hxx | 59 ----------------------------------------- common/query/traits-sqlite.hxx | 59 ----------------------------------------- common/query/traits.hxx | 21 --------------- 7 files changed, 3 insertions(+), 263 deletions(-) delete mode 100644 common/query/traits-mysql.hxx delete mode 100644 common/query/traits-oracle.hxx delete mode 100644 common/query/traits-pgsql.hxx delete mode 100644 common/query/traits-sqlite.hxx delete mode 100644 common/query/traits.hxx diff --git a/common/query/driver.cxx b/common/query/driver.cxx index e019fe5..6dd7757 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -399,7 +399,7 @@ main (int argc, char* argv[]) t.commit (); } - // Test value_traits::type != value_traits::value_type. + // Test value_traits::value_type != value_traits::query_type. // cout << "test 013" << endl; { diff --git a/common/query/makefile b/common/query/makefile index f1f2fa9..63c0e77 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -36,8 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix t_query_ +--generate-query --table-prefix t_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -54,13 +53,12 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx $(databases:%=traits-%.hxx) $(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) $(extra_headers) $(data_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)) diff --git a/common/query/traits-mysql.hxx b/common/query/traits-mysql.hxx deleted file mode 100644 index fb95bfd..0000000 --- a/common/query/traits-mysql.hxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : common/query/traits-mysql.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_MYSQL_HXX -#define TRAITS_MYSQL_HXX - -#include -#include // std::auto_ptr -#include // std::memcpy - -#include - -namespace odb -{ - namespace mysql - { - template <> - class value_traits, id_string> - { - public: - typedef std::auto_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (std::auto_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const std::auto_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_MYSQL_HXX diff --git a/common/query/traits-oracle.hxx b/common/query/traits-oracle.hxx deleted file mode 100644 index 9f9c71b..0000000 --- a/common/query/traits-oracle.hxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : common/query/traits-oracle.hxx -// author : Constantin Michael -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_ORACLE_HXX -#define TRAITS_ORACLE_HXX - -#include -#include // std::auto_ptr -#include // std::memcpy -#include - -#include - -namespace odb -{ - namespace oracle - { - template <> - class value_traits, id_string> - { - public: - typedef std::auto_ptr value_type; - typedef std::string query_type; - typedef char* image_type; - - static void - set_value (std::auto_ptr& v, - const char* b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b, n)); - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const std::auto_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - assert (c >= n); - - if (n != 0) - std::memcpy (b, v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_ORACLE_HXX diff --git a/common/query/traits-pgsql.hxx b/common/query/traits-pgsql.hxx deleted file mode 100644 index 5b5c5d3..0000000 --- a/common/query/traits-pgsql.hxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : common/query/traits-pgsql.hxx -// author : Constantin Michael -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_PGSQL_HXX -#define TRAITS_PGSQL_HXX - -#include -#include // std::auto_ptr -#include // std::memcpy - -#include - -namespace odb -{ - namespace pgsql - { - template <> - class value_traits, id_string> - { - public: - typedef std::auto_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (std::auto_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const std::auto_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_PGSQL_HXX diff --git a/common/query/traits-sqlite.hxx b/common/query/traits-sqlite.hxx deleted file mode 100644 index 4e58b34..0000000 --- a/common/query/traits-sqlite.hxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : common/query/traits-sqlite.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_SQLITE_HXX -#define TRAITS_SQLITE_HXX - -#include -#include // std::auto_ptr -#include // std::memcpy - -#include - -namespace odb -{ - namespace sqlite - { - template <> - class value_traits, id_text> - { - public: - typedef std::auto_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (std::auto_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const std::auto_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_SQLITE_HXX diff --git a/common/query/traits.hxx b/common/query/traits.hxx deleted file mode 100644 index ea142c9..0000000 --- a/common/query/traits.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : common/query/traits.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include - -#if defined(DATABASE_MYSQL) -# include "traits-mysql.hxx" -#elif defined(DATABASE_ORACLE) -# include "traits-oracle.hxx" -#elif defined(DATABASE_SQLITE) -# include "traits-sqlite.hxx" -#elif defined(DATABASE_PGSQL) -# include "traits-pgsql.hxx" -#endif - -#endif // TRAITS_HXX -- cgit v1.1 From 1c9bf613aba99ca70a53b5f8f90e49225c7a56f1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 7 Nov 2011 15:22:44 +0200 Subject: Add tests for Oracle INTERVAL temporal types --- oracle/types/driver.cxx | 7 +- oracle/types/test.hxx | 64 ++++++++++++++++-- oracle/types/traits.hxx | 171 +++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 217 insertions(+), 25 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 2eeb2e8..371388c 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -43,7 +43,10 @@ main (int argc, char* argv[]) o.binary_float_ = 1.123F; o.binary_double_ = 1.123; - o.date_ = date_time (2010, 8, 29, 15, 33, 18); + o.date_ = date_time (2010, 8, 29, 15, 33, 18, 0); + o.timestamp_ = date_time (1996, 3, 9, 18, 2, 54, 123000); + o.interval_ds_ = time_interval (0, 0, 13, 43, 23, 19, 123000); + o.interval_ym_ = time_interval (12, 3, 0, 0, 0, 0, 0); string vshort_str (8, 's'); string short_str (13, 's'); @@ -87,7 +90,7 @@ main (int argc, char* argv[]) // Testing of character set conversion to and from the client's database // character set is disabled as the server database character set may // not be able to represent some Unicode characters. If this were the case - // the test outcome be a false negative. + // the test outcome would be a false negative. // // o.char_ = unicode_str; // o.varchar2_ = unicode_str; diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index bfb06f9..907d310 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -8,6 +8,7 @@ #include #include +#include #include @@ -22,13 +23,15 @@ struct date_time unsigned char d, unsigned char h, unsigned char min, - unsigned char sec) + unsigned char sec, + unsigned int nsec) : year (y), month (m), day (d), hour (h), minute (min), - second (sec) + second (sec), + nanosecond (nsec) { } @@ -41,7 +44,8 @@ struct date_time day == y.day && hour == y.hour && minute == y.minute && - second == y.second; + second == y.second && + nanosecond == y.nanosecond; } unsigned short year; @@ -50,6 +54,46 @@ struct date_time unsigned char hour; unsigned char minute; unsigned char second; + unsigned int nanosecond; +}; + +struct time_interval +{ + time_interval () + { + } + + time_interval (int y, int m, int d, int h, int min, int sec, int nsec) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + nanosecond (nsec) + { + } + + bool + operator== (const time_interval& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + nanosecond == y.nanosecond; + } + + int year; + int month; + int day; + int hour; + int minute; + int second; + int nanosecond; }; #pragma db object @@ -100,9 +144,14 @@ struct object #pragma db type ("DATE") date_time date_; - // @@ - // #pragma db type ("TIMESTAMP(6)") - // date_time timestamp_; + #pragma db type ("TIMESTAMP(6)") + date_time timestamp_; + + #pragma db type ("INTERVAL DAY TO SECOND") + time_interval interval_ds_; + + #pragma db type ("INTERVAL YEAR TO MONTH") + time_interval interval_ym_; // String and binary types. // @@ -149,6 +198,9 @@ struct object binary_float_ == y.binary_float_ && binary_double_ == y.binary_double_ && date_ == y.date_ && + timestamp_ == y.timestamp_ && + interval_ds_ == y.interval_ds_ && + interval_ym_ == y.interval_ym_ && char_ == y.char_ && varchar2_ == y.varchar2_ && nchar_ == y.nchar_ && diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 521bc9c..46223ea 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -6,9 +6,12 @@ #ifndef TRAITS_HXX #define TRAITS_HXX +#include // datetime, interval_ym, interval_ds #include -#include "test.hxx" // date_time +#include + +#include "test.hxx" // date_time, time_interval namespace odb { @@ -18,8 +21,8 @@ namespace odb class value_traits { public: - typedef long long value_type; - typedef long long query_type; + typedef date_time value_type; + typedef date_time query_type; typedef char* image_type; static void @@ -27,13 +30,21 @@ namespace odb { if (!is_null) { - v.year = (i[0] - 100) * 100; - v.year += (i[1] - 100); - v.month = i[2]; - v.day = i[3]; - v.hour = i[4] - 1; - v.minute = i[5] - 1; - v.second = i[6] - 1; + short y (0); + unsigned char m (0), d (0), h (0), min (0), s (0); + + details::get_date (i, y, m, d, h, min, s); + + v.year = y; + v.month = m; + v.day = d; + v.hour = h; + v.minute = min; + v.second = s; + + // Oracle DATE does not support fractional seconds. + // + v.nanosecond = 0; } } @@ -41,14 +52,140 @@ namespace odb set_image (char* i, bool& is_null, const date_time& v) { is_null = false; + details::set_date (i, + static_cast (v.year), + v.month, + v.day, + v.hour, + v.minute, + v.second); + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetime image_type; + + static void + set_value (date_time& v, const datetime& i, bool is_null) + { + if (!is_null) + { + sb2 y (0); + ub1 m (0), d (0), h (0), min (0), s (0); + ub4 ns (0); + + i.get (y, m, d, h, min, s, ns); + + v.year = y; + v.month = m; + v.day = d; + v.hour = h; + v.minute = min; + v.second = s; + v.nanosecond = ns; + } + } + + static void + set_image (datetime& i, + bool& is_null, + const date_time& v) + { + is_null = false; + + i.set (static_cast (v.year), + v.month, + v.day, + v.hour, + v.minute, + v.second, + v.nanosecond); + } + }; + + template <> + class value_traits + { + public: + typedef time_interval value_type; + typedef time_interval query_type; + typedef interval_ds image_type; + + static void + set_value (time_interval& v, + const interval_ds& i, + bool is_null) + { + if (!is_null) + { + sb4 d (0), h (0), m (0), s (0), ns (0); + i.get (d, h, m, s, ns); + + v.year = 0; + v.month = 0; + v.day = static_cast (d); + v.hour = static_cast (h); + v.minute = static_cast (m); + v.second = static_cast (s); + v.nanosecond = static_cast (ns); + } + } + + static void + set_image (interval_ds& i, + bool& is_null, + const time_interval& v) + { + is_null = false; + + i.set (v.day, + v.hour, + v.minute, + v.second, + static_cast (v.nanosecond)); + } + }; - i[0] = static_cast (v.year / 100 + 100); - i[1] = static_cast (v.year % 100 + 100); - i[2] = static_cast (v.month); - i[3] = static_cast (v.day); - i[4] = static_cast (v.hour + 1); - i[5] = static_cast (v.minute + 1); - i[6] = static_cast (v.second + 1); + template <> + class value_traits + { + public: + typedef time_interval value_type; + typedef time_interval query_type; + typedef interval_ym image_type; + + static void + set_value (time_interval& v, + const interval_ym& i, + bool is_null) + { + if (!is_null) + { + sb4 y (0), m (0); + i.get (y, m); + + v.year = static_cast (y); + v.month = static_cast (m); + v.day = 0; + v.hour = 0; + v.minute = 0; + v.second = 0; + v.nanosecond = 0; + } + } + + static void + set_image (interval_ym& i, + bool& is_null, + const time_interval& v) + { + is_null = false; + i.set (v.year, v.month); } }; } -- cgit v1.1 From 20c2f6cde170e1a8703858e17530fcf68e4efbe4 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 8 Nov 2011 13:42:45 +0200 Subject: Add tests for Oracle support of the Boost profile --- boost/makefile | 2 + boost/oracle/date-time/driver.cxx | 134 ++++++++++++++++++++++++++++++++++++++ boost/oracle/date-time/makefile | 121 ++++++++++++++++++++++++++++++++++ boost/oracle/date-time/test.hxx | 41 ++++++++++++ boost/oracle/date-time/test.std | 0 boost/oracle/makefile | 36 ++++++++++ boost/oracle/template/driver.cxx | 44 +++++++++++++ boost/oracle/template/makefile | 116 +++++++++++++++++++++++++++++++++ boost/oracle/template/test.hxx | 27 ++++++++ boost/oracle/template/test.std | 1 + makefile | 4 +- 11 files changed, 524 insertions(+), 2 deletions(-) create mode 100644 boost/oracle/date-time/driver.cxx create mode 100644 boost/oracle/date-time/makefile create mode 100644 boost/oracle/date-time/test.hxx create mode 100644 boost/oracle/date-time/test.std create mode 100644 boost/oracle/makefile create mode 100644 boost/oracle/template/driver.cxx create mode 100644 boost/oracle/template/makefile create mode 100644 boost/oracle/template/test.hxx create mode 100644 boost/oracle/template/test.std diff --git a/boost/makefile b/boost/makefile index 4bb2793..9b9a25c 100644 --- a/boost/makefile +++ b/boost/makefile @@ -10,6 +10,8 @@ dirs := common ifeq ($(db_id),mysql) dirs += mysql +else ifeq ($(db_id),oracle) +dirs += oracle else ifeq ($(db_id),sqlite) dirs += sqlite else ifeq ($(db_id),pgsql) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx new file mode 100644 index 0000000..4bb3058 --- /dev/null +++ b/boost/oracle/date-time/driver.cxx @@ -0,0 +1,134 @@ +// file : boost/oracle/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (ptime (max_date_time)); + + o.durations.push_back (time_duration (1, 2, 3)); + o.durations.push_back (time_duration (-1, 2, 3)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime mappings. + // + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid time_duration mappings. + // + object sv1, sv2; + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile new file mode 100644 index 0000000..059582c --- /dev/null +++ b/boost/oracle/date-time/makefile @@ -0,0 +1,121 @@ +# file : boost/oracle/date-time/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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 oracle \ +--profile boost/date-time --generate-schema \ +--table-prefix date_time_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/oracle/,,$(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 schema) + $(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/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx new file mode 100644 index 0000000..ef5455a --- /dev/null +++ b/boost/oracle/date-time/test.hxx @@ -0,0 +1,41 @@ +// file : boost/oracle/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/boost/oracle/date-time/test.std b/boost/oracle/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/oracle/makefile b/boost/oracle/makefile new file mode 100644 index 0000000..929fa8b --- /dev/null +++ b/boost/oracle/makefile @@ -0,0 +1,36 @@ +# file : boost/oracle/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 := \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := boost-oracle +$(dist): export dirs := $(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/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx new file mode 100644 index 0000000..b1442e0 --- /dev/null +++ b/boost/oracle/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/oracle/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 // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile new file mode 100644 index 0000000..551cfb0 --- /dev/null +++ b/boost/oracle/template/makefile @@ -0,0 +1,116 @@ +# file : boost/oracle/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) + +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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 oracle --profile boost \ +--generate-schema --table-prefix boost_oracle_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/oracle/,,$(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 schema) + $(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/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx new file mode 100644 index 0000000..2bb9244 --- /dev/null +++ b/boost/oracle/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/oracle/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/boost/oracle/template/test.std b/boost/oracle/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/oracle/template/test.std @@ -0,0 +1 @@ +test 001 diff --git a/makefile b/makefile index 66fe55b..2007852 100644 --- a/makefile +++ b/makefile @@ -23,8 +23,8 @@ endif # @@ Remove overrides when Oracle implementation is complete. # ifeq ($(db_id),oracle) -all_dirs := libcommon common tracer mysql sqlite oracle -dirs := common tracer oracle +all_dirs := libcommon common tracer mysql sqlite pgsql oracle boost +dirs := common tracer boost oracle endif default := $(out_base)/ -- cgit v1.1 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 From cbaa5532f056d0ad20300abbba253b065982187a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Nov 2011 17:06:00 +0200 Subject: Add common/transaction test (port from tracer) --- common/makefile | 1 + common/transaction/driver.cxx | 117 ++++++++++++++++++++++++++++++++++++++++++ common/transaction/makefile | 88 +++++++++++++++++++++++++++++++ common/transaction/test.std | 21 ++++++++ libcommon/common/common.hxx | 2 +- libcommon/common/concrete.hxx | 43 ++++++++++++++++ 6 files changed, 271 insertions(+), 1 deletion(-) create mode 100644 common/transaction/driver.cxx create mode 100644 common/transaction/makefile create mode 100644 common/transaction/test.std create mode 100644 libcommon/common/concrete.hxx diff --git a/common/makefile b/common/makefile index c75ea56..81481b6 100644 --- a/common/makefile +++ b/common/makefile @@ -31,6 +31,7 @@ relationship \ relationship-query \ schema \ template \ +transaction \ types \ view \ wrapper diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx new file mode 100644 index 0000000..d868782 --- /dev/null +++ b/common/transaction/driver.cxx @@ -0,0 +1,117 @@ +// file : common/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 +#include + +#include +#include + +using namespace std; +using namespace odb::core; + +struct transaction_tracer: odb::tracer +{ + virtual void + execute (connection&, const char* s) + { + string str (s); + + if (str == "BEGIN") + cout << "begin transaction" << endl; + else if (str == "COMMIT") + cout << "commit transaction" << endl; + else if (str == "ROLLBACK") + cout << "rollback transaction" << endl; + } +}; + +int +main (int argc, char* argv[]) +{ + transaction_tracer tracer; + auto_ptr db (create_database (argc, argv, false)); + db->tracer (tracer); + + assert (!transaction::has_current ()); + + // Current and db accessors. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + assert (&t.database () == db.get ()); + 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 (odb_db::transaction) == sizeof (transaction)); + + odb_db::transaction t (static_cast (*db).begin ()); + odb_db::transaction& r (odb_db::transaction::current ()); + assert (&t == &r); + } +} diff --git a/common/transaction/makefile b/common/transaction/makefile new file mode 100644 index 0000000..7c0889b --- /dev/null +++ b/common/transaction/makefile @@ -0,0 +1,88 @@ +# file : common/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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/test.std b/common/transaction/test.std new file mode 100644 index 0000000..792010c --- /dev/null +++ b/common/transaction/test.std @@ -0,0 +1,21 @@ +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/libcommon/common/common.hxx b/libcommon/common/common.hxx index b3ab40c..ead8888 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -15,7 +15,7 @@ #include #include -// Make sure assert() is not diabled. +// Make sure assert() is not disabled. // #ifdef NDEBUG # error ODB tests require enabled assert(); un-define the NDEBUG macro diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx new file mode 100644 index 0000000..d3c8cc4 --- /dev/null +++ b/libcommon/common/concrete.hxx @@ -0,0 +1,43 @@ +// file : libcommon/common/concrete.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_CONCRETE_HXX +#define LIBCOMMON_COMMON_CONCRETE_HXX + +#include + +// Namespace alias for the concrete database namespace. +// +#if defined(DATABASE_MYSQL) + +#include +#include + +namespace odb_db = odb::mysql; + +#elif defined(DATABASE_SQLITE) + +#include +#include + +namespace odb_db = odb::sqlite; + +#elif defined(DATABASE_PGSQL) + +#include +#include + +namespace odb_db = odb::pgsql; + +#elif defined(DATABASE_ORACLE) + +#include +#include + +namespace odb_db = odb::oracle; + +#endif + +#endif // LIBCOMMON_COMMON_CONCRETE_HXX -- cgit v1.1 From df9de141e37fdec17c33d56cb0f21f76a4867239 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Nov 2011 17:29:55 +0200 Subject: Add support for const version members --- common/optimistic/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 06dadff..5346e1c 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -61,7 +61,7 @@ struct base unsigned long id_; #pragma db version - unsigned long ver; + const unsigned long ver; std::string str; -- cgit v1.1 From 5aee82f8d634739d8b1af602d804e76d962a2d56 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Nov 2011 20:19:17 +0200 Subject: Make sure we can use same type as both container and simple value --- common/blob/driver.cxx | 3 +++ common/blob/test.hxx | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 0c58deb..f123577 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -48,6 +48,9 @@ main (int argc, char* argv[]) o.vuc.assign (udata, udata + sizeof (data)); memcpy (o.c, data, sizeof (data)); memcpy (o.uc, udata, sizeof (data)); + o.cont.push_back (1); + o.cont.push_back (2); + o.cont.push_back (3); { transaction t (db->begin ()); diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 5fb501e..b1b7cf5 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -39,6 +39,10 @@ struct object #pragma db type(BLOB_TYPE) unsigned char uc[1024]; + + // Make sure we can still use std::vector as a container. + // + std::vector cont; }; inline bool @@ -49,7 +53,8 @@ operator== (const object& x, const object& y) x.vc == y.vc && x.vuc == y.vuc && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 && - std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0; + std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 && + x.cont == y.cont; } #endif // TEST_HXX -- cgit v1.1 From 8fcd54e0011cf336b9e11a8c1264e19fcad861d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Nov 2011 16:23:24 +0200 Subject: Add descriptor management flags for TIMESTAMP and INTERVAL image types For a query expression that has only by-value parameters, we guarantee that it can be used by multiple threads. However, the way we handle TIMESTAMP and INTERVAL types now requires the modification of the image during query execution. To resolve this, the datetime, interval_ym, and interval_ds image types now have flags that allow the query implementation to avoid the modification. --- oracle/types/driver.cxx | 25 +++++++++++++++++++++++++ oracle/types/makefile | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 371388c..994885f 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -168,6 +168,31 @@ main (int argc, char* argv[]) assert (bui2 == *buil2); assert (bui3 == *buil3); } + + // Test descriptor management in TIMESTAMP and INTERVAL images. + // + { + typedef odb::query query; + typedef odb::result result; + + query q (query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_); + + transaction t (db->begin ()); + + { + result r (db->query (q)); + assert (size (r) == 1); + } + + { + result r (db->query (q)); + assert (size (r) == 1); + } + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/oracle/types/makefile b/oracle/types/makefile index 7f01dd6..69b3b66 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -36,7 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle --generate-schema \ ---table-prefix oracle_types_ --hxx-prologue '\#include "traits.hxx"' +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--table-prefix oracle_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 8c4f0afcc7f2db3c0696aa1edac1270c4bffbec7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 10 Nov 2011 13:06:19 +0200 Subject: Oracle INTERVAL hours field valid range is 0-23 --- oracle/types/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 994885f..b786cec 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -45,7 +45,7 @@ main (int argc, char* argv[]) o.date_ = date_time (2010, 8, 29, 15, 33, 18, 0); o.timestamp_ = date_time (1996, 3, 9, 18, 2, 54, 123000); - o.interval_ds_ = time_interval (0, 0, 13, 43, 23, 19, 123000); + o.interval_ds_ = time_interval (0, 0, 13, 15, 23, 19, 123000); o.interval_ym_ = time_interval (12, 3, 0, 0, 0, 0, 0); string vshort_str (8, 's'); -- cgit v1.1 From e00bc68eb5eb8070c8799275f73345a27f7abc60 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 10 Nov 2011 13:07:20 +0200 Subject: Test large Oracle LOBs --- oracle/types/driver.cxx | 22 ++++++++++++++++++++++ oracle/types/test.hxx | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index b786cec..aac636a 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -169,6 +169,28 @@ main (int argc, char* argv[]) assert (bui3 == *buil3); } + // Test large BLOBs. + // + blob b (1, 50000); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr bl (db->load (1)); + t.commit (); + + assert (b == *bl); + } + // Test descriptor management in TIMESTAMP and INTERVAL images. // { diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 907d310..be49b82 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -252,4 +252,27 @@ struct big_int } }; +#pragma db object +struct blob +{ + blob (): id_ (0) {} + + blob (unsigned int id, std::size_t n) + : id_ (id), value_ ('b', n) + { + } + + #pragma db id + unsigned int id_; + + #pragma db type ("BLOB") + std::vector value_; + + bool + operator== (const blob& y) const + { + return id_ == y.id_ && value_ == y.value_; + } +}; + #endif // TEST_HXX -- cgit v1.1 From 95e1a2336699ef7ac8cdd806f7dca8c100ceeb50 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 11 Nov 2011 13:45:16 +0200 Subject: Set and export LD_LIBRARY_PATH and SQLPATH in Oracle test driver --- build/oracle/configure | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/oracle/configure b/build/oracle/configure index 6e59a3d..1325c83 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -80,6 +80,20 @@ echo "--port '$port'" >>$opt fi echo "#!/bin/sh" >$drv + +dir=`dirname $driver` +if [ "$dir" != "." ]; then + echo >>$drv + echo "LD_LIBRARY_PATH=\"$dir:$LD_LIBRARY_PATH\"" >>$drv + echo export LD_LIBRARY_PATH >>$drv + echo >>$drv + echo "if [ -z \"\$SQLPATH\" ]; then" >>$drv + echo " SQLPATH=\"$dir\"" >>$drv + echo export SQLPATH >>$drv + echo "fi" >>$drv + echo >>$drv +fi + echo "opt=\`cat $opt\`" >>$drv echo "eval $scf_root/oracle/oracle --driver $driver \$opt \$*" >>$drv chmod 755 $drv -- cgit v1.1 From 1b2489b74b3e77d7eef2d18b3b206d9825731762 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 11 Nov 2011 13:57:27 +0200 Subject: Add tests for Oracle support of Qt profile --- makefile | 11 ++-- qt/makefile | 2 + qt/oracle/basic/driver.cxx | 58 +++++++++++++++++++++ qt/oracle/basic/makefile | 116 +++++++++++++++++++++++++++++++++++++++++ qt/oracle/basic/test.hxx | 29 +++++++++++ qt/oracle/basic/test.std | 0 qt/oracle/date-time/driver.cxx | 83 +++++++++++++++++++++++++++++ qt/oracle/date-time/makefile | 116 +++++++++++++++++++++++++++++++++++++++++ qt/oracle/date-time/test.hxx | 45 ++++++++++++++++ qt/oracle/date-time/test.std | 0 qt/oracle/makefile | 37 +++++++++++++ qt/oracle/template/driver.cxx | 44 ++++++++++++++++ qt/oracle/template/makefile | 110 ++++++++++++++++++++++++++++++++++++++ qt/oracle/template/test.hxx | 27 ++++++++++ qt/oracle/template/test.std | 1 + 15 files changed, 672 insertions(+), 7 deletions(-) create mode 100644 qt/oracle/basic/driver.cxx create mode 100644 qt/oracle/basic/makefile create mode 100644 qt/oracle/basic/test.hxx create mode 100644 qt/oracle/basic/test.std create mode 100644 qt/oracle/date-time/driver.cxx create mode 100644 qt/oracle/date-time/makefile create mode 100644 qt/oracle/date-time/test.hxx create mode 100644 qt/oracle/date-time/test.std create mode 100644 qt/oracle/makefile create mode 100644 qt/oracle/template/driver.cxx create mode 100644 qt/oracle/template/makefile create mode 100644 qt/oracle/template/test.hxx create mode 100644 qt/oracle/template/test.std diff --git a/makefile b/makefile index 1e94b3a..dc0d58a 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,10 @@ ifeq ($(db_id),mysql) dirs += mysql endif +ifeq ($(db_id),oracle) +dirs += oracle +endif + ifeq ($(db_id),sqlite) dirs += sqlite endif @@ -20,13 +24,6 @@ ifeq ($(db_id),pgsql) dirs += pgsql endif -# @@ Remove overrides when Oracle implementation is complete. -# -ifeq ($(db_id),oracle) -all_dirs := libcommon common mysql sqlite pgsql oracle boost -dirs := common boost oracle -endif - default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test diff --git a/qt/makefile b/qt/makefile index a835d49..13a05a0 100644 --- a/qt/makefile +++ b/qt/makefile @@ -10,6 +10,8 @@ dirs := common ifeq ($(db_id),mysql) dirs += mysql +else ifeq ($(db_id),oracle) +dirs += oracle else ifeq ($(db_id),sqlite) dirs += sqlite else ifeq ($(db_id),pgsql) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx new file mode 100644 index 0000000..926ea8f --- /dev/null +++ b/qt/oracle/basic/driver.cxx @@ -0,0 +1,58 @@ +// file : qt/oracle/basic/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "John Doe"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + object* ol = db->load (o.str); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile new file mode 100644 index 0000000..9f3207e --- /dev/null +++ b/qt/oracle/basic/makefile @@ -0,0 +1,116 @@ +# file : qt/oracle/basic/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 oracle --profile qt/basic \ +--generate-schema --table-prefix qt_oracle_basic_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/oracle/,,$(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 schema) + $(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/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx new file mode 100644 index 0000000..25710c0 --- /dev/null +++ b/qt/oracle/basic/test.hxx @@ -0,0 +1,29 @@ +// file : qt/oracle/basic/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/qt/oracle/basic/test.std b/qt/oracle/basic/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx new file mode 100644 index 0000000..82dd2fe --- /dev/null +++ b/qt/oracle/date-time/driver.cxx @@ -0,0 +1,83 @@ +// file : qt/oracle/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // // Check persistence of valid dates and times. + // // + // QDateTime t (QDateTime::currentDateTime ()); + + // t.setTime (QTime (t.time ().hour (), + // t.time ().minute (), + // t.time ().second (), + // t.time ().msec ())); + + // o.date = t.date (); + // o.date_time = t; + // o.time = t.time (); + + // { + // transaction t (db->begin ()); + // db->persist (o); + // t.commit (); + // } + + // { + // transaction t (db->begin ()); + // auto_ptr ol (db->load (o.id)); + // t.commit (); + + // assert (*ol == o); + // } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile new file mode 100644 index 0000000..2b92ac2 --- /dev/null +++ b/qt/oracle/date-time/makefile @@ -0,0 +1,116 @@ +# file : qt/oracle/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 oracle --profile qt/date-time \ +--generate-schema --table-prefix qt_oracle_date_time_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/oracle/,,$(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 schema) + $(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/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx new file mode 100644 index 0000000..5396d4f --- /dev/null +++ b/qt/oracle/date-time/test.hxx @@ -0,0 +1,45 @@ +// file : qt/oracle/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QDateTime date_time; + QTime time; +}; + +#endif // TEST_HXX diff --git a/qt/oracle/date-time/test.std b/qt/oracle/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/oracle/makefile b/qt/oracle/makefile new file mode 100644 index 0000000..3d3b063 --- /dev/null +++ b/qt/oracle/makefile @@ -0,0 +1,37 @@ +# file : qt/oracle/makefile +# author : Constantin Michael +# 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 := \ +basic \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := qt-oracle +$(dist): export dirs := $(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/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx new file mode 100644 index 0000000..88e9e74 --- /dev/null +++ b/qt/oracle/template/driver.cxx @@ -0,0 +1,44 @@ +// file : qt/oracle/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile new file mode 100644 index 0000000..ede9ed3 --- /dev/null +++ b/qt/oracle/template/makefile @@ -0,0 +1,110 @@ +# file : qt/oracle/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +#Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 oracle --profile qt \ +--generate-schema --table-prefix qt_oracle_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/oracle/,,$(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 schema) + $(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/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx new file mode 100644 index 0000000..02fcb8f --- /dev/null +++ b/qt/oracle/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/oracle/template/test.hxx +// author : Constantin Michael +// 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/qt/oracle/template/test.std b/qt/oracle/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/oracle/template/test.std @@ -0,0 +1 @@ +test 001 -- cgit v1.1 From a84dffbcf901af047b793a50b472f165c0a9c564 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 11 Nov 2011 15:01:33 +0200 Subject: Minor fixes to Oracle driver generator --- build/oracle/configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/oracle/configure b/build/oracle/configure index 1325c83..9746133 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -84,12 +84,12 @@ echo "#!/bin/sh" >$drv dir=`dirname $driver` if [ "$dir" != "." ]; then echo >>$drv - echo "LD_LIBRARY_PATH=\"$dir:$LD_LIBRARY_PATH\"" >>$drv - echo export LD_LIBRARY_PATH >>$drv + echo 'LD_LIBRARY_PATH="'$dir':$LD_LIBRARY_PATH"' >>$drv + echo "export LD_LIBRARY_PATH" >>$drv echo >>$drv - echo "if [ -z \"\$SQLPATH\" ]; then" >>$drv - echo " SQLPATH=\"$dir\"" >>$drv - echo export SQLPATH >>$drv + echo 'if [ -z "$SQLPATH" ]; then' >>$drv + echo ' SQLPATH="'$dir'"' >>$drv + echo " export SQLPATH" >>$drv echo "fi" >>$drv echo >>$drv fi -- cgit v1.1 From 1792e4f1aba7a60ae4ae6a227982da5459d34cfc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 11 Nov 2011 15:01:57 +0200 Subject: Shorten table prefixes to help Oracle --- boost/mysql/date-time/makefile | 2 +- boost/oracle/date-time/makefile | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/sqlite/date-time/makefile | 2 +- qt/common/containers/makefile | 2 +- qt/mysql/date-time/makefile | 2 +- qt/oracle/date-time/makefile | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/sqlite/date-time/makefile | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 204743e..9f9584b 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile boost/date-time \ ---generate-schema --table-prefix boost_mysql_date_time_ +--generate-schema --table-prefix boost_mysql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 059582c..c2a8711 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -50,7 +50,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle \ --profile boost/date-time --generate-schema \ ---table-prefix date_time_ +--table-prefix boost_or_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 3e64e60..27f3f6d 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile boost/date-time \ ---generate-schema --table-prefix boost_pgsql_date_time_ +--generate-schema --table-prefix boost_pgsql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 1f87856..fbaccaf 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -49,7 +49,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile boost/date-time \ ---generate-schema --table-prefix boost_sqlite_date_time_ +--generate-schema --table-prefix boost_sqlite_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index c95a1a6..0bbdda8 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_containers_ +--table-prefix qt_cont_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index ef50f46..94963f5 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mysql --profile qt/date-time \ ---generate-schema --table-prefix qt_mysql_date_time_ +--generate-schema --table-prefix qt_mysql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 2b92ac2..e018e16 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle --profile qt/date-time \ ---generate-schema --table-prefix qt_oracle_date_time_ +--generate-schema --table-prefix qt_oracle_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 51f8375..b6e71a8 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database pgsql --profile qt/date-time \ ---generate-schema --table-prefix qt_pgsql_date_time_ +--generate-schema --table-prefix qt_pgsql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index a105859..71365df 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --profile qt/date-time \ ---generate-schema --table-prefix qt_sqlite_date_time_ +--generate-schema --table-prefix qt_sqlite_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) -- cgit v1.1 From 7b6ace8f265e12704cc1d7e0c6f26dfe51ea2809 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 15 Nov 2011 12:04:57 +0200 Subject: Add tests for Oracle LOB support of QByteArray and QString --- qt/oracle/basic/driver.cxx | 13 ++++++++++--- qt/oracle/basic/test.hxx | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 926ea8f..39f6b41 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -9,6 +9,7 @@ #include // std::auto_ptr #include #include +#include #include #include @@ -28,9 +29,15 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + string long_str (20000, 'l'); + object o; - o.str = "John Doe"; - o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + o.varchar = "John Doe"; + o.clob = QString::fromStdString (string (150, 'c')); + o.nclob = QString::fromStdString (long_str); + o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + o.blob = QByteArray (long_str.c_str (), + static_cast (long_str.size ())); // Persist. // @@ -44,7 +51,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.str); + object* ol = db->load (o.varchar); t.commit (); assert (*ol == o); diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 25710c0..979e11f 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -16,14 +16,26 @@ struct object operator== (const object& x) const { return - str == x.str && - blob == x.blob; + varchar == x.varchar && + clob == x.clob && + nclob == x.nclob && + blob == x.blob && + raw == x.raw; } #pragma db id - QString str; + QString varchar; + + #pragma db type ("CLOB") + QString clob; + + #pragma db type ("NCLOB") + QString nclob; QByteArray blob; + + #pragma db type ("RAW(128)") + QByteArray raw; }; #endif // TEST_HXX -- cgit v1.1 From 076a61b6c19044a38de8c17b0fefbc74074491f4 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 15 Nov 2011 16:35:47 +0200 Subject: Test containers of Oracle LOB types --- oracle/types/driver.cxx | 5 +++++ oracle/types/test.hxx | 16 ++++++++++++++-- qt/oracle/basic/driver.cxx | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index aac636a..fa056ff 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -65,6 +65,11 @@ main (int argc, char* argv[]) o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + o.strs_.push_back (short_str); + o.strs_.push_back (medium_str); + o.strs_.push_back (long_str); + o.strs_.push_back (vlong_str); + // Persist. // { diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index be49b82..b496114 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -8,7 +8,7 @@ #include #include -#include +#include // std::auto_ptr #include @@ -96,6 +96,9 @@ struct time_interval int nanosecond; }; +typedef std::auto_ptr string_ptr; +typedef std::vector strings; + #pragma db object struct object { @@ -181,8 +184,15 @@ struct object #pragma db type ("NCLOB") std::string nclob_; + // Test containers of LOBs + // + #pragma db value_type ("CLOB") + strings strs_; + // Test NULL value. // + #pragma db type ("VARCHAR(32)") null + string_ptr null_; bool operator== (const object& y) const @@ -208,7 +218,9 @@ struct object raw_ == y.raw_ && blob_ == y.blob_ && clob_ == y.clob_ && - nclob_ == y.nclob_; + nclob_ == y.nclob_ && + strs_ == y.strs_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); } }; diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 39f6b41..1afb966 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -32,6 +32,7 @@ main (int argc, char* argv[]) string long_str (20000, 'l'); object o; + o.varchar = "John Doe"; o.clob = QString::fromStdString (string (150, 'c')); o.nclob = QString::fromStdString (long_str); -- cgit v1.1 From af3c189d16503722d4c568b9b49a553af2f4b4db Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 18 Nov 2011 11:22:49 +0200 Subject: Correct license in file headers --- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index a4a8c99..1ad67cf 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,7 +1,7 @@ # file : build/import/libodb-oracle/configuration-rules.make # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. $(call message,,$(scf_root)/import/libodb-oracle/configure $@) diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 9934d03..adee0be 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -3,7 +3,7 @@ # file : build/import/libodb-oracle/configure # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file # $1 - out file diff --git a/build/oracle/configure b/build/oracle/configure index 9746133..564d526 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -3,7 +3,7 @@ # file : build/oracle/configure # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file # # dcf_root - dynamic configuration root diff --git a/build/oracle/oracle b/build/oracle/oracle index 9228025..4d518fe 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -3,7 +3,7 @@ # file : build/oracle/oracle # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file # # Oracle driver wrapper. -- cgit v1.1 From 7dfafd074a3a6e7cca3c72e94ea39293298bb9d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2011 13:56:35 +0200 Subject: Exclude include test from distribution list --- common/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/makefile b/common/makefile index 81481b6..8534034 100644 --- a/common/makefile +++ b/common/makefile @@ -50,7 +50,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := common $(dist): name := $(name) -$(dist): export dirs := $(tests) +$(dist): export dirs := $(filter-out include,$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ $(call vc10slns,$(name)) -- cgit v1.1 From 023cc1b06faa3e3ff6588ef4095f6e6badf19c17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2011 14:02:00 +0200 Subject: Add template to list of Oracle-specific tests --- oracle/makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/oracle/makefile b/oracle/makefile index 8073a94..aaefd80 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ +template \ native \ types -- cgit v1.1 From 47b943aa03a569fc23b9057ba572e9aeb63b5822 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2011 16:32:59 +0200 Subject: Add support for common tests without ODB compilation for automake/VC projects --- common/template/Makefile.am | 3 +++ common/template/template-vc10.vcxproj | 9 ++++++--- common/template/template-vc9.vcproj | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/template/Makefile.am b/common/template/Makefile.am index eb1ae97..3cd0fb2 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -14,6 +14,8 @@ 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 @@ -27,3 +29,4 @@ ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< +) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index 4a2711c..bdaf37b 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -154,21 +154,24 @@ true +m4_ifelse(__value__(odb_options),,, +m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -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_entry__(test-odb.ixx)) __header_entries__(extra_headers) __source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) +m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index 49e95ec..9bb8cf8 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -__source_entry__(test-odb.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__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -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_entry__(test-odb.ixx)) __file_entries__(extra_headers) -- cgit v1.1 From 7703243861e4ade2c0fcdda98033a19d006717b7 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 24 Nov 2011 09:52:17 +0200 Subject: Specify correct license in file headers --- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oracle/makefile b/oracle/makefile index aaefd80..d4a3e94 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,7 +1,7 @@ # file : oracle/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index ab1138a..d2b0bfc 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,7 +1,7 @@ // file : oracle/native/driver.cxx // author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : ODB NCUEL; see accompanying LICENSE file +// license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. // diff --git a/oracle/native/makefile b/oracle/native/makefile index cea60ae..ff2d16c 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,7 +1,7 @@ # file : oracle/native/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index b5c9f71..a2146ba 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,7 +1,7 @@ // file : oracle/template/driver.cxx // author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : ODB NCUEL; see accompanying LICENSE file +// license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE // diff --git a/oracle/template/makefile b/oracle/template/makefile index 47315d9..2798388 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,7 +1,7 @@ # file : oracle/template/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index 7e8f699..fb8e53c 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,7 +1,7 @@ // file : oracle/template/test.hxx // author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : ODB NCUEL; see accompanying LICENSE file +// license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX #define TEST_HXX -- cgit v1.1 From aefb392d4d6bcb59c3f3df34018d754ac4f718e9 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 24 Nov 2011 09:58:48 +0200 Subject: Add Oracle to automake and Visual Studio build --- Makefile.am | 4 + boost/Makefile.am | 4 + boost/makefile | 2 +- boost/oracle/Makefile.am | 7 + boost/oracle/boost-oracle-vc10.sln | 15 + boost/oracle/boost-oracle-vc9.sln | 15 + boost/oracle/template/Makefile.am | 32 ++ boost/oracle/template/template-vc10.vcxproj | 180 ++++++++++ .../oracle/template/template-vc10.vcxproj.filters | 25 ++ boost/oracle/template/template-vc9.vcproj | 361 +++++++++++++++++++++ boost/oracle/test.bat | 70 ++++ configure.ac | 4 + m4/database.m4 | 7 +- m4/libodb-oracle.m4 | 84 +++++ m4/oracle.m4 | 245 ++++++++++++++ makefile | 3 +- oracle-driver.bat | 43 +++ oracle.options | 9 + oracle/Makefile.am | 7 + oracle/oracle-vc10.sln | 15 + oracle/oracle-vc9.sln | 15 + oracle/template/Makefile.am | 32 ++ oracle/template/template-vc10.vcxproj | 180 ++++++++++ oracle/template/template-vc10.vcxproj.filters | 25 ++ oracle/template/template-vc9.vcproj | 361 +++++++++++++++++++++ oracle/test.bat | 70 ++++ qt/Makefile.am | 4 + qt/makefile | 2 +- qt/oracle/Makefile.am | 7 + qt/oracle/qt-oracle-vc10.sln | 15 + qt/oracle/qt-oracle-vc9.sln | 15 + qt/oracle/template/Makefile.am | 32 ++ qt/oracle/template/template-vc10.vcxproj | 180 ++++++++++ qt/oracle/template/template-vc10.vcxproj.filters | 25 ++ qt/oracle/template/template-vc9.vcproj | 361 +++++++++++++++++++++ qt/oracle/test.bat | 70 ++++ 36 files changed, 2522 insertions(+), 4 deletions(-) create mode 100644 boost/oracle/Makefile.am create mode 100644 boost/oracle/boost-oracle-vc10.sln create mode 100644 boost/oracle/boost-oracle-vc9.sln create mode 100644 boost/oracle/template/Makefile.am create mode 100644 boost/oracle/template/template-vc10.vcxproj create mode 100644 boost/oracle/template/template-vc10.vcxproj.filters create mode 100644 boost/oracle/template/template-vc9.vcproj create mode 100644 boost/oracle/test.bat create mode 100644 m4/libodb-oracle.m4 create mode 100644 m4/oracle.m4 create mode 100644 oracle-driver.bat create mode 100644 oracle.options create mode 100644 oracle/Makefile.am create mode 100644 oracle/oracle-vc10.sln create mode 100644 oracle/oracle-vc9.sln create mode 100644 oracle/template/Makefile.am create mode 100644 oracle/template/template-vc10.vcxproj create mode 100644 oracle/template/template-vc10.vcxproj.filters create mode 100644 oracle/template/template-vc9.vcproj create mode 100644 oracle/test.bat create mode 100644 qt/oracle/Makefile.am create mode 100644 qt/oracle/qt-oracle-vc10.sln create mode 100644 qt/oracle/qt-oracle-vc9.sln create mode 100644 qt/oracle/template/Makefile.am create mode 100644 qt/oracle/template/template-vc10.vcxproj create mode 100644 qt/oracle/template/template-vc10.vcxproj.filters create mode 100644 qt/oracle/template/template-vc9.vcproj create mode 100644 qt/oracle/test.bat diff --git a/Makefile.am b/Makefile.am index 9c56178..9b1360e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,5 +25,9 @@ if DATABASE_PGSQL SUBDIRS += pgsql endif +if DATABASE_ORACLE +SUBDIRS += oracle +endif + EXTRA_DIST = __file__(extra_dist) ACLOCAL_AMFLAGS = -I m4 diff --git a/boost/Makefile.am b/boost/Makefile.am index 2e6565f..a18e3f7 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -17,4 +17,8 @@ if DATABASE_PGSQL SUBDIRS += pgsql endif +if DATABASE_ORACLE +SUBDIRS += oracle +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/boost/makefile b/boost/makefile index 9b9a25c..27a5fb8 100644 --- a/boost/makefile +++ b/boost/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite pgsql +all_dirs := common mysql sqlite pgsql oracle dirs := common ifeq ($(db_id),mysql) diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am new file mode 100644 index 0000000..6237668 --- /dev/null +++ b/boost/oracle/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/oracle/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) diff --git a/boost/oracle/boost-oracle-vc10.sln b/boost/oracle/boost-oracle-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/oracle/boost-oracle-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/oracle/boost-oracle-vc9.sln b/boost/oracle/boost-oracle-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/oracle/boost-oracle-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am new file mode 100644 index 0000000..2e5e5f8 --- /dev/null +++ b/boost/oracle/template/Makefile.am @@ -0,0 +1,32 @@ +# file : boost/oracle/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/boost/oracle/template/template-vc10.vcxproj b/boost/oracle/template/template-vc10.vcxproj new file mode 100644 index 0000000..99773c8 --- /dev/null +++ b/boost/oracle/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.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/boost/oracle/template/template-vc10.vcxproj.filters b/boost/oracle/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/boost/oracle/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/boost/oracle/template/template-vc9.vcproj b/boost/oracle/template/template-vc9.vcproj new file mode 100644 index 0000000..0342966 --- /dev/null +++ b/boost/oracle/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/boost/oracle/test.bat b/boost/oracle/test.bat new file mode 100644 index 0000000..d323b10 --- /dev/null +++ b/boost/oracle/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : boost/oracle/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 oracle %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/configure.ac b/configure.ac index 26ae26d..532140d 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,10 @@ case $database in LIBODB_PGSQL([], [AC_MSG_ERROR([libodb-pgsql is not found; consider using --with-libodb-pgsql=DIR])]) PGSQL ;; + oracle) + LIBODB_ORACLE([], [AC_MSG_ERROR([libodb-oracle is not found; consider using --with-libodb-oracle=DIR])]) + ORACLE + ;; esac # Check for the ODB compiler. diff --git a/m4/database.m4 b/m4/database.m4 index 968f764..5f5a03e 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -13,7 +13,7 @@ AC_MSG_CHECKING([for database to use]) AC_ARG_WITH( [database], [AC_HELP_STRING([--with-database=db], - [database to use for tests; valid values are: 'mysql', 'sqlite', and 'pgsql'])], + [database to use for tests; valid values are: 'mysql', 'sqlite', 'pgsql', and 'oracle'])], [case $withval in no | yes) AC_MSG_RESULT([]) @@ -31,6 +31,10 @@ AC_ARG_WITH( database=pgsql AC_DEFINE([DATABASE_PGSQL], [1], [Using PostgreSQL.]) ;; + oracle) + database=oracle + AC_DEFINE([DATABASE_ORACLE], [1], [Using Oracle.]) + ;; *) AC_MSG_RESULT([]) AC_MSG_ERROR([unknown database $withval]) @@ -47,5 +51,6 @@ AC_SUBST([database]) AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) AM_CONDITIONAL([DATABASE_SQLITE], [test x$database = xsqlite]) AM_CONDITIONAL([DATABASE_PGSQL], [test x$database = xpgsql]) +AM_CONDITIONAL([DATABASE_ORACLE], [test x$database = xoracle]) ])dnl diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 new file mode 100644 index 0000000..319377f --- /dev/null +++ b/m4/libodb-oracle.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-oracle.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_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_ORACLE], [ +libodb_oracle_found=no + +AC_ARG_WITH( + [libodb-oracle], + [AC_HELP_STRING([--with-libodb-oracle=DIR],[location of libodb-oracle build directory])], + [libodb_oracle_dir=${withval}], + [libodb_oracle_dir=]) + +AC_MSG_CHECKING([for libodb-oracle]) + +# If libodb_oracle_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_oracle_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_oracle_dir], [$ac_pwd], [$libodb_oracle_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_oracle_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_oracle_dir/odb/oracle" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-oracle $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::oracle::database_exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_oracle_found=yes]) +libodb_oracle_found=yes +if test x"$libodb_oracle_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_oracle_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_oracle_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/oracle.m4 b/m4/oracle.m4 new file mode 100644 index 0000000..836ded5 --- /dev/null +++ b/m4/oracle.m4 @@ -0,0 +1,245 @@ +dnl file : m4/oracle.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 ORACLE +dnl +AC_DEFUN([ORACLE], [ + +# Client. +# +AC_MSG_CHECKING([for oracle client program]) +AC_ARG_WITH( + [oracle-client], + [AC_HELP_STRING([--with-oracle-client=path], [Oracle client program path (sqlplus by default)])], + [case $withval in + yes) + oracle_client=sqlplus + ;; + no) + AC_MSG_RESULT([]) + AC_MSG_ERROR([need oracle client to run the tests]) + ;; + *) + oracle_client=$withval + ;; + esac], + [oracle_client=sqlplus]) + +$oracle_client -V 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$oracle_client]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([oracle client is not found; consider using --with-oracle-client=PATH]) +fi + +# User. +# +AC_MSG_CHECKING([for oracle database user]) +AC_ARG_WITH( + [oracle-user], + [AC_HELP_STRING([--with-oracle-user=login], [Oracle database user (odb_test by default)])], + [case $withval in + yes) + oracle_user=odb_test + oracle_user_set=yes + ;; + no) + oracle_user_set=no + ;; + *) + oracle_user=$withval + oracle_user_set=yes + ;; + esac], + [oracle_user=odb_test + oracle_user_set=yes]) + +if test x$oracle_user_set = xyes; then + AC_MSG_RESULT(['$oracle_user']) +else + AC_MSG_RESULT([none]) +fi + +# Password. +# +AC_MSG_CHECKING([for oracle database password]) +AC_ARG_WITH( + [oracle-password], + [AC_HELP_STRING([--with-oracle-password=login], [Oracle database password])], + [case $withval in + yes) + oracle_password= + oracle_password_set=yes + ;; + no) + oracle_password_set=no + ;; + *) + oracle_password=$withval + oracle_password_set=yes + ;; + esac], + [oracle_password_set=no]) + +if test x$oracle_password_set = xyes; then + AC_MSG_RESULT(['$oracle_password']) +# Use obd_test as a default password if the user is odb_test and the password +# option was not specified. +# +elif test x$oracle_user = xodb_test; then + oracle_password=odb_test + oracle_password_set=yes + AC_MSG_RESULT(['$oracle_password']) +else + AC_MSG_RESULT([none]) +fi + +# Service name. +# +AC_MSG_CHECKING([for oracle service name]) +AC_ARG_WITH( + [oracle-service], + [AC_HELP_STRING([--with-oracle-service=name], [Oracle service name (default service if left empty). Note that all data in the database associated with the test user on this service WILL BE LOST!])], + [case $withval in + yes) + oracle_service= + oracle_service_set=yes + ;; + no) + oracle_service_set=no + ;; + *) + oracle_service=$withval + oracle_service_set=yes + ;; + esac], + [oracle_service_set=no]) + +if test x$oracle_service_set = xyes; then + AC_MSG_RESULT(['$oracle_service']) +else + AC_MSG_RESULT([default]) +fi + +# Host. +# +AC_MSG_CHECKING([for oracle database host]) +AC_ARG_WITH( + [oracle-host], + [AC_HELP_STRING([--with-oracle-host=host], [Oracle database host (localhost by default)])], + [case $withval in + yes) + oracle_host= + oracle_host_set=yes + ;; + no) + oracle_host_set=no + ;; + *) + oracle_host=$withval + oracle_host_set=yes + ;; + esac], + [oracle_host_set=no]) + +if test x$oracle_host_set = xyes; then + AC_MSG_RESULT(['$oracle_host']) +else + AC_MSG_RESULT([default]) +fi + +# Port. +# +AC_MSG_CHECKING([for oracle database port]) +AC_ARG_WITH( + [oracle-port], + [AC_HELP_STRING([--with-oracle-port=port], [Oracle database port (standard Oracle port by default)])], + [case $withval in + yes) + oracle_port= + oracle_port_set=yes + ;; + no) + oracle_port_set=no + ;; + *) + oracle_port=$withval + oracle_port_set=yes + ;; + esac], + [oracle_port_set=no]) + +if test x$oracle_port_set = xyes; then + AC_MSG_RESULT(['$oracle_port']) +else + AC_MSG_RESULT([default]) +fi + +# Create options file. +# +AC_CONFIG_COMMANDS([oracle.options], + [ + rm -f db.options + echo '#! /bin/sh' >db-driver + + if test x$oracle_user_set = xyes; then + echo "--user '$oracle_user'" >>db.options + echo 'conn_str="'"$oracle_user"'"' >>db-driver + fi + + if test x$oracle_password_set = xyes; then + echo "--password '$oracle_password'" >>db.options + echo 'conn_str="$conn_str/'"$oracle_password"'"' >>db-driver + fi + + if test x$oracle_host_set = xyes; then + echo "--host '$oracle_host'" >>db.options + echo 'conn_str="$conn_str@//'"$oracle_host"'"' >>db-driver + + if test x$oracle_port_set = xyes; then + echo "--port '$oracle_port'" >>db.options + echo 'conn_str="$conn_str:'"$oracle_port"'"' >>db-driver + fi + fi + + if test x$oracle_service != x; then + if test x$oracle_host_set = xno; then + echo 'conn_str="$conn_str@"' >>db-driver + fi + + echo "--service '$oracle_service'" >>db.options + echo 'conn_str="$conn_str/'"$oracle_service"'"' >>db-driver + fi + + echo 'if test x$[]1 != x; then' >>db-driver + echo " exec $oracle_client -L -S "'$conn_str <$[]1' >>db-driver + echo "else" >>db-driver + echo " exec $oracle_client -L -S "'$conn_str' >>db-driver + echo "fi" >>db-driver + + chmod +x db-driver + ], + [ + oracle_client="$oracle_client" + + oracle_user="$oracle_user" + oracle_user_set="$oracle_user_set" + + oracle_password="$oracle_password" + oracle_password_set="$oracle_password_set" + + oracle_service="$oracle_service" + oracle_service_set="$oracle_service_set" + + oracle_host="$oracle_host" + oracle_host_set="$oracle_host_set" + + oracle_port="$oracle_port" + oracle_port_set="$oracle_port_set" + ]) + +])dnl diff --git a/makefile b/makefile index dc0d58a..bc46d43 100644 --- a/makefile +++ b/makefile @@ -33,7 +33,8 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): data_dist := GPLv2 LICENSE README INSTALL version test.bat \ tester.bat mysql-driver.bat mysql.options sqlite-driver.bat \ -sqlite.options pgsql-driver.bat pgsql.options +sqlite.options pgsql-driver.bat pgsql.options oracle.options \ +oracle-driver.bat $(dist): exec_dist := bootstrap tester.in $(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat $(dist): export version = $(shell cat $(src_root)/version) diff --git a/oracle-driver.bat b/oracle-driver.bat new file mode 100644 index 0000000..83662bf --- /dev/null +++ b/oracle-driver.bat @@ -0,0 +1,43 @@ +@echo off +rem file : oracle-driver.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem oracle-driver.bat sql-file +rem +rem Run the oracle client on the SQL file specified. Adjust the +rem option below to match your Oracle setup. +rem + +setlocal + +set "options=%ORACLE_OPTIONS%" +set "options=%options% odb_test/odb_test" + +set "oracle=%ORACLE_CLIENT%" + +if "_%oracle%_" == "__" set "oracle=sqlplus" + +if "_%1_" == "__" ( + echo no sql file specified + goto usage +) + +%oracle% %options% < %1 + +if errorlevel 1 goto error +goto end + +:usage +echo. +echo usage: oracle-driver.bat sql-file +echo. + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/oracle.options b/oracle.options new file mode 100644 index 0000000..3f4f77f --- /dev/null +++ b/oracle.options @@ -0,0 +1,9 @@ +# Sample Oracle options file used to run the tests. Adjust to +# match your Oracle setup. +# + +--user odb_test +--password odb_test +# --service +# --host +# --port diff --git a/oracle/Makefile.am b/oracle/Makefile.am new file mode 100644 index 0000000..2fefbca --- /dev/null +++ b/oracle/Makefile.am @@ -0,0 +1,7 @@ +# file : oracle/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) diff --git a/oracle/oracle-vc10.sln b/oracle/oracle-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/oracle/oracle-vc10.sln @@ -0,0 +1,15 @@ + +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/oracle/oracle-vc9.sln b/oracle/oracle-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/oracle/oracle-vc9.sln @@ -0,0 +1,15 @@ + +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/oracle/template/Makefile.am b/oracle/template/Makefile.am new file mode 100644 index 0000000..4cb79d0 --- /dev/null +++ b/oracle/template/Makefile.am @@ -0,0 +1,32 @@ +# file : oracle/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/oracle/template/template-vc10.vcxproj b/oracle/template/template-vc10.vcxproj new file mode 100644 index 0000000..fce8b69 --- /dev/null +++ b/oracle/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.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/oracle/template/template-vc10.vcxproj.filters b/oracle/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/oracle/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/oracle/template/template-vc9.vcproj b/oracle/template/template-vc9.vcproj new file mode 100644 index 0000000..acec7e6 --- /dev/null +++ b/oracle/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/oracle/test.bat b/oracle/test.bat new file mode 100644 index 0000000..13680d5 --- /dev/null +++ b/oracle/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : oracle/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 oracle %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/qt/Makefile.am b/qt/Makefile.am index fc38fc6..9c22df3 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -17,4 +17,8 @@ if DATABASE_PGSQL SUBDIRS += pgsql endif +if DATABASE_ORACLE +SUBDIRS += oracle +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/qt/makefile b/qt/makefile index 13a05a0..1345e70 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite pgsql +all_dirs := common mysql sqlite pgsql oracle dirs := common ifeq ($(db_id),mysql) diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am new file mode 100644 index 0000000..dedab0e --- /dev/null +++ b/qt/oracle/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/oracle/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/oracle/qt-oracle-vc10.sln b/qt/oracle/qt-oracle-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/oracle/qt-oracle-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/qt-oracle-vc9.sln b/qt/oracle/qt-oracle-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/oracle/qt-oracle-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am new file mode 100644 index 0000000..00b4afe --- /dev/null +++ b/qt/oracle/template/Makefile.am @@ -0,0 +1,32 @@ +# file : qt/oracle/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/qt/oracle/template/template-vc10.vcxproj b/qt/oracle/template/template-vc10.vcxproj new file mode 100644 index 0000000..d984502 --- /dev/null +++ b/qt/oracle/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.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/qt/oracle/template/template-vc10.vcxproj.filters b/qt/oracle/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/qt/oracle/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/qt/oracle/template/template-vc9.vcproj b/qt/oracle/template/template-vc9.vcproj new file mode 100644 index 0000000..563a440 --- /dev/null +++ b/qt/oracle/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/qt/oracle/test.bat b/qt/oracle/test.bat new file mode 100644 index 0000000..e73cdff --- /dev/null +++ b/qt/oracle/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : qt/oracle/test.bat +rem author : Constantin Michael +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 oracle %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 -- cgit v1.1 From 40ed92d7a5d0d2ea499ce04aca4b6cd6ddca878d Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 25 Nov 2011 15:25:02 +0200 Subject: Corrections to Oracle user configuration script --- m4/oracle.m4 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 836ded5..9e02c72 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -69,7 +69,7 @@ fi AC_MSG_CHECKING([for oracle database password]) AC_ARG_WITH( [oracle-password], - [AC_HELP_STRING([--with-oracle-password=login], [Oracle database password])], + [AC_HELP_STRING([--with-oracle-password=login], [Oracle database password (odb_test by default)])], [case $withval in yes) oracle_password= @@ -87,15 +87,13 @@ AC_ARG_WITH( if test x$oracle_password_set = xyes; then AC_MSG_RESULT(['$oracle_password']) -# Use obd_test as a default password if the user is odb_test and the password -# option was not specified. -# elif test x$oracle_user = xodb_test; then oracle_password=odb_test oracle_password_set=yes AC_MSG_RESULT(['$oracle_password']) -else +elif test x$oracle_user != x/; then AC_MSG_RESULT([none]) + AC_MSG_ERROR([password not specfied; Oracle requires a password]) fi # Service name. @@ -103,7 +101,7 @@ fi AC_MSG_CHECKING([for oracle service name]) AC_ARG_WITH( [oracle-service], - [AC_HELP_STRING([--with-oracle-service=name], [Oracle service name (default service if left empty). Note that all data in the database associated with the test user on this service WILL BE LOST!])], + [AC_HELP_STRING([--with-oracle-service=name], [Oracle service name (default service if left empty). Note that all data associated with this user on this service WILL BE LOST!])], [case $withval in yes) oracle_service= @@ -160,7 +158,7 @@ AC_ARG_WITH( [AC_HELP_STRING([--with-oracle-port=port], [Oracle database port (standard Oracle port by default)])], [case $withval in yes) - oracle_port= + oracle_port=0 oracle_port_set=yes ;; no) @@ -216,7 +214,7 @@ AC_CONFIG_COMMANDS([oracle.options], fi echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $oracle_client -L -S "'$conn_str <$[]1' >>db-driver + echo " exec $oracle_client -L -S "'$conn_str @$[]1' >>db-driver echo "else" >>db-driver echo " exec $oracle_client -L -S "'$conn_str' >>db-driver echo "fi" >>db-driver -- cgit v1.1 From 25d1585f1ec1886dc5afb5d754f6b7269ff7d994 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 28 Nov 2011 12:19:38 +0200 Subject: Corrections to Oracle user configuration script --- m4/oracle.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 9e02c72..bf192e4 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -72,7 +72,7 @@ AC_ARG_WITH( [AC_HELP_STRING([--with-oracle-password=login], [Oracle database password (odb_test by default)])], [case $withval in yes) - oracle_password= + oracle_password=odb_test oracle_password_set=yes ;; no) @@ -131,7 +131,7 @@ AC_ARG_WITH( [AC_HELP_STRING([--with-oracle-host=host], [Oracle database host (localhost by default)])], [case $withval in yes) - oracle_host= + oracle_host=localhost oracle_host_set=yes ;; no) @@ -147,7 +147,7 @@ AC_ARG_WITH( if test x$oracle_host_set = xyes; then AC_MSG_RESULT(['$oracle_host']) else - AC_MSG_RESULT([default]) + AC_MSG_RESULT([localhost]) fi # Port. @@ -158,7 +158,7 @@ AC_ARG_WITH( [AC_HELP_STRING([--with-oracle-port=port], [Oracle database port (standard Oracle port by default)])], [case $withval in yes) - oracle_port=0 + oracle_port=1521 oracle_port_set=yes ;; no) -- cgit v1.1 From 00a3409902646f8c8576ec06eb26243c9cf629f1 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Mon, 28 Nov 2011 12:19:52 +0200 Subject: Corrections to Oracle test scripts for Windows --- oracle-driver.bat | 5 +++-- oracle.options | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/oracle-driver.bat b/oracle-driver.bat index 83662bf..7f531ed 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -13,8 +13,9 @@ rem setlocal -set "options=%ORACLE_OPTIONS%" +set "options=%ORACLE_OPTIONS% -L -S" set "options=%options% odb_test/odb_test" +rem set "options=%options% odb_test/odb_test@//192.168.0.5:1521/xe" set "oracle=%ORACLE_CLIENT%" @@ -25,7 +26,7 @@ if "_%1_" == "__" ( goto usage ) -%oracle% %options% < %1 +%oracle% %options% @%1 if errorlevel 1 goto error goto end diff --git a/oracle.options b/oracle.options index 3f4f77f..f01413e 100644 --- a/oracle.options +++ b/oracle.options @@ -4,6 +4,6 @@ --user odb_test --password odb_test -# --service # --host # --port +# --service -- cgit v1.1 From 140476391c2dd2982a0b0560e5960de8b7231fb1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Nov 2011 16:15:03 +0200 Subject: Clear shell variables before appending --- build/mysql/mysql | 3 +++ build/oracle/oracle | 9 ++++++++- build/pgsql/pgsql | 3 +++ m4/mysql.m4 | 2 ++ m4/oracle.m4 | 2 ++ m4/pgsql.m4 | 2 ++ 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/build/mysql/mysql b/build/mysql/mysql index a6800a0..e91da92 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -9,6 +9,9 @@ # MySQL driver wrapper. # +opt= +driver= + while [ $# -gt 0 ]; do case $1 in --driver) diff --git a/build/oracle/oracle b/build/oracle/oracle index 4d518fe..e3030d6 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -9,6 +9,13 @@ # Oracle driver wrapper. # +driver= +user= +passwd= +service= +host= +port= + while [ $# -gt 0 ]; do case $1 in --driver) @@ -65,7 +72,7 @@ elif [ -n "$service" ]; then conn="$conn@$service" fi -opt="-L $opt" +opt="-L" if [ -n "$1" ]; then opt="-S $opt" diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index c1c2482..0f92871 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -9,6 +9,9 @@ # PostgreSQL driver wrapper. # +driver= +opt= + while [ $# -gt 0 ]; do case $1 in --driver) diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 102f150..a93efe6 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -207,6 +207,8 @@ AC_CONFIG_COMMANDS([mysql.options], rm -f db.options echo '#! /bin/sh' >db-driver + echo 'opt=' >>db-driver + if test x$mysql_user_set = xyes; then echo "--user '$mysql_user'" >>db.options echo 'opt="$opt --user='"$mysql_user"'"' >>db-driver diff --git a/m4/oracle.m4 b/m4/oracle.m4 index bf192e4..24e2724 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -184,6 +184,8 @@ AC_CONFIG_COMMANDS([oracle.options], rm -f db.options echo '#! /bin/sh' >db-driver + echo 'conn_str=' >>db-driver + if test x$oracle_user_set = xyes; then echo "--user '$oracle_user'" >>db.options echo 'conn_str="'"$oracle_user"'"' >>db-driver diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index a75a95e..b38bf34 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -153,6 +153,8 @@ AC_CONFIG_COMMANDS([pgsql.options], rm -f db.options echo '#! /bin/sh' >db-driver + echo 'opt=' >>db-driver + if test x$pgsql_user_set = xyes; then echo "--username '$pgsql_user'" >>db.options echo 'opt="$opt --username='"$pgsql_user"'"' >>db-driver -- cgit v1.1 From 1b719c832cd664884183af698b1f2d6075579cd2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 Nov 2011 12:18:10 +0200 Subject: Use biggest int type to avoid potential warnings --- common/types/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/types/test.hxx b/common/types/test.hxx index 858f403..a36b5d5 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -51,7 +51,7 @@ struct num_wrap struct object3 { #pragma db id type("INTEGER") - num_wrap num_; + num_wrap num_; // Use long long to avoid warnings. }; #endif // TEST_HXX -- cgit v1.1 From 26315ea5ab491aa8ab83de7674c308c871b8f79b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Nov 2011 08:33:25 +0200 Subject: Cosmetic automake changes --- configure.ac | 16 ++++++++-------- m4/database.m4 | 2 +- m4/mysql.m4 | 14 +++++++------- m4/odb.m4 | 2 +- m4/oracle.m4 | 12 ++++++------ m4/pgsql.m4 | 10 +++++----- m4/sqlite.m4 | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/configure.ac b/configure.ac index 532140d..a44248d 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,10 @@ LT_INIT([win32-dll]) AC_CANONICAL_HOST +# Check for diff. +# +DIFF_TOOL + # Check for C++ compiler and use it to compile the tests. # AC_PROG_CXX @@ -30,6 +34,10 @@ THREADS AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) +# Check for the ODB compiler. +# +ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) + # Check for the ODB libs. # LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) @@ -87,14 +95,6 @@ case $database in ;; esac -# Check for the ODB compiler. -# -ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) - -# Check for diff. -# -DIFF_TOOL - # Define LIBCOMMON_STATIC_LIB if we are build static library on certain # platforms. # diff --git a/m4/database.m4 b/m4/database.m4 index 5f5a03e..a2d72eb 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -12,7 +12,7 @@ AC_MSG_CHECKING([for database to use]) AC_ARG_WITH( [database], - [AC_HELP_STRING([--with-database=db], + [AC_HELP_STRING([--with-database=DB], [database to use for tests; valid values are: 'mysql', 'sqlite', 'pgsql', and 'oracle'])], [case $withval in no | yes) diff --git a/m4/mysql.m4 b/m4/mysql.m4 index a93efe6..c6bac0d 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -12,7 +12,7 @@ AC_DEFUN([MYSQL], [ AC_MSG_CHECKING([for mysql client program]) AC_ARG_WITH( [mysql-client], - [AC_HELP_STRING([--with-mysql-client=path], [MySQL client program path (mysql by default)])], + [AC_HELP_STRING([--with-mysql-client=PATH], [MySQL client program path (mysql by default)])], [case $withval in yes) mysql_client=mysql @@ -41,7 +41,7 @@ fi AC_MSG_CHECKING([for mysql database user]) AC_ARG_WITH( [mysql-user], - [AC_HELP_STRING([--with-mysql-user=login], [MySQL database user (odb_test by default)])], + [AC_HELP_STRING([--with-mysql-user=NAME], [MySQL database user (odb_test by default)])], [case $withval in yes) mysql_user=odb_test @@ -69,7 +69,7 @@ fi AC_MSG_CHECKING([for mysql database password]) AC_ARG_WITH( [mysql-password], - [AC_HELP_STRING([--with-mysql-password=login], [MySQL database password (no password by default)])], + [AC_HELP_STRING([--with-mysql-password=PASS], [MySQL database password (no password by default)])], [case $withval in yes) mysql_password= @@ -96,7 +96,7 @@ fi AC_MSG_CHECKING([for mysql database name]) AC_ARG_WITH( [mysql-db], - [AC_HELP_STRING([--with-mysql-db=name], [MySQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], + [AC_HELP_STRING([--with-mysql-db=NAME], [MySQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], [case $withval in yes) mysql_db=odb_test @@ -124,7 +124,7 @@ fi AC_MSG_CHECKING([for mysql database host]) AC_ARG_WITH( [mysql-host], - [AC_HELP_STRING([--with-mysql-host=host], [MySQL database host (localhost by default)])], + [AC_HELP_STRING([--with-mysql-host=HOST], [MySQL database host (localhost by default)])], [case $withval in yes) mysql_host=localhost @@ -151,7 +151,7 @@ fi AC_MSG_CHECKING([for mysql database port]) AC_ARG_WITH( [mysql-port], - [AC_HELP_STRING([--with-mysql-port=port], [MySQL database port (standard MySQL port by default)])], + [AC_HELP_STRING([--with-mysql-port=PORT], [MySQL database port (standard MySQL port by default)])], [case $withval in yes) mysql_port=0 @@ -178,7 +178,7 @@ fi AC_MSG_CHECKING([for mysql database socket]) AC_ARG_WITH( [mysql-socket], - [AC_HELP_STRING([--with-mysql-socket=socket], [MySQL database socket (standard MySQL socket by default)])], + [AC_HELP_STRING([--with-mysql-socket=SOCKET], [MySQL database socket (standard MySQL socket by default)])], [case $withval in yes) mysql_socket= diff --git a/m4/odb.m4 b/m4/odb.m4 index a9f03c0..e873645 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -14,7 +14,7 @@ AC_ARG_VAR([ODBCPPFLAGS],[ODB-specific C++ preprocessor flags]) AC_ARG_WITH( [odb], - [AC_HELP_STRING([--with-odb=DIR],[location of odb build directory])], + [AC_HELP_STRING([--with-odb=DIR],[location of odb compiler build directory])], [odb_dir=${withval}], [odb_dir=]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 24e2724..80e3600 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -12,7 +12,7 @@ AC_DEFUN([ORACLE], [ AC_MSG_CHECKING([for oracle client program]) AC_ARG_WITH( [oracle-client], - [AC_HELP_STRING([--with-oracle-client=path], [Oracle client program path (sqlplus by default)])], + [AC_HELP_STRING([--with-oracle-client=PATH], [Oracle client program path (sqlplus by default)])], [case $withval in yes) oracle_client=sqlplus @@ -41,7 +41,7 @@ fi AC_MSG_CHECKING([for oracle database user]) AC_ARG_WITH( [oracle-user], - [AC_HELP_STRING([--with-oracle-user=login], [Oracle database user (odb_test by default)])], + [AC_HELP_STRING([--with-oracle-user=NAME], [Oracle database user (odb_test by default)])], [case $withval in yes) oracle_user=odb_test @@ -69,7 +69,7 @@ fi AC_MSG_CHECKING([for oracle database password]) AC_ARG_WITH( [oracle-password], - [AC_HELP_STRING([--with-oracle-password=login], [Oracle database password (odb_test by default)])], + [AC_HELP_STRING([--with-oracle-password=PASS], [Oracle database password (odb_test by default)])], [case $withval in yes) oracle_password=odb_test @@ -101,7 +101,7 @@ fi AC_MSG_CHECKING([for oracle service name]) AC_ARG_WITH( [oracle-service], - [AC_HELP_STRING([--with-oracle-service=name], [Oracle service name (default service if left empty). Note that all data associated with this user on this service WILL BE LOST!])], + [AC_HELP_STRING([--with-oracle-service=NAME], [Oracle service name (default service if left empty). Note that all data associated with this user on this service WILL BE LOST!])], [case $withval in yes) oracle_service= @@ -128,7 +128,7 @@ fi AC_MSG_CHECKING([for oracle database host]) AC_ARG_WITH( [oracle-host], - [AC_HELP_STRING([--with-oracle-host=host], [Oracle database host (localhost by default)])], + [AC_HELP_STRING([--with-oracle-host=HOST], [Oracle database host (localhost by default)])], [case $withval in yes) oracle_host=localhost @@ -155,7 +155,7 @@ fi AC_MSG_CHECKING([for oracle database port]) AC_ARG_WITH( [oracle-port], - [AC_HELP_STRING([--with-oracle-port=port], [Oracle database port (standard Oracle port by default)])], + [AC_HELP_STRING([--with-oracle-port=PORT], [Oracle database port (standard Oracle port by default)])], [case $withval in yes) oracle_port=1521 diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index b38bf34..f894891 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -12,7 +12,7 @@ AC_DEFUN([PGSQL], [ AC_MSG_CHECKING([for pgsql client program]) AC_ARG_WITH( [pgsql-client], - [AC_HELP_STRING([--with-pgsql-client=path], [PostgreSQL client program path (psql by default)])], + [AC_HELP_STRING([--with-pgsql-client=PATH], [PostgreSQL client program path (psql by default)])], [case $withval in yes) pgsql_client=psql @@ -41,7 +41,7 @@ fi AC_MSG_CHECKING([for pgsql database user]) AC_ARG_WITH( [pgsql-user], - [AC_HELP_STRING([--with-pgsql-user=login], [PostgreSQL database user (odb_test by default). The user must be able to login without specifying a password.])], + [AC_HELP_STRING([--with-pgsql-user=NAME], [PostgreSQL database user (odb_test by default). The user must be able to login without specifying a password.])], [case $withval in yes) pgsql_user=odb_test @@ -69,7 +69,7 @@ fi AC_MSG_CHECKING([for pgsql database name]) AC_ARG_WITH( [pgsql-db], - [AC_HELP_STRING([--with-pgsql-db=name], [PostgreSQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], + [AC_HELP_STRING([--with-pgsql-db=NAME], [PostgreSQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], [case $withval in yes) pgsql_db=odb_test @@ -97,7 +97,7 @@ fi AC_MSG_CHECKING([for pgsql database host]) AC_ARG_WITH( [pgsql-host], - [AC_HELP_STRING([--with-pgsql-host=host], [PostgreSQL database host (localhost by default)])], + [AC_HELP_STRING([--with-pgsql-host=HOST], [PostgreSQL database host (localhost by default)])], [case $withval in yes) pgsql_host= @@ -124,7 +124,7 @@ fi AC_MSG_CHECKING([for pgsql database port]) AC_ARG_WITH( [pgsql-port], - [AC_HELP_STRING([--with-pgsql-port=port], [PostgreSQL database port (standard PostgreSQL port by default)])], + [AC_HELP_STRING([--with-pgsql-port=PORT], [PostgreSQL database port (standard PostgreSQL port by default)])], [case $withval in yes) pgsql_port=0 diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index de5503e..0a54bf6 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -12,7 +12,7 @@ AC_DEFUN([SQLITE], [ AC_MSG_CHECKING([for sqlite database file]) AC_ARG_WITH( [sqlite-db], - [AC_HELP_STRING([--with-sqlite-db=file], [SQLite database file (odb_test.db by default). Note that all data in this database WILL BE LOST!])], + [AC_HELP_STRING([--with-sqlite-db=FILE], [SQLite database file (odb_test.db by default). Note that all data in this database WILL BE LOST!])], [case $withval in yes) sqlite_db=odb_test.db -- cgit v1.1 From b5ddc0e5b2ccd7c49ad752f8b8adbf91a0418f1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Nov 2011 09:21:00 +0200 Subject: Add test for fixed-point numbers --- oracle/types/driver.cxx | 2 ++ oracle/types/test.hxx | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index fa056ff..b23a757 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -40,6 +40,8 @@ main (int argc, char* argv[]) o.float_ = 1.123F; o.double_ = 1.123; + o.num_float_ = 1.123F; + o.num_double_ = 1.123; o.binary_float_ = 1.123F; o.binary_double_ = 1.123; diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index b496114..3e59594 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -136,6 +136,12 @@ struct object #pragma db type ("FLOAT(53)") double double_; + #pragma db type ("NUMBER(7,3)") + float num_float_; + + #pragma db type ("NUMBER(15,5)") + double num_double_; + #pragma db type ("BINARY_FLOAT") float binary_float_; @@ -205,6 +211,8 @@ struct object ulong_long_ == y.ulong_long_ && float_ == y.float_ && double_ == y.double_ && + num_float_ == y.num_float_ && + num_double_ == y.num_double_ && binary_float_ == y.binary_float_ && binary_double_ == y.binary_double_ && date_ == y.date_ && -- cgit v1.1 From 44cb5422ce125f356b9f6c87f4ef372d9d693fb1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Nov 2011 12:25:40 +0200 Subject: Use VARCHAR2 instead of VARCHAR in Oracle test --- oracle/types/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 3e59594..0e48745 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -197,7 +197,7 @@ struct object // Test NULL value. // - #pragma db type ("VARCHAR(32)") null + #pragma db type ("VARCHAR2(32)") null string_ptr null_; bool -- cgit v1.1 From 72ad2f40da8268326bcbf4fc0d230860a8b05581 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Wed, 30 Nov 2011 16:05:52 +0200 Subject: Add tests for QString NCHAR and NVARCHAR2 mapping --- qt/oracle/basic/driver.cxx | 16 ++++++++++++---- qt/oracle/basic/test.hxx | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 1afb966..908f2b4 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -29,13 +29,21 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - string long_str (20000, 'l'); + string short_str (13, 's'); + string medium_str (150, 'm'); + string long_str (20000, 'v'); + string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"); object o; - o.varchar = "John Doe"; - o.clob = QString::fromStdString (string (150, 'c')); + o.char_= QString::fromStdString (short_str); + o.varchar2 = QString::fromStdString (medium_str); + o.clob = QString::fromStdString (long_str); + + o.nchar= QString::fromStdString (unicode_str); + o.nvarchar2 = QString::fromStdString (unicode_str); o.nclob = QString::fromStdString (long_str); + o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); o.blob = QByteArray (long_str.c_str (), static_cast (long_str.size ())); @@ -52,7 +60,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.varchar); + object* ol = db->load (o.varchar2); t.commit (); assert (*ol == o); diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 979e11f..6a3e788 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -16,7 +16,10 @@ struct object operator== (const object& x) const { return - varchar == x.varchar && + varchar2 == x.varchar2 && + char_ == x.char_ && + nchar == x.nchar && + nvarchar2 == x.nvarchar2 && clob == x.clob && nclob == x.nclob && blob == x.blob && @@ -24,7 +27,16 @@ struct object } #pragma db id - QString varchar; + QString varchar2; + + #pragma db type ("CHAR(13)") + QString char_; + + #pragma db type ("NCHAR(13)") + QString nchar; + + #pragma db type ("NVARCHAR2(512)") + QString nvarchar2; #pragma db type ("CLOB") QString clob; -- cgit v1.1 From 2a95cabe38f24eddd2739dcb5ef3657e4c165082 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 08:57:15 +0200 Subject: Cosmetic changes --- INSTALL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index 2f98f9c..2828c4f 100644 --- a/INSTALL +++ b/INSTALL @@ -81,8 +81,8 @@ cannot be discovered automatically. For each value the configure script has a set of options in the form --with--* that allow you to specify various database system parameters, such as the login name, password, and database name, -that should be used when running the tests. Run configure with ---help to see the available options for your database. +that should be used when running the tests. Run configure with --help +to see the available options for your database. As another example, the following configure command uses the specified C++ compiler and compiles with optimization and without debug information: @@ -158,7 +158,7 @@ Before you can run test.bat, you may need to adjust the database system parameters, such as the login name, password, and database name, that should be used when running the tests. To do this, edit the .options and -driver.bat files located in the -odb-tests\ directory. Once this is, done you can run the tests by +odb-tests\ directory. Once this is done, you can run the tests by executing the following command from the command prompt: test.bat -- cgit v1.1 From 08613d9556bb2bcb5d1a6e123d11a8f3ffec22dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 12:40:01 +0200 Subject: Make sure PostgreSQL psql driver stops at first error and exits with error code --- build/pgsql/pgsql | 2 +- m4/pgsql.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 0f92871..356079a 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -49,7 +49,7 @@ opt="--quiet $opt" export PGOPTIONS=--client-min-messages=warning if [ -n "$1" ]; then - exec $driver $opt <$1 + exec $driver $opt --set ON_ERROR_STOP=1 -f $1 else exec $driver $opt fi diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index f894891..e4f6d71 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -180,7 +180,7 @@ AC_CONFIG_COMMANDS([pgsql.options], echo 'export PGOPTIONS' >>db-driver echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $pgsql_client "'$opt <$[]1' >>db-driver + echo " exec $pgsql_client "'$opt --set ON_ERROR_STOP=1 -f $[]1' >>db-driver echo "else" >>db-driver echo " exec $pgsql_client "'$opt' >>db-driver echo "fi" >>db-driver -- cgit v1.1 From 70903bb5c90bf27899fd68596a857aa67780af14 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 16:05:42 +0200 Subject: Correct license information --- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index 1ad67cf..a4a8c99 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,7 +1,7 @@ # file : build/import/libodb-oracle/configuration-rules.make # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. $(call message,,$(scf_root)/import/libodb-oracle/configure $@) diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index adee0be..9934d03 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -3,7 +3,7 @@ # file : build/import/libodb-oracle/configure # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file +# license : ODB NCUEL; see accompanying LICENSE file # $1 - out file -- cgit v1.1 From 178d0a28bd7d69799828d1640a02731cb42f1b4d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 16:12:47 +0200 Subject: Cosmetic changes --- boost/makefile | 4 ++-- makefile | 8 ++++---- qt/makefile | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boost/makefile b/boost/makefile index 27a5fb8..dcc5d32 100644 --- a/boost/makefile +++ b/boost/makefile @@ -10,12 +10,12 @@ dirs := common ifeq ($(db_id),mysql) dirs += mysql -else ifeq ($(db_id),oracle) -dirs += oracle else ifeq ($(db_id),sqlite) dirs += sqlite else ifeq ($(db_id),pgsql) dirs += pgsql +else ifeq ($(db_id),oracle) +dirs += oracle endif default := $(out_base)/ diff --git a/makefile b/makefile index bc46d43..e7184f9 100644 --- a/makefile +++ b/makefile @@ -12,10 +12,6 @@ ifeq ($(db_id),mysql) dirs += mysql endif -ifeq ($(db_id),oracle) -dirs += oracle -endif - ifeq ($(db_id),sqlite) dirs += sqlite endif @@ -24,6 +20,10 @@ ifeq ($(db_id),pgsql) dirs += pgsql endif +ifeq ($(db_id),oracle) +dirs += oracle +endif + default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test diff --git a/qt/makefile b/qt/makefile index 1345e70..e0ec91d 100644 --- a/qt/makefile +++ b/qt/makefile @@ -10,12 +10,12 @@ dirs := common ifeq ($(db_id),mysql) dirs += mysql -else ifeq ($(db_id),oracle) -dirs += oracle else ifeq ($(db_id),sqlite) dirs += sqlite else ifeq ($(db_id),pgsql) dirs += pgsql +else ifeq ($(db_id),oracle) +dirs += oracle endif default := $(out_base)/ -- cgit v1.1 From 176f05921d638aeb6e546126f11fcd8a13f0cb71 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 18:02:51 +0200 Subject: Instantiate QCoreApplication in Qt tests/examples It performs Qt initialization/finalization and without it bad things will happen (like deleting TLS keys that don't belong to Qt). --- qt/common/containers/driver.cxx | 4 ++++ qt/common/smart-ptr/driver.cxx | 3 +++ qt/common/template/driver.cxx | 4 ++++ qt/mysql/basic/driver.cxx | 4 ++++ qt/mysql/date-time/driver.cxx | 3 +++ qt/mysql/template/driver.cxx | 4 ++++ qt/oracle/basic/driver.cxx | 4 ++++ qt/oracle/date-time/driver.cxx | 3 +++ qt/oracle/template/driver.cxx | 4 ++++ qt/pgsql/basic/driver.cxx | 4 ++++ qt/pgsql/date-time/driver.cxx | 3 +++ qt/pgsql/template/driver.cxx | 4 ++++ qt/sqlite/basic/driver.cxx | 4 ++++ qt/sqlite/date-time/driver.cxx | 3 +++ qt/sqlite/template/driver.cxx | 4 ++++ 15 files changed, 55 insertions(+) diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx index 6010571..e285448 100644 --- a/qt/common/containers/driver.cxx +++ b/qt/common/containers/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 49e2ae1..b149fee 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -32,6 +33,8 @@ template class QLazyWeakPointer; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 7822aab..ca37c05 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index ed3165e..d2eebd6 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index a6637bb..34eea5d 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ test_out_of_range_value (object&, database&); int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index c94096b..bd12e22 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 908f2b4..9b37d67 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -25,6 +27,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 82dd2fe..2d9b46d 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -26,6 +27,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index 88e9e74..c43e4f2 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 1c89430..a2384f6 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index e81fcf3..fde15a6 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ test_out_of_range_value (object&, database&); int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index a478c35..aae2509 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index f24053a..c925f65 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index a095aa5..0ee5831 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ test_out_of_range_value (object&, database&); int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index cce886a..c02cf06 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,8 @@ using namespace odb::core; int main (int argc, char* argv[]) { + QCoreApplication app (argc, argv); + try { auto_ptr db (create_database (argc, argv)); -- cgit v1.1 From f71283fdc79fdc810ca1aa6cfbf48af2e88ad8f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2011 09:10:57 +0200 Subject: Update Oracle runtime license --- build/import/libodb-oracle/LICENSE | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build/import/libodb-oracle/LICENSE b/build/import/libodb-oracle/LICENSE index ed9c55c..ec74f50 100644 --- a/build/import/libodb-oracle/LICENSE +++ b/build/import/libodb-oracle/LICENSE @@ -1,12 +1,13 @@ -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. +Permission is granted to use, copy, modify, and distribute this +program under the ODB Non-Commercial Use and Evaluation License +(NCUEL) as published by Code Synthesis Tools CC. 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. +ODB Non-Commercial Use and Evaluation 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 +You should have received a copy of the ODB Non-Commercial Use and +Evaluation License (normally located in the NCUEL file that is +accompanying the distribution); if not, contact Code Synthesis +Tools CC at info@codesynthesis.com. -- cgit v1.1 From 8bba70a624cc79f6c0a8b29009f9b8d05e906b2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2011 09:30:32 +0200 Subject: Add link to licensing overview page --- LICENSE | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LICENSE b/LICENSE index ed9c55c..612c66c 100644 --- a/LICENSE +++ b/LICENSE @@ -2,6 +2,12 @@ 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. +For more information on ODB licensing as well as for answers to +some of the common licensing questions, visit the ODB License +page: + +http://www.codesynthesis.com/products/odb/license.xhtml + 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 -- cgit v1.1 From f333016241010d32224e671006dfcd47c9e4be9e Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Sun, 4 Dec 2011 23:33:23 +0200 Subject: Test updated PostgreSQL date-time mappings which handle microsecond resolutions --- boost/pgsql/date-time/driver.cxx | 22 ++++----- qt/pgsql/date-time/driver.cxx | 103 ++++++++++++++++++--------------------- 2 files changed, 56 insertions(+), 69 deletions(-) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index d261add..6827bd6 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -50,24 +50,20 @@ main (int argc, char* argv[]) o.dates.push_back (date (max_date_time)); o.dates.push_back (date (min_date_time)); - o.times.push_back (second_clock::local_time ()); + o.times.push_back (microsec_clock::local_time ()); o.times.push_back (not_a_date_time); o.times.push_back (pos_infin); o.times.push_back (neg_infin); - - // Boost seems to handle 64 bit std::time_t incorrectly. - // Insert 32 bit minimum and maximum UNIX time values for now. - // - // o.times.push_back (date (max_date_time)); - // o.times.push_back (date (min_date_time)); - // - - o.times.push_back (ptime (date (1901, 12, 14), time_duration (0, 0, 0))); - o.times.push_back (ptime (date (2038, 1, 19), time_duration (3, 14, 7))); + o.times.push_back (ptime (date (max_date_time), + time_duration (16, 23, 0, 123456))); + o.times.push_back (ptime (date (min_date_time), + time_duration (3, 14, 7, 123456))); + o.times.push_back (ptime (date (1969, 12, 31), // Before PG epoch. + time_duration (23, 59, 59, 123000))); o.durations.push_back (time_duration (0, 0, 0)); - o.durations.push_back (time_duration (12, 3, 4)); - o.durations.push_back (time_duration (23, 59, 59)); + o.durations.push_back (time_duration (12, 3, 4, 123456)); + o.durations.push_back (time_duration (23, 59, 59, 123456)); o.durations.push_back (not_a_date_time); { diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index fde15a6..c1f41f0 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -38,59 +38,68 @@ main (int argc, char* argv[]) // Check persistence of null values. // - object o1; { - transaction t (db->begin ()); - db->persist (o1); - t.commit (); - } + object o; - { - transaction t (db->begin ()); - auto_ptr ol1 (db->load (o1.id)); - t.commit (); + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } - assert (ol1->is_null ()); - } + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); - QDateTime ct (QDateTime::currentDateTime ()); - QDateTime ct_no_ms = QDateTime (QDate (ct.date ().year (), - ct.date ().month (), - ct.date ().day ()), - QTime (ct.time ().hour (), - ct.time ().minute (), - ct.time ().second ())); + assert (ol->is_null ()); + } + } // Check persistence of valid dates and times. // - object o2; - { - o2.date = ct.date (); - o2.time = ct_no_ms.time (); - o2.date_time = ct_no_ms; - - transaction t (db->begin ()); - db->persist (o2); - t.commit (); - } - { - transaction t (db->begin ()); - auto_ptr ol2 (db->load (o2.id)); - t.commit (); + QDateTime ct (QDateTime::currentDateTime ()); - assert (*ol2 == o2); + object o; + o.date = ct.date (); + o.time = ct.time (); + o.date_time = ct; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } } - // Test out of range values for QDateTime traits. + // Test a QDateTime value before PG epoch. // { object o; - o.date_time = QDateTime (QDate (1969, 12, 31), - QTime (23, 59, 59), - Qt::UTC); + o.date_time = QDateTime (QDate (1969, 12, 31), QTime (23, 59, 59, 123)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); - assert (test_out_of_range_value (o, *db)); + assert (*ol == o); + } } } catch (const odb::exception& e) @@ -99,21 +108,3 @@ main (int argc, char* argv[]) return 1; } } - -bool -test_out_of_range_value (object& x, database& db) -{ - try - { - transaction t (db.begin ()); - db.persist (x); - t.rollback (); - - return false; - } - catch (const odb::qt::date_time::value_out_of_range&) - { - } - - return true; -} -- cgit v1.1 From 5535c87bf437f6f6acae0e52b0fe6cd5204df5a7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2011 12:02:19 +0200 Subject: Bump version to 1.7.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 38a3807..bd8bf88 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.7.0.a1 +1.7.0 -- cgit v1.1 From 7c517014fe1e1b0350b8a1580f6a016fb556c1a6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 6 Dec 2011 13:43:21 +0200 Subject: Override second version of tracer::execute() to suppress Sun CC warning --- common/transaction/driver.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx index d868782..00aff29 100644 --- a/common/transaction/driver.cxx +++ b/common/transaction/driver.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,14 @@ struct transaction_tracer: odb::tracer else if (str == "ROLLBACK") cout << "rollback transaction" << endl; } + + // Override the other version to get rid of a Sun CC warning. + // + virtual void + execute (connection& c, const statement& s) + { + execute (c, s.text ()); + } }; int -- cgit v1.1 From 16a4099d36ca1cdc33cf6e2b99edce796595341f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Jan 2012 17:27:40 +0200 Subject: Add support for defining composite value type as class template instantiations --- common/composite/driver.cxx | 37 +++++++++++++++++++++++++++ common/composite/makefile | 2 +- common/composite/test.hxx | 62 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 606f367..a3825e1 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -122,6 +122,43 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test composite class template instantiation. + // + { + object o (1); + + o.comp_.num = 123; + o.comp_.str = "abc"; + o.comp_.vec.push_back (int_str_pair (123, "abc")); + o.comp_.vec.push_back (int_str_pair (234, "bcd")); + o.comp_.vec.push_back (int_str_pair (345, "cde")); + + o.pair_.first = 123; + o.pair_.second = "abc"; + + o.vec_.push_back (int_str_pair (123, "abc")); + o.vec_.push_back (int_str_pair (234, "bcd")); + o.vec_.push_back (int_str_pair (345, "cde")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } } catch (const odb::exception& e) { diff --git a/common/composite/makefile b/common/composite/makefile index 1a4ceb7..58fa6eb 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_composite_ +--generate-query --table-prefix t_comp_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 120476a..d846c9c 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -7,6 +7,8 @@ #define TEST_HXX #include +#include +#include // std::pair #include @@ -68,7 +70,7 @@ struct person }; inline bool -operator== (person const& x, person const& y) +operator== (const person& x, const person& y) { return x.id_ == y.id_ && x.name_.first == y.name_.first&& @@ -82,4 +84,62 @@ operator== (person const& x, person const& y) x.age_ == y.age_; } +// Test composite class template instantiation. +// +template +struct comp +{ + I num; + S str; + std::vector > vec; +}; + +template +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str && x.vec == y.vec; +} + +typedef std::pair int_str_pair; +#pragma db value(int_str_pair) + +// Make sure we use the name that was specified in the pragma. +// +#ifdef ODB_COMPILER +typedef comp int_str_comp1; +#endif + +typedef comp int_str_comp; +#pragma db value(int_str_comp) + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + comp comp_; + std::pair pair_; + std::vector vec_; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return x.id_ == y.id_ && + x.comp_ == y.comp_ && + x.pair_ == y.pair_ && + x.vec_ == y.vec_; +} + #endif // TEST_HXX -- cgit v1.1 From 04201d013c2a43d27987122e0118236d74154d77 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Nov 2011 16:49:03 +0200 Subject: Add initial support for SQL Server test infrastructure --- build/bootstrap.make | 2 +- build/configure | 3 +- build/import/libodb-mssql/LICENSE | 12 +++++ build/import/libodb-mssql/configuration-rules.make | 15 ++++++ build/import/libodb-mssql/configure | 55 ++++++++++++++++++++++ build/import/libodb-mssql/stub.make | 30 ++++++++++++ build/mssql/configure | 12 +++++ libcommon/common/common.cxx | 13 +++++ libcommon/common/concrete.hxx | 7 +++ libcommon/common/makefile | 3 ++ 10 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 build/import/libodb-mssql/LICENSE create mode 100644 build/import/libodb-mssql/configuration-rules.make create mode 100755 build/import/libodb-mssql/configure create mode 100644 build/import/libodb-mssql/stub.make create mode 100755 build/mssql/configure diff --git a/build/bootstrap.make b/build/bootstrap.make index f59e809..d3da6dd 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -62,7 +62,7 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql sqlite pgsql oracle +databases := mysql sqlite pgsql oracle mssql $(dist): databases := $(databases) # $1 project template without the -vcN.vc[x]proj suffix. diff --git a/build/configure b/build/configure index 9aee64a..c4fb620 100755 --- a/build/configure +++ b/build/configure @@ -26,9 +26,10 @@ $echo "(1) MySQL" $echo "(2) SQLite" $echo "(3) PostgreSQL" $echo "(4) Oracle" +$echo "(5) Microsoft SQL Server" $echo -db_id=`read_option "mysql sqlite pgsql oracle"` +db_id=`read_option "mysql sqlite pgsql oracle mssql"` echo "db_id := $db_id" >$1 diff --git a/build/import/libodb-mssql/LICENSE b/build/import/libodb-mssql/LICENSE new file mode 100644 index 0000000..ed9c55c --- /dev/null +++ b/build/import/libodb-mssql/LICENSE @@ -0,0 +1,12 @@ +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-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make new file mode 100644 index 0000000..6c74f64 --- /dev/null +++ b/build/import/libodb-mssql/configuration-rules.make @@ -0,0 +1,15 @@ +# file : build/import/libodb-mssql/configuration-rules.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +$(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. + $(call message,,$(scf_root)/import/libodb-mssql/configure $@) + +ifndef %foreign% + +$(dcf_root)/.disfigure:: + $(call message,rm $(dcf_root)/import/libodb-mssql/configuration-dynamic.make,\ +rm -f $(dcf_root)/import/libodb-mssql/configuration-dynamic.make) + +endif diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure new file mode 100755 index 0000000..dabc42a --- /dev/null +++ b/build/import/libodb-mssql/configure @@ -0,0 +1,55 @@ +#! /usr/bin/env bash + +# file : build/import/libodb-mssql/configure +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; 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-mssql' for '$project_name'." +$echo + +$echo +$echo "Would you like to configure dependency on the installed version" +$echo "of 'libodb-mssql' 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-mssql'." +$echo + +src_root=`read_path --directory --exist` + +$echo +$echo "Please enter the out_root for 'libodb-mssql'." +$echo + +out_root=`read_path --directory $src_root` + +fi + +echo libodb_mssql_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-mssql/stub.make b/build/import/libodb-mssql/stub.make new file mode 100644 index 0000000..c970543 --- /dev/null +++ b/build/import/libodb-mssql/stub.make @@ -0,0 +1,30 @@ +# file : build/import/libodb-mssql/stub.make +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +$(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) + +libodb_mssql_installed := + +$(call -include,$(dcf_root)/import/libodb-mssql/configuration-dynamic.make) + +ifdef libodb_mssql_installed + +ifeq ($(libodb_mssql_installed),y) + +$(call export,l: -lodb-mssql -lodb,cpp-options: ) + +else + +# Include export stub. +# +$(call include,$(scf_root)/export/libodb-mssql/stub.make) + +endif + +else + +.NOTPARALLEL: + +endif diff --git a/build/mssql/configure b/build/mssql/configure new file mode 100755 index 0000000..c7d1b1b --- /dev/null +++ b/build/mssql/configure @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +# file : build/mssql/configure +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# dcf_root - dynamic configuration root +# + +#@@ TODO diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 285ef68..28fd24a 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -25,6 +25,9 @@ #elif defined(DATABASE_ORACLE) # include # include +#elif defined(DATABASE_MSSQL) +# include +# include #else # error unknown database #endif @@ -42,6 +45,8 @@ namespace sqlite = odb::sqlite; namespace pgsql = odb::pgsql; #elif defined(DATABASE_ORACLE) namespace oracle = odb::oracle; +#elif defined(DATABASE_MSSQL) +namespace mssql = odb::mssql; #endif auto_ptr @@ -124,6 +129,14 @@ create_database (int& argc, // to UTF-8. // db.reset (new oracle::database (argc, argv, false, 873, 873, 0, f)); + +#elif defined(DATABASE_MSSQL) + auto_ptr f; + + if (max_connections != 0) + f.reset (new mssql::connection_pool_factory (max_connections)); + + db.reset (new mssql::database (argc, argv, false, 0, f)); #endif return db; diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index d3c8cc4..b7fde1f 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -38,6 +38,13 @@ namespace odb_db = odb::pgsql; namespace odb_db = odb::oracle; +#elif defined(DATABASE_MSSQL) + +#include +#include + +namespace odb_db = odb::mssql; + #endif #endif // LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 6bc7a88..accf285 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -61,6 +61,9 @@ endif ifeq ($(db_id),oracle) @echo '#define DATABASE_ORACLE 1' >>$@ endif +ifeq ($(db_id),mssql) + @echo '#define DATABASE_MSSQL 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ -- cgit v1.1 From 50255cefbe9585bbe50d17bd89758132f56df7dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Nov 2011 14:55:17 +0200 Subject: Fix mssql::database constructor call --- libcommon/common/common.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 28fd24a..66a629f 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -136,7 +136,7 @@ create_database (int& argc, if (max_connections != 0) f.reset (new mssql::connection_pool_factory (max_connections)); - db.reset (new mssql::database (argc, argv, false, 0, f)); + db.reset (new mssql::database (argc, argv, false, "", 0, f)); #endif return db; -- cgit v1.1 From 56e72cb1b2fdbd462987853a80e043881e9f6452 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Nov 2011 16:45:43 +0200 Subject: Add missing library in libodb-mssql import stub --- build/import/libodb-mssql/stub.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index c970543..a7aa2dd 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -13,7 +13,7 @@ ifdef libodb_mssql_installed ifeq ($(libodb_mssql_installed),y) -$(call export,l: -lodb-mssql -lodb,cpp-options: ) +$(call export,l: -lodb-mssql -lodb -lodbc,cpp-options: ) else -- cgit v1.1 From cbefe1f332b590f8d239d3d97de61d500cdd40e9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 21 Nov 2011 12:31:49 +0200 Subject: Implement mssql/native test --- mssql/makefile | 37 +++++++++++++++++++++ mssql/native/driver.cxx | 74 ++++++++++++++++++++++++++++++++++++++++++ mssql/native/makefile | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ mssql/native/test.std | 0 4 files changed, 196 insertions(+) create mode 100644 mssql/makefile create mode 100644 mssql/native/driver.cxx create mode 100644 mssql/native/makefile create mode 100644 mssql/native/test.std diff --git a/mssql/makefile b/mssql/makefile new file mode 100644 index 0000000..6fcc307 --- /dev/null +++ b/mssql/makefile @@ -0,0 +1,37 @@ +# file : mssql/makefile +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +#@@ template +# +tests := \ +native + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := mssql +$(dist): export dirs := $(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/mssql/native/driver.cxx b/mssql/native/driver.cxx new file mode 100644 index 0000000..6dff23f --- /dev/null +++ b/mssql/native/driver.cxx @@ -0,0 +1,74 @@ +// file : mssql/native/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : ODB NCUEL; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("IF OBJECT_ID('mssql_native_test', 'U') IS NOT NULL\n" + " DROP TABLE mssql_native_test"); + + db->execute ("CREATE TABLE mssql_native_test (n int)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO mssql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO mssql_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM mssql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM mssql_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/native/makefile b/mssql/native/makefile new file mode 100644 index 0000000..40c3ab0 --- /dev/null +++ b/mssql/native/makefile @@ -0,0 +1,85 @@ +# file : mssql/native/makefile +# author : Constantin Michael +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : ODB NCUEL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +driver := $(out_base)/driver +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/native/test.std b/mssql/native/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From ee207bcbca247538de9ebbd64484708732a891e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Nov 2011 15:51:56 +0200 Subject: Add driver wrapper and options file generation for SQL Server --- build/mssql/configure | 44 ++++++++++++++++++++++++++++++++++++++++++- build/mssql/mssql | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100755 build/mssql/mssql diff --git a/build/mssql/configure b/build/mssql/configure index c7d1b1b..5013609 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -9,4 +9,46 @@ # dcf_root - dynamic configuration root # -#@@ TODO +$echo +$echo "Please enter the SQL Server client program path." +$echo + +driver=`read_path --command sqlcmd` + +$echo +$echo "Please enter the SQL Server database user." +$echo + +user=`read_value "odb_test"` + +$echo +$echo "Please enter the SQL Server database password." +$echo + +passwd=`read_value "odb_test"` + +$echo +$echo "Please enter the SQL Server database name. Note that it WILL BE" +$echo "MODIFIED by the tests." +$echo + +db=`read_value "odb_test"` + +$echo +$echo "Please enter the SQL Server instance address." +$echo + +server=`read_value ""` + +opt=$dcf_root/db.options +drv=$dcf_root/db-driver + +echo "--user '$user'" >$opt +echo "--password '$passwd'" >>$opt +echo "--database '$db'" >>$opt +echo "--server '$server'" >>$opt + +echo "#!/bin/sh" >$drv +echo "opt=\`cat $opt\`" >>$drv +echo "eval $scf_root/mssql/mssql --driver $driver \$opt \$*" >>$drv +chmod 755 $drv diff --git a/build/mssql/mssql b/build/mssql/mssql new file mode 100755 index 0000000..44c52b3 --- /dev/null +++ b/build/mssql/mssql @@ -0,0 +1,52 @@ +#! /usr/bin/env bash + +# file : build/mssql/mssql +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# SQL Server driver wrapper. +# + +opt= + +while [ $# -gt 0 ]; do + case $1 in + --driver) + driver=$2 + shift 2 + ;; + --user) + opt="$opt -U $2" + shift 2 + ;; + --password) + opt="$opt -P $2" + shift 2 + ;; + --database) + opt="$opt -d $2" + shift 2 + ;; + --server) + opt="$opt -S $2" + shift 2 + ;; + *) + break + ;; + esac +done + +if [ -z "$driver" ]; then + driver=sqlcmd +fi + +opt="-x -r -b $opt" + +if [ -n "$1" ]; then + exec $driver $opt -i $1 +else + exec $driver $opt +fi -- cgit v1.1 From 2ea274bfc40e43f3793e1cfee5e5c903f8689e60 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Nov 2011 16:16:28 +0200 Subject: Clear shell variables before appending --- build/mssql/mssql | 1 + 1 file changed, 1 insertion(+) diff --git a/build/mssql/mssql b/build/mssql/mssql index 44c52b3..d451ee6 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -10,6 +10,7 @@ # opt= +driver= while [ $# -gt 0 ]; do case $1 in -- cgit v1.1 From 8f8c17009691694fe42651a13972140bf4112678 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 16:07:44 +0200 Subject: Correct license information --- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mssql/makefile b/mssql/makefile index 6fcc307..fa68039 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,7 +1,7 @@ # file : mssql/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 6dff23f..9911a36 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,7 +1,7 @@ // file : mssql/native/driver.cxx // author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : ODB NCUEL; see accompanying LICENSE file +// license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. // diff --git a/mssql/native/makefile b/mssql/native/makefile index 40c3ab0..3eca560 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,7 +1,7 @@ # file : mssql/native/makefile # author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -# license : ODB NCUEL; see accompanying LICENSE file +# license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -- cgit v1.1 From 07c02dcecd806810226db734f193bdcf4df8cae7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Dec 2011 11:01:44 +0200 Subject: Add test for object with only auto-id member This tests the generation of the INSERT ... DEFAULT VALUES special syntax in some databases. --- common/auto/driver.cxx | 81 +++++++++++++++++++++++++++++++++----------------- common/auto/test.hxx | 9 ++++++ 2 files changed, 63 insertions(+), 27 deletions(-) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 9b863f8..121cbe8 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -28,37 +28,64 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - unsigned long id1, id2, id3; + // object + // { - object o1 ("one"); - object o2 ("two"); - object o3 ("three"); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - - id1 = o1.id_; - id2 = o2.id_; - id3 = o3.id_; - - assert (id1 != id2); - assert (id1 != id3); - assert (id2 != id3); + unsigned long id1, id2, id3; + { + object o1 ("one"); + object o2 ("two"); + object o3 ("three"); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = o1.id_; + id2 = o2.id_; + id3 = o3.id_; + + assert (id1 != id2); + assert (id1 != id3); + assert (id2 != id3); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (id1)); + auto_ptr o2 (db->load (id2)); + auto_ptr o3 (db->load (id3)); + t.commit (); + + assert (o1->id_ == id1 && o1->str_ == "one"); + assert (o2->id_ == id2 && o2->str_ == "two"); + assert (o3->id_ == id3 && o3->str_ == "three"); + } } + // auto_only + // { - transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); - auto_ptr o3 (db->load (id3)); - t.commit (); - - assert (o1->id_ == id1 && o1->str_ == "one"); - assert (o2->id_ == id2 && o2->str_ == "two"); - assert (o3->id_ == id3 && o3->str_ == "three"); + unsigned long id; + { + auto_only o; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + id = o.id_; + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (id)); + t.commit (); + + assert (o->id_ == id); + } } } catch (const odb::exception& e) diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 6f8106f..6810767 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -30,4 +30,13 @@ private: friend class odb::access; }; +// Test the case where the object has just the auto id. +// +#pragma db object +struct auto_only +{ + #pragma db auto id + unsigned long id_; +}; + #endif // TEST_HXX -- cgit v1.1 From 0e9d2582dc02ff507265fcafc99ef6a13f0dc3f7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Dec 2011 11:19:25 +0200 Subject: ODB compiler implementation, traits, and types test for SQL Server --- mssql/makefile | 3 +- mssql/types/driver.cxx | 158 ++++++++++++++++++++++++ mssql/types/makefile | 107 ++++++++++++++++ mssql/types/test.hxx | 325 +++++++++++++++++++++++++++++++++++++++++++++++++ mssql/types/test.std | 0 mssql/types/traits.hxx | 225 ++++++++++++++++++++++++++++++++++ 6 files changed, 817 insertions(+), 1 deletion(-) create mode 100644 mssql/types/driver.cxx create mode 100644 mssql/types/makefile create mode 100644 mssql/types/test.hxx create mode 100644 mssql/types/test.std create mode 100644 mssql/types/traits.hxx diff --git a/mssql/makefile b/mssql/makefile index fa68039..6c3b2a8 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -8,7 +8,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make #@@ template # tests := \ -native +native \ +types default := $(out_base)/ dist := $(out_base)/.dist diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx new file mode 100644 index 0000000..2266792 --- /dev/null +++ b/mssql/types/driver.cxx @@ -0,0 +1,158 @@ +// file : mssql/types/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + { + object o (1); + + o.bit_ = 1; + o.utint_ = 222; + o.stint_ = -123; + o.usint_ = 65000; + o.ssint_ = -12345; + o.uint_ = 4294967290U; + o.sint_ = -1234567890; + o.ubint_ = 18446744073709551610ULL; + o.sbint_ = -1234567890123456789LL; + + o.fsm_ = -214748.3648F; + o.dsm_ = 214748.3647D; + o.ism_ = -2147483647 -1; + + o.dm1_ = -922337203685477.5808D; + o.dm2_ = 922337203685476.3520D; // 922337203685477.5807 + o.im_ = 9223372036854775807LL; + + o.f4_ = 123.123F; + o.f8_ = 123.1234567D; + + o.schar_ = "short data char "; + o.svchar_ = "short data varchar"; + + o.lchar_.assign (257, 'a'); + o.lvchar_ = "long data varchar"; // Test the short string optimization. + o.mvchar_.assign (70000, 'm'); + o.text_.assign (70000, 't'); + + o.snchar_ = L"short data nchar\x1FFF\xD7FF "; + o.snvchar_ = L"short data nvarchar \x1FFF\xD7FF"; + + o.lnchar_.assign (129, L'\x1234'); + o.lnvchar_ = L""; // Test empty string. + o.mnvchar_.assign (70000, L'\x2345'); + o.ntext_.assign (70000, L'\x4356'); + + const char sdata[] = "abc""\x00\x01""def"; + memcpy (o.sbin_, sdata, sizeof (sdata)); + o.svbin_.assign (sdata, sdata + sizeof (sdata)); + + string ldata (256 * 1024, '\x01'); + memset (o.lbin_, 2, sizeof (o.lbin_)); + o.lvbin_.assign (50, '\x03'); + o.mvbin_.assign (ldata.begin (), ldata.end ()); + o.image_.assign (ldata.begin (), ldata.end ()); + + o.date_ = date_time (2011, 12, 20, 0, 0, 0, 0, 0, 0); + o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456789, 0, 0); + o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); + o.sdt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); + o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); + o.dt2_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); + o.dto7_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); + o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); + +#ifdef _WIN32 + // 6F846D41-C89A-4E4D-B22F-56443CFA543F + o.guid_.Data1 = 0x6F846D41; + o.guid_.Data2 = 0xC89A; + o.guid_.Data3 = 0x4E4D; + memcpy (&o.guid_.Data4, "\xB2\x2F\x56\x44\x3C\xFA\x54\x3F", 8); +#endif + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); + o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123400000, 0, 0); + o.sdt_ = date_time (2011, 12, 20, 15, 44, 0, 0, 0, 0); + o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123000000, 0, 0); + o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 0, 2, 0); + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + + // Test long NULL data. + // + { + long_null o1 (1); + long_null o2 (2); + o2.str_.reset (new string); + o2.str_->assign (70000, 'x'); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/types/makefile b/mssql/types/makefile new file mode 100644 index 0000000..96f7d68 --- /dev/null +++ b/mssql/types/makefile @@ -0,0 +1,107 @@ +# file : mssql/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 mssql --generate-schema \ +--hxx-prologue '\#include "traits.hxx"' --table-prefix mssql_types_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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/mssql/types/test.hxx b/mssql/types/test.hxx new file mode 100644 index 0000000..8cd689b --- /dev/null +++ b/mssql/types/test.hxx @@ -0,0 +1,325 @@ +// file : mssql/types/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include // GUID +#elif defined(WIN32_CROSS) +typedef struct _GUID +{ + unsigned int Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; +#endif + +#include +#include +#include // std::auto_ptr +#include // std::memcmp + +#include + +struct date_time +{ + date_time () + { + } + + date_time (short y, + unsigned short m, + unsigned short d, + unsigned short h, + unsigned short min, + unsigned short sec, + unsigned int f, + short tzh, + short tzm) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + fraction (f), + timezone_hour (tzh), + timezone_minute (tzm) + { + } + + bool + operator== (const date_time& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + fraction == y.fraction && + timezone_hour == y.timezone_hour && + timezone_minute == y.timezone_minute; + } + + short year; + unsigned short month; + unsigned short day; + unsigned short hour; + unsigned short minute; + unsigned short second; + unsigned int fraction; + short timezone_hour; + short timezone_minute; +}; + +#pragma db object +struct object +{ + object () {} + object (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + // Integer types. + // + #pragma db type ("BIT") + unsigned char bit_; + + #pragma db type ("TINYINT") + unsigned char utint_; + + #pragma db type ("TINYINT") + unsigned char stint_; + + #pragma db type ("SMALLINT") + unsigned short usint_; + + #pragma db type ("SMALLINT") + short ssint_; + + #pragma db type ("INT") + unsigned int uint_; + + #pragma db type ("INTEGER") + int sint_; + + #pragma db type ("BIGINT") + unsigned long long ubint_; + + #pragma db type ("BIGINT") + long long sbint_; + + // Floating/fixed point types. + // + #pragma db type ("SMALLMONEY") + float fsm_; + + #pragma db type ("SMALLMONEY") + double dsm_; + + #pragma db type ("SMALLMONEY") + int ism_; + + #pragma db type ("MONEY") + double dm1_; + + #pragma db type ("MONEY") + double dm2_; + + #pragma db type ("MONEY") + long long im_; + + #pragma db type ("REAL") + float f4_; + + #pragma db type ("FLOAT") + double f8_; + + // Strings. + // + #pragma db type ("CHAR(20)") + std::string schar_; + + #pragma db type ("VARCHAR(128)") + std::string svchar_; + + #pragma db type ("CHAR(257)") + std::string lchar_; + + #pragma db type ("CHARACTER VARYING(8000)") + std::string lvchar_; + + #pragma db type ("VARCHAR(max)") + std::string mvchar_; + + #pragma db type ("TEXT") + std::string text_; + + // National strings. + // + #pragma db type ("NCHAR(20)") + std::wstring snchar_; + + #pragma db type ("NVARCHAR(128)") + std::wstring snvchar_; + + #pragma db type ("NCHAR(129)") + std::wstring lnchar_; + + #pragma db type ("NATIONAL CHARACTER VARYING(4000)") + std::wstring lnvchar_; + + #pragma db type ("NVARCHAR(max)") + std::wstring mnvchar_; + + #pragma db type ("NTEXT") + std::wstring ntext_; + + // Binary. + // + #pragma db type ("BINARY(9)") + unsigned char sbin_[9]; + + #pragma db type ("VARBINARY(256)") + std::vector svbin_; + + #pragma db type ("BINARY(257)") + char lbin_[257]; + + #pragma db type ("BINARY VARYING(8000)") + std::vector lvbin_; + + #pragma db type ("VARBINARY(max)") + std::vector mvbin_; + + #pragma db type ("IMAGE") + std::vector image_; + + // Date-time. + // + #pragma db type ("DATE") + date_time date_; + + #pragma db type ("TIME") + date_time time7_; + + #pragma db type ("TIME(4)") + date_time time4_; + + #pragma db type ("SMALLDATETIME") + date_time sdt_; + + #pragma db type ("DATETIME") + date_time dt_; + + #pragma db type ("DATETIME2") + date_time dt2_; + + #pragma db type ("DATETIMEOFFSET") + date_time dto7_; + + #pragma db type ("DATETIMEOFFSET(0)") + date_time dto0_; + + // Other types. + // +#if defined(_WIN32) || defined(WIN32_CROSS) + //#pragma db type ("UNIQUEIDENTIFIER") + GUID guid_; +#endif + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bit_ == y.bit_ && + utint_ == y.utint_ && + stint_ == y.stint_ && + usint_ == y.usint_ && + ssint_ == y.ssint_ && + uint_ == y.uint_ && + sint_ == y.sint_ && + ubint_ == y.ubint_ && + sbint_ == y.sbint_ && + fsm_ == y.fsm_ && + dsm_ == y.dsm_ && + ism_ == y.ism_ && + dm1_ == y.dm1_ && + dm2_ == y.dm2_ && + im_ == y.im_ && + f4_ == y.f4_ && + f8_ == y.f8_ && + + schar_ == y.schar_ && + svchar_ == y.svchar_ && + lchar_ == y.lchar_ && + lvchar_ == y.lvchar_ && + mvchar_ == y.mvchar_ && + text_ == y.text_ && + + snchar_ == y.snchar_ && + snvchar_ == y.snvchar_ && + lnchar_ == y.lnchar_ && + lnvchar_ == y.lnvchar_ && + mnvchar_ == y.mnvchar_ && + ntext_ == y.ntext_ && + + std::memcmp (sbin_, y.sbin_, sizeof (sbin_)) == 0 && + svbin_ == y.svbin_ && + std::memcmp (lbin_, y.lbin_, sizeof (lbin_)) == 0 && + lvbin_ == y.lvbin_ && + mvbin_ == y.mvbin_ && + image_ == y.image_ && + + date_ == y.date_ && + time7_ == y.time7_ && + time4_ == y.time4_ && + sdt_ == y.sdt_ && + dt_ == y.dt_ && + dt2_ == y.dt2_ && + dto7_ == y.dto7_ && + dto0_ == y.dto0_ + +#ifdef _WIN32 + && std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0 +#endif + ; + } +}; + + +// Test long NULL data. +// +#pragma db object +struct long_null +{ + long_null () {} + long_null (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + #pragma db type ("VARCHAR(max)") null + std::auto_ptr str_; + + bool + operator== (const long_null& y) const + { + return + id_ == y.id_ && + ((str_.get () == 0 && y.str_.get () == 0) || *str_ == *y.str_); + } +}; + +#endif // TEST_HXX diff --git a/mssql/types/test.std b/mssql/types/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx new file mode 100644 index 0000000..76a21c5 --- /dev/null +++ b/mssql/types/traits.hxx @@ -0,0 +1,225 @@ +// file : mssql/types/traits.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // date, time, datetime, datetimeoffset +#include + +#include "test.hxx" // date_time + +namespace odb +{ + namespace mssql + { + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef date image_type; + + static void + set_value (date_time& v, const date& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = 0; + v.minute = 0; + v.second = 0; + v.fraction = 0; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (date& i, bool& is_null, const date_time& v) + { + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef time image_type; + + static void + set_value (date_time& v, const time& i, bool is_null) + { + if (!is_null) + { + v.year = 0; + v.month = 0; + v.day = 0; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (time& i, unsigned short s, bool& is_null, const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetime image_type; + + static void + set_value (date_time& v, const datetime& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (datetime& i, + unsigned short s, + bool& is_null, + const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + + // Scale value 8 indicates we are dealing with SMALLDATETIME + // which has the minutes precision. + // + if (s != 8) + { + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + } + else + { + i.second = 0; + i.fraction = 0; + } + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetimeoffset image_type; + + static void + set_value (date_time& v, const datetimeoffset& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = i.timezone_hour; + v.timezone_minute = i.timezone_minute; + } + } + + static void + set_image (datetimeoffset& i, + unsigned short s, + bool& is_null, + const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + i.timezone_hour = v.timezone_hour; + i.timezone_minute = v.timezone_minute; + } + }; + } +} + +#endif // TRAITS_HXX -- cgit v1.1 From 065bb177141ce0c9963d0100fe5e6800d9235f33 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Dec 2011 15:33:54 +0200 Subject: Add support for SQL Server in blob test --- common/blob/test.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/blob/test.hxx b/common/blob/test.hxx index b1b7cf5..2a0f880 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -12,8 +12,10 @@ #include #ifdef ODB_COMPILER -# ifdef ODB_DATABASE_PGSQL +# if defined(ODB_DATABASE_PGSQL) # define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" # else # define BLOB_TYPE "BLOB" # endif -- cgit v1.1 From 089a36ee4a3c7bf6d7288f021f135b8c4ffce8a0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Dec 2011 11:33:15 +0200 Subject: Add test template for SQL Server --- mssql/makefile | 3 +- mssql/template/driver.cxx | 44 +++++++++++++++++++ mssql/template/makefile | 106 ++++++++++++++++++++++++++++++++++++++++++++++ mssql/template/test.hxx | 27 ++++++++++++ mssql/template/test.std | 1 + 5 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 mssql/template/driver.cxx create mode 100644 mssql/template/makefile create mode 100644 mssql/template/test.hxx create mode 100644 mssql/template/test.std diff --git a/mssql/makefile b/mssql/makefile index 6c3b2a8..6c441ef 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -5,9 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -#@@ template -# tests := \ +template \ native \ types diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx new file mode 100644 index 0000000..d142ac5 --- /dev/null +++ b/mssql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : mssql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/template/makefile b/mssql/template/makefile new file mode 100644 index 0000000..4b94e07 --- /dev/null +++ b/mssql/template/makefile @@ -0,0 +1,106 @@ +# file : mssql/template/makefile +# author : Constantin Michael +# 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 mssql --generate-schema \ +--table-prefix mssql_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(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 schema) + $(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/mssql/template/test.hxx b/mssql/template/test.hxx new file mode 100644 index 0000000..f86c855 --- /dev/null +++ b/mssql/template/test.hxx @@ -0,0 +1,27 @@ +// file : mssql/template/test.hxx +// author : Constantin Michael +// 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/mssql/template/test.std b/mssql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/mssql/template/test.std @@ -0,0 +1 @@ +test 001 -- cgit v1.1 From 2a8f6db525ba7f400c170cdd6321dcb20c2d24e3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Dec 2011 11:50:32 +0200 Subject: Test SQL Server long data in container --- mssql/types/driver.cxx | 27 +++++++++++++++++++++++++++ mssql/types/test.hxx | 39 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 2266792..f4c9452 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -149,6 +149,33 @@ main (int argc, char* argv[]) assert (o2 == *p2); } } + + // Test long data in containers. + // + { + long_cont o (1); + o.v.push_back (long_comp ("aaa", 123)); + o.v.push_back (long_comp (string (500, 'b'), 234)); + o.v.push_back (long_comp (string (70000, 'c'), 345)); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + + assert (o == *p); + } + } } catch (const odb::exception& e) { diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 8cd689b..a0d261e 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -298,7 +298,6 @@ struct object } }; - // Test long NULL data. // #pragma db object @@ -322,4 +321,42 @@ struct long_null } }; +// Test long data in containers, in particular column re-arrangement. +// +#pragma db value +struct long_comp +{ + long_comp () {} + long_comp (std::string s, unsigned int n): str (s), num (n) {} + + #pragma db type ("VARCHAR(max)") + std::string str; + + unsigned int num; + + bool + operator== (const long_comp& y) const + { + return str == y.str && num == y.num; + } +}; + +#pragma db object +struct long_cont +{ + long_cont () {} + long_cont (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + std::vector v; + + bool + operator== (const long_cont& y) const + { + return id_ == y.id_ && v == y.v; + } +}; + #endif // TEST_HXX -- cgit v1.1 From ce67e078eb0a2a867a0381d849d5b8180c1f6e25 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 09:05:45 +0200 Subject: Fix incorrect argument order --- oracle/types/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 0e48745..53f09e8 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -278,7 +278,7 @@ struct blob blob (): id_ (0) {} blob (unsigned int id, std::size_t n) - : id_ (id), value_ ('b', n) + : id_ (id), value_ (n, 'b') { } -- cgit v1.1 From 3cc019d0df41400f9cf921040adab0ae198b570a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 09:06:13 +0200 Subject: Implement callback data re-basing support for LOB result streaming This is used by the query machinery when a copy of the image has to be made. In this case stream_result() needs to use data from the copy of the image, and not from the image that was bound to the bind array. --- oracle/types/driver.cxx | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index b23a757..684a46e 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -178,13 +178,15 @@ main (int argc, char* argv[]) // Test large BLOBs. // - blob b (1, 50000); + blob b1 (1, 50000); + blob b2 (2, 500000); // Persist. // { transaction t (db->begin ()); - db->persist (b); + db->persist (b1); + db->persist (b2); t.commit (); } @@ -192,10 +194,41 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr bl (db->load (1)); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); t.commit (); - assert (b == *bl); + assert (b1 == *p1); + assert (b2 == *p2); + } + + // Test image copying with LOB data. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::id < 3)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + + { + result r (db->query (query::id < 2)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->value_.size () == 50000); + assert (++i == r.end ()); + } + + assert (i->value_.size () == 500000); // Load from copy. + assert (++i == r.end ()); + + t.commit (); } // Test descriptor management in TIMESTAMP and INTERVAL images. -- cgit v1.1 From 043d8fabcf15918e22efdbde41af4880b23c0104 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 09:28:07 +0200 Subject: Query support for SQL Server --- common/query/test.hxx | 16 ++-- libcommon/common/common.hxx | 4 +- mssql/makefile | 1 + mssql/query/driver.cxx | 189 ++++++++++++++++++++++++++++++++++++++++++++ mssql/query/makefile | 106 +++++++++++++++++++++++++ mssql/query/test.hxx | 40 ++++++++++ mssql/query/test.std | 0 7 files changed, 350 insertions(+), 6 deletions(-) create mode 100644 mssql/query/driver.cxx create mode 100644 mssql/query/makefile create mode 100644 mssql/query/test.hxx create mode 100644 mssql/query/test.std diff --git a/common/query/test.hxx b/common/query/test.hxx index b69be3c..9e8b0ff 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -14,6 +14,16 @@ #include #include +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + typedef std::vector buffer; typedef odb::nullable nullable_buffer; @@ -54,11 +64,7 @@ struct person unsigned short age_; bool married_; -#ifdef ODB_DATABASE_PGSQL - #pragma db column ("key") type ("BYTEA") null -#else - #pragma db column ("key") type ("BLOB") null -#endif + #pragma db column ("key") type(BLOB_TYPE) null nullable_buffer public_key_; }; diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index ead8888..2cf2357 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -35,7 +35,9 @@ std::size_t size (odb::result& r) { std::size_t n (0); -#if defined(DATABASE_SQLITE) || defined(DATABASE_ORACLE) +#if defined(DATABASE_SQLITE) || \ + defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) n++; #else diff --git a/mssql/makefile b/mssql/makefile index 6c441ef..83b9e90 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -8,6 +8,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ native \ +query \ types default := $(out_base)/ diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx new file mode 100644 index 0000000..2bcd692 --- /dev/null +++ b/mssql/query/driver.cxx @@ -0,0 +1,189 @@ +// file : mssql/query/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server-specific query support aspects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + object o1; + object o2; + object o3; + + o1.num = 1; + o1.str = "aaa"; + o1.nstr = L"aaa"; + o1.lstr.assign (1024, 'a'); + o1.lnstr.assign (1024, L'a'); + o1.smoney = 11000; + o1.money = 1.1; + + o2.num = 2; + o2.str = "bbb"; + o2.nstr = L"bbb"; + o2.lstr.assign (1024, 'b'); + o2.lnstr.assign (1024, L'b'); + o2.smoney = 22000; + o2.money = 2.2; + + o3.num = 3; + o3.str = "ccc"; + o3.nstr = L"ccc"; + o3.lstr.assign (1024, 'c'); + o3.lnstr.assign (1024, L'c'); + o3.smoney = 33000; + o3.money = 3.3; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Money and small money. + // + { + result r (db->query (query::smoney < 22000)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->smoney == 11000); + assert (++i == r.end ()); + } + + { + result r (db->query ("smoney < " + query::_val (2.1F))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->smoney == 11000); + assert (++i == r.end ()); + } + + { + result r (db->query (query::money < 2.2)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->money == 1.1); + assert (++i == r.end ()); + } + + { + result r (db->query ("money < " + query::_val (2.2))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->money == 1.1); + assert (++i == r.end ()); + } + + // Short/long string. + // + { + result r (db->query (query::str < "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query ("str < " + query::_val ("bbb", 3))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::nstr < L"bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->nstr == L"aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::lstr < string (1024, 'b'))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lstr == string (1024, 'a')); + assert (++i == r.end ()); + } + + { + string v (1024, 'b'); + result r (db->query (query::lstr < query::_ref (v))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lstr == string (1024, 'a')); + assert (++i == r.end ()); + } + + { + result r (db->query (query::lnstr < wstring (1024, L'b'))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lnstr == wstring (1024, L'a')); + assert (++i == r.end ()); + } + + // Test image copying with long data. + // + { + result r (db->query (query::str < "ccc")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + + { + result r (db->query (query::str < "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + assert (i->str == "bbb"); // Load from copy. + assert (++i == r.end ()); + } + + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/query/makefile b/mssql/query/makefile new file mode 100644 index 0000000..808e48d --- /dev/null +++ b/mssql/query/makefile @@ -0,0 +1,106 @@ +# file : mssql/query/makefile +# author : Constantin Michael +# 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 mssql --generate-schema \ +--generate-query --table-prefix mssql_query_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(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 schema) + $(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/mssql/query/test.hxx b/mssql/query/test.hxx new file mode 100644 index 0000000..964d893 --- /dev/null +++ b/mssql/query/test.hxx @@ -0,0 +1,40 @@ +// file : mssql/query/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + unsigned int num; + + #pragma db type ("SMALLMONEY") + int smoney; + + #pragma db type ("MONEY") + double money; + + #pragma db type ("VARCHAR(256)") + std::string str; + + #pragma db type ("NVARCHAR(128)") + std::wstring nstr; + + #pragma db type ("VARCHAR(max)") + std::string lstr; + + #pragma db type ("NVARCHAR(max)") + std::wstring lnstr; +}; + +#endif // TEST_HXX diff --git a/mssql/query/test.std b/mssql/query/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 386162fc49b1adb266bbabc735ab28f46b98fa45 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 14:18:37 +0200 Subject: Disable re-loading of object with long data for SQL Server --- common/query/driver.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 6dd7757..ee5a76c 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -421,8 +421,15 @@ main (int argc, char* argv[]) assert (i != r.end ()); ++i; assert (i != r.end ()); + auto_ptr joe (db->load (3)); + + // SQL Server does not support re-loading of an object with long data + // from a query result. + // +#ifndef DATABASE_MSSQL assert (i->last_name_ == "Doe"); // Actual load. +#endif person p; joe.reset (db->load (3)); // Overwrite object image again. -- cgit v1.1 From 306781934b1ae960c7c4bab900da7b1c9d3ccaac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 14:20:58 +0200 Subject: Change short data max and default string sizes for SQL Server Now the default short data max is 1024, non-key string size is 512 characters, and key string size is 256 characters. Also add default mapping for std::wstring. --- mssql/types/driver.cxx | 4 ++-- mssql/types/test.hxx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index f4c9452..005214a 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -55,7 +55,7 @@ main (int argc, char* argv[]) o.schar_ = "short data char "; o.svchar_ = "short data varchar"; - o.lchar_.assign (257, 'a'); + o.lchar_.assign (1025, 'a'); o.lvchar_ = "long data varchar"; // Test the short string optimization. o.mvchar_.assign (70000, 'm'); o.text_.assign (70000, 't'); @@ -63,7 +63,7 @@ main (int argc, char* argv[]) o.snchar_ = L"short data nchar\x1FFF\xD7FF "; o.snvchar_ = L"short data nvarchar \x1FFF\xD7FF"; - o.lnchar_.assign (129, L'\x1234'); + o.lnchar_.assign (513, L'\x1234'); o.lnvchar_ = L""; // Test empty string. o.mnvchar_.assign (70000, L'\x2345'); o.ntext_.assign (70000, L'\x4356'); diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index a0d261e..7653ec6 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -153,7 +153,7 @@ struct object #pragma db type ("VARCHAR(128)") std::string svchar_; - #pragma db type ("CHAR(257)") + #pragma db type ("CHAR(1025)") std::string lchar_; #pragma db type ("CHARACTER VARYING(8000)") @@ -173,7 +173,7 @@ struct object #pragma db type ("NVARCHAR(128)") std::wstring snvchar_; - #pragma db type ("NCHAR(129)") + #pragma db type ("NCHAR(513)") std::wstring lnchar_; #pragma db type ("NATIONAL CHARACTER VARYING(4000)") @@ -193,8 +193,8 @@ struct object #pragma db type ("VARBINARY(256)") std::vector svbin_; - #pragma db type ("BINARY(257)") - char lbin_[257]; + #pragma db type ("BINARY(1025)") + char lbin_[1025]; #pragma db type ("BINARY VARYING(8000)") std::vector lvbin_; -- cgit v1.1 From 47ce8460b0403981528a8ebfc69945586b9374ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Jan 2012 12:03:34 +0200 Subject: Add SQL Server directory --- boost/makefile | 13 ++----------- makefile | 19 ++----------------- qt/makefile | 13 ++----------- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/boost/makefile b/boost/makefile index dcc5d32..a8edf49 100644 --- a/boost/makefile +++ b/boost/makefile @@ -5,18 +5,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite pgsql oracle +all_dirs := common mysql sqlite pgsql oracle mssql dirs := common - -ifeq ($(db_id),mysql) -dirs += mysql -else ifeq ($(db_id),sqlite) -dirs += sqlite -else ifeq ($(db_id),pgsql) -dirs += pgsql -else ifeq ($(db_id),oracle) -dirs += oracle -endif +dirs += $(db_id) default := $(out_base)/ dist := $(out_base)/.dist diff --git a/makefile b/makefile index e7184f9..576792d 100644 --- a/makefile +++ b/makefile @@ -5,24 +5,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common mysql sqlite pgsql oracle boost qt +all_dirs := libcommon common mysql sqlite pgsql oracle mssql boost qt dirs := common boost qt - -ifeq ($(db_id),mysql) -dirs += mysql -endif - -ifeq ($(db_id),sqlite) -dirs += sqlite -endif - -ifeq ($(db_id),pgsql) -dirs += pgsql -endif - -ifeq ($(db_id),oracle) -dirs += oracle -endif +dirs += $(db_id) default := $(out_base)/ dist := $(out_base)/.dist diff --git a/qt/makefile b/qt/makefile index e0ec91d..f491174 100644 --- a/qt/makefile +++ b/qt/makefile @@ -5,18 +5,9 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -all_dirs := common mysql sqlite pgsql oracle +all_dirs := common mysql sqlite pgsql oracle mssql dirs := common - -ifeq ($(db_id),mysql) -dirs += mysql -else ifeq ($(db_id),sqlite) -dirs += sqlite -else ifeq ($(db_id),pgsql) -dirs += pgsql -else ifeq ($(db_id),oracle) -dirs += oracle -endif +dirs += $(db_id) default := $(out_base)/ dist := $(out_base)/.dist -- cgit v1.1 From 506edcf7bb2a9c099f9aebc84a0a0d18c8dd45d7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Jan 2012 12:04:10 +0200 Subject: Cosmetic changes --- boost/oracle/date-time/driver.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index 4bb3058..f74f3cd 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -72,9 +72,9 @@ main (int argc, char* argv[]) assert (*ol == o); } + // Test invalid date mappings. + // { - // Test invalid date mappings. - // object sv1, sv2; sv1.dates.push_back (date (neg_infin)); sv2.dates.push_back (date (pos_infin)); @@ -85,9 +85,9 @@ main (int argc, char* argv[]) t.commit (); } + // Test invalid ptime mappings. + // { - // Test invalid ptime mappings. - // object sv1, sv2; sv1.times.push_back (neg_infin); sv2.times.push_back (pos_infin); @@ -98,9 +98,9 @@ main (int argc, char* argv[]) t.commit (); } + // Test invalid time_duration mappings. + // { - // Test invalid time_duration mappings. - // object sv1, sv2; sv1.durations.push_back (pos_infin); sv2.durations.push_back (neg_infin); -- cgit v1.1 From 806df44f9182ebd1cb86bc31189370a3e595d3b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Jan 2012 12:07:50 +0200 Subject: Boost profile implementation for SQL Server --- boost/mssql/date-time/driver.cxx | 154 +++++++++++++++++++++++++++++++++++++++ boost/mssql/date-time/makefile | 121 ++++++++++++++++++++++++++++++ boost/mssql/date-time/test.hxx | 51 +++++++++++++ boost/mssql/date-time/test.std | 0 boost/mssql/makefile | 36 +++++++++ boost/mssql/template/driver.cxx | 44 +++++++++++ boost/mssql/template/makefile | 116 +++++++++++++++++++++++++++++ boost/mssql/template/test.hxx | 27 +++++++ boost/mssql/template/test.std | 1 + 9 files changed, 550 insertions(+) create mode 100644 boost/mssql/date-time/driver.cxx create mode 100644 boost/mssql/date-time/makefile create mode 100644 boost/mssql/date-time/test.hxx create mode 100644 boost/mssql/date-time/test.std create mode 100644 boost/mssql/makefile create mode 100644 boost/mssql/template/driver.cxx create mode 100644 boost/mssql/template/makefile create mode 100644 boost/mssql/template/test.hxx create mode 100644 boost/mssql/template/test.std diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx new file mode 100644 index 0000000..d48f90b --- /dev/null +++ b/boost/mssql/date-time/driver.cxx @@ -0,0 +1,154 @@ +// file : boost/mssql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (ptime (max_date_time)); + + // In DATETIME fractional seconds are rounded to .000, .003, or .007. + // + o.times_dt.push_back (ptime (date (2012, 1, 13), + time_duration (11, 57, 13, 7000))); + + // SMALLDATETIME doesn't have seconds (always 0). + // + o.times_sdt.push_back (ptime (date (2012, 1, 13), + time_duration (11, 57, 0, 0))); + + o.durations.push_back (time_duration (1, 2, 3, 123456)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + // Test invalid date mappings. + // + { + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid ptime mappings. + // + { + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid time_duration mappings. + // + { + object sv1, sv2, or1; + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + or1.durations.push_back (time_duration (50, 2, 3, 123456700)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + + try + { + db->persist (or1); + assert (false); + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile new file mode 100644 index 0000000..4c97299 --- /dev/null +++ b/boost/mssql/date-time/makefile @@ -0,0 +1,121 @@ +# file : boost/mssql/date-time/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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/date-time/stub.make,\ + l: boost_date_time.l) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 mssql \ +--profile boost/date-time --generate-schema \ +--table-prefix boost_mssql_dt_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/mssql/,,$(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 schema) + $(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/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx new file mode 100644 index 0000000..7bbd15d --- /dev/null +++ b/boost/mssql/date-time/test.hxx @@ -0,0 +1,51 @@ +// file : boost/mssql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + times_dt == x.times_dt && + times_sdt == x.times_sdt && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + + std::vector times; + + #pragma db value_type("DATETIME") + std::vector times_dt; + + #pragma db value_type("SMALLDATETIME") + std::vector times_sdt; + + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/boost/mssql/date-time/test.std b/boost/mssql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/boost/mssql/makefile b/boost/mssql/makefile new file mode 100644 index 0000000..1f43f40 --- /dev/null +++ b/boost/mssql/makefile @@ -0,0 +1,36 @@ +# file : boost/mssql/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 := \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := boost-mssql +$(dist): export dirs := $(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/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx new file mode 100644 index 0000000..e43fd72 --- /dev/null +++ b/boost/mssql/template/driver.cxx @@ -0,0 +1,44 @@ +// file : boost/mssql/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 // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile new file mode 100644 index 0000000..06d9ba7 --- /dev/null +++ b/boost/mssql/template/makefile @@ -0,0 +1,116 @@ +# file : boost/mssql/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) + +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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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 mssql --profile boost \ +--generate-schema --table-prefix boost_mssql_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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)/boost/mssql/,,$(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 schema) + $(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/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx new file mode 100644 index 0000000..ab41549 --- /dev/null +++ b/boost/mssql/template/test.hxx @@ -0,0 +1,27 @@ +// file : boost/mssql/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/boost/mssql/template/test.std b/boost/mssql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/boost/mssql/template/test.std @@ -0,0 +1 @@ +test 001 -- cgit v1.1 From e0849593316ba0f3e45545dad98ee9218d017184 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 13 Jan 2012 12:12:16 +0200 Subject: Test fractional seconds --- boost/oracle/date-time/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index f74f3cd..7c1733e 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -54,7 +54,7 @@ main (int argc, char* argv[]) o.times.push_back (min_date_time); o.times.push_back (ptime (max_date_time)); - o.durations.push_back (time_duration (1, 2, 3)); + o.durations.push_back (time_duration (1, 2, 3, 123456)); o.durations.push_back (time_duration (-1, 2, 3)); o.durations.push_back (not_a_date_time); -- cgit v1.1 From 0da5345276f1e655e5e099fdf6280466e3a5dda4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 09:43:38 +0200 Subject: Date-time part of Qt profile implementation for SQL Server --- qt/mssql/date-time/driver.cxx | 92 +++++++++++++++++++++++++++++++++ qt/mssql/date-time/makefile | 116 ++++++++++++++++++++++++++++++++++++++++++ qt/mssql/date-time/test.hxx | 55 ++++++++++++++++++++ qt/mssql/date-time/test.std | 0 qt/mssql/makefile | 37 ++++++++++++++ qt/mssql/template/driver.cxx | 48 +++++++++++++++++ qt/mssql/template/makefile | 110 +++++++++++++++++++++++++++++++++++++++ qt/mssql/template/test.hxx | 27 ++++++++++ qt/mssql/template/test.std | 1 + 9 files changed, 486 insertions(+) create mode 100644 qt/mssql/date-time/driver.cxx create mode 100644 qt/mssql/date-time/makefile create mode 100644 qt/mssql/date-time/test.hxx create mode 100644 qt/mssql/date-time/test.std create mode 100644 qt/mssql/makefile create mode 100644 qt/mssql/template/driver.cxx create mode 100644 qt/mssql/template/makefile create mode 100644 qt/mssql/template/test.hxx create mode 100644 qt/mssql/template/test.std diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx new file mode 100644 index 0000000..66d6b67 --- /dev/null +++ b/qt/mssql/date-time/driver.cxx @@ -0,0 +1,92 @@ +// file : qt/mssql/date-time/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // + QDateTime t (QDateTime::currentDateTime ()); + + o.date = t.date (); + o.date_time = t; + + // In DATETIME fractional seconds are rounded to .000, .003, or .007. + // + o.date_time_dt = QDateTime (QDate (2012, 1, 14), + QTime (11, 57, 13, 3)); + + // SMALLDATETIME doesn't have seconds (always 0). + // + o.date_time_sdt = QDateTime (QDate (2012, 1, 14), + QTime (11, 57, 0, 0)); + + o.time = t.time (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile new file mode 100644 index 0000000..efe33e2 --- /dev/null +++ b/qt/mssql/date-time/makefile @@ -0,0 +1,116 @@ +# file : qt/mssql/date-time/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 mssql --profile qt/date-time \ +--generate-schema --table-prefix qt_mssql_dt_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/mssql/,,$(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 schema) + $(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/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx new file mode 100644 index 0000000..c494efb --- /dev/null +++ b/qt/mssql/date-time/test.hxx @@ -0,0 +1,55 @@ +// file : qt/mssql/date-time/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + date_time_dt == x.date_time_dt && + date_time_sdt == x.date_time_sdt && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + date_time_dt.isNull () && + date_time_sdt.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + + QDateTime date_time; + + #pragma db type ("DATETIME") + QDateTime date_time_dt; + + #pragma db type ("SMALLDATETIME") + QDateTime date_time_sdt; + + QTime time; +}; + +#endif // TEST_HXX diff --git a/qt/mssql/date-time/test.std b/qt/mssql/date-time/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/mssql/makefile b/qt/mssql/makefile new file mode 100644 index 0000000..22e3570 --- /dev/null +++ b/qt/mssql/makefile @@ -0,0 +1,37 @@ +# file : qt/mssql/makefile +# author : Constantin Michael +# 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 := \ +basic \ +date-time \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) + +$(dist): name := qt-mssql +$(dist): export dirs := $(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/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx new file mode 100644 index 0000000..070ed91 --- /dev/null +++ b/qt/mssql/template/driver.cxx @@ -0,0 +1,48 @@ +// file : qt/mssql/template/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile new file mode 100644 index 0000000..8502371 --- /dev/null +++ b/qt/mssql/template/makefile @@ -0,0 +1,110 @@ +# file : qt/mssql/template/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +#Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mssql --profile qt \ +--generate-schema --table-prefix qt_mssql_template_ #@@ CHANGE THIS +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mssql/,,$(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 schema) + $(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/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx new file mode 100644 index 0000000..c3b2198 --- /dev/null +++ b/qt/mssql/template/test.hxx @@ -0,0 +1,27 @@ +// file : qt/mssql/template/test.hxx +// author : Constantin Michael +// 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/qt/mssql/template/test.std b/qt/mssql/template/test.std new file mode 100644 index 0000000..af8d8e7 --- /dev/null +++ b/qt/mssql/template/test.std @@ -0,0 +1 @@ +test 001 -- cgit v1.1 From fb3f565e804603c66457514e20018434c989883e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 12:52:04 +0200 Subject: Basic Qt profile implementation for SQL Server --- qt/mssql/basic/driver.cxx | 67 ++++++++++++++++++++++++++ qt/mssql/basic/makefile | 116 ++++++++++++++++++++++++++++++++++++++++++++++ qt/mssql/basic/test.hxx | 48 +++++++++++++++++++ qt/mssql/basic/test.std | 0 4 files changed, 231 insertions(+) create mode 100644 qt/mssql/basic/driver.cxx create mode 100644 qt/mssql/basic/makefile create mode 100644 qt/mssql/basic/test.hxx create mode 100644 qt/mssql/basic/test.std diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx new file mode 100644 index 0000000..25ea172 --- /dev/null +++ b/qt/mssql/basic/driver.cxx @@ -0,0 +1,67 @@ +// file : qt/mssql/basic/driver.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.id_ = "object 1"; + o.sstr_ = QString (512, 's'); + o.lstr_ = QString (65000, 'l'); // Test temp buffer boundary. + o.snstr_ = QString (512, QChar (0x1234)); + o.lnstr_ = QString (65536, QChar (0x2345)); + o.sbuf_ = QByteArray (512, 0x01); + o.lbuf_ = QByteArray (65536, 0x02); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + object* ol = db->load (o.id_); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile new file mode 100644 index 0000000..181e2ef --- /dev/null +++ b/qt/mssql/basic/makefile @@ -0,0 +1,116 @@ +# file : qt/mssql/basic/makefile +# author : Constantin Michael +# 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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 mssql --profile qt/basic \ +--generate-schema --table-prefix qt_mssql_basic_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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)/qt/mssql/,,$(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 schema) + $(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/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx new file mode 100644 index 0000000..245d1ee --- /dev/null +++ b/qt/mssql/basic/test.hxx @@ -0,0 +1,48 @@ +// file : qt/mssql/basic/test.hxx +// author : Constantin Michael +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id_ == x.id_ && + sstr_ == x.sstr_ && + lstr_ == x.lstr_ && + snstr_ == x.snstr_ && + lnstr_ == x.lnstr_ && + sbuf_ == x.sbuf_ && + lbuf_ == x.lbuf_; + } + + #pragma db id + QString id_; + + QString sstr_; + + #pragma db type ("VARCHAR(max)") + QString lstr_; + + #pragma db type ("NVARCHAR(512)") + QString snstr_; + + #pragma db type ("NVARCHAR(max)") + QString lnstr_; + + #pragma db type ("VARBINARY(512)") + QByteArray sbuf_; + + QByteArray lbuf_; +}; + +#endif // TEST_HXX diff --git a/qt/mssql/basic/test.std b/qt/mssql/basic/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 1fde6335608b81d0aff2f57414104c619f15b145 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 12:53:46 +0200 Subject: Remove unnecessary #include --- qt/oracle/date-time/test.hxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 5396d4f..1f10411 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -6,8 +6,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include - #include #include -- cgit v1.1 From 36b0ca2e8b8f35b977599122e39001e242969abf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 13:06:01 +0200 Subject: Uncomment temporarily disabled test code, remove unneeded section --- qt/oracle/date-time/driver.cxx | 47 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 2d9b46d..f6c5400 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -51,32 +51,27 @@ main (int argc, char* argv[]) assert (ol->is_null ()); } - // // Check persistence of valid dates and times. - // // - // QDateTime t (QDateTime::currentDateTime ()); - - // t.setTime (QTime (t.time ().hour (), - // t.time ().minute (), - // t.time ().second (), - // t.time ().msec ())); - - // o.date = t.date (); - // o.date_time = t; - // o.time = t.time (); - - // { - // transaction t (db->begin ()); - // db->persist (o); - // t.commit (); - // } - - // { - // transaction t (db->begin ()); - // auto_ptr ol (db->load (o.id)); - // t.commit (); - - // assert (*ol == o); - // } + // Check persistence of valid dates and times. + // + QDateTime t (QDateTime::currentDateTime ()); + + o.date = t.date (); + o.date_time = t; + o.time = t.time (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } } catch (const odb::exception& e) { -- cgit v1.1 From 8ac6762591c207cf58498ceb92c05d736078c00c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 14 Jan 2012 14:48:39 +0200 Subject: Enable query support in SQL Server types test --- mssql/types/makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mssql/types/makefile b/mssql/types/makefile index 96f7d68..a75fba5 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -36,7 +36,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---hxx-prologue '\#include "traits.hxx"' --table-prefix mssql_types_ +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--table-prefix mssql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From b53e7c4aa82f7fca4d6ce166a58dc518a37d561e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Jan 2012 09:48:52 +0200 Subject: Use 'else if' make construct --- libcommon/common/makefile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libcommon/common/makefile b/libcommon/common/makefile index accf285..842f8e4 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -51,17 +51,13 @@ $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/. @echo '' >>$@ ifeq ($(db_id),mysql) @echo '#define DATABASE_MYSQL 1' >>$@ -endif -ifeq ($(db_id),sqlite) +else ifeq ($(db_id),sqlite) @echo '#define DATABASE_SQLITE 1' >>$@ -endif -ifeq ($(db_id),pgsql) +else ifeq ($(db_id),pgsql) @echo '#define DATABASE_PGSQL 1' >>$@ -endif -ifeq ($(db_id),oracle) +else ifeq ($(db_id),oracle) @echo '#define DATABASE_ORACLE 1' >>$@ -endif -ifeq ($(db_id),mssql) +else ifeq ($(db_id),mssql) @echo '#define DATABASE_MSSQL 1' >>$@ endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ -- cgit v1.1 From ef14f12b15f3a7414594eb6f340a6ab9e6e209b8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Jan 2012 17:00:21 +0200 Subject: Misc fixes --- m4/libodb-oracle.m4 | 2 +- m4/oracle.m4 | 2 +- mysql-driver.bat | 2 +- oracle-driver.bat | 2 +- pgsql-driver.bat | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 319377f..8c3d38a 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -64,7 +64,7 @@ main () } ]]), [libodb_oracle_found=yes]) -libodb_oracle_found=yes + if test x"$libodb_oracle_found" = xno; then LIBS="$save_LIBS" diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 80e3600..ec3d235 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -93,7 +93,7 @@ elif test x$oracle_user = xodb_test; then AC_MSG_RESULT(['$oracle_password']) elif test x$oracle_user != x/; then AC_MSG_RESULT([none]) - AC_MSG_ERROR([password not specfied; Oracle requires a password]) + AC_MSG_ERROR([password not specified; Oracle requires a password (--with-oracle-password=PASS)]) fi # Service name. diff --git a/mysql-driver.bat b/mysql-driver.bat index b11b1e6..c28c232 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -8,7 +8,7 @@ rem rem mysql-driver.bat sql-file rem rem Run the mysql client on the SQL file specified. Adjust the -rem option below to match your MySQL setup. +rem options below to match your MySQL setup. rem setlocal diff --git a/oracle-driver.bat b/oracle-driver.bat index 7f531ed..c8d500f 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -8,7 +8,7 @@ rem rem oracle-driver.bat sql-file rem rem Run the oracle client on the SQL file specified. Adjust the -rem option below to match your Oracle setup. +rem options below to match your Oracle setup. rem setlocal diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 338d00d..9d9551a 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -8,7 +8,7 @@ rem rem pgsql-driver.bat sql-file rem rem Run the pgsql client on the SQL file specified. Adjust the -rem option below to match your PostgreSQL setup. +rem options below to match your PostgreSQL setup. rem setlocal -- cgit v1.1 From c9a94e547659e48ced103a58e9ca260199e79095 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 12:37:34 +0200 Subject: Restore building database-specific tests --- build.bat | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.bat b/build.bat index 7ec749d..4afe3a2 100644 --- a/build.bat +++ b/build.bat @@ -79,6 +79,14 @@ for %%c in (%confs%) do ( ) ) +for %%d in (%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 -- cgit v1.1 From 8a7ade2e937145398156380a31c0f0574b5b7b1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:42:25 +0200 Subject: Cosmetic change --- common/erase-query/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index adbdb76..0880f62 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -172,7 +172,7 @@ main (int argc, char* argv[]) #endif t.commit (); } -} + } catch (const odb::exception& e) { cerr << e.what () << endl; -- cgit v1.1 From 151e92a20374d9259d8a0686916293749740ed88 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:43:20 +0200 Subject: Rewrite size() function to not rely in DATABSE_* macros in header Those are not defined for some tests (e.g., database-specific tests built with VC++ project). --- libcommon/common/common.cxx | 12 ++++++++++++ libcommon/common/common.hxx | 17 +++-------------- libcommon/common/common.txx | 26 ++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 libcommon/common/common.txx diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 66a629f..8be7631 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -141,3 +141,15 @@ create_database (int& argc, return db; } + +bool +size_available () +{ +#if defined(DATABASE_SQLITE) || \ + defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) + return false; +#else + return true; +#endif +} diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 2cf2357..da3737a 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -12,7 +12,6 @@ #include // odb::database #include -#include #include // Make sure assert() is not disabled. @@ -32,18 +31,8 @@ create_database (int& argc, // template std::size_t -size (odb::result& r) -{ - std::size_t n (0); -#if defined(DATABASE_SQLITE) || \ - defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) - for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) - n++; -#else - n = r.size (); -#endif - return n; -} +size (odb::result&); + +#include #endif // LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx new file mode 100644 index 0000000..ef1461e --- /dev/null +++ b/libcommon/common/common.txx @@ -0,0 +1,26 @@ +// file : libcommon/common/common.txx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// We have to use this helper function instead of just checking which +// database is used because the DATABASE_* macro may not be defined +// in a project that includes this header. +// +LIBCOMMON_EXPORT bool +size_available (); + +template +std::size_t +size (odb::result& r) +{ + if (size_available ()) + return r.size (); + else + { + std::size_t n (0); + for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) + n++; + return n; + } +} -- cgit v1.1 From b9e842132ce9d7f1edce15868d205a1e8c77816c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:44:57 +0200 Subject: Don't use 'D' suffix (for double) since it is not portable --- mssql/types/driver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 005214a..3cef5ad 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -42,15 +42,15 @@ main (int argc, char* argv[]) o.sbint_ = -1234567890123456789LL; o.fsm_ = -214748.3648F; - o.dsm_ = 214748.3647D; + o.dsm_ = 214748.3647; o.ism_ = -2147483647 -1; - o.dm1_ = -922337203685477.5808D; - o.dm2_ = 922337203685476.3520D; // 922337203685477.5807 + o.dm1_ = -922337203685477.5808; + o.dm2_ = 922337203685476.3520; // 922337203685477.5807 o.im_ = 9223372036854775807LL; o.f4_ = 123.123F; - o.f8_ = 123.1234567D; + o.f8_ = 123.1234567; o.schar_ = "short data char "; o.svchar_ = "short data varchar"; -- cgit v1.1 From efe50036fbdca051ac44e76a7b0b8be37076dc9a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:45:34 +0200 Subject: Don't use min as variable name since it is macro in VC++ --- oracle/types/traits.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 46223ea..e47e1ea 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -31,15 +31,15 @@ namespace odb if (!is_null) { short y (0); - unsigned char m (0), d (0), h (0), min (0), s (0); + unsigned char m (0), d (0), h (0), mins (0), s (0); - details::get_date (i, y, m, d, h, min, s); + details::get_date (i, y, m, d, h, mins, s); v.year = y; v.month = m; v.day = d; v.hour = h; - v.minute = min; + v.minute = mins; v.second = s; // Oracle DATE does not support fractional seconds. @@ -76,16 +76,16 @@ namespace odb if (!is_null) { sb2 y (0); - ub1 m (0), d (0), h (0), min (0), s (0); + ub1 m (0), d (0), h (0), mins (0), s (0); ub4 ns (0); - i.get (y, m, d, h, min, s, ns); + i.get (y, m, d, h, mins, s, ns); v.year = y; v.month = m; v.day = d; v.hour = h; - v.minute = min; + v.minute = mins; v.second = s; v.nanosecond = ns; } -- cgit v1.1 From 605e4dee303f2a7b3b493e7a73faa09e61d88839 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jan 2012 16:46:51 +0200 Subject: Autotools and VC++ build support for SQL Server --- INSTALL | 1 + Makefile.am | 4 + boost/Makefile.am | 4 + boost/mssql/Makefile.am | 7 + boost/mssql/boost-mssql-vc10.sln | 15 + boost/mssql/boost-mssql-vc9.sln | 15 + boost/mssql/template/Makefile.am | 32 ++ boost/mssql/template/template-vc10.vcxproj | 180 ++++++++++ boost/mssql/template/template-vc10.vcxproj.filters | 25 ++ boost/mssql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ boost/mssql/test.bat | 70 ++++ configure.ac | 4 + libcommon/common/config.h.in | 1 + m4/database.m4 | 5 + m4/libodb-mssql.m4 | 84 +++++ m4/mssql.m4 | 226 +++++++++++++ makefile | 2 +- mssql-driver.bat | 63 ++++ mssql.options | 10 + mssql/Makefile.am | 7 + mssql/mssql-vc10.sln | 15 + mssql/mssql-vc9.sln | 15 + mssql/template/Makefile.am | 32 ++ mssql/template/template-vc10.vcxproj | 180 ++++++++++ mssql/template/template-vc10.vcxproj.filters | 25 ++ mssql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ mssql/test.bat | 70 ++++ qt/Makefile.am | 4 + qt/mssql/Makefile.am | 7 + qt/mssql/qt-mssql-vc10.sln | 15 + qt/mssql/qt-mssql-vc9.sln | 15 + qt/mssql/template/Makefile.am | 32 ++ qt/mssql/template/template-vc10.vcxproj | 180 ++++++++++ qt/mssql/template/template-vc10.vcxproj.filters | 25 ++ qt/mssql/template/template-vc9.vcproj | 361 +++++++++++++++++++++ qt/mssql/test.bat | 70 ++++ 36 files changed, 2522 insertions(+), 1 deletion(-) create mode 100644 boost/mssql/Makefile.am create mode 100644 boost/mssql/boost-mssql-vc10.sln create mode 100644 boost/mssql/boost-mssql-vc9.sln create mode 100644 boost/mssql/template/Makefile.am create mode 100644 boost/mssql/template/template-vc10.vcxproj create mode 100644 boost/mssql/template/template-vc10.vcxproj.filters create mode 100644 boost/mssql/template/template-vc9.vcproj create mode 100644 boost/mssql/test.bat create mode 100644 m4/libodb-mssql.m4 create mode 100644 m4/mssql.m4 create mode 100644 mssql-driver.bat create mode 100644 mssql.options create mode 100644 mssql/Makefile.am create mode 100644 mssql/mssql-vc10.sln create mode 100644 mssql/mssql-vc9.sln create mode 100644 mssql/template/Makefile.am create mode 100644 mssql/template/template-vc10.vcxproj create mode 100644 mssql/template/template-vc10.vcxproj.filters create mode 100644 mssql/template/template-vc9.vcproj create mode 100644 mssql/test.bat create mode 100644 qt/mssql/Makefile.am create mode 100644 qt/mssql/qt-mssql-vc10.sln create mode 100644 qt/mssql/qt-mssql-vc9.sln create mode 100644 qt/mssql/template/Makefile.am create mode 100644 qt/mssql/template/template-vc10.vcxproj create mode 100644 qt/mssql/template/template-vc10.vcxproj.filters create mode 100644 qt/mssql/template/template-vc9.vcproj create mode 100644 qt/mssql/test.bat diff --git a/INSTALL b/INSTALL index 2828c4f..af84129 100644 --- a/INSTALL +++ b/INSTALL @@ -5,6 +5,7 @@ system you would like to use. Valid values for are: 'sqlite' - The SQLite database system 'pgsql' - The PostgreSQL database system 'oracle' - The Oracle database system + 'mssql' - The Microsoft SQL Server database system Prerequisites ============= diff --git a/Makefile.am b/Makefile.am index 9b1360e..d6cfce3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,5 +29,9 @@ if DATABASE_ORACLE SUBDIRS += oracle endif +if DATABASE_MSSQL +SUBDIRS += mssql +endif + EXTRA_DIST = __file__(extra_dist) ACLOCAL_AMFLAGS = -I m4 diff --git a/boost/Makefile.am b/boost/Makefile.am index a18e3f7..5363e6f 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -21,4 +21,8 @@ if DATABASE_ORACLE SUBDIRS += oracle endif +if DATABASE_MSSQL +SUBDIRS += mssql +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am new file mode 100644 index 0000000..76af29a --- /dev/null +++ b/boost/mssql/Makefile.am @@ -0,0 +1,7 @@ +# file : boost/mssql/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) diff --git a/boost/mssql/boost-mssql-vc10.sln b/boost/mssql/boost-mssql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/boost/mssql/boost-mssql-vc10.sln @@ -0,0 +1,15 @@ + +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/boost/mssql/boost-mssql-vc9.sln b/boost/mssql/boost-mssql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/boost/mssql/boost-mssql-vc9.sln @@ -0,0 +1,15 @@ + +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/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am new file mode 100644 index 0000000..6ac8d13 --- /dev/null +++ b/boost/mssql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : boost/mssql/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/boost/mssql/template/template-vc10.vcxproj b/boost/mssql/template/template-vc10.vcxproj new file mode 100644 index 0000000..a8e32bb --- /dev/null +++ b/boost/mssql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.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/boost/mssql/template/template-vc10.vcxproj.filters b/boost/mssql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/boost/mssql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/boost/mssql/template/template-vc9.vcproj b/boost/mssql/template/template-vc9.vcproj new file mode 100644 index 0000000..905f55a --- /dev/null +++ b/boost/mssql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/boost/mssql/test.bat b/boost/mssql/test.bat new file mode 100644 index 0000000..a13b843 --- /dev/null +++ b/boost/mssql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : boost/mssql/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 mssql %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/configure.ac b/configure.ac index a44248d..f32e4fa 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,10 @@ case $database in LIBODB_ORACLE([], [AC_MSG_ERROR([libodb-oracle is not found; consider using --with-libodb-oracle=DIR])]) ORACLE ;; + mssql) + LIBODB_MSSQL([], [AC_MSG_ERROR([libodb-mssql is not found; consider using --with-libodb-mssql=DIR])]) + MSSQL + ;; esac # Define LIBCOMMON_STATIC_LIB if we are build static library on certain diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index b7cc545..2a98025 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -13,6 +13,7 @@ #undef DATABASE_SQLITE #undef DATABASE_PGSQL #undef DATABASE_ORACLE +#undef DATABASE_MSSQL #undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB diff --git a/m4/database.m4 b/m4/database.m4 index a2d72eb..e334e91 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -35,6 +35,10 @@ AC_ARG_WITH( database=oracle AC_DEFINE([DATABASE_ORACLE], [1], [Using Oracle.]) ;; + mssql) + database=mssql + AC_DEFINE([DATABASE_MSSQL], [1], [Using SQL Server.]) + ;; *) AC_MSG_RESULT([]) AC_MSG_ERROR([unknown database $withval]) @@ -52,5 +56,6 @@ AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) AM_CONDITIONAL([DATABASE_SQLITE], [test x$database = xsqlite]) AM_CONDITIONAL([DATABASE_PGSQL], [test x$database = xpgsql]) AM_CONDITIONAL([DATABASE_ORACLE], [test x$database = xoracle]) +AM_CONDITIONAL([DATABASE_MSSQL], [test x$database = xmssql]) ])dnl diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 new file mode 100644 index 0000000..acddfd4 --- /dev/null +++ b/m4/libodb-mssql.m4 @@ -0,0 +1,84 @@ +dnl file : m4/libodb-mssql.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_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBODB_MSSQL], [ +libodb_mssql_found=no + +AC_ARG_WITH( + [libodb-mssql], + [AC_HELP_STRING([--with-libodb-mssql=DIR],[location of libodb-mssql build directory])], + [libodb_mssql_dir=${withval}], + [libodb_mssql_dir=]) + +AC_MSG_CHECKING([for libodb-mssql]) + +# If libodb_mssql_dir was given, add the necessary preprocessor and +# linker flags. +# +if test x"$libodb_mssql_dir" != x; then + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + + AS_SET_CATFILE([abs_libodb_mssql_dir], [$ac_pwd], [$libodb_mssql_dir]) + + CPPFLAGS="$CPPFLAGS -I$abs_libodb_mssql_dir" + LDFLAGS="$LDFLAGS -L$abs_libodb_mssql_dir/odb/mssql" +fi + +save_LIBS="$LIBS" +LIBS="-lodb-mssql $LIBS" + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +void +f () +{ +} + +const char* +g () +{ + try + { + f (); + } + catch (const odb::mssql::database_exception& e) + { + return e.what (); + } + return 0; +} + +int +main () +{ + const char* m (g ()); + return m != 0; +} +]]), +[libodb_mssql_found=yes]) + +if test x"$libodb_mssql_found" = xno; then + LIBS="$save_LIBS" + + if test x"$libodb_mssql_dir" != x; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + fi +fi + +if test x"$libodb_mssql_found" = xyes; then + AC_MSG_RESULT([yes]) + $1 +else + AC_MSG_RESULT([no]) + $2 +fi +])dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 new file mode 100644 index 0000000..c446f31 --- /dev/null +++ b/m4/mssql.m4 @@ -0,0 +1,226 @@ +dnl file : m4/mssql.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 MSSQL +dnl +AC_DEFUN([MSSQL], [ + +# Client. +# +AC_MSG_CHECKING([for mssql client program]) +AC_ARG_WITH( + [mssql-client], + [AC_HELP_STRING([--with-mssql-client=PATH], [SQL Server client program path (sqlcmd by default)])], + [case $withval in + yes) + mssql_client=sqlcmd + ;; + no) + AC_MSG_RESULT([]) + AC_MSG_ERROR([need mssql client to run the tests]) + ;; + *) + mssql_client=$withval + ;; + esac], + [mssql_client=sqlcmd]) + +$mssql_client -? 2>/dev/null 1>&2 + +if test x"$?" = x0; then + AC_MSG_RESULT([$mssql_client]) +else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([mssql client is not found; consider using --with-mssql-client=PATH]) +fi + +# User. If 'no' is specified, then use Windows authentication. +# +AC_MSG_CHECKING([for mssql database user]) +AC_ARG_WITH( + [mssql-user], + [AC_HELP_STRING([--with-mssql-user=NAME], [SQL Server database user (odb_test by default)])], + [case $withval in + yes) + mssql_user=odb_test + mssql_user_set=yes + ;; + no) + mssql_user_set=no + ;; + *) + mssql_user=$withval + mssql_user_set=yes + ;; + esac], + [mssql_user=odb_test + mssql_user_set=yes]) + +if test x$mssql_user_set = xyes; then + AC_MSG_RESULT(['$mssql_user']) +else + AC_MSG_RESULT([none]) +fi + +# Password. Can be left unspecified if using Windows authentication. +# +AC_MSG_CHECKING([for mssql database password]) +AC_ARG_WITH( + [mssql-password], + [AC_HELP_STRING([--with-mssql-password=PASS], [SQL Server database password (odb_test by default)])], + [case $withval in + yes) + mssql_password=odb_test + mssql_password_set=yes + ;; + no) + mssql_password_set=no + ;; + *) + mssql_password=$withval + mssql_password_set=yes + ;; + esac], + [mssql_password_set=no]) + +if test x$mssql_password_set = xyes; then + AC_MSG_RESULT(['$mssql_password']) +elif test x$mssql_user = xodb_test; then + mssql_password=odb_test + mssql_password_set=yes + AC_MSG_RESULT(['$mssql_password']) +else + AC_MSG_RESULT([none]) + if test x$mssql_user_set = xyes; then + AC_MSG_ERROR([password not specified; SQL Server requires a password (--with-mssql-password=PASS)]) + fi +fi + +# Database. If not specified, use the user's default. +# +AC_MSG_CHECKING([for mssql database name]) +AC_ARG_WITH( + [mssql-db], + [AC_HELP_STRING([--with-mssql-db=NAME], [SQL Server database name (odb_test by default). Note that all data in this database WILL BE LOST!])], + [case $withval in + yes) + mssql_db=odb_test + mssql_db_set=yes + ;; + no) + mssql_db_set=no + ;; + *) + mssql_db=$withval + mssql_db_set=yes + ;; + esac], + [mssql_db=odb_test + mssql_db_set=yes]) + +if test x$mssql_db_set = xyes; then + AC_MSG_RESULT(['$mssql_db']) +else + AC_MSG_RESULT([default]) +fi + +# Server. +# +AC_MSG_CHECKING([for mssql instance address]) +AC_ARG_WITH( + [mssql-server], + [AC_HELP_STRING([--with-mssql-server=ADDR], [SQL Server instance address])], + [case $withval in + yes | no) + mssql_server_set=no + ;; + *) + mssql_server=$withval + mssql_server_set=yes + ;; + esac], + [mssql_server_set=no]) + +if test x$mssql_server_set = xyes; then + AC_MSG_RESULT(['$mssql_server']) +else + AC_MSG_RESULT([none]) + AC_MSG_ERROR([instance address not specified; SQL Server instance address is required (--with-mssql-server=ADDR)]) +fi + +# Driver. +# +AC_MSG_CHECKING([for mssql native client odbc driver]) +AC_ARG_WITH( + [mssql-driver], + [AC_HELP_STRING([--with-mssql-driver=NAME], [SQL Server Native Client ODBC driver (latest available by default)])], + [case $withval in + yes | no) + mssql_driver_set=no + ;; + *) + mssql_driver=$withval + mssql_driver_set=yes + ;; + esac], + [mssql_driver_set=no]) + +if test x$mssql_driver_set = xyes; then + AC_MSG_RESULT(['$mssql_driver']) +else + AC_MSG_RESULT([latest]) +fi + +# Create options file. +# +AC_CONFIG_COMMANDS([mssql.options], + [ + rm -f db.options + echo '#! /bin/sh' >db-driver + + echo 'opt=' >>db-driver + + if test x$mssql_user_set = xyes; then + echo "--user '$mssql_user'" >>db.options + echo 'opt="$opt -U '"$mssql_user"'"' >>db-driver + + echo "--password '$mssql_password'" >>db.options + echo 'opt="$opt -P '"$mssql_password"'"' >>db-driver + fi + + if test x$mssql_db_set = xyes; then + echo "--database '$mssql_db'" >>db.options + echo 'opt="$opt -d '"$mssql_db"'"' >>db-driver + fi + + echo "--server '$mssql_server'" >>db.options + echo 'opt="$opt -S '"$mssql_server"'"' >>db-driver + + if test x$mssql_driver_set = xyes; then + echo "--driver '$mssql_driver'" >>db.options + fi + + echo 'opt="$opt -x -r -b"' >>db-driver + echo 'if test x$[]1 != x; then' >>db-driver + echo " exec $mssql_client "'$opt -i $[]1' >>db-driver + echo "else" >>db-driver + echo " exec $mssql_client "'$opt' >>db-driver + echo "fi" >>db-driver + + chmod +x db-driver + ], + [ + mssql_client="$mssql_client" + mssql_user="$mssql_user" + mssql_user_set="$mssql_user_set" + mssql_password="$mssql_password" + mssql_db="$mssql_db" + mssql_db_set="$mssql_db_set" + mssql_server="$mssql_server" + mssql_driver="$mssql_driver" + mssql_driver_set="$mssql_driver_set" + ]) + +])dnl diff --git a/makefile b/makefile index 576792d..c26c717 100644 --- a/makefile +++ b/makefile @@ -19,7 +19,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): data_dist := GPLv2 LICENSE README INSTALL version test.bat \ tester.bat mysql-driver.bat mysql.options sqlite-driver.bat \ sqlite.options pgsql-driver.bat pgsql.options oracle.options \ -oracle-driver.bat +oracle-driver.bat mssql.options mssql-driver.bat $(dist): exec_dist := bootstrap tester.in $(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat $(dist): export version = $(shell cat $(src_root)/version) diff --git a/mssql-driver.bat b/mssql-driver.bat new file mode 100644 index 0000000..55ed487 --- /dev/null +++ b/mssql-driver.bat @@ -0,0 +1,63 @@ +@echo off +rem file : mssql-driver.bat +rem author : Boris Kolpackov +rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem mssql-driver.bat sql-file +rem +rem Run the mssql client on the SQL file specified. Adjust the +rem options below to match your SQL Server setup. +rem + +setlocal + +set "options=%MSSQL_OPTIONS%" + +rem User. +rem +set "options=%options% -U odb_test" + +rem Password. +rem +set "options=%options% -P odb_test" + +rem Database name. +rem +set "options=%options% -d odb_test" + +rem SQL Server instance address. +rem +rem set "options=%options% -S host\instance" +rem set "options=%options% -S tcp:host,port" + +rem Standard options. +rem +set "options=%options% -x -r -b" + +set "mssql=%MSSQL_CLIENT%" + +if "_%mssql%_" == "__" set "mssql=sqlcmd" + +if "_%1_" == "__" ( + echo no sql file specified + goto usage +) + +%mssql% %options% -i %1 + +if errorlevel 1 goto error +goto end + +:usage +echo. +echo usage: mssql-driver.bat sql-file +echo. + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/mssql.options b/mssql.options new file mode 100644 index 0000000..6e201e2 --- /dev/null +++ b/mssql.options @@ -0,0 +1,10 @@ +# Sample Microsoft SQL Server options file used to run the tests. Adjust to +# match your SQL Server setup. +# + +--user odb_test +--password odb_test +--database odb_test +# --server host\instance +# --server tcp:host,port +# --driver diff --git a/mssql/Makefile.am b/mssql/Makefile.am new file mode 100644 index 0000000..434664d --- /dev/null +++ b/mssql/Makefile.am @@ -0,0 +1,7 @@ +# file : mssql/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) diff --git a/mssql/mssql-vc10.sln b/mssql/mssql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/mssql/mssql-vc10.sln @@ -0,0 +1,15 @@ + +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/mssql/mssql-vc9.sln b/mssql/mssql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/mssql/mssql-vc9.sln @@ -0,0 +1,15 @@ + +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/mssql/template/Makefile.am b/mssql/template/Makefile.am new file mode 100644 index 0000000..7e1b579 --- /dev/null +++ b/mssql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : mssql/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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/mssql/template/template-vc10.vcxproj b/mssql/template/template-vc10.vcxproj new file mode 100644 index 0000000..afd612e --- /dev/null +++ b/mssql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.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/mssql/template/template-vc10.vcxproj.filters b/mssql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/mssql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/mssql/template/template-vc9.vcproj b/mssql/template/template-vc9.vcproj new file mode 100644 index 0000000..53bef019 --- /dev/null +++ b/mssql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/mssql/test.bat b/mssql/test.bat new file mode 100644 index 0000000..46db55e --- /dev/null +++ b/mssql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : mssql/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 mssql %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/qt/Makefile.am b/qt/Makefile.am index 9c22df3..95d34d5 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -21,4 +21,8 @@ if DATABASE_ORACLE SUBDIRS += oracle endif +if DATABASE_MSSQL +SUBDIRS += mssql +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am new file mode 100644 index 0000000..4ed226a --- /dev/null +++ b/qt/mssql/Makefile.am @@ -0,0 +1,7 @@ +# file : qt/mssql/Makefile.am +# author : Constantin Michael +# 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) diff --git a/qt/mssql/qt-mssql-vc10.sln b/qt/mssql/qt-mssql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mssql/qt-mssql-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/qt-mssql-vc9.sln b/qt/mssql/qt-mssql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mssql/qt-mssql-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am new file mode 100644 index 0000000..ea290f1 --- /dev/null +++ b/qt/mssql/template/Makefile.am @@ -0,0 +1,32 @@ +# file : qt/mssql/template/Makefile.am +# author : Constantin Michael +# 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_builddir)/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +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/qt/mssql/template/template-vc10.vcxproj b/qt/mssql/template/template-vc10.vcxproj new file mode 100644 index 0000000..d913afc --- /dev/null +++ b/qt/mssql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.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/qt/mssql/template/template-vc10.vcxproj.filters b/qt/mssql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/qt/mssql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__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/qt/mssql/template/template-vc9.vcproj b/qt/mssql/template/template-vc9.vcproj new file mode 100644 index 0000000..dc38c43 --- /dev/null +++ b/qt/mssql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__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/qt/mssql/test.bat b/qt/mssql/test.bat new file mode 100644 index 0000000..5629a6b --- /dev/null +++ b/qt/mssql/test.bat @@ -0,0 +1,70 @@ +@echo off +rem file : qt/mssql/test.bat +rem author : Constantin Michael +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 mssql %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 -- cgit v1.1 From 092163ffe44f64387508a0770948636f79ae139d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Jan 2012 14:34:06 +0200 Subject: Add support for configuring test suite with additional macros --- INSTALL | 43 ++++++++++++++++++++++++++++ boost/mssql/date-time/driver.cxx | 6 ++++ boost/mssql/date-time/test.hxx | 33 ++++++++++++++-------- mssql/types/driver.cxx | 8 ++++++ mssql/types/test.hxx | 34 +++++++++++++--------- qt/mssql/date-time/driver.cxx | 4 +++ qt/mssql/date-time/test.hxx | 61 +++++++++++++++++++++++++--------------- 7 files changed, 141 insertions(+), 48 deletions(-) diff --git a/INSTALL b/INSTALL index af84129..6a59aee 100644 --- a/INSTALL +++ b/INSTALL @@ -163,3 +163,46 @@ odb-tests\ directory. Once this is done, you can run the tests by executing the following command from the command prompt: test.bat + + +Test Suite Configuration +======================== + +The test suite supports additional configuration via the following +preprocessor macros: + +HOST_WIN32 Specifies that the tests will run on Windows. This + macro is only needed when cross-compiling for Windows + using, for example, a cross-compiler to MinGW. + +MSSQL_SERVER_VERSION Specifies the SQL Server version that will be used to + run the tests. The version is specified as XXYY where + XX is the major and YY is the minor SQL Server versions, + for example, 900 (SQL Server 2005/9.0), 1000 (2008/10.0), + 1050 (2008R2/10.5), 1100 (2012/11.0). If this macro is + not defined, then the test suite assumes SQL Server 2008. + +To define any of these macros when building on UNIX operating systems you +can use the CPPFLAGS configure variable, for example: + +./configure CPPFLAGS=-DMSSQL_SERVER_VERSION=900 + +When building on Windows with Visual Studio the extra macros have to be +specified in two places: in the default.options ODB configuration file +(located in the odb-X.Y.Z-i686-windows\etc\odb\ directory) as well as +in the CL environment variable. For example, to specify the SQL Server +version add the following line to the default.options file: + +-DMSSQL_SERVER_VERSION=900 + +As well as set the CL environment variable before running the build.bat +batch file: + +SET CL=-DMSSQL_SERVER_VERSION=900 + +If you are using the Visual Studio IDE to build the tests, then you will +need to start the IDE from a command prompt after setting the CL variable, +for example: + +SET CL=-DMSSQL_SERVER_VERSION=900 +C:\Program Files (x86)\Microsoft Visual Studio \Common7\IDE\devenv.com diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index d48f90b..55cbdb0 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -44,6 +44,7 @@ main (int argc, char* argv[]) // Test all valid date-time mappings. // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.dates.push_back (day_clock::local_day ()); o.dates.push_back (date (not_a_date_time)); o.dates.push_back (date (max_date_time)); @@ -53,6 +54,7 @@ main (int argc, char* argv[]) o.times.push_back (not_a_date_time); o.times.push_back (min_date_time); o.times.push_back (ptime (max_date_time)); +#endif // In DATETIME fractional seconds are rounded to .000, .003, or .007. // @@ -64,8 +66,10 @@ main (int argc, char* argv[]) o.times_sdt.push_back (ptime (date (2012, 1, 13), time_duration (11, 57, 0, 0))); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.durations.push_back (time_duration (1, 2, 3, 123456)); o.durations.push_back (not_a_date_time); +#endif { transaction t (db->begin ()); @@ -81,6 +85,7 @@ main (int argc, char* argv[]) assert (*ol == o); } +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 // Test invalid date mappings. // { @@ -130,6 +135,7 @@ main (int argc, char* argv[]) t.commit (); } +#endif } catch (const odb::exception& e) { diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index 7bbd15d..ddf38f6 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -20,24 +20,14 @@ struct object { } - bool - operator== (const object& x) const - { - return - id == x.id && - dates == x.dates && - times == x.times && - times_dt == x.times_dt && - times_sdt == x.times_sdt && - durations == x.durations; - } - #pragma db id auto unsigned long id; +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 std::vector dates; std::vector times; +#endif #pragma db value_type("DATETIME") std::vector times_dt; @@ -45,7 +35,26 @@ struct object #pragma db value_type("SMALLDATETIME") std::vector times_sdt; +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 std::vector durations; +#endif + + bool + operator== (const object& x) const + { + return + id == x.id +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && dates == x.dates + && times == x.times +#endif + && times_dt == x.times_dt + && times_sdt == x.times_sdt +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && durations == x.durations +#endif + ; + } }; #endif // TEST_HXX diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 3cef5ad..db814e2 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -78,14 +78,18 @@ main (int argc, char* argv[]) o.mvbin_.assign (ldata.begin (), ldata.end ()); o.image_.assign (ldata.begin (), ldata.end ()); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.date_ = date_time (2011, 12, 20, 0, 0, 0, 0, 0, 0); o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456789, 0, 0); o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); +#endif o.sdt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.dt2_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); o.dto7_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); +#endif #ifdef _WIN32 // 6F846D41-C89A-4E4D-B22F-56443CFA543F @@ -103,11 +107,15 @@ main (int argc, char* argv[]) t.commit (); } +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123400000, 0, 0); +#endif o.sdt_ = date_time (2011, 12, 20, 15, 44, 0, 0, 0, 0); o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123000000, 0, 0); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 0, 2, 0); +#endif // Load. // diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 7653ec6..57bc7b2 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -11,7 +11,7 @@ # define WIN32_LEAN_AND_MEAN # endif # include // GUID -#elif defined(WIN32_CROSS) +#elif defined(HOST_WIN32) typedef struct _GUID { unsigned int Data1; @@ -205,8 +205,9 @@ struct object #pragma db type ("IMAGE") std::vector image_; - // Date-time. + // Date-time. SQL Server 2005 (9.0) only has DATETIME and SMALLDATETIME. // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 #pragma db type ("DATE") date_time date_; @@ -215,6 +216,7 @@ struct object #pragma db type ("TIME(4)") date_time time4_; +#endif #pragma db type ("SMALLDATETIME") date_time sdt_; @@ -222,6 +224,7 @@ struct object #pragma db type ("DATETIME") date_time dt_; +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 #pragma db type ("DATETIME2") date_time dt2_; @@ -230,10 +233,11 @@ struct object #pragma db type ("DATETIMEOFFSET(0)") date_time dto0_; +#endif // Other types. // -#if defined(_WIN32) || defined(WIN32_CROSS) +#if defined(_WIN32) || defined(HOST_WIN32) //#pragma db type ("UNIQUEIDENTIFIER") GUID guid_; #endif @@ -280,16 +284,20 @@ struct object std::memcmp (lbin_, y.lbin_, sizeof (lbin_)) == 0 && lvbin_ == y.lvbin_ && mvbin_ == y.mvbin_ && - image_ == y.image_ && - - date_ == y.date_ && - time7_ == y.time7_ && - time4_ == y.time4_ && - sdt_ == y.sdt_ && - dt_ == y.dt_ && - dt2_ == y.dt2_ && - dto7_ == y.dto7_ && - dto0_ == y.dto0_ + image_ == y.image_ + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date_ == y.date_ + && time7_ == y.time7_ + && time4_ == y.time4_ +#endif + && sdt_ == y.sdt_ + && dt_ == y.dt_ +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && dt2_ == y.dt2_ + && dto7_ == y.dto7_ + && dto0_ == y.dto0_ +#endif #ifdef _WIN32 && std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0 diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 66d6b67..0e7681a 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -53,10 +53,12 @@ main (int argc, char* argv[]) // Check persistence of valid dates and times. // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 QDateTime t (QDateTime::currentDateTime ()); o.date = t.date (); o.date_time = t; +#endif // In DATETIME fractional seconds are rounded to .000, .003, or .007. // @@ -68,7 +70,9 @@ main (int argc, char* argv[]) o.date_time_sdt = QDateTime (QDate (2012, 1, 14), QTime (11, 57, 0, 0)); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.time = t.time (); +#endif { transaction t (db->begin ()); diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index c494efb..218baaa 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -13,35 +13,14 @@ #pragma db object struct object { - bool - operator== (const object& x) const - { - return - id == x.id && - date == x.date && - date_time == x.date_time && - date_time_dt == x.date_time_dt && - date_time_sdt == x.date_time_sdt && - time == x.time; - } - - bool - is_null () const - { - return - date.isNull () && - date_time.isNull () && - date_time_dt.isNull () && - date_time_sdt.isNull () && - time.isNull (); - } - #pragma db id auto unsigned long id; +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 QDate date; QDateTime date_time; +#endif #pragma db type ("DATETIME") QDateTime date_time_dt; @@ -49,7 +28,43 @@ struct object #pragma db type ("SMALLDATETIME") QDateTime date_time_sdt; +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 QTime time; +#endif + + bool + operator== (const object& x) const + { + return + id == x.id +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date == x.date + && date_time == x.date_time +#endif + && date_time_dt == x.date_time_dt + && date_time_sdt == x.date_time_sdt +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && time == x.time +#endif + ; + } + + bool + is_null () const + { + return + true +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date.isNull () + && date_time.isNull () +#endif + && date_time_dt.isNull () + && date_time_sdt.isNull () +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && time.isNull () +#endif + ; + } }; #endif // TEST_HXX -- cgit v1.1 From 32b8b828dc0e8ffea918c8cf9f07ba213ef63724 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Jan 2012 10:30:22 +0200 Subject: Work around SQL Server 2005 bug with long data and OUTPUT clause --- mssql/query/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql/query/makefile b/mssql/query/makefile index 808e48d..dce0c9c 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---generate-query --table-prefix mssql_query_ +--generate-query --mssql-server-version 9.0 --table-prefix mssql_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From d3905b172b7d3cd1df933f57072aee652d10c186 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Jan 2012 12:43:17 +0200 Subject: Implement support for database schema New pragma qualifier: namespace. New pragma specifier: schema. The table specifier was extended to accept a schema prefix. New option: --default- schema. The common/schema test was extended to cover the new functionality. --- common/schema/driver.cxx | 76 +++++++++++++++++++++++++++++++++++++++++-- common/schema/makefile | 2 +- common/schema/test.hxx | 85 ++++++++++++++++++++++++++++++++++++++++++++++-- common/schema/test.std | 1 - 4 files changed, 156 insertions(+), 8 deletions(-) diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index b53464c..eb1358e 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -3,7 +3,7 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test database schema creation. +// Test various aspects of database schema. // #include // std::auto_ptr @@ -28,11 +28,81 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + // Test database schema (aka database namespace). // - // - cout << "test 001" << endl; + using ns::object2; + + object2 o2; + o2.id = "aaa"; + o2.nums.push_back (1); + o2.nums.push_back (2); + o2.nums.push_back (3); + o2.obj1 = new object1; + o2.obj1->str = "aaa"; + + { + transaction t (db->begin ()); + db->persist (o2.obj1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2 (db->load ("aaa")); + t.commit (); + + assert (o2 == *p2); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::id == "aaa")); + assert (size (r) == 1); + } + + { + result r (db->query (query::obj1->str == "aaa")); + assert (size (r) == 1); + } + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object2::id == "aaa")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id2 == "aaa" && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + { + typedef odb::query query; + typedef odb::result result; + transaction t (db->begin ()); + + result r (db->query ()); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + t.commit (); } } diff --git a/common/schema/makefile b/common/schema/makefile index bc04d16..043e8a1 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix schema_ +--generate-query --table-prefix schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 45ffe9a..6c1bbd4 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -7,11 +7,13 @@ #define TEST_HXX #include +#include + #include // Table names. // -#pragma db object table ("TABLE_EXPLICIT") +#pragma db object table("TABLE_EXPLICIT") struct table_explicit { #pragma db id @@ -33,7 +35,7 @@ struct column #pragma db id int m1; - #pragma db column ("foo") + #pragma db column("foo") int m2; int m_m3; @@ -69,11 +71,88 @@ struct type double d; std::string str; - #pragma db type ("INTEGER") + #pragma db type("INTEGER") bool m1; #pragma db transient char* m2; }; +// Test database schema (aka database namespace). +// +#ifdef ODB_COMPILER +#if defined (ODB_DATABASE_MYSQL) +//# define DB_SCHEMA "odb_test" +# define DB_SCHEMA "" +#elif defined (ODB_DATABASE_SQLITE) +# define DB_SCHEMA "main" +#elif defined (ODB_DATABASE_PGSQL) +# define DB_SCHEMA "public" +#elif defined (ODB_DATABASE_ORACLE) +//# define DB_SCHEMA "ODB_TEST" +# define DB_SCHEMA "" +#elif defined(ODB_DATABASE_MSSQL) +# define DB_SCHEMA "dbo" +#else +# error unknown database +#endif +#endif + +namespace ns {typedef int my_int;} // Original. + +#pragma db object table(DB_SCHEMA."object_1") +struct object1 +{ + #pragma db id auto + unsigned long id; + + #pragma db column("str") + std::string str; +}; + +inline bool +operator== (const object1& x, const object1& y) +{ + return x.id == y.id && x.str == y.str; +} + +#pragma db namespace schema(DB_SCHEMA) +namespace ns // Extension. +{ + #pragma db object + struct object2 + { + object2 (): obj1 (0) {} + ~object2 () {delete obj1;} + + #pragma db id + std::string id; + + std::vector nums; + object1* obj1; + }; + + inline bool + operator== (const object2& x, const object2& y) + { + return x.id == y.id && x.nums == y.nums && *x.obj1 == *y.obj1; + } +} + +#pragma db view object(object1) object(ns::object2) +struct object_view +{ + #pragma db column(ns::object2::id) + std::string id2; + + std::string str; +}; + +#pragma db view table(DB_SCHEMA."schema_object_1") +struct table_view +{ + #pragma db column(DB_SCHEMA."schema_object_1"."str") + std::string str; +}; + #endif // TEST_HXX diff --git a/common/schema/test.std b/common/schema/test.std index af8d8e7..e69de29 100644 --- a/common/schema/test.std +++ b/common/schema/test.std @@ -1 +0,0 @@ -test 001 -- cgit v1.1 From dae71f180120d7a7e22262220410913d77aa1767 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Jan 2012 14:25:57 +0200 Subject: Remove author field from file header Too much effort to maintain. --- Makefile.am | 1 - boost/Makefile.am | 1 - boost/build.bat | 1 - boost/common/Makefile.am | 1 - boost/common/makefile | 1 - boost/common/optional/driver.cxx | 1 - boost/common/optional/makefile | 1 - boost/common/optional/test.hxx | 1 - boost/common/smart-ptr/driver.cxx | 1 - boost/common/smart-ptr/makefile | 1 - boost/common/smart-ptr/test.hxx | 1 - boost/common/template/Makefile.am | 1 - boost/common/template/driver.cxx | 1 - boost/common/template/makefile | 1 - boost/common/template/test.hxx | 1 - boost/common/test.bat | 1 - boost/common/unordered/driver.cxx | 1 - boost/common/unordered/makefile | 1 - boost/common/unordered/test.hxx | 1 - boost/makefile | 1 - boost/mssql/Makefile.am | 1 - boost/mssql/date-time/driver.cxx | 1 - boost/mssql/date-time/makefile | 1 - boost/mssql/date-time/test.hxx | 1 - boost/mssql/makefile | 1 - boost/mssql/template/Makefile.am | 1 - boost/mssql/template/driver.cxx | 1 - boost/mssql/template/makefile | 1 - boost/mssql/template/test.hxx | 1 - boost/mssql/test.bat | 1 - boost/mysql/Makefile.am | 1 - boost/mysql/date-time/driver.cxx | 1 - boost/mysql/date-time/makefile | 1 - boost/mysql/date-time/test.hxx | 1 - boost/mysql/makefile | 1 - boost/mysql/template/Makefile.am | 1 - boost/mysql/template/driver.cxx | 1 - boost/mysql/template/makefile | 1 - boost/mysql/template/test.hxx | 1 - boost/mysql/test.bat | 1 - boost/oracle/Makefile.am | 1 - boost/oracle/date-time/driver.cxx | 1 - boost/oracle/date-time/makefile | 1 - boost/oracle/date-time/test.hxx | 1 - boost/oracle/makefile | 1 - boost/oracle/template/Makefile.am | 1 - boost/oracle/template/driver.cxx | 1 - boost/oracle/template/makefile | 1 - boost/oracle/template/test.hxx | 1 - boost/oracle/test.bat | 1 - boost/pgsql/Makefile.am | 1 - boost/pgsql/date-time/driver.cxx | 1 - boost/pgsql/date-time/makefile | 1 - boost/pgsql/date-time/test.hxx | 1 - boost/pgsql/makefile | 1 - boost/pgsql/template/Makefile.am | 1 - boost/pgsql/template/driver.cxx | 1 - boost/pgsql/template/makefile | 1 - boost/pgsql/template/test.hxx | 1 - boost/pgsql/test.bat | 1 - boost/sqlite/Makefile.am | 1 - boost/sqlite/date-time/driver.cxx | 1 - boost/sqlite/date-time/makefile | 1 - boost/sqlite/date-time/test.hxx | 1 - boost/sqlite/makefile | 1 - boost/sqlite/template/Makefile.am | 1 - boost/sqlite/template/driver.cxx | 1 - boost/sqlite/template/makefile | 1 - boost/sqlite/template/test.hxx | 1 - boost/sqlite/test.bat | 1 - bootstrap | 1 - build.bat | 1 - build/bootstrap.make | 1 - build/configuration-rules.make | 1 - build/configuration.make | 1 - build/configure | 1 - build/import/libboost/configuration-rules.make | 1 - build/import/libboost/configure | 1 - build/import/libboost/date-time/rules.make | 1 - build/import/libboost/date-time/stub.make | 1 - build/import/libboost/header-only/rules.make | 1 - build/import/libboost/header-only/stub.make | 1 - build/import/libodb-boost/configuration-rules.make | 1 - build/import/libodb-boost/configure | 1 - build/import/libodb-boost/stub.make | 1 - build/import/libodb-mssql/configuration-rules.make | 1 - build/import/libodb-mssql/configure | 1 - build/import/libodb-mssql/stub.make | 1 - build/import/libodb-mysql/configuration-rules.make | 1 - build/import/libodb-mysql/configure | 1 - build/import/libodb-mysql/stub.make | 1 - build/import/libodb-oracle/configuration-rules.make | 1 - build/import/libodb-oracle/configure | 1 - build/import/libodb-oracle/stub.make | 1 - build/import/libodb-pgsql/configuration-rules.make | 1 - build/import/libodb-pgsql/configure | 1 - build/import/libodb-pgsql/stub.make | 1 - build/import/libodb-qt/configuration-rules.make | 1 - build/import/libodb-qt/configure | 1 - build/import/libodb-qt/stub.make | 1 - build/import/libodb-sqlite/configuration-rules.make | 1 - build/import/libodb-sqlite/configure | 1 - build/import/libodb-sqlite/stub.make | 1 - build/import/libodb/configuration-rules.make | 1 - build/import/libodb/configure | 1 - build/import/libodb/stub.make | 1 - build/import/libqt/configuration-rules.make | 1 - build/import/libqt/configure | 1 - build/import/libqt/core/rules.make | 1 - build/import/libqt/core/stub.make | 1 - build/import/odb/configuration-rules.make | 1 - build/import/odb/configure | 1 - build/import/odb/hxx-cxx.make | 1 - build/import/odb/stub.make | 1 - build/mssql/configure | 1 - build/mssql/mssql | 1 - build/mysql/configure | 1 - build/mysql/mysql | 1 - build/oracle/configure | 1 - build/oracle/oracle | 1 - build/pgsql/configure | 1 - build/pgsql/pgsql | 1 - build/sqlite/configure | 1 - common/Makefile.am | 1 - common/auto/driver.cxx | 1 - common/auto/makefile | 1 - common/auto/test.hxx | 1 - common/blob/driver.cxx | 1 - common/blob/makefile | 1 - common/blob/test.hxx | 1 - common/callback/driver.cxx | 1 - common/callback/makefile | 1 - common/callback/test.hxx | 1 - common/composite/driver.cxx | 1 - common/composite/makefile | 1 - common/composite/test.hxx | 1 - common/const-member/driver.cxx | 1 - common/const-member/makefile | 1 - common/const-member/test.hxx | 1 - common/const-object/driver.cxx | 1 - common/const-object/makefile | 1 - common/const-object/test.hxx | 1 - common/container/driver.cxx | 1 - common/container/makefile | 1 - common/container/test.hxx | 1 - common/ctor/driver.cxx | 1 - common/ctor/makefile | 1 - common/ctor/test.hxx | 1 - common/default/driver.cxx | 1 - common/default/makefile | 1 - common/default/test.hxx | 1 - common/enum/driver.cxx | 1 - common/enum/makefile | 1 - common/enum/test.hxx | 1 - common/erase-query/driver.cxx | 1 - common/erase-query/makefile | 1 - common/erase-query/test.hxx | 1 - common/include/driver.cxx | 1 - common/include/makefile | 1 - common/include/obj1.hxx | 1 - common/include/obj2.hxx | 1 - common/include/obj3.hxx | 1 - common/include/objs1.hxx | 1 - common/include/objs2.hxx | 1 - common/include/objs3.hxx | 1 - common/include/objs4.hxx | 1 - common/include/test1.hxx | 1 - common/include/test2.hxx | 1 - common/include/test3.hxx | 1 - common/include/test4.hxx | 1 - common/inheritance/driver.cxx | 1 - common/inheritance/makefile | 1 - common/inheritance/test.hxx | 1 - common/inverse/driver.cxx | 1 - common/inverse/makefile | 1 - common/inverse/test.hxx | 1 - common/lazy-ptr/driver.cxx | 1 - common/lazy-ptr/makefile | 1 - common/lazy-ptr/test.hxx | 1 - common/lifecycle/driver.cxx | 1 - common/lifecycle/makefile | 1 - common/lifecycle/test.hxx | 1 - common/makefile | 1 - common/no-id/driver.cxx | 1 - common/no-id/makefile | 1 - common/no-id/test.hxx | 1 - common/optimistic/driver.cxx | 1 - common/optimistic/makefile | 1 - common/optimistic/test.hxx | 1 - common/pragma/driver.cxx | 1 - common/pragma/makefile | 1 - common/pragma/test.hxx | 1 - common/query/driver.cxx | 1 - common/query/makefile | 1 - common/query/test.hxx | 1 - common/readonly/driver.cxx | 1 - common/readonly/makefile | 1 - common/readonly/test.hxx | 1 - common/relationship-query/driver.cxx | 1 - common/relationship-query/makefile | 1 - common/relationship-query/test.hxx | 1 - common/relationship/driver.cxx | 1 - common/relationship/makefile | 1 - common/relationship/test.hxx | 1 - common/schema/driver.cxx | 1 - common/schema/makefile | 1 - common/schema/test.hxx | 1 - common/template/Makefile.am | 1 - common/template/driver.cxx | 1 - common/template/makefile | 1 - common/template/test.hxx | 1 - common/test.bat | 1 - common/threads/driver.cxx | 1 - common/threads/makefile | 1 - common/threads/test.hxx | 1 - common/transaction/driver.cxx | 1 - common/transaction/makefile | 1 - common/types/driver.cxx | 1 - common/types/makefile | 1 - common/types/test.hxx | 1 - common/view/driver.cxx | 1 - common/view/makefile | 1 - common/view/test.hxx | 1 - common/wrapper/driver.cxx | 1 - common/wrapper/makefile | 1 - common/wrapper/test.hxx | 1 - configure.ac | 1 - libcommon/Makefile.am | 1 - libcommon/common/Makefile.am | 1 - libcommon/common/buffer.hxx | 1 - libcommon/common/common.cxx | 1 - libcommon/common/common.hxx | 1 - libcommon/common/common.txx | 1 - libcommon/common/concrete.hxx | 1 - libcommon/common/config-vc.h | 1 - libcommon/common/config.h.in | 1 - libcommon/common/config.hxx | 1 - libcommon/common/export.hxx | 1 - libcommon/common/makefile | 3 +-- libcommon/makefile | 1 - m4/database.m4 | 1 - m4/diff.m4 | 1 - m4/libboost.m4 | 1 - m4/libodb-boost.m4 | 1 - m4/libodb-mssql.m4 | 1 - m4/libodb-mysql.m4 | 1 - m4/libodb-oracle.m4 | 1 - m4/libodb-pgsql.m4 | 1 - m4/libodb-qt.m4 | 1 - m4/libodb-sqlite.m4 | 1 - m4/libodb.m4 | 1 - m4/libqt.m4 | 1 - m4/libtool-link.m4 | 1 - m4/mssql.m4 | 1 - m4/mysql.m4 | 1 - m4/odb.m4 | 1 - m4/oracle.m4 | 1 - m4/pgsql.m4 | 1 - m4/sqlite.m4 | 1 - m4/static-lib.m4 | 1 - m4/threads.m4 | 1 - m4/tr1-memory.m4 | 1 - makefile | 1 - mssql-driver.bat | 1 - mssql/Makefile.am | 1 - mssql/makefile | 1 - mssql/native/driver.cxx | 1 - mssql/native/makefile | 1 - mssql/query/driver.cxx | 1 - mssql/query/makefile | 1 - mssql/query/test.hxx | 1 - mssql/template/Makefile.am | 1 - mssql/template/driver.cxx | 1 - mssql/template/makefile | 1 - mssql/template/test.hxx | 1 - mssql/test.bat | 1 - mssql/types/driver.cxx | 1 - mssql/types/makefile | 1 - mssql/types/test.hxx | 1 - mssql/types/traits.hxx | 1 - mysql-driver.bat | 1 - mysql/Makefile.am | 1 - mysql/makefile | 1 - mysql/native/driver.cxx | 1 - mysql/native/makefile | 1 - mysql/template/Makefile.am | 1 - mysql/template/driver.cxx | 1 - mysql/template/makefile | 1 - mysql/template/test.hxx | 1 - mysql/test.bat | 1 - mysql/truncation/driver.cxx | 1 - mysql/truncation/makefile | 1 - mysql/truncation/test.hxx | 1 - mysql/types/driver.cxx | 1 - mysql/types/makefile | 1 - mysql/types/test.hxx | 1 - mysql/types/traits.hxx | 1 - oracle-driver.bat | 1 - oracle/Makefile.am | 1 - oracle/makefile | 1 - oracle/native/driver.cxx | 1 - oracle/native/makefile | 1 - oracle/template/Makefile.am | 1 - oracle/template/driver.cxx | 1 - oracle/template/makefile | 1 - oracle/template/test.hxx | 1 - oracle/test.bat | 1 - oracle/types/driver.cxx | 1 - oracle/types/makefile | 1 - oracle/types/test.hxx | 1 - oracle/types/traits.hxx | 1 - pgsql-driver.bat | 1 - pgsql/Makefile.am | 1 - pgsql/makefile | 1 - pgsql/native/driver.cxx | 1 - pgsql/native/makefile | 1 - pgsql/template/Makefile.am | 1 - pgsql/template/driver.cxx | 1 - pgsql/template/makefile | 1 - pgsql/template/test.hxx | 1 - pgsql/test.bat | 1 - pgsql/truncation/driver.cxx | 2 -- pgsql/truncation/makefile | 1 - pgsql/truncation/test.hxx | 2 -- pgsql/types/driver.cxx | 1 - pgsql/types/makefile | 1 - pgsql/types/test.hxx | 1 - pgsql/types/traits.hxx | 1 - qt/Makefile.am | 1 - qt/build.bat | 1 - qt/common/Makefile.am | 1 - qt/common/containers/driver.cxx | 1 - qt/common/containers/makefile | 1 - qt/common/containers/test.hxx | 1 - qt/common/makefile | 1 - qt/common/smart-ptr/driver.cxx | 1 - qt/common/smart-ptr/makefile | 1 - qt/common/smart-ptr/test.hxx | 1 - qt/common/template/Makefile.am | 1 - qt/common/template/driver.cxx | 1 - qt/common/template/makefile | 1 - qt/common/template/test.hxx | 1 - qt/common/test.bat | 1 - qt/makefile | 1 - qt/mssql/Makefile.am | 1 - qt/mssql/basic/driver.cxx | 1 - qt/mssql/basic/makefile | 1 - qt/mssql/basic/test.hxx | 1 - qt/mssql/date-time/driver.cxx | 1 - qt/mssql/date-time/makefile | 1 - qt/mssql/date-time/test.hxx | 1 - qt/mssql/makefile | 1 - qt/mssql/template/Makefile.am | 1 - qt/mssql/template/driver.cxx | 1 - qt/mssql/template/makefile | 1 - qt/mssql/template/test.hxx | 1 - qt/mssql/test.bat | 1 - qt/mysql/Makefile.am | 1 - qt/mysql/basic/driver.cxx | 1 - qt/mysql/basic/makefile | 1 - qt/mysql/basic/test.hxx | 1 - qt/mysql/date-time/driver.cxx | 1 - qt/mysql/date-time/makefile | 1 - qt/mysql/date-time/test.hxx | 1 - qt/mysql/makefile | 1 - qt/mysql/template/Makefile.am | 1 - qt/mysql/template/driver.cxx | 1 - qt/mysql/template/makefile | 1 - qt/mysql/template/test.hxx | 1 - qt/mysql/test.bat | 1 - qt/oracle/Makefile.am | 1 - qt/oracle/basic/driver.cxx | 1 - qt/oracle/basic/makefile | 1 - qt/oracle/basic/test.hxx | 1 - qt/oracle/date-time/driver.cxx | 1 - qt/oracle/date-time/makefile | 1 - qt/oracle/date-time/test.hxx | 1 - qt/oracle/makefile | 1 - qt/oracle/template/Makefile.am | 1 - qt/oracle/template/driver.cxx | 1 - qt/oracle/template/makefile | 1 - qt/oracle/template/test.hxx | 1 - qt/oracle/test.bat | 1 - qt/pgsql/Makefile.am | 1 - qt/pgsql/basic/driver.cxx | 1 - qt/pgsql/basic/makefile | 1 - qt/pgsql/basic/test.hxx | 1 - qt/pgsql/date-time/driver.cxx | 1 - qt/pgsql/date-time/makefile | 1 - qt/pgsql/date-time/test.hxx | 1 - qt/pgsql/makefile | 1 - qt/pgsql/template/Makefile.am | 1 - qt/pgsql/template/driver.cxx | 1 - qt/pgsql/template/makefile | 1 - qt/pgsql/template/test.hxx | 1 - qt/pgsql/test.bat | 1 - qt/sqlite/Makefile.am | 1 - qt/sqlite/basic/driver.cxx | 1 - qt/sqlite/basic/makefile | 1 - qt/sqlite/basic/test.hxx | 1 - qt/sqlite/date-time/driver.cxx | 1 - qt/sqlite/date-time/makefile | 1 - qt/sqlite/date-time/test.hxx | 1 - qt/sqlite/makefile | 1 - qt/sqlite/template/Makefile.am | 1 - qt/sqlite/template/driver.cxx | 1 - qt/sqlite/template/makefile | 1 - qt/sqlite/template/test.hxx | 1 - qt/sqlite/test.bat | 1 - sqlite/Makefile.am | 1 - sqlite/makefile | 1 - sqlite/native/driver.cxx | 1 - sqlite/native/makefile | 1 - sqlite/template/Makefile.am | 1 - sqlite/template/driver.cxx | 1 - sqlite/template/makefile | 1 - sqlite/template/test.hxx | 1 - sqlite/test.bat | 1 - sqlite/truncation/driver.cxx | 1 - sqlite/truncation/makefile | 1 - sqlite/truncation/test.hxx | 1 - sqlite/types/driver.cxx | 1 - sqlite/types/makefile | 1 - sqlite/types/test.hxx | 1 - sqlite/types/traits.hxx | 1 - test.bat | 1 - tester.bat | 1 - tester.in | 1 - 428 files changed, 1 insertion(+), 431 deletions(-) diff --git a/Makefile.am b/Makefile.am index d6cfce3..db1adca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,4 @@ # file : Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/Makefile.am b/boost/Makefile.am index 5363e6f..3874e15 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,4 @@ # file : boost/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/build.bat b/boost/build.bat index 9f1d742..34d7a76 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/build.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index 2b3806b..0398585 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,4 @@ # file : boost/common/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/makefile b/boost/common/makefile index 8b44c63..3bbd3d5 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,4 @@ # file : boost/common/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index 7673e68..6956cd0 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/optional/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index ca0a94d..843f645 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,4 @@ # file : boost/common/optional/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 519ed94..732683d 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/optional/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index af5767c..ff583b3 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/smart-ptr/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 79c943a..c4e1ee4 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,4 @@ # file : boost/common/smart-ptr/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 62a9ae6..99270c4 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/smart-ptr/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 6cd68eb..e8bf277 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/common/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 5865289..734dcf9 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 8fe2fa6..14e9af1 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,4 @@ # file : boost/common/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index ca19cba..21dbc05 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/test.bat b/boost/common/test.bat index a5f035a..58d6f7b 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/common/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 diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 3750e58..5240004 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/unordered/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 7ea4e60..85073db 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,4 @@ # file : boost/common/unordered/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 02ed5bd..e0f7a48 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/unordered/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/makefile b/boost/makefile index a8edf49..40d8ae7 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,4 @@ # file : boost/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index 76af29a..dbab009 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mssql/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index 55cbdb0..ed1519e 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mssql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 4c97299..3917061 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/date-time/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index ddf38f6..4757153 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/mssql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 1f43f40..8bdd349 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 6ac8d13..59051f9 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mssql/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index e43fd72..3c55864 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mssql/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 06d9ba7..8d1ef71 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index ab41549..881fce7 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/mssql/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index a13b843..ba03581 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/mssql/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 diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index 8d1c143..d641b42 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mysql/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 5dfd374..59e94e6 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mysql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 9f9584b..183d8c5 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/date-time/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index b84bf0f..6036e8f 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/mysql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 6aa5a48..5089f41 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 6bab1d5..3a7ce53 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mysql/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index 2a92ab4..db7c237 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mysql/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 0cba62b..3571228 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index c89562b..5105c6c 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/mysql/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index e9b2e5d..387ad26 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/mysql/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 diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 6237668..796d9c2 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : boost/oracle/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index 7c1733e..6c8c240 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/oracle/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index c2a8711..ac1680d 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/date-time/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index ef5455a..9a5fe8b 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/oracle/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 929fa8b..1e3fc52 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 2e5e5f8..23f695f 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/oracle/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index b1442e0..b77f0f5 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/oracle/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 551cfb0..a2fb64d 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 2bb9244..65123a7 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/oracle/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index d323b10..fcc0945 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/oracle/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 diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index cf1cda7..92fca3e 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/pgsql/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 6827bd6..4012fd6 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/pgsql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 27f3f6d..bebe279 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 9f6746e..68e26e5 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/pgsql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 9b69e32..dbf8a6d 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 2c9f50a..8e75803 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/pgsql/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index e670008..2f7d3e1 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/pgsql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 986926b..bbb2bcf 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index fd4a879..09b1b82 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/pgsql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index bcbab16..48ec426 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/pgsql/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index d32821a..649d587 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : boost/sqlite/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index e4c619f..877f659 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/sqlite/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index fbaccaf..e218727 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index 020bc7d..b966d37 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/sqlite/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index e23ec20..e5b67a6 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 0203290..aa4cb4b 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/sqlite/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index 0878f2e..b853f9c 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/sqlite/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 9c107ff..de0059d 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index b6cd18e..289cbd9 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/sqlite/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index dd6fe87..4aceba1 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/sqlite/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/bootstrap b/bootstrap index 777bd86..7f49d40 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,6 @@ #! /bin/sh # file : bootstrap -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build.bat b/build.bat index 4afe3a2..a263fda 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,5 @@ @echo off rem file : build.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/bootstrap.make b/build/bootstrap.make index d3da6dd..8dedf02 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,4 @@ # file : build/bootstrap.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 69048a8..7afa3f0 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/configuration.make b/build/configuration.make index 2cf8c9a..77e8a83 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,4 @@ # file : build/configuration.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/configure b/build/configure index c4fb620..ed3a94c 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index df35c70..88a3b38 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 7f78219..361be81 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index b9ea87b..7f862f5 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/date-time/rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index 66d1989..64deb54 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,4 @@ # file : build/import/libboost/date-time/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index b966860..f8b68bc 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/header-only/rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 9c39397..9fa86e9 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,4 @@ # file : build/import/libboost/header-only/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 18de990..3f689f4 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-boost/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index 67699cd..86ecc96 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 44abed4..43c489a 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-boost/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 6c74f64..3924f9b 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mssql/configuration-rules.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index dabc42a..1340531 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index a7aa2dd..940028a 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mssql/stub.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index 53e116c..0f43267 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mysql/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index cde10e2..adf3825 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index d005fa5..ccfd4e8 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mysql/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index a4a8c99..0a34295 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-oracle/configuration-rules.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 9934d03..f64f096 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 2432246..3ee3cf3 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-oracle/stub.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index 307a8f6..2dc9b18 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 3315781..e6b3a6f 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index fed0f02..b07ecf9 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-pgsql/stub.make -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index 1116405..9df9ac4 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-qt/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 16d09fc..442a824 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index fe6060d..dd70364 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-qt/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 420f1ef..7fce21e 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index ee067ca..b891125 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 43f0e11..6ea894f 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-sqlite/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 9263bb0..15b4ffd 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 90e21d4..959e613 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 97bb5ff..29a4ae6 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 03a4774..35384b9 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libqt/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 1b67928..9fad2f7 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index b0d5e2e..71abfb3 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,4 @@ # file : build/import/libqt/core/rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 821eab7..8e4acca 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,4 @@ # file : build/import/libqt/core/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2005-2011 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index a16c36b..504ffb7 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/odb/configuration-rules.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/configure b/build/import/odb/configure index 43d6c70..d7c6328 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index e97443c..031bc4b 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,4 @@ # file : build/import/odb/hxx-cxx.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index ee7371e..4f662cb 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,4 @@ # file : build/import/odb/stub.make -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/mssql/configure b/build/mssql/configure index 5013609..64def46 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mssql/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/mssql/mssql b/build/mssql/mssql index d451ee6..f62873a 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/mysql/configure b/build/mysql/configure index ac70779..2c1b0dd 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mysql/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/mysql/mysql b/build/mysql/mysql index e91da92..e8d2554 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/oracle/configure b/build/oracle/configure index 564d526..a4ff0d9 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/oracle/configure -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/oracle/oracle b/build/oracle/oracle index e3030d6..6b438f2 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/pgsql/configure b/build/pgsql/configure index 3e8a72c..c9927d5 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 356079a..49ddee8 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/sqlite/configure b/build/sqlite/configure index 621d582..2f3c593 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/Makefile.am b/common/Makefile.am index 2e6e958..c461ea0 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,4 @@ # file : common/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 121cbe8..441c547 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -1,5 +1,4 @@ // file : common/auto/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/auto/makefile b/common/auto/makefile index da798c6..a06c50f 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -1,5 +1,4 @@ # file : common/auto/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 6810767..0fd27be 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -1,5 +1,4 @@ // file : common/auto/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index f123577..3b25d8d 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,4 @@ // file : common/blob/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/blob/makefile b/common/blob/makefile index ae0ea11..09350fd 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,4 @@ # file : common/blob/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 2a0f880..2c8f20a 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,4 @@ // file : common/blob/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index b22d543..fc4832a 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,4 @@ // file : common/callback/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/callback/makefile b/common/callback/makefile index 6dca289..0c57905 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,4 @@ # file : common/callback/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/callback/test.hxx b/common/callback/test.hxx index 058a327..f0112c5 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,4 @@ // file : common/callback/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index a3825e1..94b6b8c 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,4 @@ // file : common/composite/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/composite/makefile b/common/composite/makefile index 58fa6eb..454d043 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,4 @@ # file : common/composite/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/composite/test.hxx b/common/composite/test.hxx index d846c9c..3823d7d 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,4 @@ // file : common/composite/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index 8cd815e..51f0581 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,4 @@ // file : common/const-member/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-member/makefile b/common/const-member/makefile index 40516dd..05c904f 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,4 @@ # file : common/const-member/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index c987cf8..eefb041 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,4 @@ // file : common/const-member/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 6fb4cde..41bf745 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,4 @@ // file : common/const-object/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-object/makefile b/common/const-object/makefile index 73d6715..a1e4ac5 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,4 @@ # file : common/const-object/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 82635f0..40e2635 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,4 @@ // file : common/const-object/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/container/driver.cxx b/common/container/driver.cxx index 0705794..d743d40 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -1,5 +1,4 @@ // file : common/container/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/container/makefile b/common/container/makefile index a482d9b..25e66d9 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -1,5 +1,4 @@ # file : common/container/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/container/test.hxx b/common/container/test.hxx index 2e267f6..280a60d 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -1,5 +1,4 @@ // file : common/container/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index a83724c..0298190 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,4 @@ // file : common/ctor/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/ctor/makefile b/common/ctor/makefile index 98e9e3a..a08fa92 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,4 @@ # file : common/ctor/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 09a3686..6b3af25 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,4 @@ // file : common/ctor/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 5fef85c..87dc631 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,4 @@ // file : common/default/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/default/makefile b/common/default/makefile index 2f66e7a..7a4eb8c 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,4 @@ # file : common/default/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/default/test.hxx b/common/default/test.hxx index a676753..45ae390 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,4 @@ // file : common/default/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 833eebb..e7ad7ff 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,4 @@ // file : common/enum/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/enum/makefile b/common/enum/makefile index bbfb1e1..39e7649 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,4 @@ # file : common/enum/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/enum/test.hxx b/common/enum/test.hxx index bb264d5..675a530 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,4 @@ // file : common/enum/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 0880f62..563bd50 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,4 @@ // file : common/erase-query/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 4ea31a2..b9fd06a 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,4 @@ # file : common/erase-query/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 781eedd..6857f88 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,4 @@ // file : common/erase-query/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/include/driver.cxx b/common/include/driver.cxx index d588a62..f9cf7e5 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/makefile b/common/include/makefile index 7053d75..b4ad846 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,4 @@ # file : common/include/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index cdf6a66..30a8169 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index 4c98d7d..8da9834 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index b73673a..222fe9a 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index 5e592a4..b2befc6 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index f2cfee0..40cafa0 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index d9bc01a..29b6206 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index fc5f1de..e7ab43a 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/test1.hxx b/common/include/test1.hxx index 15972c1..fb639cf 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/test2.hxx b/common/include/test2.hxx index ee26994..5af2ac1 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/test3.hxx b/common/include/test3.hxx index a2b2096..44117c3 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 49180bc..e385af4 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index 0106b5b..bf47406 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -1,5 +1,4 @@ // file : common/inheritance/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 4e95c68..fae47d7 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -1,5 +1,4 @@ # file : common/inheritance/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx index 5ef2ea4..6e3cec4 100644 --- a/common/inheritance/test.hxx +++ b/common/inheritance/test.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 17fc5d6..812cf1a 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,4 @@ // file : common/inverse/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/inverse/makefile b/common/inverse/makefile index 3b5fa1b..7d52021 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,4 @@ # file : common/inverse/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 12eddfb..b98d65b 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,4 @@ // file : common/inverse/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index d215240..32677e0 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : common/lazy-ptr/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index d11a87b..7d5da5f 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,4 @@ # file : common/lazy-ptr/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 32f6a43..8394f0e 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,4 @@ // file : common/lazy-ptr/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 8323694..5476c78 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,4 @@ // file : common/lifecycle/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index d1cd9ad..a0a0a84 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,4 @@ # file : common/lifecycle/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 4f591ec..879149d 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,4 @@ // file : common/lifecycle/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/makefile b/common/makefile index 8534034..adbe7a8 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,4 @@ # file : common/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index a2171a0..45acf21 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,4 @@ // file : common/no-id/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/no-id/makefile b/common/no-id/makefile index 11cd2e2..2b20cf1 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,4 @@ # file : common/no-id/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 3508d88..ccf4e19 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,4 @@ // file : common/no-id/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 46929d4..84f54e9 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,4 @@ // file : common/optimistic/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 9945ca5..f22f056 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,4 @@ # file : common/optimistic/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 5346e1c..746c5a0 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,4 @@ // file : common/optimistic/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 65b384d..549da67 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/pragma/makefile b/common/pragma/makefile index 449fcaf..b66d04a 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,4 @@ # file : common/pragma/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index d7f21b0..cf80998 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/query/driver.cxx b/common/query/driver.cxx index ee5a76c..fd001dd 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -1,5 +1,4 @@ // file : common/query/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/query/makefile b/common/query/makefile index 63c0e77..7d5972c 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -1,5 +1,4 @@ # file : common/query/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/query/test.hxx b/common/query/test.hxx index 9e8b0ff..10d2dac 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -1,5 +1,4 @@ // file : common/query/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 0432c69..f30dceb 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,4 @@ // file : common/readonly/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/readonly/makefile b/common/readonly/makefile index d8fd474..f3632c5 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,4 @@ # file : common/readonly/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 3a0095f..8205d27 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,4 @@ // file : common/readonly/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 2e0068e..7d92783 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -1,5 +1,4 @@ // file : common/relationship-query/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 2097823..8ade97e 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -1,5 +1,4 @@ # file : common/relationship-query/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx index c832405..427f4eb 100644 --- a/common/relationship-query/test.hxx +++ b/common/relationship-query/test.hxx @@ -1,5 +1,4 @@ // file : common/relationship-query/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index e2ac749..71ad9ae 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -1,5 +1,4 @@ // file : common/relationship/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship/makefile b/common/relationship/makefile index 71ab773..ca9fbf4 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -1,5 +1,4 @@ # file : common/relationship/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index b9ad7c2..51e610a 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -1,5 +1,4 @@ // file : common/relationship/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index eb1358e..a68a0fe 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -1,5 +1,4 @@ // file : common/schema/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/schema/makefile b/common/schema/makefile index 043e8a1..03593b1 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -1,5 +1,4 @@ # file : common/schema/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 6c1bbd4..f8c6f45 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -1,5 +1,4 @@ // file : common/schema/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 3cd0fb2..779ba36 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : common/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/template/driver.cxx b/common/template/driver.cxx index ad95809..1d99ff1 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : common/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/template/makefile b/common/template/makefile index 820fcb3..1fbb708 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,4 @@ # file : common/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/template/test.hxx b/common/template/test.hxx index 6e528c7..e9ff3a5 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/test.bat b/common/test.bat index 4c6db0b..73ad3a6 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : common/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 diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 192a3b7..848030b 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,4 @@ // file : common/threads/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/threads/makefile b/common/threads/makefile index e9aef66..351980a 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,4 @@ # file : common/threads/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/threads/test.hxx b/common/threads/test.hxx index 3f129f2..90e5b7c 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx index 00aff29..13e6bd6 100644 --- a/common/transaction/driver.cxx +++ b/common/transaction/driver.cxx @@ -1,5 +1,4 @@ // file : common/transaction/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/transaction/makefile b/common/transaction/makefile index 7c0889b..9b9aff7 100644 --- a/common/transaction/makefile +++ b/common/transaction/makefile @@ -1,5 +1,4 @@ # file : common/transaction/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 11e15d7..b601c84 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/types/makefile b/common/types/makefile index 4081ee8..95588a3 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,4 @@ # file : common/types/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/types/test.hxx b/common/types/test.hxx index a36b5d5..8945eda 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,4 @@ // 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 diff --git a/common/view/driver.cxx b/common/view/driver.cxx index f6dd613..01d06ca 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -1,5 +1,4 @@ // file : common/view/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/view/makefile b/common/view/makefile index 3b7c03d..b8bc105 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -1,5 +1,4 @@ # file : common/view/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/view/test.hxx b/common/view/test.hxx index 5cbd171..51862c1 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -1,5 +1,4 @@ // file : common/view/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index af6a3d1..20bfa31 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,4 @@ // file : common/wrapper/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/wrapper/makefile b/common/wrapper/makefile index a6c82b1..520fadc 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,4 @@ # file : common/wrapper/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index baf6346..1545d23 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,4 @@ // file : common/wrapper/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/configure.ac b/configure.ac index f32e4fa..9a6772f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,4 @@ # file : configure.ac -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index f4904c1..aae7ec9 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,4 @@ # file : libcommon/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 405a2ed..a8740d6 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,4 @@ # file : libcommon/common/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index ada73a1..876907f 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/buffer.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 8be7631..c8f43b8 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,4 @@ // file : libcommon/common/common.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index da3737a..2eeb0b9 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/common.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index ef1461e..89e2897 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,4 @@ // file : libcommon/common/common.txx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index b7fde1f..00878e1 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/concrete.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index e4a9397..1fcafe8 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,4 @@ /* file : libcommon/common/config-vc.h - * author : Boris Kolpackov * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 2a98025..453b0f1 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,4 @@ /* file : libcommon/common/config.h.in - * author : Boris Kolpackov * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 935f0bc..6b18e6c 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/config.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 1f1a229..3a9e50d 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/export.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 842f8e4..7a0de2f 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,4 @@ # file : libcommon/common/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file @@ -43,7 +42,7 @@ $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/. @echo '/* file : libcommon/common/config.h' >$@ - @echo ' * author : automatically generated' >>$@ + @echo ' * note : automatically generated' >>$@ @echo ' */' >>$@ @echo '' >>$@ @echo '#ifndef LIBCOMMON_COMMON_CONFIG_H' >>$@ diff --git a/libcommon/makefile b/libcommon/makefile index cac6e2d..869d4f5 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,4 @@ # file : libcommon/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/m4/database.m4 b/m4/database.m4 index e334e91..428b22d 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,4 @@ dnl file : m4/database.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 diff --git a/m4/diff.m4 b/m4/diff.m4 index 0fcb62f..c7603a1 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,4 @@ dnl file : m4/diff.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 diff --git a/m4/libboost.m4 b/m4/libboost.m4 index 6ce9d79..8f6c756 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,4 @@ dnl file : m4/libboost.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 diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 323cc56..3eef9a3 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-boost.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 diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index acddfd4..f12e3f8 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-mssql.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 diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index e43ebff..187a6c6 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-mysql.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 diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 8c3d38a..0f480ca 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-oracle.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 diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index 0e92478..16d85ea 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-pgsql.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 diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index 7e6b31e..d36fe6d 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-qt.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 diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index b85614f..3d9ee8c 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-sqlite.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 diff --git a/m4/libodb.m4 b/m4/libodb.m4 index fb11859..ffee03d 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb.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 diff --git a/m4/libqt.m4 b/m4/libqt.m4 index a094643..6e0fea3 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,4 @@ dnl file : m4/libqt.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 diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index d8395d5..221b9f2 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,4 @@ dnl file : m4/libtool-link.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 diff --git a/m4/mssql.m4 b/m4/mssql.m4 index c446f31..0fd8163 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,4 @@ dnl file : m4/mssql.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 diff --git a/m4/mysql.m4 b/m4/mysql.m4 index c6bac0d..5351215 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,4 @@ dnl file : m4/mysql.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 diff --git a/m4/odb.m4 b/m4/odb.m4 index e873645..03d8b02 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,4 @@ dnl file : m4/odb.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 diff --git a/m4/oracle.m4 b/m4/oracle.m4 index ec3d235..fbce179 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,4 @@ dnl file : m4/oracle.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 diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index e4f6d71..fa4e2e7 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,4 @@ dnl file : m4/pgsql.m4 -dnl author : Constantin Michael dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 0a54bf6..b1bd26f 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,4 @@ dnl file : m4/sqlite.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 diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index f550b7b..14a1041 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,4 @@ dnl file : m4/static-lib.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 diff --git a/m4/threads.m4 b/m4/threads.m4 index d4ed7cd..e351480 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,4 @@ dnl file : m4/threads.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 diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 29966b3..3c555e1 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,4 @@ dnl file : m4/tr1-memory.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 diff --git a/makefile b/makefile index c26c717..3d52f32 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,4 @@ # file : makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/mssql-driver.bat b/mssql-driver.bat index 55ed487..da4ce7d 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : mssql-driver.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 434664d..0c641ab 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : mssql/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/makefile b/mssql/makefile index 83b9e90..cf32f4d 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,4 @@ # file : mssql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 9911a36..fd23648 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/native/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file diff --git a/mssql/native/makefile b/mssql/native/makefile index 3eca560..cb14a9c 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,4 @@ # file : mssql/native/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index 2bcd692..d95bb15 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/query/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/query/makefile b/mssql/query/makefile index dce0c9c..ede73ef 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,4 @@ # file : mssql/query/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 964d893..284e8d7 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,4 @@ // file : mssql/query/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 7e1b579..45ada5e 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : mssql/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index d142ac5..ffd08a4 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/template/makefile b/mssql/template/makefile index 4b94e07..5489cd5 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,4 @@ # file : mssql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index f86c855..fda3c46 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : mssql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/test.bat b/mssql/test.bat index 46db55e..23de1d4 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : mssql/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 diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index db814e2..3476515 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/types/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/types/makefile b/mssql/types/makefile index a75fba5..9024007 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,4 @@ # file : mssql/types/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 57bc7b2..0f817ec 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,4 @@ // file : mssql/types/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index 76a21c5..bf7eccb 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,4 @@ // file : mssql/types/traits.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql-driver.bat b/mysql-driver.bat index c28c232..127b4e1 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : mysql-driver.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 8995e2d..721a01c 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : mysql/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/makefile b/mysql/makefile index a5c512e..2447e87 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,4 @@ # file : mysql/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 9472cf3..7b3377a 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/native/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/native/makefile b/mysql/native/makefile index c58e56f..c872966 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,4 @@ # file : mysql/native/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index af5895f..b508146 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : mysql/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index a305739..a7b3980 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/template/makefile b/mysql/template/makefile index e51c862..a92574c 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,4 @@ # file : mysql/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index e5a593f..31abd3d 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : mysql/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/test.bat b/mysql/test.bat index 66d0dcd..ee3755d 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : mysql/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 diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index b4f68b4..4d773c6 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/truncation/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index def31ba..831979e 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,4 @@ # file : mysql/truncation/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index f63b68b..709d1f7 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,4 @@ // file : mysql/truncation/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index f397084..784d0c1 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/types/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/types/makefile b/mysql/types/makefile index dab5489..5df509f 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,4 @@ # file : mysql/types/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 1f6b771..93e2395 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,4 @@ // file : mysql/types/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 09d50a1..537b549 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,4 @@ // file : mysql/types/traits.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle-driver.bat b/oracle-driver.bat index c8d500f..c0d01b9 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : oracle-driver.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/Makefile.am b/oracle/Makefile.am index 2fefbca..9caff0c 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : oracle/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/makefile b/oracle/makefile index d4a3e94..ed6dd2a 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,4 @@ # file : oracle/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index d2b0bfc..6a78e46 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/native/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/native/makefile b/oracle/native/makefile index ff2d16c..d911c6d 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,4 @@ # file : oracle/native/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 4cb79d0..3b4c3cb 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : oracle/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index a2146ba..4b18515 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/template/makefile b/oracle/template/makefile index 2798388..d761873 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,4 @@ # file : oracle/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index fb8e53c..6ba06ce 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : oracle/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/test.bat b/oracle/test.bat index 13680d5..481590e 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : oracle/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 diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 684a46e..0f8c0f9 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/types/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/types/makefile b/oracle/types/makefile index 69b3b66..c91868f 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,4 @@ # file : oracle/types/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 53f09e8..3090961 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,4 @@ // file : oracle/types/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index e47e1ea..8c43f0d 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,4 @@ // file : oracle/types/traits.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 9d9551a..80c2898 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : pgsql-driver.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index 11dd4cc..e7a0d57 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : pgsql/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/makefile b/pgsql/makefile index 1fee285..097072e 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,4 @@ # file : pgsql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 7fc63f6..c2389a0 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/native/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 5b85f42..940cfee 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,4 @@ # file : pgsql/native/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 9781646..a34a5c3 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : pgsql/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 1ebb890..7f3ec12 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/template/makefile b/pgsql/template/makefile index bf6b9c3..d1edd41 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : pgsql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index a142b7f..be89561 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/test.bat b/pgsql/test.bat index 4075d5c..cd93b22 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : pgsql/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index bbfa99e..810f422 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,6 +1,4 @@ // file : pgsql/truncation/driver.cxx -// author : Boris Kolpackov -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 6bfe835..152250c 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,4 @@ # file : pgsql/truncation/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index d472b52..1fbba44 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,6 +1,4 @@ // file : pgsql/truncation/test.hxx -// author : Boris Kolpackov -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index d6d675c..e69f3a5 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/types/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 0ba6bec..41c890c 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,4 @@ # file : pgsql/types/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 500887a..354a190 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/types/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index ae3bd9e..eadc94a 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,4 @@ // file : pgsql/types/traits.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/Makefile.am b/qt/Makefile.am index 95d34d5..43a2f40 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,4 @@ # file : qt/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/build.bat b/qt/build.bat index 3f6a647..aea98fd 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/build.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 20241a5..c55213a 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,4 @@ # file : qt/common/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx index e285448..b9ff8cb 100644 --- a/qt/common/containers/driver.cxx +++ b/qt/common/containers/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/containers/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index 0bbdda8..7ee8495 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -1,5 +1,4 @@ # file : qt/common/containers/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/containers/test.hxx b/qt/common/containers/test.hxx index 7953d14..226217f 100644 --- a/qt/common/containers/test.hxx +++ b/qt/common/containers/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/containers/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/makefile b/qt/common/makefile index 7c4c59c..7a7e59e 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,4 @@ # file : qt/common/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index b149fee..1089b41 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/smart-ptr/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 12514f7..08775d9 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,4 @@ # file : qt/common/smart-ptr/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 86e4fba..94fbce8 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/smart-ptr/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index e3cca0a..69037f6 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/common/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index ca37c05..48648aa 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 84a63eb..82ab0b9 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,4 @@ # file : qt/common/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index ced88b2..aed4455 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/common/test.bat b/qt/common/test.bat index bd6c5b5..c6808cf 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/common/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/makefile b/qt/makefile index f491174..11401e6 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,4 @@ # file : qt/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 4ed226a..157af68 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mssql/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 25ea172..65b8a1c 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/basic/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 181e2ef..694c222 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/basic/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index 245d1ee..62bbbfe 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/basic/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 0e7681a..1e43e04 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index efe33e2..c473900 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 218baaa..0f3f625 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 22e3570..eb9b7b0 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index ea290f1..1547fb4 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mssql/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 070ed91..4f12ba0 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 8502371..e92d26a 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index c3b2198..cebe72b 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index 5629a6b..3d76501 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/mssql/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index dec2a28..0e85c9f 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mysql/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index d2eebd6..d4ed9b8 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/basic/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index dcfac13..3d7d512 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/basic/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index 83b1396..e31689e 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/basic/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 34eea5d..0f54c54 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 94963f5..278ed02 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index dd0f640..dcc711d 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/makefile b/qt/mysql/makefile index c87e1ea..4f65578 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 1239fa7..6de24ff 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mysql/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index bd12e22..02bf646 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index aa5381d..ca8d4ca 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index e6ca8ba..660a844 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index 96f88be..d2d9278 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/mysql/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index dedab0e..496c797 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : qt/oracle/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 9b37d67..a85911f 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/basic/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 9f3207e..ab8e650 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/basic/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 6a3e788..d511f3d 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/basic/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index f6c5400..b201c9f 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index e018e16..0fbdce6 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 1f10411..ab3f11e 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 3d3b063..4ae5f4b 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 00b4afe..8a9ee00 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/oracle/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index c43e4f2..c30c0d8 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index ede9ed3..3b444b1 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index 02fcb8f..386cbc5 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index e73cdff..e9a56ee 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/oracle/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index 3073fef..c409576 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/pgsql/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index a2384f6..5a4889c 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/basic/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 977cdca..b5151bf 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/basic/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index 4633b2c..ef24936 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/basic/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index c1f41f0..cad440f 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index b6e71a8..ad9225f 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index 6560e0c..cc84066 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 21f4fd3..85f348d 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 94f3474..134ffd9 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/pgsql/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index aae2509..41431b4 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index c599c3e..723d1fe 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index 7d285b7..fd09f8e 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index 02da4cd..d0f042a 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/pgsql/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 98962a9..0964652 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : qt/sqlite/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index c925f65..1f68e91 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/basic/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index aeede6a..e923fc8 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/basic/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 847e8c1..032de7f 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/basic/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 0ee5831..4e131df 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/date-time/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 71365df..d2b1f33 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/date-time/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 7531362..58c3a8d 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/date-time/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 3f40007..7b0b9ab 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index fbf2e84..bcc946b 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/sqlite/template/Makefile.am -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index c02cf06..cdf7e68 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/template/driver.cxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index b86ba6e..40e3fd0 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/template/makefile -# author : Constantin Michael # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index c823c0e..e94983c 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/template/test.hxx -// author : Constantin Michael // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index 997a329..f15d6e4 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/sqlite/test.bat -rem author : Constantin Michael rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 7661bd9..a9b351f 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : sqlite/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/makefile b/sqlite/makefile index b421807..052cf6b 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,4 @@ # file : sqlite/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 7f1d319..062e594 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/native/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 6a111e3..938d4fb 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,4 @@ # file : sqlite/native/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index ba169b3..7c6d39e 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : sqlite/template/Makefile.am -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index d7847f7..ba3b950 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/template/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/template/makefile b/sqlite/template/makefile index bb63095..6c84d24 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : sqlite/template/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index 45b1d82..715e0f5 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/template/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/test.bat b/sqlite/test.bat index f653557..e0f9f3d 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : sqlite/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 diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index a48bdc2..34f1886 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/truncation/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 33c7f46..83c823b 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,4 @@ # file : sqlite/truncation/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 824c0e8..f12cf0e 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/truncation/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 3c14c7a..86d78f8 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/types/driver.cxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/types/makefile b/sqlite/types/makefile index bf6235f..9bb9474 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,4 @@ # file : sqlite/types/makefile -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 79b0a33..61304e8 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/types/test.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 486e608..ba01bba 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,4 @@ // file : sqlite/types/traits.hxx -// author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file diff --git a/test.bat b/test.bat index c3355e0..a244867 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,5 @@ @echo off rem file : 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 diff --git a/tester.bat b/tester.bat index 23a0f8a..f21da3a 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,5 @@ @echo off rem file : tester.bat -rem author : Boris Kolpackov rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file diff --git a/tester.in b/tester.in index fdf2b9c..e8c74f3 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,6 @@ #! /bin/sh # file : tester.in -# author : Boris Kolpackov # copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -- cgit v1.1 From ad0fc0d9e6d9ad4e9aef6c76e1150ccf8885b217 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Jan 2012 14:52:04 +0200 Subject: Update copyright year --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/auto/driver.cxx | 2 +- common/auto/makefile | 2 +- common/auto/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/driver.cxx | 2 +- common/container/makefile | 2 +- common/container/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/inheritance/driver.cxx | 2 +- common/inheritance/makefile | 2 +- common/inheritance/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/query/driver.cxx | 2 +- common/query/makefile | 2 +- common/query/test.hxx | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship-query/driver.cxx | 2 +- common/relationship-query/makefile | 2 +- common/relationship-query/test.hxx | 2 +- common/relationship/driver.cxx | 2 +- common/relationship/makefile | 2 +- common/relationship/test.hxx | 2 +- common/schema/driver.cxx | 2 +- common/schema/makefile | 2 +- common/schema/test.hxx | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/driver.cxx | 2 +- common/transaction/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/driver.cxx | 2 +- common/view/makefile | 2 +- common/view/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/containers/driver.cxx | 2 +- qt/common/containers/makefile | 2 +- qt/common/containers/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 428 files changed, 428 insertions(+), 428 deletions(-) diff --git a/Makefile.am b/Makefile.am index db1adca..831f993 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common diff --git a/boost/Makefile.am b/boost/Makefile.am index 3874e15..86d1701 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index 34d7a76..132e011 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index 0398585..53d4fd6 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index 3bbd3d5..1c41fa8 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index 6956cd0..c32edb2 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 843f645..528823a 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 732683d..915afc6 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index ff583b3..cc6490d 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index c4e1ee4..8da77eb 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 99270c4..93b53a3 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index e8bf277..aab4631 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 734dcf9..d754acf 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 14e9af1..42dd770 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index 21dbc05..8c89b4f 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index 58d6f7b..ee8dcd2 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 5240004..2e04e03 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost container persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 85073db..ed78a2d 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index e0f7a48..1477fe7 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index 40d8ae7..a7430c7 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index dbab009..c0fc1c4 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index ed1519e..4164174 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 3917061..7713edc 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index 4757153..505d1c1 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 8bdd349..3154b10 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 59051f9..8eb0769 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 3c55864..212c5b5 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 8d1ef71..184a324 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index 881fce7..84e5bcc 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index ba03581..4b73df6 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index d641b42..ad4ad3a 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 59e94e6..d90310d 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 183d8c5..9d9449b 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index 6036e8f..dcfb20b 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 5089f41..088c25a 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 3a7ce53..a10f7a0 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index db7c237..da31a63 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 3571228..875ca60 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index 5105c6c..cb901fc 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 387ad26..603d4df 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 796d9c2..1b65c84 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index 6c8c240..ca59757 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index ac1680d..e1916b7 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 9a5fe8b..9699c5d 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 1e3fc52..380e746 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 23f695f..da5c150 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index b77f0f5..c4aa21d 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index a2fb64d..87829d5 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 65123a7..8251a6d 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index fcc0945..a17ecd6 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index 92fca3e..c925995 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 4012fd6..afd4657 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index bebe279..4f79151 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 68e26e5..b197037 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index dbf8a6d..6069988 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 8e75803..94546bc 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 2f7d3e1..0c1b33d 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index bbb2bcf..b97537c 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 09b1b82..605bc5b 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 48ec426..835bcda 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index 649d587..a98bfa2 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index 877f659..c719fc7 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index e218727..377b0f6 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index b966d37..afff640 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index e5b67a6..211e3c0 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index aa4cb4b..f03a875 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index b853f9c..0959213 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index de0059d..b4bf588 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index 289cbd9..a4e938a 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index 4aceba1..52f2228 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index 7f49d40..39910bb 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index a263fda..87cf5b4 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 8dedf02..531d4f4 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 7afa3f0..3a3051b 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index 77e8a83..622c2b9 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index ed3a94c..7125e52 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 88a3b38..3ac5ace 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 361be81..067ced3 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index 7f862f5..0178480 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index 64deb54..a40ce22 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index f8b68bc..c24faf3 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 9fa86e9..cfc9b34 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 3f689f4..eecd4e1 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index 86ecc96..ea786da 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 43c489a..f0f10f3 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 3924f9b..3f7549f 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index 1340531..3ad6b90 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 940028a..020617d 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index 0f43267..b399190 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index adf3825..2b62914 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index ccfd4e8..8a731b7 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index 0a34295..2541bb9 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index f64f096..0afcec2 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 3ee3cf3..7119fa6 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index 2dc9b18..fdc71dd 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index e6b3a6f..7830bb5 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index b07ecf9..86596b6 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index 9df9ac4..c40da43 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 442a824..f1e39ad 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index dd70364..abb2680 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 7fce21e..f5787e8 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index b891125..cf14ccd 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 6ea894f..872aa63 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 15b4ffd..1fe7152 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 959e613..1217fee 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 29a4ae6..65ac80b 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 35384b9..f06c51c 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 9fad2f7..98dec90 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index 71abfb3..f9e75a5 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 8e4acca..123d38b 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2011 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Boris Kolpackov # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 504ffb7..9839d51 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index d7c6328..7aa5a68 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 031bc4b..a416cf8 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 4f662cb..e793478 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 64def46..24b9644 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index f62873a..39b613e 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index 2c1b0dd..f76ceea 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index e8d2554..6eb9178 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index a4ff0d9..c643451 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index 6b438f2..ccff3af 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index c9927d5..9d70583 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 49ddee8..e12ced3 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index 2f3c593..71225ce 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index c461ea0..f413d76 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 441c547..54ca735 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/auto/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/auto/makefile b/common/auto/makefile index a06c50f..f05d4cc 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -1,5 +1,5 @@ # file : common/auto/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 0fd27be..1234720 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/auto/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 3b25d8d..b280771 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index 09350fd..7e0a789 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 2c8f20a..9e6434b 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index fc4832a..a43fa03 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index 0c57905..37f4cd4 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index f0112c5..99d7089 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 94b6b8c..4f4d720 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 454d043..4bac352 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 3823d7d..be53a2e 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index 51f0581..06b4798 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index 05c904f..45c4a6b 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index eefb041..f89c878 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 41bf745..03a6a68 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index a1e4ac5..d335d43 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 40e2635..1b8e3c0 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/driver.cxx b/common/container/driver.cxx index d743d40..d19dca1 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test container persistence. diff --git a/common/container/makefile b/common/container/makefile index 25e66d9..6c17fcf 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -1,5 +1,5 @@ # file : common/container/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/container/test.hxx b/common/container/test.hxx index 280a60d..31e9542 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -1,5 +1,5 @@ // file : common/container/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 0298190..d74c44d 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index a08fa92..f38995c 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 6b3af25..234119d 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 87dc631..49677c2 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index 7a4eb8c..c8e6b31 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index 45ae390..cff2d0c 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index e7ad7ff..cbc8192 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index 39e7649..3d9aeba 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index 675a530..bf6121e 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 563bd50..5bfa6a7 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index b9fd06a..04483f9 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 6857f88..8cc47ee 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index f9cf7e5..fc86730 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index b4ad846..fa392c7 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index 30a8169..50ca970 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index 8da9834..63c7e0f 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index 222fe9a..df85700 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index b2befc6..d6d83cf 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index 40cafa0..f7b711a 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 29b6206..9831ee8 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index e7ab43a..f9a18c2 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index fb639cf..4db3caa 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 5af2ac1..51e492b 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 44117c3..6aaf47c 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index e385af4..8eaf3f7 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index bf47406..a0e3725 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object inheritance. diff --git a/common/inheritance/makefile b/common/inheritance/makefile index fae47d7..633801c 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx index 6e3cec4..d679c46 100644 --- a/common/inheritance/test.hxx +++ b/common/inheritance/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 812cf1a..c2cc98a 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index 7d52021..d229c3d 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index b98d65b..fe47eb8 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 32677e0..2052f6f 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 7d5da5f..10d0faf 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 8394f0e..f9362f8 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 5476c78..efe50b5 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index a0a0a84..8304fe3 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 879149d..fca0320 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index adbe7a8..e75f66f 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index 45acf21..b613f0c 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 2b20cf1..c0ba422 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index ccf4e19..e53a0bb 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 84f54e9..2ee15b8 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index f22f056..5728a27 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 746c5a0..9363d22 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 549da67..1d31134 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index b66d04a..b44fc8d 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index cf80998..cbe46b8 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/driver.cxx b/common/query/driver.cxx index fd001dd..6afd82d 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support. diff --git a/common/query/makefile b/common/query/makefile index 7d5972c..dfdd5bd 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -1,5 +1,5 @@ # file : common/query/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/query/test.hxx b/common/query/test.hxx index 10d2dac..948ba30 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -1,5 +1,5 @@ // file : common/query/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index f30dceb..c543f7a 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index f3632c5..713b035 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 8205d27..04250fe 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 7d92783..56d1f14 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 8ade97e..b73cfe4 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx index 427f4eb..5168ac4 100644 --- a/common/relationship-query/test.hxx +++ b/common/relationship-query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 71ad9ae..879b123 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/makefile b/common/relationship/makefile index ca9fbf4..b6a8e94 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -1,5 +1,5 @@ # file : common/relationship/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 51e610a..bd18747 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index a68a0fe..ddbeb26 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test various aspects of database schema. diff --git a/common/schema/makefile b/common/schema/makefile index 03593b1..f221f06 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -1,5 +1,5 @@ # file : common/schema/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/schema/test.hxx b/common/schema/test.hxx index f8c6f45..5e30518 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 779ba36..47715ce 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 1d99ff1..d4f62fc 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 1fbb708..0557801 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index e9ff3a5..bf3545c 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 73ad3a6..0b47bb4 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 848030b..710b162 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index 351980a..a87e47a 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index 90e5b7c..dff900a 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx index 13e6bd6..a487a7d 100644 --- a/common/transaction/driver.cxx +++ b/common/transaction/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction operations. diff --git a/common/transaction/makefile b/common/transaction/makefile index 9b9aff7..aa15629 100644 --- a/common/transaction/makefile +++ b/common/transaction/makefile @@ -1,5 +1,5 @@ # file : common/transaction/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index b601c84..24105a3 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index 95588a3..28a3650 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index 8945eda..b7813de 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 01d06ca..76ffa1c 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test views. diff --git a/common/view/makefile b/common/view/makefile index b8bc105..fb8155b 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -1,5 +1,5 @@ # file : common/view/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/view/test.hxx b/common/view/test.hxx index 51862c1..04b8cef 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -1,5 +1,5 @@ // file : common/view/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 20bfa31..bb48fde 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 520fadc..3ea462d 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 1545d23..eeff674 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 9a6772f..259551d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index aae7ec9..da72069 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index a8740d6..38862f3 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 876907f..9674c70 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index c8f43b8..29e3eed 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 2eeb0b9..8ff02d3 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index 89e2897..66ccac9 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 00878e1..0d91172 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 1fcafe8..3c150cc 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 453b0f1..4bce49a 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 6b18e6c..14644f7 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 3a9e50d..09f305d 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 7a0de2f..63aaea9 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index 869d4f5..b137b11 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/database.m4 b/m4/database.m4 index 428b22d..83a3154 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index c7603a1..3762641 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index 8f6c756..b1f53b4 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 3eef9a3..874597a 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index f12e3f8..cc1c627 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index 187a6c6..b369a09 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 0f480ca..2b85a83 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index 16d85ea..30dcd4d 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index d36fe6d..6abf9cc 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index 3d9ee8c..2e1ab19 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index ffee03d..6e282a6 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 6e0fea3..ef754a9 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 221b9f2..adecac1 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index 0fd8163..89fa30c 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 5351215..b0c1b98 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index 03d8b02..c13f559 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index fbce179..a46139b 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index fa4e2e7..464d8d9 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index b1bd26f..5de424a 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 14a1041..6e0f45b 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index e351480..fce3f39 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 3c555e1..d207f1e 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 3d52f32..1fdc6aa 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index da4ce7d..e47e3bd 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 0c641ab..ef043a8 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/makefile b/mssql/makefile index cf32f4d..de9390a 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index fd23648..562583c 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index cb14a9c..6d6c474 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index d95bb15..03e97af 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index ede73ef..4fbaf08 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 284e8d7..ae1a76e 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 45ada5e..984daf7 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index ffd08a4..4c7ff97 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index 5489cd5..f4e61c2 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index fda3c46..805312b 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index 23de1d4..74d692a 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 3476515..fd183ea 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index 9024007..f44147c 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 0f817ec..b89a621 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index bf7eccb..659a89e 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index 127b4e1..3b09c12 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 721a01c..49bac08 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/makefile b/mysql/makefile index 2447e87..1872888 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 7b3377a..4ffe447 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index c872966..5632efe 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index b508146..cd3f9b5 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index a7b3980..636af43 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index a92574c..a5aacdd 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index 31abd3d..48d084d 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index ee3755d..1cd54e2 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 4d773c6..292d08f 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 831979e..39c0a88 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 709d1f7..b3128c0 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 784d0c1..493c5c2 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 5df509f..da5b444 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 93e2395..bf1ac9f 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 537b549..c437faa 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index c0d01b9..c400abd 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index 9caff0c..e4c46c3 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/makefile b/oracle/makefile index ed6dd2a..5f29177 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 6a78e46..33d18e0 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index d911c6d..33355a5 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 3b4c3cb..d7d5d84 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 4b18515..44b4f83 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index d761873..35530bc 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index 6ba06ce..c642aef 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 481590e..1a3ed8e 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 0f8c0f9..d34a882 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index c91868f..89f8e0b 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 3090961..f745a1e 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 8c43f0d..51ff2e2 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 80c2898..f840511 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index e7a0d57..ea93c9c 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/makefile b/pgsql/makefile index 097072e..6add9be 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index c2389a0..10bf92d 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 940cfee..79d28a3 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index a34a5c3..7f0984f 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 7f3ec12..755aaeb 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index d1edd41..3682441 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index be89561..9916172 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index cd93b22..fb0389e 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 810f422..eefbdcd 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 152250c..f6dfe18 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 1fbba44..531cbfa 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index e69f3a5..724a068 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 41c890c..e2cff01 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 354a190..856e981 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index eadc94a..0ec4079 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index 43a2f40..be36c0a 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index aea98fd..ed6b27e 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index c55213a..60826ae 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx index b9ff8cb..5de758c 100644 --- a/qt/common/containers/driver.cxx +++ b/qt/common/containers/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt containers persistence. diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index 7ee8495..fa74ed4 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/containers/test.hxx b/qt/common/containers/test.hxx index 226217f..2e452d6 100644 --- a/qt/common/containers/test.hxx +++ b/qt/common/containers/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index 7a7e59e..584267e 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 1089b41..4af2c05 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 08775d9..59ed66e 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 94fbce8..a3c3b94 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index 69037f6..a15f7b8 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 48648aa..0cdf655 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 82ab0b9..808c459 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index aed4455..2ccb3ef 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index c6808cf..eabcd0a 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index 11401e6..dd90f8a 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 157af68..b3c6307 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 65b8a1c..9fac8de 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 694c222..34a326b 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index 62bbbfe..c75153c 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 1e43e04..00ae30e 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index c473900..d6d7e62 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 0f3f625..bb31af5 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index eb9b7b0..ca01afd 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 1547fb4..33b0868 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 4f12ba0..b07f8b1 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index e92d26a..3fe0eb4 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index cebe72b..9e94dad 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index 3d76501..32e22e7 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index 0e85c9f..f84cca0 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index d4ed9b8..f0cc876 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 3d7d512..45a61ac 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index e31689e..a91f3cb 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 0f54c54..19b28df 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 278ed02..682176b 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index dcc711d..09c44ba 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 4f65578..7493222 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 6de24ff..1c8a6a6 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index 02bf646..ac95bb9 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index ca8d4ca..918e7d0 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index 660a844..4f9d094 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index d2d9278..7e17e86 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index 496c797..7b45bdc 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index a85911f..9b852d8 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index ab8e650..fcf137f 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index d511f3d..9269954 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index b201c9f..5b3b51a 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 0fbdce6..fec548e 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index ab3f11e..2eb8735 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 4ae5f4b..9850458 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 8a9ee00..5d19be3 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index c30c0d8..e626c4b 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 3b444b1..01c47bc 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index 386cbc5..b840a29 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index e9a56ee..066836e 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index c409576..aef28e9 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 5a4889c..ead2470 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index b5151bf..81c9b4f 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index ef24936..da594ec 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index cad440f..4ceaed8 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index ad9225f..05d9624 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index cc84066..f9edcbe 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 85f348d..02dad62 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 134ffd9..5a99cfa 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 41431b4..27d83ba 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 723d1fe..001996f 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index fd09f8e..c0ece6b 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index d0f042a..5364b03 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 0964652..2d89d3b 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 1f68e91..322e962 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index e923fc8..6e961bf 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 032de7f..542c179 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 4e131df..5c18a51 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index d2b1f33..4ab332e 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 58c3a8d..9c9235a 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 7b0b9ab..ee0c6f9 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index bcc946b..0448971 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index cdf7e68..6b368b1 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 40e3fd0..91b96dd 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index e94983c..4900420 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index f15d6e4..794653c 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index a9b351f..9b81766 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/makefile b/sqlite/makefile index 052cf6b..9e61fc5 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 062e594..30f0197 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 938d4fb..7de389a 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 7c6d39e..6171479 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index ba3b950..83766fd 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 6c84d24..a1be429 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index 715e0f5..2b961f3 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index e0f9f3d..2629151 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 34f1886..c8b9dab 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 83c823b..eb0da53 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index f12cf0e..9f7023d 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 86d78f8..0c19e75 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 9bb9474..4e00e86 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 61304e8..6d9fc1c 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index ba01bba..7a58946 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index a244867..7662f68 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index f21da3a..f5b00f5 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index e8c74f3..c55c59a 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From 18822401209d068801000709187654c28e3c1f2e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Jan 2012 15:12:37 +0200 Subject: Fix incorrect copyright holder --- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 3ac5ace..8d5737e 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 067ced3..d5e6a9f 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index 0178480..d184b72 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index a40ce22..8b9a5bd 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index c24faf3..a54a446 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index cfc9b34..b92076f 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index f06c51c..03fb341 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 98dec90..2350822 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index f9e75a5..a6d102c 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 123d38b..464b0ab 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2012 Boris Kolpackov +# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) -- cgit v1.1 From 589378df8c0cce1ae293cd6fcbaa570aab070538 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Jan 2012 16:28:41 +0200 Subject: Copy correct license file --- build/import/libodb-mssql/LICENSE | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/build/import/libodb-mssql/LICENSE b/build/import/libodb-mssql/LICENSE index ed9c55c..e559d65 100644 --- a/build/import/libodb-mssql/LICENSE +++ b/build/import/libodb-mssql/LICENSE @@ -1,12 +1,19 @@ -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. +Permission is granted to use, copy, modify, and distribute this +program under the ODB Non-Commercial Use and Evaluation License +(NCUEL) as published by Code Synthesis Tools CC. + +For more information on ODB licensing as well as for answers to +some of the common licensing questions, visit the ODB License +page: + +http://www.codesynthesis.com/products/odb/license.xhtml 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. +ODB Non-Commercial Use and Evaluation 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 +You should have received a copy of the ODB Non-Commercial Use and +Evaluation License (normally located in the NCUEL file that is +accompanying the distribution); if not, contact Code Synthesis +Tools CC at info@codesynthesis.com. -- cgit v1.1 From 777e124b689fcce6382ee322ed9c1fa65f6a5c42 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Jan 2012 16:37:05 +0200 Subject: Bump version to 1.8.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index bd8bf88..27f9cd3 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.7.0 +1.8.0 -- cgit v1.1 From d19c5d874860575e1aa379d6e55409a16d4455a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Jan 2012 14:57:18 +0200 Subject: Link to correct library --- libcommon/common/libcommon-vc9.vcproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj index afec31a..49bfe21 100644 --- a/libcommon/common/libcommon-vc9.vcproj +++ b/libcommon/common/libcommon-vc9.vcproj @@ -303,7 +303,7 @@ /> Date: Fri, 10 Feb 2012 15:06:17 +0200 Subject: Use correct truncation vector in container loading code --- mysql/truncation/driver.cxx | 33 +++++++++++++++++++++++++++++++-- mysql/truncation/test.hxx | 34 ++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 292d08f..43f18b3 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -23,9 +24,9 @@ using namespace odb::core; int main (int argc, char* argv[]) { - // The default pre-allocated buffer is 512 bytes long. + // The default pre-allocated buffer is 256 bytes long. // - string long_str (640, 'c'); // This will get the buffer to 1024 + string long_str (300, 'c'); // This will get the buffer to 512 string longer_str (1025, 'b'); try @@ -152,6 +153,34 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test containers. + // + { + auto_ptr db (create_database (argc, argv)); + + // Use different connections to persist and load the object. + // + connection_ptr c1 (db->connection ()); + connection_ptr c2 (db->connection ()); + + container o (1); + o.vec_.push_back (string (513, 'x')); + + { + transaction t (c1->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (c2->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + + assert (p->vec_ == o.vec_); + } + } } catch (const odb::exception& e) { diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index b3128c0..b1aae1a 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -6,19 +6,15 @@ #define TEST_HXX #include +#include + #include #pragma db object table ("test") struct object1 { - object1 (unsigned long id) - : id_ (id) - { - } - - object1 () - { - } + object1 () {} + object1 (unsigned long id): id_ (id) {} #pragma db id unsigned long id_; @@ -29,14 +25,8 @@ struct object1 #pragma db object table ("test") struct object2 { - object2 (unsigned long id) - : id_ (id) - { - } - - object2 () - { - } + object2 () {} + object2 (unsigned long id): id_ (id) {} #pragma db id unsigned long id_; @@ -44,4 +34,16 @@ struct object2 std::string str_; }; +#pragma db object +struct container +{ + container () {} + container (unsigned long id) : id_ (id) {} + + #pragma db id + unsigned long id_; + + std::vector vec_; +}; + #endif // TEST_HXX -- cgit v1.1 From 5646a1c5a3529f787803edf61f15ae8692eb574e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Feb 2012 10:07:16 +0200 Subject: Resolve C++11 ambiguity --- common/lazy-ptr/driver.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 2052f6f..8065e2c 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -223,6 +223,7 @@ main (int argc, char* argv[]) #ifdef HAVE_TR1_MEMORY { using namespace ::tr1; + using std::tr1::shared_ptr; // persist // -- cgit v1.1 From 0306a05023c3857bc0ee7a3bf8355a5665f78d11 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 22 Feb 2012 12:28:06 +0200 Subject: Add support for composite object ids New pragma id_type (member). New test: common/composite-id. The composite example has also been updated. --- common/composite-id/driver.cxx | 633 +++++++++++++++++++++++++++++++++++++++++ common/composite-id/makefile | 108 +++++++ common/composite-id/test.hxx | 418 +++++++++++++++++++++++++++ common/composite-id/test.std | 0 common/makefile | 1 + 5 files changed, 1160 insertions(+) create mode 100644 common/composite-id/driver.cxx create mode 100644 common/composite-id/makefile create mode 100644 common/composite-id/test.hxx create mode 100644 common/composite-id/test.std diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx new file mode 100644 index 0000000..3ad71ac --- /dev/null +++ b/common/composite-id/driver.cxx @@ -0,0 +1,633 @@ +// file : common/composite-id/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test composite object ids. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test 1. + // + { + using namespace test1; + + object o1 (scomp ("aaa", "bbb", "ccc"), 123); + o1.vec.push_back (scomp ("xxx", "xxx", "xxx")); + o1.vec.push_back (scomp ("yyy", "yyy", "yyy")); + + object o2 (scomp ("aaa", "bbb", "ccd"), 234); + o2.vec.push_back (scomp ("zzz", "", "zzz")); + + object o3 (scomp ("baa", "bbb", "ccc"), 345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p3 == o3); + } + + // Update. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o1.id)); + p->num++; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o1.id)); + t.commit (); + + assert (p->num == o1.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (o1.id); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->find (o1.id)); + assert (p.get () == 0); + t.commit (); + } + } + + // Test 2. + // + { + using namespace test2; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + + object3 o3 (ncomp (3, 0, 1)); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "aaa"))); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "bbb"))); + + object4 o4 (ncomp (4, 0, 1)); + o4.c.o2 = new object2 (ncomp (2, 4, 1)); + o4.c.o2->o1 = new object1 (scomp ("o1", "o2", "ccc")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + db->persist (o3.o1[0]); + db->persist (o3.o1[1]); + db->persist (o3); + db->persist (o4.c.o2->o1); + db->persist (o4.c.o2); + db->persist (o4); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + auto_ptr p4 (db->load (o4.id)); + t.commit (); + + assert (p2->o1->id == o2.o1->id); + assert (p3->o1.size () == o3.o1.size ()); + assert (p3->o1[0]->id == o3.o1[0]->id); + assert (p3->o1[1]->id == o3.o1[1]->id); + assert (p4->c.o2->id == o4.c.o2->id); + assert (p4->c.o2->o1->id == o4.c.o2->o1->id); + } + + // Update. + // + { + scomp id2, id3; + + { + transaction t (db->begin ()); + + auto_ptr p2 (db->load (o2.id)); + delete p2->o1; + p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); + id2 = db->persist (p2->o1); + db->update (*p2); + + auto_ptr p3 (db->load (o3.id)); + delete p3->o1.back (); + p3->o1.pop_back (); + p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); + id3 = db->persist (p3->o1.back ()); + db->update (*p3); + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2->o1->id == id2); + assert (p3->o1.back ()->id == id3); + } + } + + // Query. + // + { + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::o1->id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + { + // As id (dual interface). + // + result r (db->query (query::o1.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + t.commit (); + } + + // Second level composite object pointer. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::c.o2->o1.str3 == "ccc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o4.id); + assert (++i == r.end ()); + + t.commit (); + } + } + + // View. + // + { + transaction t (db->begin ()); + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object2::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query ((query::object3::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object4::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num4 == 1 && i->num2 == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // Test 3. + // + { + using namespace test3; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + o2.o1->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1->id); + + i->o2->o1 = 0; + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str2 == "o2")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 4. + // + { + using namespace test4; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + assert (p2->o1[0]->o2->id == o2.id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1[0]->id); + i->o2->o1.clear (); + + assert (++i != r.end ()); + assert (i->id == o2.o1[1]->id); + + i->o2->o1.clear (); + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 5. + // + { + using namespace test5; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 6. + // + { + using namespace test6; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2.push_back (&o2); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2.push_back (&o2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2[0]->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2[0]->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 7. + // + { + using namespace test7; + + object o (scomp ("aaa", "bbb", "ccc"), 123); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p == o); + } + + // Update. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + p->num++; + db->update (*p); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (p->num == o.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/composite-id/makefile b/common/composite-id/makefile new file mode 100644 index 0000000..774b8c7 --- /dev/null +++ b/common/composite-id/makefile @@ -0,0 +1,108 @@ +# file : common/composite-id/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix t_comp_id_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +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 schema) + $(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/composite-id/test.hxx b/common/composite-id/test.hxx new file mode 100644 index 0000000..a5fb375 --- /dev/null +++ b/common/composite-id/test.hxx @@ -0,0 +1,418 @@ +// file : common/composite-id/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db value +struct scomp +{ + scomp () {} + scomp (std::string const& s1, std::string const& s2, std::string const& s3) + : str1 (s1), str2 (s2), str3 (s3) + { + } + + std::string str1; + std::string str2; + std::string str3; +}; + +inline bool +operator== (const scomp& x, const scomp& y) +{ + return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; +} + +//@@ tmp? +// +inline bool +operator< (const scomp& x, const scomp& y) +{ + return x.str1 < y.str1 || + (x.str1 == y.str1 && x.str2 < y.str2) || + (x.str1 == y.str1 && x.str2 == y.str2 && x.str3 < y.str3); +} + +#pragma db value +struct ncomp +{ + ncomp () {} + ncomp (unsigned short n1, unsigned short n2, unsigned short n3) + : num1 (n1), num2 (n2), num3 (n3) + { + } + + unsigned short num1; + unsigned short num2; + unsigned short num3; +}; + +inline bool +operator== (const ncomp& x, const ncomp& y) +{ + return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; +} + +//@@ tmp? +// +inline bool +operator< (const ncomp& x, const ncomp& y) +{ + return x.num1 < y.num1 || + (x.num1 == y.num1 && x.num2 < y.num2) || + (x.num1 == y.num1 && x.num2 == y.num2 && x.num3 < y.num3); +} + +// Test object with composite id, container. +// +namespace test1 +{ + #pragma db object + struct object + { + object () {} + object (scomp const& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + std::vector vec; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.num == y.num && x.vec == y.vec; + } +} + +// Test to-one and to-many relationships with composite id as well as +// queries and views. +// +namespace test2 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (scomp const& i): id (i) {} + + #pragma db id + scomp id; + }; + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + object2 (ncomp const& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (ncomp const& i): id (i) {} + + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + // Test second-level query pointer test as well as pointers in + // composite types. + // + #pragma db value + struct comp + { + comp (): o2 (0) {} + ~comp () {delete o2;} + + object2* o2; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (ncomp const& i): id (i) {} + + #pragma db id + ncomp id; + + comp c; + }; + + #pragma db view object(object2) object(object1) + struct view2 + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object3) object(object1) + struct view3 + { + #pragma db column (object3::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object4) object(object2) object(object1) + struct view4 + { + #pragma db column (object4::id.num3) + unsigned short num4; + + #pragma db column (object2::id.num3) + unsigned short num2; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-one(i) relationship with composite id. +// +namespace test3 +{ + struct object2; + + #pragma db object table("test3_object1") + struct object1 + { + object1 () {} + object1 (scomp const& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object table("test3_object2") + struct object2 + { + object2 (): o1 (0) {} + object2 (ncomp const& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-one(i) relationship with composite id. +// +namespace test4 +{ + struct object2; + + #pragma db object table("test4_object1") + struct object1 + { + object1 () {} + object1 (scomp const& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object table("test4_object2") + struct object2 + { + object2 () {} + object2 (ncomp const& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-many(i) relationship with composite id. +// +namespace test5 +{ + struct object2; + + #pragma db object table("test5_object1") + struct object1 + { + object1 () {} + object1 (scomp const& i): id (i) {} + + #pragma db id + scomp id; + + object2* o2; + }; + + #pragma db object table("test5_object2") + struct object2 + { + object2 () {} + object2 (ncomp const& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-many(i) relationship with composite id. +// +namespace test6 +{ + struct object2; + + #pragma db object table("test6_object1") + struct object1 + { + object1 () {} + object1 (scomp const& i): id (i) {} + + #pragma db id + scomp id; + + std::vector o2; + }; + + #pragma db object table("test6_object2") + struct object2 + { + object2 () {} + object2 (ncomp const& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test object with composite id and version (optimistic concurrency). +// +namespace test7 +{ + #pragma db object optimistic table("test7_object") + struct object + { + object () {} + object (scomp const& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + #pragma db version + unsigned long ver; + + unsigned long num; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.ver == y.ver && x.num == y.num ; + } +} + +#endif // TEST_HXX diff --git a/common/composite-id/test.std b/common/composite-id/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index e75f66f..80aa030 100644 --- a/common/makefile +++ b/common/makefile @@ -9,6 +9,7 @@ auto \ blob \ callback \ composite \ +composite-id \ const-object \ const-member \ container \ -- cgit v1.1 From 50b4de07844ca2a5781d7845115d7bd9e7c8f003 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Feb 2012 09:58:48 +0200 Subject: C++11 support (initial infrastructure) --- common/relationship/makefile | 1 + configure.ac | 12 ++++++++---- libcommon/common/config-vc.h | 6 ++++++ libcommon/common/config.h.in | 1 + libcommon/common/makefile | 11 ++++++++++- m4/cxx11.m4 | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 m4/cxx11.m4 diff --git a/common/relationship/makefile b/common/relationship/makefile index b6a8e94..f422860 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -98,6 +98,7 @@ $(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) diff --git a/configure.ac b/configure.ac index 259551d..109b4cc 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,14 @@ THREADS AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) +# Check for C++11. +# +CXX11([HAVE_CXX11], [Compiling in the C++11 mode.]) + +# Check for TR1 availability. +# +TR1_MEMORY + # Check for the ODB compiler. # ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) @@ -41,10 +49,6 @@ ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB # LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) -# Check for TR1 availability. -# -TR1_MEMORY - # Check for boost. # odb_tests_boost=yes diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 3c150cc..7031e35 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -10,4 +10,10 @@ #define HAVE_TR1_MEMORY +/* VC++10 has C++11 always enabled. + */ +#if _MSC_VER >= 1600 +# define HAVE_CXX11 +#endif + #endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 4bce49a..ed600ac 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -14,6 +14,7 @@ #undef DATABASE_ORACLE #undef DATABASE_MSSQL #undef HAVE_TR1_MEMORY +#undef HAVE_CXX11 #undef LIBCOMMON_STATIC_LIB #endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 63aaea9..0742caf 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -40,7 +40,11 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) -$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/. +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard + +ifdef db_id +ifdef cxx_standard +$(out_base)/config.h: | $(out_base)/. @echo '/* file : libcommon/common/config.h' >$@ @echo ' * note : automatically generated' >>$@ @echo ' */' >>$@ @@ -59,9 +63,14 @@ else ifeq ($(db_id),oracle) else ifeq ($(db_id),mssql) @echo '#define DATABASE_MSSQL 1' >>$@ endif +ifeq ($(cxx_standard),c++11) + @echo '#define HAVE_CXX11 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ +endif +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) diff --git a/m4/cxx11.m4 b/m4/cxx11.m4 new file mode 100644 index 0000000..774f20d --- /dev/null +++ b/m4/cxx11.m4 @@ -0,0 +1,38 @@ +dnl file : m4/cxx11.m4 +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl CXX11(MACRO, DESCRIPTION) +dnl +dnl Check if we are compiling in the C++11 mode. If we are, define MACRO as +dnl both a macro and conditional as well as set the cxx11 variable to 'yes'. +dnl +AC_DEFUN([CXX11], +[ +cxx11=no + +AC_MSG_CHECKING([whether we are in C++11 mode]) + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +int +main () +{ + std::shared_ptr p (new int (10)); + *p = 11; +} +]]), +[cxx11=yes]) + +if test x"$cxx11" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([$1], [1], [$2]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL([$1], [test x$cxx11 = xyes]) + +])dnl -- cgit v1.1 From 564700ab7c96b671b0c08a37e9a0e50f4b2fc176 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Feb 2012 10:03:19 +0200 Subject: C++11 support (pass --std ODB compiler option in build makefiles) --- boost/common/optional/makefile | 5 +++++ boost/common/smart-ptr/makefile | 5 +++++ boost/common/template/makefile | 5 +++++ boost/common/unordered/makefile | 5 +++++ boost/mssql/date-time/makefile | 5 +++++ boost/mssql/template/makefile | 5 +++++ boost/mysql/date-time/makefile | 5 +++++ boost/mysql/template/makefile | 5 +++++ boost/oracle/date-time/makefile | 5 +++++ boost/oracle/template/makefile | 5 +++++ boost/pgsql/date-time/makefile | 5 +++++ boost/pgsql/template/makefile | 5 +++++ boost/sqlite/date-time/makefile | 5 +++++ boost/sqlite/template/makefile | 5 +++++ common/auto/makefile | 5 +++++ common/blob/makefile | 5 +++++ common/callback/makefile | 5 +++++ common/composite-id/makefile | 5 +++++ common/composite/makefile | 5 +++++ common/const-member/makefile | 5 +++++ common/const-object/makefile | 5 +++++ common/container/makefile | 5 +++++ common/ctor/makefile | 5 +++++ common/default/makefile | 5 +++++ common/enum/makefile | 5 +++++ common/erase-query/makefile | 5 +++++ common/include/makefile | 5 +++++ common/inheritance/makefile | 5 +++++ common/inverse/makefile | 5 +++++ common/lazy-ptr/makefile | 5 +++++ common/lifecycle/makefile | 5 +++++ common/no-id/makefile | 5 +++++ common/optimistic/makefile | 5 +++++ common/pragma/makefile | 5 +++++ common/query/makefile | 5 +++++ common/readonly/makefile | 5 +++++ common/relationship-query/makefile | 5 +++++ common/relationship/makefile | 6 +++++- common/schema/makefile | 5 +++++ common/template/makefile | 5 +++++ common/threads/makefile | 5 +++++ common/types/makefile | 5 +++++ common/view/makefile | 5 +++++ common/wrapper/makefile | 5 +++++ mssql/query/makefile | 5 +++++ mssql/template/makefile | 5 +++++ mssql/types/makefile | 5 +++++ mysql/template/makefile | 5 +++++ mysql/truncation/makefile | 5 +++++ mysql/types/makefile | 5 +++++ oracle/template/makefile | 5 +++++ oracle/types/makefile | 5 +++++ pgsql/template/makefile | 5 +++++ pgsql/truncation/makefile | 5 +++++ pgsql/types/makefile | 5 +++++ qt/common/containers/makefile | 5 +++++ qt/common/smart-ptr/makefile | 5 +++++ qt/common/template/makefile | 5 +++++ qt/mssql/basic/makefile | 5 +++++ qt/mssql/date-time/makefile | 5 +++++ qt/mssql/template/makefile | 5 +++++ qt/mysql/basic/makefile | 5 +++++ qt/mysql/date-time/makefile | 5 +++++ qt/mysql/template/makefile | 5 +++++ qt/oracle/basic/makefile | 5 +++++ qt/oracle/date-time/makefile | 5 +++++ qt/oracle/template/makefile | 5 +++++ qt/pgsql/basic/makefile | 5 +++++ qt/pgsql/date-time/makefile | 5 +++++ qt/pgsql/template/makefile | 5 +++++ qt/sqlite/basic/makefile | 5 +++++ qt/sqlite/date-time/makefile | 5 +++++ qt/sqlite/template/makefile | 5 +++++ sqlite/template/makefile | 5 +++++ sqlite/truncation/makefile | 5 +++++ sqlite/types/makefile | 5 +++++ 76 files changed, 380 insertions(+), 1 deletion(-) diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 528823a..0b1866d 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 8da77eb..920d3b3 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 42dd770..363c730 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index ed78a2d..30603c6 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 7713edc..ab68ca6 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -110,7 +110,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 184a324..19ff1db 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 9d9449b..7889b7f 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 875ca60..5ec5934 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index e1916b7..63ad18d 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -110,7 +110,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 87829d5..c813394 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 4f79151..b1afc76 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index b97537c..db2426d 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 377b0f6..b36f2b7 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index b4bf588..c57dd91 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/auto/makefile b/common/auto/makefile index f05d4cc..188267e 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/blob/makefile b/common/blob/makefile index 7e0a789..5d1ac1c 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/callback/makefile b/common/callback/makefile index 37f4cd4..0c85d05 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 774b8c7..a10dd57 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/composite/makefile b/common/composite/makefile index 4bac352..602a9ab 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/const-member/makefile b/common/const-member/makefile index 45c4a6b..1c22843 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/const-object/makefile b/common/const-object/makefile index d335d43..47d9a0b 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/container/makefile b/common/container/makefile index 6c17fcf..b81b891 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/ctor/makefile b/common/ctor/makefile index f38995c..abcb78c 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/default/makefile b/common/default/makefile index c8e6b31..ad2010a 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/enum/makefile b/common/enum/makefile index 3d9aeba..f22da16 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 04483f9..5fc5305 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/include/makefile b/common/include/makefile index fa392c7..7320605 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -80,7 +80,12 @@ endif # How to. # +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 633801c..26d27eb 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/inverse/makefile b/common/inverse/makefile index d229c3d..30bd265 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 10d0faf..77053e3 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 8304fe3..210bb46 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/no-id/makefile b/common/no-id/makefile index c0ba422..9c6eeec 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 5728a27..80e32f5 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/pragma/makefile b/common/pragma/makefile index b44fc8d..09696c3 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/query/makefile b/common/query/makefile index dfdd5bd..8d08b04 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/readonly/makefile b/common/readonly/makefile index 713b035..4409927 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index b73cfe4..619cf8b 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/relationship/makefile b/common/relationship/makefile index f422860..4a6425e 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -98,8 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/schema/makefile b/common/schema/makefile index f221f06..9a3fb92 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/template/makefile b/common/template/makefile index 0557801..bf28ba1 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/threads/makefile b/common/threads/makefile index a87e47a..1c3550d 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/types/makefile b/common/types/makefile index 28a3650..f81b56f 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -96,7 +96,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/view/makefile b/common/view/makefile index fb8155b..26566ce 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 3ea462d..101ac93 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -98,7 +98,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mssql/query/makefile b/mssql/query/makefile index 4fbaf08..f2eed97 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mssql/template/makefile b/mssql/template/makefile index f4e61c2..7a469b2 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mssql/types/makefile b/mssql/types/makefile index f44147c..195dd46 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mysql/template/makefile b/mysql/template/makefile index a5aacdd..b7175bc 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 39c0a88..39ac0f3 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/mysql/types/makefile b/mysql/types/makefile index da5b444..ccc8ee9 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/oracle/template/makefile b/oracle/template/makefile index 35530bc..f3cf5e2 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/oracle/types/makefile b/oracle/types/makefile index 89f8e0b..da385ea 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 3682441..eb43706 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -94,7 +94,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index f6dfe18..d581f1f 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index e2cff01..a144a80 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index fa74ed4..439bc42 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 59ed66e..0a35eae 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -108,7 +108,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 808c459..68ca16b 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -109,7 +109,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 34a326b..ba1443d 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index d6d7e62..9ca111d 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 3fe0eb4..0bd81e3 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -99,7 +99,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 45a61ac..eaea174 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 682176b..2d038bd 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 918e7d0..9ddaede 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -99,7 +99,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index fcf137f..f77e896 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index fec548e..51d5374 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 01c47bc..c542b36 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -99,7 +99,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 81c9b4f..576fbd2 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 05d9624..c52bb98 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 001996f..aaceb1c 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -99,7 +99,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 6e961bf..2c1b23a 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 4ab332e..ebb707e 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -105,7 +105,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 91b96dd..8ce338f 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -99,7 +99,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/sqlite/template/makefile b/sqlite/template/makefile index a1be429..7f0881d 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index eb0da53..72c47e8 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -95,7 +95,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 4e00e86..bb3c09a 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -97,7 +97,12 @@ $(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/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) $(call include,$(odb_rules)) +endif + $(call include,$(bld_root)/cxx/cxx-d.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/o-e.make) -- cgit v1.1 From 439bc0ff201f38025d224ce421c86ca44f3dc063 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Feb 2012 12:46:48 +0200 Subject: Test std::shared_ptr in C++11 mode and std::tr1::shared_ptr in C++98 mode --- common/inverse/driver.cxx | 44 ++-- common/inverse/test.hxx | 395 ++++++++++++++++++----------------- common/lazy-ptr/driver.cxx | 44 +++- common/lazy-ptr/test.hxx | 20 +- common/relationship-query/driver.cxx | 9 +- common/relationship-query/test.hxx | 43 ++-- common/relationship/driver.cxx | 6 +- common/relationship/test.hxx | 17 +- 8 files changed, 327 insertions(+), 251 deletions(-) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index c2cc98a..cf66276 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -28,9 +28,11 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // Raw pointer version. + // Test raw pointers. // { + using namespace test1; + obj1_ptr o1_1 (new obj1); obj1_ptr o1_2 (new obj1); obj2_ptr o2 (new obj2); @@ -208,18 +210,20 @@ main (int argc, char* argv[]) delete o1_2; } - // TR1 pointer version. + // Test shared_ptr/weak_ptr. // -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { - tr1_obj1_ptr o1_1 (new tr1_obj1); - tr1_obj1_ptr o1_2 (new tr1_obj1); - tr1_obj2_ptr o2 (new tr1_obj2); - tr1_obj3_ptr o3_1 (new tr1_obj3); - tr1_obj3_ptr o3_2 (new tr1_obj3); - tr1_obj4_ptr o4 (new tr1_obj4); - tr1_obj5_ptr o5_1 (new tr1_obj5); - tr1_obj5_ptr o5_2 (new tr1_obj5); + using namespace test2; + + obj1_ptr o1_1 (new obj1); + obj1_ptr o1_2 (new obj1); + obj2_ptr o2 (new obj2); + obj3_ptr o3_1 (new obj3); + obj3_ptr o3_2 (new obj3); + obj4_ptr o4 (new obj4); + obj5_ptr o5_1 (new obj5); + obj5_ptr o5_2 (new obj5); o1_1->id = "obj1 1"; o1_1->o2 = o2; @@ -230,7 +234,7 @@ main (int argc, char* argv[]) o1_1->o5.push_back (o5_2); o1_2->id = "obj1 2"; - o1_2->o2 = tr1_obj2_ptr (); + o1_2->o2 = obj2_ptr (); o1_2->o3.clear (); o1_2->o4 = o4; o1_2->o5.push_back (o5_1); @@ -279,12 +283,12 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - tr1_obj2_ptr x2 (db->load (o2->id)); - tr1_obj3_ptr x3_1 (db->load (o3_1->id)); - tr1_obj3_ptr x3_2 (db->load (o3_2->id)); - tr1_obj4_ptr x4 (db->load (o4->id)); - tr1_obj5_ptr x5_1 (db->load (o5_1->id)); - tr1_obj5_ptr x5_2 (db->load (o5_2->id)); + obj2_ptr x2 (db->load (o2->id)); + obj3_ptr x3_1 (db->load (o3_1->id)); + obj3_ptr x3_2 (db->load (o3_2->id)); + obj4_ptr x4 (db->load (o4->id)); + obj5_ptr x5_1 (db->load (o5_1->id)); + obj5_ptr x5_2 (db->load (o5_2->id)); t.commit (); assert (x2->str == o2->str); @@ -301,7 +305,7 @@ main (int argc, char* argv[]) { assert (x4->str == o4->str); - tr1_obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); + obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); assert (t1->id == o1_1->id || t2->id == o1_1->id); assert (t1->id == o1_2->id || t2->id == o1_2->id); @@ -311,7 +315,7 @@ main (int argc, char* argv[]) assert (x5_1->str == o5_1->str); assert (x5_2->str == o5_2->str); - tr1_obj1_ptr t1 (x5_1->o1[0].lock ()), t2 (x5_1->o1[1].lock ()), + obj1_ptr t1 (x5_1->o1[0].lock ()), t2 (x5_1->o1[1].lock ()), t3 (x5_2->o1[0].lock ()); assert (t1->id == o1_1->id || t2->id == o1_1->id); diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index fe47eb8..83b6a3c 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY #include #include @@ -14,203 +14,222 @@ #include -#ifdef HAVE_TR1_MEMORY +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) # include #endif -struct obj1; -struct obj2; -struct obj3; -struct obj4; -struct obj5; - -typedef obj1* obj1_ptr; -typedef obj2* obj2_ptr; -typedef obj3* obj3_ptr; -typedef obj4* obj4_ptr; -typedef obj5* obj5_ptr; - -typedef std::set obj1_ptr_set; -typedef std::set obj3_ptr_set; -typedef std::set obj5_ptr_set; - -#pragma db object -struct obj1 -{ - obj1 (): o2 (0), o4 (0) {} - ~obj1 (); - - #pragma db id - std::string id; - - obj2_ptr o2; - - #pragma db id_column("obj1_id") value_column("obj3_id") - obj3_ptr_set o3; - - obj4_ptr o4; - - obj5_ptr_set o5; -}; - -#pragma db object -struct obj2 -{ - #pragma db id auto - int id; - - // one-to-one - // - #pragma db inverse(o2) - obj1_ptr o1; - - std::string str; -}; - -#pragma db object -struct obj3 -{ - std::string str; - - // one(i)-to-many - // - #pragma db inverse (o3) - obj1_ptr o1; - - #pragma db id auto - int id; -}; - -#pragma db object -struct obj4 -{ - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-one - // - #pragma db inverse (o4) - obj1_ptr_set o1; -}; - -#pragma db object -struct obj5 -{ - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-many - // - #pragma db inverse (o5) - obj1_ptr_set o1; -}; - -inline obj1:: -~obj1 () +// Test raw pointers. +// +#pragma db namespace table("t1_") +namespace test1 { - delete o2; - for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) - delete *i; - delete o4; - for (obj5_ptr_set::iterator i (o5.begin ()); i != o5.end (); ++i) - delete *i; + struct obj1; + struct obj2; + struct obj3; + struct obj4; + struct obj5; + + typedef obj1* obj1_ptr; + typedef obj2* obj2_ptr; + typedef obj3* obj3_ptr; + typedef obj4* obj4_ptr; + typedef obj5* obj5_ptr; + + typedef std::set obj1_ptr_set; + typedef std::set obj3_ptr_set; + typedef std::set obj5_ptr_set; + + #pragma db object + struct obj1 + { + obj1 (): o2 (0), o4 (0) {} + ~obj1 (); + + #pragma db id + std::string id; + + obj2_ptr o2; + + #pragma db id_column("obj1_id") value_column("obj3_id") + obj3_ptr_set o3; + + obj4_ptr o4; + + obj5_ptr_set o5; + }; + + #pragma db object + struct obj2 + { + #pragma db id auto + int id; + + // one-to-one + // + #pragma db inverse(o2) + obj1_ptr o1; + + std::string str; + }; + + #pragma db object + struct obj3 + { + std::string str; + + // one(i)-to-many + // + #pragma db inverse (o3) + obj1_ptr o1; + + #pragma db id auto + int id; + }; + + #pragma db object + struct obj4 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + obj1_ptr_set o1; + }; + + #pragma db object + struct obj5 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + obj1_ptr_set o1; + }; + + inline obj1:: + ~obj1 () + { + delete o2; + for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) + delete *i; + delete o4; + for (obj5_ptr_set::iterator i (o5.begin ()); i != o5.end (); ++i) + delete *i; + } } -// TR1 version +// Test shared_ptr/weak_ptr. // -#ifdef HAVE_TR1_MEMORY -struct tr1_obj1; -struct tr1_obj2; -struct tr1_obj3; -struct tr1_obj4; -struct tr1_obj5; - -typedef std::tr1::shared_ptr tr1_obj1_ptr; -typedef std::tr1::shared_ptr tr1_obj2_ptr; -typedef std::tr1::shared_ptr tr1_obj3_ptr; -typedef std::tr1::shared_ptr tr1_obj4_ptr; -typedef std::tr1::shared_ptr tr1_obj5_ptr; - -typedef std::tr1::weak_ptr tr1_obj1_wptr; - -typedef std::vector tr1_obj1_wptr_vec; -typedef std::vector tr1_obj3_ptr_vec; -typedef std::vector tr1_obj5_ptr_vec; - -#pragma db object pointer(tr1_obj1_ptr) -struct tr1_obj1 -{ - #pragma db id - std::string id; - - tr1_obj2_ptr o2; - - #pragma db id_column("tr1_obj1_id") value_column("tr1_obj3_id") - tr1_obj3_ptr_vec o3; - - tr1_obj4_ptr o4; - tr1_obj5_ptr_vec o5; -}; - -#pragma db object pointer(tr1_obj2_ptr) -struct tr1_obj2 -{ - #pragma db id auto - int id; - - std::string str; - - // one(i)-to-one - // - #pragma db inverse(o2) - tr1_obj1_wptr o1; -}; +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -#pragma db object pointer(tr1_obj3_ptr) -struct tr1_obj3 +#pragma db namespace table("t2_") +namespace test2 { - #pragma db id auto - int id; - - std::string str; - - // one(i)-to-many - // - #pragma db inverse (o3) - tr1_obj1_wptr o1; -}; - -#pragma db object pointer(tr1_obj4_ptr) -struct tr1_obj4 -{ - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-one - // - #pragma db inverse (o4) - tr1_obj1_wptr_vec o1; -}; - -#pragma db object pointer(tr1_obj5_ptr) -struct tr1_obj5 -{ - #pragma db id auto - int id; - - std::string str; +#ifdef HAVE_CXX11 + using std::shared_ptr; + using std::weak_ptr; +#else + using std::tr1::shared_ptr; + using std::tr1::weak_ptr; +#endif - // many(i)-to-many - // - #pragma db inverse (o5) - tr1_obj1_wptr_vec o1; -}; + struct obj1; + struct obj2; + struct obj3; + struct obj4; + struct obj5; + + typedef shared_ptr obj1_ptr; + typedef shared_ptr obj2_ptr; + typedef shared_ptr obj3_ptr; + typedef shared_ptr obj4_ptr; + typedef shared_ptr obj5_ptr; + + typedef weak_ptr obj1_wptr; + + typedef std::vector obj1_wptr_vec; + typedef std::vector obj3_ptr_vec; + typedef std::vector obj5_ptr_vec; + + #pragma db object pointer(obj1_ptr) + struct obj1 + { + #pragma db id + std::string id; + + obj2_ptr o2; + + #pragma db id_column("obj1_id") value_column("obj3_id") + obj3_ptr_vec o3; + + obj4_ptr o4; + obj5_ptr_vec o5; + }; + + #pragma db object pointer(obj2_ptr) + struct obj2 + { + #pragma db id auto + int id; + + std::string str; + + // one(i)-to-one + // + #pragma db inverse(o2) + obj1_wptr o1; + }; + + #pragma db object pointer(obj3_ptr) + struct obj3 + { + #pragma db id auto + int id; + + std::string str; + + // one(i)-to-many + // + #pragma db inverse (o3) + obj1_wptr o1; + }; + + #pragma db object pointer(obj4_ptr) + struct obj4 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + obj1_wptr_vec o1; + }; + + #pragma db object pointer(obj5_ptr) + struct obj5 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + obj1_wptr_vec o1; + }; +} #endif #endif // TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 8065e2c..3e031d3 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -6,6 +6,7 @@ // #include // std::auto_ptr +#include // std::move #include #include @@ -113,8 +114,13 @@ main (int argc, char* argv[]) // Correct object ids. // +#ifdef HAVE_CXX11 + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); +#else assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); +#endif // Load. // @@ -185,8 +191,13 @@ main (int argc, char* argv[]) // Correct object ids. // +#ifdef HAVE_CXX11 + assert (c->o.object_id () == o->id); + assert (o->c.object_id () == c->id); +#else assert (c->o.object_id () == o->id); assert (o->c.object_id () == c->id); +#endif // Load. // @@ -218,12 +229,11 @@ main (int argc, char* argv[]) } } - // TR1. + // Shared pointer from C++11 or TR1. // -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { - using namespace ::tr1; - using std::tr1::shared_ptr; + using namespace shared; // persist // @@ -258,6 +268,22 @@ main (int argc, char* argv[]) assert (lc1 == lazy_shared_ptr (*db, c1)); assert (lc1 != lazy_shared_ptr (*db, c2)); + // Test move constructors. + // +#ifdef HAVE_CXX11 + { + lazy_shared_ptr tmp (*db, 1); + lazy_shared_ptr l (std::move (tmp)); + assert (lc1 == l); + } + + { + shared_ptr tmp (c1); + lazy_shared_ptr l (*db, std::move (tmp)); + assert (lc1 == l); + } +#endif + { transaction t (db->begin ()); @@ -289,8 +315,13 @@ main (int argc, char* argv[]) // Correct object ids. // +#ifdef HAVE_CXX11 + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); +#else assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); +#endif // Load. // @@ -315,7 +346,12 @@ main (int argc, char* argv[]) assert (!c->o[1].loaded ()); lazy_shared_ptr l (c->o[1].lock ()); assert (!l.loaded ()); + +#ifdef HAVE_CXX11 + assert (l.object_id () == c->o[1].object_id ()); +#else assert (l.object_id () == c->o[1].object_id ()); +#endif // Reload. // diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index f9362f8..0adddf8 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY #include #include @@ -14,7 +14,7 @@ #include #include -#ifdef HAVE_TR1_MEMORY +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) # include # include #endif @@ -59,8 +59,8 @@ inline cont1:: ~cont1 () { for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) - if (i->loaded ()) - delete i->get (); + if (obj1* p = i->get ()) + delete p; } // Auto pointer. @@ -98,14 +98,20 @@ public: lazy_ptr c; // weak }; -// TR1. +// shared_ptr // -#ifdef HAVE_TR1_MEMORY -namespace tr1 +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) +namespace shared { +#ifdef HAVE_CXX11 + using std::shared_ptr; + using odb::lazy_shared_ptr; + using odb::lazy_weak_ptr; +#else using std::tr1::shared_ptr; using odb::tr1::lazy_shared_ptr; using odb::tr1::lazy_weak_ptr; +#endif class obj; diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 56d1f14..58bbef5 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY #include #include "test.hxx" @@ -29,9 +29,7 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); -#ifdef HAVE_TR1_MEMORY - - using std::tr1::shared_ptr; +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) // // @@ -164,7 +162,8 @@ main (int argc, char* argv[]) t.commit (); } -#endif +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY + } catch (const odb::exception& e) { diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx index 5168ac4..c2e167c 100644 --- a/common/relationship-query/test.hxx +++ b/common/relationship-query/test.hxx @@ -5,21 +5,28 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) #include #include -#include + +#ifdef HAVE_CXX11 +# include +using std::shared_ptr; +#else +# include +using std::tr1::shared_ptr; +#endif struct country; #pragma db value struct residence_info { - residence_info (bool p, std::tr1::shared_ptr l) + residence_info (bool p, shared_ptr l) : permanent (p), location (l) { } @@ -31,19 +38,19 @@ struct residence_info bool permanent; #pragma db not_null - std::tr1::shared_ptr location; + shared_ptr location; }; -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(shared_ptr) struct person { person (unsigned long i, const std::string& fn, const std::string& ln, unsigned short a, - std::tr1::shared_ptr r, + shared_ptr r, bool p, - std::tr1::shared_ptr n) + shared_ptr n) : id (i), first_name (fn), last_name (ln), @@ -71,24 +78,24 @@ struct person residence_info residence; #pragma db not_null - std::tr1::shared_ptr nationality; + shared_ptr nationality; - std::tr1::shared_ptr husband; // Self-join. + shared_ptr husband; // Self-join. }; struct employer; -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(shared_ptr) struct employee: person { employee (unsigned long i, const std::string& fn, const std::string& ln, unsigned short a, - std::tr1::shared_ptr r, + shared_ptr r, bool p, - std::tr1::shared_ptr n, - std::tr1::shared_ptr e) + shared_ptr n, + shared_ptr e) : person (i, fn, ln, a, r, p, n), employed_by (e) { @@ -98,10 +105,10 @@ struct employee: person { } - std::tr1::shared_ptr employed_by; + shared_ptr employed_by; }; -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(shared_ptr) struct employer { employer (const std::string& n) @@ -117,7 +124,7 @@ struct employer std::string name; }; -#pragma db object pointer(std::tr1::shared_ptr) +#pragma db object pointer(shared_ptr) struct country { country (const std::string& c, std::string const& n) @@ -135,5 +142,5 @@ struct country std::string name; }; -#endif // HAVE_TR1_MEMORY +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY #endif // TEST_HXX diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 879b123..20e0f0c 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -30,7 +30,7 @@ main (int argc, char* argv[]) aggr a ("aggr"); a.o1 = new obj1 ("o1", "obj1"); a.o2.reset (new obj2 ("obj2")); -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (new obj3 ("obj3")); a.c.num = 123; @@ -60,7 +60,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); db->persist (a.o1); db->persist (a.o2); -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) db->persist (a.o3); db->persist (a.c.o3); @@ -117,7 +117,7 @@ main (int argc, char* argv[]) delete a.o1; a.o1 = 0; a.o2.reset (); -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (); #endif diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index bd18747..8b40dba 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY #include #include @@ -15,7 +15,7 @@ #include -#ifdef HAVE_TR1_MEMORY +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) # include #endif @@ -138,11 +138,16 @@ operator== (const obj2& x, const obj2& y) return x.id == y.id && x.str == y.str; } -// tr1::shared_ptr +// shared_ptr // -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) struct obj3; + +#ifdef HAVE_CXX11 +typedef std::shared_ptr obj3_ptr; +#else typedef std::tr1::shared_ptr obj3_ptr; +#endif #pragma db object pointer(obj3_ptr) struct obj3 @@ -211,7 +216,7 @@ struct aggr obj1* o1; std::auto_ptr o2; -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) obj3_ptr o3; comp c; comp_vec cv; @@ -235,7 +240,7 @@ operator== (const aggr& x, const aggr& y) x.id == y.id && (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && x.c == y.c && x.cv == y.cv && -- cgit v1.1 From d706ea36e08230eb21996562e4e129495d871239 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Feb 2012 10:57:43 +0200 Subject: Support for C++11 std::unique_ptr as object pointer This includes the odb::lazy_unique_ptr implementation. --- common/lazy-ptr/driver.cxx | 51 ++++++++------- common/lazy-ptr/test.hxx | 137 +++++++++++++++++++++++------------------ common/relationship/driver.cxx | 14 +++++ common/relationship/test.hxx | 39 +++++++++++- 4 files changed, 156 insertions(+), 85 deletions(-) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 3e031d3..2e2f140 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -21,18 +21,21 @@ using namespace std; using namespace odb::core; -auto_ptr -create (unsigned int id) +namespace test2 { - auto_ptr r (new obj2 (id)); - return r; -} + obj_ptr + create (unsigned int id) + { + obj_ptr r (new obj (id)); + return r; + } -lazy_auto_ptr -create (database& db, unsigned int id) -{ - lazy_auto_ptr r (db, id); - return r; + lazy_obj_ptr + create (database& db, unsigned int id) + { + lazy_obj_ptr r (db, id); + return r; + } } int @@ -45,8 +48,7 @@ main (int argc, char* argv[]) // Raw. // { - typedef cont1 cont; - typedef obj1 obj; + using namespace test1; // persist // @@ -141,28 +143,31 @@ main (int argc, char* argv[]) } } - // Auto pointer. + // std::auto_ptr/std::unique_ptr // { - typedef cont2 cont; - typedef obj2 obj; + using namespace test2; // persist // { - auto_ptr o1 (new obj (1)); + obj_ptr o1 (new obj (1)); transaction t (db->begin ()); db->persist (*o1); t.commit (); } - auto_ptr c1 (new cont (1)); - auto_ptr c2 (new cont (2)); + cont_ptr c1 (new cont (1)); + cont_ptr c2 (new cont (2)); - lazy_auto_ptr lo1 = create (*db, 1); + lazy_obj_ptr lo1 = create (*db, 1); lo1 = create (*db, 1); +#ifdef HAVE_CXX11 + c1->o = std::move (lo1); +#else c1->o = lo1; +#endif c2->o = create (2); { @@ -181,7 +186,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr c (db->load (1)); + cont_ptr c (db->load (1)); obj* o (db->load (1)); // Not loaded. @@ -202,7 +207,7 @@ main (int argc, char* argv[]) // Load. // cont* cl (o->c.load ()); - const auto_ptr& ol (c->o.load ()); + const obj_ptr& ol (c->o.load ()); assert (cl == c.get ()); assert (ol.get () == o); @@ -215,7 +220,7 @@ main (int argc, char* argv[]) { // No session. transaction t (db->begin ()); - auto_ptr c (db->load (1)); + cont_ptr c (db->load (1)); assert (!c->o.loaded ()); c->o.load (); @@ -233,7 +238,7 @@ main (int argc, char* argv[]) // #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { - using namespace shared; + using namespace test3; // persist // diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 0adddf8..2813c50 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -21,87 +21,106 @@ // Raw pointer. // -using odb::lazy_ptr; -class obj1; - -#pragma db object -class cont1 +#pragma db namespace table("t1_") +namespace test1 { -public: - cont1 () {} - cont1 (unsigned long i): id (i) {} - ~cont1 (); + using odb::lazy_ptr; + class obj; - #pragma db id - unsigned long id; + #pragma db object + class cont + { + public: + cont () {} + cont (unsigned long i): id (i) {} + ~cont (); - typedef std::vector > obj_list; + #pragma db id + unsigned long id; - #pragma db value_not_null - obj_list o; -}; + typedef std::vector > obj_list; -#pragma db object -class obj1 -{ -public: - obj1 () {} - obj1 (unsigned long i): id (i) {} + #pragma db value_not_null + obj_list o; + }; - #pragma db id - unsigned long id; + #pragma db object + class obj + { + public: + obj () {} + obj (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; - #pragma db inverse(o) not_null - lazy_ptr c; // weak -}; + #pragma db inverse(o) not_null + lazy_ptr c; // weak + }; -inline cont1:: -~cont1 () -{ - for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) - if (obj1* p = i->get ()) - delete p; + inline cont:: + ~cont () + { + for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) + if (obj* p = i->get ()) + delete p; + } } -// Auto pointer. +// std::auto_ptr/std::unique_ptr // -using std::auto_ptr; -using odb::lazy_auto_ptr; +#pragma db namespace table("t2_") +namespace test2 +{ + using odb::lazy_ptr; -class obj2; + class obj; + class cont; -#pragma db object -class cont2 -{ -public: - cont2 () {} - cont2 (unsigned long i): id (i) {} +#ifdef HAVE_CXX11 + typedef std::unique_ptr obj_ptr; + typedef std::unique_ptr cont_ptr; + typedef odb::lazy_unique_ptr lazy_obj_ptr; +#else + typedef std::auto_ptr obj_ptr; + typedef std::auto_ptr cont_ptr; + typedef odb::lazy_auto_ptr lazy_obj_ptr; +#endif - #pragma db id - unsigned long id; + #pragma db object + class cont + { + public: + cont () {} + cont (unsigned long i): id (i) {} - #pragma db not_null - lazy_auto_ptr o; -}; + #pragma db id + unsigned long id; -#pragma db object -class obj2 -{ -public: - obj2 () {} - obj2 (unsigned long i): id (i) {} + #pragma db not_null + lazy_obj_ptr o; + }; + + #pragma db object + class obj + { + public: + obj () {} + obj (unsigned long i): id (i) {} - #pragma db id - unsigned long id; + #pragma db id + unsigned long id; - #pragma db inverse(o) not_null - lazy_ptr c; // weak -}; + #pragma db inverse(o) not_null + lazy_ptr c; // weak + }; +} // shared_ptr // #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -namespace shared +#pragma db namespace table("t3_") +namespace test3 { #ifdef HAVE_CXX11 using std::shared_ptr; diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 20e0f0c..c6f4b01 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -30,6 +30,13 @@ main (int argc, char* argv[]) aggr a ("aggr"); a.o1 = new obj1 ("o1", "obj1"); a.o2.reset (new obj2 ("obj2")); + +#ifdef HAVE_CXX11 + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); + a.v2.push_back (0); + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); +#endif + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (new obj3 ("obj3")); @@ -60,6 +67,13 @@ main (int argc, char* argv[]) transaction t (db->begin ()); db->persist (a.o1); db->persist (a.o2); + +#ifdef HAVE_CXX11 + for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) + if (*i) + db->persist (*i); +#endif + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) db->persist (a.o3); diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 8b40dba..e66e72c 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -118,9 +118,17 @@ operator== (const obj1_map& x, const obj1_map& y) return true; } -// auto_ptr +// auto_ptr/unique_ptr // -#pragma db object pointer(std::auto_ptr) +struct obj2; + +#ifdef HAVE_CXX11 +typedef std::unique_ptr obj2_ptr; +#else +typedef std::auto_ptr obj2_ptr; +#endif + +#pragma db object pointer(obj2_ptr) struct obj2 { obj2 () {} @@ -138,6 +146,23 @@ operator== (const obj2& x, const obj2& y) return x.id == y.id && x.str == y.str; } +#ifdef HAVE_CXX11 +typedef std::vector obj2_vec; + +inline bool +operator== (const obj2_vec& x, const obj2_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj2_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} +#endif + // shared_ptr // #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) @@ -215,7 +240,12 @@ struct aggr unsigned long id; obj1* o1; - std::auto_ptr o2; + + obj2_ptr o2; // std::auto_ptr or std::unique_ptr +#ifdef HAVE_CXX11 + obj2_vec v2; +#endif + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) obj3_ptr o3; comp c; @@ -240,6 +270,9 @@ operator== (const aggr& x, const aggr& y) x.id == y.id && (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && +#ifdef HAVE_CXX11 + x.v2 == y.v2 && +#endif #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && x.c == y.c && -- cgit v1.1 From 528f932066ecfc6a9fb5477031114da5aeceeb9c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Feb 2012 11:53:22 +0200 Subject: Support for C++11 std::unique_ptr and std::shared_ptr as wrappers --- common/wrapper/driver.cxx | 24 +++++++++---------- common/wrapper/test.hxx | 60 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 56 insertions(+), 28 deletions(-) diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index bb48fde..4f78a1b 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -36,9 +36,9 @@ main (int argc, char* argv[]) o.num.reset (new int (123)); o.nstrs.push_back (nullable_string ()); o.nstrs.push_back (nullable_string ("123")); -#ifdef HAVE_TR1_MEMORY - o.tr1_strs.push_back (tr1_nullable_string ()); - o.tr1_strs.push_back (tr1_nullable_string (new string ("123"))); +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + o.sstrs.push_back (str_sptr ()); + o.sstrs.push_back (str_sptr (new string ("123"))); #endif transaction t (db->begin ()); @@ -56,10 +56,10 @@ main (int argc, char* argv[]) assert (o->nstr.null ()); assert (o->nstrs[0].null ()); assert (o->nstrs[1].get () == "123"); -#ifdef HAVE_TR1_MEMORY - assert (!o->tr1_str); - assert (!o->tr1_strs[0]); - assert (*o->tr1_strs[1] == "123"); +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + assert (!o->sstr); + assert (!o->sstrs[0]); + assert (*o->sstrs[1] == "123"); #endif } @@ -102,10 +102,10 @@ main (int argc, char* argv[]) { cont_object co; - co.vi.reset (new vector); - co.vi->push_back (1); - co.vi->push_back (2); - co.vi->push_back (3); + co.nums.reset (new vector); + co.nums->push_back (1); + co.nums->push_back (2); + co.nums->push_back (3); co.c.num = 123; co.c.strs.reset (new vector); @@ -124,7 +124,7 @@ main (int argc, char* argv[]) auto_ptr o (db->load (id)); t.commit (); - assert (*o->vi == *co.vi); + assert (*o->nums == *co.nums); assert (o->c == co.c); } } diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index eeff674..ccf32b3 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_TR1_MEMORY +#include // HAVE_CXX11, HAVE_TR1_MEMORY #include #include // std::auto_ptr @@ -14,7 +14,7 @@ #include #include -#ifdef HAVE_TR1_MEMORY +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) # include #endif @@ -26,8 +26,16 @@ using odb::nullable; typedef nullable nullable_string; -#ifdef HAVE_TR1_MEMORY -typedef std::tr1::shared_ptr tr1_nullable_string; +#ifdef HAVE_CXX11 +typedef std::unique_ptr num_uptr; +typedef std::unique_ptr str_uptr; +typedef std::shared_ptr str_sptr; +#else +typedef std::auto_ptr num_uptr; +typedef std::auto_ptr str_uptr; +# ifdef HAVE_TR1_MEMORY +typedef std::tr1::shared_ptr str_sptr; +# endif #endif #pragma db object table("obj") @@ -36,20 +44,20 @@ struct object #pragma db id auto unsigned long id_; - std::auto_ptr num; + num_uptr num; #pragma db null - std::auto_ptr str; + str_uptr str; nullable_string nstr; std::vector nstrs; -#ifdef HAVE_TR1_MEMORY +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) #pragma db null - tr1_nullable_string tr1_str; + str_sptr sstr; #pragma db value_null - std::vector tr1_strs; + std::vector sstrs; #endif }; @@ -92,15 +100,27 @@ operator== (const comp2& x, const comp2& y) return x.str == y.str && x.num == y.num && x.strs == y.strs; } +struct comp3; + +#ifdef HAVE_CXX11 +typedef std::unique_ptr comp1_uptr; +typedef std::unique_ptr comp2_uptr; +typedef std::unique_ptr comp3_uptr; +#else +typedef std::auto_ptr comp1_uptr; +typedef std::auto_ptr comp2_uptr; +typedef std::auto_ptr comp3_uptr; +#endif + #pragma db object struct comp_object { #pragma db id auto unsigned long id_; - std::auto_ptr c1; // Wrapped comp value. + comp1_uptr c1; // Wrapped comp value. std::vector > vc1; // Container of wrapped comp values. - std::auto_ptr c2; // Container inside wrapped comp value. + comp2_uptr c2; // Container inside wrapped comp value. }; // This one is just a compilation test to cover more convolute cases. @@ -108,7 +128,7 @@ struct comp_object #pragma db value struct comp3: comp2 { - std::auto_ptr c1; + comp1_uptr c1; std::vector > vc1; }; @@ -118,18 +138,26 @@ struct comp_object2 #pragma db id auto unsigned long id_; - std::auto_ptr c3; + comp3_uptr c3; }; // // Containers. // +#ifdef HAVE_CXX11 +typedef std::unique_ptr> nums_uptr; +typedef std::unique_ptr> strs_uptr; +#else +typedef std::auto_ptr > nums_uptr; +typedef std::auto_ptr > strs_uptr; +#endif + #pragma db value struct cont_comp { int num; - std::auto_ptr > strs; + strs_uptr strs; }; inline bool @@ -144,8 +172,8 @@ struct cont_object #pragma db id auto unsigned long id_; - std::auto_ptr > vi; // Wrapped container. - cont_comp c; // Wrapped container in comp value. + nums_uptr nums; // Wrapped container. + cont_comp c; // Wrapped container in comp value. }; #endif // TEST_HXX -- cgit v1.1 From f8f44f0a8bae0667c6f5ff2315b220144785c6fb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Feb 2012 17:08:36 +0200 Subject: Support for C++11 containers (array, forward_list, unordered) --- common/container/driver.cxx | 206 ++++++++++++++++++++++++++++++++++++++++++++ common/container/test.hxx | 95 +++++++++++++++++++- 2 files changed, 299 insertions(+), 2 deletions(-) diff --git a/common/container/driver.cxx b/common/container/driver.cxx index d19dca1..469bba2 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -38,6 +38,23 @@ main (int argc, char* argv[]) empty.num = 0; empty.str = ""; +#ifdef HAVE_CXX11 + // array + // + empty.na[0] = 123; + empty.na[1] = 234; + empty.na[2] = 345; + + empty.sa[0] = "aaa"; + empty.sa[1] = "bbbb"; + empty.sa[2] = "ccccc"; + + empty.ca[0] = comp (123, "aaa"); + empty.ca[1] = comp (234, "bbbb"); + empty.ca[2] = comp (345, "ccccc"); +#endif + + // // med // @@ -89,6 +106,58 @@ main (int argc, char* argv[]) med.csm[comp (123, "aaa")] = "aaa"; med.csm[comp (234, "bbbb")] = "bbbb"; +#ifdef HAVE_CXX11 + // array + // + med.na[0] = 123; + med.na[1] = 234; + med.na[2] = 345; + + med.sa[0] = "aaa"; + med.sa[1] = "bbbb"; + med.sa[2] = "ccccc"; + + med.ca[0] = comp (123, "aaa"); + med.ca[1] = comp (234, "bbbb"); + med.ca[2] = comp (345, "ccccc"); + + // forward_list + // + med.nfl.push_front (234); + med.nfl.push_front (123); + + med.sfl.push_front ("bbbb"); + med.sfl.push_front ("aaa"); + + med.cfl.push_front (comp (234, "bbbb")); + med.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + med.nus.insert (123); + med.nus.insert (234); + + med.sus.insert ("aaa"); + med.sus.insert ("bbbb"); + + med.cus.insert (comp (123, "aaa")); + med.cus.insert (comp (234, "bbbb")); + + // unordered_map + // + med.nsum[123] = "aaa"; + med.nsum[234] = "bbbb"; + + med.snum["aaa"] = 123; + med.snum["bbbb"] = 234; + + med.ncum[123] = comp (123, "aaa"); + med.ncum[234] = comp (234, "bbbb"); + + med.csum[comp (123, "aaa")] = "aaa"; + med.csum[comp (234, "bbbb")] = "bbbb"; +#endif + // // full // @@ -152,6 +221,68 @@ main (int argc, char* argv[]) full.csm[comp (2345, "bbbbb")] = "bbbbb"; full.csm[comp (3456, "cccccc")] = "cccccc"; +#ifdef HAVE_CXX11 + // array + // + full.na[0] = 123; + full.na[1] = 234; + full.na[2] = 345; + + full.sa[0] = "aaa"; + full.sa[1] = "bbbb"; + full.sa[2] = "ccccc"; + + full.ca[0] = comp (123, "aaa"); + full.ca[1] = comp (234, "bbbb"); + full.ca[2] = comp (345, "ccccc"); + + // forward_list + // + full.nfl.push_front (345); + full.nfl.push_front (234); + full.nfl.push_front (123); + + full.sfl.push_front ("ccccc"); + full.sfl.push_front ("bbbb"); + full.sfl.push_front ("aaa"); + + full.cfl.push_front (comp (345, "ccccc")); + full.cfl.push_front (comp (234, "bbbb")); + full.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + full.nus.insert (1234); + full.nus.insert (2345); + full.nus.insert (3456); + + full.sus.insert ("aaaa"); + full.sus.insert ("bbbbb"); + full.sus.insert ("cccccc"); + + full.cus.insert (comp (1234, "aaaa")); + full.cus.insert (comp (2345, "bbbbb")); + full.cus.insert (comp (3456, "cccccc")); + + // unordered_map + // + full.nsum[1234] = "aaaa"; + full.nsum[2345] = "bbbbb"; + full.nsum[3456] = "cccccc"; + + full.snum["aaaa"] = 1234; + full.snum["bbbbb"] = 2345; + full.snum["cccccc"] = 3456; + + full.ncum[1234] = comp (1234, "aaaa"); + full.ncum[2345] = comp (2345, "bbbbb"); + full.ncum[3456] = comp (3456, "cccccc"); + + full.csum[comp (1234, "aaaa")] = "aaaa"; + full.csum[comp (2345, "bbbbb")] = "bbbbb"; + full.csum[comp (3456, "cccccc")] = "cccccc"; +#endif + // persist // { @@ -182,19 +313,37 @@ main (int argc, char* argv[]) empty.num = 99; empty.str = "xx"; + empty.nv.push_back (12); empty.sv.push_back ("aa"); empty.cv.push_back (comp (12, "aa")); empty.uv.push_back (12); empty.sl.push_back ("aa"); + empty.ns.insert (12); empty.ss.insert ("aa"); empty.cs.insert (comp (12, "aa")); + empty.nsm[12] = "aa"; empty.snm["aa"] = 12; empty.ncm[12] = comp (12, "aa"); empty.csm[comp (12, "aa")] = "aa"; +#ifdef HAVE_CXX11 + empty.nfl.push_front (12); + empty.sfl.push_front ("aa"); + empty.cfl.push_front (comp (12, "aa")); + + empty.nus.insert (12); + empty.sus.insert ("aa"); + empty.cus.insert (comp (12, "aa")); + + empty.nsum[12] = "aa"; + empty.snum["aa"] = 12; + empty.ncum[12] = comp (12, "aa"); + empty.csum[comp (12, "aa")] = "aa"; +#endif + // // med // @@ -218,6 +367,21 @@ main (int argc, char* argv[]) med.ncm.clear (); med.csm.clear (); +#ifdef HAVE_CXX11 + med.nfl.clear (); + med.sfl.clear (); + med.cfl.clear (); + + med.nus.clear (); + med.sus.clear (); + med.cus.clear (); + + med.nsum.clear (); + med.snum.clear (); + med.ncum.clear (); + med.csum.clear (); +#endif + // // full // @@ -266,6 +430,48 @@ main (int argc, char* argv[]) full.csm[comp (3456, "cccccc")] += "c"; full.csm[comp (4567, "ddddddd")] = "ddddddd"; +#ifdef HAVE_CXX11 + // array + // + full.na[0]++; + full.sa[0] += 'a'; + full.ca[0].num++; + full.ca[0].str += 'a'; + + // forward_list + // + full.nfl.front ()++; + full.nfl.push_front (4567); + + full.sfl.front () += 'a'; + full.sfl.push_front ("ddddddd"); + + full.cfl.front ().num++; + full.cfl.front ().str += 'a'; + full.cfl.push_front (comp (4567, "ddddddd")); + + // unordered_set + // + full.nus.insert (4567); + full.sus.insert ("ddddddd"); + full.cus.insert (comp (4567, "ddddddd")); + + // unordered_map + // + full.nsum[3456] += 'c'; + full.nsum[4567] = "ddddddd"; + + full.snum["cccccc"]++; + full.snum["ddddddd"] = 4567; + + full.ncum[3456].num++; + full.ncum[3456].str += 'c'; + full.ncum[4567] = comp (4567, "ddddddd"); + + full.csum[comp (3456, "cccccc")] += "c"; + full.csum[comp (4567, "ddddddd")] = "ddddddd"; +#endif + // update // { diff --git a/common/container/test.hxx b/common/container/test.hxx index 31e9542..ff2a4e2 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -5,12 +5,21 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include #include #include #include +#ifdef HAVE_CXX11 +# include +# include +# include +# include +#endif + #include #pragma db value @@ -31,6 +40,12 @@ operator== (const comp& x, const comp& y) } inline bool +operator!= (const comp& x, const comp& y) +{ + return !(x == y); +} + +inline bool operator< (const comp& x, const comp& y) { return x.num != y.num ? x.num < y.num : x.str < y.str; @@ -43,10 +58,40 @@ typedef std::vector str_vector; typedef std::set num_set; typedef std::set str_set; +typedef std::set comp_set; typedef std::map num_str_map; typedef std::map str_num_map; typedef std::map num_comp_map; +typedef std::map comp_str_map; + +#ifdef HAVE_CXX11 +struct comp_hash +{ + std::size_t + operator() (comp const& x) const {return nh (x.num) + sh (x.str);} + + std::hash nh; + std::hash sh; +}; + +typedef std::array num_array; +typedef std::array str_array; +typedef std::array comp_array; + +typedef std::forward_list num_flist; +typedef std::forward_list str_flist; +typedef std::forward_list comp_flist; + +typedef std::unordered_set num_uset; +typedef std::unordered_set str_uset; +typedef std::unordered_set comp_uset; + +typedef std::unordered_map num_str_umap; +typedef std::unordered_map str_num_umap; +typedef std::unordered_map num_comp_umap; +typedef std::unordered_map comp_str_umap; +#endif #pragma db value struct cont_comp1 @@ -103,14 +148,41 @@ struct object // num_set ns; str_set ss; - std::set cs; + comp_set cs; // map // num_str_map nsm; str_num_map snm; num_comp_map ncm; - std::map csm; + comp_str_map csm; + +#ifdef HAVE_CXX11 + // array + // + num_array na; + str_array sa; + comp_array ca; + + // forward_list + // + num_flist nfl; + str_flist sfl; + comp_flist cfl; + + // unordered_set + // + num_uset nus; + str_uset sus; + comp_uset cus; + + // unordered_map + // + num_str_umap nsum; + str_num_umap snum; + num_comp_umap ncum; + comp_str_umap csum; +#endif std::string str; }; @@ -152,6 +224,25 @@ operator== (const object& x, const object& y) x.ncm == y.ncm && x.csm == y.csm && +#ifdef HAVE_CXX11 + x.na == y.na && + x.sa == y.sa && + x.ca == y.ca && + + x.nfl == y.nfl && + x.sfl == y.sfl && + x.cfl == y.cfl && + + x.nus == y.nus && + x.sus == y.sus && + x.cus == y.cus && + + x.nsum == y.nsum && + x.snum == y.snum && + x.ncum == y.ncum && + x.csum == y.csum && +#endif + x.str == y.str; } -- cgit v1.1 From f59b5ad17eb77c3ff6f0e6e81162545e4b8d934b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Mar 2012 12:29:06 +0200 Subject: Use consistent default database name for SQLite --- build/sqlite/configure | 7 +++---- m4/sqlite.m4 | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build/sqlite/configure b/build/sqlite/configure index 71225ce..0111c94 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -10,12 +10,11 @@ $echo $echo "Please enter the SQLite database file name. Note that it WILL" -$echo "BE MODIFIED by the tests. If you do not specify a name, then a" -$echo "temporary on-disk database will be created. You can also specify" -$echo "':memory:' as a file name to use a temporary in-memory database." +$echo "BE MODIFIED by the tests. You can also specify ':memory:' as a" +$echo "file name to use a temporary in-memory database." $echo -db=`read_value` +db=`read_value "/tmp/odb-test.db"` opt=$dcf_root/db.options diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 5de424a..318a873 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -11,10 +11,10 @@ AC_DEFUN([SQLITE], [ AC_MSG_CHECKING([for sqlite database file]) AC_ARG_WITH( [sqlite-db], - [AC_HELP_STRING([--with-sqlite-db=FILE], [SQLite database file (odb_test.db by default). Note that all data in this database WILL BE LOST!])], + [AC_HELP_STRING([--with-sqlite-db=FILE], [SQLite database file (odb-test.db by default). Note that all data in this database WILL BE LOST!])], [case $withval in yes) - sqlite_db=odb_test.db + sqlite_db=odb-test.db sqlite_db_set=yes ;; no) @@ -25,7 +25,7 @@ AC_ARG_WITH( sqlite_db_set=yes ;; esac], - [sqlite_db=odb_test.db + [sqlite_db=odb-test.db sqlite_db_set=yes]) if test x$sqlite_db_set = xyes; then -- cgit v1.1 From 69c77457dd476fd554557d8ea39e6b4a1424259e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Mar 2012 12:32:53 +0200 Subject: Make sure we have same container members in all configurations --- common/container/test.hxx | 19 +++++++++++++++++++ common/relationship/test.hxx | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/common/container/test.hxx b/common/container/test.hxx index ff2a4e2..c531efb 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -182,6 +182,25 @@ struct object str_num_umap snum; num_comp_umap ncum; comp_str_umap csum; +#else + // Dummy containers to get the equivalent DROP TABLE statements. + // + num_vector na; + num_vector sa; + num_vector ca; + + num_vector nfl; + num_vector sfl; + num_vector cfl; + + num_set nus; + str_set sus; + comp_set cus; + + num_str_map nsum; + str_num_map snum; + num_comp_map ncum; + comp_str_map csum; #endif std::string str; diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index e66e72c..5383db6 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -244,6 +244,10 @@ struct aggr obj2_ptr o2; // std::auto_ptr or std::unique_ptr #ifdef HAVE_CXX11 obj2_vec v2; +#else + // Dummy containers to get the equivalent DROP TABLE statements. + // + std::vector v2; #endif #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -- cgit v1.1 From 3bf99419d41768c889c0ce04841815e8880d3f97 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Mar 2012 12:34:41 +0200 Subject: Add support for using C++11 std::unique_ptr to pass connection factory --- libcommon/common/common.cxx | 69 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 29e3eed..10c8ba2 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -3,6 +3,7 @@ // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit +#include // std::move #include #include @@ -79,21 +80,44 @@ create_database (int& argc, auto_ptr db; #if defined(DATABASE_MYSQL) + +#ifdef HAVE_CXX11 + unique_ptr f; +#else auto_ptr f; +#endif if (max_connections != 0) f.reset (new mysql::connection_pool_factory (max_connections)); - db.reset (new mysql::database (argc, argv, false, "", 0, f)); + db.reset (new mysql::database (argc, argv, false, "", 0, +#ifdef HAVE_CXX11 + move (f) +#else + f +#endif + )); + #elif defined(DATABASE_SQLITE) + +#ifdef HAVE_CXX11 + unique_ptr f; +#else auto_ptr f; +#endif if (max_connections != 0) f.reset (new sqlite::connection_pool_factory (max_connections)); db.reset ( new sqlite::database ( - argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, true, f)); + argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, true, +#ifdef HAVE_CXX11 + move (f) +#else + f +#endif + )); // Create the database schema. Due to bugs in SQLite foreign key // support for DDL statements, we need to temporarily disable @@ -111,15 +135,33 @@ create_database (int& argc, c->execute ("PRAGMA foreign_keys=ON"); } + #elif defined(DATABASE_PGSQL) + +#ifdef HAVE_CXX11 + unique_ptr f; +#else auto_ptr f; +#endif if (max_connections != 0) f.reset (new pgsql::connection_pool_factory (max_connections)); - db.reset (new pgsql::database (argc, argv, false, "", f)); + db.reset (new pgsql::database (argc, argv, false, "", +#ifdef HAVE_CXX11 + move (f) +#else + f +#endif + )); + #elif defined(DATABASE_ORACLE) + +#ifdef HAVE_CXX11 + unique_ptr f; +#else auto_ptr f; +#endif if (max_connections != 0) f.reset (new oracle::connection_pool_factory (max_connections)); @@ -127,15 +169,32 @@ create_database (int& argc, // Set client database character set and client national character set // to UTF-8. // - db.reset (new oracle::database (argc, argv, false, 873, 873, 0, f)); + db.reset (new oracle::database (argc, argv, false, 873, 873, 0, +#ifdef HAVE_CXX11 + move (f) +#else + f +#endif + )); #elif defined(DATABASE_MSSQL) + +#ifdef HAVE_CXX11 + unique_ptr f; +#else auto_ptr f; +#endif if (max_connections != 0) f.reset (new mssql::connection_pool_factory (max_connections)); - db.reset (new mssql::database (argc, argv, false, "", 0, f)); + db.reset (new mssql::database (argc, argv, false, "", 0, +#ifdef HAVE_CXX11 + move (f) +#else + f +#endif + )); #endif return db; -- cgit v1.1 From e67a19c220db8315914a74be7b3527535e480c87 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Mar 2012 12:36:58 +0200 Subject: Rename cxx11.m4 to c++11.m4 --- m4/c++11.m4 | 38 ++++++++++++++++++++++++++++++++++++++ m4/cxx11.m4 | 38 -------------------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 m4/c++11.m4 delete mode 100644 m4/cxx11.m4 diff --git a/m4/c++11.m4 b/m4/c++11.m4 new file mode 100644 index 0000000..774f20d --- /dev/null +++ b/m4/c++11.m4 @@ -0,0 +1,38 @@ +dnl file : m4/cxx11.m4 +dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl CXX11(MACRO, DESCRIPTION) +dnl +dnl Check if we are compiling in the C++11 mode. If we are, define MACRO as +dnl both a macro and conditional as well as set the cxx11 variable to 'yes'. +dnl +AC_DEFUN([CXX11], +[ +cxx11=no + +AC_MSG_CHECKING([whether we are in C++11 mode]) + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +int +main () +{ + std::shared_ptr p (new int (10)); + *p = 11; +} +]]), +[cxx11=yes]) + +if test x"$cxx11" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([$1], [1], [$2]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL([$1], [test x$cxx11 = xyes]) + +])dnl diff --git a/m4/cxx11.m4 b/m4/cxx11.m4 deleted file mode 100644 index 774f20d..0000000 --- a/m4/cxx11.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl CXX11(MACRO, DESCRIPTION) -dnl -dnl Check if we are compiling in the C++11 mode. If we are, define MACRO as -dnl both a macro and conditional as well as set the cxx11 variable to 'yes'. -dnl -AC_DEFUN([CXX11], -[ -cxx11=no - -AC_MSG_CHECKING([whether we are in C++11 mode]) - -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ -#include - -int -main () -{ - std::shared_ptr p (new int (10)); - *p = 11; -} -]]), -[cxx11=yes]) - -if test x"$cxx11" = xyes; then - AC_MSG_RESULT([yes]) - AC_DEFINE([$1], [1], [$2]) -else - AC_MSG_RESULT([no]) -fi - -AM_CONDITIONAL([$1], [test x$cxx11 = xyes]) - -])dnl -- cgit v1.1 From 34a371625b17428aa0e35488499a2a7b69b0da27 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Mar 2012 12:29:37 +0200 Subject: C++11 support in automake and VC++ projects, portability fixes --- boost/common/template/Makefile.am | 4 ++++ boost/common/template/template-vc10.vcxproj | 2 +- boost/common/template/template-vc9.vcproj | 2 +- boost/mssql/template/Makefile.am | 4 ++++ boost/mssql/template/template-vc10.vcxproj | 2 +- boost/mssql/template/template-vc9.vcproj | 2 +- boost/mysql/template/Makefile.am | 4 ++++ boost/mysql/template/template-vc10.vcxproj | 2 +- boost/mysql/template/template-vc9.vcproj | 2 +- boost/oracle/template/Makefile.am | 4 ++++ boost/oracle/template/template-vc10.vcxproj | 2 +- boost/oracle/template/template-vc9.vcproj | 2 +- boost/pgsql/template/Makefile.am | 4 ++++ boost/pgsql/template/template-vc10.vcxproj | 2 +- boost/pgsql/template/template-vc9.vcproj | 2 +- boost/sqlite/template/Makefile.am | 4 ++++ boost/sqlite/template/template-vc10.vcxproj | 2 +- boost/sqlite/template/template-vc9.vcproj | 2 +- common/lazy-ptr/driver.cxx | 9 +++++---- common/template/Makefile.am | 4 ++++ common/template/template-vc10.vcxproj | 2 +- common/template/template-vc9.vcproj | 2 +- libcommon/common/config-vc.h | 3 ++- mssql/template/Makefile.am | 4 ++++ mssql/template/template-vc10.vcxproj | 2 +- mssql/template/template-vc9.vcproj | 2 +- mysql/template/Makefile.am | 4 ++++ mysql/template/template-vc10.vcxproj | 2 +- mysql/template/template-vc9.vcproj | 2 +- oracle/template/Makefile.am | 4 ++++ oracle/template/template-vc10.vcxproj | 2 +- oracle/template/template-vc9.vcproj | 2 +- pgsql/template/Makefile.am | 4 ++++ pgsql/template/template-vc10.vcxproj | 2 +- pgsql/template/template-vc9.vcproj | 2 +- qt/common/template/Makefile.am | 4 ++++ qt/common/template/template-vc10.vcxproj | 2 +- qt/common/template/template-vc9.vcproj | 2 +- qt/mssql/template/Makefile.am | 4 ++++ qt/mssql/template/template-vc10.vcxproj | 2 +- qt/mssql/template/template-vc9.vcproj | 2 +- qt/mysql/template/Makefile.am | 4 ++++ qt/mysql/template/template-vc10.vcxproj | 2 +- qt/mysql/template/template-vc9.vcproj | 2 +- qt/oracle/template/Makefile.am | 4 ++++ qt/oracle/template/template-vc10.vcxproj | 2 +- qt/oracle/template/template-vc9.vcproj | 2 +- qt/pgsql/template/Makefile.am | 4 ++++ qt/pgsql/template/template-vc10.vcxproj | 2 +- qt/pgsql/template/template-vc9.vcproj | 2 +- qt/sqlite/template/Makefile.am | 4 ++++ qt/sqlite/template/template-vc10.vcxproj | 2 +- qt/sqlite/template/template-vc9.vcproj | 2 +- sqlite/template/Makefile.am | 4 ++++ sqlite/template/template-vc10.vcxproj | 2 +- sqlite/template/template-vc9.vcproj | 2 +- 56 files changed, 115 insertions(+), 41 deletions(-) diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index aab4631..d242a61 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -24,5 +24,9 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj index 55ceffc..af7987e 100644 --- a/boost/common/template/template-vc10.vcxproj +++ b/boost/common/template/template-vc10.vcxproj @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj index 235bd3c..bf900d0 100644 --- a/boost/common/template/template-vc9.vcproj +++ b/boost/common/template/template-vc9.vcproj @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 8eb0769..f450bb0 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/boost/mssql/template/template-vc10.vcxproj b/boost/mssql/template/template-vc10.vcxproj index a8e32bb..b1e2e37 100644 --- a/boost/mssql/template/template-vc10.vcxproj +++ b/boost/mssql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/mssql/template/template-vc9.vcproj b/boost/mssql/template/template-vc9.vcproj index 905f55a..520a143 100644 --- a/boost/mssql/template/template-vc9.vcproj +++ b/boost/mssql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index a10f7a0..10e80d3 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/boost/mysql/template/template-vc10.vcxproj b/boost/mysql/template/template-vc10.vcxproj index e6475bb..29e53be 100644 --- a/boost/mysql/template/template-vc10.vcxproj +++ b/boost/mysql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj index 316ea86..99551c1 100644 --- a/boost/mysql/template/template-vc9.vcproj +++ b/boost/mysql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index da5c150..9853f57 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/boost/oracle/template/template-vc10.vcxproj b/boost/oracle/template/template-vc10.vcxproj index 99773c8..8aa5256 100644 --- a/boost/oracle/template/template-vc10.vcxproj +++ b/boost/oracle/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/oracle/template/template-vc9.vcproj b/boost/oracle/template/template-vc9.vcproj index 0342966..2a7448a 100644 --- a/boost/oracle/template/template-vc9.vcproj +++ b/boost/oracle/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 94546bc..ec9e43b 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj index b344095..9f41ede 100644 --- a/boost/pgsql/template/template-vc10.vcxproj +++ b/boost/pgsql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj index 2639ffb..34a8582 100644 --- a/boost/pgsql/template/template-vc9.vcproj +++ b/boost/pgsql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index f03a875..0168a12 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/boost/sqlite/template/template-vc10.vcxproj b/boost/sqlite/template/template-vc10.vcxproj index 14e3fb8..5224c7f 100644 --- a/boost/sqlite/template/template-vc10.vcxproj +++ b/boost/sqlite/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/sqlite/template/template-vc9.vcproj b/boost/sqlite/template/template-vc9.vcproj index b8fab03..93e9ba2 100644 --- a/boost/sqlite/template/template-vc9.vcproj +++ b/boost/sqlite/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 2e2f140..3be6517 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -12,6 +12,7 @@ #include #include +#include // ODB_CXX11_* #include @@ -116,7 +117,7 @@ main (int argc, char* argv[]) // Correct object ids. // -#ifdef HAVE_CXX11 +#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); #else @@ -196,7 +197,7 @@ main (int argc, char* argv[]) // Correct object ids. // -#ifdef HAVE_CXX11 +#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o.object_id () == o->id); assert (o->c.object_id () == c->id); #else @@ -320,7 +321,7 @@ main (int argc, char* argv[]) // Correct object ids. // -#ifdef HAVE_CXX11 +#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); #else @@ -352,7 +353,7 @@ main (int argc, char* argv[]) lazy_shared_ptr l (c->o[1].lock ()); assert (!l.loaded ()); -#ifdef HAVE_CXX11 +#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (l.object_id () == c->o[1].object_id ()); #else assert (l.object_id () == c->o[1].object_id ()); diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 47715ce..4478502 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index bdaf37b..5666584 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index 9bb8cf8..caf7201 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -349,7 +349,7 @@ m4_ifelse(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 7031e35..d2e631d 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -12,7 +12,8 @@ /* VC++10 has C++11 always enabled. */ -#if _MSC_VER >= 1600 +#if (defined(_MSC_VER) && _MSC_VER >= 1600) || \ + (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1600) # define HAVE_CXX11 #endif diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 984daf7..204258b 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/mssql/template/template-vc10.vcxproj b/mssql/template/template-vc10.vcxproj index afd612e..3f5be3e 100644 --- a/mssql/template/template-vc10.vcxproj +++ b/mssql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mssql/template/template-vc9.vcproj b/mssql/template/template-vc9.vcproj index 53bef019..a1b3359 100644 --- a/mssql/template/template-vc9.vcproj +++ b/mssql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index cd3f9b5..b748228 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index 6e43f64..8246eab 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index e6a253a..387c18f 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index d7d5d84..7beba9c 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/oracle/template/template-vc10.vcxproj b/oracle/template/template-vc10.vcxproj index fce8b69..f1a91e0 100644 --- a/oracle/template/template-vc10.vcxproj +++ b/oracle/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/oracle/template/template-vc9.vcproj b/oracle/template/template-vc9.vcproj index acec7e6..97cff07 100644 --- a/oracle/template/template-vc9.vcproj +++ b/oracle/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 7f0984f..fdcd8b1 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/pgsql/template/template-vc10.vcxproj b/pgsql/template/template-vc10.vcxproj index f0ac852..87f2ee1 100644 --- a/pgsql/template/template-vc10.vcxproj +++ b/pgsql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/pgsql/template/template-vc9.vcproj b/pgsql/template/template-vc9.vcproj index ff1cbb9..07d580d 100644 --- a/pgsql/template/template-vc9.vcproj +++ b/pgsql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index a15f7b8..4101392 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -24,5 +24,9 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< diff --git a/qt/common/template/template-vc10.vcxproj b/qt/common/template/template-vc10.vcxproj index 5283a7e..1c4b458 100644 --- a/qt/common/template/template-vc10.vcxproj +++ b/qt/common/template/template-vc10.vcxproj @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-vc9.vcproj b/qt/common/template/template-vc9.vcproj index 1ad9a61..e8a6a3c 100644 --- a/qt/common/template/template-vc9.vcproj +++ b/qt/common/template/template-vc9.vcproj @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 33b0868..7d944cc 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/qt/mssql/template/template-vc10.vcxproj b/qt/mssql/template/template-vc10.vcxproj index d913afc..a3477e0 100644 --- a/qt/mssql/template/template-vc10.vcxproj +++ b/qt/mssql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/mssql/template/template-vc9.vcproj b/qt/mssql/template/template-vc9.vcproj index dc38c43..dc06622 100644 --- a/qt/mssql/template/template-vc9.vcproj +++ b/qt/mssql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 1c8a6a6..1fe0055 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj index d366643..0460825 100644 --- a/qt/mysql/template/template-vc10.vcxproj +++ b/qt/mysql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj index a9b474a..031e923 100644 --- a/qt/mysql/template/template-vc9.vcproj +++ b/qt/mysql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 5d19be3..6e23f58 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/qt/oracle/template/template-vc10.vcxproj b/qt/oracle/template/template-vc10.vcxproj index d984502..0ea856a 100644 --- a/qt/oracle/template/template-vc10.vcxproj +++ b/qt/oracle/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/oracle/template/template-vc9.vcproj b/qt/oracle/template/template-vc9.vcproj index 563a440..a350894 100644 --- a/qt/oracle/template/template-vc9.vcproj +++ b/qt/oracle/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 5a99cfa..f5f1eed 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj index 37ce9a0..bc51721 100644 --- a/qt/pgsql/template/template-vc10.vcxproj +++ b/qt/pgsql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj index fa20737..19cffcf 100644 --- a/qt/pgsql/template/template-vc9.vcproj +++ b/qt/pgsql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index 0448971..2470afe 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/qt/sqlite/template/template-vc10.vcxproj b/qt/sqlite/template/template-vc10.vcxproj index c299610..d705b5c 100644 --- a/qt/sqlite/template/template-vc10.vcxproj +++ b/qt/sqlite/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/sqlite/template/template-vc9.vcproj b/qt/sqlite/template/template-vc9.vcproj index c4c3b95..962bde9 100644 --- a/qt/sqlite/template/template-vc9.vcproj +++ b/qt/sqlite/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 6171479..baea455 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -26,6 +26,10 @@ ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ ODBCPPFLAGS = @ODBCPPFLAGS@ +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + test-odb.hxx: test.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj index 1b70509..9cf0599 100644 --- a/sqlite/template/template-vc10.vcxproj +++ b/sqlite/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ 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, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj index 9d54cbb..490567e 100644 --- a/sqlite/template/template-vc9.vcproj +++ b/sqlite/template/template-vc9.vcproj @@ -349,7 +349,7 @@ 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, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) -- cgit v1.1 From d5e2ad1054f9e025d12e85e9a124ddbfe10e64cf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Mar 2012 14:39:13 +0200 Subject: Workaround for VC10 unordered container ordering bug/peculiarity --- common/container/driver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/container/driver.cxx b/common/container/driver.cxx index 469bba2..c4e1179 100644 --- a/common/container/driver.cxx +++ b/common/container/driver.cxx @@ -453,8 +453,8 @@ main (int argc, char* argv[]) // unordered_set // full.nus.insert (4567); - full.sus.insert ("ddddddd"); - full.cus.insert (comp (4567, "ddddddd")); + full.sus.insert ("ddddddd1"); // 1 is to preserve order in VC++ 10. + full.cus.insert (comp (4567, "ddddddd1")); // unordered_map // @@ -462,14 +462,14 @@ main (int argc, char* argv[]) full.nsum[4567] = "ddddddd"; full.snum["cccccc"]++; - full.snum["ddddddd"] = 4567; + full.snum["ddddddd1"] = 4567; full.ncum[3456].num++; full.ncum[3456].str += 'c'; full.ncum[4567] = comp (4567, "ddddddd"); full.csum[comp (3456, "cccccc")] += "c"; - full.csum[comp (4567, "ddddddd")] = "ddddddd"; + full.csum[comp (4567, "ddddddd1")] = "ddddddd"; #endif // update -- cgit v1.1 From 176cceba500c15678733ec340a7725f0eb1cd3b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Mar 2012 18:08:04 +0200 Subject: Bump version to 1.9.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 27f9cd3..8a776ac 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.8.0 +1.9.0.a1 -- cgit v1.1 From 4059cc0ef58ffc40f50f15bdd1fecd78f49c2727 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 3 Mar 2012 15:51:57 +0200 Subject: Documentation updates for C++11 support --- INSTALL | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 6a59aee..ba1251c 100644 --- a/INSTALL +++ b/INSTALL @@ -90,6 +90,12 @@ C++ compiler and compiles with optimization and without debug information: ./configure CXX=g++-4.5 CXXFLAGS=-O3 +If you would like to build the tests in the C++11 mode, then you will need +to pass the necessary options to turn the C++ compiler into this mode. For +example: + +./configure CXXFLAGS=-std=c++0x + Once configuration is complete, run make to build the tests: make @@ -136,7 +142,8 @@ 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. +solution. Note that with Visual Studio 10 (2010) and later the tests are +built in the C++11 mode. Alternatively, you can use the build.bat batch files located in the odb-tests\, odb-tests\boost\, and odb-tests\qt\ directories to build all -- cgit v1.1 From 215a45dc83cd8fea56f413d164734345cfbfc994 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 6 Mar 2012 11:34:57 +0200 Subject: Detect situations where session is required but not used Throw session_required. --- common/session/driver.cxx | 83 ++++++++++++++++++++++++++++++++++ common/session/makefile | 113 ++++++++++++++++++++++++++++++++++++++++++++++ common/session/test.hxx | 66 +++++++++++++++++++++++++++ common/session/test.std | 0 4 files changed, 262 insertions(+) create mode 100644 common/session/driver.cxx create mode 100644 common/session/makefile create mode 100644 common/session/test.hxx create mode 100644 common/session/test.std diff --git a/common/session/driver.cxx b/common/session/driver.cxx new file mode 100644 index 0000000..d8467c2 --- /dev/null +++ b/common/session/driver.cxx @@ -0,0 +1,83 @@ +// file : common/session/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test session. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test the session_required exception. + // +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + { + using namespace test1; + + shared_ptr o1a (new obj1 (1)); + shared_ptr o1b (new obj1 (2)); + shared_ptr o2 (new obj2 (1)); + + o1a->o2 = o2; + o1b->o2 = o2; + + o2->o1.push_back (o1a); + o2->o1.push_back (o1b); + + { + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o1b); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + + try + { + shared_ptr o1 (db->load (1)); + assert (false); + } + catch (const session_required&) + { + } + + t.commit (); + } + + { + session s; + transaction t (db->begin ()); + shared_ptr o1 (db->load (1)); + t.commit (); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/session/makefile b/common/session/makefile new file mode 100644 index 0000000..4facdbb --- /dev/null +++ b/common/session/makefile @@ -0,0 +1,113 @@ +# file : common/session/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--table-prefix session_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/test.hxx b/common/session/test.hxx new file mode 100644 index 0000000..abc4628 --- /dev/null +++ b/common/session/test.hxx @@ -0,0 +1,66 @@ +// file : common/session/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include + +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +// Test the session_required exception. +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + +#pragma db namespace table("t1_") +namespace test1 +{ +#ifdef HAVE_CXX11 + using std::shared_ptr; + using std::weak_ptr; +#else + using std::tr1::shared_ptr; + using std::tr1::weak_ptr; +#endif + + #pragma db namespace(test1) pointer(shared_ptr) + + struct obj2; + + #pragma db object + struct obj1 + { + obj1 () {} + obj1 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + shared_ptr o2; + }; + + #pragma db object + struct obj2 + { + obj2 () {} + obj2 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db inverse (o2) + std::vector< weak_ptr > o1; + }; +} + +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY + +#endif // TEST_HXX diff --git a/common/session/test.std b/common/session/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 58f14a5a500b92f6ed34fe20a896ae9c2d777071 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 6 Mar 2012 11:49:43 +0200 Subject: Add missing test to top-level makefile --- common/makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/common/makefile b/common/makefile index 80aa030..886e4fa 100644 --- a/common/makefile +++ b/common/makefile @@ -30,6 +30,7 @@ readonly \ relationship \ relationship-query \ schema \ +session \ template \ transaction \ types \ -- cgit v1.1 From 382d0972301fb575f36eb2e5d442d735d7da3da4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 7 Mar 2012 10:21:09 +0200 Subject: Use RAII to free select statement results --- common/query/driver.cxx | 19 +++++++++++++++++++ common/query/test.std | 1 + common/threads/driver.cxx | 31 ++++++++++++++++++++++--------- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 6afd82d..c207955 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -513,6 +513,25 @@ main (int argc, char* argv[]) t.commit (); } + + // Test empty result set. + // + cout << "test 018" << endl; + { + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.begin () == r.end ()); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/query/test.std b/common/query/test.std index 58a2aa0..e4ed7a0 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -98,3 +98,4 @@ Jane Doe 29 married test 016 test 017 +test 018 diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 710b162..cbfb283 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -42,7 +42,7 @@ struct task { } - void + void* execute () { try @@ -121,24 +121,31 @@ struct task } } } + catch (int) + { + } + /* catch (const odb::exception& e) { cerr << e.what () << endl; + return reinterpret_cast (1); } + */ + + return 0; } static void* execute (void* arg) { - static_cast (arg)->execute (); - return 0; + return static_cast (arg)->execute (); } database& db_; unsigned long n_; }; -void +bool test (int argc, char* argv[], size_t max_connections) { auto_ptr db (create_database (argc, argv, true, max_connections)); @@ -156,8 +163,11 @@ test (int argc, char* argv[], size_t max_connections) new (details::shared) details::thread (&task::execute, t.get ()))); } + bool r (true); + for (unsigned long i (0); i < thread_count; ++i) - threads[i]->join (); + if (threads[i]->join () != 0) + r = false; { typedef odb::result result; @@ -170,6 +180,8 @@ test (int argc, char* argv[], size_t max_connections) t.commit (); } + + return r; } int @@ -177,10 +189,11 @@ main (int argc, char* argv[]) { try { - test (argc, argv, 0); - test (argc, argv, thread_count - 1); - test (argc, argv, thread_count / 2); - test (argc, argv, thread_count / 4); + if (!(test (argc, argv, 0) && + test (argc, argv, thread_count - 1) && + test (argc, argv, thread_count / 2) && + test (argc, argv, thread_count / 4))) + return 1; } catch (const odb::exception& e) { -- cgit v1.1 From adfa9c5ffccdd4e5db8c545d9106c0eb1d7bdcb8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Mar 2012 10:57:32 +0200 Subject: Print usage/version information to STDOUT instead of STDERR --- libcommon/common/common.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 10c8ba2..a786fb5 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -61,17 +61,17 @@ create_database (int& argc, { if (argc > 1 && argv[1] == string ("--help")) { - cerr << "Usage: " << argv[0] << " [options]" << endl + cout << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; #if defined(DATABASE_MYSQL) - mysql::database::print_usage (cerr); + mysql::database::print_usage (cout); #elif defined(DATABASE_SQLITE) - sqlite::database::print_usage (cerr); + sqlite::database::print_usage (cout); #elif defined(DATABASE_PGSQL) - pgsql::database::print_usage (cerr); + pgsql::database::print_usage (cout); #elif defined(DATABASE_ORAClE) - oracle::database::print_usage (cerr); + oracle::database::print_usage (cout); #endif exit (0); -- cgit v1.1 From 635d11d74cd873e6f53d05b1d9f091ae112402a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Apr 2012 16:48:03 +0200 Subject: Polymorphic inheritance support --- common/callback/test.std | 28 +- common/inheritance/driver.cxx | 17 + common/inheritance/test.hxx | 12 +- common/makefile | 1 + common/polymorphism/driver.cxx | 1830 ++++++++++++++++++++++++++++++++++ common/polymorphism/makefile | 113 +++ common/polymorphism/test.hxx | 987 ++++++++++++++++++ common/polymorphism/test.std | 36 + common/query/driver.cxx | 14 +- common/readonly/driver.cxx | 12 +- common/readonly/test.hxx | 12 + common/relationship-query/driver.cxx | 4 +- common/relationship-query/test.hxx | 9 +- 13 files changed, 3052 insertions(+), 23 deletions(-) create mode 100644 common/polymorphism/driver.cxx create mode 100644 common/polymorphism/makefile create mode 100644 common/polymorphism/test.hxx create mode 100644 common/polymorphism/test.std diff --git a/common/callback/test.std b/common/callback/test.std index c1afa36..b34a8de 100644 --- a/common/callback/test.std +++ b/common/callback/test.std @@ -1,6 +1,6 @@ persist - pre_persist 1 - post_persist 1 + pre_persist 1 const + post_persist 1 const pre_persist 2 const post_persist 2 const *** @@ -21,8 +21,8 @@ update post_load 1 pre_load 0 post_load 2 - pre_update 1 - post_update 1 + pre_update 1 const + post_update 1 const pre_update 2 const post_update 2 const *** @@ -33,18 +33,18 @@ erase post_load 2 pre_erase 1 const post_erase 1 const - pre_erase 2 - post_erase 2 + pre_erase 2 const + post_erase 2 const *** delayed load - pre_persist 1 - post_persist 1 - pre_persist 2 - post_persist 2 - pre_persist 3 - post_persist 3 - pre_persist 4 - post_persist 4 + pre_persist 1 const + post_persist 1 const + pre_persist 2 const + post_persist 2 const + pre_persist 3 const + post_persist 3 const + pre_persist 4 const + post_persist 4 const pre_load 0 pre_load 0 pre_load 0 diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index a0e3725..466ed33 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -161,6 +161,23 @@ main (int argc, char* argv[]) t.commit (); } + + // views + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::num == o2.num_)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); + assert (++i == r.end ()); + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx index d679c46..6059337 100644 --- a/common/inheritance/test.hxx +++ b/common/inheritance/test.hxx @@ -90,7 +90,7 @@ struct object1: base #pragma db object struct object2: base { - #pragma db column ("derived_str") + #pragma db column("derived_str") std::string str_; bool @@ -145,4 +145,14 @@ struct empty: base { }; +// View based on the derived object. +// +#pragma db view object(object2) +struct object2_view +{ + unsigned int num; // from abstract_base + unsigned long id; // from base + std::string str; // from object2, hides one from abstract_base +}; + #endif // TEST_HXX diff --git a/common/makefile b/common/makefile index 886e4fa..3ec0aa2 100644 --- a/common/makefile +++ b/common/makefile @@ -24,6 +24,7 @@ lazy-ptr \ lifecycle \ no-id \ optimistic \ +polymorphism \ pragma \ query \ readonly \ diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx new file mode 100644 index 0000000..efda095 --- /dev/null +++ b/common/polymorphism/driver.cxx @@ -0,0 +1,1830 @@ +// file : common/polymorphism/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test polymorphic object inheritance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +const char* events[] = +{ + "pre_persist", + "post_persist", + "pre_load", + "post_load", + "pre_update", + "post_update", + "pre_erase", + "post_erase" +}; + +namespace test6 +{ + void base:: + db_callback (callback_event e, database&) + { + cout << "base " << events[e] << " " << id << endl; + } + + void base:: + db_callback (callback_event e, database&) const + { + cout << "base " << events[e] << " " << id << " const" << endl; + } + + void derived:: + db_callback (callback_event e, database&) const + { + cout << "derived " << events[e] << " " << id << " const" << endl; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test 1: basic polymorphism functionality. + // + { + using namespace test1; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + + // Static persist. + // + db->persist (r); + db->persist (b); + + // Dynamic persist. + // + root& r (d); + db->persist (r); + + t.commit (); + } + + // Static load. + // + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Dynamic load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d.id)); + auto_ptr pd2 (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd1 == d); + assert (*pd2 == d); + } + + // Invalid load. + // + { + transaction t (db->begin ()); + + try + { + auto_ptr p (db->load (r.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + auto_ptr p (db->load (b.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static load into existing instance. + // + { + transaction t (db->begin ()); + root r1; + db->load (r.id, r1); + base b1; + db->load (b.id, b1); + derived d1; + db->load (d.id, d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic load into existing instance. + // + { + transaction t (db->begin ()); + base b1; + db->load (b.id, static_cast (b1)); + derived d1; + db->load (d.id, static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid load into existing instance. + // + { + transaction t (db->begin ()); + + try + { + base b; + db->load (r.id, static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + db->load (b.id, static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing load. + // + { + transaction t (db->begin ()); + root b1; + db->load (b.id, b1); + base d1; + db->load (d.id, d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Static reload. + // + { + transaction t (db->begin ()); + root r1; + r1.id = r.id; + db->reload (r1); + base b1; + b1.id = b.id; + db->reload (b1); + derived d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic reload. + // + { + transaction t (db->begin ()); + base b1; + b1.id = b.id; + db->reload (static_cast (b1)); + derived d1; + d1.id = d.id; + db->reload (static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid reload. + // + { + transaction t (db->begin ()); + + try + { + base b; + b.id = r.id; + db->reload (static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + d.id = b.id; + db->reload (static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing reload. + // + { + transaction t (db->begin ()); + root b1; + b1.id = b.id; + db->reload (b1); + base d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Query. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test loading via root. + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == r); + assert (++i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via base. + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via derived. + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test loading into an existing instance. + // + { + root_result qr (db->query ()); + + unsigned short mask (0); + + for (root_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::root") + { + root r1; + i.load (r1); + assert (r1 == r); + mask |= 1; + } + else if (ds == "test1::base") + { + base b1; + i.load (b1); + assert (b1 == b); + mask |= 2; + } + else if (ds == "test1::derived") + { + derived d1; + i.load (d1); + assert (d1 == d); + mask |= 4; + } + else + assert (false); + } + + assert (mask == 7); + } + + // Test query conditions with columns from multiple tables. + // + { + base_result qr ( + db->query ( + base_query::num == 3 && base_query::str == "ddd")); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test discriminator access. + // + { + base_result qr (db->query (base_query::id == 3)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test1::derived"); + assert (++i == e); + } + + // Test loading of an object from the same hierarchy during + // query result iteration (tests image copying via change + // callbacks in some databases). + // + { + base_result qr (db->query ()); + + unsigned short mask (0); + + for (base_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::base") + { + auto_ptr d1 (db->load (d.id)); + assert (*d1 == d); + assert (*i == b); + mask |= 1; + } + else if (ds == "test1::derived") + { + auto_ptr b1 (db->load (b.id)); + assert (*b1 == b); + assert (*i == d); + mask |= 2; + } + } + + assert (mask == 3); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->typeid_ == "test1::root" && i->num == r.num); + assert (++i != e && i->typeid_ == "test1::base" && i->num == b.num); + assert (++i != e && i->typeid_ == "test1::derived" && i->num == d.num); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->id == b.id && i->num == b.num && i->str == b.str); + assert (++i != e && + i->id == d.id && i->num == d.num && i->str == d.str); + assert (++i == e); + } + + // derived + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->num == d.num && i->str == d.str && + i->dnum == d.dnum && i->dstr == d.dstr); + assert (++i == e); + } + + t.commit (); + } + + // Update. + // + r.num++; + r.strs.push_back ("aaaa"); + + b.num++; + b.str += "b"; + b.nums.push_back (24); + b.strs.push_back ("bbbb"); + + d.num++; + d.str += "d"; + d.dnum++; + d.dstr += "d"; + d.nums.push_back (34); + d.strs.push_back ("dddd"); + + { + transaction t (db->begin ()); + + // Static update. + // + db->update (r); + db->update (b); + + // Dynamic update. + // + root& r (d); + db->update (r); + + t.commit (); + } + + // Verify update. + // + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Invalid erase via id. + // + { + transaction t (db->begin ()); + + try + { + db->erase (r.id); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + db->erase (b.id); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static erase via id. + // + { + transaction t (db->begin ()); + db->erase (r.id); + db->erase (b.id); + t.commit (); + } + + // Dynamic erase via id. + // + { + transaction t (db->begin ()); + db->erase (d.id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Static erase via object. + // + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + t.commit (); + } + + // Dynamic erase via object. + // + { + const root& r (d); + transaction t (db->begin ()); + db->erase (r); + t.commit (); + } + } + + // Test 2: inverse object pointers in polymorhic bases. + // + { + using namespace test2; + + derived d (1, "d", 1); + root_pointer rp (&d); + base_pointer bp (&d); + + { + transaction t (db->begin ()); + db->persist (rp); + db->persist (bp); + + d.rp.reset (*db, &rp); + d.bp.reset (*db, &bp); + + db->persist (d); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + auto_ptr pb (db->load (d.id)); + auto_ptr pr (db->load (d.id)); + t.commit (); + + assert (pd->rp.object_id () == rp.id && + pd->bp.object_id () == bp.id); + + derived* p (dynamic_cast (pb.get ())); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + + p = dynamic_cast (pr.get ()); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + base_result qr ( + db->query ( + base_query::rp->id == rp.id && + base_query::bp->id == bp.id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test2::derived"); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ()); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->rp_id == rp.id && i->r_id == d.id); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ()); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->bp_id == bp.id && i->b_id == d.id && i->str == d.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 3: delayed loading. + // + { + using namespace test3; + + base b1 (21, 21); + base b2 (22, 22); + base b3 (23, 23); + + derived d1 (31, 31, "d"); + derived d2 (32, 32, "dd"); + derived d3 (33, 33, "ddd"); + + b1.rptr = new root (1); + b2.rptr = new base (2, 2); + b3.rptr = new derived (3, 3, "b3"); + + d1.rptr = new root (4); + d2.rptr = new base (5, 5); + d3.rptr = new derived (6, 6, "d3"); + + d2.bptr = new base (7, 7); + d3.bptr = new derived (8, 8, "d3b"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (b2); + db->persist (b3); + + db->persist (d1); + db->persist (d2); + db->persist (d3); + + db->persist (b1.rptr); + db->persist (b2.rptr); + db->persist (b3.rptr); + + db->persist (d1.rptr); + db->persist (d2.rptr); + db->persist (d3.rptr); + + db->persist (d2.bptr); + db->persist (d3.bptr); + + t.commit (); + } + + { + transaction t (db->begin ()); + + { + auto_ptr p1 (db->load (b1.id)); + auto_ptr p2 (db->load (b2.id)); + auto_ptr p3 (db->load (b3.id)); + assert (*p1 == b1); + assert (*p2 == b2); + assert (*p3 == b3); + } + + { + auto_ptr p1 (db->load (d1.id)); + auto_ptr p2 (db->load (d2.id)); + auto_ptr p3 (db->load (d3.id)); + assert (*p1 == d1); + assert (*p2 == d2); + assert (*p3 == d3); + } + + t.commit (); + } + + // Query. + // + { + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + derived_result qr ( + db->query ( + derived_query::rptr->id == 6 && + derived_query::bptr->id == 8 && + derived_query::bptr->num == 8)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d3); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + typedef odb::query root_query; + typedef odb::result root_result; + + transaction t (db->begin ()); + + // base + // + { + base_result qr ( + db->query ( + base_query::base::num == b2.num && + base_query::base::id == b2.id && + base_query::r::id == b2.rptr->id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->b_id == b2.id && + i->r_id == b2.rptr->id && + i->num == b2.num); + assert (++i == e); + } + + // derived + // + { + derived_result qr ( + db->query ( + derived_query::d::str == d3.str && + derived_query::d::num == d3.num && + derived_query::b::num == d3.bptr->num && + derived_query::d::id == d3.id && + derived_query::b::id == d3.bptr->id && + derived_query::r::id == d3.rptr->id)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->d_id == d3.id && + i->b_id == d3.bptr->id && + i->r_id == d3.rptr->id && + i->d_num == d3.num && + i->b_num == d3.bptr->num && + i->str == d3.str); + assert (++i == e); + } + + // root + // + { + root_result qr ( + db->query ( + root_query::r::id.in (b2.rptr->id, d2.rptr->id))); + + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->r_id == d2.rptr->id && + i->d_id == d2.id && + i->str == d2.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 4: views. + // + { + using namespace test4; + + base1 b1 (21, 1); + + root2 r2 (11, 0); + base2 b2 (21, 1, "abc"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (r2); + db->persist (b2); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr ( + db->query ( + query::base1::num == b1.num)); + + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->str == "abc"); + assert (++i == e); + } + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr (db->query ()); + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->min_num == 1); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 5: polymorphism and optimistic concurrency. + // + { + using namespace test5; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Update. + // + { + transaction t (db->begin ()); + + // Root. + // + { + auto_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaa"); + db->update (r); + + p->num--; + p->strs.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (r == *p); + } + + // Base. + // + { + auto_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + p->num--; + p->str += "B"; + p->strs.pop_back (); + p->nums.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (b == *p); + } + + // Derived. + // + { + auto_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + derived& d1 (static_cast (*p)); + d1.num--; + d1.str += "D"; + d1.strs.pop_back (); + d1.nums.pop_back (); + d1.dnum--; + d1.dstr += "D"; + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (d == *p); + } + + t.commit (); + } + + // Reload. + // + { + transaction t (db->begin ()); + + // Make sure reload doesn't modify the object if the versions + // match. + // + derived d1 (d); + d1.num++; + d1.str += "d"; + d1.strs.push_back ("dddd"); + d1.nums.push_back (24); + d1.dnum++; + d1.dstr += "d"; + derived d2 (d1); + + db->reload (d1); + assert (d1 == d2); + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + + // Root. + // + { + auto_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaaa"); + db->update (r); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Base. + // + { + auto_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Derived. + // + { + auto_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Try to update non-existent object. + // + { + try + { + db->update (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + // Try to erase non-existent object. + // + { + try + { + db->erase (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + t.commit (); + } + } + + // Test 6: polymorphism and callbacks. + // + { + using namespace test6; + + base b (1, 1, "bbb"); + auto_ptr d (new derived (2, 2, "ddd")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d->id)); + + db->load (b.id, *pb); + db->load (d->id, *pd); + + db->reload (*pb); + db->reload (*pd); + + t.commit (); + } + + // Update. + // + { + b.num++; + d->num++; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + *i; + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d); + t.commit (); + } + + // Recursive (delayed) loading. + // + { + derived d (3, 3, "dddd"); + d.ptr.reset (new derived (4, 4, "ddddd")); + + { + transaction t (db->begin ()); + db->persist (d); + db->persist (d.ptr); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (d.id)); + t.commit (); + } + } + } + + // Test 7: polymorphism and object cache (session). + // +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + { + using namespace test7; + + shared_ptr r (new root (1, 1)); + shared_ptr b (new base (2, 2, "b")); + shared_ptr d (new derived (3, 3, "d")); + + // Persist. + // + { + session s; + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + assert (db->load (r->id) == r); + assert (db->load (b->id) == b); + assert (db->load (d->id) == d); + } + + // Load. + // + { + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + assert (db->load (r->id) == r1); + assert (db->load (b->id) == b1); + assert (db->load (d->id) == d1); + + assert (!db->find (b->id)); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + { + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i.load () == r1); + assert (++i != e && i.load () == b1); + assert (++i != e && i.load () == d1); + assert (++i == e); + + t.commit (); + } + } + + // Erase. + // + { + session s; + + { + transaction t (db->begin ()); + db->load (r->id); + db->load (b->id); + db->load (d->id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + db->erase (d); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (!db->find (r->id)); + assert (!db->find (b->id)); + assert (!db->find (d->id)); + t.commit (); + } + } + } +#endif + + // Test 8: polymorphism and abstract bases. + // + { + using namespace test8; + + base b (1, 1, "b"); + interm i (2, 2, "i", true); + derived1 d1 (3, 3, "d1", true); + derived2 d2 (4, 4, "d2", false); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d1)); + db->persist (static_cast (d2)); + + try + { + db->persist (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->persist (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Load. + // + { + base vb; + interm vi; + derived1 vd1; + derived2 vd2; + + transaction t (db->begin ()); + + // load (id) + // + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d1.id)); + auto_ptr pd2 (db->load (d2.id)); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + + // load (id, obj) + // + db->load (b.id, static_cast (vb)); + db->load (d1.id, static_cast (vd1)); + db->load (d2.id, static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->load (i.id, static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + // reload (obj) + // + vb.num = 0; + vd1.num = 0; + vd2.num = 0; + + db->reload (static_cast (vb)); + db->reload (static_cast (vd1)); + db->reload (static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->reload (static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Update. + // + { + b.num++; + b.str += 'b'; + d1.num++; + d1.str += "d1"; + d2.num++; + d2.str += "d1"; + + { + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d1); + db->update (static_cast (d2)); + + try + { + db->update (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->update (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d1.id)); + auto_ptr pd2 (db->load (d2.id)); + t.commit (); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + } + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d1.id); + db->erase (static_cast (d2)); + + try + { + db->erase (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->erase (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + } + + // Test 9: polymorphism and readonly classes. + // + { + using namespace test9; + + ro_root ro_r (1, 1); + rw_base rw_b (2, 2, "b"); + ro_derived ro_d (3, 3, "d"); + + rw_root rw_r (1, 1); + ro_base ro_b (2, 2, "b"); + rw_derived rw_d (3, 3, "d"); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (ro_r); + db->persist (rw_b); + db->persist (ro_d); + + db->persist (rw_r); + db->persist (ro_b); + db->persist (rw_d); + t.commit (); + } + + // Update. + // + { + ro_root ro_r1 (ro_r); + rw_base rw_b1 (rw_b); + ro_derived ro_d1 (ro_d); + + ro_base ro_b1 (ro_b); + rw_derived rw_d1 (rw_d); + + ro_r1.num++; + ro_r1.strs.push_back ("b"); + + rw_b1.num++; + rw_b1.strs.push_back ("b"); + rw_b1.str += "b"; + rw_b1.nums.push_back (2); + rw_b.str += "b"; + rw_b.nums.push_back (2); + + ro_d1.num++; + ro_d1.strs.push_back ("d"); + ro_d1.str += "d"; + ro_d1.nums.push_back (3); + ro_d1.dnum++; + ro_d1.dstr += "d"; + + rw_r.num++; + rw_r.strs.push_back ("b"); + + ro_b1.num++; + ro_b1.strs.push_back ("b"); + ro_b1.str += "b"; + ro_b1.nums.push_back (2); + + rw_d1.num++; + rw_d1.strs.push_back ("d"); + rw_d1.str += "d"; + rw_d1.nums.push_back (3); + rw_d1.dnum++; + rw_d1.dstr += "d"; + rw_d.dnum++; + rw_d.dstr += "d"; + + { + // These should be no-ops. + // + db->update (ro_r1); + db->update (static_cast (ro_d1)); + db->update (ro_b1); + + transaction t (db->begin ()); + db->update (static_cast (rw_b1)); + db->update (rw_r); + db->update (static_cast (rw_d1)); + t.commit (); + } + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p_ro_r (db->load (ro_r.id)); + auto_ptr p_rw_b (db->load (rw_b.id)); + auto_ptr p_ro_d (db->load (ro_d.id)); + + auto_ptr p_rw_r (db->load (rw_r.id)); + auto_ptr p_ro_b (db->load (ro_b.id)); + auto_ptr p_rw_d (db->load (rw_d.id)); + t.commit (); + + assert (*p_ro_r == ro_r); + assert (*p_rw_b == rw_b); + assert (*p_ro_d == ro_d); + + assert (*p_rw_r == rw_r); + assert (*p_ro_b == ro_b); + assert (*p_rw_d == rw_d); + } + } + + // Test 10: empty polymorphic classes. + // + { + using namespace test10; + + base b (1, 1); + derived d (2, 2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + d.num++; + + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } + + // Test 11: reuse and polymorphic inheritance. + // + { + using namespace test11; + + base b (1, 1, "b"); + derived d (2, 2, "d"); + + b.strs.push_back ("b"); + b.nums.push_back (1); + + d.strs.push_back ("d"); + d.nums.push_back (1); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + b.str += "b"; + b.strs.push_back ("bb"); + b.nums.push_back (2); + + d.num++; + d.str += "d"; + d.strs.push_back ("dd"); + d.nums.push_back (2); + d.dnum++; + d.dstr += "d"; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + { + base_result qr (db->query (base_query::num == 2)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i == e); + } + + { + derived_result qr (db->query (derived_query::num == 3)); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/polymorphism/makefile b/common/polymorphism/makefile new file mode 100644 index 0000000..9b4385e --- /dev/null +++ b/common/polymorphism/makefile @@ -0,0 +1,113 @@ +# file : common/polymorphism/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix poly_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx new file mode 100644 index 0000000..5e72b77 --- /dev/null +++ b/common/polymorphism/test.hxx @@ -0,0 +1,987 @@ +// file : common/polymorphism/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +#include +#include +#include + +// Test basic polymorphism functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // Views. + // + #pragma db view object(root) + struct root_view + { + //#pragma db column(root::typeid_) + std::string typeid_; // @@ tmp + + unsigned long num; + }; + + #pragma db view object(base = b) + struct base_view + { + unsigned long id; + unsigned long num; + std::string str; + }; + + #pragma db view object(derived) + struct derived_view + { + unsigned long num; + std::string str; + unsigned long dnum; + std::string dstr; + }; +} + +// Test inverse object pointers in polymorhic bases. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct root; + + #pragma db object + struct root_pointer + { + root_pointer (root* r = 0): p (r) {} + + #pragma db id auto + unsigned long id; + + root* p; + }; + + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(p) + odb::lazy_ptr rp; + }; + + struct base; + + #pragma db object + struct base_pointer + { + base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} + + #pragma db id auto + unsigned long id; + + std::vector vp; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, const std::string& s): root (i), str (s) {} + + std::string str; + + #pragma db inverse(vp) + odb::lazy_ptr bp; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, const std::string& s, unsigned long n) + : base (i, s), num (n) {} + + unsigned long num; + }; + + // Views. + // + #pragma db view object(root_pointer = rp) object(root) + struct root_view + { + #pragma db column(rp::id) + unsigned long rp_id; + + #pragma db column(root::id) + unsigned long r_id; + }; + + #pragma db view object(base_pointer) object(base = b) + struct base_view + { + #pragma db column(base_pointer::id) + unsigned long bp_id; + + #pragma db column(b::id) + unsigned long b_id; + + std::string str; + }; +} + +// Test delayed loading. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + virtual ~base () {delete rptr;} + base (): rptr (0) {} + base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} + + unsigned long num; + root* rptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return + root::compare (r, false) && + num == b.num && + ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); + } + }; + + #pragma db object + struct derived: base + { + virtual ~derived () {delete bptr;} + derived (): bptr (0) {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n), str (s), bptr (0) {} + + std::string str; + base* bptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return + base::compare (r, false) && + str == d.str && + ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); + } + }; + + // Views. + // + #pragma db view object(base) object(root = r) + struct base_view + { + #pragma db column(base::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + unsigned long num; + }; + + #pragma db view \ + object(derived = d) \ + object(base = b) \ + object(root = r: d::rptr) + struct derived_view + { + #pragma db column(d::id) + unsigned long d_id; + + #pragma db column(b::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::num) + unsigned long d_num; + + #pragma db column(b::num) + unsigned long b_num; + + std::string str; + }; + + // This is an example of a pathological case, where the right-hand-side + // of the join condition comes from one of the bases. As a result, we + // join the base table first, which means we will get both bases and + // derived objects instead of just derived. + // + //#pragma db view object(root = r) object(derived = d) + #pragma db view object(derived = d) object(root = r) + struct root_view + { + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::id) + unsigned long d_id; + + std::string str; + }; +} + +// Test views. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic + struct root1 + { + virtual ~root1 () {} + root1 () {} + root1 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + }; + + #pragma db object + struct base1: root1 + { + base1 () {} + base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} + + unsigned long num; + }; + + #pragma db object polymorphic + struct root2 + { + virtual ~root2 () {} + root2 () {} + root2 (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base2: root2 + { + base2 () {} + base2 (unsigned long i, unsigned long n, const std::string& s) + : root2 (i, n), str (s) {} + + std::string str; + }; + + // Test custom join condition. + // + #pragma db view object(base2) object(base1: base2::num == base1::num) + struct view1 + { + std::string str; + }; + + #pragma db view object(base2) + struct view2 + { + #pragma db column("min(" + base2::num + ")") + std::size_t min_num; + }; +} + +// Test polymorphism and optimistic concurrency. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + #pragma db version + unsigned long version; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && version == r.version && + num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +// Test polymorphism and callbacks. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object callback(db_callback) + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; + }; + + #pragma db object callback(db_callback) + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + std::auto_ptr ptr; + + void + db_callback (odb::callback_event, odb::database&) const; + }; +} + +// Test polymorphism and object cache (session). +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) +#pragma db namespace table("t7_") +namespace test7 +{ +#ifdef HAVE_CXX11 + using std::shared_ptr; +#else + using std::tr1::shared_ptr; +#endif + + #pragma db object polymorphic pointer(shared_ptr) + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + }; +} +#endif + +// Test polymorphism and abstract bases. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object abstract + struct interm: base + { + interm () {} + interm (unsigned long i, unsigned long n, const std::string& s, bool b) + : base (i, n, s), bln (b) {} + + bool bln; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (interm)) + return false; + + const interm& i (static_cast (r)); + return base::compare (r, false) && bln == i.bln; + } + }; + + #pragma db object + struct derived1: interm + { + derived1 () {} + derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dnum (n + 1) {} + + unsigned long dnum; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived1)) + return false; + + const derived1& d (static_cast (r)); + return interm::compare (r, false) && dnum == d.dnum; + } + }; + + #pragma db object + struct derived2: interm + { + derived2 () {} + derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dstr (s + 'd') {} + + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived2)) + return false; + + const derived2& d (static_cast (r)); + return interm::compare (r, false) && dstr == d.dstr; + } + }; +} + +// Test polymorphism and readonly classes. +// +#pragma db namespace table("t9_") +namespace test9 +{ + // + // ro_root, rw_base, ro_derived + // + #pragma db object polymorphic readonly + struct ro_root + { + virtual ~ro_root () {} + ro_root () {} + ro_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} + + #pragma db object + struct rw_base: ro_root + { + rw_base () {} + rw_base (unsigned long i, unsigned long n, const std::string& s) + : ro_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_base)) + return false; + + const rw_base& b (static_cast (r)); + return ro_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object readonly + struct ro_derived: rw_base + { + ro_derived () {} + ro_derived (unsigned long i, unsigned long n, const std::string& s) + : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_derived)) + return false; + + const ro_derived& d (static_cast (r)); + return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // + // rw_root, ro_base, rw_derived + // + #pragma db object polymorphic + struct rw_root + { + virtual ~rw_root () {} + rw_root () {} + rw_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} + + #pragma db object readonly + struct ro_base: rw_root + { + ro_base () {} + ro_base (unsigned long i, unsigned long n, const std::string& s) + : rw_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_base)) + return false; + + const ro_base& b (static_cast (r)); + return rw_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct rw_derived: ro_base + { + rw_derived () {} + rw_derived (unsigned long i, unsigned long n, const std::string& s) + : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_derived)) + return false; + + const rw_derived& d (static_cast (r)); + return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +// Test empty polymorphic classes. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n) : root (i), num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n): base (i, n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +// Test mixing reuse and polymorphic inheritance. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db object abstract + struct root + { + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + }; + + #pragma db object polymorphic + struct base: root + { + virtual ~base () {} + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (base)) + return false; + + return id == b.id && num == b.num && strs == b.strs && + str == b.str && nums == b.nums; + } + }; + + inline bool + operator== (const base& x, const base& y) {return x.compare (y);} + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (derived)) + return false; + + const derived& d (static_cast (b)); + return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST_HXX diff --git a/common/polymorphism/test.std b/common/polymorphism/test.std new file mode 100644 index 0000000..5c18191 --- /dev/null +++ b/common/polymorphism/test.std @@ -0,0 +1,36 @@ +base pre_persist 1 const +base post_persist 1 const +derived pre_persist 2 const +derived post_persist 2 const +base pre_load 0 +base post_load 1 +derived pre_load 0 const +derived post_load 2 const +base pre_load 1 +base post_load 1 +derived pre_load 2 const +derived post_load 2 const +base pre_load 1 +base post_load 1 +derived pre_load 2 const +derived post_load 2 const +base pre_update 1 const +base post_update 1 const +derived pre_update 2 const +derived post_update 2 const +base pre_load 0 +base post_load 1 +derived pre_load 0 const +derived post_load 2 const +base pre_erase 1 const +base post_erase 1 const +derived pre_erase 2 const +derived post_erase 2 const +derived pre_persist 3 const +derived post_persist 3 const +derived pre_persist 4 const +derived post_persist 4 const +derived pre_load 0 const +derived pre_load 0 const +derived post_load 4 const +derived post_load 3 const diff --git a/common/query/driver.cxx b/common/query/driver.cxx index c207955..cc92f41 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -421,7 +421,15 @@ main (int argc, char* argv[]) ++i; assert (i != r.end ()); - auto_ptr joe (db->load (3)); + { + auto_ptr joe (db->load (3)); + } + + { + person p (5, "Peter", "Peterson", 70, false, key3); + db->persist (p); + db->erase (p); + } // SQL Server does not support re-loading of an object with long data // from a query result. @@ -430,8 +438,10 @@ main (int argc, char* argv[]) assert (i->last_name_ == "Doe"); // Actual load. #endif + // Overwrite object image again. + // + auto_ptr joe (db->load (3)); person p; - joe.reset (db->load (3)); // Overwrite object image again. i.load (p); assert (p.last_name_ == "Doe"); diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index c543f7a..b39ab38 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -204,15 +204,20 @@ main (int argc, char* argv[]) // Readonly object. // { + typedef odb::object_traits so_traits; typedef odb::object_traits ro_traits; typedef odb::object_traits rw_traits; + assert (so_traits::column_count == + so_traits::id_column_count + so_traits::readonly_column_count); + assert (ro_traits::column_count == ro_traits::id_column_count + ro_traits::readonly_column_count); assert (rw_traits::column_count != rw_traits::id_column_count + rw_traits::readonly_column_count); + simple_object so (1, 1); ro_object ro_o (1, 1); rw_object rw_o (1, 1); @@ -224,6 +229,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + db->persist (so); db->persist (ro_o); db->persist (rw_o); t.commit (); @@ -234,6 +240,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + //db->update (so); // Compile error. //db->update (ro_o); // Compile error. db->update (rw_o); t.commit (); @@ -241,8 +248,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->load (1, ro_o); - db->load (1, rw_o); + db->load (1, so); + db->load (1, ro_o); + db->load (1, rw_o); t.commit (); } diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 04250fe..a29a2bd 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -132,6 +132,18 @@ struct container // Readonly object. // +#pragma db object readonly +struct simple_object +{ + simple_object (unsigned long i, unsigned long x): id (i), sv (x) {} + simple_object () {} + + #pragma db id + unsigned long id; + + unsigned long sv; +}; + #pragma db object struct object { diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 58bbef5..ed96223 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -39,8 +39,8 @@ main (int argc, char* argv[]) shared_ptr us (new country ("US", "United States")); shared_ptr se (new country ("SE", "Sweden")); - shared_ptr st (new employer ("Simple Tech, Inc")); - shared_ptr ct (new employer ("Complex Tech, Inc")); + shared_ptr st (new employer ("Simple Tech, Inc", ca)); + shared_ptr ct (new employer ("Complex Tech, Inc", us)); // person // diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx index c2e167c..671c849 100644 --- a/common/relationship-query/test.hxx +++ b/common/relationship-query/test.hxx @@ -111,8 +111,8 @@ struct employee: person #pragma db object pointer(shared_ptr) struct employer { - employer (const std::string& n) - : name (n) + employer (const std::string& n, shared_ptr nat) + : name (n), nationality (nat) { } @@ -122,6 +122,11 @@ struct employer #pragma db id std::string name; + + // The same member name and type as in person (test JOIN alias). + // + #pragma db not_null + shared_ptr nationality; }; #pragma db object pointer(shared_ptr) -- cgit v1.1 From 2cd5cd2f706d0e76784bc297a02f9d655843f699 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Apr 2012 17:12:48 +0200 Subject: Assign table prefix to namespace instead of to each class --- common/composite-id/test.hxx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index a5fb375..00ea972 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -72,6 +72,7 @@ operator< (const ncomp& x, const ncomp& y) // Test object with composite id, container. // +#pragma db namespace table("t1_") namespace test1 { #pragma db object @@ -97,6 +98,7 @@ namespace test1 // Test to-one and to-many relationships with composite id as well as // queries and views. // +#pragma db namespace table("t2_") namespace test2 { #pragma db object @@ -201,11 +203,12 @@ namespace test2 // Test one-to-one(i) relationship with composite id. // +#pragma db namespace table("t3_") namespace test3 { struct object2; - #pragma db object table("test3_object1") + #pragma db object struct object1 { object1 () {} @@ -218,7 +221,7 @@ namespace test3 object2* o2; }; - #pragma db object table("test3_object2") + #pragma db object struct object2 { object2 (): o1 (0) {} @@ -244,11 +247,12 @@ namespace test3 // Test many-to-one(i) relationship with composite id. // +#pragma db namespace table("t4_") namespace test4 { struct object2; - #pragma db object table("test4_object1") + #pragma db object struct object1 { object1 () {} @@ -261,7 +265,7 @@ namespace test4 object2* o2; }; - #pragma db object table("test4_object2") + #pragma db object struct object2 { object2 () {} @@ -293,11 +297,12 @@ namespace test4 // Test one-to-many(i) relationship with composite id. // +#pragma db namespace table("t5_") namespace test5 { struct object2; - #pragma db object table("test5_object1") + #pragma db object struct object1 { object1 () {} @@ -309,7 +314,7 @@ namespace test5 object2* o2; }; - #pragma db object table("test5_object2") + #pragma db object struct object2 { object2 () {} @@ -342,11 +347,12 @@ namespace test5 // Test many-to-many(i) relationship with composite id. // +#pragma db namespace table("t6_") namespace test6 { struct object2; - #pragma db object table("test6_object1") + #pragma db object struct object1 { object1 () {} @@ -358,7 +364,7 @@ namespace test6 std::vector o2; }; - #pragma db object table("test6_object2") + #pragma db object struct object2 { object2 () {} @@ -391,9 +397,10 @@ namespace test6 // Test object with composite id and version (optimistic concurrency). // +#pragma db namespace table("t7_") namespace test7 { - #pragma db object optimistic table("test7_object") + #pragma db object optimistic struct object { object () {} -- cgit v1.1 From a93ad74833e3a99a1421fd695a01a1fb15d1f2dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Apr 2012 09:04:35 +0200 Subject: Fix auto id handling in polymorphic objects --- common/polymorphism/driver.cxx | 32 ++++++++++++++++++++ common/polymorphism/test.hxx | 67 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx index efda095..0c9bf1e 100644 --- a/common/polymorphism/driver.cxx +++ b/common/polymorphism/driver.cxx @@ -1821,6 +1821,38 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test 12: polymorphic objects with auto id. + // + { + using namespace test12; + + base b (1); + derived d (2); + + unsigned long id1, id2; + + // Persist. + // + { + transaction t (db->begin ()); + id1 = db->persist (b); + id2 = db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (id1)); + auto_ptr pd (db->load (id2)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } } catch (const odb::exception& e) { diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx index 5e72b77..99711b5 100644 --- a/common/polymorphism/test.hxx +++ b/common/polymorphism/test.hxx @@ -887,7 +887,7 @@ namespace test10 struct base: root { base () {} - base (unsigned long i, unsigned long n) : root (i), num (n) {} + base (unsigned long i, unsigned long n): root (i), num (n) {} unsigned long num; @@ -984,4 +984,69 @@ namespace test11 }; } +// Test polymorphic classes with auto id. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + + #pragma db id auto + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long n): num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long n): base (n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + #endif // TEST_HXX -- cgit v1.1 From 61ff4c0458fa0362e054970efbcc21d66240ccc9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Apr 2012 11:29:05 +0200 Subject: Make session optional --- boost/common/smart-ptr/driver.cxx | 1 + boost/common/smart-ptr/makefile | 2 +- common/composite-id/driver.cxx | 2 +- common/composite-id/makefile | 2 +- common/composite-id/test.hxx | 4 ---- common/const-object/driver.cxx | 2 +- common/const-object/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/lazy-ptr/driver.cxx | 1 + common/lazy-ptr/makefile | 2 +- common/polymorphism/driver.cxx | 1 + common/polymorphism/test.hxx | 2 +- common/relationship-query/driver.cxx | 2 +- common/relationship-query/makefile | 2 +- common/session/driver.cxx | 1 + common/session/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 1 + qt/common/smart-ptr/makefile | 3 ++- 19 files changed, 19 insertions(+), 17 deletions(-) diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index cc6490d..906efa2 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 920d3b3..51ef93e 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -44,7 +44,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/smart-ptr --generate-schema \ +--profile boost/smart-ptr --generate-schema --generate-session \ --table-prefix boost_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx index 3ad71ac..2066335 100644 --- a/common/composite-id/driver.cxx +++ b/common/composite-id/driver.cxx @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include diff --git a/common/composite-id/makefile b/common/composite-id/makefile index a10dd57..3c91c2d 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_comp_id_ +--generate-query --generate-session --table-prefix t_comp_id_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index 00ea972..512c980 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -30,8 +30,6 @@ operator== (const scomp& x, const scomp& y) return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; } -//@@ tmp? -// inline bool operator< (const scomp& x, const scomp& y) { @@ -60,8 +58,6 @@ operator== (const ncomp& x, const ncomp& y) return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; } -//@@ tmp? -// inline bool operator< (const ncomp& x, const ncomp& y) { diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 03a6a68..1bf66d8 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 1b8e3c0..feb0040 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -8,7 +8,7 @@ #include #include -#pragma db object pointer (obj1*) +#pragma db object pointer (obj1*) session struct obj1 { obj1 () {} diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index cf66276..a88ceee 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -10,8 +10,8 @@ #include #include -#include #include +#include #include diff --git a/common/inverse/makefile b/common/inverse/makefile index 30bd265..8e3e912 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_inverse_ +--generate-query --generate-session --table-prefix t_inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 3be6517..ffe692c 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include #include // ODB_CXX11_* diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 77053e3..f0344c9 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix lazy_ptr_ +--generate-session --table-prefix lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx index 0c9bf1e..09e3321 100644 --- a/common/polymorphism/driver.cxx +++ b/common/polymorphism/driver.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx index 99711b5..d0a6ed5 100644 --- a/common/polymorphism/test.hxx +++ b/common/polymorphism/test.hxx @@ -552,7 +552,7 @@ namespace test7 using std::tr1::shared_ptr; #endif - #pragma db object polymorphic pointer(shared_ptr) + #pragma db object polymorphic pointer(shared_ptr) session struct root { virtual ~root () {} diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index ed96223..94a6141 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -9,8 +9,8 @@ #include #include -#include #include +#include #include #include // HAVE_CXX11, HAVE_TR1_MEMORY diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 619cf8b..87835ad 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix relationship_query_ +--generate-query --generate-session --table-prefix relationship_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/session/driver.cxx b/common/session/driver.cxx index d8467c2..232aee6 100644 --- a/common/session/driver.cxx +++ b/common/session/driver.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/common/session/makefile b/common/session/makefile index 4facdbb..e9edc87 100644 --- a/common/session/makefile +++ b/common/session/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix session_ +--generate-session --table-prefix session_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 4af2c05..28ad9a2 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 0a35eae..8f3e087 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -44,7 +44,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/smart-ptr --generate-schema --table-prefix qt_smart_ptr_ +--profile qt/smart-ptr --generate-schema --generate-session \ +--table-prefix qt_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) -- cgit v1.1 From d073555e513e671b197c5eb31c0b2b269f137d0f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Apr 2012 16:45:23 +0200 Subject: Add database::reset() --- common/transaction/driver.cxx | 10 ++++++++++ common/transaction/test.std | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx index a487a7d..64351c3 100644 --- a/common/transaction/driver.cxx +++ b/common/transaction/driver.cxx @@ -122,4 +122,14 @@ main (int argc, char* argv[]) odb_db::transaction& r (odb_db::transaction::current ()); assert (&t == &r); } + + // Transaction restart. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + t.commit (); + t.reset (db->begin ()); + t.commit (); + } } diff --git a/common/transaction/test.std b/common/transaction/test.std index 792010c..37d3598 100644 --- a/common/transaction/test.std +++ b/common/transaction/test.std @@ -19,3 +19,8 @@ rollback transaction test 006 begin transaction rollback transaction +test 007 +begin transaction +commit transaction +begin transaction +commit transaction -- cgit v1.1 From 6a3ddb6bd80f3c0c4d7b6957cb7be1f3d8713720 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Apr 2012 17:16:24 +0200 Subject: Add test for readonly object with auto id --- common/readonly/driver.cxx | 24 ++++++++++++++++++++++++ common/readonly/test.hxx | 16 +++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index b39ab38..b67ed4f 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -287,6 +287,30 @@ main (int argc, char* argv[]) assert (*o.pl == 2 && *o.cpl == 2 && *o.pcl == 2 && *o.cpcl == 1); } + + // Readonly object with auto id. + // + { + ro_auto o1 (1); + ro_auto o2 (2); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->num == o1.num); + assert (p2->num == o2.num); + } + } } catch (const odb::exception& e) { diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index a29a2bd..0b73d94 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -10,7 +10,7 @@ #include -// Simple readonly value. +// Simple readonly object. // #pragma db object struct simple @@ -209,4 +209,18 @@ struct wrapper const std::auto_ptr cpcl; }; +// Readonly object with auto id. +// +#pragma db object readonly +struct ro_auto +{ + ro_auto (unsigned long n): num (n) {} + ro_auto () {} + + #pragma db id auto + unsigned long id; + + unsigned long num; +}; + #endif // TEST_HXX -- cgit v1.1 From c8458a266eb258cf61b1e66066c72a2dc0f0ad8b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Apr 2012 11:36:43 +0200 Subject: Add support for NULL pointers to objects with composite object ids --- common/composite-id/driver.cxx | 71 ++++++++++++++++++++++++++++++++++++++++++ common/composite-id/test.hxx | 54 +++++++++++++++++++++++++++++++- 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx index 2066335..8a230eb 100644 --- a/common/composite-id/driver.cxx +++ b/common/composite-id/driver.cxx @@ -624,6 +624,77 @@ main (int argc, char* argv[]) } } + // Test 8. + // + { + using namespace test8; + + object2 o2a, o2b; + object3 o3; + + o2b.o1 = new object1 (scomp ("222", "aaa", "bbb"), 123); + o3.o1.push_back (0); + o3.o1.push_back (new object1 (scomp ("333", "aaa", "bbb"), 234)); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2a); + db->persist (o2b); + db->persist (o2b.o1); + db->persist (o3); + db->persist (o3.o1[1]); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p2a (db->load (o2a.id)); + auto_ptr p2b (db->load (o2b.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 == 0); + assert (p2b->o1 != 0 && *p2b->o1 == *o2b.o1); + assert (p3->o1[0] == 0); + assert (p3->o1[1] != 0 && *p3->o1[1] == *o3.o1[1]); + } + + // Update. + // + { + object1* o1 (o3.o1[1]); + + o3.o1.clear (); + o3.o1.push_back (o2b.o1); + o3.o1.push_back (0); + + o2a.o1 = o1; + o2b.o1 = 0; + + transaction t (db->begin ()); + db->update (o2a); + db->update (o2b); + db->update (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2a (db->load (o2a.id)); + auto_ptr p2b (db->load (o2b.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); + assert (p2b->o1 == 0); + assert (p3->o1[0] != 0 && *p3->o1[0] == *o3.o1[0]); + assert (p3->o1[1] == 0); + } + } } catch (const odb::exception& e) { diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index 512c980..9c2b2b3 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -414,8 +414,60 @@ namespace test7 inline bool operator== (const object& x, const object& y) { - return x.id == y.id && x.ver == y.ver && x.num == y.num ; + return x.id == y.id && x.ver == y.ver && x.num == y.num; } } +// Test composite NULL pointers. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (scomp const& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + }; + + inline bool + operator== (const object1& x, const object1& y) + { + return x.id == y.id && x.num == y.num; + } + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id auto + unsigned long id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id auto + unsigned long id; + + std::vector o1; + }; +} + #endif // TEST_HXX -- cgit v1.1 From edfd1193d15696c7a2e54573776b9121d6167e83 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Apr 2012 13:32:46 +0200 Subject: Support for NULL value semantics for composite values --- common/wrapper/driver.cxx | 74 +++++++++++++++++++++++++++++++++++++++++++++++ common/wrapper/test.hxx | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 4f78a1b..d8985fa 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -128,6 +128,80 @@ main (int argc, char* argv[]) assert (o->c == co.c); } } + + // Test 5: composite NULL values. + // + { + using namespace test5; + + using test5::object; //@@ tmp + + object o1, o2; + + o1.v.push_back (nullable ()); + + o2.p.reset (new comp (1, "a")); + o2.n = comp (2, "b"); + o2.v.push_back (comp (3, "c")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->p.get () == 0); + assert (!p1->n); + assert (!p1->v[0]); + + assert (p2->p.get () != 0 && *p2->p == *o2.p); + assert (p2->n && *p2->n == *o2.n); + assert (p2->v[0] && *p2->v[0] == *o2.v[0]); + } + + // Update. + // + { + o1.p.reset (new comp (1, "a")); + o1.n = comp (2, "b"); + o1.v[0] = comp (3, "c"); + + o2.p.reset (); + o2.n.reset (); + o2.v[0].reset (); + + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->p.get () != 0 && *p1->p == *o1.p); + assert (p1->n && *p1->n == *o1.n); + assert (p1->v[0] && *p1->v[0] == *o1.v[0]); + + assert (p2->p.get () == 0); + assert (!p2->n); + assert (!p2->v[0]); + } + } } catch (const odb::exception& e) { diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index ccf32b3..399073d 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -176,4 +176,58 @@ struct cont_object cont_comp c; // Wrapped container in comp value. }; +// Test composite NULL values. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db value + struct base + { + base () {} + base (int n): num (n) {} + + int num; + }; + + inline bool + operator== (const base& x, const base& y) + { + return x.num == y.num; + } + + #pragma db value + struct comp: base + { + comp () {} + comp (int n, const std::string s): base (n), str (s), extra (n + 1) {} + + std::string str; + base extra; + + odb::nullable always_null; + }; + + inline bool + operator== (const comp& x, const comp& y) + { + return static_cast (x) == y && + x.str == y.str && x.extra == y.extra; + } + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + #pragma db null + std::auto_ptr p; + + odb::nullable n; + + std::vector< odb::nullable > v; + }; +} + #endif // TEST_HXX -- cgit v1.1 From 0112b488de8316edc37b72c86dfc411816b029f2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Apr 2012 16:14:54 +0200 Subject: Bump version to 2.0.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 8a776ac..227cea2 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.9.0.a1 +2.0.0 -- cgit v1.1 From 00f25fc7183f5508f0cc6f8798e634c76434ce0e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Apr 2012 21:03:42 +0200 Subject: Make sure TR1 test comes after libodb in configure.ac TR1 test uses a header from libodb. --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 109b4cc..d42da63 100644 --- a/configure.ac +++ b/configure.ac @@ -37,10 +37,6 @@ AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) # CXX11([HAVE_CXX11], [Compiling in the C++11 mode.]) -# Check for TR1 availability. -# -TR1_MEMORY - # Check for the ODB compiler. # ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) @@ -49,6 +45,10 @@ ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB # LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) +# Check for TR1 availability (has to be after libodb). +# +TR1_MEMORY + # Check for boost. # odb_tests_boost=yes -- cgit v1.1 From da13cf5463a3d047c8b52c5b95b00b203e56eb2d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 29 Apr 2012 21:12:26 +0200 Subject: Factor TR1/C++11 shared_ptr test into separate object The current approach causes problems with foreign key constraints during table dropping. --- common/wrapper/driver.cxx | 64 ++++++++++++++++++++++++++--------------------- common/wrapper/test.hxx | 59 +++++++++++++++++++++++++------------------ 2 files changed, 70 insertions(+), 53 deletions(-) diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index d8985fa..b434dba 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -27,45 +27,55 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + // Test 1: simple values. // - // Simple values. - // - unsigned long id; { - object o; - o.num.reset (new int (123)); - o.nstrs.push_back (nullable_string ()); - o.nstrs.push_back (nullable_string ("123")); + using namespace test1; + + unsigned long id1, id2; + { + object1 o1; + object2 o2; + + o1.num.reset (new int (123)); + o1.nstrs.push_back (nullable_string ()); + o1.nstrs.push_back (nullable_string ("123")); + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - o.sstrs.push_back (str_sptr ()); - o.sstrs.push_back (str_sptr (new string ("123"))); + o2.sstrs.push_back (str_sptr ()); + o2.sstrs.push_back (str_sptr (new string ("123"))); #endif - transaction t (db->begin ()); - id = db->persist (o); - t.commit (); - } + transaction t (db->begin ()); + id1 = db->persist (o1); + id2 = db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (id1)); + auto_ptr o2 (db->load (id2)); + t.commit (); + + assert (*o1->num == 123); + assert (o1->str.get () == 0); + assert (o1->nstr.null ()); + assert (o1->nstrs[0].null ()); + assert (o1->nstrs[1].get () == "123"); - { - transaction t (db->begin ()); - auto_ptr o (db->load (id)); - t.commit (); - - assert (*o->num == 123); - assert (o->str.get () == 0); - assert (o->nstr.null ()); - assert (o->nstrs[0].null ()); - assert (o->nstrs[1].get () == "123"); #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - assert (!o->sstr); - assert (!o->sstrs[0]); - assert (*o->sstrs[1] == "123"); + assert (!o2->sstr); + assert (!o2->sstrs[0]); + assert (*o2->sstrs[1] == "123"); #endif + } } // // Composite values. // + unsigned long id; { comp_object co; @@ -134,8 +144,6 @@ main (int argc, char* argv[]) { using namespace test5; - using test5::object; //@@ tmp - object o1, o2; o1.v.push_back (nullable ()); diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 399073d..f308409 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -20,46 +20,55 @@ using odb::nullable; +// Test 1: simple values. // -// Simple values. -// - -typedef nullable nullable_string; +#pragma db namespace table("t1_") +namespace test1 +{ + typedef nullable nullable_string; #ifdef HAVE_CXX11 -typedef std::unique_ptr num_uptr; -typedef std::unique_ptr str_uptr; -typedef std::shared_ptr str_sptr; + typedef std::unique_ptr num_uptr; + typedef std::unique_ptr str_uptr; + typedef std::shared_ptr str_sptr; #else -typedef std::auto_ptr num_uptr; -typedef std::auto_ptr str_uptr; + typedef std::auto_ptr num_uptr; + typedef std::auto_ptr str_uptr; # ifdef HAVE_TR1_MEMORY -typedef std::tr1::shared_ptr str_sptr; + typedef std::tr1::shared_ptr str_sptr; # endif #endif -#pragma db object table("obj") -struct object -{ - #pragma db id auto - unsigned long id_; + #pragma db object table("obj1") + struct object1 + { + #pragma db id auto + unsigned long id_; + + num_uptr num; - num_uptr num; + #pragma db null + str_uptr str; - #pragma db null - str_uptr str; + nullable_string nstr; + std::vector nstrs; + }; - nullable_string nstr; - std::vector nstrs; + #pragma db object + struct object2 + { + #pragma db id auto + unsigned long id_; #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - #pragma db null - str_sptr sstr; + #pragma db null + str_sptr sstr; - #pragma db value_null - std::vector sstrs; + #pragma db value_null + std::vector sstrs; #endif -}; + }; +} // // Composite values. -- cgit v1.1 From 40e8a72ebd1a8bb475b3bb25f23d8c205dadeb06 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 May 2012 12:40:28 +0200 Subject: Add -D_REENTRANT when building on Linux to emulate -pthread --- m4/acx-pthread.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 index ffa3dfa..204b32d 100644 --- a/m4/acx-pthread.m4 +++ b/m4/acx-pthread.m4 @@ -220,7 +220,9 @@ dnl fi flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + # CS: Add _REENTRANT in Linux to emulate -pthread. + # + *-linux* | *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then -- cgit v1.1 From 5e98aad4b067ece803b75cae7f538565da8661c8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jun 2012 14:55:47 +0200 Subject: Add support for mapping posix_time::ptime and QDateTime to DATE Oracle type --- boost/oracle/date-time/driver.cxx | 4 ++++ boost/oracle/date-time/test.hxx | 3 +++ qt/oracle/date-time/driver.cxx | 1 + qt/oracle/date-time/test.hxx | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index ca59757..a1a12fb 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -53,6 +53,10 @@ main (int argc, char* argv[]) o.times.push_back (min_date_time); o.times.push_back (ptime (max_date_time)); + o.times_d.push_back (ptime (date (2012, 6, 27), + time_duration (14, 17, 05, 0))); + o.times_d.push_back (not_a_date_time); + o.durations.push_back (time_duration (1, 2, 3, 123456)); o.durations.push_back (time_duration (-1, 2, 3)); o.durations.push_back (not_a_date_time); diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 9699c5d..e7afe8f 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -26,6 +26,7 @@ struct object id == x.id && dates == x.dates && times == x.times && + times_d == x.times_d && durations == x.durations; } @@ -34,6 +35,8 @@ struct object std::vector dates; std::vector times; + #pragma db value_type("DATE") + std::vector times_d; std::vector durations; }; diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 5b3b51a..20fe9db 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -56,6 +56,7 @@ main (int argc, char* argv[]) o.date = t.date (); o.date_time = t; + o.date_time_d = QDateTime (QDate (2012, 6, 27), QTime (14, 17, 05, 0)); o.time = t.time (); { diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 2eb8735..45ccfd9 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -19,6 +19,7 @@ struct object id == x.id && date == x.date && date_time == x.date_time && + date_time_d == x.date_time_d && time == x.time; } @@ -28,6 +29,7 @@ struct object return date.isNull () && date_time.isNull () && + date_time_d.isNull () && time.isNull (); } @@ -36,6 +38,8 @@ struct object QDate date; QDateTime date_time; + #pragma db type("DATE") + QDateTime date_time_d; QTime time; }; -- cgit v1.1 From 66732b210c512b8dfe7e97d3ab6522cf3be72a72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2012 14:40:13 +0200 Subject: Add support for multiple database schema files Files are executed in alphabetic order. --- build/bootstrap.make | 5 ++++- tester.bat | 11 +++++++---- tester.in | 14 +++++++++----- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index 531d4f4..aba7532 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -47,8 +47,11 @@ endif # Database schema creation. # ifeq ($(filter $(db_id),sqlite),) +$(out_base)/.test: schema-extra = \ +$(call message,sql $$1,$(dcf_root)/db-driver $$1,$(src_base)/$1)$(literal_newline)$(literal_tab) $(out_base)/.test: schema = \ -$(call message,sql $$1,$(dcf_root)/db-driver $$1,$(out_base)/test.sql) +$(foreach s,$1,$(call schema-extra,$s))$(call \ +message,sql $$1,$(dcf_root)/db-driver $$1,$(out_base)/test.sql) endif # Dist setup. diff --git a/tester.bat b/tester.bat index f5b00f5..fdd408c 100644 --- a/tester.bat +++ b/tester.bat @@ -24,9 +24,13 @@ if "_%3_" == "_Win32_" ( set "dir=%3\%2" ) -if exist test.sql ( - call %topdir%\%1-driver.bat test.sql - if errorlevel 1 goto error +rem Globbing returns files in alphabetic order. +rem +if exist *.sql ( + for %%f in (*.sql) do ( + call %topdir%\%1-driver.bat %%f + if errorlevel 1 goto error + ) ) if exist test.std ( @@ -56,4 +60,3 @@ exit /b 1 :end endlocal - diff --git a/tester.in b/tester.in index c55c59a..84b77ad 100755 --- a/tester.in +++ b/tester.in @@ -9,13 +9,17 @@ # data files, if any, are in $srcdir. # -if test -f test.sql; then - $top_builddir/db-driver test.sql +# Globbing returns files in alphabetic order. +# +for f in `echo *.sql`; do + if test -f $f; then + $top_builddir/db-driver $f - if test $? -ne 0; then - exit 1 + if test $? -ne 0; then + exit 1 + fi fi -fi +done echo ./driver --options-file "$top_builddir/db.options" -- cgit v1.1 From 7ba8d1469e331f07040352c069cf7b9d24ac57a3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2012 15:09:14 +0200 Subject: Remove unneeded third argument to create_database() --- mssql/native/driver.cxx | 2 +- mssql/types/driver.cxx | 2 +- mysql/native/driver.cxx | 2 +- oracle/native/driver.cxx | 2 +- oracle/types/driver.cxx | 2 +- pgsql/native/driver.cxx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 562583c..097a72d 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); // Create the database schema. // diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index fd183ea..2d32429 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -25,7 +25,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); { object o (1); diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 4ffe447..a8d2f5f 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); // Create the database schema. // diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 33d18e0..0e90ff0 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); // Create the database schema. // diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index d34a882..b1ca3ad 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -28,7 +28,7 @@ main (int argc, char* argv[]) // Create an Oracle database instance, setting both the client database // and national character set to UTF-8. // - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); object o (1); diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 10bf92d..94bda60 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -21,7 +21,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db (create_database (argc, argv)); // Create the database schema. // -- cgit v1.1 From 6b8def06796d1e4fc9e6e7e75ce59bccf6899261 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2012 15:17:16 +0200 Subject: Add support for custom database type mapping New pragma qualifier, map, and specifiers: as, to, from. New tests: /custom. --- mssql/custom/driver.cxx | 124 ++++++++++++++++++++++++++++++++ mssql/custom/makefile | 112 +++++++++++++++++++++++++++++ mssql/custom/query.hxx | 184 +++++++++++++++++++++++++++++++++++++++++++++++ mssql/custom/test.hxx | 78 ++++++++++++++++++++ mssql/custom/test.std | 0 mssql/custom/traits.hxx | 90 +++++++++++++++++++++++ mssql/makefile | 1 + mysql/custom/driver.cxx | 112 +++++++++++++++++++++++++++++ mysql/custom/makefile | 112 +++++++++++++++++++++++++++++ mysql/custom/query.hxx | 161 +++++++++++++++++++++++++++++++++++++++++ mysql/custom/test.hxx | 55 ++++++++++++++ mysql/custom/test.std | 0 mysql/custom/traits.hxx | 89 +++++++++++++++++++++++ mysql/makefile | 1 + oracle/custom/custom.sql | 61 ++++++++++++++++ oracle/custom/driver.cxx | 77 ++++++++++++++++++++ oracle/custom/makefile | 112 +++++++++++++++++++++++++++++ oracle/custom/test.hxx | 41 +++++++++++ oracle/custom/test.std | 0 oracle/custom/traits.hxx | 77 ++++++++++++++++++++ oracle/makefile | 1 + pgsql/custom/driver.cxx | 123 +++++++++++++++++++++++++++++++ pgsql/custom/makefile | 112 +++++++++++++++++++++++++++++ pgsql/custom/query.hxx | 159 ++++++++++++++++++++++++++++++++++++++++ pgsql/custom/test.hxx | 87 ++++++++++++++++++++++ pgsql/custom/test.std | 0 pgsql/custom/traits.hxx | 167 ++++++++++++++++++++++++++++++++++++++++++ pgsql/makefile | 1 + sqlite/custom/driver.cxx | 76 ++++++++++++++++++++ sqlite/custom/makefile | 110 ++++++++++++++++++++++++++++ sqlite/custom/test.hxx | 40 +++++++++++ sqlite/custom/test.std | 0 sqlite/makefile | 1 + 33 files changed, 2364 insertions(+) create mode 100644 mssql/custom/driver.cxx create mode 100644 mssql/custom/makefile create mode 100644 mssql/custom/query.hxx create mode 100644 mssql/custom/test.hxx create mode 100644 mssql/custom/test.std create mode 100644 mssql/custom/traits.hxx create mode 100644 mysql/custom/driver.cxx create mode 100644 mysql/custom/makefile create mode 100644 mysql/custom/query.hxx create mode 100644 mysql/custom/test.hxx create mode 100644 mysql/custom/test.std create mode 100644 mysql/custom/traits.hxx create mode 100644 oracle/custom/custom.sql create mode 100644 oracle/custom/driver.cxx create mode 100644 oracle/custom/makefile create mode 100644 oracle/custom/test.hxx create mode 100644 oracle/custom/test.std create mode 100644 oracle/custom/traits.hxx create mode 100644 pgsql/custom/driver.cxx create mode 100644 pgsql/custom/makefile create mode 100644 pgsql/custom/query.hxx create mode 100644 pgsql/custom/test.hxx create mode 100644 pgsql/custom/test.std create mode 100644 pgsql/custom/traits.hxx create mode 100644 sqlite/custom/driver.cxx create mode 100644 sqlite/custom/makefile create mode 100644 sqlite/custom/test.hxx create mode 100644 sqlite/custom/test.std diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx new file mode 100644 index 0000000..7b0891d --- /dev/null +++ b/mssql/custom/driver.cxx @@ -0,0 +1,124 @@ +// file : mssql/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in SQL Server. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. +#endif + + o.xml = "AAABBBCCC"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query ( + query::p + ".STEquals(" + query::_val (o.p) + ") = 1")); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } +#endif + + t.commit (); + } + + // Update. + // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; +#endif + + o.xml = "BBBCCCDDD"; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/custom/makefile b/mssql/custom/makefile new file mode 100644 index 0000000..27f7823 --- /dev/null +++ b/mssql/custom/makefile @@ -0,0 +1,112 @@ +# file : mssql/custom/makefile +# copyright : Copyright (c) 2009-2012 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 mssql --generate-schema \ +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--hxx-prologue '\#include "query.hxx"' --table-prefix mssql_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx query.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx new file mode 100644 index 0000000..21dee89 --- /dev/null +++ b/mssql/custom/query.hxx @@ -0,0 +1,184 @@ +// file : mssql/custom/query.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mssql + { +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + unsigned short prec_; + unsigned short scale_; + + std::string x_column_; + std::string y_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query + is_null () const + { + query q (table_, column_); + q += "IS NULL"; + return q; + } + + query + is_not_null () const + { + query q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query + equal (val_bind v) const + { + query q (table_, column_); + q += ".STEquals("; + q.append (v, conversion_); + q += ") = 1"; + return q; + } + + query + equal (ref_bind r) const + { + query q (table_, column_); + q += ".STEquals("; + q.append (r, conversion_); + q += ") = 1"; + return q; + } + + friend query + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query + operator== (const query_column& c) const + { + query q (table_, column_); + q += ".STEquals("; + q.append (c.table (), c.column ()); + q += ") = 1"; + return q; + } + + public: + query_column (const char* table, + const char* column, + const char* conv, + unsigned short prec = 0, + unsigned short scale = 0xFFFF) + : table_ (table), column_ (column), conversion_ (conv), + prec_ (prec), scale_ (scale), + x_column_ (std::string (column) + ".STX"), + y_column_ (std::string (column) + ".STY"), + x (table, x_column_.c_str (), 0), + y (table, y_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + + unsigned short + prec () const + { + return prec_; + } + + unsigned short + scale () const + { + return scale_; + } + }; +#endif // SQL Server > 2005 + } +} + +#endif // QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx new file mode 100644 index 0000000..5548baa --- /dev/null +++ b/mssql/custom/test.hxx @@ -0,0 +1,78 @@ +// file : mssql/types/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 +// Map GEOMETRY SQL Server type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// Note that GEOMETRY is not available in SQL Server 2005. +// +#pragma db map type("GEOMETRY") \ + as("VARCHAR(256)") \ + to("GEOMETRY::STGeomFromText((?), 0)") \ + from("(?).STAsText()") + +#pragma db value type("GEOMETRY") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} +#endif // SQL Server > 2005 + +// Map XML SQL Server type to std::string (or any other type that provides +// the value_traits specialization). Note also that +// another alternative would be to interface with the XML data type using +// VARBINARY or NVARCHAR. Here we use implicit string to/from XML conversion, +// however, CAST/CONVERT can be used instead for greater control over +// whitespace handling, etc. +// +#pragma db map type("XML *(\\(.+\\))?") as("VARCHAR(max)") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + point p; + std::vector pv; +#endif + + #pragma db type("XML") + std::string xml; + + bool + operator== (const object& y) const + { + return id == y.id +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && p == y.p + && pv == y.pv +#endif + && xml == y.xml; + } +}; + +#endif // TEST_HXX diff --git a/mssql/custom/test.std b/mssql/custom/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx new file mode 100644 index 0000000..34081ed --- /dev/null +++ b/mssql/custom/traits.hxx @@ -0,0 +1,90 @@ +// file : mssql/types/traits.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include // std::memcpy +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mssql + { +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + + typedef char* image_type; + + static void + set_value (point& v, + const char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "POINT (x y)". + // + std::istringstream is (std::string (b + 7, n - 7)); + + is >> v.x; + is >> v.y; + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << "POINT (" << v.x << ' ' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + assert (n <= c); + std::memcpy (b, s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "GEOMETRY::STGeomFromText((?), 0)";} + }; + }; +#endif // SQL Server > 2005 + } +} + +#endif // TRAITS_HXX diff --git a/mssql/makefile b/mssql/makefile index de9390a..2c62cc6 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +custom \ native \ query \ types diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx new file mode 100644 index 0000000..b591095 --- /dev/null +++ b/mysql/custom/driver.cxx @@ -0,0 +1,112 @@ +// file : mysql/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in MySQL. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query (query::p + "=" + query::_val (o.p))); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } + + t.commit (); + } + + // Update. + // + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/custom/makefile b/mysql/custom/makefile new file mode 100644 index 0000000..4edfd2d --- /dev/null +++ b/mysql/custom/makefile @@ -0,0 +1,112 @@ +# file : mysql/custom/makefile +# copyright : Copyright (c) 2009-2012 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 mysql --generate-schema \ +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--hxx-prologue '\#include "query.hxx"' --table-prefix mysql_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx query.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx new file mode 100644 index 0000000..110624a --- /dev/null +++ b/mysql/custom/query.hxx @@ -0,0 +1,161 @@ +// file : mysql/custom/query.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mysql + { + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + std::string x_table_; + std::string y_table_; + std::string s_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query + is_null () const + { + query q (table_, column_); + q += "IS NULL"; + return q; + } + + query + is_not_null () const + { + query q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query + equal (val_bind v) const + { + query q (table_, column_); + q += "="; + q.append (v, conversion_); + return q; + } + + query + equal (ref_bind r) const + { + query q (table_, column_); + q += "="; + q.append (r, conversion_); + return q; + } + + friend query + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query + operator== (const query_column& c) const + { + query q (table_, column_); + q += "="; + q.append (c.table (), c.column ()); + return q; + } + + public: + query_column (const char* table, const char* column, const char* conv) + : table_ (table), column_ (column), conversion_ (conv), + x_table_ ("X(" + std::string (table)), // @@ Not very clean. + y_table_ ("Y(" + std::string (table)), + s_column_ (std::string (column) + ")"), // X & Y column suffix. + x (x_table_.c_str (), s_column_.c_str (), 0), + y (y_table_.c_str (), s_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + }; + } +} + +#endif // QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx new file mode 100644 index 0000000..5d739a1 --- /dev/null +++ b/mysql/custom/test.hxx @@ -0,0 +1,55 @@ +// file : mysql/custom/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Map GEOMETRY MySQL type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// +#pragma db map type("GEOMETRY") \ + as("VARCHAR(256)") \ + to("GeomFromText((?))") \ + from("AsText((?))") + +#pragma db value type("GEOMETRY") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + point p; + std::vector pv; + + bool + operator== (const object& y) const + { + return id == y.id && p == y.p && pv == y.pv; + } +}; + +#endif // TEST_HXX diff --git a/mysql/custom/test.std b/mysql/custom/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx new file mode 100644 index 0000000..bf4ceb4 --- /dev/null +++ b/mysql/custom/traits.hxx @@ -0,0 +1,89 @@ +// file : mysql/types/traits.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include // std::memcpy + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mysql + { + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + + typedef char* image_type; + + static void + set_value (point& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "POINT(x y)". + // + std::istringstream is (std::string (b.data () + 6, n - 6)); + + is >> v.x; + is >> v.y; + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << "POINT(" << v.x << ' ' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "GeomFromText((?))";} + }; + }; + } +} + +#endif // TRAITS_HXX diff --git a/mysql/makefile b/mysql/makefile index 1872888..b3fc74f 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +custom \ native \ truncation \ types diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql new file mode 100644 index 0000000..3200e74 --- /dev/null +++ b/oracle/custom/custom.sql @@ -0,0 +1,61 @@ +/* This file contains custom type definitions and helper functions. + */ + +SET FEEDBACK OFF; +WHENEVER SQLERROR EXIT FAILURE; +WHENEVER OSERROR EXIT FAILURE; + +-- @@ Temporary workaround: we cannot replace a type if there are +-- tables that use it. So need to drop the tables first, then +-- create/replace the type, and then create the tables. +-- +--CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10); + +BEGIN + BEGIN + EXECUTE IMMEDIATE 'CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10)'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -955 THEN RAISE; END IF; + END; +END; +/ + +CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers +IS + ret Numbers := Numbers(); + s_pos NUMBER := 1; + e_pos NUMBER := 0; +BEGIN + IF in_str IS NOT NULL THEN + LOOP + e_pos := INSTR(in_str, ',', s_pos); + EXIT WHEN e_pos = 0; + ret.extend; + ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos, e_pos - s_pos) AS NUMBER); + s_pos := e_pos + 1; + END LOOP; + ret.extend; + ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos) AS NUMBER); + END IF; + RETURN ret; +END; +/ + +CREATE OR REPLACE FUNCTION numbers_to_string(in_nums IN Numbers) RETURN VARCHAR2 +IS + ret VARCHAR2(1500); +BEGIN + IF in_nums.COUNT != 0 THEN + FOR i IN in_nums.FIRST .. in_nums.LAST LOOP + IF i != in_nums.FIRST THEN + ret := ret || ','; + END IF; + ret := ret || in_nums(i); + END LOOP; + END IF; + RETURN ret; +END; +/ + +EXIT; diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx new file mode 100644 index 0000000..2425b29 --- /dev/null +++ b/oracle/custom/driver.cxx @@ -0,0 +1,77 @@ +// file : oracle/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in Oracle. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.iv.push_back (123); + o.iv.push_back (234); + o.iv.push_back (-345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Update. + // + o.iv[0]++; + o.iv.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/oracle/custom/makefile b/oracle/custom/makefile new file mode 100644 index 0000000..97cdb2c --- /dev/null +++ b/oracle/custom/makefile @@ -0,0 +1,112 @@ +# file : oracle/custom/makefile +# copyright : Copyright (c) 2009-2012 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 oracle --generate-schema \ +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--table-prefix oracle_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx custom.sql +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema, custom.sql) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx new file mode 100644 index 0000000..cc46512 --- /dev/null +++ b/oracle/custom/test.hxx @@ -0,0 +1,41 @@ +// file : oracle/custom/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Map Numbers VARRAY Oracle type to std::vector. This type is defined +// in the custom.sql file along with two helper functions that convert +// between Numbers and its string representation. The other half of this +// mapping is in traits.hxx (value_traits, id_string>). +// +#pragma db map type("Numbers") \ + as("VARCHAR2(1500)") \ + to("CAST(string_to_numbers((?)) AS Numbers)") \ + from("numbers_to_string((?))") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + #pragma db type("Numbers") + std::vector iv; + + bool + operator== (const object& y) const + { + return id == y.id && iv == y.iv; + } +}; + +#endif // TEST_HXX diff --git a/oracle/custom/test.std b/oracle/custom/test.std new file mode 100644 index 0000000..e69de29 diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx new file mode 100644 index 0000000..8f3e81e --- /dev/null +++ b/oracle/custom/traits.hxx @@ -0,0 +1,77 @@ +// file : oracle/types/traits.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include +#include +#include // std::memcpy +#include // std::memcpy + +#include + +namespace odb +{ + namespace oracle + { + + template <> + class value_traits, id_string> + { + public: + typedef std::vector value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const char* b, + std::size_t n, + bool is_null) + { + v.clear (); + + if (!is_null) + { + // Array format is "n1,n2,n3...". + // + std::istringstream is (std::string (b, n)); + + for (char c; !is.eof (); is >> c) + { + v.push_back (int ()); + is >> v.back (); + } + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + std::ostringstream os; + + for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) + { + os << *i; + + if (++i != e) + os << ','; + } + + const std::string& s (os.str ()); + n = s.size (); + assert (n <= c); + std::memcpy (b, s.c_str (), n); + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/oracle/makefile b/oracle/makefile index 5f29177..0ed2e3c 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +custom \ native \ types diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx new file mode 100644 index 0000000..f1f70f8 --- /dev/null +++ b/pgsql/custom/driver.cxx @@ -0,0 +1,123 @@ +// file : pgsql/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in PostgreSQL. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. + + o.n1 = "23.5154"; + o.n2 = "235154"; + o.n3 = "2222222222222222222222222222.111111111111111111111111111111"; + + o.iv.push_back (123); + o.iv.push_back (234); + o.iv.push_back (-345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query (query::p + "~=" + query::_val (o.p))); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } + + t.commit (); + } + + // Update. + // + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; + o.n3 += "999"; + o.iv[0]++; + o.iv.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile new file mode 100644 index 0000000..30ce36d --- /dev/null +++ b/pgsql/custom/makefile @@ -0,0 +1,112 @@ +# file : pgsql/custom/makefile +# copyright : Copyright (c) 2009-2012 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 pgsql --generate-schema \ +--generate-query --hxx-prologue '\#include "traits.hxx"' \ +--hxx-prologue '\#include "query.hxx"' --table-prefix pgsql_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := traits.hxx query.hxx +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx new file mode 100644 index 0000000..4b29b45 --- /dev/null +++ b/pgsql/custom/query.hxx @@ -0,0 +1,159 @@ +// file : pgsql/custom/query.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace pgsql + { + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + std::string x_column_; + std::string y_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query + is_null () const + { + query q (table_, column_); + q += "IS NULL"; + return q; + } + + query + is_not_null () const + { + query q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query + equal (val_bind v) const + { + query q (table_, column_); + q += "~="; + q.append (v, conversion_); + return q; + } + + query + equal (ref_bind r) const + { + query q (table_, column_); + q += "~="; + q.append (r, conversion_); + return q; + } + + friend query + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query + operator== (const query_column& c) const + { + query q (table_, column_); + q += "~="; + q.append (c.table (), c.column ()); + return q; + } + + public: + query_column (const char* table, const char* column, const char* conv) + : table_ (table), column_ (column), conversion_ (conv), + x_column_ (std::string (column) + "[0]"), + y_column_ (std::string (column) + "[1]"), + x (table, x_column_.c_str (), 0), + y (table, y_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + }; + } +} + +#endif // QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx new file mode 100644 index 0000000..1f83031 --- /dev/null +++ b/pgsql/custom/test.hxx @@ -0,0 +1,87 @@ +// file : pgsql/custom/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Map POINT PostgreSQL type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// +#pragma db map type("POINT") as("TEXT") to("(?)::POINT") from("(?)::TEXT") + +#pragma db value type("POINT") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} + +// Map NUMERIC PostgreSQL type to std::string (or any other type that +// provides the value_traits specialization). +// +#pragma db map type("NUMERIC *(\\(.+\\))?") \ + as("TEXT") \ + to("(?)::NUMERIC$1") \ + from("(?)::TEXT") + +// Map INTEGER[] PostgreSQL type to std::vector. The other half of +// this mapping is in traits.hxx (value_traits, id_string>). +// +#pragma db map type("INTEGER *\\[(\\d+)\\]") \ + as("TEXT") \ + to("(?)::INTEGER[$1]") \ + from("(?)::TEXT") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + point p; + std::vector pv; + + #pragma db type("NUMERIC(6, 4)") + std::string n1; + + #pragma db type("NUMERIC(6)") + std::string n2; + + #pragma db type("NUMERIC") + std::string n3; + + #pragma db type("INTEGER [123]") + std::vector iv; + + bool + operator== (const object& y) const + { + return id == y.id && + p == y.p && + pv == y.pv && + n1 == y.n1 && + n2 == y.n2 && + n3 == y.n3 && + iv == y.iv; + } +}; + +#endif // TEST_HXX diff --git a/pgsql/custom/test.std b/pgsql/custom/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx new file mode 100644 index 0000000..800bfdb --- /dev/null +++ b/pgsql/custom/traits.hxx @@ -0,0 +1,167 @@ +// file : pgsql/custom/traits.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include +#include // std::memcpy + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace pgsql + { + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + typedef details::buffer image_type; + + static void + set_value (point& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "(x,y)". + // + char c; + std::istringstream is (std::string (b.data (), n)); + + is >> c; // '(' + is >> v.x; + is >> c; // ',' + is >> v.y; + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << '(' << v.x << ',' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "(?)::POINT";} + }; + }; + + template <> + class value_traits, id_string> + { + public: + typedef std::vector value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.clear (); + + if (!is_null) + { + // Array format is "{n1,n2,n3...}". + // + char c; + std::istringstream is (std::string (b.data (), n)); + + is >> c; // '{' + + for (c = static_cast (is.peek ()); c != '}'; is >> c) + { + v.push_back (int ()); + is >> v.back (); + } + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + std::ostringstream os; + + os << '{'; + + for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) + { + os << *i; + + if (++i != e) + os << ','; + } + + os << '}'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits > + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "(?)::INTEGER[]";} + }; + }; + } +} + +#endif // TRAITS_HXX diff --git a/pgsql/makefile b/pgsql/makefile index 6add9be..852e017 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +custom \ native \ truncation \ types diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx new file mode 100644 index 0000000..9e387b0 --- /dev/null +++ b/sqlite/custom/driver.cxx @@ -0,0 +1,76 @@ +// file : sqlite/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in SQLite. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.nv.push_back ("123"); // INTEGER + o.nv.push_back ("1.23"); // REAL + o.nv.push_back ("abc"); // TEXT + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Update. + // + o.nv[1] += "4"; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile new file mode 100644 index 0000000..5de140f --- /dev/null +++ b/sqlite/custom/makefile @@ -0,0 +1,110 @@ +# file : sqlite/custom/makefile +# copyright : Copyright (c) 2009-2012 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 sqlite --generate-schema \ +--generate-query --table-prefix sqlitex_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx new file mode 100644 index 0000000..ea20912 --- /dev/null +++ b/sqlite/custom/test.hxx @@ -0,0 +1,40 @@ +// file : sqlite/custom/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Map NUMERIC SQLite type to std::string (or any other type that +// provides the value_traits specialization). By +// default ODB treats NUMERIC as REAL. Note also that we don't +// need to specify to/from conversions since SQLite will convert +// implicitly. +// +#pragma db map type("NUMERIC") as("TEXT") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_): id (id_) {} + + #pragma db id + unsigned long id; + + #pragma db value_type("NUMERIC") + std::vector nv; + + bool + operator== (const object& y) const + { + return id == y.id && nv == y.nv; + } +}; + +#endif // TEST_HXX diff --git a/sqlite/custom/test.std b/sqlite/custom/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/makefile b/sqlite/makefile index 9e61fc5..a584535 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +custom \ native \ truncation \ types -- cgit v1.1 From 82fba993cd1525dc7096e48ba3685f067ca9b896 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Jul 2012 11:02:29 +0200 Subject: Fix array regex to match arrays without bounds --- pgsql/custom/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index 1f83031..68b6dd6 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -42,7 +42,7 @@ operator== (const point& a, const point& b) // Map INTEGER[] PostgreSQL type to std::vector. The other half of // this mapping is in traits.hxx (value_traits, id_string>). // -#pragma db map type("INTEGER *\\[(\\d+)\\]") \ +#pragma db map type("INTEGER *\\[(\\d*)\\]") \ as("TEXT") \ to("(?)::INTEGER[$1]") \ from("(?)::TEXT") -- cgit v1.1 From dc5874e5b8cdb2a8c8a5dc77a0bb4bd891079e3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Jul 2012 09:56:04 +0200 Subject: Fix code generation for circularly-dependant classes in separate headers New tests: common/circular/{single,multiple}. --- build/bootstrap.make | 7 +-- common/circular/multiple/driver.cxx | 51 ++++++++++++++++ common/circular/multiple/makefile | 116 ++++++++++++++++++++++++++++++++++++ common/circular/multiple/test.std | 0 common/circular/multiple/test1.hxx | 28 +++++++++ common/circular/multiple/test2.hxx | 18 ++++++ common/circular/single/driver.cxx | 39 ++++++++++++ common/circular/single/makefile | 113 +++++++++++++++++++++++++++++++++++ common/circular/single/test.hxx | 29 +++++++++ common/circular/single/test.std | 0 common/makefile | 2 + oracle/custom/makefile | 2 +- 12 files changed, 400 insertions(+), 5 deletions(-) create mode 100644 common/circular/multiple/driver.cxx create mode 100644 common/circular/multiple/makefile create mode 100644 common/circular/multiple/test.std create mode 100644 common/circular/multiple/test1.hxx create mode 100644 common/circular/multiple/test2.hxx create mode 100644 common/circular/single/driver.cxx create mode 100644 common/circular/single/makefile create mode 100644 common/circular/single/test.hxx create mode 100644 common/circular/single/test.std diff --git a/build/bootstrap.make b/build/bootstrap.make index aba7532..d4e5049 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -47,11 +47,10 @@ endif # Database schema creation. # ifeq ($(filter $(db_id),sqlite),) -$(out_base)/.test: schema-extra = \ -$(call message,sql $$1,$(dcf_root)/db-driver $$1,$(src_base)/$1)$(literal_newline)$(literal_tab) +$(out_base)/.test: schema-body = \ +$(call message,sql $$1,$(dcf_root)/db-driver $$1,$1)$(literal_newline)$(literal_tab) $(out_base)/.test: schema = \ -$(foreach s,$1,$(call schema-extra,$s))$(call \ -message,sql $$1,$(dcf_root)/db-driver $$1,$(out_base)/test.sql) +$(foreach s,$(if $1,$1,$(out_base)/test.sql),$(call schema-body,$s))@: endif # Dist setup. diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx new file mode 100644 index 0000000..2f28911 --- /dev/null +++ b/common/circular/multiple/driver.cxx @@ -0,0 +1,51 @@ +// file : common/circular/multiple/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test cases of circular dependencies between persistent classes, multiple +// files version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" + +#include "test2-odb.hxx" +#include "test1-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + } + + query bq (query::d->id != 0); + query dq (query::b->id != 0); + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile new file mode 100644 index 0000000..82a0bae --- /dev/null +++ b/common/circular/multiple/makefile @@ -0,0 +1,116 @@ +# file : common/circular/multiple/makefile +# copyright : Copyright (c) 2009-2012 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 := test1.hxx test2.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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--schema-format embedded --generate-query --table-prefix circular_m_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +# Extra dependecy for the ODB-generated code. +# +$(gen): $(src_base)/test1.hxx $(src_base)/test2.hxx + +$(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/circular/multiple/test.std b/common/circular/multiple/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx new file mode 100644 index 0000000..5ba4b92 --- /dev/null +++ b/common/circular/multiple/test1.hxx @@ -0,0 +1,28 @@ +// file : common/circular/multiple/test1.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include + +#pragma db object +struct derived; + +#pragma db object polymorphic +struct base +{ + virtual ~base () {} + + #pragma db id + unsigned long id_; + + derived* d_; +}; + +#ifdef ODB_COMPILER +# include "test2.hxx" +#endif + +#endif // TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx new file mode 100644 index 0000000..8f6ae5e --- /dev/null +++ b/common/circular/multiple/test2.hxx @@ -0,0 +1,18 @@ +// file : common/circular/multiple/test2.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include + +#include "test1.hxx" + +#pragma db object +struct derived: base +{ + base* b_; +}; + +#endif // TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx new file mode 100644 index 0000000..e4b0be6 --- /dev/null +++ b/common/circular/single/driver.cxx @@ -0,0 +1,39 @@ +// file : common/circular/single/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test cases of circular dependencies between persistent classes, single +// file version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + query bq (query::d->id != 0); + query dq (query::b->id != 0); + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/circular/single/makefile b/common/circular/single/makefile new file mode 100644 index 0000000..e1677d4 --- /dev/null +++ b/common/circular/single/makefile @@ -0,0 +1,113 @@ +# file : common/circular/single/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix circular_s_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx new file mode 100644 index 0000000..8dd39fe --- /dev/null +++ b/common/circular/single/test.hxx @@ -0,0 +1,29 @@ +// file : common/circular/single/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +struct derived; + +#pragma db object polymorphic +struct base +{ + virtual ~base () {} + + #pragma db id + unsigned long id_; + + derived* d_; +}; + +#pragma db object +struct derived: base +{ + base* b_; +}; + +#endif // TEST_HXX diff --git a/common/circular/single/test.std b/common/circular/single/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 3ec0aa2..cb033a8 100644 --- a/common/makefile +++ b/common/makefile @@ -8,6 +8,8 @@ tests := \ auto \ blob \ callback \ +circular/single \ +circular/multiple \ composite \ composite-id \ const-object \ diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 97cdb2c..66a0273 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -64,7 +64,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema, custom.sql) + $(call schema,$(src_base)/custom.sql $(out_base)/test.sql) $(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) -- cgit v1.1 From 6b4e9e363a2bf7c119391e6f4ecf68e194636ecc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jul 2012 09:12:17 +0200 Subject: Disable foreign keys for MySQL and SQLite while creating schema --- common/circular/multiple/driver.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index 2f28911..1b80218 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -11,9 +11,11 @@ #include #include +#include #include #include +#include // DATABASE_XXX #include #include "test1.hxx" @@ -35,9 +37,27 @@ main (int argc, char* argv[]) // Create the database schema. // { - transaction t (db->begin ()); + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for MySQL and SQLite. + // For these databases this is the only way to drop circularly- + // dependant tables. + // +#if defined(DATABASE_MYSQL) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); +#elif defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=OFF"); +#endif + + transaction t (c->begin ()); schema_catalog::create_schema (*db); t.commit (); + +#if defined(DATABASE_MYSQL) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); +#elif defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=ON"); +#endif } query bq (query::d->id != 0); -- cgit v1.1 From 9f2b5f3c24907d603706ff81b459d3f5d3c0882e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jul 2012 10:44:03 +0200 Subject: Bump version to 2.1.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 227cea2..7900f1c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.0 +2.1.0.a1 -- cgit v1.1 From 5aa48fc52202fd95210d8860b66769550732a5d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jul 2012 15:16:34 +0200 Subject: Add support for tests with multiple ODB headers --- build/bootstrap.make | 4 ++++ common/circular/multiple/makefile | 7 ++++--- common/circular/single/makefile | 6 +++--- common/template/Makefile.am | 23 ++++++++++++--------- common/template/template-vc10.vcxproj | 29 ++++++++++++++++----------- common/template/template-vc10.vcxproj.filters | 20 ++++++++++-------- common/template/template-vc9.vcproj | 21 ++++++++++--------- 7 files changed, 66 insertions(+), 44 deletions(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index d4e5049..507ce08 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -44,6 +44,10 @@ clean: $(out_base)/.clean endif +# By default the ODB header is called test.hxx. +# +$(out_base)/.dist: export odb_header_stem := test + # Database schema creation. # ifeq ($(filter $(db_id),sqlite),) diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 82a0bae..abd72e7 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -58,13 +58,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) +$(dist): export odb_header_stem := $(basename $(odb_hdr)) $(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)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) # Test. # diff --git a/common/circular/single/makefile b/common/circular/single/makefile index e1677d4..1fcfdb0 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -58,9 +58,9 @@ $(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)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) # Test. # diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 4478502..0aa8f83 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -13,15 +13,9 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, - +__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@ @@ -30,6 +24,17 @@ if HAVE_CXX11 ODBFLAGS += --std c++11 endif -test-odb.hxx: test.hxx +nodist_driver_SOURCES = +BUILT_SOURCES = +CLEANFILES = + +__foreach_w__(__f,__path__(odb_header_stem), +driver_SOURCES += __f.hxx +nodist_driver_SOURCES += __f-odb.cxx +BUILT_SOURCES += __f-odb.hxx +CLEANFILES += __f-odb.hxx __f-odb.ixx __f-odb.cxx + +__f-odb.hxx: __f.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) + +)) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index 5666584..c1229ea 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -154,25 +154,30 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) + __foreach_w__(__f,__path__(odb_header_stem), + __custom_build_entry__( +__f.hxx, +odb __f.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) +) ) -m4_ifelse(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_entry__(__f-odb.hxx) +__header_entry__(__f-odb.ixx) +))__header_entries__(extra_headers) __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_entry__(__f-odb.cxx) +))__source_entries__(extra_sources) diff --git a/common/template/template-vc10.vcxproj.filters b/common/template/template-vc10.vcxproj.filters index f3ee658..3460ffd 100644 --- a/common/template/template-vc10.vcxproj.filters +++ b/common/template/template-vc10.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -11,14 +11,18 @@ -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx) -__header_filter_entries__(extra_headers) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_filter_entry__(__f.hxx) +__header_filter_entry__(__f-odb.hxx) +__header_filter_entry__(__f-odb.ixx) +))__header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_filter_entry__(__f-odb.cxx) +))__source_filter_entries__(extra_sources) - \ No newline at end of file + diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index caf7201..a09174c 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -337,7 +337,9 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), + __source_entry__(__f-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__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), + __file_entry_custom_build__( +__f.hxx, +odb __f.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, +__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) +__file_entry__(__f-odb.hxx) +__file_entry__(__f-odb.ixx))) __file_entries__(extra_headers) -- cgit v1.1 From 3be0180445eaed554bf001d59e2cfa4389f94c10 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Jul 2012 15:17:09 +0200 Subject: Use __ifelse__ instead of m4_ifelse --- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/template-vc10.vcxproj | 6 +++--- boost/mssql/template/template-vc10.vcxproj.filters | 4 ++-- boost/mssql/template/template-vc9.vcproj | 4 ++-- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/template-vc10.vcxproj | 6 +++--- boost/mysql/template/template-vc10.vcxproj.filters | 4 ++-- boost/mysql/template/template-vc9.vcproj | 4 ++-- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/template-vc10.vcxproj | 6 +++--- boost/oracle/template/template-vc10.vcxproj.filters | 4 ++-- boost/oracle/template/template-vc9.vcproj | 4 ++-- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/template-vc10.vcxproj | 6 +++--- boost/pgsql/template/template-vc10.vcxproj.filters | 4 ++-- boost/pgsql/template/template-vc9.vcproj | 4 ++-- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/template-vc10.vcxproj | 6 +++--- boost/sqlite/template/template-vc10.vcxproj.filters | 4 ++-- boost/sqlite/template/template-vc9.vcproj | 4 ++-- mssql/template/Makefile.am | 2 +- mssql/template/template-vc10.vcxproj | 6 +++--- mssql/template/template-vc10.vcxproj.filters | 4 ++-- mssql/template/template-vc9.vcproj | 4 ++-- mysql/template/Makefile.am | 2 +- mysql/template/template-vc10.vcxproj | 6 +++--- mysql/template/template-vc10.vcxproj.filters | 4 ++-- mysql/template/template-vc9.vcproj | 4 ++-- oracle/template/Makefile.am | 2 +- oracle/template/template-vc10.vcxproj | 6 +++--- oracle/template/template-vc10.vcxproj.filters | 4 ++-- oracle/template/template-vc9.vcproj | 4 ++-- pgsql/template/Makefile.am | 2 +- pgsql/template/template-vc10.vcxproj | 6 +++--- pgsql/template/template-vc10.vcxproj.filters | 4 ++-- pgsql/template/template-vc9.vcproj | 4 ++-- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/template-vc10.vcxproj | 6 +++--- qt/mssql/template/template-vc10.vcxproj.filters | 4 ++-- qt/mssql/template/template-vc9.vcproj | 4 ++-- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/template-vc10.vcxproj | 6 +++--- qt/mysql/template/template-vc10.vcxproj.filters | 4 ++-- qt/mysql/template/template-vc9.vcproj | 4 ++-- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/template-vc10.vcxproj | 6 +++--- qt/oracle/template/template-vc10.vcxproj.filters | 4 ++-- qt/oracle/template/template-vc9.vcproj | 4 ++-- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/template-vc10.vcxproj | 6 +++--- qt/pgsql/template/template-vc10.vcxproj.filters | 4 ++-- qt/pgsql/template/template-vc9.vcproj | 4 ++-- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/template-vc10.vcxproj | 6 +++--- qt/sqlite/template/template-vc10.vcxproj.filters | 4 ++-- qt/sqlite/template/template-vc9.vcproj | 4 ++-- sqlite/template/Makefile.am | 2 +- sqlite/template/template-vc10.vcxproj | 6 +++--- sqlite/template/template-vc10.vcxproj.filters | 4 ++-- sqlite/template/template-vc9.vcproj | 4 ++-- 60 files changed, 120 insertions(+), 120 deletions(-) diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index f450bb0..5f194a7 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/boost/mssql/template/template-vc10.vcxproj b/boost/mssql/template/template-vc10.vcxproj index b1e2e37..dcb625e 100644 --- a/boost/mssql/template/template-vc10.vcxproj +++ b/boost/mssql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/boost/mssql/template/template-vc10.vcxproj.filters b/boost/mssql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/boost/mssql/template/template-vc10.vcxproj.filters +++ b/boost/mssql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/boost/mssql/template/template-vc9.vcproj b/boost/mssql/template/template-vc9.vcproj index 520a143..422fbd7 100644 --- a/boost/mssql/template/template-vc9.vcproj +++ b/boost/mssql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 10e80d3..c7305cc 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/boost/mysql/template/template-vc10.vcxproj b/boost/mysql/template/template-vc10.vcxproj index 29e53be..3137abc 100644 --- a/boost/mysql/template/template-vc10.vcxproj +++ b/boost/mysql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/boost/mysql/template/template-vc10.vcxproj.filters b/boost/mysql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/boost/mysql/template/template-vc10.vcxproj.filters +++ b/boost/mysql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj index 99551c1..b60c7e2 100644 --- a/boost/mysql/template/template-vc9.vcproj +++ b/boost/mysql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 9853f57..3eec093 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/boost/oracle/template/template-vc10.vcxproj b/boost/oracle/template/template-vc10.vcxproj index 8aa5256..0c93020 100644 --- a/boost/oracle/template/template-vc10.vcxproj +++ b/boost/oracle/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/boost/oracle/template/template-vc10.vcxproj.filters b/boost/oracle/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/boost/oracle/template/template-vc10.vcxproj.filters +++ b/boost/oracle/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/boost/oracle/template/template-vc9.vcproj b/boost/oracle/template/template-vc9.vcproj index 2a7448a..a3061ee 100644 --- a/boost/oracle/template/template-vc9.vcproj +++ b/boost/oracle/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index ec9e43b..24a0206 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj index 9f41ede..7bc0243 100644 --- a/boost/pgsql/template/template-vc10.vcxproj +++ b/boost/pgsql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/boost/pgsql/template/template-vc10.vcxproj.filters b/boost/pgsql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/boost/pgsql/template/template-vc10.vcxproj.filters +++ b/boost/pgsql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj index 34a8582..db49496 100644 --- a/boost/pgsql/template/template-vc9.vcproj +++ b/boost/pgsql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 0168a12..ba7b102 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/boost/sqlite/template/template-vc10.vcxproj b/boost/sqlite/template/template-vc10.vcxproj index 5224c7f..f94df08 100644 --- a/boost/sqlite/template/template-vc10.vcxproj +++ b/boost/sqlite/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/boost/sqlite/template/template-vc10.vcxproj.filters b/boost/sqlite/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/boost/sqlite/template/template-vc10.vcxproj.filters +++ b/boost/sqlite/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/boost/sqlite/template/template-vc9.vcproj b/boost/sqlite/template/template-vc9.vcproj index 93e9ba2..32fb152 100644 --- a/boost/sqlite/template/template-vc9.vcproj +++ b/boost/sqlite/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 204258b..500c758 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/mssql/template/template-vc10.vcxproj b/mssql/template/template-vc10.vcxproj index 3f5be3e..cf9c6ff 100644 --- a/mssql/template/template-vc10.vcxproj +++ b/mssql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/mssql/template/template-vc10.vcxproj.filters b/mssql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/mssql/template/template-vc10.vcxproj.filters +++ b/mssql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/mssql/template/template-vc9.vcproj b/mssql/template/template-vc9.vcproj index a1b3359..50e7e17 100644 --- a/mssql/template/template-vc9.vcproj +++ b/mssql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index b748228..0ba50ba 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index 8246eab..0da2efe 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/mysql/template/template-vc10.vcxproj.filters b/mysql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/mysql/template/template-vc10.vcxproj.filters +++ b/mysql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index 387c18f..58e1a54 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 7beba9c..cb3bd54 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/oracle/template/template-vc10.vcxproj b/oracle/template/template-vc10.vcxproj index f1a91e0..5246cf8 100644 --- a/oracle/template/template-vc10.vcxproj +++ b/oracle/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/oracle/template/template-vc10.vcxproj.filters b/oracle/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/oracle/template/template-vc10.vcxproj.filters +++ b/oracle/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/oracle/template/template-vc9.vcproj b/oracle/template/template-vc9.vcproj index 97cff07..bf9b1a7 100644 --- a/oracle/template/template-vc9.vcproj +++ b/oracle/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index fdcd8b1..0d632cc 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/pgsql/template/template-vc10.vcxproj b/pgsql/template/template-vc10.vcxproj index 87f2ee1..4bf096a 100644 --- a/pgsql/template/template-vc10.vcxproj +++ b/pgsql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/pgsql/template/template-vc10.vcxproj.filters b/pgsql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/pgsql/template/template-vc10.vcxproj.filters +++ b/pgsql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/pgsql/template/template-vc9.vcproj b/pgsql/template/template-vc9.vcproj index 07d580d..3a75a38 100644 --- a/pgsql/template/template-vc9.vcproj +++ b/pgsql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 7d944cc..f05c501 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/qt/mssql/template/template-vc10.vcxproj b/qt/mssql/template/template-vc10.vcxproj index a3477e0..e4902d0 100644 --- a/qt/mssql/template/template-vc10.vcxproj +++ b/qt/mssql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/qt/mssql/template/template-vc10.vcxproj.filters b/qt/mssql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/qt/mssql/template/template-vc10.vcxproj.filters +++ b/qt/mssql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/qt/mssql/template/template-vc9.vcproj b/qt/mssql/template/template-vc9.vcproj index dc06622..da1b5ab 100644 --- a/qt/mssql/template/template-vc9.vcproj +++ b/qt/mssql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 1fe0055..55c7643 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj index 0460825..0f57bbe 100644 --- a/qt/mysql/template/template-vc10.vcxproj +++ b/qt/mysql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/qt/mysql/template/template-vc10.vcxproj.filters b/qt/mysql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/qt/mysql/template/template-vc10.vcxproj.filters +++ b/qt/mysql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj index 031e923..a904d40 100644 --- a/qt/mysql/template/template-vc9.vcproj +++ b/qt/mysql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 6e23f58..df3e7c4 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/qt/oracle/template/template-vc10.vcxproj b/qt/oracle/template/template-vc10.vcxproj index 0ea856a..6e7c369 100644 --- a/qt/oracle/template/template-vc10.vcxproj +++ b/qt/oracle/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/qt/oracle/template/template-vc10.vcxproj.filters b/qt/oracle/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/qt/oracle/template/template-vc10.vcxproj.filters +++ b/qt/oracle/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/qt/oracle/template/template-vc9.vcproj b/qt/oracle/template/template-vc9.vcproj index a350894..292b899 100644 --- a/qt/oracle/template/template-vc9.vcproj +++ b/qt/oracle/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index f5f1eed..18fe499 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj index bc51721..1c1e1a7 100644 --- a/qt/pgsql/template/template-vc10.vcxproj +++ b/qt/pgsql/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/qt/pgsql/template/template-vc10.vcxproj.filters b/qt/pgsql/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/qt/pgsql/template/template-vc10.vcxproj.filters +++ b/qt/pgsql/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj index 19cffcf..2e9e84b 100644 --- a/qt/pgsql/template/template-vc9.vcproj +++ b/qt/pgsql/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index 2470afe..d6a565a 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/qt/sqlite/template/template-vc10.vcxproj b/qt/sqlite/template/template-vc10.vcxproj index d705b5c..5d4cd02 100644 --- a/qt/sqlite/template/template-vc10.vcxproj +++ b/qt/sqlite/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/qt/sqlite/template/template-vc10.vcxproj.filters b/qt/sqlite/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/qt/sqlite/template/template-vc10.vcxproj.filters +++ b/qt/sqlite/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/qt/sqlite/template/template-vc9.vcproj b/qt/sqlite/template/template-vc9.vcproj index 962bde9..b52f2ec 100644 --- a/qt/sqlite/template/template-vc9.vcproj +++ b/qt/sqlite/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index baea455..5d9d107 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -13,7 +13,7 @@ AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, # ODB compilation. # diff --git a/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj index 9cf0599..8e11aa6 100644 --- a/sqlite/template/template-vc10.vcxproj +++ b/sqlite/template/template-vc10.vcxproj @@ -154,7 +154,7 @@ true -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, m4_dnl __custom_build_entry__( @@ -164,14 +164,14 @@ odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFI test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -m4_ifelse(__value__(odb_options),,, +__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)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) diff --git a/sqlite/template/template-vc10.vcxproj.filters b/sqlite/template/template-vc10.vcxproj.filters index 951015b..8ac18a3 100644 --- a/sqlite/template/template-vc10.vcxproj.filters +++ b/sqlite/template/template-vc10.vcxproj.filters @@ -11,7 +11,7 @@ -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __header_filter_entry__(test.hxx) __header_filter_entry__(test-odb.hxx) __header_filter_entry__(test-odb.ixx)) @@ -19,7 +19,7 @@ __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) __source_filter_entries__(extra_sources) \ No newline at end of file diff --git a/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj index 490567e..960f086 100644 --- a/sqlite/template/template-vc9.vcproj +++ b/sqlite/template/template-vc9.vcproj @@ -337,7 +337,7 @@ UniqueIdentifier="{__uuid__()}" > __source_entry__(driver.cxx) -m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) __source_entries__(extra_sources) -m4_ifelse(__value__(odb_options),,, +__ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -- cgit v1.1 From 4f59995242d894baa041a8171d420a18b43ceb8c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 18 Jul 2012 12:07:19 +0200 Subject: Convert NULLs to NaNs in SQLite for float and double This makes it consistent with SQLite behavior which converts NaNs to NULLs. --- sqlite/types/driver.cxx | 2 ++ sqlite/types/test.hxx | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 0c19e75..1214d18 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -5,6 +5,7 @@ // Test SQLite type conversion. // +#include // std::numeric_limits #include // std::auto_ptr #include #include @@ -33,6 +34,7 @@ main (int argc, char* argv[]) o.bool_ = true; o.integer_ = -123456; o.real_ = 1.123; + o.nan_ = numeric_limits::quiet_NaN (); string long_str (2040, 'l'); diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 6d9fc1c..7ed1a8c 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -29,24 +29,27 @@ struct object #pragma db id unsigned long id_; - #pragma db type ("BOOL") + #pragma db type("BOOL") bool bool_; - #pragma db type ("INTEGER") + #pragma db type("INTEGER") int integer_; - #pragma db type ("REAL") + #pragma db type("REAL") double real_; - #pragma db type ("TEXT") + #pragma db type("REAL") null + double nan_; + + #pragma db type("TEXT") std::string text_; - #pragma db type ("BLOB") + #pragma db type("BLOB") std::vector blob_; // Test NULL value. // - #pragma db type ("TEXT") null + #pragma db type("TEXT") null string_ptr null_; bool @@ -57,6 +60,7 @@ struct object bool_ == y.bool_ && integer_ == y.integer_ && real_ == y.real_ && + nan_ != nan_ && text_ == y.text_ && blob_ == y.blob_ && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); -- cgit v1.1 From fa31e7c6a729a5e9772bfd775d19501996652f30 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Jul 2012 11:32:54 +0200 Subject: Fix PostgreSQL test template to do the same as in other databases --- pgsql/template/driver.cxx | 22 ++++++++++++++++++++-- pgsql/template/makefile | 1 + pgsql/template/test.hxx | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 755aaeb..329c91c 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -9,17 +9,35 @@ #include #include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + using namespace std; +using namespace odb::core; int -main () +main (int argc, char* argv[]) { try { + auto_ptr db (create_database (argc, argv)); + + // + // cout << "test 001" << endl; + { + transaction t (db->begin ()); + t.commit (); + } } - catch (...) + catch (const odb::exception& e) { + cerr << e.what () << endl; return 1; } } diff --git a/pgsql/template/makefile b/pgsql/template/makefile index eb43706..aab7437 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -62,6 +62,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std + $(call schema) $(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) diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 9916172..7f7bb99 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -5,4 +5,22 @@ #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 -- cgit v1.1 From e88ee0b91d795f3c3061c41e53e39c2b30707798 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Jul 2012 12:13:39 +0200 Subject: Add support for defining indexes New db pragma qualifier: index. New tests: common/index, mysql/index, pgsql/index. --- common/index/driver.cxx | 43 +++++++++++++++ common/index/makefile | 113 ++++++++++++++++++++++++++++++++++++++ common/index/test.hxx | 143 ++++++++++++++++++++++++++++++++++++++++++++++++ common/index/test.std | 0 common/makefile | 1 + mysql/index/driver.cxx | 42 ++++++++++++++ mysql/index/makefile | 110 +++++++++++++++++++++++++++++++++++++ mysql/index/test.hxx | 21 +++++++ mysql/index/test.std | 0 mysql/makefile | 1 + pgsql/index/driver.cxx | 42 ++++++++++++++ pgsql/index/makefile | 110 +++++++++++++++++++++++++++++++++++++ pgsql/index/test.hxx | 20 +++++++ pgsql/index/test.std | 0 pgsql/makefile | 1 + 15 files changed, 647 insertions(+) create mode 100644 common/index/driver.cxx create mode 100644 common/index/makefile create mode 100644 common/index/test.hxx create mode 100644 common/index/test.std create mode 100644 mysql/index/driver.cxx create mode 100644 mysql/index/makefile create mode 100644 mysql/index/test.hxx create mode 100644 mysql/index/test.std create mode 100644 pgsql/index/driver.cxx create mode 100644 pgsql/index/makefile create mode 100644 pgsql/index/test.hxx create mode 100644 pgsql/index/test.std diff --git a/common/index/driver.cxx b/common/index/driver.cxx new file mode 100644 index 0000000..175aaee --- /dev/null +++ b/common/index/driver.cxx @@ -0,0 +1,43 @@ +// file : common/index/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test index creation with db pragma index. See also database-specific +// tests. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/index/makefile b/common/index/makefile new file mode 100644 index 0000000..e21aab0 --- /dev/null +++ b/common/index/makefile @@ -0,0 +1,113 @@ +# file : common/index/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--table-prefix index_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/index/test.hxx b/common/index/test.hxx new file mode 100644 index 0000000..4392854 --- /dev/null +++ b/common/index/test.hxx @@ -0,0 +1,143 @@ +// file : common/index/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Test basic functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + + #pragma db index + int i1; + + #pragma db unique + int i2; + + #pragma db unique index + int i3; + + int i4; + #pragma db index unique member(i4) + + int i5; + #pragma db index type("UNIQUE") member(i5) + + int i6; + #pragma db index("i6_index") member(i6) + + int i7; + int i8; + int i9; + + int i10; + #pragma db index member(i10, "ASC") + }; + + #pragma db index(object) member(i7) + #pragma db index(object::"i8_index") member(i8) +} + +#pragma db index(test1::object::"i9_index") member(i9) + +// Test composite indexes. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct nested + { + int x; + int y; + }; + + #pragma db value + struct comp + { + int x; + int y; + nested n; + }; + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + + int i1a; + int i1b; + #pragma db index("i1_i") member(i1a) member(i1b) + + int i2a; + int i2b; + #pragma db index("i2_i") members(i2a, i2b) + + #pragma db index + comp c1; + + #pragma db index column("") + comp c2; + + comp c3; + #pragma db index member(c3.x) + #pragma db index member(c3.y) + + comp c4; + #pragma db index("c4_i") members(c4.x, c4.y, c4.n.x) + + comp c5; + int i5; + #pragma db index("ci5_i") member(c5) member(i5) + }; +} + +// Test container indexes. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct id + { + int x; + int y; + }; + + #pragma db value + struct comp + { + int x; + std::vector v; + }; + + #pragma db object + struct object + { + #pragma db id + id id_; + + std::vector v; + #pragma db index unique member(v.id) + #pragma db index("index_index") member(v.index) + + comp c; + #pragma db index("id_index") member(c.v.id) + #pragma db index unique member(c.v.index) + }; +} + +#endif // TEST_HXX diff --git a/common/index/test.std b/common/index/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index cb033a8..464466a 100644 --- a/common/makefile +++ b/common/makefile @@ -20,6 +20,7 @@ default \ enum \ erase-query \ include \ +index \ inheritance \ inverse \ lazy-ptr \ diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx new file mode 100644 index 0000000..b1e8e54 --- /dev/null +++ b/mysql/index/driver.cxx @@ -0,0 +1,42 @@ +// file : mysql/index/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test MySQL index creation. See also the common test. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mysql/index/makefile b/mysql/index/makefile new file mode 100644 index 0000000..a51ae43 --- /dev/null +++ b/mysql/index/makefile @@ -0,0 +1,110 @@ +# file : mysql/index/makefile +# copyright : Copyright (c) 2009-2012 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 mysql --generate-schema \ +--table-prefix mysql_index_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx new file mode 100644 index 0000000..65870ff --- /dev/null +++ b/mysql/index/test.hxx @@ -0,0 +1,21 @@ +// file : mysql/template/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + std::string s; + #pragma db index method("BTREE") member(s, "(200) DESC") +}; + +#endif // TEST_HXX diff --git a/mysql/index/test.std b/mysql/index/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/makefile b/mysql/makefile index b3fc74f..ccd0087 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +index \ native \ truncation \ types diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx new file mode 100644 index 0000000..48ac5f8 --- /dev/null +++ b/pgsql/index/driver.cxx @@ -0,0 +1,42 @@ +// file : pgsql/template/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL index creation. See also the common test. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/index/makefile b/pgsql/index/makefile new file mode 100644 index 0000000..f56a6ba --- /dev/null +++ b/pgsql/index/makefile @@ -0,0 +1,110 @@ +# file : pgsql/index/makefile +# copyright : Copyright (c) 2009-2012 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)) +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 pgsql --generate-schema \ +--table-prefix pgsql_index_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx new file mode 100644 index 0000000..8635eec --- /dev/null +++ b/pgsql/index/test.hxx @@ -0,0 +1,20 @@ +// file : pgsql/index/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + int i; + #pragma db index type("UNIQUE CONCURRENTLY") method("BTREE") member(i) +}; + +#endif // TEST_HXX diff --git a/pgsql/index/test.std b/pgsql/index/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/makefile b/pgsql/makefile index 852e017..702825a 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +index \ native \ truncation \ types -- cgit v1.1 From c4f40393e585d1a22115259188d2758821643cf3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jul 2012 09:31:02 +0200 Subject: Restore exception handling --- common/threads/driver.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index cbfb283..dc4de0d 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -121,16 +121,11 @@ struct task } } } - catch (int) - { - } - /* catch (const odb::exception& e) { cerr << e.what () << endl; return reinterpret_cast (1); } - */ return 0; } -- cgit v1.1 From f1f4129311ef43d2320fa44571f749a8e9c5b9eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jul 2012 10:19:39 +0200 Subject: Enable URI paths for SQLite database --- libcommon/common/common.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a786fb5..6990924 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -111,7 +111,14 @@ create_database (int& argc, db.reset ( new sqlite::database ( - argc, argv, false, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, true, + argc, argv, false, + SQLITE_OPEN_READWRITE + | SQLITE_OPEN_CREATE +#ifdef SQLITE_OPEN_URI + | SQLITE_OPEN_URI +#endif + , + true, #ifdef HAVE_CXX11 move (f) #else -- cgit v1.1 From 5eb4fdfe0e203a288b1ba8bbe9b8aa6d08f4dbf9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 27 Jul 2012 16:04:31 +0200 Subject: Bump version to 2.1.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7900f1c..51b720e 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.1.0.a1 +2.1.0.a2 -- cgit v1.1 From 54f820b0d4a1cb614753c333bd78feb9ed579aad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 31 Jul 2012 12:16:55 +0200 Subject: Add support for changing location that ODB views as class definition This is useful for making third-party/system types into ODB composite value types. New pragma: definition. New test: common/definition. --- common/definition/driver.cxx | 55 +++++++++++++++++ common/definition/makefile | 117 +++++++++++++++++++++++++++++++++++++ common/definition/test.hxx | 27 +++++++++ common/definition/test.std | 0 common/definition/time-mapping.hxx | 18 ++++++ common/makefile | 1 + 6 files changed, 218 insertions(+) create mode 100644 common/definition/driver.cxx create mode 100644 common/definition/makefile create mode 100644 common/definition/test.hxx create mode 100644 common/definition/test.std create mode 100644 common/definition/time-mapping.hxx diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx new file mode 100644 index 0000000..d23b9e2 --- /dev/null +++ b/common/definition/driver.cxx @@ -0,0 +1,55 @@ +// file : common/definition/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test overriding composite value definition point. This is primarily +// useful to make composite values out of third-party types. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.time.tv_sec = 1; + o.time.tv_usec = 1000; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (p->time.tv_sec == o.time.tv_sec && + p->time.tv_usec == o.time.tv_usec); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/definition/makefile b/common/definition/makefile new file mode 100644 index 0000000..fb64b71 --- /dev/null +++ b/common/definition/makefile @@ -0,0 +1,117 @@ +# file : common/definition/makefile +# copyright : Copyright (c) 2009-2012 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 time-mapping.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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--table-prefix definition_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +# Extra dependecy for the ODB-generated code. +# +$(gen): $(src_base)/time-mapping.hxx + +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/definition/test.hxx b/common/definition/test.hxx new file mode 100644 index 0000000..51a5029 --- /dev/null +++ b/common/definition/test.hxx @@ -0,0 +1,27 @@ +// file : common/definition/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#ifdef _WIN32 +# include // timeval +#else +# include // timeval +#endif + +#include + +#include "time-mapping.hxx" + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; + + timeval time; +}; + +#endif // TEST_HXX diff --git a/common/definition/test.std b/common/definition/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx new file mode 100644 index 0000000..d55159d --- /dev/null +++ b/common/definition/time-mapping.hxx @@ -0,0 +1,18 @@ +// file : common/definition/time-mapping.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TIME_MAPPING_HXX +#define TIME_MAPPING_HXX + +#ifdef _WIN32 +# include // timeval +#else +# include // timeval +#endif + +#pragma db value(timeval) definition +#pragma db member(timeval::tv_sec) column("sec") +#pragma db member(timeval::tv_usec) column("usec") + +#endif // TIME_MAPPING_HXX diff --git a/common/makefile b/common/makefile index 464466a..e1a5f13 100644 --- a/common/makefile +++ b/common/makefile @@ -17,6 +17,7 @@ const-member \ container \ ctor \ default \ +definition \ enum \ erase-query \ include \ -- cgit v1.1 From ae6dd84a3b61063a595efb2cd02eff01b0185546 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 1 Aug 2012 11:16:20 +0200 Subject: Add support for empty column names in composite value types --- common/composite/driver.cxx | 33 +++++++ common/composite/test.hxx | 226 +++++++++++++++++++++++++------------------- 2 files changed, 161 insertions(+), 98 deletions(-) diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 4f4d720..a7bc26e 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -27,8 +27,12 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + // Test basic composite functionality. + // for (unsigned short i (0); i < 2; ++i) { + using namespace test1; + person p (1); p.name_.first = "Joe"; p.name_.last = "Dirt"; @@ -125,6 +129,8 @@ main (int argc, char* argv[]) // Test composite class template instantiation. // { + using namespace test2; + object o (1); o.comp_.num = 123; @@ -158,6 +164,33 @@ main (int argc, char* argv[]) assert (o == *o1); } } + + // Test empty column name. + // + { + using namespace test3; + + object o (1); + o.c_.str = "abc"; + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } } catch (const odb::exception& e) { diff --git a/common/composite/test.hxx b/common/composite/test.hxx index be53a2e..fe578cb 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -11,134 +11,164 @@ #include -#pragma db value -struct name -{ - std::string first; - std::string last; -}; - -#pragma db value -struct name_title -{ - std::string title; -}; - -#pragma db value -struct name_title_ex: name_title +// Test basic composite functionality. +// +#pragma db namespace table("t1_") +namespace test1 { - // Test value types without data members. -}; + #pragma db value + struct name + { + std::string first; + std::string last; + }; -#pragma db value -struct name_flags -{ - bool nick; - bool alias; -}; + #pragma db value + struct name_title + { + std::string title; + }; -#pragma db value -struct name_ex: name, name_title_ex -{ - name alias; - std::string nick; + #pragma db value + struct name_title_ex: name_title + { + // Test value types without data members. + }; - #pragma db column("show_") - name_flags flags; -}; + #pragma db value + struct name_flags + { + bool nick; + bool alias; + }; -#pragma db object -struct person -{ - person (unsigned long id) - : id_ (id) + #pragma db value + struct name_ex: name, name_title_ex { - } + name alias; + std::string nick; - person () + #pragma db column("show_") + name_flags flags; + }; + + #pragma db object + struct person { - } + person () {} + person (unsigned long id): id_ (id) {} - #pragma db id - unsigned long id_; + #pragma db id + unsigned long id_; - #pragma db column("") - name_ex name_; + #pragma db column("") + name_ex name_; - unsigned short age_; -}; + unsigned short age_; + }; -inline bool -operator== (const person& x, const person& y) -{ - return x.id_ == y.id_ && - x.name_.first == y.name_.first&& - x.name_.last == y.name_.last && - x.name_.title == y.name_.title && - x.name_.alias.first == y.name_.alias.first && - x.name_.alias.last == y.name_.alias.last && - x.name_.nick == y.name_.nick && - x.name_.flags.nick == y.name_.flags.nick && - x.name_.flags.alias == y.name_.flags.alias && - x.age_ == y.age_; + inline bool + operator== (const person& x, const person& y) + { + return x.id_ == y.id_ && + x.name_.first == y.name_.first&& + x.name_.last == y.name_.last && + x.name_.title == y.name_.title && + x.name_.alias.first == y.name_.alias.first && + x.name_.alias.last == y.name_.alias.last && + x.name_.nick == y.name_.nick && + x.name_.flags.nick == y.name_.flags.nick && + x.name_.flags.alias == y.name_.flags.alias && + x.age_ == y.age_; + } } // Test composite class template instantiation. // -template -struct comp +#pragma db namespace table("t2_") +namespace test2 { - I num; - S str; - std::vector > vec; -}; - -template -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str && x.vec == y.vec; -} + template + struct comp + { + I num; + S str; + std::vector > vec; + }; + + template + inline bool + operator== (const comp& x, const comp& y) + { + return x.num == y.num && x.str == y.str && x.vec == y.vec; + } -typedef std::pair int_str_pair; -#pragma db value(int_str_pair) + typedef std::pair int_str_pair; + #pragma db value(int_str_pair) -// Make sure we use the name that was specified in the pragma. -// + // Make sure we use the name that was specified in the pragma. + // #ifdef ODB_COMPILER -typedef comp int_str_comp1; + typedef comp int_str_comp1; #endif -typedef comp int_str_comp; -#pragma db value(int_str_comp) + typedef comp int_str_comp; + #pragma db value(int_str_comp) -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) + #pragma db object + struct object { - } + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + comp comp_; + std::pair pair_; + std::vector vec_; + }; - object () + inline bool + operator== (const object& x, const object& y) { + return x.id_ == y.id_ && + x.comp_ == y.comp_ && + x.pair_ == y.pair_ && + x.vec_ == y.vec_; } +} - #pragma db id - unsigned long id_; +// Test empty column name. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct comp + { + #pragma db column("") + std::string str; + }; - comp comp_; - std::pair pair_; - std::vector vec_; -}; + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} -inline bool -operator== (const object& x, const object& y) -{ - return x.id_ == y.id_ && - x.comp_ == y.comp_ && - x.pair_ == y.pair_ && - x.vec_ == y.vec_; + #pragma db id + unsigned long id_; + + comp c_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id_ == y.id_ && x.c_.str == y.c_.str; + } } + #endif // TEST_HXX -- cgit v1.1 From da9f37e292c9f490e0c0e9b467114d5df70a9a53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Aug 2012 11:46:00 +0200 Subject: Add support for member accessors/modifiers New pragmas: get, set, access. New test: common/access. --- common/access/driver.cxx | 228 ++++++++++++++++++++ common/access/makefile | 113 ++++++++++ common/access/test.hxx | 501 +++++++++++++++++++++++++++++++++++++++++++ common/access/test.std | 0 common/makefile | 1 + common/polymorphism/test.hxx | 13 +- 6 files changed, 851 insertions(+), 5 deletions(-) create mode 100644 common/access/driver.cxx create mode 100644 common/access/makefile create mode 100644 common/access/test.hxx create mode 100644 common/access/test.std diff --git a/common/access/driver.cxx b/common/access/driver.cxx new file mode 100644 index 0000000..3e3c96d --- /dev/null +++ b/common/access/driver.cxx @@ -0,0 +1,228 @@ +// file : common/access/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test accessor/modifier expressions. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test basic accessor/modifier functionality. + // + { + using namespace test1; + + object o (1, 623, 723); + o.i1 () = 123; + o.i2 (223); + o.i3 () = 323; + o.i4 () = 423; + o.set_i5 (423); + o.s1 ("1bc"); + memcpy (o.b1 (), "123456789012345", 16); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test composite accessor/modifier functionality. + // + { + using namespace test2; + + object o (1); + + o.v1 () = value (1123, 1234); + o.v2 (value (2123, 2234)); + o.v3_i1 (3123); + o.v3_i2 (3223); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test object pointer accessor/modifier functionality. + // + { + using namespace test3; + + object2 o (1); + o.p1 ().reset (new object1 (1)); + o.p2 (object1_ptr (new object1 (2))); + + { + transaction t (db->begin ()); + db->persist (o.p1 ()); + db->persist (o.p2 ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id ())); + t.commit (); + + assert (p->p1 ()->id () == o.p1 ()->id () && + p->p2 ()->id () == o.p2 ()->id ()); + } + } + + // Test container accessor/modifier functionality. + // + { + using namespace test4; + + object o (1); + o.c1 ().push_back (1123); + o.c1 ().push_back (1124); + o.c1 ().push_back (1125); + + { + std::vector v; + v.push_back (2123); + v.push_back (2124); + v.push_back (2125); + o.c2 (v); + } + + o.v1 ().c1 ().push_back (1123); + o.v1 ().c1 ().push_back (1124); + o.v1 ().c1 ().push_back (1125); + + { + std::vector v; + v.push_back (2123); + v.push_back (2124); + v.push_back (2125); + o.v1 ().c2 (v); + } + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test id accessor/modifier functionality. + // + { + using namespace test5; + + object1 o1; + object2 o2; + object3 o3; + object4 o4; + o4.id (uuid ("\x60\x1D\x17\xF0-\x60\x05-\x47\x23-\x95\x37-" + "\xC1\xF8\x94\x41\x2B\xEC")); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id ())); + auto_ptr p2 (db->load (o2.id ())); + auto_ptr p3 (db->load (o3.id_)); + auto_ptr p4 (db->load (o4.id ())); + t.commit (); + } + } + + // Test version accessor/modifier functionality. + // + { + using namespace test6; + + object1 o1 (1); + object2 o2; + object3 o3 (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + assert (o1.version () == 1); + assert (o2.version () == 1); + assert (o3.version_ == 1); + } + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->update (o3); + t.commit (); + + assert (o1.version () == 2); + assert (o2.version () == 2); + assert (o3.version_ == 2); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/access/makefile b/common/access/makefile new file mode 100644 index 0000000..674128d --- /dev/null +++ b/common/access/makefile @@ -0,0 +1,113 @@ +# file : common/access/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--table-prefix access_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/access/test.hxx b/common/access/test.hxx new file mode 100644 index 0000000..7964edb --- /dev/null +++ b/common/access/test.hxx @@ -0,0 +1,501 @@ +// file : common/access/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include +#include +#include // std::memcpy, std::memcmp, std::memset +#include // std::auto_ptr/std::unique_ptr +#include // std::move + +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) +# define BINARY16_TYPE "BINARY(16)" +# elif defined(ODB_DATABASE_SQLITE) +# define BINARY16_TYPE "BLOB" +# elif defined(ODB_DATABASE_PGSQL) +# define BINARY16_TYPE "BYTEA" +# elif defined(ODB_DATABASE_ORACLE) +# define BINARY16_TYPE "RAW(16)" +# elif defined(ODB_DATABASE_MSSQL) +# define BINARY16_TYPE "BINARY(16)" +# else +# error unknown database +# endif +#endif + +// Test basic accessor/modifier functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object (): i6_ (0), i7_ (0) {} + object (unsigned long id, int i6, int i7): id_ (id), i6_ (i6), i7_ (i7) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + #pragma db access(i1) + int i1_; + + public: + int i2 () const {return i2_;} + void i2 (int i2) {i2_ = i2;} + private: + #pragma db access(i2) + int i2_; + + // Prefer reference accessor to modifier. + // + public: + int i3 () const {return i3_;} + int& i3 () {return i3_;} + private: + void i3 (int i3) {i3_ = i3;} + #pragma db access(i3) + int i3_; + + // Prefer reference accessor to modifier (reverse function order). + // + void i4 (int i4) {i4_ = i4;} + public: + int i4 () const {return i4_;} + int& i4 () {return i4_;} + private: + #pragma db access(i4) + int i4_; + + public: + int get_i5 () const {return i5_;} + void set_i5 (int i5) {i5_ = i5;} + private: + #pragma db get(get_i5) set(set_i5) + int i5_; + + // Const member via reference. + // + public: + const int& i6 () const {return i6_;} + private: + #pragma db get(i6) set(const_cast (this.i6 ())) + const int i6_; + + // Const member via modifier. + // + public: + int i7 () const {return i7_;} + void i7 (int i7) const {const_cast (i7_) = i7;} + private: + #pragma db access(i7) + const int i7_; + + public: + const char* s1 () const {return s1_.c_str ();} + void s1 (const char* s1) {s1_ = s1;} + private: + #pragma db get(s1) set(s1((?).c_str ())) + std::string s1_; + + // Array member via ref. + // + public: + const char* b1 () const {return b1_;} + char* b1 () {return b1_;} + private: + #pragma db type(BINARY16_TYPE) access(b1) + char b1_[16]; + + // Array member via modifier. + // + public: + const char* b2 () const {return b2_;} + void b2 (char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} + private: + #pragma db type(BINARY16_TYPE) access(b2) + char b2_[16]; + + public: + bool operator== (const object& o) const + { + return id_ == o.id_ && + i1_ == o.i1_ && + i2_ == o.i2_ && + i3_ == o.i3_ && + i4_ == o.i4_ && + i5_ == o.i5_ && + i6_ == o.i6_ && + i7_ == o.i7_ && + s1_ == o.s1_ && + std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && + std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; + } + }; +} + +// Test composite accessor/modifier functionality. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct value + { + value () {} + value (int i1, int i2): i1_ (i1), i2_ (i2) {} + + bool operator== (const value& v) const + { + return i1_ == v.i1_ && i2_ == v.i2_; + } + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + #pragma db access(i1) + int i1_; + + public: + int i2 () const {return i2_;} + void i2 (int i2) {i2_ = i2;} + private: + #pragma db access(i2) + int i2_; + }; + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + bool operator== (const object& o) const + { + return id_ == o.id_ && + v1_ == o.v1_ && + v2_ == o.v2_ && + v3_ == o.v3_; + } + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const value& v1 () const {return v1_;} + value& v1 () {return v1_;} + private: + #pragma db access(v1) + value v1_; + + public: + const value& v2 () const {return v2_;} + void v2 (const value& v2) {v2_ = v2;} + private: + #pragma db access(v2) + value v2_; + + public: + int v3_i1 () const {return v3_.i1 ();} + int v3_i2 () const {return v3_.i2 ();} + void v3_i1 (int i1) {v3_.i1 () = i1;} + void v3_i2 (int i2) {v3_.i2 (i2);} + private: + #pragma db get(test2::value (this.v3_i1 (), this.v3_i2 ())) \ + set(this.v3_i1 ((?).i1 ()); this.v3_i2 ((?).i2 ())) + value v3_; + }; +} + +// Test object pointer accessor/modifier functionality. +// +#pragma db namespace table("t3_") +namespace test3 +{ + struct object1; + +#ifdef HAVE_CXX11 + typedef std::unique_ptr object1_ptr; +#else + typedef std::auto_ptr object1_ptr; +#endif + + #pragma db object pointer(object1_ptr) + struct object1 + { + object1 () {} + object1 (unsigned long id): id_ (id) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (unsigned long id): id_ (id) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const object1_ptr& p1 () const {return p1_;} + object1_ptr& p1 () {return p1_;} + private: + #pragma db access(p1) + object1_ptr p1_; + + public: + const object1_ptr& p2 () const {return p2_;} + +#ifdef HAVE_CXX11 + void p2 (object1_ptr p2) {p2_ = std::move (p2);} +#else + void p2 (object1_ptr p2) {p2_ = p2;} +#endif + private: +#ifdef HAVE_CXX11 + #pragma db get(p2) set(p2 (std::move (?))) +#else + #pragma db access(p2) +#endif + object1_ptr p2_; + }; +} + +// Test container accessor/modifier functionality. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db value + struct value + { + value (): c3_ (3, 999) {} + value (int v): c1_ (3, v), c2_ (3, v + 1), c3_ (3, v + 2) {} + + bool operator== (const value& v) const + { + return c1_ == v.c1_ && c2_ == v.c2_ && c3_ == v.c3_; + } + + public: + const std::vector& c1 () const {return c1_;} + std::vector& c1 () {return c1_;} + private: + #pragma db access(c1) + std::vector c1_; + + public: + const std::vector& c2 () const {return c2_;} + void c2 (const std::vector& c2) {c2_ = c2;} + private: + #pragma db access(c2) + std::vector c2_; + + public: + const std::vector c3_; + }; + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id), c3_ (3, 3123), v2_ (2123) {} + + bool operator== (const object& o) const + { + return id_ == o.id_ && + c1_ == o.c1_ && + c2_ == o.c2_ && + c3_ == o.c3_ && + v1_ == o.v1_ && + v2_ == o.v2_; + } + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const std::vector& c1 () const {return c1_;} + std::vector& c1 () {return c1_;} + private: + #pragma db access(c1) + std::vector c1_; + + public: + const std::vector& c2 () const {return c2_;} + void c2 (const std::vector& c2) {c2_ = c2;} + private: + #pragma db access(c2) + std::vector c2_; + + public: + const std::vector& c3 () const {return c3_;} + private: + #pragma db get(c3) set(const_cast&> (this.c3 ())) + const std::vector c3_; + + public: + const value& v1 () const {return v1_;} + value& v1 () {return v1_;} + private: + #pragma db access(v1) + value v1_; + + public: + const value v2_; + }; +} + +// Test id accessor/modifier functionality. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object + struct object1 + { + object1 (): id_ (0) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 (): id_ (0) {} + + public: + unsigned long id () const {return id_;} + unsigned long& id () {return id_;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + #pragma db object + struct object3 + { + object3 (): id_ (0) {} + + #pragma db id auto + const unsigned long id_; + }; + + #pragma db value + struct uuid + { + uuid () {std::memset (data_, 0, sizeof (data_));} + explicit uuid (const char* d) {data (d);} + + public: + const char* data () const {return data_;} + void data (const char* d) {std::memcpy (data_, d, sizeof (data_));} + private: + #pragma db type(BINARY16_TYPE) column("") access(data) + char data_[16]; + }; + + #pragma db object + struct object4 + { + public: + const uuid& id () const {return id_;} + void id (const uuid& id) {id_ = id;} + private: + #pragma db id access(id) + uuid id_; + }; +} + +// Test version accessor/modifier functionality. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object optimistic + struct object1 + { + object1 (unsigned long id = 0): id_ (id), version_ (0) {} + + #pragma db id + unsigned long id_; + + public: + unsigned long version () const {return version_;} + void version (unsigned long version) {version_ = version;} + private: + #pragma db version access(version) + unsigned long version_; + }; + + #pragma db object optimistic + struct object2 + { + object2 (): version_ (0) {} + + #pragma db id auto + unsigned long id_; + + public: + unsigned long version () const {return version_;} + unsigned long& version () {return version_;} + private: + #pragma db version access(version) + unsigned long version_; + }; + + #pragma db object optimistic + struct object3 + { + object3 (unsigned long id = 0): id_ (id), version_ (0) {} + + #pragma db id + unsigned long id_; + + #pragma db version + const unsigned long version_; + }; +} + +#endif // TEST_HXX diff --git a/common/access/test.std b/common/access/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index e1a5f13..9965095 100644 --- a/common/makefile +++ b/common/makefile @@ -5,6 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ +access \ auto \ blob \ callback \ diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx index d0a6ed5..9994fdd 100644 --- a/common/polymorphism/test.hxx +++ b/common/polymorphism/test.hxx @@ -984,7 +984,7 @@ namespace test11 }; } -// Test polymorphic classes with auto id. +// Test polymorphic classes with private auto id. // #pragma db namespace table("t12_") namespace test12 @@ -994,17 +994,20 @@ namespace test12 { virtual ~root () = 0; // Auto-abstract. - #pragma db id auto - unsigned long id; - virtual bool compare (const root& r, bool tc = true) const { if (tc && typeid (r) != typeid (root)) return false; - return id == r.id; + return id_ == r.id_; } + + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; }; inline root:: -- cgit v1.1 From 19a3dfd0bcb583e246f83a9c01f9218a8b41fd3c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 16 Aug 2012 12:23:25 +0200 Subject: Add support for automatically discovering accessor/modifier functions New options: --{accessor,modifier}-regex, --{accessor,modifier}-regex-trace. --- common/access/driver.cxx | 34 +++++++++++++- common/access/makefile | 3 +- common/access/test.hxx | 112 ++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 142 insertions(+), 7 deletions(-) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 3e3c96d..79c63bf 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -37,9 +37,10 @@ main (int argc, char* argv[]) o.i2 (223); o.i3 () = 323; o.i4 () = 423; - o.set_i5 (423); + o.set_i5 (523); o.s1 ("1bc"); memcpy (o.b1 (), "123456789012345", 16); + o.b2 ("123456789012345"); { transaction t (db->begin ()); @@ -219,6 +220,37 @@ main (int argc, char* argv[]) assert (o3.version_ == 2); } } + + // Test basic accessor/modifier functionality. + // + { + using namespace test7; + + object o (1); + o.i1 () = 123; + o.set_i2 (223); + o.setI3 (323); + o.seti4 (423); + o.i5 () = 523; + o.i6 () = 623; + o.SetI7 (723); + memcpy (o.b1 (), "123456789012345", 16); + o.b2 ("123456789012345"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (o == *p); + } + } } catch (const odb::exception& e) { diff --git a/common/access/makefile b/common/access/makefile index 674128d..3cf2953 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -35,7 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix access_ +--table-prefix access_ --accessor-regex "/(.+)/Get\u\1/" \ +--modifier-regex "/(.+)/Set\u\1/" $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/access/test.hxx b/common/access/test.hxx index 7964edb..8e1c209 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -63,21 +63,21 @@ namespace test1 #pragma db access(i2) int i2_; - // Prefer reference accessor to modifier. + // Prefer reference modifier. // public: int i3 () const {return i3_;} int& i3 () {return i3_;} + void i3 (int i3); private: - void i3 (int i3) {i3_ = i3;} #pragma db access(i3) int i3_; - // Prefer reference accessor to modifier (reverse function order). + // Prefer reference modifier (reverse function order). // - void i4 (int i4) {i4_ = i4;} public: int i4 () const {return i4_;} + void i4 (int i4); int& i4 () {return i4_;} private: #pragma db access(i4) @@ -110,8 +110,11 @@ namespace test1 public: const char* s1 () const {return s1_.c_str ();} void s1 (const char* s1) {s1_ = s1;} + //std::string s1 () const {return s1_;} + //void s1 (std::string s1) {s1_ = s1;} private: #pragma db get(s1) set(s1((?).c_str ())) + //#pragma db access(s1) std::string s1_; // Array member via ref. @@ -127,7 +130,7 @@ namespace test1 // public: const char* b2 () const {return b2_;} - void b2 (char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} + void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} private: #pragma db type(BINARY16_TYPE) access(b2) char b2_[16]; @@ -498,4 +501,103 @@ namespace test6 }; } +// Test automatic discovery of accessor/modifier functions. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + int i1_; + + public: + const int& get_i2 () const {return i2_;} + void set_i2 (int i2) {i2_ = i2;} + private: + int i2_; + + public: + const int& getI3 () const {return i3_;} + void setI3 (const int& i3) {i3_ = i3;} + private: + int i3_; + + public: + int geti4 () const {return i4;} + int seti4 (int v) {int r (i4); i4 = v; return r;} + private: + int i4; + + // Prefer reference modifier. + // + public: + int i5 () const {return i5_;} + int& i5 () {return i5_;} + void i5 (int i5); + private: + int i5_; + + // Prefer reference modifier (reverse function order). + // + public: + int i6 () const {return i6_;} + void i6 (int i6); + int& i6 () {return i6_;} + private: + int i6_; + + // Custom accessor/modifier regex. + // + public: + int GetI7 () const {return i7_;} + void SetI7 (int i7) {i7_ = i7;} + private: + int i7_; + + // Array member via ref. + // + public: + const char* b1 () const {return b1_;} + char* b1 () {return b1_;} + private: + #pragma db type(BINARY16_TYPE) + char b1_[16]; + + // Array member via modifier. + // + public: + const char* b2 () const {return b2_;} + void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} + private: + #pragma db type(BINARY16_TYPE) + char b2_[16]; + + public: + bool operator== (const object& o) const + { + return id_ == o.id_ && + i1_ == o.i1_ && + i2_ == o.i2_ && + i3_ == o.i3_ && + i4 == o.i4 && + i5_ == o.i5_ && + i6_ == o.i6_ && + i7_ == o.i7_ && + std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && + std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; + } + }; +} + #endif // TEST_HXX -- cgit v1.1 From c225be5dea36eaaa3df7f24d33a9644a9158b6a7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Aug 2012 10:03:46 +0200 Subject: Add support for virtual data members New test: common/virtual. --- common/makefile | 1 + common/virtual/driver.cxx | 128 ++++++++++++++++++++++++++++++++++++++++++ common/virtual/makefile | 113 +++++++++++++++++++++++++++++++++++++ common/virtual/test.hxx | 139 ++++++++++++++++++++++++++++++++++++++++++++++ common/virtual/test.std | 0 5 files changed, 381 insertions(+) create mode 100644 common/virtual/driver.cxx create mode 100644 common/virtual/makefile create mode 100644 common/virtual/test.hxx create mode 100644 common/virtual/test.std diff --git a/common/makefile b/common/makefile index 9965095..9356327 100644 --- a/common/makefile +++ b/common/makefile @@ -41,6 +41,7 @@ template \ transaction \ types \ view \ +virtual \ wrapper thread_tests := threads diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx new file mode 100644 index 0000000..05acfcb --- /dev/null +++ b/common/virtual/driver.cxx @@ -0,0 +1,128 @@ +// file : common/virtual/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test virtual data members. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test basic virtual data member functionality. + // + { + using namespace test1; + + object o; + o.i (123); + o.c1.i = 123; + o.c1.s = "abc"; + o.v1.push_back ("abc"); + o.v1.push_back ("abd"); + o.v1.push_back ("abe"); + o.p1 = new object; + + { + transaction t (db->begin ()); + db->persist (*o.p1); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id1.v)); + t.commit (); + + assert (o == *p); + } + } + + // Test pragma resolution to virtual data member. + // + { + using namespace test2; + + object1 o1 (1); + o1.o2 = new object2 (1); + o1.o2->o1 = &o1; + + { + transaction t (db->begin ()); + db->persist (*o1.o2); + o1.n1 = o1.o2->id; + db->persist (o1); + t.commit (); + } + + { + session s; + transaction t (db->begin ()); + auto_ptr p (db->load (o1.id)); + t.commit (); + + assert (p->o2->id == o1.o2->id); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::object2::id == o1.o2->id)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::o2::id == o1.o2->id)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/virtual/makefile b/common/virtual/makefile new file mode 100644 index 0000000..92ae1d6 --- /dev/null +++ b/common/virtual/makefile @@ -0,0 +1,113 @@ +# file : common/virtual/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --generate-session --table-prefix virtual_ +$(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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx new file mode 100644 index 0000000..3c0b0f1 --- /dev/null +++ b/common/virtual/test.hxx @@ -0,0 +1,139 @@ +// file : common/virtual/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Test basic virtual data member functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db value + struct comp + { + int i; + + #pragma db transient + std::string s; + #pragma db member(s_) virtual(std::string) access (s) + + bool operator== (const comp& v) const + { + return i == v.i && s == v.s; + } + }; + + #pragma db object transient + struct object + { + object (): p1 (0) {} + ~object () {delete p1;} + + struct {unsigned long v;} id1; + + #pragma db id + #pragma db member(id) get(id1.v) virtual(unsigned long) set(id1.v) + #pragma db member(id) auto + + int i () const {return i1;} + void i (int i) {i1 = i;} + int i1; + + comp c1; + #pragma db member(c) virtual(comp) access(c1) + + typedef std::vector strings; + strings v1; + #pragma db member(v) virtual(strings) access(v1) + + typedef object* object_ptr; + object_ptr p1; + #pragma db member(p) virtual(object_ptr) access(p1) + + bool operator== (const object& o) const + { + return id1.v == o.id1.v && + i1 == o.i1 && + c1 == o.c1 && + v1 == o.v1 && + (p1 != 0 ? o.p1 != 0 && *p1 == *o.p1 : o.p1 == 0); + } + }; + + #pragma db member(object::i) virtual(int) +} + +#pragma db member(test1::object::id) column("oid") + +// Test pragma resolution to virtual data member. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct object1; + struct object2; + + typedef object1* object1_ptr; + typedef object2* object2_ptr; + + #pragma db object + struct object2 + { + object2 (unsigned long i = 0): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) + object1_ptr o1; + }; + + #pragma db object + struct object1 + { + object1 (unsigned long i = 0): id (i), o2 (0) {} + ~object1 () {delete o2;} + + #pragma db id + unsigned long id; + + #pragma db transient + object2_ptr o2; + #pragma db member(o) virtual(object2_ptr) access(o2) + + #pragma db transient + unsigned long n1; + #pragma db member(n) virtual(unsigned long) access(n1) + #pragma db index member(n) + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + #pragma db column(object1::n) + unsigned long i; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::n == o2::id) + struct view2 + { + #pragma db column(o1::n) + unsigned long i; + }; + + #pragma db view object(object1: object1::n != 0) + struct view3 + { + #pragma db column(test2::object1::n) + unsigned long i; + }; +} + +#endif // TEST_HXX diff --git a/common/virtual/test.std b/common/virtual/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 3e6bb9e10626e192c5d56f806c3262c8ab489bad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Aug 2012 15:47:55 +0200 Subject: Test handling multi-member composite object id using virtual data member --- common/virtual/driver.cxx | 25 +++++++++++++++++++++++++ common/virtual/test.hxx | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index 05acfcb..1083cab 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -119,6 +119,31 @@ main (int argc, char* argv[]) t.commit (); } } + + // Use virtual data members to implement multi-member composite object id. + // + { + using namespace test3; + + person o; + o.first_ = "John"; + o.last_ = "Doe"; + + name id; + { + transaction t (db->begin ()); + id = db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + t.commit (); + + assert (o.first_ == p->first_ && o.last_ == p->last_); + } + } } catch (const odb::exception& e) { diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index 3c0b0f1..a6caf2c 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -22,7 +22,7 @@ namespace test1 #pragma db transient std::string s; - #pragma db member(s_) virtual(std::string) access (s) + #pragma db member(s_) virtual(std::string) access(s) bool operator== (const comp& v) const { @@ -136,4 +136,37 @@ namespace test2 }; } +// Use virtual data members to implement multi-member composite object id. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct name + { + name () {} + name (std::string const& f, std::string const& l) + : first (f), last(l) {} + + std::string first; + std::string last; + + bool operator< (const name& x) const + { + return first < x.first || (first == x.first && last < x.last); + } + }; + + #pragma db object transient + struct person + { + std::string first_; + std::string last_; + + #pragma db member(name) virtual(name) id \ + get(::test3::name (this.first_, this.last_)) \ + set(this.first_ = (?).first; this.last_ = (?).last) + }; +} + #endif // TEST_HXX -- cgit v1.1 From 92ebb8c861c4986e10d38d949a024aee205b14b2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2012 11:04:21 +0200 Subject: Add missing include and some cosmetic changes --- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/test.hxx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 2e04e03..8a6589f 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -2,7 +2,7 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test boost container persistence. +// Test Boost unordered containers persistence. // #include // std::auto_ptr diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 1477fe7..8bbf0a6 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include + #include #include -- cgit v1.1 From bb48c54f1080874f5a10907714f5fbae0b985ce9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Sep 2012 12:02:30 +0200 Subject: Add support for Boost Multi-Index container in Boost profile --- boost/common/makefile | 1 + boost/common/multi-index/driver.cxx | 190 ++++++++++++++++++++++++++++++++++++ boost/common/multi-index/makefile | 124 +++++++++++++++++++++++ boost/common/multi-index/test.hxx | 114 ++++++++++++++++++++++ boost/common/multi-index/test.std | 0 5 files changed, 429 insertions(+) create mode 100644 boost/common/multi-index/driver.cxx create mode 100644 boost/common/multi-index/makefile create mode 100644 boost/common/multi-index/test.hxx create mode 100644 boost/common/multi-index/test.std diff --git a/boost/common/makefile b/boost/common/makefile index 1c41fa8..59c4537 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -5,6 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ +multi-index \ optional \ smart-ptr \ template \ diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx new file mode 100644 index 0000000..f8a87f4 --- /dev/null +++ b/boost/common/multi-index/driver.cxx @@ -0,0 +1,190 @@ +// file : boost/common/multi-index/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Boost multi-index container persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + { + using namespace odb; + + assert (access::container_traits::kind == ck_ordered); + assert (access::container_traits::kind == ck_ordered); + assert (access::container_traits::kind == ck_set); + + assert (access::container_traits::kind == ck_ordered); + assert (access::container_traits::kind == ck_ordered); + assert (access::container_traits::kind == ck_set); + } + + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + // + // med + // + med.il.push_back (234); + med.il.push_back (123); + + med.iv.push_back (234); + med.iv.push_back (123); + + med.is.insert (234); + med.is.insert (123); + + med.ils.push_back (234); + med.ils.push_back (123); + + med.csv.insert (comp (234, "bcd")); + med.csv.insert (comp (123, "abc")); + + med.css.insert (comp (234, "bcd")); + med.css.insert (comp (123, "abc")); + + // + // full + // + full.il.push_back (2345); + full.il.push_back (1234); + full.il.push_back (3456); + + full.iv.push_back (2345); + full.iv.push_back (1234); + full.iv.push_back (3456); + + full.is.insert (2345); + full.is.insert (1234); + full.is.insert (3456); + + full.ils.push_back (2345); + full.ils.push_back (1234); + full.ils.push_back (3456); + + full.csv.insert (comp (234, "bcde")); + full.csv.insert (comp (123, "abcd")); + full.csv.insert (comp (234, "cdef")); + + full.css.insert (comp (234, "bcde")); + full.css.insert (comp (123, "abcd")); + full.css.insert (comp (234, "cdef")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // empty + // + empty.il.push_back (12); + empty.iv.push_back (12); + empty.is.insert (12); + empty.ils.push_back (12); + empty.csv.insert (comp (12, "ab")); + empty.css.insert (comp (12, "ab")); + + // med + // + med.il.clear (); + med.iv.clear (); + med.is.clear (); + med.ils.clear (); + med.csv.clear (); + med.css.clear (); + + // full + // + full.il.push_back (4567); + full.iv.push_back (4567); + full.is.insert (4567); + full.ils.push_back (4567); + full.csv.insert (comp (4567, "defg")); + full.css.insert (comp (4567, "defg")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile new file mode 100644 index 0000000..96f4b66 --- /dev/null +++ b/boost/common/multi-index/makefile @@ -0,0 +1,124 @@ +# file : boost/common/multi-index/makefile +# copyright : Copyright (c) 2009-2012 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) \ +--profile boost/multi-index --generate-schema \ +--table-prefix boost_multi_index_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/boost/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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx new file mode 100644 index 0000000..4018b61 --- /dev/null +++ b/boost/common/multi-index/test.hxx @@ -0,0 +1,114 @@ +// file : boost/common/multi-index/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include + +#include + +namespace mi = boost::multi_index; + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +typedef +mi::multi_index_container< + int, + mi::indexed_by > +> int_lst; + +typedef +mi::multi_index_container< + int, + mi::indexed_by > +> int_vec; + +typedef +mi::multi_index_container< + int, + mi::indexed_by > > +> int_set; + +typedef +mi::multi_index_container< + int, + mi::indexed_by< + mi::sequenced<>, + mi::ordered_unique > + > +> int_lst_set; + +typedef +mi::multi_index_container< + comp, + mi::indexed_by< + mi::ordered_unique >, + mi::random_access<> + > +> comp_set_vec; + +typedef +mi::multi_index_container< + comp, + mi::indexed_by< + mi::ordered_unique >, + mi::ordered_unique > + > +> comp_set_set; + +#pragma db object +struct object +{ + object () {} + object (const std::string& id): id (id) {} + + #pragma db id + std::string id; + + int_lst il; + int_lst iv; + int_set is; + + int_lst_set ils; + comp_set_vec csv; + comp_set_set css; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id == y.id && + + x.il == y.il && + x.iv == y.iv && + x.is == y.is && + + x.ils == y.ils && + x.csv == y.csv && + x.css == y.css; +} + +#endif // TEST_HXX diff --git a/boost/common/multi-index/test.std b/boost/common/multi-index/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From c77b0419f08708a205acab088b7c95c839b38cfc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Sep 2012 11:22:07 +0200 Subject: NULL handling improvements Add support for specifying NULL-ness for types with built-in mapping. Handle Oracle [N]VARCHAR2 and SQLite FLOAT oddities using this mechanism instead of overriding it at the schema generation level. Also use the is_null argument that is passed to value_traits::init_image() to indicate whether the value can be NULL. --- oracle/types/driver.cxx | 2 ++ oracle/types/test.hxx | 8 ++++++++ sqlite/types/test.hxx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index b1ca3ad..554c506 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -63,6 +63,8 @@ main (int argc, char* argv[]) o.nvarchar2_ = medium_str; o.nclob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + o.empty_c_.push_back (""); + o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index f745a1e..0543598 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -175,6 +175,12 @@ struct object #pragma db type ("NVARCHAR2(512)") std::string nvarchar2_; + // Oracle treats empty and NULL VARCHAR2 the same. Test that we + // handle this. + // + std::string empty_; + std::vector empty_c_; + #pragma db type ("RAW(1024)") std::vector raw_; @@ -222,6 +228,8 @@ struct object varchar2_ == y.varchar2_ && nchar_ == y.nchar_ && nvarchar2_ == y.nvarchar2_ && + empty_ == y.empty_ && + empty_c_ == y.empty_c_ && raw_ == y.raw_ && blob_ == y.blob_ && clob_ == y.clob_ && diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 7ed1a8c..897590d 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -38,7 +38,7 @@ struct object #pragma db type("REAL") double real_; - #pragma db type("REAL") null + #pragma db type("REAL") double nan_; #pragma db type("TEXT") -- cgit v1.1 From 5a16b0511ae3ac491ac23bba07f7259f6c255472 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Sep 2012 11:59:28 +0200 Subject: Support for Boost uuid persistence New Boost sub-profile: uuid. New test: boost/common/uuid. Updated the boost example to use uuid as an object id. --- boost/common/makefile | 3 +- boost/common/uuid/driver.cxx | 70 ++++++++++++++++++++++++ boost/common/uuid/makefile | 124 +++++++++++++++++++++++++++++++++++++++++++ boost/common/uuid/test.hxx | 38 +++++++++++++ boost/common/uuid/test.std | 0 5 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 boost/common/uuid/driver.cxx create mode 100644 boost/common/uuid/makefile create mode 100644 boost/common/uuid/test.hxx create mode 100644 boost/common/uuid/test.std diff --git a/boost/common/makefile b/boost/common/makefile index 59c4537..1aecce0 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -9,7 +9,8 @@ multi-index \ optional \ smart-ptr \ template \ -unordered +unordered \ +uuid all_tests := $(tests) build_tests := $(tests) diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx new file mode 100644 index 0000000..952890f --- /dev/null +++ b/boost/common/uuid/driver.cxx @@ -0,0 +1,70 @@ +// file : boost/common/uuid/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Boost UUID persistence. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace boost::uuids; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.uuid_ = random_generator() (); + o.null_ = nil_uuid (); + o.zero_ = nil_uuid (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::uuid == o.uuid_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->id_ == o.id_); + assert (++i == r.end ()); + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile new file mode 100644 index 0000000..e39df77 --- /dev/null +++ b/boost/common/uuid/makefile @@ -0,0 +1,124 @@ +# file : boost/common/uuid/makefile +# copyright : Copyright (c) 2009-2012 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) + +$(call import,\ + $(scf_root)/import/libodb-boost/stub.make,\ + l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libboost/header-only/stub.make,\ + cpp-options: boost.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.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) \ +--profile boost/uuid --generate-schema --generate-query \ +--table-prefix boost_uuid_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ +$(boost.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/boost/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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx new file mode 100644 index 0000000..d0138e4 --- /dev/null +++ b/boost/common/uuid/test.hxx @@ -0,0 +1,38 @@ +// file : boost/common/uuid/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + typedef boost::uuids::uuid uuid; + + uuid uuid_; + uuid null_; + + #pragma db not_null + uuid zero_; + + bool operator== (const object& x) const + { + return id_ == x.id_ && + uuid_ == x.uuid_ && + null_ == x.null_ && + zero_ == x.zero_; + } +}; + +#endif // TEST_HXX diff --git a/boost/common/uuid/test.std b/boost/common/uuid/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 0e6587f29f40a841f0e393887fea4e5cf385e0e6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Sep 2012 14:58:55 +0200 Subject: Support for Qt QUuid persistence This support was added to the basic sub-profile. New test: qt/common/basic. Updated the qt example to use QUuid as an object id. --- qt/common/basic/driver.cxx | 67 ++++++++++++++++++++++++ qt/common/basic/makefile | 124 +++++++++++++++++++++++++++++++++++++++++++++ qt/common/basic/test.hxx | 36 +++++++++++++ qt/common/basic/test.std | 0 qt/common/makefile | 1 + 5 files changed, 228 insertions(+) create mode 100644 qt/common/basic/driver.cxx create mode 100644 qt/common/basic/makefile create mode 100644 qt/common/basic/test.hxx create mode 100644 qt/common/basic/test.std diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx new file mode 100644 index 0000000..5a31674 --- /dev/null +++ b/qt/common/basic/driver.cxx @@ -0,0 +1,67 @@ +// file : qt/common/basic/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence (common part). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.uuid_ = QUuid::createUuid (); + o.null_ = QUuid (); + o.zero_ = QUuid (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::uuid == o.uuid_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->id_ == o.id_); + assert (++i == r.end ()); + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile new file mode 100644 index 0000000..6ede2c6 --- /dev/null +++ b/qt/common/basic/makefile @@ -0,0 +1,124 @@ +# file : qt/common/basic/makefile +# copyright : Copyright (c) 2009-2012 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt_core.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/basic --generate-schema --generate-query \ +--table-prefix qt_basic_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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 schema) + $(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,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx new file mode 100644 index 0000000..6fee19a --- /dev/null +++ b/qt/common/basic/test.hxx @@ -0,0 +1,36 @@ +// file : qt/common/basic/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + QUuid uuid_; + QUuid null_; + + #pragma db not_null + QUuid zero_; + + bool operator== (const object& x) const + { + return id_ == x.id_ && + uuid_ == x.uuid_ && + null_ == x.null_ && + zero_ == x.zero_; + } +}; + +#endif // TEST_HXX diff --git a/qt/common/basic/test.std b/qt/common/basic/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/common/makefile b/qt/common/makefile index 584267e..1ac4f7e 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -5,6 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make tests := \ +basic \ containers \ smart-ptr \ template -- cgit v1.1 From 16f2e990acb2463a96611b25effb411ecca2b76c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Sep 2012 09:42:55 +0200 Subject: Split polymorphism test.hxx to multiple files --- common/circular/multiple/makefile | 2 +- common/polymorphism/driver.cxx | 27 +- common/polymorphism/makefile | 9 +- common/polymorphism/test.hxx | 1055 ------------------------------------- common/polymorphism/test1.hxx | 116 ++++ common/polymorphism/test10.hxx | 79 +++ common/polymorphism/test11.hxx | 79 +++ common/polymorphism/test12.hxx | 80 +++ common/polymorphism/test2.hxx | 106 ++++ common/polymorphism/test3.hxx | 147 ++++++ common/polymorphism/test4.hxx | 76 +++ common/polymorphism/test5.hxx | 93 ++++ common/polymorphism/test6.hxx | 65 +++ common/polymorphism/test7.hxx | 67 +++ common/polymorphism/test8.hxx | 130 +++++ common/polymorphism/test9.hxx | 162 ++++++ 16 files changed, 1232 insertions(+), 1061 deletions(-) delete mode 100644 common/polymorphism/test.hxx create mode 100644 common/polymorphism/test1.hxx create mode 100644 common/polymorphism/test10.hxx create mode 100644 common/polymorphism/test11.hxx create mode 100644 common/polymorphism/test12.hxx create mode 100644 common/polymorphism/test2.hxx create mode 100644 common/polymorphism/test3.hxx create mode 100644 common/polymorphism/test4.hxx create mode 100644 common/polymorphism/test5.hxx create mode 100644 common/polymorphism/test6.hxx create mode 100644 common/polymorphism/test7.hxx create mode 100644 common/polymorphism/test8.hxx create mode 100644 common/polymorphism/test9.hxx diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index abd72e7..bce0f5b 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -41,7 +41,7 @@ $(gen): $(common.l.cpp-options) # Extra dependecy for the ODB-generated code. # -$(gen): $(src_base)/test1.hxx $(src_base)/test2.hxx +$(gen): $(addprefix $(src_base)/,$(odb_hdr)) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx index 09e3321..6093178 100644 --- a/common/polymorphism/driver.cxx +++ b/common/polymorphism/driver.cxx @@ -15,8 +15,31 @@ #include -#include "test.hxx" -#include "test-odb.hxx" +#include "test1.hxx" +#include "test2.hxx" +#include "test3.hxx" +#include "test4.hxx" +#include "test5.hxx" +#include "test6.hxx" +#include "test7.hxx" +#include "test8.hxx" +#include "test9.hxx" +#include "test10.hxx" +#include "test11.hxx" +#include "test12.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" +#include "test4-odb.hxx" +#include "test5-odb.hxx" +#include "test6-odb.hxx" +#include "test7-odb.hxx" +#include "test8-odb.hxx" +#include "test9-odb.hxx" +#include "test10-odb.hxx" +#include "test11-odb.hxx" +#include "test12-odb.hxx" using namespace std; using namespace odb::core; diff --git a/common/polymorphism/makefile b/common/polymorphism/makefile index 9b4385e..36d48ea 100644 --- a/common/polymorphism/makefile +++ b/common/polymorphism/makefile @@ -5,7 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ +test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,7 +30,7 @@ $(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) +genf := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) @@ -54,6 +55,7 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) +$(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(dist): @@ -64,8 +66,9 @@ $(dist): # Test. # +$(test): schemas := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.sql)) $(test): $(driver) $(src_base)/test.std - $(call schema) + $(call schema,$(schemas)) $(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) diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx deleted file mode 100644 index 9994fdd..0000000 --- a/common/polymorphism/test.hxx +++ /dev/null @@ -1,1055 +0,0 @@ -// file : common/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#include -#include -#include - -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - -#include -#include -#include - -// Test basic polymorphism functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // Views. - // - #pragma db view object(root) - struct root_view - { - //#pragma db column(root::typeid_) - std::string typeid_; // @@ tmp - - unsigned long num; - }; - - #pragma db view object(base = b) - struct base_view - { - unsigned long id; - unsigned long num; - std::string str; - }; - - #pragma db view object(derived) - struct derived_view - { - unsigned long num; - std::string str; - unsigned long dnum; - std::string dstr; - }; -} - -// Test inverse object pointers in polymorhic bases. -// -#pragma db namespace table("t2_") -namespace test2 -{ - struct root; - - #pragma db object - struct root_pointer - { - root_pointer (root* r = 0): p (r) {} - - #pragma db id auto - unsigned long id; - - root* p; - }; - - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(p) - odb::lazy_ptr rp; - }; - - struct base; - - #pragma db object - struct base_pointer - { - base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} - - #pragma db id auto - unsigned long id; - - std::vector vp; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, const std::string& s): root (i), str (s) {} - - std::string str; - - #pragma db inverse(vp) - odb::lazy_ptr bp; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, const std::string& s, unsigned long n) - : base (i, s), num (n) {} - - unsigned long num; - }; - - // Views. - // - #pragma db view object(root_pointer = rp) object(root) - struct root_view - { - #pragma db column(rp::id) - unsigned long rp_id; - - #pragma db column(root::id) - unsigned long r_id; - }; - - #pragma db view object(base_pointer) object(base = b) - struct base_view - { - #pragma db column(base_pointer::id) - unsigned long bp_id; - - #pragma db column(b::id) - unsigned long b_id; - - std::string str; - }; -} - -// Test delayed loading. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - virtual ~base () {delete rptr;} - base (): rptr (0) {} - base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} - - unsigned long num; - root* rptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return - root::compare (r, false) && - num == b.num && - ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); - } - }; - - #pragma db object - struct derived: base - { - virtual ~derived () {delete bptr;} - derived (): bptr (0) {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n), str (s), bptr (0) {} - - std::string str; - base* bptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return - base::compare (r, false) && - str == d.str && - ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); - } - }; - - // Views. - // - #pragma db view object(base) object(root = r) - struct base_view - { - #pragma db column(base::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - unsigned long num; - }; - - #pragma db view \ - object(derived = d) \ - object(base = b) \ - object(root = r: d::rptr) - struct derived_view - { - #pragma db column(d::id) - unsigned long d_id; - - #pragma db column(b::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::num) - unsigned long d_num; - - #pragma db column(b::num) - unsigned long b_num; - - std::string str; - }; - - // This is an example of a pathological case, where the right-hand-side - // of the join condition comes from one of the bases. As a result, we - // join the base table first, which means we will get both bases and - // derived objects instead of just derived. - // - //#pragma db view object(root = r) object(derived = d) - #pragma db view object(derived = d) object(root = r) - struct root_view - { - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::id) - unsigned long d_id; - - std::string str; - }; -} - -// Test views. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object polymorphic - struct root1 - { - virtual ~root1 () {} - root1 () {} - root1 (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - }; - - #pragma db object - struct base1: root1 - { - base1 () {} - base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} - - unsigned long num; - }; - - #pragma db object polymorphic - struct root2 - { - virtual ~root2 () {} - root2 () {} - root2 (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base2: root2 - { - base2 () {} - base2 (unsigned long i, unsigned long n, const std::string& s) - : root2 (i, n), str (s) {} - - std::string str; - }; - - // Test custom join condition. - // - #pragma db view object(base2) object(base1: base2::num == base1::num) - struct view1 - { - std::string str; - }; - - #pragma db view object(base2) - struct view2 - { - #pragma db column("min(" + base2::num + ")") - std::size_t min_num; - }; -} - -// Test polymorphism and optimistic concurrency. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object polymorphic optimistic pointer(std::auto_ptr) - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - #pragma db version - unsigned long version; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && version == r.version && - num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -// Test polymorphism and callbacks. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object polymorphic pointer(std::auto_ptr) - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object callback(db_callback) - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - - void - db_callback (odb::callback_event, odb::database&); - - void - db_callback (odb::callback_event, odb::database&) const; - }; - - #pragma db object callback(db_callback) - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - std::auto_ptr ptr; - - void - db_callback (odb::callback_event, odb::database&) const; - }; -} - -// Test polymorphism and object cache (session). -// -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -#pragma db namespace table("t7_") -namespace test7 -{ -#ifdef HAVE_CXX11 - using std::shared_ptr; -#else - using std::tr1::shared_ptr; -#endif - - #pragma db object polymorphic pointer(shared_ptr) session - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - }; -} -#endif - -// Test polymorphism and abstract bases. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object abstract - struct interm: base - { - interm () {} - interm (unsigned long i, unsigned long n, const std::string& s, bool b) - : base (i, n, s), bln (b) {} - - bool bln; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (interm)) - return false; - - const interm& i (static_cast (r)); - return base::compare (r, false) && bln == i.bln; - } - }; - - #pragma db object - struct derived1: interm - { - derived1 () {} - derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dnum (n + 1) {} - - unsigned long dnum; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived1)) - return false; - - const derived1& d (static_cast (r)); - return interm::compare (r, false) && dnum == d.dnum; - } - }; - - #pragma db object - struct derived2: interm - { - derived2 () {} - derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dstr (s + 'd') {} - - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived2)) - return false; - - const derived2& d (static_cast (r)); - return interm::compare (r, false) && dstr == d.dstr; - } - }; -} - -// Test polymorphism and readonly classes. -// -#pragma db namespace table("t9_") -namespace test9 -{ - // - // ro_root, rw_base, ro_derived - // - #pragma db object polymorphic readonly - struct ro_root - { - virtual ~ro_root () {} - ro_root () {} - ro_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} - - #pragma db object - struct rw_base: ro_root - { - rw_base () {} - rw_base (unsigned long i, unsigned long n, const std::string& s) - : ro_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_base)) - return false; - - const rw_base& b (static_cast (r)); - return ro_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object readonly - struct ro_derived: rw_base - { - ro_derived () {} - ro_derived (unsigned long i, unsigned long n, const std::string& s) - : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_derived)) - return false; - - const ro_derived& d (static_cast (r)); - return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // - // rw_root, ro_base, rw_derived - // - #pragma db object polymorphic - struct rw_root - { - virtual ~rw_root () {} - rw_root () {} - rw_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} - - #pragma db object readonly - struct ro_base: rw_root - { - ro_base () {} - ro_base (unsigned long i, unsigned long n, const std::string& s) - : rw_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_base)) - return false; - - const ro_base& b (static_cast (r)); - return rw_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct rw_derived: ro_base - { - rw_derived () {} - rw_derived (unsigned long i, unsigned long n, const std::string& s) - : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_derived)) - return false; - - const rw_derived& d (static_cast (r)); - return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -// Test empty polymorphic classes. -// -#pragma db namespace table("t10_") -namespace test10 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n): root (i), num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n): base (i, n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -// Test mixing reuse and polymorphic inheritance. -// -#pragma db namespace table("t11_") -namespace test11 -{ - #pragma db object abstract - struct root - { - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - }; - - #pragma db object polymorphic - struct base: root - { - virtual ~base () {} - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (base)) - return false; - - return id == b.id && num == b.num && strs == b.strs && - str == b.str && nums == b.nums; - } - }; - - inline bool - operator== (const base& x, const base& y) {return x.compare (y);} - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (derived)) - return false; - - const derived& d (static_cast (b)); - return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -// Test polymorphic classes with private auto id. -// -#pragma db namespace table("t12_") -namespace test12 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id_ == r.id_; - } - - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id auto access(id) - unsigned long id_; - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long n): num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long n): base (n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -#endif // TEST_HXX diff --git a/common/polymorphism/test1.hxx b/common/polymorphism/test1.hxx new file mode 100644 index 0000000..e6db3f4 --- /dev/null +++ b/common/polymorphism/test1.hxx @@ -0,0 +1,116 @@ +// file : common/polymorphism/test1.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include +#include +#include + +#include + +// Test basic polymorphism functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // Views. + // + #pragma db view object(root) + struct root_view + { + //#pragma db column(root::typeid_) + std::string typeid_; // @@ tmp + + unsigned long num; + }; + + #pragma db view object(base = b) + struct base_view + { + unsigned long id; + unsigned long num; + std::string str; + }; + + #pragma db view object(derived) + struct derived_view + { + unsigned long num; + std::string str; + unsigned long dnum; + std::string dstr; + }; +} + +#endif // TEST1_HXX diff --git a/common/polymorphism/test10.hxx b/common/polymorphism/test10.hxx new file mode 100644 index 0000000..be7d3c0 --- /dev/null +++ b/common/polymorphism/test10.hxx @@ -0,0 +1,79 @@ +// file : common/polymorphism/test10.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST10_HXX +#define TEST10_HXX + +#include + +#include + +// Test empty polymorphic classes. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n): root (i), num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n): base (i, n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST10_HXX diff --git a/common/polymorphism/test11.hxx b/common/polymorphism/test11.hxx new file mode 100644 index 0000000..58a4ff4 --- /dev/null +++ b/common/polymorphism/test11.hxx @@ -0,0 +1,79 @@ +// file : common/polymorphism/test11.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST11_HXX +#define TEST11_HXX + +#include +#include +#include + +#include + +// Test mixing reuse and polymorphic inheritance. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db object abstract + struct root + { + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + }; + + #pragma db object polymorphic + struct base: root + { + virtual ~base () {} + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (base)) + return false; + + return id == b.id && num == b.num && strs == b.strs && + str == b.str && nums == b.nums; + } + }; + + inline bool + operator== (const base& x, const base& y) {return x.compare (y);} + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (derived)) + return false; + + const derived& d (static_cast (b)); + return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST11_HXX diff --git a/common/polymorphism/test12.hxx b/common/polymorphism/test12.hxx new file mode 100644 index 0000000..5feb2bb --- /dev/null +++ b/common/polymorphism/test12.hxx @@ -0,0 +1,80 @@ +// file : common/polymorphism/test12.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST12_HXX +#define TEST12_HXX + +#include + +#include + +// Test polymorphic classes with private auto id. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id_ == r.id_; + } + + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long n): num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long n): base (n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST12_HXX diff --git a/common/polymorphism/test2.hxx b/common/polymorphism/test2.hxx new file mode 100644 index 0000000..1b81f41 --- /dev/null +++ b/common/polymorphism/test2.hxx @@ -0,0 +1,106 @@ +// file : common/polymorphism/test2.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include +#include + +#include +#include + +// Test inverse object pointers in polymorhic bases. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct root; + + #pragma db object + struct root_pointer + { + root_pointer (root* r = 0): p (r) {} + + #pragma db id auto + unsigned long id; + + root* p; + }; + + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(p) + odb::lazy_ptr rp; + }; + + struct base; + + #pragma db object + struct base_pointer + { + base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} + + #pragma db id auto + unsigned long id; + + std::vector vp; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, const std::string& s): root (i), str (s) {} + + std::string str; + + #pragma db inverse(vp) + odb::lazy_ptr bp; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, const std::string& s, unsigned long n) + : base (i, s), num (n) {} + + unsigned long num; + }; + + // Views. + // + #pragma db view object(root_pointer = rp) object(root) + struct root_view + { + #pragma db column(rp::id) + unsigned long rp_id; + + #pragma db column(root::id) + unsigned long r_id; + }; + + #pragma db view object(base_pointer) object(base = b) + struct base_view + { + #pragma db column(base_pointer::id) + unsigned long bp_id; + + #pragma db column(b::id) + unsigned long b_id; + + std::string str; + }; +} + +#endif // TEST2_HXX diff --git a/common/polymorphism/test3.hxx b/common/polymorphism/test3.hxx new file mode 100644 index 0000000..9a9a269 --- /dev/null +++ b/common/polymorphism/test3.hxx @@ -0,0 +1,147 @@ +// file : common/polymorphism/test3.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#include +#include + +#include + +// Test delayed loading. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + virtual ~base () {delete rptr;} + base (): rptr (0) {} + base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} + + unsigned long num; + root* rptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return + root::compare (r, false) && + num == b.num && + ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); + } + }; + + #pragma db object + struct derived: base + { + virtual ~derived () {delete bptr;} + derived (): bptr (0) {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n), str (s), bptr (0) {} + + std::string str; + base* bptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return + base::compare (r, false) && + str == d.str && + ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); + } + }; + + // Views. + // + #pragma db view object(base) object(root = r) + struct base_view + { + #pragma db column(base::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + unsigned long num; + }; + + #pragma db view \ + object(derived = d) \ + object(base = b) \ + object(root = r: d::rptr) + struct derived_view + { + #pragma db column(d::id) + unsigned long d_id; + + #pragma db column(b::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::num) + unsigned long d_num; + + #pragma db column(b::num) + unsigned long b_num; + + std::string str; + }; + + // This is an example of a pathological case, where the right-hand-side + // of the join condition comes from one of the bases. As a result, we + // join the base table first, which means we will get both bases and + // derived objects instead of just derived. + // + //#pragma db view object(root = r) object(derived = d) + #pragma db view object(derived = d) object(root = r) + struct root_view + { + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::id) + unsigned long d_id; + + std::string str; + }; +} + +#endif // TEST3_HXX diff --git a/common/polymorphism/test4.hxx b/common/polymorphism/test4.hxx new file mode 100644 index 0000000..d9eba86 --- /dev/null +++ b/common/polymorphism/test4.hxx @@ -0,0 +1,76 @@ +// file : common/polymorphism/test4.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST4_HXX +#define TEST4_HXX + +#include + +#include + +// Test views. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic + struct root1 + { + virtual ~root1 () {} + root1 () {} + root1 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + }; + + #pragma db object + struct base1: root1 + { + base1 () {} + base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} + + unsigned long num; + }; + + #pragma db object polymorphic + struct root2 + { + virtual ~root2 () {} + root2 () {} + root2 (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base2: root2 + { + base2 () {} + base2 (unsigned long i, unsigned long n, const std::string& s) + : root2 (i, n), str (s) {} + + std::string str; + }; + + // Test custom join condition. + // + #pragma db view object(base2) object(base1: base2::num == base1::num) + struct view1 + { + std::string str; + }; + + #pragma db view object(base2) + struct view2 + { + #pragma db column("min(" + base2::num + ")") + std::size_t min_num; + }; +} + +#endif // TEST4_HXX diff --git a/common/polymorphism/test5.hxx b/common/polymorphism/test5.hxx new file mode 100644 index 0000000..ede75a0 --- /dev/null +++ b/common/polymorphism/test5.hxx @@ -0,0 +1,93 @@ +// file : common/polymorphism/test5.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST5_HXX +#define TEST5_HXX + +#include +#include +#include +#include + +#include + +// Test polymorphism and optimistic concurrency. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + #pragma db version + unsigned long version; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && version == r.version && + num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST5_HXX diff --git a/common/polymorphism/test6.hxx b/common/polymorphism/test6.hxx new file mode 100644 index 0000000..9ecef40 --- /dev/null +++ b/common/polymorphism/test6.hxx @@ -0,0 +1,65 @@ +// file : common/polymorphism/test6.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST6_HXX +#define TEST6_HXX + +#include +#include + +#include +#include + +// Test polymorphism and callbacks. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object callback(db_callback) + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; + }; + + #pragma db object callback(db_callback) + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + std::auto_ptr ptr; + + void + db_callback (odb::callback_event, odb::database&) const; + }; +} + +#endif // TEST6_HXX diff --git a/common/polymorphism/test7.hxx b/common/polymorphism/test7.hxx new file mode 100644 index 0000000..1d3a807 --- /dev/null +++ b/common/polymorphism/test7.hxx @@ -0,0 +1,67 @@ +// file : common/polymorphism/test7.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +#include + +// Test polymorphism and object cache (session). +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) +#pragma db namespace table("t7_") +namespace test7 +{ +#ifdef HAVE_CXX11 + using std::shared_ptr; +#else + using std::tr1::shared_ptr; +#endif + + #pragma db object polymorphic pointer(shared_ptr) session + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + }; +} +#endif + +#endif // TEST7_HXX diff --git a/common/polymorphism/test8.hxx b/common/polymorphism/test8.hxx new file mode 100644 index 0000000..adaafc2 --- /dev/null +++ b/common/polymorphism/test8.hxx @@ -0,0 +1,130 @@ +// file : common/polymorphism/test8.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST8_HXX +#define TEST8_HXX + +#include +#include +#include + +#include + +// Test polymorphism and abstract bases. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object abstract + struct interm: base + { + interm () {} + interm (unsigned long i, unsigned long n, const std::string& s, bool b) + : base (i, n, s), bln (b) {} + + bool bln; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (interm)) + return false; + + const interm& i (static_cast (r)); + return base::compare (r, false) && bln == i.bln; + } + }; + + #pragma db object + struct derived1: interm + { + derived1 () {} + derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dnum (n + 1) {} + + unsigned long dnum; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived1)) + return false; + + const derived1& d (static_cast (r)); + return interm::compare (r, false) && dnum == d.dnum; + } + }; + + #pragma db object + struct derived2: interm + { + derived2 () {} + derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dstr (s + 'd') {} + + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived2)) + return false; + + const derived2& d (static_cast (r)); + return interm::compare (r, false) && dstr == d.dstr; + } + }; +} + +#endif // TEST8_HXX diff --git a/common/polymorphism/test9.hxx b/common/polymorphism/test9.hxx new file mode 100644 index 0000000..d1496c1 --- /dev/null +++ b/common/polymorphism/test9.hxx @@ -0,0 +1,162 @@ +// file : common/polymorphism/test9.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST9_HXX +#define TEST9_HXX + +#include +#include +#include + +#include + +// Test polymorphism and readonly classes. +// +#pragma db namespace table("t9_") +namespace test9 +{ + // + // ro_root, rw_base, ro_derived + // + #pragma db object polymorphic readonly + struct ro_root + { + virtual ~ro_root () {} + ro_root () {} + ro_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} + + #pragma db object + struct rw_base: ro_root + { + rw_base () {} + rw_base (unsigned long i, unsigned long n, const std::string& s) + : ro_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_base)) + return false; + + const rw_base& b (static_cast (r)); + return ro_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object readonly + struct ro_derived: rw_base + { + ro_derived () {} + ro_derived (unsigned long i, unsigned long n, const std::string& s) + : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_derived)) + return false; + + const ro_derived& d (static_cast (r)); + return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // + // rw_root, ro_base, rw_derived + // + #pragma db object polymorphic + struct rw_root + { + virtual ~rw_root () {} + rw_root () {} + rw_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} + + #pragma db object readonly + struct ro_base: rw_root + { + ro_base () {} + ro_base (unsigned long i, unsigned long n, const std::string& s) + : rw_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_base)) + return false; + + const ro_base& b (static_cast (r)); + return rw_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct rw_derived: ro_base + { + rw_derived () {} + rw_derived (unsigned long i, unsigned long n, const std::string& s) + : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_derived)) + return false; + + const rw_derived& d (static_cast (r)); + return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST9_HXX -- cgit v1.1 From 13df9a4acf3b1a411f66274bd3ed2cb633dc1e7b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Sep 2012 11:26:24 +0200 Subject: Test that database constructors are unambiguous --- mssql/database/driver.cxx | 51 ++++++++++++++++++++++++++++ mssql/database/makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++ mssql/database/test.std | 0 mssql/makefile | 1 + mysql/database/driver.cxx | 69 +++++++++++++++++++++++++++++++++++++ mysql/database/makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++ mysql/database/test.std | 0 mysql/makefile | 1 + oracle/database/driver.cxx | 33 ++++++++++++++++++ oracle/database/makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++ oracle/database/test.std | 0 oracle/makefile | 1 + pgsql/database/driver.cxx | 41 ++++++++++++++++++++++ pgsql/database/makefile | 80 +++++++++++++++++++++++++++++++++++++++++++ pgsql/database/test.std | 0 pgsql/makefile | 1 + sqlite/database/driver.cxx | 28 ++++++++++++++++ sqlite/database/makefile | 84 ++++++++++++++++++++++++++++++++++++++++++++++ sqlite/database/test.std | 0 sqlite/makefile | 1 + 20 files changed, 643 insertions(+) create mode 100644 mssql/database/driver.cxx create mode 100644 mssql/database/makefile create mode 100644 mssql/database/test.std create mode 100644 mysql/database/driver.cxx create mode 100644 mysql/database/makefile create mode 100644 mysql/database/test.std create mode 100644 oracle/database/driver.cxx create mode 100644 oracle/database/makefile create mode 100644 oracle/database/test.std create mode 100644 pgsql/database/driver.cxx create mode 100644 pgsql/database/makefile create mode 100644 pgsql/database/test.std create mode 100644 sqlite/database/driver.cxx create mode 100644 sqlite/database/makefile create mode 100644 sqlite/database/test.std diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx new file mode 100644 index 0000000..4e6a33c --- /dev/null +++ b/mssql/database/driver.cxx @@ -0,0 +1,51 @@ +// file : mssql/database/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +using namespace odb::mssql; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("bob", "secret", "db1", "server1"); + database d2 ("bob", "secret", "db1", "server1", "driver1"); + database d3 ("bob", "secret", "db1", "server1", "driver1", "extra"); + } + + { + database d1 ("bob", "secret", "db1", protocol_auto); + database d2 ("bob", "secret", "db1", protocol_auto, "server1"); + database d3 ("bob", "secret", "db1", protocol_auto, "server1", "inst1"); + database d4 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1"); + database d5 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1", "extra"); + } + + { + database d1 ("bob", "secret", "db1", "server1", 0); + database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); + database d3 ("bob", "secret", "db1", "server1", 0, "driver1", "extra"); + } + + { + database d1 ("conn1"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "extra"); + } +} diff --git a/mssql/database/makefile b/mssql/database/makefile new file mode 100644 index 0000000..f29495b --- /dev/null +++ b/mssql/database/makefile @@ -0,0 +1,84 @@ +# file : mssql/database/makefile +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +driver := $(out_base)/driver +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/database/test.std b/mssql/database/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mssql/makefile b/mssql/makefile index 2c62cc6..ac6b7c8 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +database \ native \ query \ types diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx new file mode 100644 index 0000000..e9b625d --- /dev/null +++ b/mysql/database/driver.cxx @@ -0,0 +1,69 @@ +// file : mysql/database/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +#include + +using std::string; +using namespace odb::mysql; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 (0, 0, 0); + database d2 ("bob", "secret", "db1"); + database d3 ("bob", "secret", "db1", "server1"); + database d4 ("bob", "secret", "db1", "server1", 999); + database d5 ("bob", "secret", "db1", "server1", 999, "sock1"); + database d6 ("bob", "secret", "db1", "server1", 999, "sock1", "charset1"); + } + + std::string u ("bob"), p ("secret"), db ("bd1"), h ("server1"), + s ("sock1"), cs ("charset1"); + + { + database d1 (u, p, db); + database d2 (u, p, db, h); + database d3 (u, p, db, h, 999); + database d4 (u, p, db, h, 999, &s); + database d5 (u, p, db, h, 999, &s, cs); + } + + { + database d1 (u, 0, db); + database d2 (u, &p, db); + database d3 (u, &p, db, h); + database d4 (u, &p, db, h, 999); + database d5 (u, &p, db, h, 999, &s); + database d6 (u, &p, db, h, 999, &s, cs); + } + + { + database d1 (u, p, db, h, 999, "socket1"); + database d2 (u, p, db, h, 999, s); + database d3 (u, p, db, h, 999, s, cs); + } + + { + database d1 (u, 0, db, h, 999, s); + database d2 (u, &p, db, h, 999, "socket1"); + database d3 (u, &p, db, h, 999, s, cs); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "charset1"); + } +} diff --git a/mysql/database/makefile b/mysql/database/makefile new file mode 100644 index 0000000..486da1b --- /dev/null +++ b/mysql/database/makefile @@ -0,0 +1,84 @@ +# file : mysql/database/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/database/test.std b/mysql/database/test.std new file mode 100644 index 0000000..e69de29 diff --git a/mysql/makefile b/mysql/makefile index ccd0087..dfbb5da 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +database \ index \ native \ truncation \ diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx new file mode 100644 index 0000000..d6846b6 --- /dev/null +++ b/oracle/database/driver.cxx @@ -0,0 +1,33 @@ +// file : oracle/database/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +using namespace odb::oracle; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("bob", "secret", "db1"); + } + + { + database d1 ("bob", "secret", "svc1", "server1"); + database d2 ("bob", "secret", "svc1", "server1", 999); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + } +} diff --git a/oracle/database/makefile b/oracle/database/makefile new file mode 100644 index 0000000..8fdb82a --- /dev/null +++ b/oracle/database/makefile @@ -0,0 +1,84 @@ +# file : oracle/database/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/database/test.std b/oracle/database/test.std new file mode 100644 index 0000000..e69de29 diff --git a/oracle/makefile b/oracle/makefile index 0ed2e3c..0fb30fc 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +database \ native \ types diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx new file mode 100644 index 0000000..8746c37 --- /dev/null +++ b/pgsql/database/driver.cxx @@ -0,0 +1,41 @@ +// file : pgsql/database/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +using namespace odb::pgsql; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("bob", "secret", "db1"); + database d2 ("bob", "secret", "db1", "server1"); + database d3 ("bob", "secret", "db1", "server1", 999); + database d4 ("bob", "secret", "db1", "server1", 999, "extra"); + } + + { + database d1 ("bob", "secret", "db1", "server1", "ext1"); + database d2 ("bob", "secret", "db1", "server1", "ext1", "extra"); + } + + { + database d1 ("conninfo"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "extra"); + } +} diff --git a/pgsql/database/makefile b/pgsql/database/makefile new file mode 100644 index 0000000..41b6fb9 --- /dev/null +++ b/pgsql/database/makefile @@ -0,0 +1,80 @@ +# file : pgsql/database/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 $<,$< --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)) + $(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/pgsql/database/test.std b/pgsql/database/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/makefile b/pgsql/makefile index 702825a..77ee368 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +database \ index \ native \ truncation \ diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx new file mode 100644 index 0000000..bccdab9 --- /dev/null +++ b/sqlite/database/driver.cxx @@ -0,0 +1,28 @@ +// file : sqlite/database/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +using namespace odb::sqlite; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("db1"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + } +} diff --git a/sqlite/database/makefile b/sqlite/database/makefile new file mode 100644 index 0000000..b2b04ac --- /dev/null +++ b/sqlite/database/makefile @@ -0,0 +1,84 @@ +# file : sqlite/database/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) $(name)-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 $<,$< --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)) + $(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) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/database/test.std b/sqlite/database/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/makefile b/sqlite/makefile index a584535..36e6669 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -7,6 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ custom \ +database \ native \ truncation \ types -- cgit v1.1 From a15d6818920e7972cb8e61fc3dd457705d840f8d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Sep 2012 13:59:15 +0200 Subject: Rename id() to no_id --- common/no-id/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index e53a0bb..5e86c31 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -9,7 +9,7 @@ #include -#pragma db object id() +#pragma db object no_id struct object { object () {} -- cgit v1.1 From 517ea9bd35ff406c0c7908f678b3fee17a280969 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Sep 2012 14:36:20 +0200 Subject: Add ability to specify SQLite vfs module in database constructor --- libcommon/common/common.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 6990924..524c11b 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -119,6 +119,7 @@ create_database (int& argc, #endif , true, + "", #ifdef HAVE_CXX11 move (f) #else -- cgit v1.1 From 4e7f517a711d9b6e95512cad1891710bcd591034 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 7 Sep 2012 13:58:47 +0200 Subject: Add support for passing database name as std::wstring on Windows --- sqlite/database/driver.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index bccdab9..cb531c6 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -2,9 +2,11 @@ // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -// Test that database constructors are unambiguous (compilation only). +// Test that database constructors are unambiguous and some other things. // +#include + #include using namespace odb::sqlite; @@ -12,6 +14,15 @@ using namespace odb::sqlite; int main (int argc, char* argv[]) { + // Test UTF-16 to UTF-8 conversion. + // +#ifdef _WIN32 + { + database d (L"t\x00C8st"); + assert (d.name () == "t\xC3\x88st"); + } +#endif + // This code should not execute. // if (argc != 0) -- cgit v1.1 From 32fcd732e2535090174142dd15b8b74fc444a9c2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 10 Sep 2012 12:12:06 +0200 Subject: Add support for alternative UTF-16 image for TEXT in SQLite Use it to handle QString and support std::wstring on Windows. --- qt/sqlite/basic/driver.cxx | 2 +- sqlite/types/driver.cxx | 17 +++++++++++++++-- sqlite/types/test.hxx | 24 +++++++++++++++--------- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 322e962..c0fb883 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -32,7 +32,7 @@ main (int argc, char* argv[]) auto_ptr db (create_database (argc, argv)); object o; - o.str = "Constantin Michael"; + o.str = QString::fromUtf8 ("Constantin Micha\xC3\x88l"); o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); // Persist. diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 1214d18..ac8c8d4 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -39,6 +39,9 @@ main (int argc, char* argv[]) string long_str (2040, 'l'); o.text_ = long_str; +#ifdef _WIN32 + o.wtext_ = L"t\x00C8st string"; +#endif o.blob_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); { @@ -47,8 +50,6 @@ main (int argc, char* argv[]) t.commit (); } - // - // { transaction t (db->begin ()); auto_ptr o1 (db->load (1)); @@ -56,6 +57,18 @@ main (int argc, char* argv[]) assert (o == *o1); } + + typedef odb::query query; + typedef odb::result result; + +#ifdef _WIN32 + { + transaction t (db->begin ()); + result r (db->query (query::wtext == L"t\x00C8st string")); + assert (!r.empty ()); + t.commit (); + } +#endif } catch (const odb::exception& e) { diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 897590d..bd8f48a 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -44,6 +44,10 @@ struct object #pragma db type("TEXT") std::string text_; +#ifdef _WIN32 + std::string wtext_; +#endif + #pragma db type("BLOB") std::vector blob_; @@ -55,15 +59,17 @@ struct object bool operator== (const object& y) const { - return - id_ == y.id_ && - bool_ == y.bool_ && - integer_ == y.integer_ && - real_ == y.real_ && - nan_ != nan_ && - text_ == y.text_ && - blob_ == y.blob_ && - ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + return id_ == y.id_ + && bool_ == y.bool_ + && integer_ == y.integer_ + && real_ == y.real_ + && nan_ != nan_ + && text_ == y.text_ +#ifdef _WIN32 + && wtext_ == y.wtext_ +#endif + && blob_ == y.blob_ + && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); } }; -- cgit v1.1 From d87a78e24d5988cfa3556707b7beffd1b0c15901 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 11 Sep 2012 13:55:48 +0200 Subject: Add support for mapping std::array to BLOB and char[16] to UUID types --- common/blob/driver.cxx | 6 ++++++ common/blob/test.hxx | 36 ++++++++++++++++++++++++++++-------- mssql/types/driver.cxx | 2 ++ mssql/types/test.hxx | 5 ++++- pgsql/types/driver.cxx | 4 ++++ pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 27 --------------------------- 7 files changed, 45 insertions(+), 37 deletions(-) diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index b280771..ec507ce 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -5,6 +5,8 @@ // Test BLOB mapping. // +#include // HAVE_CXX11 + #include // std::auto_ptr #include #include @@ -47,6 +49,10 @@ main (int argc, char* argv[]) o.vuc.assign (udata, udata + sizeof (data)); memcpy (o.c, data, sizeof (data)); memcpy (o.uc, udata, sizeof (data)); +#ifdef HAVE_CXX11 + memcpy (o.a.data (), data, sizeof (data)); + memcpy (o.ua.data (), udata, sizeof (data)); +#endif o.cont.push_back (1); o.cont.push_back (2); o.cont.push_back (3); diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 9e6434b..5d88d8b 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -5,17 +5,25 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include // std::memcmp +#ifdef HAVE_CXX11 +# include +#endif + #include #ifdef ODB_COMPILER # if defined(ODB_DATABASE_PGSQL) # define BLOB_TYPE "BYTEA" # elif defined(ODB_DATABASE_MSSQL) +//# define BLOB_TYPE "VARBINARY(1024)" # define BLOB_TYPE "VARBINARY(max)" # else +//# define BLOB_TYPE "RAW(1024)" # define BLOB_TYPE "BLOB" # endif #endif @@ -41,7 +49,16 @@ struct object #pragma db type(BLOB_TYPE) unsigned char uc[1024]; - // Make sure we can still use std::vector as a container. +#ifdef HAVE_CXX11 + #pragma db type(BLOB_TYPE) + std::array a; + + #pragma db type(BLOB_TYPE) + std::array ua; +#endif + + // Make sure we can still use std::vector and std::array + // as containers. // std::vector cont; }; @@ -49,13 +66,16 @@ struct object inline bool operator== (const object& x, const object& y) { - return - x.id_ == y.id_ && - x.vc == y.vc && - x.vuc == y.vuc && - std::memcmp (x.c, y.c, sizeof (x.c)) == 0 && - std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 && - x.cont == y.cont; + return x.id_ == y.id_ + && x.vc == y.vc + && x.vuc == y.vuc + && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 + && std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 +#ifdef HAVE_CXX11 + && x.a == y.a + && x.ua == y.ua +#endif + && x.cont == y.cont; } #endif // TEST_HXX diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 2d32429..3f5577f 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -97,6 +97,8 @@ main (int argc, char* argv[]) o.guid_.Data3 = 0x4E4D; memcpy (&o.guid_.Data4, "\xB2\x2F\x56\x44\x3C\xFA\x54\x3F", 8); #endif + memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" + "\x56\x44\x3C\xFA\x54\x3F", 16); // Persist. // diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index b89a621..d735acf 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -241,6 +241,9 @@ struct object GUID guid_; #endif + #pragma db type ("UNIQUEIDENTIFIER") + char uuid_[16]; + bool operator== (const object& y) const { @@ -301,7 +304,7 @@ struct object #ifdef _WIN32 && std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0 #endif - ; + && std::memcmp (uuid_, y.uuid_, sizeof (uuid_)) == 0; } }; diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 724a068..8b51cc5 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -61,6 +61,10 @@ main (int argc, char* argv[]) o.bit_.c = 0; o.bit_.d = 1; + // 6F846D41-C89A-4E4D-B22F-56443CFA543F + memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" + "\x56\x44\x3C\xFA\x54\x3F", 16); + o.enum_ = green; // Persist. diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 856e981..34f913f 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -150,7 +150,7 @@ struct object // Other types. // #pragma db type ("UUID") - unsigned char uuid_[16]; + char uuid_[16]; // Test ENUM representation. // diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 0ec4079..10dcb24 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -130,33 +130,6 @@ namespace odb }; template <> - class value_traits - { - public: - typedef unsigned char* value_type; - typedef details::ubuffer query_type; - typedef unsigned char* image_type; - - static void - set_value (unsigned char v[16], - const unsigned char* i, - bool is_null) - { - if (!is_null) - std::memcpy (v, i, 16); - else - std::memset (v, 0, 16); - } - - static void - set_image (unsigned char* i, bool& is_null, const unsigned char v[16]) - { - is_null = false; - std::memcpy (i, v, 16); - } - }; - - template <> class value_traits { public: -- cgit v1.1 From 1945a7ee2d64fffd19a839bbeb619cba2d287837 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Sep 2012 10:53:39 +0200 Subject: Cosmetic change --- oracle/custom/custom.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql index 3200e74..94ff5f5 100644 --- a/oracle/custom/custom.sql +++ b/oracle/custom/custom.sql @@ -25,7 +25,7 @@ CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers IS ret Numbers := Numbers(); s_pos NUMBER := 1; - e_pos NUMBER := 0; + e_pos NUMBER := 0; BEGIN IF in_str IS NOT NULL THEN LOOP -- cgit v1.1 From a906ffae1092f03c992b457e39fe25ab63d28c2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Sep 2012 12:00:30 +0200 Subject: Only look for SQL files in test*.sql form instead of *.sql --- tester.bat | 4 ++-- tester.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tester.bat b/tester.bat index fdd408c..9cee8ea 100644 --- a/tester.bat +++ b/tester.bat @@ -26,8 +26,8 @@ if "_%3_" == "_Win32_" ( rem Globbing returns files in alphabetic order. rem -if exist *.sql ( - for %%f in (*.sql) do ( +if exist test*.sql ( + for %%f in (test*.sql) do ( call %topdir%\%1-driver.bat %%f if errorlevel 1 goto error ) diff --git a/tester.in b/tester.in index 84b77ad..2fa3caf 100755 --- a/tester.in +++ b/tester.in @@ -11,7 +11,7 @@ # Globbing returns files in alphabetic order. # -for f in `echo *.sql`; do +for f in `echo test*.sql`; do if test -f $f; then $top_builddir/db-driver $f -- cgit v1.1 From 0301abe9322092ffef1d7713f838dcc12ab29a8e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Sep 2012 12:01:21 +0200 Subject: Replace src_base with suitable path for each target build system --- oracle/template/Makefile.am | 2 +- oracle/template/template-vc10.vcxproj | 2 +- oracle/template/template-vc9.vcproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index cb3bd54..135eb4e 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -31,5 +31,5 @@ ODBFLAGS += --std c++11 endif test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) m4_patsubst(__value__(odb_options), __value__(src_base), $(srcdir)) $< ) diff --git a/oracle/template/template-vc10.vcxproj b/oracle/template/template-vc10.vcxproj index 5246cf8..92066cf 100644 --- a/oracle/template/template-vc10.vcxproj +++ b/oracle/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/oracle/template/template-vc9.vcproj b/oracle/template/template-vc9.vcproj index bf9b1a7..de9804e 100644 --- a/oracle/template/template-vc9.vcproj +++ b/oracle/template/template-vc9.vcproj @@ -349,7 +349,7 @@ __ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) -- cgit v1.1 From e8a334106c3a330dfb202a538338d4aad547c3e3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Sep 2012 12:02:43 +0200 Subject: Use new --sql-interlude option to fix Oracle custom test --- oracle/custom/custom.sql | 21 +-------------------- oracle/custom/makefile | 10 +++++----- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql index 94ff5f5..191f397 100644 --- a/oracle/custom/custom.sql +++ b/oracle/custom/custom.sql @@ -1,24 +1,7 @@ /* This file contains custom type definitions and helper functions. */ -SET FEEDBACK OFF; -WHENEVER SQLERROR EXIT FAILURE; -WHENEVER OSERROR EXIT FAILURE; - --- @@ Temporary workaround: we cannot replace a type if there are --- tables that use it. So need to drop the tables first, then --- create/replace the type, and then create the tables. --- ---CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10); - -BEGIN - BEGIN - EXECUTE IMMEDIATE 'CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10)'; - EXCEPTION - WHEN OTHERS THEN - IF SQLCODE != -955 THEN RAISE; END IF; - END; -END; +CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10); / CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers @@ -57,5 +40,3 @@ BEGIN RETURN ret; END; / - -EXIT; diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 66a0273..b57e3ea 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -35,8 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database oracle --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix oracle_custom_ +--generate-query --hxx-prologue '\#include "traits.hxx"' --sql-interlude \ +"@ $(src_base)/custom.sql" --table-prefix oracle_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -50,8 +50,8 @@ $(out_base)/: $(driver) # $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx custom.sql -$(dist): data_dist := test.std +$(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std custom.sql $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters @@ -64,7 +64,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema,$(src_base)/custom.sql $(out_base)/test.sql) + $(call schema) $(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) -- cgit v1.1 From c404e1e17f3385a3a0102158b271b0628736dfda Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Sep 2012 08:29:57 +0200 Subject: Bump version to 2.1.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 51b720e..7ec1d6d 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.1.0.a2 +2.1.0 -- cgit v1.1 From 00033cdacff5abd150976834a2010f8ff94365e8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Sep 2012 12:50:08 +0200 Subject: Fix incorrect data member type --- sqlite/types/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index bd8f48a..fdaa541 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -45,7 +45,7 @@ struct object std::string text_; #ifdef _WIN32 - std::string wtext_; + std::wstring wtext_; #endif #pragma db type("BLOB") -- cgit v1.1 From 52e04cd68d9d7733912926e226181e11a84b1ed6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Sep 2012 12:50:33 +0200 Subject: Fix dist target --- common/definition/makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/common/definition/makefile b/common/definition/makefile index fb64b71..961685f 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -58,6 +58,7 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) +$(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(dist): -- cgit v1.1 From 219cba3efa5358dd0deea7f54db403b149bbc2a0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 16 Sep 2012 12:28:48 +0200 Subject: Add operator!= which is expected by newer Boost unordered containers --- boost/common/unordered/test.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 8bbf0a6..17e4e0e 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -30,6 +30,12 @@ operator== (const comp& x, const comp& y) } inline bool +operator!= (const comp& x, const comp& y) +{ + return !(x == y); +} + +inline bool operator< (const comp& x, const comp& y) { return x.num != y.num ? x.num < y.num : x.str < y.str; -- cgit v1.1 From 05f6238ddae9347de4c320424e3cd924b5f8a146 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 16 Sep 2012 12:29:42 +0200 Subject: Resolve ambiguity --- mssql/database/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 4e6a33c..747fc98 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -36,7 +36,7 @@ main (int argc, char* argv[]) { database d1 ("bob", "secret", "db1", "server1", 0); database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); - database d3 ("bob", "secret", "db1", "server1", 0, "driver1", "extra"); + database d3 ("bob", "secret", "db1", "server1", 999, "driver1", "extra"); } { -- cgit v1.1 From f399873d8df0cda717d525de02f561c88eb17c01 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 16 Sep 2012 13:21:50 +0200 Subject: Add support for Visual Studio 2012 --- boost/build.bat | 1 + boost/common/boost-common-vc11.sln | 15 ++ boost/common/makefile | 4 +- boost/common/multi-index/makefile | 4 +- boost/common/optional/makefile | 4 +- boost/common/smart-ptr/makefile | 4 +- boost/common/template/makefile | 4 +- boost/common/template/template-vc11.vcxproj | 181 ++++++++++++++++++++ .../common/template/template-vc11.vcxproj.filters | 24 +++ boost/common/unordered/makefile | 4 +- boost/common/uuid/makefile | 4 +- boost/mssql/boost-mssql-vc11.sln | 15 ++ boost/mssql/date-time/makefile | 5 +- boost/mssql/makefile | 4 +- boost/mssql/template/makefile | 5 +- boost/mssql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ boost/mssql/template/template-vc11.vcxproj.filters | 25 +++ boost/mysql/boost-mysql-vc11.sln | 15 ++ boost/mysql/date-time/makefile | 5 +- boost/mysql/makefile | 4 +- boost/mysql/template/makefile | 5 +- boost/mysql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ boost/mysql/template/template-vc11.vcxproj.filters | 25 +++ boost/oracle/boost-oracle-vc11.sln | 15 ++ boost/oracle/date-time/makefile | 5 +- boost/oracle/makefile | 4 +- boost/oracle/template/makefile | 5 +- boost/oracle/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ .../oracle/template/template-vc11.vcxproj.filters | 25 +++ boost/pgsql/boost-pgsql-vc11.sln | 15 ++ boost/pgsql/date-time/makefile | 5 +- boost/pgsql/makefile | 4 +- boost/pgsql/template/makefile | 5 +- boost/pgsql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ boost/pgsql/template/template-vc11.vcxproj.filters | 25 +++ boost/sqlite/boost-sqlite-vc11.sln | 15 ++ boost/sqlite/date-time/makefile | 5 +- boost/sqlite/makefile | 4 +- boost/sqlite/template/makefile | 5 +- boost/sqlite/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ .../sqlite/template/template-vc11.vcxproj.filters | 25 +++ build.bat | 1 + build/bootstrap.make | 15 ++ common/access/makefile | 4 +- common/auto/makefile | 4 +- common/blob/makefile | 4 +- common/callback/makefile | 4 +- common/circular/multiple/makefile | 4 +- common/circular/single/makefile | 4 +- common/common-vc11.sln | 15 ++ common/composite-id/makefile | 4 +- common/composite/makefile | 4 +- common/const-member/makefile | 4 +- common/const-object/makefile | 4 +- common/container/makefile | 4 +- common/ctor/makefile | 4 +- common/default/makefile | 4 +- common/definition/makefile | 4 +- common/enum/makefile | 4 +- common/erase-query/makefile | 4 +- common/index/makefile | 4 +- common/inheritance/makefile | 4 +- common/inverse/makefile | 4 +- common/lazy-ptr/makefile | 4 +- common/lifecycle/makefile | 4 +- common/makefile | 4 +- common/no-id/makefile | 4 +- common/optimistic/makefile | 4 +- common/polymorphism/makefile | 4 +- common/pragma/makefile | 4 +- common/query/makefile | 4 +- common/readonly/makefile | 4 +- common/relationship-query/makefile | 4 +- common/relationship/makefile | 4 +- common/schema/makefile | 4 +- common/session/makefile | 4 +- common/template/makefile | 4 +- common/template/template-vc11.vcxproj | 189 +++++++++++++++++++++ common/template/template-vc11.vcxproj.filters | 28 +++ common/threads/makefile | 4 +- common/transaction/makefile | 4 +- common/types/makefile | 4 +- common/view/makefile | 4 +- common/virtual/makefile | 4 +- common/wrapper/makefile | 4 +- libcommon/common/libcommon-vc11.vcxproj | 178 +++++++++++++++++++ libcommon/common/libcommon-vc11.vcxproj.filters | 19 +++ libcommon/common/makefile | 4 +- libcommon/libcommon-vc11.sln | 26 +++ libcommon/makefile | 4 +- mssql/custom/makefile | 5 +- mssql/database/makefile | 5 +- mssql/makefile | 4 +- mssql/mssql-vc11.sln | 15 ++ mssql/native/makefile | 5 +- mssql/query/makefile | 5 +- mssql/template/makefile | 5 +- mssql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ mssql/template/template-vc11.vcxproj.filters | 25 +++ mssql/types/makefile | 5 +- mysql/custom/makefile | 5 +- mysql/database/makefile | 5 +- mysql/index/makefile | 5 +- mysql/makefile | 4 +- mysql/mysql-vc11.sln | 15 ++ mysql/native/makefile | 5 +- mysql/template/makefile | 5 +- mysql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ mysql/template/template-vc11.vcxproj.filters | 25 +++ mysql/truncation/makefile | 5 +- mysql/types/makefile | 5 +- oracle/custom/makefile | 5 +- oracle/database/makefile | 5 +- oracle/makefile | 4 +- oracle/native/makefile | 5 +- oracle/oracle-vc11.sln | 15 ++ oracle/template/makefile | 5 +- oracle/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ oracle/template/template-vc11.vcxproj.filters | 25 +++ oracle/types/makefile | 5 +- pgsql/custom/makefile | 5 +- pgsql/database/makefile | 5 +- pgsql/index/makefile | 5 +- pgsql/makefile | 4 +- pgsql/native/makefile | 5 +- pgsql/pgsql-vc11.sln | 15 ++ pgsql/template/makefile | 5 +- pgsql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ pgsql/template/template-vc11.vcxproj.filters | 25 +++ pgsql/truncation/makefile | 5 +- pgsql/types/makefile | 5 +- qt/build.bat | 1 + qt/common/basic/makefile | 4 +- qt/common/containers/makefile | 4 +- qt/common/makefile | 4 +- qt/common/qt-common-vc11.sln | 15 ++ qt/common/smart-ptr/makefile | 4 +- qt/common/template/makefile | 4 +- qt/common/template/template-vc11.vcxproj | 181 ++++++++++++++++++++ qt/common/template/template-vc11.vcxproj.filters | 24 +++ qt/mssql/basic/makefile | 5 +- qt/mssql/date-time/makefile | 5 +- qt/mssql/makefile | 4 +- qt/mssql/qt-mssql-vc11.sln | 15 ++ qt/mssql/template/makefile | 5 +- qt/mssql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ qt/mssql/template/template-vc11.vcxproj.filters | 25 +++ qt/mysql/basic/makefile | 5 +- qt/mysql/date-time/makefile | 5 +- qt/mysql/makefile | 4 +- qt/mysql/qt-mysql-vc11.sln | 15 ++ qt/mysql/template/makefile | 5 +- qt/mysql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ qt/mysql/template/template-vc11.vcxproj.filters | 25 +++ qt/oracle/basic/makefile | 5 +- qt/oracle/date-time/makefile | 5 +- qt/oracle/makefile | 4 +- qt/oracle/qt-oracle-vc11.sln | 15 ++ qt/oracle/template/makefile | 5 +- qt/oracle/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ qt/oracle/template/template-vc11.vcxproj.filters | 25 +++ qt/pgsql/basic/makefile | 5 +- qt/pgsql/date-time/makefile | 5 +- qt/pgsql/makefile | 4 +- qt/pgsql/qt-pgsql-vc11.sln | 15 ++ qt/pgsql/template/makefile | 5 +- qt/pgsql/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ qt/pgsql/template/template-vc11.vcxproj.filters | 25 +++ qt/sqlite/basic/makefile | 5 +- qt/sqlite/date-time/makefile | 5 +- qt/sqlite/makefile | 4 +- qt/sqlite/qt-sqlite-vc11.sln | 15 ++ qt/sqlite/template/makefile | 5 +- qt/sqlite/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ qt/sqlite/template/template-vc11.vcxproj.filters | 25 +++ sqlite/custom/makefile | 5 +- sqlite/database/makefile | 5 +- sqlite/makefile | 4 +- sqlite/native/makefile | 5 +- sqlite/sqlite-vc11.sln | 15 ++ sqlite/template/makefile | 5 +- sqlite/template/template-vc11.vcxproj | 184 ++++++++++++++++++++ sqlite/template/template-vc11.vcxproj.filters | 25 +++ sqlite/truncation/makefile | 5 +- sqlite/types/makefile | 5 +- 185 files changed, 4701 insertions(+), 124 deletions(-) create mode 100644 boost/common/boost-common-vc11.sln create mode 100644 boost/common/template/template-vc11.vcxproj create mode 100644 boost/common/template/template-vc11.vcxproj.filters create mode 100644 boost/mssql/boost-mssql-vc11.sln create mode 100644 boost/mssql/template/template-vc11.vcxproj create mode 100644 boost/mssql/template/template-vc11.vcxproj.filters create mode 100644 boost/mysql/boost-mysql-vc11.sln create mode 100644 boost/mysql/template/template-vc11.vcxproj create mode 100644 boost/mysql/template/template-vc11.vcxproj.filters create mode 100644 boost/oracle/boost-oracle-vc11.sln create mode 100644 boost/oracle/template/template-vc11.vcxproj create mode 100644 boost/oracle/template/template-vc11.vcxproj.filters create mode 100644 boost/pgsql/boost-pgsql-vc11.sln create mode 100644 boost/pgsql/template/template-vc11.vcxproj create mode 100644 boost/pgsql/template/template-vc11.vcxproj.filters create mode 100644 boost/sqlite/boost-sqlite-vc11.sln create mode 100644 boost/sqlite/template/template-vc11.vcxproj create mode 100644 boost/sqlite/template/template-vc11.vcxproj.filters create mode 100644 common/common-vc11.sln create mode 100644 common/template/template-vc11.vcxproj create mode 100644 common/template/template-vc11.vcxproj.filters create mode 100644 libcommon/common/libcommon-vc11.vcxproj create mode 100644 libcommon/common/libcommon-vc11.vcxproj.filters create mode 100644 libcommon/libcommon-vc11.sln create mode 100644 mssql/mssql-vc11.sln create mode 100644 mssql/template/template-vc11.vcxproj create mode 100644 mssql/template/template-vc11.vcxproj.filters create mode 100644 mysql/mysql-vc11.sln create mode 100644 mysql/template/template-vc11.vcxproj create mode 100644 mysql/template/template-vc11.vcxproj.filters create mode 100644 oracle/oracle-vc11.sln create mode 100644 oracle/template/template-vc11.vcxproj create mode 100644 oracle/template/template-vc11.vcxproj.filters create mode 100644 pgsql/pgsql-vc11.sln create mode 100644 pgsql/template/template-vc11.vcxproj create mode 100644 pgsql/template/template-vc11.vcxproj.filters create mode 100644 qt/common/qt-common-vc11.sln create mode 100644 qt/common/template/template-vc11.vcxproj create mode 100644 qt/common/template/template-vc11.vcxproj.filters create mode 100644 qt/mssql/qt-mssql-vc11.sln create mode 100644 qt/mssql/template/template-vc11.vcxproj create mode 100644 qt/mssql/template/template-vc11.vcxproj.filters create mode 100644 qt/mysql/qt-mysql-vc11.sln create mode 100644 qt/mysql/template/template-vc11.vcxproj create mode 100644 qt/mysql/template/template-vc11.vcxproj.filters create mode 100644 qt/oracle/qt-oracle-vc11.sln create mode 100644 qt/oracle/template/template-vc11.vcxproj create mode 100644 qt/oracle/template/template-vc11.vcxproj.filters create mode 100644 qt/pgsql/qt-pgsql-vc11.sln create mode 100644 qt/pgsql/template/template-vc11.vcxproj create mode 100644 qt/pgsql/template/template-vc11.vcxproj.filters create mode 100644 qt/sqlite/qt-sqlite-vc11.sln create mode 100644 qt/sqlite/template/template-vc11.vcxproj create mode 100644 qt/sqlite/template/template-vc11.vcxproj.filters create mode 100644 sqlite/sqlite-vc11.sln create mode 100644 sqlite/template/template-vc11.vcxproj create mode 100644 sqlite/template/template-vc11.vcxproj.filters diff --git a/boost/build.bat b/boost/build.bat index 132e011..d9a2e4f 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -38,6 +38,7 @@ set "failed=" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" +if "_%2_" == "_11_" set "vcver=11" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 diff --git a/boost/common/boost-common-vc11.sln b/boost/common/boost-common-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/common/boost-common-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/common/makefile b/boost/common/makefile index 1aecce0..c85a808 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -26,11 +26,12 @@ name := boost-common $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) +$(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) + $(call meta-vc11slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -38,6 +39,7 @@ $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 96f4b66..9ffdb0f 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 0b1866d..3f3c1e8 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 51ef93e..18eeceb 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 363c730..d9dc969 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/template/template-vc11.vcxproj b/boost/common/template/template-vc11.vcxproj new file mode 100644 index 0000000..72fb7e3 --- /dev/null +++ b/boost/common/template/template-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/boost/common/template/template-vc11.vcxproj.filters b/boost/common/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/boost/common/template/template-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 30603c6..e50f3a7 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index e39df77..6d89098 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/boost-mssql-vc11.sln b/boost/mssql/boost-mssql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/mssql/boost-mssql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index ab68ca6..7c267a0 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -67,12 +67,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -108,6 +110,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 3154b10..145bb34 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -17,11 +17,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 19ff1db..2d03374 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/template/template-vc11.vcxproj b/boost/mssql/template/template-vc11.vcxproj new file mode 100644 index 0000000..2cc9f28 --- /dev/null +++ b/boost/mssql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/mssql/template/template-vc11.vcxproj.filters b/boost/mssql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/mssql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/mysql/boost-mysql-vc11.sln b/boost/mysql/boost-mysql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/mysql/boost-mysql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 7889b7f..19e7ccf 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -66,12 +66,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -107,6 +109,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 088c25a..217c902 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -17,11 +17,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 5ec5934..3753564 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mysql/template/template-vc11.vcxproj b/boost/mysql/template/template-vc11.vcxproj new file mode 100644 index 0000000..85fd7ac --- /dev/null +++ b/boost/mysql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/mysql/template/template-vc11.vcxproj.filters b/boost/mysql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/mysql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/oracle/boost-oracle-vc11.sln b/boost/oracle/boost-oracle-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/oracle/boost-oracle-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 63ad18d..c94ca46 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -67,12 +67,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -108,6 +110,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 380e746..18f5179 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -17,11 +17,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index c813394..d98a808 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/oracle/template/template-vc11.vcxproj b/boost/oracle/template/template-vc11.vcxproj new file mode 100644 index 0000000..d29652e --- /dev/null +++ b/boost/oracle/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/oracle/template/template-vc11.vcxproj.filters b/boost/oracle/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/oracle/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/pgsql/boost-pgsql-vc11.sln b/boost/pgsql/boost-pgsql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/pgsql/boost-pgsql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index b1afc76..5d812bc 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -66,12 +66,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -107,6 +109,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 6069988..8f3d4ae 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -17,11 +17,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index db2426d..35ec75b 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -66,12 +66,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -107,6 +109,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/pgsql/template/template-vc11.vcxproj b/boost/pgsql/template/template-vc11.vcxproj new file mode 100644 index 0000000..1615292 --- /dev/null +++ b/boost/pgsql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/pgsql/template/template-vc11.vcxproj.filters b/boost/pgsql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/pgsql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/sqlite/boost-sqlite-vc11.sln b/boost/sqlite/boost-sqlite-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/boost/sqlite/boost-sqlite-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index b36f2b7..99c1761 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -66,12 +66,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -107,6 +109,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 211e3c0..0bb7672 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -17,11 +17,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index c57dd91..ccbdf3f 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -66,12 +66,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -107,6 +109,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/sqlite/template/template-vc11.vcxproj b/boost/sqlite/template/template-vc11.vcxproj new file mode 100644 index 0000000..4056905 --- /dev/null +++ b/boost/sqlite/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/sqlite/template/template-vc11.vcxproj.filters b/boost/sqlite/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/sqlite/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/build.bat b/build.bat index 87cf5b4..421a307 100644 --- a/build.bat +++ b/build.bat @@ -38,6 +38,7 @@ set "failed=" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" +if "_%2_" == "_11_" set "vcver=11" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 diff --git a/build/bootstrap.make b/build/bootstrap.make index 507ce08..ed52a80 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -83,12 +83,21 @@ $(foreach d,$(databases),$(call \ meta-vc10proj,$1-vc10.vcxproj,$(if $2,$2,$(notdir \ $1))-$d-vc10.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: +$(dist): meta-vc11projs = \ +$(foreach d,$(databases),$(call \ +meta-vc11proj,$1-vc11.vcxproj,$(if $2,$2,$(notdir \ +$1))-$d-vc11.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: + # $1 project name without the -vcN.vc[x]proj suffix. # vc9projs = $(addprefix $1-,$(addsuffix -vc9.vcproj,$(databases))) + vc10projs = $(addprefix $1-,$(addsuffix -vc10.vcxproj,$(databases))) \ $(addprefix $1-,$(addsuffix -vc10.vcxproj.filters,$(databases))) +vc11projs = $(addprefix $1-,$(addsuffix -vc11.vcxproj,$(databases))) \ +$(addprefix $1-,$(addsuffix -vc11.vcxproj.filters,$(databases))) + # $1 solution name without the -vcN.sln suffix. # $(dist): meta-vc9slns = \ @@ -101,8 +110,14 @@ $(foreach d,$(databases),$(call \ meta-vc10sln,$1-vc10.sln,$1-$d-vc10.sln,-$d-vc10.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: +$(dist): meta-vc11slns = \ +$(foreach d,$(databases),$(call \ +meta-vc11sln,$1-vc11.sln,$1-$d-vc11.sln,-$d-vc11.vcxproj,database,$d)$(literal_newline)\ +$(literal_tab))@: + vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) vc10slns = $(addprefix $1-,$(addsuffix -vc10.sln,$(databases))) +vc11slns = $(addprefix $1-,$(addsuffix -vc11.sln,$(databases))) endif diff --git a/common/access/makefile b/common/access/makefile index 3cf2953..cf167f3 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -56,12 +56,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -97,6 +98,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/auto/makefile b/common/auto/makefile index 188267e..7b9321f 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/blob/makefile b/common/blob/makefile index 5d1ac1c..cdf35f7 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/callback/makefile b/common/callback/makefile index 0c85d05..5538707 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index bce0f5b..0ad17d6 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -60,12 +60,13 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # @@ -100,6 +101,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 1fcfdb0..955a81e 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/common-vc11.sln b/common/common-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/common/common-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 3c91c2d..25970aa 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/composite/makefile b/common/composite/makefile index 602a9ab..015f2b8 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/const-member/makefile b/common/const-member/makefile index 1c22843..8c8b932 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/const-object/makefile b/common/const-object/makefile index 47d9a0b..1826dbe 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/container/makefile b/common/container/makefile index b81b891..7173c57 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/ctor/makefile b/common/ctor/makefile index abcb78c..4b79e2c 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/default/makefile b/common/default/makefile index ad2010a..653b395 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/definition/makefile b/common/definition/makefile index 961685f..11b8d94 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -60,12 +60,13 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -101,6 +102,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/enum/makefile b/common/enum/makefile index f22da16..a69e3f0 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 5fc5305..caac9cc 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/index/makefile b/common/index/makefile index e21aab0..ddc9f11 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 26d27eb..df31c4f 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inverse/makefile b/common/inverse/makefile index 8e3e912..0f17e8c 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index f0344c9..f3bcd76 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 210bb46..0fffed1 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/makefile b/common/makefile index 9356327..3988260 100644 --- a/common/makefile +++ b/common/makefile @@ -61,11 +61,12 @@ $(dist): name := $(name) $(dist): export dirs := $(filter-out include,$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) +$(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) + $(call meta-vc11slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -73,6 +74,7 @@ $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/common/no-id/makefile b/common/no-id/makefile index 9c6eeec..04f8b03 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 80e32f5..9042931 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/polymorphism/makefile b/common/polymorphism/makefile index 36d48ea..6a8b72a 100644 --- a/common/polymorphism/makefile +++ b/common/polymorphism/makefile @@ -57,12 +57,13 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -99,6 +100,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/pragma/makefile b/common/pragma/makefile index 09696c3..d576667 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -95,6 +96,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/query/makefile b/common/query/makefile index 8d08b04..8cfbb95 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/readonly/makefile b/common/readonly/makefile index 4409927..822bf0e 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 87835ad..617c1dd 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/relationship/makefile b/common/relationship/makefile index 4a6425e..c3b3c66 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/schema/makefile b/common/schema/makefile index 9a3fb92..e7f03df 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/session/makefile b/common/session/makefile index e9edc87..7da6d42 100644 --- a/common/session/makefile +++ b/common/session/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/template/makefile b/common/template/makefile index bf28ba1..bbb65f1 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/template/template-vc11.vcxproj b/common/template/template-vc11.vcxproj new file mode 100644 index 0000000..048f160 --- /dev/null +++ b/common/template/template-vc11.vcxproj @@ -0,0 +1,189 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + + __foreach_w__(__f,__path__(odb_header_stem), + __custom_build_entry__( +__f.hxx, +odb __f.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) +) + ) + +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_entry__(__f-odb.hxx) +__header_entry__(__f-odb.ixx) +))__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_entry__(__f-odb.cxx) +))__source_entries__(extra_sources) + + + + + diff --git a/common/template/template-vc11.vcxproj.filters b/common/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..3460ffd --- /dev/null +++ b/common/template/template-vc11.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_filter_entry__(__f.hxx) +__header_filter_entry__(__f-odb.hxx) +__header_filter_entry__(__f-odb.ixx) +))__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_filter_entry__(__f-odb.cxx) +))__source_filter_entries__(extra_sources) + + diff --git a/common/threads/makefile b/common/threads/makefile index 1c3550d..3c0a041 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/transaction/makefile b/common/transaction/makefile index aa15629..516990c 100644 --- a/common/transaction/makefile +++ b/common/transaction/makefile @@ -37,12 +37,13 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -76,6 +77,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/common/types/makefile b/common/types/makefile index f81b56f..5df5a0a 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -54,12 +54,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -94,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/view/makefile b/common/view/makefile index 26566ce..cf389cc 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/virtual/makefile b/common/virtual/makefile index 92ae1d6..a5d24f9 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 101ac93..79d39d9 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -55,12 +55,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -96,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/libcommon/common/libcommon-vc11.vcxproj b/libcommon/common/libcommon-vc11.vcxproj new file mode 100644 index 0000000..c5a6758 --- /dev/null +++ b/libcommon/common/libcommon-vc11.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {019C2E51-BF41-4490-AB96-4156741B8CC9} + Win32Proj + libcommon + + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\bin\ + common-d + + + true + ..\bin64\ + common-d + + + false + ..\bin\ + common + + + false + ..\bin64\ + common + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib\common-d.lib + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib64\common-d.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib\common.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib64\common.lib + + + +__header_entries__(headers) + + +__source_entries__(sources) + + + + + diff --git a/libcommon/common/libcommon-vc11.vcxproj.filters b/libcommon/common/libcommon-vc11.vcxproj.filters new file mode 100644 index 0000000..ecc3613 --- /dev/null +++ b/libcommon/common/libcommon-vc11.vcxproj.filters @@ -0,0 +1,19 @@ + + + + + {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} + cxx + + + {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} + h;hxx;ixx;txx + + + +__header_filter_entries__(headers) + + +__source_filter_entries__(sources) + + diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 0742caf..e6fc755 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -85,13 +85,14 @@ $(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) $(dist): data_dist := config.h.in config-vc.h $(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ -$(call vc10projs,libcommon) +$(call vc10projs,libcommon) $(call vc11projs,libcommon) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake) $(call meta-vc9projs,libcommon) $(call meta-vc10projs,libcommon) + $(call meta-vc11projs,libcommon) # Clean. # @@ -117,6 +118,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/libcommon/libcommon-vc11.sln b/libcommon/libcommon-vc11.sln new file mode 100644 index 0000000..6439a7d --- /dev/null +++ b/libcommon/libcommon-vc11.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc11.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libcommon/makefile b/libcommon/makefile index b137b11..c64ab99 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -14,16 +14,18 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export dirs := $(dirs) $(dist): export extra_dist := $(call vc9slns,libcommon) \ -$(call vc10slns,libcommon) +$(call vc10slns,libcommon) $(call vc11slns,libcommon) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) $(call meta-automake) $(call meta-vc9slns,libcommon) $(call meta-vc10slns,libcommon) + $(call meta-vc11slns,libcommon) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vc11sln.make) $(call include,$(bld_root)/meta/automake.make) $(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 27f7823..84191f3 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx query.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/database/makefile b/mssql/database/makefile index f29495b..1d8848d 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mssql/makefile b/mssql/makefile index ac6b7c8..0708fb0 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -21,11 +21,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -33,6 +34,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/mssql/mssql-vc11.sln b/mssql/mssql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/mssql/mssql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mssql/native/makefile b/mssql/native/makefile index 6d6c474..3a09c6c 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mssql/query/makefile b/mssql/query/makefile index f2eed97..53526b9 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/template/makefile b/mssql/template/makefile index 7a469b2..b451bd4 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/template/template-vc11.vcxproj b/mssql/template/template-vc11.vcxproj new file mode 100644 index 0000000..3d2a5ae --- /dev/null +++ b/mssql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/mssql/template/template-vc11.vcxproj.filters b/mssql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/mssql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/mssql/types/makefile b/mssql/types/makefile index 195dd46..38935ed 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 4edfd2d..e5e3983 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx query.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/database/makefile b/mysql/database/makefile index 486da1b..d6d9787 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mysql/index/makefile b/mysql/index/makefile index a51ae43..3218c00 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/makefile b/mysql/makefile index dfbb5da..eec0791 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -22,11 +22,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -34,6 +35,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/mysql/mysql-vc11.sln b/mysql/mysql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/mysql/mysql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql/native/makefile b/mysql/native/makefile index 5632efe..4a43cc4 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mysql/template/makefile b/mysql/template/makefile index b7175bc..3371da0 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/template/template-vc11.vcxproj b/mysql/template/template-vc11.vcxproj new file mode 100644 index 0000000..c29cc09 --- /dev/null +++ b/mysql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/mysql/template/template-vc11.vcxproj.filters b/mysql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/mysql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 39ac0f3..caa9ebb 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/types/makefile b/mysql/types/makefile index ccc8ee9..112af70 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/custom/makefile b/oracle/custom/makefile index b57e3ea..b27c3bd 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std custom.sql $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/database/makefile b/oracle/database/makefile index 8fdb82a..862b08e 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/oracle/makefile b/oracle/makefile index 0fb30fc..9c9b143 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -20,11 +20,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -32,6 +33,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/oracle/native/makefile b/oracle/native/makefile index 33355a5..1fa5fe5 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/oracle/oracle-vc11.sln b/oracle/oracle-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/oracle/oracle-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/oracle/template/makefile b/oracle/template/makefile index f3cf5e2..e68a09c 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/template/template-vc11.vcxproj b/oracle/template/template-vc11.vcxproj new file mode 100644 index 0000000..68ba938 --- /dev/null +++ b/oracle/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/oracle/template/template-vc11.vcxproj.filters b/oracle/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/oracle/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/oracle/types/makefile b/oracle/types/makefile index da385ea..08eb42f 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 30ce36d..9c4cf91 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx query.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 41b6fb9..268af78 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index f56a6ba..e6f8ca6 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/makefile b/pgsql/makefile index 77ee368..320d2b5 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -22,11 +22,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -34,6 +35,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 79d28a3..02aabe6 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/pgsql/pgsql-vc11.sln b/pgsql/pgsql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/pgsql/pgsql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pgsql/template/makefile b/pgsql/template/makefile index aab7437..b966ac8 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/template/template-vc11.vcxproj b/pgsql/template/template-vc11.vcxproj new file mode 100644 index 0000000..afccb7e --- /dev/null +++ b/pgsql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/pgsql/template/template-vc11.vcxproj.filters b/pgsql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/pgsql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index d581f1f..f61eef4 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/types/makefile b/pgsql/types/makefile index a144a80..ccaedbf 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/build.bat b/qt/build.bat index ed6b27e..186101c 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -38,6 +38,7 @@ set "failed=" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" +if "_%2_" == "_11_" set "vcver=11" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 6ede2c6..f6a8728 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index 439bc42..3cfc22f 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/makefile b/qt/common/makefile index 1ac4f7e..33b17aa 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -24,11 +24,12 @@ name := qt-common $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) +$(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) + $(call meta-vc11slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -36,6 +37,7 @@ $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/common/qt-common-vc11.sln b/qt/common/qt-common-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/common/qt-common-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 8f3e087..84972c5 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 68ca16b..1b58ef1 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -66,12 +66,13 @@ $(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)) +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) # Test. # @@ -107,6 +108,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/template/template-vc11.vcxproj b/qt/common/template/template-vc11.vcxproj new file mode 100644 index 0000000..b9a0bc4 --- /dev/null +++ b/qt/common/template/template-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-vc11.vcxproj.filters b/qt/common/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index ba1443d..8dc9255 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 9ca111d..69ff484 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/makefile b/qt/mssql/makefile index ca01afd..8f8c848 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -18,11 +18,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -30,6 +31,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/mssql/qt-mssql-vc11.sln b/qt/mssql/qt-mssql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mssql/qt-mssql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 0bd81e3..3ba03b2 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -56,12 +56,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -97,6 +99,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/template/template-vc11.vcxproj b/qt/mssql/template/template-vc11.vcxproj new file mode 100644 index 0000000..d58282a --- /dev/null +++ b/qt/mssql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-vc11.vcxproj.filters b/qt/mssql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index eaea174..bb12751 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 2d038bd..6060d91 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 7493222..6f4cb87 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -18,11 +18,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -30,6 +31,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/mysql/qt-mysql-vc11.sln b/qt/mysql/qt-mysql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mysql/qt-mysql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 9ddaede..ac6f0c9 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -56,12 +56,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -97,6 +99,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/template/template-vc11.vcxproj b/qt/mysql/template/template-vc11.vcxproj new file mode 100644 index 0000000..fc8ac4e --- /dev/null +++ b/qt/mysql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-vc11.vcxproj.filters b/qt/mysql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index f77e896..b076d58 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 51d5374..9d7f776 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 9850458..5a06b62 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -18,11 +18,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -30,6 +31,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/oracle/qt-oracle-vc11.sln b/qt/oracle/qt-oracle-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/oracle/qt-oracle-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index c542b36..75a1f35 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -56,12 +56,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -97,6 +99,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/template/template-vc11.vcxproj b/qt/oracle/template/template-vc11.vcxproj new file mode 100644 index 0000000..1f4248d --- /dev/null +++ b/qt/oracle/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-vc11.vcxproj.filters b/qt/oracle/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 576fbd2..1fddeea 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index c52bb98..5da2649 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 02dad62..1d6fa4f 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -18,11 +18,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -30,6 +31,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/pgsql/qt-pgsql-vc11.sln b/qt/pgsql/qt-pgsql-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/pgsql/qt-pgsql-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index aaceb1c..7b40f65 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -56,12 +56,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -97,6 +99,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/template/template-vc11.vcxproj b/qt/pgsql/template/template-vc11.vcxproj new file mode 100644 index 0000000..69278cd --- /dev/null +++ b/qt/pgsql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-vc11.vcxproj.filters b/qt/pgsql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 2c1b23a..48c6e76 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index ebb707e..a3bc0a4 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -62,12 +62,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -103,6 +105,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index ee0c6f9..149c118 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -18,11 +18,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -30,6 +31,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/sqlite/qt-sqlite-vc11.sln b/qt/sqlite/qt-sqlite-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/sqlite/qt-sqlite-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 8ce338f..0b1b565 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -56,12 +56,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -97,6 +99,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/template/template-vc11.vcxproj b/qt/sqlite/template/template-vc11.vcxproj new file mode 100644 index 0000000..c7f0438 --- /dev/null +++ b/qt/sqlite/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-vc11.vcxproj.filters b/qt/sqlite/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 5de140f..de52742 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/database/makefile b/sqlite/database/makefile index b2b04ac..3f567c9 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/sqlite/makefile b/sqlite/makefile index 36e6669..8f1648c 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -21,11 +21,12 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln test.bat +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.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-vc11sln,$(name)-vc11.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -33,6 +34,7 @@ $(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/vc11sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 7de389a..763bed9 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -34,12 +34,14 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -73,6 +75,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/sqlite/sqlite-vc11.sln b/sqlite/sqlite-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/sqlite/sqlite-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 7f0881d..65bc159 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/template/template-vc11.vcxproj b/sqlite/template/template-vc11.vcxproj new file mode 100644 index 0000000..e62ab19 --- /dev/null +++ b/sqlite/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/sqlite/template/template-vc11.vcxproj.filters b/sqlite/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/sqlite/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 72c47e8..3dfae0e 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -52,12 +52,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -93,6 +95,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/types/makefile b/sqlite/types/makefile index bb3c09a..4e78f0a 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -54,12 +54,14 @@ $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_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) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) # Test. # @@ -95,6 +97,7 @@ endif $(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/vc11proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard -- cgit v1.1 From 118995d34d2c9428654d45b8f7b7823339bda5cc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Sep 2012 08:29:41 +0200 Subject: Use type name directly instead of typedef'ing alias --- common/default/test.hxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/default/test.hxx b/common/default/test.hxx index cff2d0c..091b91a 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -10,8 +10,7 @@ enum color {red, green, blue}; -typedef unsigned long ulong; -#pragma db value(ulong) default(0) // @@ Can't do value(unsigned long). +#pragma db value(unsigned long) default(0) #pragma db object struct object -- cgit v1.1 From a9a31b5ca7deb54388f805c94e585e359162e2e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Sep 2012 08:32:59 +0200 Subject: Remove unused local typedefs (GCC 4.8 warning) --- common/inheritance/driver.cxx | 7 +------ common/polymorphism/driver.cxx | 6 ------ common/schema/driver.cxx | 1 - common/view/driver.cxx | 8 -------- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index 466ed33..ba907ce 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -129,15 +129,10 @@ main (int argc, char* argv[]) // { typedef odb::query b_query; - typedef odb::result b_result; - typedef odb::query o1_query; - typedef odb::result o1_result; - typedef odb::query o2_query; - typedef odb::result o2_result; - typedef odb::query r_query; + typedef odb::result r_result; transaction t (db->begin ()); diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx index 6093178..1bd8a2f 100644 --- a/common/polymorphism/driver.cxx +++ b/common/polymorphism/driver.cxx @@ -333,7 +333,6 @@ main (int argc, char* argv[]) typedef odb::query base_query; typedef odb::result base_result; - typedef odb::query derived_query; typedef odb::result derived_result; transaction t (db->begin ()); @@ -477,7 +476,6 @@ main (int argc, char* argv[]) typedef odb::query base_query; typedef odb::result base_result; - typedef odb::query derived_query; typedef odb::result derived_result; transaction t (db->begin ()); @@ -706,10 +704,7 @@ main (int argc, char* argv[]) // Views. // { - typedef odb::query root_query; typedef odb::result root_result; - - typedef odb::query base_query; typedef odb::result base_result; transaction t (db->begin ()); @@ -953,7 +948,6 @@ main (int argc, char* argv[]) } { - typedef odb::query query; typedef odb::result result; transaction t (db->begin ()); diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx index ddbeb26..a47d1f6 100644 --- a/common/schema/driver.cxx +++ b/common/schema/driver.cxx @@ -90,7 +90,6 @@ main (int argc, char* argv[]) } { - typedef odb::query query; typedef odb::result result; transaction t (db->begin ()); diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 76ffa1c..e000e06 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -146,7 +146,6 @@ template void view6_test (const auto_ptr& db, const odb::query& q) { - typedef odb::query query; typedef odb::result result; typedef typename result::iterator iterator; @@ -227,7 +226,6 @@ main (int argc, char* argv[]) // view1 // { - typedef odb::query query; typedef odb::result result; { @@ -263,7 +261,6 @@ main (int argc, char* argv[]) // view1a // { - typedef odb::query query; typedef odb::result result; { @@ -315,7 +312,6 @@ main (int argc, char* argv[]) // view1c // { - typedef odb::query query; typedef odb::result result; { @@ -344,7 +340,6 @@ main (int argc, char* argv[]) // view1d // { - typedef odb::query query; typedef odb::result result; { @@ -373,7 +368,6 @@ main (int argc, char* argv[]) // view3 // { - typedef odb::query query; typedef odb::result result; // Test const result. { @@ -511,7 +505,6 @@ main (int argc, char* argv[]) // view8 // { - typedef odb::query query; typedef odb::result result; { @@ -591,7 +584,6 @@ main (int argc, char* argv[]) // view11 // { - typedef odb::query query; typedef odb::result result; { -- cgit v1.1 From ffd4bae910ad8e64b044b694ac3e2bab948f7bba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Sep 2012 10:39:38 +0200 Subject: Work around Oracle 10.2 issue with CREATE OR REPLACE TYPE --- oracle/custom/custom.sql | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql index 191f397..6e22903 100644 --- a/oracle/custom/custom.sql +++ b/oracle/custom/custom.sql @@ -1,7 +1,18 @@ /* This file contains custom type definitions and helper functions. */ -CREATE OR REPLACE TYPE Numbers AS VARRAY(100) OF NUMBER(10); +/* For some reason CREATE OR REPLACE TYPE does not work on Oracle 10.2. */ +BEGIN + BEGIN + EXECUTE IMMEDIATE 'DROP TYPE Numbers'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -4043 THEN RAISE; END IF; + END; +END; +/ + +CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10); / CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers -- cgit v1.1 From 1bfdbf0f472aa02284ab72a0f89288995e86348e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Sep 2012 16:30:42 +0200 Subject: Use QtCore/ prefix when including Qt headers --- qt/common/basic/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index 6fee19a..3c7cb28 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include +#include #include -- cgit v1.1 From 977a139491fea682c9e2c0e549c680481d0e97fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Sep 2012 16:31:25 +0200 Subject: Resolve ambiguity --- boost/common/multi-index/driver.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index f8a87f4..662ffb2 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -26,13 +26,13 @@ main (int argc, char* argv[]) { using namespace odb; - assert (access::container_traits::kind == ck_ordered); - assert (access::container_traits::kind == ck_ordered); - assert (access::container_traits::kind == ck_set); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_set); - assert (access::container_traits::kind == ck_ordered); - assert (access::container_traits::kind == ck_ordered); - assert (access::container_traits::kind == ck_set); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_set); } try -- cgit v1.1 From bc199a1762a1ce3ab1e60ec29568c71a35945280 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Sep 2012 10:17:35 +0200 Subject: Use more portable regex separator In particular, if we use / as in "/foo/bar/", MinGW will replace the leading / with a Windows path. So we use # instead, which seems to work well everywhere. --- common/access/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/access/makefile b/common/access/makefile index cf167f3..7381beb 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -35,8 +35,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix access_ --accessor-regex "/(.+)/Get\u\1/" \ ---modifier-regex "/(.+)/Set\u\1/" +--table-prefix access_ --accessor-regex "\#(.+)\#Get\u\1\#" \ +--modifier-regex "\#(.+)\#Set\u\1\#" $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 0bcac7dde58c0538b9d06f866a0ebd3d60d4001d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Sep 2012 14:42:23 +0200 Subject: Make sure size() can still be called once we reached the end of result set --- common/query/driver.cxx | 45 +++++++++++++++++++++++++++++++++++++++++++++ common/query/test.std | 1 + 2 files changed, 46 insertions(+) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index cc92f41..3c3c753 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -542,6 +542,51 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test size() validity at the beginning/middle/end of result set. + // + cout << "test 019" << endl; +#if !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_ORACLE) && \ + !defined(DATABASE_MSSQL) + { + { + transaction t (db->begin ()); + result r (db->query ()); + assert (r.size () == 4); + result::iterator i (r.begin ()); + assert (r.size () == 4); + ++i; + ++i; + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + r.cache (); + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.size () == 0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) ; + assert (r.size () == 0); + } + } +#endif } catch (const odb::exception& e) { diff --git a/common/query/test.std b/common/query/test.std index e4ed7a0..0548968 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -99,3 +99,4 @@ Jane Doe 29 married test 016 test 017 test 018 +test 019 -- cgit v1.1 From eb20ad512d29475ebf81ae43bca362d40ab3fba2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Oct 2012 10:58:38 +0200 Subject: Fix bug in short national char data querying --- mssql/types/driver.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 3f5577f..cd5523d 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -127,6 +127,37 @@ main (int argc, char* argv[]) assert (o == *o1); } + + // Test short/long data in queries. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::svchar == o.svchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::snvchar == o.snvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mvchar == o.mvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mnvchar == o.mnvchar_)); + assert (size (r) == 1); + } + + t.commit (); + } } // Test long NULL data. -- cgit v1.1 From 7adf3d7aebbdea54f83a3654182cc9aafd4a8b41 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 11:56:00 +0200 Subject: More query result size() fixes --- common/query/driver.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 3c3c753..bec61fb 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -570,7 +570,7 @@ main (int argc, char* argv[]) result::iterator i (r.begin ()); ++i; ++i; - r.cache (); + r.cache (); // Cache in the middle. assert (r.size () == 4); ++i; assert (r.size () == 4); @@ -580,6 +580,17 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + ++i; + r.cache (); // Cache at the end. + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); result r (db->query (query::last_name == "None")); assert (r.size () == 0); for (result::iterator i (r.begin ()); i != r.end (); ++i) ; -- cgit v1.1 From dcee8530bb5c58710a22f50bb92ac7c3b19ddf84 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 12:25:58 +0200 Subject: Fix issue with unbind data management in query with descriptors --- oracle/types/driver.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 554c506..7c3e6bd 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -254,6 +254,21 @@ main (int argc, char* argv[]) assert (size (r) == 1); } + { + // Query temporary. + // + result r (db->query ( + query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_)); + + query dummy (query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_); + + assert (size (r) == 1); + } + t.commit (); } } -- cgit v1.1 From 6b76715e63d2c265a4c51c73f9019bc578f874cb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 14:47:57 +0200 Subject: Fix bug in transient inheritance handling Also test that we can handle it for objects, composite values, and views. --- common/inheritance/driver.cxx | 182 --- common/inheritance/makefile | 115 -- common/inheritance/polymorphism/driver.cxx | 1880 ++++++++++++++++++++++++++++ common/inheritance/polymorphism/makefile | 118 ++ common/inheritance/polymorphism/test.std | 36 + common/inheritance/polymorphism/test1.hxx | 116 ++ common/inheritance/polymorphism/test10.hxx | 79 ++ common/inheritance/polymorphism/test11.hxx | 79 ++ common/inheritance/polymorphism/test12.hxx | 80 ++ common/inheritance/polymorphism/test2.hxx | 106 ++ common/inheritance/polymorphism/test3.hxx | 147 +++ common/inheritance/polymorphism/test4.hxx | 76 ++ common/inheritance/polymorphism/test5.hxx | 93 ++ common/inheritance/polymorphism/test6.hxx | 65 + common/inheritance/polymorphism/test7.hxx | 67 + common/inheritance/polymorphism/test8.hxx | 130 ++ common/inheritance/polymorphism/test9.hxx | 162 +++ common/inheritance/reuse/driver.cxx | 182 +++ common/inheritance/reuse/makefile | 115 ++ common/inheritance/reuse/test.hxx | 158 +++ common/inheritance/reuse/test.std | 0 common/inheritance/test.hxx | 158 --- common/inheritance/test.std | 0 common/inheritance/transient/driver.cxx | 79 ++ common/inheritance/transient/makefile | 115 ++ common/inheritance/transient/test.hxx | 61 + common/inheritance/transient/test.std | 0 common/makefile | 77 +- common/polymorphism/driver.cxx | 1880 ---------------------------- common/polymorphism/makefile | 118 -- common/polymorphism/test.std | 36 - common/polymorphism/test1.hxx | 116 -- common/polymorphism/test10.hxx | 79 -- common/polymorphism/test11.hxx | 79 -- common/polymorphism/test12.hxx | 80 -- common/polymorphism/test2.hxx | 106 -- common/polymorphism/test3.hxx | 147 --- common/polymorphism/test4.hxx | 76 -- common/polymorphism/test5.hxx | 93 -- common/polymorphism/test6.hxx | 65 - common/polymorphism/test7.hxx | 67 - common/polymorphism/test8.hxx | 130 -- common/polymorphism/test9.hxx | 162 --- 43 files changed, 3983 insertions(+), 3727 deletions(-) delete mode 100644 common/inheritance/driver.cxx delete mode 100644 common/inheritance/makefile create mode 100644 common/inheritance/polymorphism/driver.cxx create mode 100644 common/inheritance/polymorphism/makefile create mode 100644 common/inheritance/polymorphism/test.std create mode 100644 common/inheritance/polymorphism/test1.hxx create mode 100644 common/inheritance/polymorphism/test10.hxx create mode 100644 common/inheritance/polymorphism/test11.hxx create mode 100644 common/inheritance/polymorphism/test12.hxx create mode 100644 common/inheritance/polymorphism/test2.hxx create mode 100644 common/inheritance/polymorphism/test3.hxx create mode 100644 common/inheritance/polymorphism/test4.hxx create mode 100644 common/inheritance/polymorphism/test5.hxx create mode 100644 common/inheritance/polymorphism/test6.hxx create mode 100644 common/inheritance/polymorphism/test7.hxx create mode 100644 common/inheritance/polymorphism/test8.hxx create mode 100644 common/inheritance/polymorphism/test9.hxx create mode 100644 common/inheritance/reuse/driver.cxx create mode 100644 common/inheritance/reuse/makefile create mode 100644 common/inheritance/reuse/test.hxx create mode 100644 common/inheritance/reuse/test.std delete mode 100644 common/inheritance/test.hxx delete mode 100644 common/inheritance/test.std create mode 100644 common/inheritance/transient/driver.cxx create mode 100644 common/inheritance/transient/makefile create mode 100644 common/inheritance/transient/test.hxx create mode 100644 common/inheritance/transient/test.std delete mode 100644 common/polymorphism/driver.cxx delete mode 100644 common/polymorphism/makefile delete mode 100644 common/polymorphism/test.std delete mode 100644 common/polymorphism/test1.hxx delete mode 100644 common/polymorphism/test10.hxx delete mode 100644 common/polymorphism/test11.hxx delete mode 100644 common/polymorphism/test12.hxx delete mode 100644 common/polymorphism/test2.hxx delete mode 100644 common/polymorphism/test3.hxx delete mode 100644 common/polymorphism/test4.hxx delete mode 100644 common/polymorphism/test5.hxx delete mode 100644 common/polymorphism/test6.hxx delete mode 100644 common/polymorphism/test7.hxx delete mode 100644 common/polymorphism/test8.hxx delete mode 100644 common/polymorphism/test9.hxx diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx deleted file mode 100644 index ba907ce..0000000 --- a/common/inheritance/driver.cxx +++ /dev/null @@ -1,182 +0,0 @@ -// file : common/inheritance/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object inheritance. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - base b; - b.comp_.bools.push_back (true); - b.comp_.num = 10; - b.comp_.str = "comp bbb"; - b.comp_.nums.push_back (101); - b.comp_.nums.push_back (102); - b.num_ = 0; - b.str_ = "bbb"; - b.strs_.push_back ("bbb one"); - b.strs_.push_back ("bbb two"); - - object1 o1; - o1.comp_.bools.push_back (false); - o1.comp_.num = 11; - o1.comp_.str = "comp o1o1o1"; - o1.comp_.nums.push_back (111); - o1.comp_.nums.push_back (112); - static_cast (o1).num_ = 1; - o1.num1_ = 21; - o1.str_ = "base o1o1o1"; - o1.strs_.push_back ("base o1o1o1 one"); - o1.strs_.push_back ("base o1o1o1 two"); - - object2 o2; - o2.comp_.bools.push_back (true); - o2.comp_.bools.push_back (false); - o2.comp_.num = 12; - o2.comp_.str = "comp o2o2o2"; - o2.comp_.nums.push_back (121); - o2.comp_.nums.push_back (122); - o2.num_ = 2; - static_cast (o2).str_ = "base o2o2o2"; - o2.str_ = "o2o2o2"; - o2.strs_.push_back ("base o2o2o2 one"); - o2.strs_.push_back ("base o2o2o2 two"); - - object3 o3; - o3.comp_.bools.push_back (false); - o3.comp_.bools.push_back (false); - o3.comp_.num = 13; - o3.comp_.str = "comp o3o3o3"; - o3.comp_.nums.push_back (131); - o3.comp_.nums.push_back (132); - o3.num_ = 3; - o3.str_ = "base o3o3o3"; - o3.strs_.push_back ("base o3o3o3 one"); - o3.strs_.push_back ("base o3o3o3 two"); - - reference r; - r.o1_ = &o1; - - empty e; - e.comp_.bools.push_back (true); - e.comp_.bools.push_back (true); - e.comp_.num = 14; - e.comp_.str = "comp eee"; - e.comp_.nums.push_back (141); - e.comp_.nums.push_back (142); - e.num_ = 4; - e.str_ = "base eee"; - e.strs_.push_back ("base eee one"); - e.strs_.push_back ("base eee two"); - - // persist - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (r); - db->persist (e); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr lb (db->load (b.id_)); - auto_ptr lo1 (db->load (o1.id_)); - auto_ptr lo2 (db->load (o2.id_)); - auto_ptr lo3 (db->load (o3.id_)); - auto_ptr le (db->load (e.id_)); - auto_ptr lr (db->load (r.id_)); - t.commit (); - - assert (b == *lb); - assert (o1 == *lo1); - assert (o2 == *lo2); - assert (o3 == *lo3); - assert (lr->o1_->id_ == r.o1_->id_); - assert (e == *le); - - delete lr->o1_; - } - - // query - // - { - typedef odb::query b_query; - typedef odb::query o1_query; - typedef odb::query o2_query; - typedef odb::query r_query; - - typedef odb::result r_result; - - transaction t (db->begin ()); - - assert (!db->query (b_query::comp.num == 10).empty ()); - assert (!db->query (o1_query::num1 == 21).empty ()); - assert (!db->query (o2_query::num == 2).empty ()); - - // Query condition with hidden members. - // - assert ( - !db->query (o2_query::base::str == "base o2o2o2").empty ()); - - // Query condition with referenced composite member in base class. - // - { - r_result r (db->query (r_query::o1->comp.num == 11)); - assert (!r.empty ()); - delete r.begin ()->o1_; - } - - t.commit (); - } - - // views - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::num == o2.num_)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); - assert (++i == r.end ()); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/inheritance/makefile b/common/inheritance/makefile deleted file mode 100644 index df31c4f..0000000 --- a/common/inheritance/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/inheritance/makefile -# copyright : Copyright (c) 2009-2012 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) --generate-schema \ ---generate-query --table-prefix inherit_ -$(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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx new file mode 100644 index 0000000..20007e4 --- /dev/null +++ b/common/inheritance/polymorphism/driver.cxx @@ -0,0 +1,1880 @@ +// file : common/inheritance/polymorphism/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test polymorphic object inheritance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test3.hxx" +#include "test4.hxx" +#include "test5.hxx" +#include "test6.hxx" +#include "test7.hxx" +#include "test8.hxx" +#include "test9.hxx" +#include "test10.hxx" +#include "test11.hxx" +#include "test12.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" +#include "test4-odb.hxx" +#include "test5-odb.hxx" +#include "test6-odb.hxx" +#include "test7-odb.hxx" +#include "test8-odb.hxx" +#include "test9-odb.hxx" +#include "test10-odb.hxx" +#include "test11-odb.hxx" +#include "test12-odb.hxx" + +using namespace std; +using namespace odb::core; + +const char* events[] = +{ + "pre_persist", + "post_persist", + "pre_load", + "post_load", + "pre_update", + "post_update", + "pre_erase", + "post_erase" +}; + +namespace test6 +{ + void base:: + db_callback (callback_event e, database&) + { + cout << "base " << events[e] << " " << id << endl; + } + + void base:: + db_callback (callback_event e, database&) const + { + cout << "base " << events[e] << " " << id << " const" << endl; + } + + void derived:: + db_callback (callback_event e, database&) const + { + cout << "derived " << events[e] << " " << id << " const" << endl; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test 1: basic polymorphism functionality. + // + { + using namespace test1; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + + // Static persist. + // + db->persist (r); + db->persist (b); + + // Dynamic persist. + // + root& r (d); + db->persist (r); + + t.commit (); + } + + // Static load. + // + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Dynamic load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d.id)); + auto_ptr pd2 (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd1 == d); + assert (*pd2 == d); + } + + // Invalid load. + // + { + transaction t (db->begin ()); + + try + { + auto_ptr p (db->load (r.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + auto_ptr p (db->load (b.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static load into existing instance. + // + { + transaction t (db->begin ()); + root r1; + db->load (r.id, r1); + base b1; + db->load (b.id, b1); + derived d1; + db->load (d.id, d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic load into existing instance. + // + { + transaction t (db->begin ()); + base b1; + db->load (b.id, static_cast (b1)); + derived d1; + db->load (d.id, static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid load into existing instance. + // + { + transaction t (db->begin ()); + + try + { + base b; + db->load (r.id, static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + db->load (b.id, static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing load. + // + { + transaction t (db->begin ()); + root b1; + db->load (b.id, b1); + base d1; + db->load (d.id, d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Static reload. + // + { + transaction t (db->begin ()); + root r1; + r1.id = r.id; + db->reload (r1); + base b1; + b1.id = b.id; + db->reload (b1); + derived d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic reload. + // + { + transaction t (db->begin ()); + base b1; + b1.id = b.id; + db->reload (static_cast (b1)); + derived d1; + d1.id = d.id; + db->reload (static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid reload. + // + { + transaction t (db->begin ()); + + try + { + base b; + b.id = r.id; + db->reload (static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + d.id = b.id; + db->reload (static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing reload. + // + { + transaction t (db->begin ()); + root b1; + b1.id = b.id; + db->reload (b1); + base d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Query. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test loading via root. + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == r); + assert (++i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via base. + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via derived. + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test loading into an existing instance. + // + { + root_result qr (db->query ()); + + unsigned short mask (0); + + for (root_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::root") + { + root r1; + i.load (r1); + assert (r1 == r); + mask |= 1; + } + else if (ds == "test1::base") + { + base b1; + i.load (b1); + assert (b1 == b); + mask |= 2; + } + else if (ds == "test1::derived") + { + derived d1; + i.load (d1); + assert (d1 == d); + mask |= 4; + } + else + assert (false); + } + + assert (mask == 7); + } + + // Test query conditions with columns from multiple tables. + // + { + base_result qr ( + db->query ( + base_query::num == 3 && base_query::str == "ddd")); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test discriminator access. + // + { + base_result qr (db->query (base_query::id == 3)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test1::derived"); + assert (++i == e); + } + + // Test loading of an object from the same hierarchy during + // query result iteration (tests image copying via change + // callbacks in some databases). + // + { + base_result qr (db->query ()); + + unsigned short mask (0); + + for (base_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::base") + { + auto_ptr d1 (db->load (d.id)); + assert (*d1 == d); + assert (*i == b); + mask |= 1; + } + else if (ds == "test1::derived") + { + auto_ptr b1 (db->load (b.id)); + assert (*b1 == b); + assert (*i == d); + mask |= 2; + } + } + + assert (mask == 3); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->typeid_ == "test1::root" && i->num == r.num); + assert (++i != e && i->typeid_ == "test1::base" && i->num == b.num); + assert (++i != e && i->typeid_ == "test1::derived" && i->num == d.num); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->id == b.id && i->num == b.num && i->str == b.str); + assert (++i != e && + i->id == d.id && i->num == d.num && i->str == d.str); + assert (++i == e); + } + + // derived + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->num == d.num && i->str == d.str && + i->dnum == d.dnum && i->dstr == d.dstr); + assert (++i == e); + } + + t.commit (); + } + + // Update. + // + r.num++; + r.strs.push_back ("aaaa"); + + b.num++; + b.str += "b"; + b.nums.push_back (24); + b.strs.push_back ("bbbb"); + + d.num++; + d.str += "d"; + d.dnum++; + d.dstr += "d"; + d.nums.push_back (34); + d.strs.push_back ("dddd"); + + { + transaction t (db->begin ()); + + // Static update. + // + db->update (r); + db->update (b); + + // Dynamic update. + // + root& r (d); + db->update (r); + + t.commit (); + } + + // Verify update. + // + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Invalid erase via id. + // + { + transaction t (db->begin ()); + + try + { + db->erase (r.id); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + db->erase (b.id); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static erase via id. + // + { + transaction t (db->begin ()); + db->erase (r.id); + db->erase (b.id); + t.commit (); + } + + // Dynamic erase via id. + // + { + transaction t (db->begin ()); + db->erase (d.id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Static erase via object. + // + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + t.commit (); + } + + // Dynamic erase via object. + // + { + const root& r (d); + transaction t (db->begin ()); + db->erase (r); + t.commit (); + } + } + + // Test 2: inverse object pointers in polymorhic bases. + // + { + using namespace test2; + + derived d (1, "d", 1); + root_pointer rp (&d); + base_pointer bp (&d); + + { + transaction t (db->begin ()); + db->persist (rp); + db->persist (bp); + + d.rp.reset (*db, &rp); + d.bp.reset (*db, &bp); + + db->persist (d); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + auto_ptr pb (db->load (d.id)); + auto_ptr pr (db->load (d.id)); + t.commit (); + + assert (pd->rp.object_id () == rp.id && + pd->bp.object_id () == bp.id); + + derived* p (dynamic_cast (pb.get ())); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + + p = dynamic_cast (pr.get ()); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + base_result qr ( + db->query ( + base_query::rp->id == rp.id && + base_query::bp->id == bp.id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test2::derived"); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::result root_result; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ()); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->rp_id == rp.id && i->r_id == d.id); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ()); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->bp_id == bp.id && i->b_id == d.id && i->str == d.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 3: delayed loading. + // + { + using namespace test3; + + base b1 (21, 21); + base b2 (22, 22); + base b3 (23, 23); + + derived d1 (31, 31, "d"); + derived d2 (32, 32, "dd"); + derived d3 (33, 33, "ddd"); + + b1.rptr = new root (1); + b2.rptr = new base (2, 2); + b3.rptr = new derived (3, 3, "b3"); + + d1.rptr = new root (4); + d2.rptr = new base (5, 5); + d3.rptr = new derived (6, 6, "d3"); + + d2.bptr = new base (7, 7); + d3.bptr = new derived (8, 8, "d3b"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (b2); + db->persist (b3); + + db->persist (d1); + db->persist (d2); + db->persist (d3); + + db->persist (b1.rptr); + db->persist (b2.rptr); + db->persist (b3.rptr); + + db->persist (d1.rptr); + db->persist (d2.rptr); + db->persist (d3.rptr); + + db->persist (d2.bptr); + db->persist (d3.bptr); + + t.commit (); + } + + { + transaction t (db->begin ()); + + { + auto_ptr p1 (db->load (b1.id)); + auto_ptr p2 (db->load (b2.id)); + auto_ptr p3 (db->load (b3.id)); + assert (*p1 == b1); + assert (*p2 == b2); + assert (*p3 == b3); + } + + { + auto_ptr p1 (db->load (d1.id)); + auto_ptr p2 (db->load (d2.id)); + auto_ptr p3 (db->load (d3.id)); + assert (*p1 == d1); + assert (*p2 == d2); + assert (*p3 == d3); + } + + t.commit (); + } + + // Query. + // + { + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + derived_result qr ( + db->query ( + derived_query::rptr->id == 6 && + derived_query::bptr->id == 8 && + derived_query::bptr->num == 8)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d3); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + typedef odb::query root_query; + typedef odb::result root_result; + + transaction t (db->begin ()); + + // base + // + { + base_result qr ( + db->query ( + base_query::base::num == b2.num && + base_query::base::id == b2.id && + base_query::r::id == b2.rptr->id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->b_id == b2.id && + i->r_id == b2.rptr->id && + i->num == b2.num); + assert (++i == e); + } + + // derived + // + { + derived_result qr ( + db->query ( + derived_query::d::str == d3.str && + derived_query::d::num == d3.num && + derived_query::b::num == d3.bptr->num && + derived_query::d::id == d3.id && + derived_query::b::id == d3.bptr->id && + derived_query::r::id == d3.rptr->id)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->d_id == d3.id && + i->b_id == d3.bptr->id && + i->r_id == d3.rptr->id && + i->d_num == d3.num && + i->b_num == d3.bptr->num && + i->str == d3.str); + assert (++i == e); + } + + // root + // + { + root_result qr ( + db->query ( + root_query::r::id.in (b2.rptr->id, d2.rptr->id))); + + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->r_id == d2.rptr->id && + i->d_id == d2.id && + i->str == d2.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 4: views. + // + { + using namespace test4; + + base1 b1 (21, 1); + + root2 r2 (11, 0); + base2 b2 (21, 1, "abc"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (r2); + db->persist (b2); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr ( + db->query ( + query::base1::num == b1.num)); + + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->str == "abc"); + assert (++i == e); + } + + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr (db->query ()); + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->min_num == 1); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 5: polymorphism and optimistic concurrency. + // + { + using namespace test5; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Update. + // + { + transaction t (db->begin ()); + + // Root. + // + { + auto_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaa"); + db->update (r); + + p->num--; + p->strs.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (r == *p); + } + + // Base. + // + { + auto_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + p->num--; + p->str += "B"; + p->strs.pop_back (); + p->nums.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (b == *p); + } + + // Derived. + // + { + auto_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + derived& d1 (static_cast (*p)); + d1.num--; + d1.str += "D"; + d1.strs.pop_back (); + d1.nums.pop_back (); + d1.dnum--; + d1.dstr += "D"; + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (d == *p); + } + + t.commit (); + } + + // Reload. + // + { + transaction t (db->begin ()); + + // Make sure reload doesn't modify the object if the versions + // match. + // + derived d1 (d); + d1.num++; + d1.str += "d"; + d1.strs.push_back ("dddd"); + d1.nums.push_back (24); + d1.dnum++; + d1.dstr += "d"; + derived d2 (d1); + + db->reload (d1); + assert (d1 == d2); + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + + // Root. + // + { + auto_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaaa"); + db->update (r); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Base. + // + { + auto_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Derived. + // + { + auto_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Try to update non-existent object. + // + { + try + { + db->update (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + // Try to erase non-existent object. + // + { + try + { + db->erase (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + t.commit (); + } + } + + // Test 6: polymorphism and callbacks. + // + { + using namespace test6; + + base b (1, 1, "bbb"); + auto_ptr d (new derived (2, 2, "ddd")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d->id)); + + db->load (b.id, *pb); + db->load (d->id, *pd); + + db->reload (*pb); + db->reload (*pd); + + t.commit (); + } + + // Update. + // + { + b.num++; + d->num++; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + *i; + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d); + t.commit (); + } + + // Recursive (delayed) loading. + // + { + derived d (3, 3, "dddd"); + d.ptr.reset (new derived (4, 4, "ddddd")); + + { + transaction t (db->begin ()); + db->persist (d); + db->persist (d.ptr); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (d.id)); + t.commit (); + } + } + } + + // Test 7: polymorphism and object cache (session). + // +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + { + using namespace test7; + + shared_ptr r (new root (1, 1)); + shared_ptr b (new base (2, 2, "b")); + shared_ptr d (new derived (3, 3, "d")); + + // Persist. + // + { + session s; + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + assert (db->load (r->id) == r); + assert (db->load (b->id) == b); + assert (db->load (d->id) == d); + } + + // Load. + // + { + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + assert (db->load (r->id) == r1); + assert (db->load (b->id) == b1); + assert (db->load (d->id) == d1); + + assert (!db->find (b->id)); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + { + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i.load () == r1); + assert (++i != e && i.load () == b1); + assert (++i != e && i.load () == d1); + assert (++i == e); + + t.commit (); + } + } + + // Erase. + // + { + session s; + + { + transaction t (db->begin ()); + db->load (r->id); + db->load (b->id); + db->load (d->id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + db->erase (d); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (!db->find (r->id)); + assert (!db->find (b->id)); + assert (!db->find (d->id)); + t.commit (); + } + } + } +#endif + + // Test 8: polymorphism and abstract bases. + // + { + using namespace test8; + + base b (1, 1, "b"); + interm i (2, 2, "i", true); + derived1 d1 (3, 3, "d1", true); + derived2 d2 (4, 4, "d2", false); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d1)); + db->persist (static_cast (d2)); + + try + { + db->persist (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->persist (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Load. + // + { + base vb; + interm vi; + derived1 vd1; + derived2 vd2; + + transaction t (db->begin ()); + + // load (id) + // + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d1.id)); + auto_ptr pd2 (db->load (d2.id)); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + + // load (id, obj) + // + db->load (b.id, static_cast (vb)); + db->load (d1.id, static_cast (vd1)); + db->load (d2.id, static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->load (i.id, static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + // reload (obj) + // + vb.num = 0; + vd1.num = 0; + vd2.num = 0; + + db->reload (static_cast (vb)); + db->reload (static_cast (vd1)); + db->reload (static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->reload (static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Update. + // + { + b.num++; + b.str += 'b'; + d1.num++; + d1.str += "d1"; + d2.num++; + d2.str += "d1"; + + { + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d1); + db->update (static_cast (d2)); + + try + { + db->update (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->update (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd1 (db->load (d1.id)); + auto_ptr pd2 (db->load (d2.id)); + t.commit (); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + } + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d1.id); + db->erase (static_cast (d2)); + + try + { + db->erase (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->erase (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + } + + // Test 9: polymorphism and readonly classes. + // + { + using namespace test9; + + ro_root ro_r (1, 1); + rw_base rw_b (2, 2, "b"); + ro_derived ro_d (3, 3, "d"); + + rw_root rw_r (1, 1); + ro_base ro_b (2, 2, "b"); + rw_derived rw_d (3, 3, "d"); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (ro_r); + db->persist (rw_b); + db->persist (ro_d); + + db->persist (rw_r); + db->persist (ro_b); + db->persist (rw_d); + t.commit (); + } + + // Update. + // + { + ro_root ro_r1 (ro_r); + rw_base rw_b1 (rw_b); + ro_derived ro_d1 (ro_d); + + ro_base ro_b1 (ro_b); + rw_derived rw_d1 (rw_d); + + ro_r1.num++; + ro_r1.strs.push_back ("b"); + + rw_b1.num++; + rw_b1.strs.push_back ("b"); + rw_b1.str += "b"; + rw_b1.nums.push_back (2); + rw_b.str += "b"; + rw_b.nums.push_back (2); + + ro_d1.num++; + ro_d1.strs.push_back ("d"); + ro_d1.str += "d"; + ro_d1.nums.push_back (3); + ro_d1.dnum++; + ro_d1.dstr += "d"; + + rw_r.num++; + rw_r.strs.push_back ("b"); + + ro_b1.num++; + ro_b1.strs.push_back ("b"); + ro_b1.str += "b"; + ro_b1.nums.push_back (2); + + rw_d1.num++; + rw_d1.strs.push_back ("d"); + rw_d1.str += "d"; + rw_d1.nums.push_back (3); + rw_d1.dnum++; + rw_d1.dstr += "d"; + rw_d.dnum++; + rw_d.dstr += "d"; + + { + // These should be no-ops. + // + db->update (ro_r1); + db->update (static_cast (ro_d1)); + db->update (ro_b1); + + transaction t (db->begin ()); + db->update (static_cast (rw_b1)); + db->update (rw_r); + db->update (static_cast (rw_d1)); + t.commit (); + } + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p_ro_r (db->load (ro_r.id)); + auto_ptr p_rw_b (db->load (rw_b.id)); + auto_ptr p_ro_d (db->load (ro_d.id)); + + auto_ptr p_rw_r (db->load (rw_r.id)); + auto_ptr p_ro_b (db->load (ro_b.id)); + auto_ptr p_rw_d (db->load (rw_d.id)); + t.commit (); + + assert (*p_ro_r == ro_r); + assert (*p_rw_b == rw_b); + assert (*p_ro_d == ro_d); + + assert (*p_rw_r == rw_r); + assert (*p_ro_b == ro_b); + assert (*p_rw_d == rw_d); + } + } + + // Test 10: empty polymorphic classes. + // + { + using namespace test10; + + base b (1, 1); + derived d (2, 2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + d.num++; + + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } + + // Test 11: reuse and polymorphic inheritance. + // + { + using namespace test11; + + base b (1, 1, "b"); + derived d (2, 2, "d"); + + b.strs.push_back ("b"); + b.nums.push_back (1); + + d.strs.push_back ("d"); + d.nums.push_back (1); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + b.str += "b"; + b.strs.push_back ("bb"); + b.nums.push_back (2); + + d.num++; + d.str += "d"; + d.strs.push_back ("dd"); + d.nums.push_back (2); + d.dnum++; + d.dstr += "d"; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + { + base_result qr (db->query (base_query::num == 2)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i == e); + } + + { + derived_result qr (db->query (derived_query::num == 3)); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 12: polymorphic objects with auto id. + // + { + using namespace test12; + + base b (1); + derived d (2); + + unsigned long id1, id2; + + // Persist. + // + { + transaction t (db->begin ()); + id1 = db->persist (b); + id2 = db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (id1)); + auto_ptr pd (db->load (id2)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile new file mode 100644 index 0000000..5796d49 --- /dev/null +++ b/common/inheritance/polymorphism/makefile @@ -0,0 +1,118 @@ +# file : common/inheritance/polymorphism/makefile +# copyright : Copyright (c) 2009-2012 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 := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ +test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--generate-query --table-prefix inherit_p_ +$(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 odb_header_stem := $(basename $(odb_hdr)) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): schemas := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.sql)) +$(test): $(driver) $(src_base)/test.std + $(call schema,$(schemas)) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/polymorphism/test.std b/common/inheritance/polymorphism/test.std new file mode 100644 index 0000000..5c18191 --- /dev/null +++ b/common/inheritance/polymorphism/test.std @@ -0,0 +1,36 @@ +base pre_persist 1 const +base post_persist 1 const +derived pre_persist 2 const +derived post_persist 2 const +base pre_load 0 +base post_load 1 +derived pre_load 0 const +derived post_load 2 const +base pre_load 1 +base post_load 1 +derived pre_load 2 const +derived post_load 2 const +base pre_load 1 +base post_load 1 +derived pre_load 2 const +derived post_load 2 const +base pre_update 1 const +base post_update 1 const +derived pre_update 2 const +derived post_update 2 const +base pre_load 0 +base post_load 1 +derived pre_load 0 const +derived post_load 2 const +base pre_erase 1 const +base post_erase 1 const +derived pre_erase 2 const +derived post_erase 2 const +derived pre_persist 3 const +derived post_persist 3 const +derived pre_persist 4 const +derived post_persist 4 const +derived pre_load 0 const +derived pre_load 0 const +derived post_load 4 const +derived post_load 3 const diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx new file mode 100644 index 0000000..f3015cd --- /dev/null +++ b/common/inheritance/polymorphism/test1.hxx @@ -0,0 +1,116 @@ +// file : common/inheritance/polymorphism/test1.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include +#include +#include + +#include + +// Test basic polymorphism functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // Views. + // + #pragma db view object(root) + struct root_view + { + //#pragma db column(root::typeid_) + std::string typeid_; // @@ tmp + + unsigned long num; + }; + + #pragma db view object(base = b) + struct base_view + { + unsigned long id; + unsigned long num; + std::string str; + }; + + #pragma db view object(derived) + struct derived_view + { + unsigned long num; + std::string str; + unsigned long dnum; + std::string dstr; + }; +} + +#endif // TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx new file mode 100644 index 0000000..d534498 --- /dev/null +++ b/common/inheritance/polymorphism/test10.hxx @@ -0,0 +1,79 @@ +// file : common/inheritance/polymorphism/test10.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST10_HXX +#define TEST10_HXX + +#include + +#include + +// Test empty polymorphic classes. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n): root (i), num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n): base (i, n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx new file mode 100644 index 0000000..0622c37 --- /dev/null +++ b/common/inheritance/polymorphism/test11.hxx @@ -0,0 +1,79 @@ +// file : common/inheritance/polymorphism/test11.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST11_HXX +#define TEST11_HXX + +#include +#include +#include + +#include + +// Test mixing reuse and polymorphic inheritance. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db object abstract + struct root + { + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + }; + + #pragma db object polymorphic + struct base: root + { + virtual ~base () {} + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (base)) + return false; + + return id == b.id && num == b.num && strs == b.strs && + str == b.str && nums == b.nums; + } + }; + + inline bool + operator== (const base& x, const base& y) {return x.compare (y);} + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (derived)) + return false; + + const derived& d (static_cast (b)); + return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx new file mode 100644 index 0000000..94054ce --- /dev/null +++ b/common/inheritance/polymorphism/test12.hxx @@ -0,0 +1,80 @@ +// file : common/inheritance/polymorphism/test12.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST12_HXX +#define TEST12_HXX + +#include + +#include + +// Test polymorphic classes with private auto id. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id_ == r.id_; + } + + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long n): num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long n): base (n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST12_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx new file mode 100644 index 0000000..a238190 --- /dev/null +++ b/common/inheritance/polymorphism/test2.hxx @@ -0,0 +1,106 @@ +// file : common/inheritance/polymorphism/test2.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include +#include + +#include +#include + +// Test inverse object pointers in polymorhic bases. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct root; + + #pragma db object + struct root_pointer + { + root_pointer (root* r = 0): p (r) {} + + #pragma db id auto + unsigned long id; + + root* p; + }; + + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(p) + odb::lazy_ptr rp; + }; + + struct base; + + #pragma db object + struct base_pointer + { + base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} + + #pragma db id auto + unsigned long id; + + std::vector vp; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, const std::string& s): root (i), str (s) {} + + std::string str; + + #pragma db inverse(vp) + odb::lazy_ptr bp; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, const std::string& s, unsigned long n) + : base (i, s), num (n) {} + + unsigned long num; + }; + + // Views. + // + #pragma db view object(root_pointer = rp) object(root) + struct root_view + { + #pragma db column(rp::id) + unsigned long rp_id; + + #pragma db column(root::id) + unsigned long r_id; + }; + + #pragma db view object(base_pointer) object(base = b) + struct base_view + { + #pragma db column(base_pointer::id) + unsigned long bp_id; + + #pragma db column(b::id) + unsigned long b_id; + + std::string str; + }; +} + +#endif // TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx new file mode 100644 index 0000000..c219bfc --- /dev/null +++ b/common/inheritance/polymorphism/test3.hxx @@ -0,0 +1,147 @@ +// file : common/inheritance/polymorphism/test3.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#include +#include + +#include + +// Test delayed loading. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + virtual ~base () {delete rptr;} + base (): rptr (0) {} + base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} + + unsigned long num; + root* rptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return + root::compare (r, false) && + num == b.num && + ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); + } + }; + + #pragma db object + struct derived: base + { + virtual ~derived () {delete bptr;} + derived (): bptr (0) {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n), str (s), bptr (0) {} + + std::string str; + base* bptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return + base::compare (r, false) && + str == d.str && + ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); + } + }; + + // Views. + // + #pragma db view object(base) object(root = r) + struct base_view + { + #pragma db column(base::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + unsigned long num; + }; + + #pragma db view \ + object(derived = d) \ + object(base = b) \ + object(root = r: d::rptr) + struct derived_view + { + #pragma db column(d::id) + unsigned long d_id; + + #pragma db column(b::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::num) + unsigned long d_num; + + #pragma db column(b::num) + unsigned long b_num; + + std::string str; + }; + + // This is an example of a pathological case, where the right-hand-side + // of the join condition comes from one of the bases. As a result, we + // join the base table first, which means we will get both bases and + // derived objects instead of just derived. + // + //#pragma db view object(root = r) object(derived = d) + #pragma db view object(derived = d) object(root = r) + struct root_view + { + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::id) + unsigned long d_id; + + std::string str; + }; +} + +#endif // TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx new file mode 100644 index 0000000..b268548 --- /dev/null +++ b/common/inheritance/polymorphism/test4.hxx @@ -0,0 +1,76 @@ +// file : common/inheritance/polymorphism/test4.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST4_HXX +#define TEST4_HXX + +#include + +#include + +// Test views. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic + struct root1 + { + virtual ~root1 () {} + root1 () {} + root1 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + }; + + #pragma db object + struct base1: root1 + { + base1 () {} + base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} + + unsigned long num; + }; + + #pragma db object polymorphic + struct root2 + { + virtual ~root2 () {} + root2 () {} + root2 (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base2: root2 + { + base2 () {} + base2 (unsigned long i, unsigned long n, const std::string& s) + : root2 (i, n), str (s) {} + + std::string str; + }; + + // Test custom join condition. + // + #pragma db view object(base2) object(base1: base2::num == base1::num) + struct view1 + { + std::string str; + }; + + #pragma db view object(base2) + struct view2 + { + #pragma db column("min(" + base2::num + ")") + std::size_t min_num; + }; +} + +#endif // TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx new file mode 100644 index 0000000..ecc92ad --- /dev/null +++ b/common/inheritance/polymorphism/test5.hxx @@ -0,0 +1,93 @@ +// file : common/inheritance/polymorphism/test5.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST5_HXX +#define TEST5_HXX + +#include +#include +#include +#include + +#include + +// Test polymorphism and optimistic concurrency. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + #pragma db version + unsigned long version; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && version == r.version && + num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx new file mode 100644 index 0000000..a40d8c1 --- /dev/null +++ b/common/inheritance/polymorphism/test6.hxx @@ -0,0 +1,65 @@ +// file : common/inheritance/polymorphism/test6.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST6_HXX +#define TEST6_HXX + +#include +#include + +#include +#include + +// Test polymorphism and callbacks. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic pointer(std::auto_ptr) + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object callback(db_callback) + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; + }; + + #pragma db object callback(db_callback) + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + std::auto_ptr ptr; + + void + db_callback (odb::callback_event, odb::database&) const; + }; +} + +#endif // TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx new file mode 100644 index 0000000..10f604f --- /dev/null +++ b/common/inheritance/polymorphism/test7.hxx @@ -0,0 +1,67 @@ +// file : common/inheritance/polymorphism/test7.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +#include + +// Test polymorphism and object cache (session). +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) +#pragma db namespace table("t7_") +namespace test7 +{ +#ifdef HAVE_CXX11 + using std::shared_ptr; +#else + using std::tr1::shared_ptr; +#endif + + #pragma db object polymorphic pointer(shared_ptr) session + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + }; +} +#endif + +#endif // TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx new file mode 100644 index 0000000..ee5829a --- /dev/null +++ b/common/inheritance/polymorphism/test8.hxx @@ -0,0 +1,130 @@ +// file : common/inheritance/polymorphism/test8.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST8_HXX +#define TEST8_HXX + +#include +#include +#include + +#include + +// Test polymorphism and abstract bases. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object abstract + struct interm: base + { + interm () {} + interm (unsigned long i, unsigned long n, const std::string& s, bool b) + : base (i, n, s), bln (b) {} + + bool bln; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (interm)) + return false; + + const interm& i (static_cast (r)); + return base::compare (r, false) && bln == i.bln; + } + }; + + #pragma db object + struct derived1: interm + { + derived1 () {} + derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dnum (n + 1) {} + + unsigned long dnum; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived1)) + return false; + + const derived1& d (static_cast (r)); + return interm::compare (r, false) && dnum == d.dnum; + } + }; + + #pragma db object + struct derived2: interm + { + derived2 () {} + derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dstr (s + 'd') {} + + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived2)) + return false; + + const derived2& d (static_cast (r)); + return interm::compare (r, false) && dstr == d.dstr; + } + }; +} + +#endif // TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx new file mode 100644 index 0000000..b059464 --- /dev/null +++ b/common/inheritance/polymorphism/test9.hxx @@ -0,0 +1,162 @@ +// file : common/inheritance/polymorphism/test9.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST9_HXX +#define TEST9_HXX + +#include +#include +#include + +#include + +// Test polymorphism and readonly classes. +// +#pragma db namespace table("t9_") +namespace test9 +{ + // + // ro_root, rw_base, ro_derived + // + #pragma db object polymorphic readonly + struct ro_root + { + virtual ~ro_root () {} + ro_root () {} + ro_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} + + #pragma db object + struct rw_base: ro_root + { + rw_base () {} + rw_base (unsigned long i, unsigned long n, const std::string& s) + : ro_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_base)) + return false; + + const rw_base& b (static_cast (r)); + return ro_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object readonly + struct ro_derived: rw_base + { + ro_derived () {} + ro_derived (unsigned long i, unsigned long n, const std::string& s) + : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_derived)) + return false; + + const ro_derived& d (static_cast (r)); + return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // + // rw_root, ro_base, rw_derived + // + #pragma db object polymorphic + struct rw_root + { + virtual ~rw_root () {} + rw_root () {} + rw_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} + + #pragma db object readonly + struct ro_base: rw_root + { + ro_base () {} + ro_base (unsigned long i, unsigned long n, const std::string& s) + : rw_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_base)) + return false; + + const ro_base& b (static_cast (r)); + return rw_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct rw_derived: ro_base + { + rw_derived () {} + rw_derived (unsigned long i, unsigned long n, const std::string& s) + : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_derived)) + return false; + + const rw_derived& d (static_cast (r)); + return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx new file mode 100644 index 0000000..78c2703 --- /dev/null +++ b/common/inheritance/reuse/driver.cxx @@ -0,0 +1,182 @@ +// file : common/inheritance/reuse/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test reuse object inheritance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + base b; + b.comp_.bools.push_back (true); + b.comp_.num = 10; + b.comp_.str = "comp bbb"; + b.comp_.nums.push_back (101); + b.comp_.nums.push_back (102); + b.num_ = 0; + b.str_ = "bbb"; + b.strs_.push_back ("bbb one"); + b.strs_.push_back ("bbb two"); + + object1 o1; + o1.comp_.bools.push_back (false); + o1.comp_.num = 11; + o1.comp_.str = "comp o1o1o1"; + o1.comp_.nums.push_back (111); + o1.comp_.nums.push_back (112); + static_cast (o1).num_ = 1; + o1.num1_ = 21; + o1.str_ = "base o1o1o1"; + o1.strs_.push_back ("base o1o1o1 one"); + o1.strs_.push_back ("base o1o1o1 two"); + + object2 o2; + o2.comp_.bools.push_back (true); + o2.comp_.bools.push_back (false); + o2.comp_.num = 12; + o2.comp_.str = "comp o2o2o2"; + o2.comp_.nums.push_back (121); + o2.comp_.nums.push_back (122); + o2.num_ = 2; + static_cast (o2).str_ = "base o2o2o2"; + o2.str_ = "o2o2o2"; + o2.strs_.push_back ("base o2o2o2 one"); + o2.strs_.push_back ("base o2o2o2 two"); + + object3 o3; + o3.comp_.bools.push_back (false); + o3.comp_.bools.push_back (false); + o3.comp_.num = 13; + o3.comp_.str = "comp o3o3o3"; + o3.comp_.nums.push_back (131); + o3.comp_.nums.push_back (132); + o3.num_ = 3; + o3.str_ = "base o3o3o3"; + o3.strs_.push_back ("base o3o3o3 one"); + o3.strs_.push_back ("base o3o3o3 two"); + + reference r; + r.o1_ = &o1; + + empty e; + e.comp_.bools.push_back (true); + e.comp_.bools.push_back (true); + e.comp_.num = 14; + e.comp_.str = "comp eee"; + e.comp_.nums.push_back (141); + e.comp_.nums.push_back (142); + e.num_ = 4; + e.str_ = "base eee"; + e.strs_.push_back ("base eee one"); + e.strs_.push_back ("base eee two"); + + // persist + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (r); + db->persist (e); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr lb (db->load (b.id_)); + auto_ptr lo1 (db->load (o1.id_)); + auto_ptr lo2 (db->load (o2.id_)); + auto_ptr lo3 (db->load (o3.id_)); + auto_ptr le (db->load (e.id_)); + auto_ptr lr (db->load (r.id_)); + t.commit (); + + assert (b == *lb); + assert (o1 == *lo1); + assert (o2 == *lo2); + assert (o3 == *lo3); + assert (lr->o1_->id_ == r.o1_->id_); + assert (e == *le); + + delete lr->o1_; + } + + // query + // + { + typedef odb::query b_query; + typedef odb::query o1_query; + typedef odb::query o2_query; + typedef odb::query r_query; + + typedef odb::result r_result; + + transaction t (db->begin ()); + + assert (!db->query (b_query::comp.num == 10).empty ()); + assert (!db->query (o1_query::num1 == 21).empty ()); + assert (!db->query (o2_query::num == 2).empty ()); + + // Query condition with hidden members. + // + assert ( + !db->query (o2_query::base::str == "base o2o2o2").empty ()); + + // Query condition with referenced composite member in base class. + // + { + r_result r (db->query (r_query::o1->comp.num == 11)); + assert (!r.empty ()); + delete r.begin ()->o1_; + } + + t.commit (); + } + + // views + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::num == o2.num_)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); + assert (++i == r.end ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile new file mode 100644 index 0000000..1fc1142 --- /dev/null +++ b/common/inheritance/reuse/makefile @@ -0,0 +1,115 @@ +# file : common/inheritance/reuse/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix inherit_r_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx new file mode 100644 index 0000000..8222f97 --- /dev/null +++ b/common/inheritance/reuse/test.hxx @@ -0,0 +1,158 @@ +// file : common/inheritance/reuse/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db value +struct comp_base +{ + std::vector bools; + + bool + operator== (const comp_base& y) const + { + return bools == y.bools; + } +}; + +#pragma db value +struct comp: comp_base +{ + unsigned int num; + std::string str; + + std::vector nums; + + bool + operator== (const comp& y) const + { + return + static_cast (*this) == y && + num == y.num && + str == y.str && + nums == y.nums; + } +}; + +#pragma db object abstract +struct abstract_base +{ + comp comp_; + + unsigned int num_; + std::string str_; + + std::vector strs_; + + bool + operator== (const abstract_base& y) const + { + return + comp_ == y.comp_ && + num_ == y.num_ && + str_ == y.str_ && + strs_ == y.strs_; + } +}; + +#pragma db object +struct base: abstract_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const base& y) const + { + return id_ == y.id_ && static_cast (*this) == y; + } +}; + +#pragma db object +struct object1: base +{ + unsigned int num1_; + + bool + operator== (const object1& y) const + { + return static_cast (*this) == y && num1_ == y.num1_; + } +}; + +#pragma db object +struct object2: base +{ + #pragma db column("derived_str") + std::string str_; + + bool + operator== (const object2& y) const + { + return static_cast (*this) == y && str_ == y.str_; + } +}; + +// Reference to derived object. +// +#pragma db object +struct reference +{ + #pragma db id auto + unsigned long id_; + + object1* o1_; +}; + +// Multiple inheritance. +// +#pragma db object abstract +struct id_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const id_base& y) const + { + return id_ == y.id_; + } +}; + +#pragma db object +struct object3: abstract_base, id_base +{ + bool + operator== (const object3& y) const + { + return + static_cast (*this) == y && + static_cast (*this) == y; + } +}; + +// Empty derived object. +// +#pragma db object +struct empty: base +{ +}; + +// View based on the derived object. +// +#pragma db view object(object2) +struct object2_view +{ + unsigned int num; // from abstract_base + unsigned long id; // from base + std::string str; // from object2, hides one from abstract_base +}; + +#endif // TEST_HXX diff --git a/common/inheritance/reuse/test.std b/common/inheritance/reuse/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/inheritance/test.hxx b/common/inheritance/test.hxx deleted file mode 100644 index 6059337..0000000 --- a/common/inheritance/test.hxx +++ /dev/null @@ -1,158 +0,0 @@ -// file : common/inheritance/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db value -struct comp_base -{ - std::vector bools; - - bool - operator== (const comp_base& y) const - { - return bools == y.bools; - } -}; - -#pragma db value -struct comp: comp_base -{ - unsigned int num; - std::string str; - - std::vector nums; - - bool - operator== (const comp& y) const - { - return - static_cast (*this) == y && - num == y.num && - str == y.str && - nums == y.nums; - } -}; - -#pragma db object abstract -struct abstract_base -{ - comp comp_; - - unsigned int num_; - std::string str_; - - std::vector strs_; - - bool - operator== (const abstract_base& y) const - { - return - comp_ == y.comp_ && - num_ == y.num_ && - str_ == y.str_ && - strs_ == y.strs_; - } -}; - -#pragma db object -struct base: abstract_base -{ - #pragma db id auto - unsigned long id_; - - bool - operator== (const base& y) const - { - return id_ == y.id_ && static_cast (*this) == y; - } -}; - -#pragma db object -struct object1: base -{ - unsigned int num1_; - - bool - operator== (const object1& y) const - { - return static_cast (*this) == y && num1_ == y.num1_; - } -}; - -#pragma db object -struct object2: base -{ - #pragma db column("derived_str") - std::string str_; - - bool - operator== (const object2& y) const - { - return static_cast (*this) == y && str_ == y.str_; - } -}; - -// Reference to derived object. -// -#pragma db object -struct reference -{ - #pragma db id auto - unsigned long id_; - - object1* o1_; -}; - -// Multiple inheritance. -// -#pragma db object abstract -struct id_base -{ - #pragma db id auto - unsigned long id_; - - bool - operator== (const id_base& y) const - { - return id_ == y.id_; - } -}; - -#pragma db object -struct object3: abstract_base, id_base -{ - bool - operator== (const object3& y) const - { - return - static_cast (*this) == y && - static_cast (*this) == y; - } -}; - -// Empty derived object. -// -#pragma db object -struct empty: base -{ -}; - -// View based on the derived object. -// -#pragma db view object(object2) -struct object2_view -{ - unsigned int num; // from abstract_base - unsigned long id; // from base - std::string str; // from object2, hides one from abstract_base -}; - -#endif // TEST_HXX diff --git a/common/inheritance/test.std b/common/inheritance/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx new file mode 100644 index 0000000..099506b --- /dev/null +++ b/common/inheritance/transient/driver.cxx @@ -0,0 +1,79 @@ +// file : common/inheritance/transient/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transient inheritance of objects, composite value types, and views. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.num = 1; + o.str = "abc"; + o.strs.push_back ("abc 1"); + o.strs.push_back ("abc 2"); + o.c.num = 11; + o.c.str = "comp abc"; + o.c.nums.push_back (111); + o.c.nums.push_back (112); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + // view + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::id == o.id_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == o.num && i->str == o.str); + assert (++i == r.end ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile new file mode 100644 index 0000000..ab5936a --- /dev/null +++ b/common/inheritance/transient/makefile @@ -0,0 +1,115 @@ +# file : common/inheritance/transient/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix inherit_t_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx new file mode 100644 index 0000000..df5d0c1 --- /dev/null +++ b/common/inheritance/transient/test.hxx @@ -0,0 +1,61 @@ +// file : common/inheritance/transient/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +struct object; + +struct base +{ + int n; + std::vector v; + object* p; +}; + +#pragma db value +struct comp: base +{ + unsigned int num; + std::string str; + std::vector nums; + + bool + operator== (const comp& y) const + { + return num == y.num && str == y.str && nums == y.nums; + } +}; + +#pragma db object +struct object: base +{ + #pragma db id auto + unsigned int id_; + + unsigned int num; + std::string str; + std::vector strs; + comp c; + + bool + operator== (const object& y) const + { + return num == y.num && str == y.str && strs == y.strs && c == y.c; + } +}; + +#pragma db view object(object) +struct view: base +{ + unsigned int num; + std::string str; +}; + +#endif // TEST_HXX diff --git a/common/inheritance/transient/test.std b/common/inheritance/transient/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 3988260..6f187fb 100644 --- a/common/makefile +++ b/common/makefile @@ -4,44 +4,45 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -access \ -auto \ -blob \ -callback \ -circular/single \ -circular/multiple \ -composite \ -composite-id \ -const-object \ -const-member \ -container \ -ctor \ -default \ -definition \ -enum \ -erase-query \ -include \ -index \ -inheritance \ -inverse \ -lazy-ptr \ -lifecycle \ -no-id \ -optimistic \ -polymorphism \ -pragma \ -query \ -readonly \ -relationship \ -relationship-query \ -schema \ -session \ -template \ -transaction \ -types \ -view \ -virtual \ +tests := \ +access \ +auto \ +blob \ +callback \ +circular/single \ +circular/multiple \ +composite \ +composite-id \ +const-object \ +const-member \ +container \ +ctor \ +default \ +definition \ +enum \ +erase-query \ +include \ +index \ +inheritance/polymorphism \ +inheritance/reuse \ +inheritance/transient \ +inverse \ +lazy-ptr \ +lifecycle \ +no-id \ +optimistic \ +pragma \ +query \ +readonly \ +relationship \ +relationship-query \ +schema \ +session \ +template \ +transaction \ +types \ +view \ +virtual \ wrapper thread_tests := threads diff --git a/common/polymorphism/driver.cxx b/common/polymorphism/driver.cxx deleted file mode 100644 index 1bd8a2f..0000000 --- a/common/polymorphism/driver.cxx +++ /dev/null @@ -1,1880 +0,0 @@ -// file : common/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test polymorphic object inheritance. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test1.hxx" -#include "test2.hxx" -#include "test3.hxx" -#include "test4.hxx" -#include "test5.hxx" -#include "test6.hxx" -#include "test7.hxx" -#include "test8.hxx" -#include "test9.hxx" -#include "test10.hxx" -#include "test11.hxx" -#include "test12.hxx" - -#include "test1-odb.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" -#include "test4-odb.hxx" -#include "test5-odb.hxx" -#include "test6-odb.hxx" -#include "test7-odb.hxx" -#include "test8-odb.hxx" -#include "test9-odb.hxx" -#include "test10-odb.hxx" -#include "test11-odb.hxx" -#include "test12-odb.hxx" - -using namespace std; -using namespace odb::core; - -const char* events[] = -{ - "pre_persist", - "post_persist", - "pre_load", - "post_load", - "pre_update", - "post_update", - "pre_erase", - "post_erase" -}; - -namespace test6 -{ - void base:: - db_callback (callback_event e, database&) - { - cout << "base " << events[e] << " " << id << endl; - } - - void base:: - db_callback (callback_event e, database&) const - { - cout << "base " << events[e] << " " << id << " const" << endl; - } - - void derived:: - db_callback (callback_event e, database&) const - { - cout << "derived " << events[e] << " " << id << " const" << endl; - } -} - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // Test 1: basic polymorphism functionality. - // - { - using namespace test1; - - root r (1, 1); - base b (2, 2, "bbb"); - derived d (3, 3, "ddd"); - - r.strs.push_back ("a"); - r.strs.push_back ("aa"); - r.strs.push_back ("aaa"); - - b.nums.push_back (21); - b.nums.push_back (22); - b.nums.push_back (23); - b.strs.push_back ("b"); - b.strs.push_back ("bb"); - b.strs.push_back ("bbb"); - - d.nums.push_back (31); - d.nums.push_back (32); - d.nums.push_back (33); - d.strs.push_back ("d"); - d.strs.push_back ("dd"); - d.strs.push_back ("ddd"); - - { - transaction t (db->begin ()); - - // Static persist. - // - db->persist (r); - db->persist (b); - - // Dynamic persist. - // - root& r (d); - db->persist (r); - - t.commit (); - } - - // Static load. - // - { - transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pr == r); - assert (*pb == b); - assert (*pd == d); - } - - // Dynamic load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d.id)); - auto_ptr pd2 (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd1 == d); - assert (*pd2 == d); - } - - // Invalid load. - // - { - transaction t (db->begin ()); - - try - { - auto_ptr p (db->load (r.id)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - auto_ptr p (db->load (b.id)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Static load into existing instance. - // - { - transaction t (db->begin ()); - root r1; - db->load (r.id, r1); - base b1; - db->load (b.id, b1); - derived d1; - db->load (d.id, d1); - t.commit (); - - assert (r1 == r); - assert (b1 == b); - assert (d1 == d); - } - - // Dynamic load into existing instance. - // - { - transaction t (db->begin ()); - base b1; - db->load (b.id, static_cast (b1)); - derived d1; - db->load (d.id, static_cast (d1)); - t.commit (); - - assert (b1 == b); - assert (d1 == d); - } - - // Invalid load into existing instance. - // - { - transaction t (db->begin ()); - - try - { - base b; - db->load (r.id, static_cast (b)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - derived d; - db->load (b.id, static_cast (d)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Slicing load. - // - { - transaction t (db->begin ()); - root b1; - db->load (b.id, b1); - base d1; - db->load (d.id, d1); - t.commit (); - - assert (b1 == static_cast (b)); - assert (d1 == static_cast (d)); - } - - // Static reload. - // - { - transaction t (db->begin ()); - root r1; - r1.id = r.id; - db->reload (r1); - base b1; - b1.id = b.id; - db->reload (b1); - derived d1; - d1.id = d.id; - db->reload (d1); - t.commit (); - - assert (r1 == r); - assert (b1 == b); - assert (d1 == d); - } - - // Dynamic reload. - // - { - transaction t (db->begin ()); - base b1; - b1.id = b.id; - db->reload (static_cast (b1)); - derived d1; - d1.id = d.id; - db->reload (static_cast (d1)); - t.commit (); - - assert (b1 == b); - assert (d1 == d); - } - - // Invalid reload. - // - { - transaction t (db->begin ()); - - try - { - base b; - b.id = r.id; - db->reload (static_cast (b)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - derived d; - d.id = b.id; - db->reload (static_cast (d)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Slicing reload. - // - { - transaction t (db->begin ()); - root b1; - b1.id = b.id; - db->reload (b1); - base d1; - d1.id = d.id; - db->reload (d1); - t.commit (); - - assert (b1 == static_cast (b)); - assert (d1 == static_cast (d)); - } - - // Query. - // - { - typedef odb::query root_query; - typedef odb::result root_result; - - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // Test loading via root. - // - { - root_result qr (db->query ("ORDER BY" + root_query::id)); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == r); - assert (++i != e && *i == b); - assert (++i != e && *i == d); - assert (++i == e); - } - - // Test loading via base. - // - { - base_result qr (db->query ("ORDER BY" + base_query::id)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == b); - assert (++i != e && *i == d); - assert (++i == e); - } - - // Test loading via derived. - // - { - derived_result qr (db->query ()); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - // Test loading into an existing instance. - // - { - root_result qr (db->query ()); - - unsigned short mask (0); - - for (root_result::iterator i (qr.begin ()); i != qr.end (); ++i) - { - string ds (i.discriminator ()); - - if (ds == "test1::root") - { - root r1; - i.load (r1); - assert (r1 == r); - mask |= 1; - } - else if (ds == "test1::base") - { - base b1; - i.load (b1); - assert (b1 == b); - mask |= 2; - } - else if (ds == "test1::derived") - { - derived d1; - i.load (d1); - assert (d1 == d); - mask |= 4; - } - else - assert (false); - } - - assert (mask == 7); - } - - // Test query conditions with columns from multiple tables. - // - { - base_result qr ( - db->query ( - base_query::num == 3 && base_query::str == "ddd")); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - // Test discriminator access. - // - { - base_result qr (db->query (base_query::id == 3)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i.discriminator () == "test1::derived"); - assert (++i == e); - } - - // Test loading of an object from the same hierarchy during - // query result iteration (tests image copying via change - // callbacks in some databases). - // - { - base_result qr (db->query ()); - - unsigned short mask (0); - - for (base_result::iterator i (qr.begin ()); i != qr.end (); ++i) - { - string ds (i.discriminator ()); - - if (ds == "test1::base") - { - auto_ptr d1 (db->load (d.id)); - assert (*d1 == d); - assert (*i == b); - mask |= 1; - } - else if (ds == "test1::derived") - { - auto_ptr b1 (db->load (b.id)); - assert (*b1 == b); - assert (*i == d); - mask |= 2; - } - } - - assert (mask == 3); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::query root_query; - typedef odb::result root_result; - - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // root - // - { - root_result qr (db->query ("ORDER BY" + root_query::id)); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->typeid_ == "test1::root" && i->num == r.num); - assert (++i != e && i->typeid_ == "test1::base" && i->num == b.num); - assert (++i != e && i->typeid_ == "test1::derived" && i->num == d.num); - assert (++i == e); - } - - // base - // - { - base_result qr (db->query ("ORDER BY" + base_query::id)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->id == b.id && i->num == b.num && i->str == b.str); - assert (++i != e && - i->id == d.id && i->num == d.num && i->str == d.str); - assert (++i == e); - } - - // derived - // - { - derived_result qr (db->query ()); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->num == d.num && i->str == d.str && - i->dnum == d.dnum && i->dstr == d.dstr); - assert (++i == e); - } - - t.commit (); - } - - // Update. - // - r.num++; - r.strs.push_back ("aaaa"); - - b.num++; - b.str += "b"; - b.nums.push_back (24); - b.strs.push_back ("bbbb"); - - d.num++; - d.str += "d"; - d.dnum++; - d.dstr += "d"; - d.nums.push_back (34); - d.strs.push_back ("dddd"); - - { - transaction t (db->begin ()); - - // Static update. - // - db->update (r); - db->update (b); - - // Dynamic update. - // - root& r (d); - db->update (r); - - t.commit (); - } - - // Verify update. - // - { - transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pr == r); - assert (*pb == b); - assert (*pd == d); - } - - // Invalid erase via id. - // - { - transaction t (db->begin ()); - - try - { - db->erase (r.id); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - db->erase (b.id); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Static erase via id. - // - { - transaction t (db->begin ()); - db->erase (r.id); - db->erase (b.id); - t.commit (); - } - - // Dynamic erase via id. - // - { - transaction t (db->begin ()); - db->erase (d.id); - t.commit (); - } - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Static erase via object. - // - { - transaction t (db->begin ()); - db->erase (r); - db->erase (b); - t.commit (); - } - - // Dynamic erase via object. - // - { - const root& r (d); - transaction t (db->begin ()); - db->erase (r); - t.commit (); - } - } - - // Test 2: inverse object pointers in polymorhic bases. - // - { - using namespace test2; - - derived d (1, "d", 1); - root_pointer rp (&d); - base_pointer bp (&d); - - { - transaction t (db->begin ()); - db->persist (rp); - db->persist (bp); - - d.rp.reset (*db, &rp); - d.bp.reset (*db, &bp); - - db->persist (d); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); - auto_ptr pb (db->load (d.id)); - auto_ptr pr (db->load (d.id)); - t.commit (); - - assert (pd->rp.object_id () == rp.id && - pd->bp.object_id () == bp.id); - - derived* p (dynamic_cast (pb.get ())); - assert (p != 0 && - p->rp.object_id () == rp.id && - p->bp.object_id () == bp.id); - - p = dynamic_cast (pr.get ()); - assert (p != 0 && - p->rp.object_id () == rp.id && - p->bp.object_id () == bp.id); - } - - // Query. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - transaction t (db->begin ()); - - // Test query conditions with columns in pointed-to objects from - // multiple tables. - // - { - base_result qr ( - db->query ( - base_query::rp->id == rp.id && - base_query::bp->id == bp.id)); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i.discriminator () == "test2::derived"); - assert (++i == e); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::result root_result; - typedef odb::result base_result; - - transaction t (db->begin ()); - - // root - // - { - root_result qr (db->query ()); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->rp_id == rp.id && i->r_id == d.id); - assert (++i == e); - } - - // base - // - { - base_result qr (db->query ()); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->bp_id == bp.id && i->b_id == d.id && i->str == d.str); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 3: delayed loading. - // - { - using namespace test3; - - base b1 (21, 21); - base b2 (22, 22); - base b3 (23, 23); - - derived d1 (31, 31, "d"); - derived d2 (32, 32, "dd"); - derived d3 (33, 33, "ddd"); - - b1.rptr = new root (1); - b2.rptr = new base (2, 2); - b3.rptr = new derived (3, 3, "b3"); - - d1.rptr = new root (4); - d2.rptr = new base (5, 5); - d3.rptr = new derived (6, 6, "d3"); - - d2.bptr = new base (7, 7); - d3.bptr = new derived (8, 8, "d3b"); - - { - transaction t (db->begin ()); - db->persist (b1); - db->persist (b2); - db->persist (b3); - - db->persist (d1); - db->persist (d2); - db->persist (d3); - - db->persist (b1.rptr); - db->persist (b2.rptr); - db->persist (b3.rptr); - - db->persist (d1.rptr); - db->persist (d2.rptr); - db->persist (d3.rptr); - - db->persist (d2.bptr); - db->persist (d3.bptr); - - t.commit (); - } - - { - transaction t (db->begin ()); - - { - auto_ptr p1 (db->load (b1.id)); - auto_ptr p2 (db->load (b2.id)); - auto_ptr p3 (db->load (b3.id)); - assert (*p1 == b1); - assert (*p2 == b2); - assert (*p3 == b3); - } - - { - auto_ptr p1 (db->load (d1.id)); - auto_ptr p2 (db->load (d2.id)); - auto_ptr p3 (db->load (d3.id)); - assert (*p1 == d1); - assert (*p2 == d2); - assert (*p3 == d3); - } - - t.commit (); - } - - // Query. - // - { - typedef odb::query derived_query; - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // Test query conditions with columns in pointed-to objects from - // multiple tables. - // - { - derived_result qr ( - db->query ( - derived_query::rptr->id == 6 && - derived_query::bptr->id == 8 && - derived_query::bptr->num == 8)); - - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d3); - assert (++i == e); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::query derived_query; - typedef odb::result derived_result; - - typedef odb::query root_query; - typedef odb::result root_result; - - transaction t (db->begin ()); - - // base - // - { - base_result qr ( - db->query ( - base_query::base::num == b2.num && - base_query::base::id == b2.id && - base_query::r::id == b2.rptr->id)); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->b_id == b2.id && - i->r_id == b2.rptr->id && - i->num == b2.num); - assert (++i == e); - } - - // derived - // - { - derived_result qr ( - db->query ( - derived_query::d::str == d3.str && - derived_query::d::num == d3.num && - derived_query::b::num == d3.bptr->num && - derived_query::d::id == d3.id && - derived_query::b::id == d3.bptr->id && - derived_query::r::id == d3.rptr->id)); - - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->d_id == d3.id && - i->b_id == d3.bptr->id && - i->r_id == d3.rptr->id && - i->d_num == d3.num && - i->b_num == d3.bptr->num && - i->str == d3.str); - assert (++i == e); - } - - // root - // - { - root_result qr ( - db->query ( - root_query::r::id.in (b2.rptr->id, d2.rptr->id))); - - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->r_id == d2.rptr->id && - i->d_id == d2.id && - i->str == d2.str); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 4: views. - // - { - using namespace test4; - - base1 b1 (21, 1); - - root2 r2 (11, 0); - base2 b2 (21, 1, "abc"); - - { - transaction t (db->begin ()); - db->persist (b1); - db->persist (r2); - db->persist (b2); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result qr ( - db->query ( - query::base1::num == b1.num)); - - result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->str == "abc"); - assert (++i == e); - } - - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - - { - result qr (db->query ()); - result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->min_num == 1); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 5: polymorphism and optimistic concurrency. - // - { - using namespace test5; - - root r (1, 1); - base b (2, 2, "bbb"); - derived d (3, 3, "ddd"); - - r.strs.push_back ("a"); - r.strs.push_back ("aa"); - r.strs.push_back ("aaa"); - - b.nums.push_back (21); - b.nums.push_back (22); - b.nums.push_back (23); - b.strs.push_back ("b"); - b.strs.push_back ("bb"); - b.strs.push_back ("bbb"); - - d.nums.push_back (31); - d.nums.push_back (32); - d.nums.push_back (33); - d.strs.push_back ("d"); - d.strs.push_back ("dd"); - d.strs.push_back ("ddd"); - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Update. - // - { - transaction t (db->begin ()); - - // Root. - // - { - auto_ptr p (db->load (r.id)); - - r.num++; - r.strs.push_back ("aaaa"); - db->update (r); - - p->num--; - p->strs.pop_back (); - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (r == *p); - } - - // Base. - // - { - auto_ptr p (db->load (b.id)); - - b.num++; - b.str += "b"; - b.strs.push_back ("bbbb"); - b.nums.push_back (24); - db->update (b); - - p->num--; - p->str += "B"; - p->strs.pop_back (); - p->nums.pop_back (); - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (b == *p); - } - - // Derived. - // - { - auto_ptr p (db->load (d.id)); // Via root. - - d.num++; - d.str += "d"; - d.strs.push_back ("dddd"); - d.nums.push_back (24); - d.dnum++; - d.dstr += "d"; - db->update (d); - - derived& d1 (static_cast (*p)); - d1.num--; - d1.str += "D"; - d1.strs.pop_back (); - d1.nums.pop_back (); - d1.dnum--; - d1.dstr += "D"; - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (d == *p); - } - - t.commit (); - } - - // Reload. - // - { - transaction t (db->begin ()); - - // Make sure reload doesn't modify the object if the versions - // match. - // - derived d1 (d); - d1.num++; - d1.str += "d"; - d1.strs.push_back ("dddd"); - d1.nums.push_back (24); - d1.dnum++; - d1.dstr += "d"; - derived d2 (d1); - - db->reload (d1); - assert (d1 == d2); - - t.commit (); - } - - // Erase. - // - { - transaction t (db->begin ()); - - // Root. - // - { - auto_ptr p (db->load (r.id)); - - r.num++; - r.strs.push_back ("aaaaa"); - db->update (r); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Base. - // - { - auto_ptr p (db->load (b.id)); - - b.num++; - b.str += "b"; - b.strs.push_back ("bbbb"); - b.nums.push_back (24); - db->update (b); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Derived. - // - { - auto_ptr p (db->load (d.id)); // Via root. - - d.num++; - d.str += "d"; - d.strs.push_back ("dddd"); - d.nums.push_back (24); - d.dnum++; - d.dstr += "d"; - db->update (d); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Try to update non-existent object. - // - { - try - { - db->update (d); - assert (false); - } - catch (const odb::object_changed&) {} - } - - // Try to erase non-existent object. - // - { - try - { - db->erase (d); - assert (false); - } - catch (const odb::object_changed&) {} - } - - t.commit (); - } - } - - // Test 6: polymorphism and callbacks. - // - { - using namespace test6; - - base b (1, 1, "bbb"); - auto_ptr d (new derived (2, 2, "ddd")); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d->id)); - - db->load (b.id, *pb); - db->load (d->id, *pd); - - db->reload (*pb); - db->reload (*pd); - - t.commit (); - } - - // Update. - // - { - b.num++; - d->num++; - - transaction t (db->begin ()); - db->update (b); - db->update (d); - t.commit (); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ("ORDER BY" + query::id)); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - *i; - - t.commit (); - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (b); - db->erase (d); - t.commit (); - } - - // Recursive (delayed) loading. - // - { - derived d (3, 3, "dddd"); - d.ptr.reset (new derived (4, 4, "ddddd")); - - { - transaction t (db->begin ()); - db->persist (d); - db->persist (d.ptr); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (d.id)); - t.commit (); - } - } - } - - // Test 7: polymorphism and object cache (session). - // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - { - using namespace test7; - - shared_ptr r (new root (1, 1)); - shared_ptr b (new base (2, 2, "b")); - shared_ptr d (new derived (3, 3, "d")); - - // Persist. - // - { - session s; - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - assert (db->load (r->id) == r); - assert (db->load (b->id) == b); - assert (db->load (d->id) == d); - } - - // Load. - // - { - session s; - - transaction t (db->begin ()); - shared_ptr r1 (db->load (r->id)); - shared_ptr b1 (db->load (b->id)); - shared_ptr d1 (db->load (d->id)); - t.commit (); - - assert (db->load (r->id) == r1); - assert (db->load (b->id) == b1); - assert (db->load (d->id) == d1); - - assert (!db->find (b->id)); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - session s; - - transaction t (db->begin ()); - shared_ptr r1 (db->load (r->id)); - shared_ptr b1 (db->load (b->id)); - shared_ptr d1 (db->load (d->id)); - t.commit (); - - { - transaction t (db->begin ()); - - result r (db->query ("ORDER BY" + query::id)); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && i.load () == r1); - assert (++i != e && i.load () == b1); - assert (++i != e && i.load () == d1); - assert (++i == e); - - t.commit (); - } - } - - // Erase. - // - { - session s; - - { - transaction t (db->begin ()); - db->load (r->id); - db->load (b->id); - db->load (d->id); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (r); - db->erase (b); - db->erase (d); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (!db->find (r->id)); - assert (!db->find (b->id)); - assert (!db->find (d->id)); - t.commit (); - } - } - } -#endif - - // Test 8: polymorphism and abstract bases. - // - { - using namespace test8; - - base b (1, 1, "b"); - interm i (2, 2, "i", true); - derived1 d1 (3, 3, "d1", true); - derived2 d2 (4, 4, "d2", false); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d1)); - db->persist (static_cast (d2)); - - try - { - db->persist (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->persist (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - // Load. - // - { - base vb; - interm vi; - derived1 vd1; - derived2 vd2; - - transaction t (db->begin ()); - - // load (id) - // - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d1.id)); - auto_ptr pd2 (db->load (d2.id)); - - assert (*pb == b); - assert (*pd1 == d1); - assert (*pd2 == d2); - - // load (id, obj) - // - db->load (b.id, static_cast (vb)); - db->load (d1.id, static_cast (vd1)); - db->load (d2.id, static_cast (vd2)); - - assert (vb == b); - assert (vd1 == d1); - assert (vd2 == d2); - - try - { - db->load (i.id, static_cast (vi)); - assert (false); - } - catch (const odb::no_type_info&) {} - - // reload (obj) - // - vb.num = 0; - vd1.num = 0; - vd2.num = 0; - - db->reload (static_cast (vb)); - db->reload (static_cast (vd1)); - db->reload (static_cast (vd2)); - - assert (vb == b); - assert (vd1 == d1); - assert (vd2 == d2); - - try - { - db->reload (static_cast (vi)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - // Update. - // - { - b.num++; - b.str += 'b'; - d1.num++; - d1.str += "d1"; - d2.num++; - d2.str += "d1"; - - { - transaction t (db->begin ()); - db->update (static_cast (b)); - db->update (d1); - db->update (static_cast (d2)); - - try - { - db->update (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->update (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d1.id)); - auto_ptr pd2 (db->load (d2.id)); - t.commit (); - - assert (*pb == b); - assert (*pd1 == d1); - assert (*pd2 == d2); - } - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (b); - db->erase (d1.id); - db->erase (static_cast (d2)); - - try - { - db->erase (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->erase (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - } - - // Test 9: polymorphism and readonly classes. - // - { - using namespace test9; - - ro_root ro_r (1, 1); - rw_base rw_b (2, 2, "b"); - ro_derived ro_d (3, 3, "d"); - - rw_root rw_r (1, 1); - ro_base ro_b (2, 2, "b"); - rw_derived rw_d (3, 3, "d"); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (ro_r); - db->persist (rw_b); - db->persist (ro_d); - - db->persist (rw_r); - db->persist (ro_b); - db->persist (rw_d); - t.commit (); - } - - // Update. - // - { - ro_root ro_r1 (ro_r); - rw_base rw_b1 (rw_b); - ro_derived ro_d1 (ro_d); - - ro_base ro_b1 (ro_b); - rw_derived rw_d1 (rw_d); - - ro_r1.num++; - ro_r1.strs.push_back ("b"); - - rw_b1.num++; - rw_b1.strs.push_back ("b"); - rw_b1.str += "b"; - rw_b1.nums.push_back (2); - rw_b.str += "b"; - rw_b.nums.push_back (2); - - ro_d1.num++; - ro_d1.strs.push_back ("d"); - ro_d1.str += "d"; - ro_d1.nums.push_back (3); - ro_d1.dnum++; - ro_d1.dstr += "d"; - - rw_r.num++; - rw_r.strs.push_back ("b"); - - ro_b1.num++; - ro_b1.strs.push_back ("b"); - ro_b1.str += "b"; - ro_b1.nums.push_back (2); - - rw_d1.num++; - rw_d1.strs.push_back ("d"); - rw_d1.str += "d"; - rw_d1.nums.push_back (3); - rw_d1.dnum++; - rw_d1.dstr += "d"; - rw_d.dnum++; - rw_d.dstr += "d"; - - { - // These should be no-ops. - // - db->update (ro_r1); - db->update (static_cast (ro_d1)); - db->update (ro_b1); - - transaction t (db->begin ()); - db->update (static_cast (rw_b1)); - db->update (rw_r); - db->update (static_cast (rw_d1)); - t.commit (); - } - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p_ro_r (db->load (ro_r.id)); - auto_ptr p_rw_b (db->load (rw_b.id)); - auto_ptr p_ro_d (db->load (ro_d.id)); - - auto_ptr p_rw_r (db->load (rw_r.id)); - auto_ptr p_ro_b (db->load (ro_b.id)); - auto_ptr p_rw_d (db->load (rw_d.id)); - t.commit (); - - assert (*p_ro_r == ro_r); - assert (*p_rw_b == rw_b); - assert (*p_ro_d == ro_d); - - assert (*p_rw_r == rw_r); - assert (*p_ro_b == ro_b); - assert (*p_rw_d == rw_d); - } - } - - // Test 10: empty polymorphic classes. - // - { - using namespace test10; - - base b (1, 1); - derived d (2, 2); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Update. - // - { - b.num++; - d.num++; - - transaction t (db->begin ()); - db->update (static_cast (b)); - db->update (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - } - - // Test 11: reuse and polymorphic inheritance. - // - { - using namespace test11; - - base b (1, 1, "b"); - derived d (2, 2, "d"); - - b.strs.push_back ("b"); - b.nums.push_back (1); - - d.strs.push_back ("d"); - d.nums.push_back (1); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Update. - // - { - b.num++; - b.str += "b"; - b.strs.push_back ("bb"); - b.nums.push_back (2); - - d.num++; - d.str += "d"; - d.strs.push_back ("dd"); - d.nums.push_back (2); - d.dnum++; - d.dstr += "d"; - - transaction t (db->begin ()); - db->update (b); - db->update (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Query. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::query derived_query; - typedef odb::result derived_result; - - transaction t (db->begin ()); - - { - base_result qr (db->query (base_query::num == 2)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == b); - assert (++i == e); - } - - { - derived_result qr (db->query (derived_query::num == 3)); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 12: polymorphic objects with auto id. - // - { - using namespace test12; - - base b (1); - derived d (2); - - unsigned long id1, id2; - - // Persist. - // - { - transaction t (db->begin ()); - id1 = db->persist (b); - id2 = db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr pb (db->load (id1)); - auto_ptr pd (db->load (id2)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/polymorphism/makefile b/common/polymorphism/makefile deleted file mode 100644 index 6a8b72a..0000000 --- a/common/polymorphism/makefile +++ /dev/null @@ -1,118 +0,0 @@ -# file : common/polymorphism/makefile -# copyright : Copyright (c) 2009-2012 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 := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -gen := $(addprefix $(out_base)/,$(genf)) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix poly_ -$(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 odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): schemas := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.sql)) -$(test): $(driver) $(src_base)/test.std - $(call schema,$(schemas)) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/polymorphism/test.std b/common/polymorphism/test.std deleted file mode 100644 index 5c18191..0000000 --- a/common/polymorphism/test.std +++ /dev/null @@ -1,36 +0,0 @@ -base pre_persist 1 const -base post_persist 1 const -derived pre_persist 2 const -derived post_persist 2 const -base pre_load 0 -base post_load 1 -derived pre_load 0 const -derived post_load 2 const -base pre_load 1 -base post_load 1 -derived pre_load 2 const -derived post_load 2 const -base pre_load 1 -base post_load 1 -derived pre_load 2 const -derived post_load 2 const -base pre_update 1 const -base post_update 1 const -derived pre_update 2 const -derived post_update 2 const -base pre_load 0 -base post_load 1 -derived pre_load 0 const -derived post_load 2 const -base pre_erase 1 const -base post_erase 1 const -derived pre_erase 2 const -derived post_erase 2 const -derived pre_persist 3 const -derived post_persist 3 const -derived pre_persist 4 const -derived post_persist 4 const -derived pre_load 0 const -derived pre_load 0 const -derived post_load 4 const -derived post_load 3 const diff --git a/common/polymorphism/test1.hxx b/common/polymorphism/test1.hxx deleted file mode 100644 index e6db3f4..0000000 --- a/common/polymorphism/test1.hxx +++ /dev/null @@ -1,116 +0,0 @@ -// file : common/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#include -#include -#include - -#include - -// Test basic polymorphism functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // Views. - // - #pragma db view object(root) - struct root_view - { - //#pragma db column(root::typeid_) - std::string typeid_; // @@ tmp - - unsigned long num; - }; - - #pragma db view object(base = b) - struct base_view - { - unsigned long id; - unsigned long num; - std::string str; - }; - - #pragma db view object(derived) - struct derived_view - { - unsigned long num; - std::string str; - unsigned long dnum; - std::string dstr; - }; -} - -#endif // TEST1_HXX diff --git a/common/polymorphism/test10.hxx b/common/polymorphism/test10.hxx deleted file mode 100644 index be7d3c0..0000000 --- a/common/polymorphism/test10.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// file : common/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST10_HXX -#define TEST10_HXX - -#include - -#include - -// Test empty polymorphic classes. -// -#pragma db namespace table("t10_") -namespace test10 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n): root (i), num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n): base (i, n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -#endif // TEST10_HXX diff --git a/common/polymorphism/test11.hxx b/common/polymorphism/test11.hxx deleted file mode 100644 index 58a4ff4..0000000 --- a/common/polymorphism/test11.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// file : common/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST11_HXX -#define TEST11_HXX - -#include -#include -#include - -#include - -// Test mixing reuse and polymorphic inheritance. -// -#pragma db namespace table("t11_") -namespace test11 -{ - #pragma db object abstract - struct root - { - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - }; - - #pragma db object polymorphic - struct base: root - { - virtual ~base () {} - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (base)) - return false; - - return id == b.id && num == b.num && strs == b.strs && - str == b.str && nums == b.nums; - } - }; - - inline bool - operator== (const base& x, const base& y) {return x.compare (y);} - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (derived)) - return false; - - const derived& d (static_cast (b)); - return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST11_HXX diff --git a/common/polymorphism/test12.hxx b/common/polymorphism/test12.hxx deleted file mode 100644 index 5feb2bb..0000000 --- a/common/polymorphism/test12.hxx +++ /dev/null @@ -1,80 +0,0 @@ -// file : common/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST12_HXX -#define TEST12_HXX - -#include - -#include - -// Test polymorphic classes with private auto id. -// -#pragma db namespace table("t12_") -namespace test12 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id_ == r.id_; - } - - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id auto access(id) - unsigned long id_; - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long n): num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long n): base (n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -#endif // TEST12_HXX diff --git a/common/polymorphism/test2.hxx b/common/polymorphism/test2.hxx deleted file mode 100644 index 1b81f41..0000000 --- a/common/polymorphism/test2.hxx +++ /dev/null @@ -1,106 +0,0 @@ -// file : common/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include -#include - -#include -#include - -// Test inverse object pointers in polymorhic bases. -// -#pragma db namespace table("t2_") -namespace test2 -{ - struct root; - - #pragma db object - struct root_pointer - { - root_pointer (root* r = 0): p (r) {} - - #pragma db id auto - unsigned long id; - - root* p; - }; - - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(p) - odb::lazy_ptr rp; - }; - - struct base; - - #pragma db object - struct base_pointer - { - base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} - - #pragma db id auto - unsigned long id; - - std::vector vp; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, const std::string& s): root (i), str (s) {} - - std::string str; - - #pragma db inverse(vp) - odb::lazy_ptr bp; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, const std::string& s, unsigned long n) - : base (i, s), num (n) {} - - unsigned long num; - }; - - // Views. - // - #pragma db view object(root_pointer = rp) object(root) - struct root_view - { - #pragma db column(rp::id) - unsigned long rp_id; - - #pragma db column(root::id) - unsigned long r_id; - }; - - #pragma db view object(base_pointer) object(base = b) - struct base_view - { - #pragma db column(base_pointer::id) - unsigned long bp_id; - - #pragma db column(b::id) - unsigned long b_id; - - std::string str; - }; -} - -#endif // TEST2_HXX diff --git a/common/polymorphism/test3.hxx b/common/polymorphism/test3.hxx deleted file mode 100644 index 9a9a269..0000000 --- a/common/polymorphism/test3.hxx +++ /dev/null @@ -1,147 +0,0 @@ -// file : common/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#include -#include - -#include - -// Test delayed loading. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - virtual ~base () {delete rptr;} - base (): rptr (0) {} - base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} - - unsigned long num; - root* rptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return - root::compare (r, false) && - num == b.num && - ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); - } - }; - - #pragma db object - struct derived: base - { - virtual ~derived () {delete bptr;} - derived (): bptr (0) {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n), str (s), bptr (0) {} - - std::string str; - base* bptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return - base::compare (r, false) && - str == d.str && - ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); - } - }; - - // Views. - // - #pragma db view object(base) object(root = r) - struct base_view - { - #pragma db column(base::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - unsigned long num; - }; - - #pragma db view \ - object(derived = d) \ - object(base = b) \ - object(root = r: d::rptr) - struct derived_view - { - #pragma db column(d::id) - unsigned long d_id; - - #pragma db column(b::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::num) - unsigned long d_num; - - #pragma db column(b::num) - unsigned long b_num; - - std::string str; - }; - - // This is an example of a pathological case, where the right-hand-side - // of the join condition comes from one of the bases. As a result, we - // join the base table first, which means we will get both bases and - // derived objects instead of just derived. - // - //#pragma db view object(root = r) object(derived = d) - #pragma db view object(derived = d) object(root = r) - struct root_view - { - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::id) - unsigned long d_id; - - std::string str; - }; -} - -#endif // TEST3_HXX diff --git a/common/polymorphism/test4.hxx b/common/polymorphism/test4.hxx deleted file mode 100644 index d9eba86..0000000 --- a/common/polymorphism/test4.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : common/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST4_HXX -#define TEST4_HXX - -#include - -#include - -// Test views. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object polymorphic - struct root1 - { - virtual ~root1 () {} - root1 () {} - root1 (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - }; - - #pragma db object - struct base1: root1 - { - base1 () {} - base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} - - unsigned long num; - }; - - #pragma db object polymorphic - struct root2 - { - virtual ~root2 () {} - root2 () {} - root2 (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base2: root2 - { - base2 () {} - base2 (unsigned long i, unsigned long n, const std::string& s) - : root2 (i, n), str (s) {} - - std::string str; - }; - - // Test custom join condition. - // - #pragma db view object(base2) object(base1: base2::num == base1::num) - struct view1 - { - std::string str; - }; - - #pragma db view object(base2) - struct view2 - { - #pragma db column("min(" + base2::num + ")") - std::size_t min_num; - }; -} - -#endif // TEST4_HXX diff --git a/common/polymorphism/test5.hxx b/common/polymorphism/test5.hxx deleted file mode 100644 index ede75a0..0000000 --- a/common/polymorphism/test5.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// file : common/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST5_HXX -#define TEST5_HXX - -#include -#include -#include -#include - -#include - -// Test polymorphism and optimistic concurrency. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object polymorphic optimistic pointer(std::auto_ptr) - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - #pragma db version - unsigned long version; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && version == r.version && - num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST5_HXX diff --git a/common/polymorphism/test6.hxx b/common/polymorphism/test6.hxx deleted file mode 100644 index 9ecef40..0000000 --- a/common/polymorphism/test6.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// file : common/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST6_HXX -#define TEST6_HXX - -#include -#include - -#include -#include - -// Test polymorphism and callbacks. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object polymorphic pointer(std::auto_ptr) - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object callback(db_callback) - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - - void - db_callback (odb::callback_event, odb::database&); - - void - db_callback (odb::callback_event, odb::database&) const; - }; - - #pragma db object callback(db_callback) - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - std::auto_ptr ptr; - - void - db_callback (odb::callback_event, odb::database&) const; - }; -} - -#endif // TEST6_HXX diff --git a/common/polymorphism/test7.hxx b/common/polymorphism/test7.hxx deleted file mode 100644 index 1d3a807..0000000 --- a/common/polymorphism/test7.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// file : common/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST7_HXX -#define TEST7_HXX - -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#include -#include - -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - -#include - -// Test polymorphism and object cache (session). -// -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -#pragma db namespace table("t7_") -namespace test7 -{ -#ifdef HAVE_CXX11 - using std::shared_ptr; -#else - using std::tr1::shared_ptr; -#endif - - #pragma db object polymorphic pointer(shared_ptr) session - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - }; -} -#endif - -#endif // TEST7_HXX diff --git a/common/polymorphism/test8.hxx b/common/polymorphism/test8.hxx deleted file mode 100644 index adaafc2..0000000 --- a/common/polymorphism/test8.hxx +++ /dev/null @@ -1,130 +0,0 @@ -// file : common/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST8_HXX -#define TEST8_HXX - -#include -#include -#include - -#include - -// Test polymorphism and abstract bases. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object abstract - struct interm: base - { - interm () {} - interm (unsigned long i, unsigned long n, const std::string& s, bool b) - : base (i, n, s), bln (b) {} - - bool bln; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (interm)) - return false; - - const interm& i (static_cast (r)); - return base::compare (r, false) && bln == i.bln; - } - }; - - #pragma db object - struct derived1: interm - { - derived1 () {} - derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dnum (n + 1) {} - - unsigned long dnum; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived1)) - return false; - - const derived1& d (static_cast (r)); - return interm::compare (r, false) && dnum == d.dnum; - } - }; - - #pragma db object - struct derived2: interm - { - derived2 () {} - derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dstr (s + 'd') {} - - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived2)) - return false; - - const derived2& d (static_cast (r)); - return interm::compare (r, false) && dstr == d.dstr; - } - }; -} - -#endif // TEST8_HXX diff --git a/common/polymorphism/test9.hxx b/common/polymorphism/test9.hxx deleted file mode 100644 index d1496c1..0000000 --- a/common/polymorphism/test9.hxx +++ /dev/null @@ -1,162 +0,0 @@ -// file : common/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST9_HXX -#define TEST9_HXX - -#include -#include -#include - -#include - -// Test polymorphism and readonly classes. -// -#pragma db namespace table("t9_") -namespace test9 -{ - // - // ro_root, rw_base, ro_derived - // - #pragma db object polymorphic readonly - struct ro_root - { - virtual ~ro_root () {} - ro_root () {} - ro_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} - - #pragma db object - struct rw_base: ro_root - { - rw_base () {} - rw_base (unsigned long i, unsigned long n, const std::string& s) - : ro_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_base)) - return false; - - const rw_base& b (static_cast (r)); - return ro_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object readonly - struct ro_derived: rw_base - { - ro_derived () {} - ro_derived (unsigned long i, unsigned long n, const std::string& s) - : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_derived)) - return false; - - const ro_derived& d (static_cast (r)); - return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // - // rw_root, ro_base, rw_derived - // - #pragma db object polymorphic - struct rw_root - { - virtual ~rw_root () {} - rw_root () {} - rw_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} - - #pragma db object readonly - struct ro_base: rw_root - { - ro_base () {} - ro_base (unsigned long i, unsigned long n, const std::string& s) - : rw_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_base)) - return false; - - const ro_base& b (static_cast (r)); - return rw_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct rw_derived: ro_base - { - rw_derived () {} - rw_derived (unsigned long i, unsigned long n, const std::string& s) - : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_derived)) - return false; - - const rw_derived& d (static_cast (r)); - return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST9_HXX -- cgit v1.1 From 3d1969a43fce72dd50044c5eada38557f3f200bd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 16:09:08 +0200 Subject: Ground work for multi-database support All generated code now includes database id. The database-specific database class interface has been updated to include all the database operations. The database-specific tests now use this interface. --- common/readonly/driver.cxx | 6 +++--- libcommon/common/common.hxx | 12 ++++++++++++ mssql/custom/driver.cxx | 7 ++++--- mssql/custom/query.hxx | 34 +++++++++++++++++----------------- mssql/database/driver.cxx | 3 ++- mssql/native/driver.cxx | 5 +++-- mssql/query/driver.cxx | 7 ++++--- mssql/template/driver.cxx | 5 +++-- mssql/types/driver.cxx | 7 ++++--- mysql/custom/driver.cxx | 7 ++++--- mysql/custom/query.hxx | 34 +++++++++++++++++----------------- mysql/database/driver.cxx | 3 ++- mysql/index/driver.cxx | 5 +++-- mysql/native/driver.cxx | 5 +++-- mysql/template/driver.cxx | 5 +++-- mysql/truncation/driver.cxx | 11 ++++++----- mysql/types/driver.cxx | 5 +++-- oracle/custom/driver.cxx | 5 +++-- oracle/database/driver.cxx | 3 ++- oracle/native/driver.cxx | 5 +++-- oracle/template/driver.cxx | 5 +++-- oracle/types/driver.cxx | 9 +++++---- pgsql/custom/driver.cxx | 7 ++++--- pgsql/custom/query.hxx | 34 +++++++++++++++++----------------- pgsql/database/driver.cxx | 3 ++- pgsql/index/driver.cxx | 7 ++++--- pgsql/native/driver.cxx | 6 ++++-- pgsql/template/driver.cxx | 5 +++-- pgsql/truncation/driver.cxx | 9 +++++---- pgsql/types/driver.cxx | 5 +++-- sqlite/custom/driver.cxx | 5 +++-- sqlite/database/driver.cxx | 3 ++- sqlite/native/driver.cxx | 6 ++++-- sqlite/template/driver.cxx | 5 +++-- sqlite/truncation/driver.cxx | 11 ++++++----- sqlite/types/driver.cxx | 8 ++++---- 36 files changed, 173 insertions(+), 129 deletions(-) diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index b67ed4f..2e692cf 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -204,9 +204,9 @@ main (int argc, char* argv[]) // Readonly object. // { - typedef odb::object_traits so_traits; - typedef odb::object_traits ro_traits; - typedef odb::object_traits rw_traits; + typedef odb::object_traits_impl so_traits; + typedef odb::object_traits_impl ro_traits; + typedef odb::object_traits_impl rw_traits; assert (so_traits::column_count == so_traits::id_column_count + so_traits::readonly_column_count); diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 8ff02d3..2b79a5a 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -25,6 +25,18 @@ create_database (int& argc, bool create_schema = true, std::size_t max_connections = 0); +template +std::auto_ptr +create_specific_database (int& argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0) +{ + std::auto_ptr r ( + create_database (argc, argv, create_schema, max_connections)); + return std::auto_ptr (&dynamic_cast (*r.release ())); +} + // This function returns an accurate result only if the result iterator // hasn't been advanced. // diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 7b0891d..3e69f97 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); @@ -58,7 +59,7 @@ main (int argc, char* argv[]) // Query. // - typedef odb::query query; + typedef mssql::query query; typedef odb::result result; { diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index 21dee89..0c5f1f2 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -38,18 +38,18 @@ namespace odb // is_null, is_not_null // public: - query + query_base is_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NULL"; return q; } - query + query_base is_not_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NOT NULL"; return q; } @@ -57,63 +57,63 @@ namespace odb // = // public: - query + query_base equal (const point& v) const { return equal (val_bind (v)); } - query + query_base equal (val_bind v) const { - query q (table_, column_); + query_base q (table_, column_); q += ".STEquals("; q.append (v, conversion_); q += ") = 1"; return q; } - query + query_base equal (ref_bind r) const { - query q (table_, column_); + query_base q (table_, column_); q += ".STEquals("; q.append (r, conversion_); q += ") = 1"; return q; } - friend query + friend query_base operator== (const query_column& c, const point& v) { return c.equal (v); } - friend query + friend query_base operator== (const point& v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, val_bind v) { return c.equal (v); } - friend query + friend query_base operator== (val_bind v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, ref_bind r) { return c.equal (r); } - friend query + friend query_base operator== (ref_bind r, const query_column& c) { return c.equal (r); @@ -122,10 +122,10 @@ namespace odb // Column comparison. // public: - query + query_base operator== (const query_column& c) const { - query q (table_, column_); + query_base q (table_, column_); q += ".STEquals("; q.append (c.table (), c.column ()); q += ") = 1"; diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 747fc98..7f8aa8f 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -7,7 +7,8 @@ #include -using namespace odb::mssql; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 097a72d..710c3c5 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -15,14 +15,15 @@ #include using namespace std; -using namespace odb::core; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index 03e97af..03b3284 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); { object o1; @@ -63,7 +64,7 @@ main (int argc, char* argv[]) t.commit (); } - typedef odb::query query; + typedef mssql::query query; typedef odb::result result; { diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 4c7ff97..26488fc 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index cd5523d..6390950 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mssql = odb::mssql; +using namespace mssql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); { object o (1); @@ -130,7 +131,7 @@ main (int argc, char* argv[]) // Test short/long data in queries. // - typedef odb::query query; + typedef mssql::query query; typedef odb::result result; { diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index b591095..83aac7e 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); o.p = point (1.1111, 2222222222.2); @@ -53,7 +54,7 @@ main (int argc, char* argv[]) // Query. // - typedef odb::query query; + typedef mysql::query query; typedef odb::result result; { diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index 110624a..ccd00e7 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -35,18 +35,18 @@ namespace odb // is_null, is_not_null // public: - query + query_base is_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NULL"; return q; } - query + query_base is_not_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NOT NULL"; return q; } @@ -54,61 +54,61 @@ namespace odb // = // public: - query + query_base equal (const point& v) const { return equal (val_bind (v)); } - query + query_base equal (val_bind v) const { - query q (table_, column_); + query_base q (table_, column_); q += "="; q.append (v, conversion_); return q; } - query + query_base equal (ref_bind r) const { - query q (table_, column_); + query_base q (table_, column_); q += "="; q.append (r, conversion_); return q; } - friend query + friend query_base operator== (const query_column& c, const point& v) { return c.equal (v); } - friend query + friend query_base operator== (const point& v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, val_bind v) { return c.equal (v); } - friend query + friend query_base operator== (val_bind v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, ref_bind r) { return c.equal (r); } - friend query + friend query_base operator== (ref_bind r, const query_column& c) { return c.equal (r); @@ -117,10 +117,10 @@ namespace odb // Column comparison. // public: - query + query_base operator== (const query_column& c) const { - query q (table_, column_); + query_base q (table_, column_); q += "="; q.append (c.table (), c.column ()); return q; diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index e9b625d..f385b3f 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -10,7 +10,8 @@ #include using std::string; -using namespace odb::mysql; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index b1e8e54..3b1a1af 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) @@ -27,7 +28,7 @@ main (int argc, char* argv[]) { // This is just a schema creation test. // - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); { transaction t (db->begin ()); diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index a8d2f5f..9eaf504 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -15,14 +15,15 @@ #include using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 636af43..0789891 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 43f18b3..da870d0 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -19,7 +19,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) @@ -34,7 +35,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -99,10 +100,10 @@ main (int argc, char* argv[]) // Test query. // { - typedef odb::query query; + typedef mysql::query query; typedef odb::result result; - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/query so that the initial bindings are established // (version == 0). @@ -157,7 +158,7 @@ main (int argc, char* argv[]) // Test containers. // { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Use different connections to persist and load the object. // diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 493c5c2..d2f159c 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace mysql = odb::mysql; +using namespace mysql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index 2425b29..16b81da 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace oracle = odb::oracle; +using namespace oracle; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); o.iv.push_back (123); diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index d6846b6..53dda69 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -7,7 +7,8 @@ #include -using namespace odb::oracle; +namespace oracle = odb::oracle; +using namespace oracle; int main (int argc, char* argv[]) diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 0e90ff0..9530692 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -15,14 +15,15 @@ #include using namespace std; -using namespace odb::core; +namespace oracle = odb::oracle; +using namespace oracle; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 44b4f83..35a2b39 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace oracle = odb::oracle; +using namespace oracle; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 7c3e6bd..be6251c 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace oracle = odb::oracle; +using namespace oracle; int main (int argc, char* argv[]) @@ -28,7 +29,7 @@ main (int argc, char* argv[]) // Create an Oracle database instance, setting both the client database // and national character set to UTF-8. // - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); @@ -206,7 +207,7 @@ main (int argc, char* argv[]) // Test image copying with LOB data. // { - typedef odb::query query; + typedef oracle::query query; typedef odb::result result; transaction t (db->begin ()); @@ -235,7 +236,7 @@ main (int argc, char* argv[]) // Test descriptor management in TIMESTAMP and INTERVAL images. // { - typedef odb::query query; + typedef oracle::query query; typedef odb::result result; query q (query::timestamp == o.timestamp_ && diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index f1f70f8..7188f74 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); o.p = point (1.1111, 2222222222.2); @@ -61,7 +62,7 @@ main (int argc, char* argv[]) // Query. // - typedef odb::query query; + typedef pgsql::query query; typedef odb::result result; { diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index 4b29b45..432d25b 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -34,18 +34,18 @@ namespace odb // is_null, is_not_null // public: - query + query_base is_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NULL"; return q; } - query + query_base is_not_null () const { - query q (table_, column_); + query_base q (table_, column_); q += "IS NOT NULL"; return q; } @@ -53,61 +53,61 @@ namespace odb // = // public: - query + query_base equal (const point& v) const { return equal (val_bind (v)); } - query + query_base equal (val_bind v) const { - query q (table_, column_); + query_base q (table_, column_); q += "~="; q.append (v, conversion_); return q; } - query + query_base equal (ref_bind r) const { - query q (table_, column_); + query_base q (table_, column_); q += "~="; q.append (r, conversion_); return q; } - friend query + friend query_base operator== (const query_column& c, const point& v) { return c.equal (v); } - friend query + friend query_base operator== (const point& v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, val_bind v) { return c.equal (v); } - friend query + friend query_base operator== (val_bind v, const query_column& c) { return c.equal (v); } - friend query + friend query_base operator== (const query_column& c, ref_bind r) { return c.equal (r); } - friend query + friend query_base operator== (ref_bind r, const query_column& c) { return c.equal (r); @@ -116,10 +116,10 @@ namespace odb // Column comparison. // public: - query + query_base operator== (const query_column& c) const { - query q (table_, column_); + query_base q (table_, column_); q += "~="; q.append (c.table (), c.column ()); return q; diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 8746c37..68c34ab 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -7,7 +7,8 @@ #include -using namespace odb::pgsql; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 48ac5f8..4c46b58 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,4 +1,4 @@ -// file : pgsql/template/driver.cxx +// file : pgsql/index/driver.cxx // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) @@ -27,7 +28,7 @@ main (int argc, char* argv[]) { // This is just a schema creation test. // - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); { transaction t (db->begin ()); diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 94bda60..3e4b680 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -10,18 +10,20 @@ #include #include +#include #include using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 329c91c..9297ab0 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index eefbdcd..fe72780 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) @@ -33,7 +34,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -98,10 +99,10 @@ main (int argc, char* argv[]) // Test query. // { - typedef odb::query query; + typedef pgsql::query query; typedef odb::result result; - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/query so that the initial bindings are established // (version == 0). diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 8b51cc5..8b969aa 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace pgsql = odb::pgsql; +using namespace pgsql; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 9e387b0..d189767 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); o.nv.push_back ("123"); // INTEGER diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index cb531c6..6e09d30 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -9,7 +9,8 @@ #include -using namespace odb::sqlite; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 30f0197..91b04e6 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -15,14 +15,16 @@ #include using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + auto_ptr db ( + create_specific_database (argc, argv, false)); // Create the database schema. // diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index 83766fd..c7979df 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -18,14 +18,15 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // // diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index c8b9dab..70fde25 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -18,7 +18,8 @@ #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) @@ -33,7 +34,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -98,10 +99,10 @@ main (int argc, char* argv[]) // Test query. // { - typedef odb::query query; - typedef odb::result result; + auto_ptr db (create_specific_database (argc, argv)); - auto_ptr db (create_database (argc, argv)); + typedef sqlite::query query; + typedef odb::result result; // Run persist/query so that the initial bindings are established // (version == 0). diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index ac8c8d4..69e8473 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -13,21 +13,21 @@ #include #include -#include #include #include "test.hxx" #include "test-odb.hxx" using namespace std; -using namespace odb::core; +namespace sqlite = odb::sqlite; +using namespace sqlite; int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_specific_database (argc, argv)); object o (1); @@ -58,7 +58,7 @@ main (int argc, char* argv[]) assert (o == *o1); } - typedef odb::query query; + typedef sqlite::query query; typedef odb::result result; #ifdef _WIN32 -- cgit v1.1 From 3fd1098c70a36cdffa256b6d9fd721cf95c6f482 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Oct 2012 11:33:50 +0200 Subject: Initial support for prepared queries --- common/makefile | 1 + common/prepared/driver.cxx | 75 +++++++++++++++++++++++++++++ common/prepared/makefile | 115 +++++++++++++++++++++++++++++++++++++++++++++ common/prepared/test.hxx | 26 ++++++++++ common/prepared/test.std | 0 5 files changed, 217 insertions(+) create mode 100644 common/prepared/driver.cxx create mode 100644 common/prepared/makefile create mode 100644 common/prepared/test.hxx create mode 100644 common/prepared/test.std diff --git a/common/makefile b/common/makefile index 6f187fb..1de430d 100644 --- a/common/makefile +++ b/common/makefile @@ -32,6 +32,7 @@ lifecycle \ no-id \ optimistic \ pragma \ +prepared \ query \ readonly \ relationship \ diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx new file mode 100644 index 0000000..24a3788 --- /dev/null +++ b/common/prepared/driver.cxx @@ -0,0 +1,75 @@ +// file : common/prepared/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test prepared query functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + person p1 ("John First", 91); + person p2 ("John Second", 81); + person p3 ("John Third", 71); + person p4 ("John Fourth", 61); + person p5 ("John Fifth", 51); + + transaction t (db->begin ()); + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + db->persist (p5); + t.commit (); + } + + typedef odb::query query; + typedef odb::prepared_query prep_query; + typedef odb::result result; + + // Simple case: uncached query. + // + { + transaction t (db->begin ()); + + unsigned short age (90); + prep_query pq ( + t.connection ().prepare_query ( + "person-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + result r (pq.execute ()); + assert (size (r) == i); + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/prepared/makefile b/common/prepared/makefile new file mode 100644 index 0000000..6da88d3 --- /dev/null +++ b/common/prepared/makefile @@ -0,0 +1,115 @@ +# file : common/prepared/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --omit-unprepared --table-prefix prepared_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx new file mode 100644 index 0000000..734b138 --- /dev/null +++ b/common/prepared/test.hxx @@ -0,0 +1,26 @@ +// file : common/prepared/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct person +{ + person () {} + person (const std::string& name, unsigned short age) + : name_ (name), age_ (age) {} + + #pragma db id auto + unsigned long id_; + + std::string name_; + unsigned short age_; +}; + +#endif // TEST_HXX diff --git a/common/prepared/test.std b/common/prepared/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From f2e4c2c70344dd1a98593cfbe9256d1b3ed54f27 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 12 Oct 2012 17:24:45 +0200 Subject: Completion of prepared query support --- common/inheritance/polymorphism/makefile | 2 +- common/prepared/driver.cxx | 276 ++++++++++++++++++++++++++++++- common/prepared/makefile | 2 +- common/prepared/test.hxx | 7 + common/query/makefile | 2 +- common/threads/driver.cxx | 20 ++- common/threads/makefile | 2 +- common/view/makefile | 2 +- 8 files changed, 304 insertions(+), 9 deletions(-) diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 5796d49..10e0a01 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inherit_p_ +--generate-query --generate-prepared --table-prefix inherit_p_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 24a3788..6738e6b 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -5,7 +5,8 @@ // Test prepared query functionality. // -#include // std::auto_ptr +#include // std::auto_ptr, std::unique_ptr +#include // std::move #include #include @@ -13,6 +14,7 @@ #include #include +#include // HAVE_CXX11 #include "test.hxx" #include "test-odb.hxx" @@ -20,6 +22,26 @@ using namespace std; using namespace odb::core; +struct params +{ + unsigned short age; + std::string name; +}; + +static void +query_factory (const char* name, connection& c) +{ + typedef odb::query query; + + auto_ptr p (new params); + prepared_query pq ( + c.prepare_query ( + name, + query::age > query::_ref (p->age) && + query::name != query::_ref (p->name))); + c.cache_query (pq, p); +} + int main (int argc, char* argv[]) { @@ -47,14 +69,14 @@ main (int argc, char* argv[]) typedef odb::prepared_query prep_query; typedef odb::result result; - // Simple case: uncached query. + // Uncached query. // { transaction t (db->begin ()); unsigned short age (90); prep_query pq ( - t.connection ().prepare_query ( + db->prepare_query ( "person-age-query", query::age > query::_ref (age))); @@ -64,6 +86,254 @@ main (int argc, char* argv[]) assert (size (r) == i); } + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); + assert (++i == r.end ()); + + t.commit (); + } + + // Cached query without parameters. + // + { + for (unsigned short i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + prep_query pq (db->lookup_query ("person-val-age-query")); + + if (!pq) + { + assert (i == 1); + pq = db->prepare_query ( + "person-val-age-query", + query::age > 90); + db->cache_query (pq); + prep_query pq1 (db->lookup_query ("person-val-age-query")); + } + else if (i == 2) + { + try + { + db->cache_query (pq); + assert (false); + } + catch (const odb::prepared_already_cached&) + { + } + } + + result r (pq.execute ()); + assert (size (r) == 1); + + t.commit (); + } + } + + // Cached query with parameters. + // + { + for (unsigned short i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + unsigned short* age; + prep_query pq (db->lookup_query ("person-ref-age-query", age)); + + if (!pq) + { + assert (i == 1); + +#ifdef HAVE_CXX11 + unique_ptr p (new unsigned short); +#else + auto_ptr p (new unsigned short); +#endif + age = p.get (); + pq = db->prepare_query ( + "person-ref-age-query", + query::age > query::_ref (*age)); + +#ifdef HAVE_CXX11 + db->cache_query (pq, move (p)); +#else + db->cache_query (pq, p); +#endif + } + else if (i == 2) + { + // Object type mismatch. + // + try + { + db->lookup_query ("person-ref-age-query", age); + assert (false); + } + catch (const odb::prepared_type_mismatch&) + { + } + + // Parameters type mismatch. + // + try + { + int* age; + db->lookup_query ("person-ref-age-query", age); + assert (false); + } + catch (const odb::prepared_type_mismatch&) + { + } + } + + *age = 100 - i * 10; + result r (pq.execute ()); + assert (size (r) == i); + + t.commit (); + } + } + + // Cached query with factory. + // + { + db->query_factory ("person-params-query", &query_factory); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("person-params-query", 0); + } + + // Cached query with wildcard factory. + // + { + db->query_factory ("", &query_factory); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query-1", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("", 0); + } + + // Cached query with lambda factory. + // +#ifdef HAVE_CXX11 + { + db->query_factory ( + "person-params-query-2", + [] (const char* name, connection& c) + { + auto_ptr p (new params); + prepared_query pq ( + c.prepare_query ( + name, + query::age > query::_ref (p->age) && + query::name != query::_ref (p->name))); + c.cache_query (pq, p); + }); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query-2", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("person-params-query-2", 0); + } +#endif + + // View prepared query. + // + { + typedef odb::query query; + typedef odb::prepared_query prep_query; + typedef odb::result result; + + transaction t (db->begin ()); + + unsigned short age (90); + prep_query pq ( + db->prepare_query ( + "person-view-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + result r (pq.execute ()); + assert (size (r) == i); + } + + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name == "John First" && i->age == 91); + assert (++i == r.end ()); + + t.commit (); + } + + // By-ref parameter image growth. + // + { + transaction t (db->begin ()); + + string name; + prep_query pq ( + db->prepare_query ( + "person-name-query", + query::name != query::_ref (name))); + + { + name = "John First"; + result r (pq.execute ()); + assert (size (r) == 4); + } + + { + name.assign (2048, 'x'); + result r (pq.execute ()); + assert (size (r) == 5); + } + t.commit (); } } diff --git a/common/prepared/makefile b/common/prepared/makefile index 6da88d3..4126b54 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --omit-unprepared --table-prefix prepared_ +--generate-query --generate-prepared --omit-unprepared --table-prefix prepared_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 734b138..7ea0ce8 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -23,4 +23,11 @@ struct person unsigned short age_; }; +#pragma db view object(person) +struct person_view +{ + std::string name; + unsigned short age; +}; + #endif // TEST_HXX diff --git a/common/query/makefile b/common/query/makefile index 8cfbb95..6f25ba4 100644 --- a/common/query/makefile +++ b/common/query/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_query_ +--generate-query --generate-prepared --table-prefix t_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index dc4de0d..b8a66f1 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -96,10 +96,25 @@ struct task for (unsigned long j (0); j < sub_iteration_count; ++j) { typedef odb::query query; + typedef odb::prepared_query prep_query; typedef odb::result result; transaction t (db_.begin ()); - result r (db_.query (query::str == "another value", false)); + + { // @@ TMP + + //result r (db_.query (query::str == "another value", false)); + + prep_query pq (db_.lookup_query ("object-query")); + + if (!pq) + { + pq = db_.prepare_query ( + "object-query", query::str == "another value"); + db_.cache_query (pq); + } + + result r (pq.execute (false)); bool found (false); for (result::iterator i (r.begin ()); i != r.end (); ++i) @@ -111,6 +126,9 @@ struct task } } assert (found); + + } // @@ TMP + t.commit (); } diff --git a/common/threads/makefile b/common/threads/makefile index 3c0a041..a9f2a66 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix threads_ +--generate-query --generate-prepared --table-prefix threads_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/makefile b/common/view/makefile index cf389cc..bb78891 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_view_ +--generate-query --generate-prepared --table-prefix t_view_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 52c34521dcb4778713b922442222cc0e5e413b71 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 13 Oct 2012 10:09:02 +0200 Subject: Add another case to prepared query test --- common/prepared/driver.cxx | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 6738e6b..1ea4108 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -69,7 +69,7 @@ main (int argc, char* argv[]) typedef odb::prepared_query prep_query; typedef odb::result result; - // Uncached query. + // Uncached query in the same transaction. // { transaction t (db->begin ()); @@ -95,6 +95,38 @@ main (int argc, char* argv[]) t.commit (); } + // Uncached query in multiple transaction. + // + { + connection_ptr c (db->connection ()); + + unsigned short age (90); + prep_query pq ( + c->prepare_query ( + "person-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + transaction t (c->begin ()); + + result r (pq.execute ()); + assert (size (r) == i); + + t.commit (); + } + + transaction t (c->begin ()); + + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); + assert (++i == r.end ()); + + t.commit (); + } + // Cached query without parameters. // { -- cgit v1.1 From fe82ef79b9276e76b50eaf8fc1cc38646a84d49a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Oct 2012 13:17:31 +0200 Subject: Implement early connection release --- common/threads/driver.cxx | 6 -- common/transaction/driver.cxx | 140 +++++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 69 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index b8a66f1..3f7f171 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -101,10 +101,6 @@ struct task transaction t (db_.begin ()); - { // @@ TMP - - //result r (db_.query (query::str == "another value", false)); - prep_query pq (db_.lookup_query ("object-query")); if (!pq) @@ -127,8 +123,6 @@ struct task } assert (found); - } // @@ TMP - t.commit (); } diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx index 64351c3..f785870 100644 --- a/common/transaction/driver.cxx +++ b/common/transaction/driver.cxx @@ -48,88 +48,102 @@ struct transaction_tracer: odb::tracer int main (int argc, char* argv[]) { - transaction_tracer tracer; - auto_ptr db (create_database (argc, argv, false)); - db->tracer (tracer); - - assert (!transaction::has_current ()); - - // Current and db accessors. - // - cout << "test 001" << endl; { - transaction t (db->begin ()); - assert (&t.database () == db.get ()); - assert (transaction::has_current ()); - assert (&transaction::current () == &t); + transaction_tracer tracer; + auto_ptr db (create_database (argc, argv, false)); + db->tracer (tracer); - transaction::reset_current (); assert (!transaction::has_current ()); - transaction t2 (db->begin (), false); - assert (!transaction::has_current ()); + // Current and db accessors. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + assert (&t.database () == db.get ()); + assert (transaction::has_current ()); + assert (&transaction::current () == &t); - transaction::current (t2); - assert (&transaction::current () == &t2); - } + transaction::reset_current (); + assert (!transaction::has_current ()); - // Commit. - // - cout << "test 002" << endl; - { - transaction t (db->begin ()); - t.commit (); - } + transaction t2 (db->begin (), false); + assert (!transaction::has_current ()); - // Rollback. - // - cout << "test 003" << endl; - { - transaction t (db->begin ()); - t.rollback (); - } + transaction::current (t2); + assert (&transaction::current () == &t2); + } - // Auto rollback. - // - cout << "test 004" << endl; - { - transaction t (db->begin ()); - } + // Commit. + // + cout << "test 002" << endl; + { + transaction t (db->begin ()); + t.commit (); + } - // Nested transaction. - // - cout << "test 005" << endl; - { - transaction t (db->begin ()); + // Rollback. + // + cout << "test 003" << endl; + { + transaction t (db->begin ()); + t.rollback (); + } - try + // Auto rollback. + // + cout << "test 004" << endl; { - transaction n (db->begin ()); + transaction t (db->begin ()); } - catch (const already_in_transaction&) + + // Nested transaction. + // + cout << "test 005" << endl; { - cout << "already_in_transaction" << 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 (odb_db::transaction) == sizeof (transaction)); + // Concrete transaction type. + // + cout << "test 006" << endl; + { + assert (sizeof (odb_db::transaction) == sizeof (transaction)); - odb_db::transaction t (static_cast (*db).begin ()); - odb_db::transaction& r (odb_db::transaction::current ()); - assert (&t == &r); + odb_db::transaction t (static_cast (*db).begin ()); + odb_db::transaction& r (odb_db::transaction::current ()); + assert (&t == &r); + } + + // Transaction restart. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + t.commit (); + t.reset (db->begin ()); + t.commit (); + } } - // Transaction restart. + // Test early connection release. // - cout << "test 007" << endl; { - transaction t (db->begin ()); - t.commit (); - t.reset (db->begin ()); - t.commit (); + auto_ptr db (create_database (argc, argv, false, 1)); + transaction t1 (db->begin ()); + t1.commit (); + transaction t2 (db->begin ()); + t2.rollback (); + transaction t3 (db->begin ()); + t3.commit (); } } -- cgit v1.1 From e43ec751d10b8346e1450781d64595b6fb7e1185 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Oct 2012 09:31:12 +0200 Subject: Remove unnecessary code --- common/prepared/driver.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 1ea4108..fc74e24 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -143,7 +143,6 @@ main (int argc, char* argv[]) "person-val-age-query", query::age > 90); db->cache_query (pq); - prep_query pq1 (db->lookup_query ("person-val-age-query")); } else if (i == 2) { -- cgit v1.1 From c9b3d19c3e1771cb1f0a3d93552e48e5f1d47025 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Oct 2012 10:04:47 +0200 Subject: Don't make database default in database-specific tests --- mssql/custom/makefile | 7 ++++--- mssql/query/makefile | 5 +++-- mssql/template/makefile | 4 ++-- mssql/types/makefile | 6 +++--- mysql/custom/makefile | 7 ++++--- mysql/index/makefile | 4 ++-- mysql/template/makefile | 4 ++-- mysql/truncation/makefile | 4 ++-- mysql/types/makefile | 6 +++--- oracle/custom/makefile | 7 ++++--- oracle/template/makefile | 4 ++-- oracle/types/makefile | 6 +++--- pgsql/custom/makefile | 7 ++++--- pgsql/index/makefile | 4 ++-- pgsql/template/makefile | 4 ++-- pgsql/truncation/makefile | 4 ++-- pgsql/types/makefile | 6 +++--- sqlite/custom/makefile | 4 ++-- sqlite/template/makefile | 4 ++-- sqlite/truncation/makefile | 4 ++-- sqlite/types/makefile | 6 +++--- 21 files changed, 56 insertions(+), 51 deletions(-) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 84191f3..9945c44 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -34,9 +34,10 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---hxx-prologue '\#include "query.hxx"' --table-prefix mssql_custom_ +$(gen) $(dist): export odb_options += --database mssql --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ +--table-prefix mssql_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mssql/query/makefile b/mssql/query/makefile index 53526b9..cd3a457 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -34,8 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---generate-query --mssql-server-version 9.0 --table-prefix mssql_query_ +$(gen) $(dist): export odb_options += --database mssql --default-database \ +common --generate-schema --generate-query --mssql-server-version 9.0 \ +--table-prefix mssql_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mssql/template/makefile b/mssql/template/makefile index b451bd4..441e45d 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---table-prefix mssql_template_ #@@ CHANGE THIS +$(gen) $(dist): export odb_options += --database mssql --default-database \ +common --generate-schema --table-prefix mssql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mssql/types/makefile b/mssql/types/makefile index 38935ed..fcac4f3 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -34,9 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix mssql_types_ +$(gen) $(dist): export odb_options += --database mssql --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --table-prefix mssql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/custom/makefile b/mysql/custom/makefile index e5e3983..7700323 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -34,9 +34,10 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---hxx-prologue '\#include "query.hxx"' --table-prefix mysql_custom_ +$(gen) $(dist): export odb_options += --database mysql --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ +--table-prefix mysql_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/index/makefile b/mysql/index/makefile index 3218c00..c594679 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---table-prefix mysql_index_ +$(gen) $(dist): export odb_options += --database mysql --default-database \ +common --generate-schema --table-prefix mysql_index_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/template/makefile b/mysql/template/makefile index 3371da0..6bb505f 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---table-prefix mysql_template_ #@@ CHANGE THIS +$(gen) $(dist): export odb_options += --database mysql --default-database \ +common --generate-schema --table-prefix mysql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index caa9ebb..95f951b 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-query \ ---generate-schema --table-prefix mysql_truncation_ +$(gen) $(dist): export odb_options += --database mysql --default-database \ +common --generate-schema --generate-query --table-prefix mysql_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/mysql/types/makefile b/mysql/types/makefile index 112af70..0770d8b 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -34,9 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix mysql_types_ +$(gen) $(dist): export odb_options += --database mysql --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --table-prefix mysql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/oracle/custom/makefile b/oracle/custom/makefile index b27c3bd..b3d5e15 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -34,9 +34,10 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' --sql-interlude \ -"@ $(src_base)/custom.sql" --table-prefix oracle_custom_ +$(gen) $(dist): export odb_options += --database oracle --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --sql-interlude "@ $(src_base)/custom.sql" \ +--table-prefix oracle_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/oracle/template/makefile b/oracle/template/makefile index e68a09c..c931305 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --generate-schema \ ---table-prefix oracle_template_ #@@ CHANGE THIS +$(gen) $(dist): export odb_options += --database oracle --default-database \ +common --generate-schema --table-prefix oracle_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/oracle/types/makefile b/oracle/types/makefile index 08eb42f..df6fefa 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -34,9 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---table-prefix oracle_types_ +$(gen) $(dist): export odb_options += --database oracle --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --table-prefix oracle_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 9c4cf91..4cdc1a2 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -34,9 +34,10 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---generate-query --hxx-prologue '\#include "traits.hxx"' \ ---hxx-prologue '\#include "query.hxx"' --table-prefix pgsql_custom_ +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --generate-query --hxx-prologue \ +'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ +--table-prefix pgsql_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index e6f8ca6..cb898f2 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---table-prefix pgsql_index_ +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --table-prefix pgsql_index_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index b966ac8..f62cd55 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---table-prefix pgsql_template_ #@@ CHANGE THIS +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --table-prefix pgsql_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index f61eef4..63300c2 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-query \ ---generate-schema --table-prefix pgsql_truncation_ +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --generate-query --table-prefix pgsql_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index ccaedbf..2a8cd93 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -34,9 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' \ ---table-prefix pgsql_types_ +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --generate-query --cxx-prologue \ +'\#include "traits.hxx"' --table-prefix pgsql_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index de52742..d61dc95 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --generate-schema \ ---generate-query --table-prefix sqlitex_custom_ +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-schema --generate-query --table-prefix sqlitex_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 65bc159..4341cc8 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --generate-schema \ ---table-prefix sqlitex_template_ #@@ CHANGE THIS +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-schema --table-prefix sqlitex_template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 3dfae0e..9fedbd1 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --generate-query \ ---generate-schema --table-prefix sqlitex_truncation_ +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-schema --generate-query --table-prefix sqlitex_truncation_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 4e78f0a..0dbdee4 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -34,9 +34,9 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --generate-schema \ ---generate-query --cxx-prologue '\#include "traits.hxx"' \ ---table-prefix sqlitex_types_ +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-schema --generate-query --cxx-prologue \ +'\#include "traits.hxx"' --table-prefix sqlitex_types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From a3bb279a8870e1ad7a21e78f18f1c2c1e5004684 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Oct 2012 12:09:41 +0200 Subject: Fix incorrect relative paths --- common/inheritance/polymorphism/makefile | 8 ++++---- common/inheritance/reuse/makefile | 8 ++++---- common/inheritance/transient/makefile | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 10e0a01..ec934f7 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -60,10 +60,10 @@ $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 1fc1142..a02edd2 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -58,10 +58,10 @@ $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index ab5936a..e6dd6d8 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -58,10 +58,10 @@ $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # -- cgit v1.1 From 01f2fe1b6ccab88e00abc263ed020947426083f4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Oct 2012 12:10:48 +0200 Subject: Bump version to 2.2.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7ec1d6d..722318f 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.1.0 +2.2.0.a1 -- cgit v1.1 From 1dc0e3c296c52b3537e43ce9d1fc5ac62776e992 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Oct 2012 14:38:50 +0200 Subject: Add workaround for VC++ --- common/prepared/driver.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index fc74e24..ba92285 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -283,13 +283,15 @@ main (int argc, char* argv[]) "person-params-query-2", [] (const char* name, connection& c) { - auto_ptr p (new params); - prepared_query pq ( - c.prepare_query ( - name, - query::age > query::_ref (p->age) && - query::name != query::_ref (p->name))); - c.cache_query (pq, p); + typedef odb::query query; + + auto_ptr p (new params); + prepared_query pq ( + c.prepare_query ( + name, + query::age > query::_ref (p->age) && + query::name != query::_ref (p->name))); + c.cache_query (pq, p); }); for (unsigned int i (1); i < 6; ++i) -- cgit v1.1 From 593c5e310a0786aca70a2a43d0aa1124504fc785 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Nov 2012 13:11:43 +0200 Subject: Add dynamic multi-database query support --- common/readonly/driver.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 2e692cf..991e000 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -204,9 +204,9 @@ main (int argc, char* argv[]) // Readonly object. // { - typedef odb::object_traits_impl so_traits; - typedef odb::object_traits_impl ro_traits; - typedef odb::object_traits_impl rw_traits; + typedef odb::object_traits_impl so_traits; + typedef odb::object_traits_impl ro_traits; + typedef odb::object_traits_impl rw_traits; assert (so_traits::column_count == so_traits::id_column_count + so_traits::readonly_column_count); -- cgit v1.1 From 9a2fb3b8b2b7f30e6f4f3cc37a18b6cc26bb7029 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Dec 2012 11:26:44 +0200 Subject: Add support for SQL name transformations --- common/index/test.hxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/index/test.hxx b/common/index/test.hxx index 4392854..5948365 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -36,7 +36,7 @@ namespace test1 #pragma db index type("UNIQUE") member(i5) int i6; - #pragma db index("i6_index") member(i6) + #pragma db index("object_i6_index") member(i6) int i7; int i8; @@ -47,10 +47,10 @@ namespace test1 }; #pragma db index(object) member(i7) - #pragma db index(object::"i8_index") member(i8) + #pragma db index(object::"object_i8_index") member(i8) } -#pragma db index(test1::object::"i9_index") member(i9) +#pragma db index(test1::object::"object_i9_index") member(i9) // Test composite indexes. // @@ -80,11 +80,11 @@ namespace test2 int i1a; int i1b; - #pragma db index("i1_i") member(i1a) member(i1b) + #pragma db index("object_i1_i") member(i1a) member(i1b) int i2a; int i2b; - #pragma db index("i2_i") members(i2a, i2b) + #pragma db index("object_i2_i") members(i2a, i2b) #pragma db index comp c1; @@ -97,11 +97,11 @@ namespace test2 #pragma db index member(c3.y) comp c4; - #pragma db index("c4_i") members(c4.x, c4.y, c4.n.x) + #pragma db index("object_c4_i") members(c4.x, c4.y, c4.n.x) comp c5; int i5; - #pragma db index("ci5_i") member(c5) member(i5) + #pragma db index("object_ci5_i") member(c5) member(i5) }; } @@ -132,10 +132,10 @@ namespace test3 std::vector v; #pragma db index unique member(v.id) - #pragma db index("index_index") member(v.index) + #pragma db index("object_v_index_index") member(v.index) comp c; - #pragma db index("id_index") member(c.v.id) + #pragma db index("object_c_v_id_index") member(c.v.id) #pragma db index unique member(c.v.index) }; } -- cgit v1.1 From 75b6052087c925b5f983c9af36c4b548d143e31e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Dec 2012 13:33:05 +0200 Subject: Bump version to 2.2.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 722318f..7e35268 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.0.a1 +2.2.0.a2 -- cgit v1.1 From 42fee52342964c689be0e48bed07637be2fb45c1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Dec 2012 14:31:22 +0200 Subject: Don't use 0 to initialize std::function This doesn't work on VC++ 11. --- common/prepared/driver.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index ba92285..1b4ad0e 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -248,7 +248,8 @@ main (int argc, char* argv[]) t.commit (); } - db->query_factory ("person-params-query", 0); + db->query_factory ("person-params-query", + database::query_factory_type ()); } // Cached query with wildcard factory. @@ -272,7 +273,7 @@ main (int argc, char* argv[]) t.commit (); } - db->query_factory ("", 0); + db->query_factory ("", database::query_factory_type ()); } // Cached query with lambda factory. @@ -310,7 +311,8 @@ main (int argc, char* argv[]) t.commit (); } - db->query_factory ("person-params-query-2", 0); + db->query_factory ("person-params-query-2", + database::query_factory_type ()); } #endif -- cgit v1.1 From 23a537ac98066dc3994100548890112aa6e8d8ac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Jan 2013 16:01:06 +0200 Subject: Add support for MSSQL ROWVERSION ODB can now use ROWVERSION column as an optimistic concurrency version. --- mssql/types/driver.cxx | 26 ++++++++++++++++++++++++++ mssql/types/test.hxx | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 6390950..a779079 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -217,6 +217,32 @@ main (int argc, char* argv[]) assert (o == *p); } } + + // Test optimistic concurrency using ROWVERSION. + // + { + rowversion o; + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + assert (o.version != 0); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + assert (p->version == o.version); + p->str += 'd'; + db->update (*p); + assert (p->version > o.version); + db->reload (o); + assert (o.version == p->version); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index d735acf..3e20e73 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -369,4 +369,24 @@ struct long_cont } }; +// Test optimistic concurrency using ROWVERSION. +// +#pragma db object optimistic +struct rowversion +{ + rowversion (): version (0) {} + + #pragma db id auto + unsigned int id_; + + #pragma db version type("ROWVERSION") +#ifdef _WIN32 + unsigned __int64 version; +#else + unsigned long long version; +#endif + + std::string str; +}; + #endif // TEST_HXX -- cgit v1.1 From f221c0a4f291646a1e698a8de2909043e7d0313d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Jan 2013 18:02:32 +0200 Subject: Fix bug in handling polymorphic derived classes without any value members --- common/inheritance/polymorphism/driver.cxx | 50 ++++++++++++++++++++++++++++++ common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test13.hxx | 47 ++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 common/inheritance/polymorphism/test13.hxx diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 20007e4..4f18c15 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -27,6 +27,7 @@ #include "test10.hxx" #include "test11.hxx" #include "test12.hxx" +#include "test13.hxx" #include "test1-odb.hxx" #include "test2-odb.hxx" @@ -40,6 +41,7 @@ #include "test10-odb.hxx" #include "test11-odb.hxx" #include "test12-odb.hxx" +#include "test13-odb.hxx" using namespace std; using namespace odb::core; @@ -1871,6 +1873,54 @@ main (int argc, char* argv[]) assert (*pd == d); } } + + // Test 13: polymorphic derived without any non-container data members + // (which results in an empty SELECT statement). + // + { + using namespace test13; + + base b; + b.nums.push_back (123); + derived d; + d.nums.push_back (123); + d.strs.push_back ("abc"); + + base1 b1; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + db->persist (b1); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pbr (db->load (b.id)); + auto_ptr pdr (db->load (d.id)); + auto_ptr pdb (db->load (d.id)); + auto_ptr pb1r (db->load (b1.id)); + t.commit (); + + base& rb (static_cast (*pbr)); + derived& rd1 (static_cast (*pdr)); + derived& rd2 (static_cast (*pdb)); + base1 rb1 (static_cast (*pb1r)); + + assert (rb.id == b.id && rb.nums == b.nums); + assert (rd1.id == d.id && rd1.nums == rd1.nums && + rd1.strs == rd1.strs); + assert (rd2.id == d.id && rd2.nums == rd2.nums && + rd2.strs == rd2.strs); + assert (rb1.id == b1.id); + } + } } catch (const odb::exception& e) { diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index ec934f7..744c688 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -6,7 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx +test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx new file mode 100644 index 0000000..8f80cdb --- /dev/null +++ b/common/inheritance/polymorphism/test13.hxx @@ -0,0 +1,47 @@ +// file : common/inheritance/polymorphism/test13.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST13_HXX +#define TEST13_HXX + +#include +#include + +#include + +// Test polymorphic derived without any non-container data members (which +// results in an empty SELECT statement). +// +#pragma db namespace table("t13_") +namespace test13 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct base: root + { + std::vector nums; + }; + + #pragma db object + struct derived: base + { + std::vector strs; + }; + + #pragma db object + struct base1: root + { + // Nothing. + }; +} + +#endif // TEST13_HXX -- cgit v1.1 From 2d2824da38f4ad89c3d9a675042547e13c03f64f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Jan 2013 12:27:27 +0200 Subject: Add support for setting SQL Server transaction isolation level --- libcommon/common/common.cxx | 4 +- mssql/database/driver.cxx | 92 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 76 insertions(+), 20 deletions(-) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 524c11b..24238a5 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -196,7 +196,9 @@ create_database (int& argc, if (max_connections != 0) f.reset (new mssql::connection_pool_factory (max_connections)); - db.reset (new mssql::database (argc, argv, false, "", 0, + db.reset (new mssql::database (argc, argv, false, "", + mssql::isolation_read_committed, 0, + #ifdef HAVE_CXX11 move (f) #else diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 7f8aa8f..47a1559 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -5,48 +5,102 @@ // Test that database constructors are unambiguous (compilation only). // +#include +#include + #include namespace mssql = odb::mssql; using namespace mssql; +static const char* isolation_map[] = {"1", "2", "3", "5", "4"}; + +static bool +check_isolation (connection& c, transaction_isolation i) +{ + std::string s ("SELECT 1 FROM sys.dm_exec_sessions WHERE session_id = @@SPID" + " AND transaction_isolation_level = "); + s += isolation_map[i]; + return c.execute (s) == 1; +} + int main (int argc, char* argv[]) { // This code should not execute. // - if (argc != 0) - return 0; + if (argc == 0) + { + { + database d1 ("bob", "secret", "db1", "server1"); + database d2 ("bob", "secret", "db1", "server1", "driver1"); + database d3 ("bob", "secret", "db1", "server1", "driver1", "extra"); + database d4 ("bob", "secret", "db1", "server1", "driver1", "extra", + isolation_read_uncommitted); + } + { + database d1 ("bob", "secret", "db1", protocol_auto); + database d2 ("bob", "secret", "db1", protocol_auto, "server1"); + database d3 ("bob", "secret", "db1", protocol_auto, "server1", "inst1"); + database d4 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1"); + database d5 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1", "extra"); + database d6 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1", "extra", isolation_read_uncommitted); + } + + { + database d1 ("bob", "secret", "db1", "server1", 0); + database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); + database d3 ("bob", "secret", "db1", "server1", 999, "driver1", "extra"); + database d4 ("bob", "secret", "db1", "server1", 999, "driver1", "extra", + isolation_read_uncommitted); + } + + { + database d1 ("conn1"); + database d2 ("conn1", isolation_read_uncommitted); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "extra"); + database d4 (argc, argv, false, "extra", isolation_read_uncommitted); + } + } + + // Test transaction isolation levels. + // { - database d1 ("bob", "secret", "db1", "server1"); - database d2 ("bob", "secret", "db1", "server1", "driver1"); - database d3 ("bob", "secret", "db1", "server1", "driver1", "extra"); + database d (argc, argv, false, "", isolation_read_uncommitted); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_read_uncommitted)); } { - database d1 ("bob", "secret", "db1", protocol_auto); - database d2 ("bob", "secret", "db1", protocol_auto, "server1"); - database d3 ("bob", "secret", "db1", protocol_auto, "server1", "inst1"); - database d4 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", - "driver1"); - database d5 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", - "driver1", "extra"); + database d (argc, argv, false, ""); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_read_committed)); } { - database d1 ("bob", "secret", "db1", "server1", 0); - database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); - database d3 ("bob", "secret", "db1", "server1", 999, "driver1", "extra"); + database d (argc, argv, false, "", isolation_repeatable_read); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_repeatable_read)); } { - database d1 ("conn1"); + database d (argc, argv, false, "", isolation_snapshot); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_snapshot)); } { - database d1 (argc, argv); - database d2 (argc, argv, false); - database d3 (argc, argv, true, "extra"); + database d (argc, argv, false, "", isolation_serializable); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_serializable)); } } -- cgit v1.1 From 6edf3badfc8c81ebfb45439408b2b1bf8c9136dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Jan 2013 15:27:16 +0200 Subject: Bump version to 2.2.0.a3 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7e35268..90d185b 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.0.a2 +2.2.0.a3 -- cgit v1.1 From 9bd664e4cb39f6654e8754c8cfd4c28295ee2d90 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Jan 2013 10:37:05 +0200 Subject: Rename common/session to common/session/cache --- common/makefile | 2 +- common/session/cache/driver.cxx | 84 +++++++++++++++++++++++++++++ common/session/cache/makefile | 115 ++++++++++++++++++++++++++++++++++++++++ common/session/cache/test.hxx | 66 +++++++++++++++++++++++ common/session/cache/test.std | 0 common/session/driver.cxx | 84 ----------------------------- common/session/makefile | 115 ---------------------------------------- common/session/test.hxx | 66 ----------------------- common/session/test.std | 0 9 files changed, 266 insertions(+), 266 deletions(-) create mode 100644 common/session/cache/driver.cxx create mode 100644 common/session/cache/makefile create mode 100644 common/session/cache/test.hxx create mode 100644 common/session/cache/test.std delete mode 100644 common/session/driver.cxx delete mode 100644 common/session/makefile delete mode 100644 common/session/test.hxx delete mode 100644 common/session/test.std diff --git a/common/makefile b/common/makefile index 1de430d..decfcd8 100644 --- a/common/makefile +++ b/common/makefile @@ -38,7 +38,7 @@ readonly \ relationship \ relationship-query \ schema \ -session \ +session/cache \ template \ transaction \ types \ diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx new file mode 100644 index 0000000..9487afa --- /dev/null +++ b/common/session/cache/driver.cxx @@ -0,0 +1,84 @@ +// file : common/session/cache/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test session object cache. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test the session_required exception. + // +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + { + using namespace test1; + + shared_ptr o1a (new obj1 (1)); + shared_ptr o1b (new obj1 (2)); + shared_ptr o2 (new obj2 (1)); + + o1a->o2 = o2; + o1b->o2 = o2; + + o2->o1.push_back (o1a); + o2->o1.push_back (o1b); + + { + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o1b); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + + try + { + shared_ptr o1 (db->load (1)); + assert (false); + } + catch (const session_required&) + { + } + + t.commit (); + } + + { + session s; + transaction t (db->begin ()); + shared_ptr o1 (db->load (1)); + t.commit (); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/session/cache/makefile b/common/session/cache/makefile new file mode 100644 index 0000000..cbbf600 --- /dev/null +++ b/common/session/cache/makefile @@ -0,0 +1,115 @@ +# file : common/session/cache/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-session --table-prefix session_cache_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx new file mode 100644 index 0000000..ff59249 --- /dev/null +++ b/common/session/cache/test.hxx @@ -0,0 +1,66 @@ +// file : common/session/cache/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include + +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +// Test the session_required exception. +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + +#pragma db namespace table("t1_") +namespace test1 +{ +#ifdef HAVE_CXX11 + using std::shared_ptr; + using std::weak_ptr; +#else + using std::tr1::shared_ptr; + using std::tr1::weak_ptr; +#endif + + #pragma db namespace(test1) pointer(shared_ptr) + + struct obj2; + + #pragma db object + struct obj1 + { + obj1 () {} + obj1 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + shared_ptr o2; + }; + + #pragma db object + struct obj2 + { + obj2 () {} + obj2 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db inverse (o2) + std::vector< weak_ptr > o1; + }; +} + +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY + +#endif // TEST_HXX diff --git a/common/session/cache/test.std b/common/session/cache/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/session/driver.cxx b/common/session/driver.cxx deleted file mode 100644 index 232aee6..0000000 --- a/common/session/driver.cxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : common/session/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test session. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // Test the session_required exception. - // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - { - using namespace test1; - - shared_ptr o1a (new obj1 (1)); - shared_ptr o1b (new obj1 (2)); - shared_ptr o2 (new obj2 (1)); - - o1a->o2 = o2; - o1b->o2 = o2; - - o2->o1.push_back (o1a); - o2->o1.push_back (o1b); - - { - transaction t (db->begin ()); - db->persist (o1a); - db->persist (o1b); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - - try - { - shared_ptr o1 (db->load (1)); - assert (false); - } - catch (const session_required&) - { - } - - t.commit (); - } - - { - session s; - transaction t (db->begin ()); - shared_ptr o1 (db->load (1)); - t.commit (); - } - } -#endif - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/session/makefile b/common/session/makefile deleted file mode 100644 index 7da6d42..0000000 --- a/common/session/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/session/makefile -# copyright : Copyright (c) 2009-2012 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) --generate-schema \ ---generate-session --table-prefix session_ -$(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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/test.hxx b/common/session/test.hxx deleted file mode 100644 index abc4628..0000000 --- a/common/session/test.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : common/session/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#include -#include - -#include - -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - -// Test the session_required exception. -// -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - -#pragma db namespace table("t1_") -namespace test1 -{ -#ifdef HAVE_CXX11 - using std::shared_ptr; - using std::weak_ptr; -#else - using std::tr1::shared_ptr; - using std::tr1::weak_ptr; -#endif - - #pragma db namespace(test1) pointer(shared_ptr) - - struct obj2; - - #pragma db object - struct obj1 - { - obj1 () {} - obj1 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - shared_ptr o2; - }; - - #pragma db object - struct obj2 - { - obj2 () {} - obj2 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db inverse (o2) - std::vector< weak_ptr > o1; - }; -} - -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY - -#endif // TEST_HXX diff --git a/common/session/test.std b/common/session/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1 From 5cf30ccfe764701f549e4152ad312187221f5285 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Jan 2013 14:50:26 +0200 Subject: Implement two-phase session insertion On the first step an uninitialized object is inserted into the cache as before (this is necessary to handle recursive loading). The second step is to notify the session that the object has been initialized. On this second step the session can perform change tracking preparations, such as make a copy of the object or reset the modification flag. New test: common/session/custom (implements a custom session that uses copies to track changes). --- common/Makefile.am | 4 + common/makefile | 15 +++- common/session/custom/driver.cxx | 168 ++++++++++++++++++++++++++++++++++++++ common/session/custom/makefile | 114 ++++++++++++++++++++++++++ common/session/custom/session.cxx | 50 ++++++++++++ common/session/custom/session.hxx | 139 +++++++++++++++++++++++++++++++ common/session/custom/session.txx | 118 ++++++++++++++++++++++++++ common/session/custom/test.hxx | 119 +++++++++++++++++++++++++++ common/session/custom/test.std | 0 9 files changed, 724 insertions(+), 3 deletions(-) create mode 100644 common/session/custom/driver.cxx create mode 100644 common/session/custom/makefile create mode 100644 common/session/custom/session.cxx create mode 100644 common/session/custom/session.hxx create mode 100644 common/session/custom/session.txx create mode 100644 common/session/custom/test.hxx create mode 100644 common/session/custom/test.std diff --git a/common/Makefile.am b/common/Makefile.am index f413d76..1b0c91e 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -8,4 +8,8 @@ if ODB_TESTS_THREADS SUBDIRS += __path__(thread_dirs) endif +if HAVE_CXX11 +SUBDIRS += __path__(cxx11_dirs) +endif + EXTRA_DIST = __file__(extra_dist) diff --git a/common/makefile b/common/makefile index decfcd8..8c93f72 100644 --- a/common/makefile +++ b/common/makefile @@ -47,21 +47,30 @@ virtual \ wrapper thread_tests := threads - -all_tests := $(tests) $(thread_tests) -build_tests := $(tests) $(thread_tests) +cxx11_tests := session/custom default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean +$(default): +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard + +all_tests := $(tests) $(thread_tests) $(cxx11_tests) +build_tests := $(tests) $(thread_tests) + +ifeq ($(cxx_standard),c++11) +build_tests += $(cxx11_tests) +endif + $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := common $(dist): name := $(name) $(dist): export dirs := $(filter-out include,$(tests)) $(dist): export thread_dirs := $(thread_tests) +$(dist): export cxx11_dirs := $(cxx11_tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ $(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx new file mode 100644 index 0000000..1ec7cbb --- /dev/null +++ b/common/session/custom/driver.cxx @@ -0,0 +1,168 @@ +// file : common/session/custom/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom session (C++11 only). +// + +#include +#include // std::size_t +#include +#include + +#include +#include +#include +#include + +#include + +#include "session.hxx" + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using odb::database; +using odb::transaction; + +struct counting_tracer: odb::tracer +{ + virtual void + execute (odb::connection&, const char*) + { + count++; + } + + size_t count; +}; + +static counting_tracer tracer; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Simple Tech Ltd. + // + { + shared_ptr er (new employer ("Simple Tech Ltd", "ST")); + + shared_ptr john (new employee ("John", "Doe", er)); + shared_ptr jane (new employee ("Jane", "Doe", er)); + + transaction t (db->begin ()); + + db->persist (er); + db->persist (john); + db->persist (jane); + + t.commit (); + } + + // Complex Systems Inc. + // + { + shared_ptr er (new employer ("Complex Systems Inc", "CS")); + + shared_ptr john (new employee ("John", "Smith", er)); + shared_ptr jane (new employee ("Jane", "Smith", er)); + + transaction t (db->begin ()); + + db->persist (er); + db->persist (john); + db->persist (jane); + + t.commit (); + } + + session s; + shared_ptr st, cs; + shared_ptr ste, cse; + + { + transaction t (db->begin ()); + + st = db->load ("Simple Tech Ltd"); + ste = db->load (st->employees ()[0].object_id ()); + + // Test object cache. + // + shared_ptr e (st->employees ()[0].load ()); + assert (ste->employer () == st); + assert (ste == e); + + t.commit (); + } + + { + transaction t (db->begin ()); + + cs = db->load ("Complex Systems Inc"); + cse = db->load (cs->employees ()[0].object_id ()); + cs->employees ()[0].load (); + + t.commit (); + } + + cs->symbol ("CSI"); + + // Swap employees. + // + ste->employer (cs); + cse->employer (st); + st->employees ()[0] = cse; + cs->employees ()[0] = ste; + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); // Flush all the changes. + assert (tracer.count == 3); + t.commit (); + s.mark (); // Mark all the changed objects as unchanged. + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + + cs->symbol ("COMP"); + st->symbol ("SMPL"); + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); // Flush all the changes. + assert (tracer.count == 2); + t.commit (); + s.mark (); // Mark all the changed objects as unchanged. + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/session/custom/makefile b/common/session/custom/makefile new file mode 100644 index 0000000..6fb6c95 --- /dev/null +++ b/common/session/custom/makefile @@ -0,0 +1,114 @@ +# file : common/session/custom/makefile +# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make + +cxx_tun := driver.cxx session.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) --generate-schema \ +--generate-session --session-type ::session --hxx-prologue \ +'\#include "session.hxx"' --table-prefix session_custom_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +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 vc10projs,$(name)) \ +$(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx new file mode 100644 index 0000000..b50493f --- /dev/null +++ b/common/session/custom/session.cxx @@ -0,0 +1,50 @@ +// file : common/session/custom/session.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +#include "session.hxx" + +static session* current_; // Use TLS in multi-threaded applications. + +session:: +session () +{ + assert (current_ == 0); + current_ = this; +} + +session:: +~session () +{ + assert (current_ == this); + current_ = 0; +} + +bool session:: +has_current () +{ + return current_ != 0; +} + +session& session:: +current () +{ + assert (current_ != 0); + return *current_; +} + +void session:: +flush (odb::database& db) +{ + for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) + i->second->flush (db); +} + +void session:: +mark () +{ + for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) + i->second->mark (); +} diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx new file mode 100644 index 0000000..bb60a4b --- /dev/null +++ b/common/session/custom/session.hxx @@ -0,0 +1,139 @@ +// file : common/session/custom/session.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef SESSION_HXX +#define SESSION_HXX + +#include +#include +#include + +#include +#include // odb::object_traits +#include // odb::details::type_info_comparator + +// This custom session implementation assumes we are working with +// one database at a time. +// +class session +{ +public: + session (); + ~session (); + +private: + session (const session&); + session& operator= (const session&); + + // Current session interface. + // +public: + static bool + has_current (); + + static session& + current (); + + // Change tracking interface. + // + // Call flush() within a transaction to apply the changes to the + // database. Then after successfully committing the transaction, + // call mark() to mark all the changed objects as again unchanged. + // +public: + void + flush (odb::database&); + + void + mark (); + +private: + struct object_map_base + { + virtual + ~object_map_base () {} + + virtual void + flush (odb::database&) = 0; + + virtual void + mark () = 0; + }; + + template + struct object_state + { + typedef typename odb::object_traits::pointer_type pointer_type; + + explicit + object_state (pointer_type o): obj (o), flushed_ (false) {} + + pointer_type obj; + pointer_type orig; + bool flushed_; + }; + + template + struct object_map: object_map_base, + std::map::id_type, + object_state > + { + virtual void + flush (odb::database&); + + virtual void + mark (); + }; + + // Object cache interface. + // +public: + template + struct position + { + typedef object_map map; + typedef typename map::iterator iterator; + + position () {} + position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + + map* map_; + iterator pos_; + }; + + template + position + insert (odb::database&, + const typename odb::object_traits::id_type&, + const typename odb::object_traits::pointer_type&); + + template + static void + initialize (const position&); + + template + typename odb::object_traits::pointer_type + find (odb::database&, const typename odb::object_traits::id_type&) const; + + template + void + erase (odb::database&, const typename odb::object_traits::id_type&); + + template + static void + erase (const position& p) + { + p.map_->erase (p.pos_); + } + +private: + typedef std::map, + odb::details::type_info_comparator> type_map; + type_map map_; +}; + +#include "session.txx" + +#endif // SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx new file mode 100644 index 0000000..203b4e3 --- /dev/null +++ b/common/session/custom/session.txx @@ -0,0 +1,118 @@ +// file : common/session/custom/session.txx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +template +typename session::position session:: +insert (odb::database&, + const typename odb::object_traits::id_type& id, + const typename odb::object_traits::pointer_type& obj) +{ + typedef odb::object_traits object_traits; + + std::shared_ptr& pm (map_[&typeid (T)]); + + if (!pm) + pm.reset (new object_map); + + object_map& m (static_cast&> (*pm)); + + typename object_map::value_type vt (id, object_state (obj)); + std::pair::iterator, bool> r (m.insert (vt)); + + // We shall never try to re-insert the same object into the cache. + // + assert (r.second); + + return position (m, r.first); +} + +template +void session:: +initialize (const position& p) +{ + typedef typename odb::object_traits::pointer_type pointer_type; + + // Make a copy for change tracking. If our object model had a + // polymorphic hierarchy, then we would have had to use a + // virtual function-based mechanism (e.g., clone()) instead of + // the copy constructor since for a polymorphic hierarchy all + // the derived objects are stored as pointers to the root object. + // + p.pos_->second.orig = pointer_type (new T (*p.pos_->second.obj)); +} + +template +typename odb::object_traits::pointer_type session:: +find (odb::database&, const typename odb::object_traits::id_type& id) const +{ + typedef typename odb::object_traits::pointer_type pointer_type; + + type_map::const_iterator ti (map_.find (&typeid (T))); + + if (ti == map_.end ()) + return pointer_type (); + + const object_map& m (static_cast&> (*ti->second)); + typename object_map::const_iterator oi (m.find (id)); + + if (oi == m.end ()) + return pointer_type (); + + return oi->second.obj; +} + +template +void session:: +erase (odb::database&, const typename odb::object_traits::id_type& id) +{ + type_map::iterator ti (map_.find (&typeid (T))); + + if (ti == map_.end ()) + return; + + object_map& m (static_cast&> (*ti->second)); + typename object_map::iterator oi (m.find (id)); + + if (oi == m.end ()) + return; + + m.erase (oi); + + if (m.empty ()) + map_.erase (ti); +} + +template +void session::object_map:: +flush (odb::database& db) +{ + for (typename object_map::iterator i (this->begin ()), e (this->end ()); + i != e; ++i) + { + const T& obj (*i->second.obj); + + if (obj.changed (*i->second.orig)) + { + db.update (obj); + i->second.flushed_ = true; + } + } +} + +template +void session::object_map:: +mark () +{ + for (typename object_map::iterator i (this->begin ()), e (this->end ()); + i != e; ++i) + { + if (i->second.flushed_) + { + i->second.orig.reset (new T (*i->second.obj)); + i->second.flushed_ = false; + } + } +} diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx new file mode 100644 index 0000000..1c4a713 --- /dev/null +++ b/common/session/custom/test.hxx @@ -0,0 +1,119 @@ +// file : common/session/custom/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include + +#include +#include + +class employee; + +#pragma db object pointer(std::shared_ptr) session +class employer +{ +public: + employer (const std::string& name, const std::string& symbol) + : name_ (name), symbol_ (symbol) {} + + const std::string& + name () const {return name_;} + + const std::string& + symbol () const {return symbol_;} + + void + symbol (const std::string& symbol) {symbol_ = symbol;} + + // Employees of this employer. + // + typedef std::vector> employees_type; + + const employees_type& + employees () const {return employees_;} + + employees_type& + employees () {return employees_;} + + // Change tracking. + // +public: + bool + changed (const employer& orig) const + { + // Note that we don't need to track object ids, inverse pointers, nor + // readonly/const data members. + // + return symbol_ != orig.symbol_; + } + +private: + friend class odb::access; + employer () {} + + #pragma db id + std::string name_; + + std::string symbol_; + + #pragma db value_not_null inverse(employer_) + employees_type employees_; +}; + +#pragma db object pointer(std::shared_ptr) session +class employee +{ +public: + typedef ::employer employer_type; + + employee (const std::string& first, + const std::string& last, + std::shared_ptr employer) + : first_ (first), last_ (last), employer_ (employer) {} + + // Name. + // + const std::string& + first () const {return first_;} + + const std::string& + last () const {return last_;} + + // Employer. + // + std::shared_ptr + employer () const {return employer_;} + + void + employer (std::shared_ptr e) {employer_ = e;} + + // Change tracking. + // +public: + bool + changed (const employee& orig) const + { + return first_ != orig.first_ || last_ != orig.last_ || + employer_ != orig.employer_; + } + +private: + friend class odb::access; + employee () {} + + #pragma db id auto + unsigned long id_; + + std::string first_; + std::string last_; + + #pragma db not_null + std::shared_ptr employer_; +}; + +#endif // TEST_HXX diff --git a/common/session/custom/test.std b/common/session/custom/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 856a438b33184959b64864f1afdf5a6a2fd6b0d2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Jan 2013 16:31:29 +0200 Subject: Make session cache management functions static, add notifications --- common/session/custom/driver.cxx | 20 ++++++++- common/session/custom/session.cxx | 23 +++------- common/session/custom/session.hxx | 64 ++++++++++++++++++--------- common/session/custom/session.txx | 92 +++++++++++++++++++++++++++------------ 4 files changed, 131 insertions(+), 68 deletions(-) diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 1ec7cbb..0a58ea5 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -145,10 +145,10 @@ main (int argc, char* argv[]) transaction t (db->begin ()); tracer.count = 0; t.tracer (tracer); - s.flush (*db); // Flush all the changes. + s.flush (*db); assert (tracer.count == 2); t.commit (); - s.mark (); // Mark all the changed objects as unchanged. + s.mark (); } { @@ -159,6 +159,22 @@ main (int argc, char* argv[]) assert (tracer.count == 0); t.commit (); } + + // Explicit update. + // + cs->symbol ("CS"); + st->symbol ("ST"); + + { + transaction t (db->begin ()); + db->update (cs); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + t.commit (); + s.mark (); + } } catch (const odb::exception& e) { diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index b50493f..f8cd102 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -6,33 +6,20 @@ #include "session.hxx" -static session* current_; // Use TLS in multi-threaded applications. +session* session::current; session:: session () { - assert (current_ == 0); - current_ = this; + assert (current == 0); + current = this; } session:: ~session () { - assert (current_ == this); - current_ = 0; -} - -bool session:: -has_current () -{ - return current_ != 0; -} - -session& session:: -current () -{ - assert (current_ != 0); - return *current_; + assert (current == this); + current = 0; } void session:: diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index bb60a4b..3b1789a 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -26,14 +26,13 @@ private: session (const session&); session& operator= (const session&); - // Current session interface. + // Session for the current thread. This can be implemented in pretty + // much any way that makes sense to the application. It can be a global + // session as we have here. In multi-threaded applications we could use + // TLS instead. // public: - static bool - has_current (); - - static session& - current (); + static session* current; // Change tracking interface. // @@ -61,23 +60,30 @@ private: mark () = 0; }; + enum object_state + { + tracking, // Tracking any modifications by storing the original copy. + changed, // Known to be changed. + flushed // Flushed but not yet committed/rolled back. + }; + template - struct object_state + struct object_data { typedef typename odb::object_traits::pointer_type pointer_type; explicit - object_state (pointer_type o): obj (o), flushed_ (false) {} + object_data (pointer_type o): obj (o), state (tracking) {} pointer_type obj; pointer_type orig; - bool flushed_; + object_state state; }; template struct object_map: object_map_base, std::map::id_type, - object_state > + object_data > { virtual void flush (odb::database&); @@ -95,37 +101,53 @@ public: typedef object_map map; typedef typename map::iterator iterator; - position () {} + position (): map_ (0) {} position (map& m, const iterator& p): map_ (&m), pos_ (p) {} map* map_; iterator pos_; }; + // Cache management. + // template - position + static position insert (odb::database&, const typename odb::object_traits::id_type&, const typename odb::object_traits::pointer_type&); template + static typename odb::object_traits::pointer_type + find (odb::database&, const typename odb::object_traits::id_type&); + + template + static void + erase (const position& p) + { + if (p.map_ != 0) + p.map_->erase (p.pos_); + } + + // Notifications. + // + template static void - initialize (const position&); + persist (const position& p) + { + load (p); + } template - typename odb::object_traits::pointer_type - find (odb::database&, const typename odb::object_traits::id_type&) const; + static void + load (const position&); template - void - erase (odb::database&, const typename odb::object_traits::id_type&); + static void + update (odb::database&, const T&); template static void - erase (const position& p) - { - p.map_->erase (p.pos_); - } + erase (odb::database&, const typename odb::object_traits::id_type&); private: typedef std::map object_traits; - std::shared_ptr& pm (map_[&typeid (T)]); + if (current == 0) + return position (); // No session, return empty position. + + std::shared_ptr& pm (current->map_[&typeid (T)]); if (!pm) pm.reset (new object_map); object_map& m (static_cast&> (*pm)); - typename object_map::value_type vt (id, object_state (obj)); + typename object_map::value_type vt (id, object_data (obj)); std::pair::iterator, bool> r (m.insert (vt)); // We shall never try to re-insert the same object into the cache. @@ -30,11 +33,37 @@ insert (odb::database&, } template +typename odb::object_traits::pointer_type session:: +find (odb::database&, const typename odb::object_traits::id_type& id) +{ + typedef typename odb::object_traits::pointer_type pointer_type; + + if (current == 0) + return pointer_type (); // No session, return NULL pointer. + + type_map::const_iterator ti (current->map_.find (&typeid (T))); + + if (ti == current->map_.end ()) + return pointer_type (); + + const object_map& m (static_cast&> (*ti->second)); + typename object_map::const_iterator oi (m.find (id)); + + if (oi == m.end ()) + return pointer_type (); + + return oi->second.obj; +} + +template void session:: -initialize (const position& p) +load (const position& p) { typedef typename odb::object_traits::pointer_type pointer_type; + if (p.map_ == 0) + return; // Empty position. + // Make a copy for change tracking. If our object model had a // polymorphic hierarchy, then we would have had to use a // virtual function-based mechanism (e.g., clone()) instead of @@ -45,32 +74,45 @@ initialize (const position& p) } template -typename odb::object_traits::pointer_type session:: -find (odb::database&, const typename odb::object_traits::id_type& id) const +void session:: +update (odb::database&, const T& obj) { - typedef typename odb::object_traits::pointer_type pointer_type; + typedef odb::object_traits object_traits; + typedef typename object_traits::pointer_type pointer_type; - type_map::const_iterator ti (map_.find (&typeid (T))); + if (current == 0) + return; // No session. - if (ti == map_.end ()) - return pointer_type (); + // User explicitly updated the object by calling database::update(). + // Change the state to flushed and reset the original copy (we are + // still tracking changes after the update). + // + type_map::iterator ti (current->map_.find (&typeid (T))); - const object_map& m (static_cast&> (*ti->second)); - typename object_map::const_iterator oi (m.find (id)); + if (ti == current->map_.end ()) + return; // This object is not in the session. + + object_map& m (static_cast&> (*ti->second)); + typename object_map::iterator oi (m.find (object_traits::id (obj))); if (oi == m.end ()) - return pointer_type (); + return; // This object is not in the session. - return oi->second.obj; + object_data& d (oi->second); + d.orig = pointer_type (new T (*d.obj)); + d.state = flushed; } template void session:: erase (odb::database&, const typename odb::object_traits::id_type& id) { - type_map::iterator ti (map_.find (&typeid (T))); + if (current == 0) + return; // No session. - if (ti == map_.end ()) + type_map::iterator ti (current->map_.find (&typeid (T))); + + if (ti == current->map_.end ()) return; object_map& m (static_cast&> (*ti->second)); @@ -82,7 +124,7 @@ erase (odb::database&, const typename odb::object_traits::id_type& id) m.erase (oi); if (m.empty ()) - map_.erase (ti); + current->map_.erase (ti); } template @@ -92,13 +134,10 @@ flush (odb::database& db) for (typename object_map::iterator i (this->begin ()), e (this->end ()); i != e; ++i) { - const T& obj (*i->second.obj); + object_data& d (i->second); - if (obj.changed (*i->second.orig)) - { - db.update (obj); - i->second.flushed_ = true; - } + if (d.state == changed || d.obj->changed (*d.orig)) + db.update (d.obj); // State changed by the update() notification. } } @@ -109,10 +148,9 @@ mark () for (typename object_map::iterator i (this->begin ()), e (this->end ()); i != e; ++i) { - if (i->second.flushed_) - { - i->second.orig.reset (new T (*i->second.obj)); - i->second.flushed_ = false; - } + object_data& d (i->second); + + if (d.state == flushed) + d.state = tracking; } } -- cgit v1.1 From d304a4b2b19dca115954f209d6a37a6958e73ab9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Jan 2013 10:23:39 +0200 Subject: Add support for post-commit/rollback callbacks New test: common/transaction/callback. --- common/makefile | 3 +- common/session/custom/driver.cxx | 201 ++++++++++++++++++------------- common/session/custom/session.cxx | 28 ++++- common/session/custom/session.hxx | 27 +++-- common/session/custom/session.txx | 11 +- common/transaction/basics/driver.cxx | 149 +++++++++++++++++++++++ common/transaction/basics/makefile | 89 ++++++++++++++ common/transaction/basics/test.std | 26 ++++ common/transaction/callback/driver.cxx | 212 +++++++++++++++++++++++++++++++++ common/transaction/callback/makefile | 89 ++++++++++++++ common/transaction/callback/test.std | 34 ++++++ common/transaction/driver.cxx | 149 ----------------------- common/transaction/makefile | 89 -------------- common/transaction/test.std | 26 ---- 14 files changed, 769 insertions(+), 364 deletions(-) create mode 100644 common/transaction/basics/driver.cxx create mode 100644 common/transaction/basics/makefile create mode 100644 common/transaction/basics/test.std create mode 100644 common/transaction/callback/driver.cxx create mode 100644 common/transaction/callback/makefile create mode 100644 common/transaction/callback/test.std delete mode 100644 common/transaction/driver.cxx delete mode 100644 common/transaction/makefile delete mode 100644 common/transaction/test.std diff --git a/common/makefile b/common/makefile index 8c93f72..9e6e319 100644 --- a/common/makefile +++ b/common/makefile @@ -40,7 +40,8 @@ relationship-query \ schema \ session/cache \ template \ -transaction \ +transaction/basics \ +transaction/callback \ types \ view \ virtual \ diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 0a58ea5..1b00ada 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -30,16 +30,14 @@ using odb::transaction; struct counting_tracer: odb::tracer { virtual void - execute (odb::connection&, const char*) - { - count++; - } - + execute (odb::connection&, const char*) {count++;} size_t count; }; static counting_tracer tracer; +struct failed {}; + int main (int argc, char* argv[]) { @@ -81,99 +79,138 @@ main (int argc, char* argv[]) t.commit (); } - session s; - shared_ptr st, cs; - shared_ptr ste, cse; - { - transaction t (db->begin ()); + session s; + shared_ptr st, cs; + shared_ptr ste, cse; - st = db->load ("Simple Tech Ltd"); - ste = db->load (st->employees ()[0].object_id ()); + { + transaction t (db->begin ()); - // Test object cache. - // - shared_ptr e (st->employees ()[0].load ()); - assert (ste->employer () == st); - assert (ste == e); + st = db->load ("Simple Tech Ltd"); + ste = db->load (st->employees ()[0].object_id ()); - t.commit (); - } + // Test object cache. + // + shared_ptr e (st->employees ()[0].load ()); + assert (ste->employer () == st); + assert (ste == e); - { - transaction t (db->begin ()); + t.commit (); + } - cs = db->load ("Complex Systems Inc"); - cse = db->load (cs->employees ()[0].object_id ()); - cs->employees ()[0].load (); + { + transaction t (db->begin ()); - t.commit (); - } + cs = db->load ("Complex Systems Inc"); + cse = db->load (cs->employees ()[0].object_id ()); + cs->employees ()[0].load (); - cs->symbol ("CSI"); - - // Swap employees. - // - ste->employer (cs); - cse->employer (st); - st->employees ()[0] = cse; - cs->employees ()[0] = ste; + t.commit (); + } - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); // Flush all the changes. - assert (tracer.count == 3); - t.commit (); - s.mark (); // Mark all the changed objects as unchanged. - } + cs->symbol ("CSI"); - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 0); - t.commit (); - } - - cs->symbol ("COMP"); - st->symbol ("SMPL"); - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 2); - t.commit (); - s.mark (); - } - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 0); - t.commit (); + // Swap employees. + // + ste->employer (cs); + cse->employer (st); + st->employees ()[0] = cse; + cs->employees ()[0] = ste; + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 3); + t.commit (); + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + + cs->symbol ("COMP"); + st->symbol ("SMPL"); + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 2); + t.commit (); + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + + // Explicit update. + // + cs->symbol ("CS"); + st->symbol ("ST"); + + { + transaction t (db->begin ()); + db->update (cs); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + t.commit (); + } + + // Rollback after update. + // + cs->symbol ("CSI"); + + try + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + throw failed (); + t.commit (); + } + catch (const failed&) + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + t.commit (); + } } - // Explicit update. + // Test session destruction before transaction is commited. // - cs->symbol ("CS"); - st->symbol ("ST"); - { transaction t (db->begin ()); - db->update (cs); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 1); + { + session s; + shared_ptr st (db->load ("Simple Tech Ltd")); + st->symbol ("STL"); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + } t.commit (); - s.mark (); } } catch (const odb::exception& e) diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index f8cd102..0009d79 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -10,6 +10,7 @@ session* session::current; session:: session () + : tran_ (0) { assert (current == 0); current = this; @@ -18,6 +19,11 @@ session () session:: ~session () { + // Unregister from transaction. + // + if (tran_ != 0) + tran_->unregister (this); + assert (current == this); current = 0; } @@ -25,13 +31,27 @@ session:: void session:: flush (odb::database& db) { + bool flushed (false); + for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) - i->second->flush (db); + { + bool r (i->second->flush (db)); + flushed = flushed || r; + } + + // If we flushed anything, then register the post-commit/rollback callback. + // + if (flushed) + { + tran_ = &odb::transaction::current (); + tran_->register_ (&mark, this, odb::transaction::event_all, 0, &tran_); + } } void session:: -mark () +mark (unsigned short event, void* key, unsigned long long) { - for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) - i->second->mark (); + session& s (*static_cast (key)); + for (type_map::iterator i (s.map_.begin ()), e (s.map_.end ()); i != e; ++i) + i->second->mark (event); } diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 3b1789a..ce7e43c 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -10,6 +10,8 @@ #include #include +#include + #include // odb::object_traits #include // odb::details::type_info_comparator @@ -36,28 +38,26 @@ public: // Change tracking interface. // +public: // Call flush() within a transaction to apply the changes to the - // database. Then after successfully committing the transaction, - // call mark() to mark all the changed objects as again unchanged. + // database. // -public: void flush (odb::database&); - void - mark (); - private: struct object_map_base { virtual ~object_map_base () {} - virtual void + // Return true we flushed anything. + // + virtual bool flush (odb::database&) = 0; virtual void - mark () = 0; + mark (unsigned short event) = 0; }; enum object_state @@ -85,11 +85,11 @@ private: std::map::id_type, object_data > { - virtual void + virtual bool flush (odb::database&); virtual void - mark (); + mark (unsigned short event); }; // Object cache interface. @@ -150,10 +150,17 @@ public: erase (odb::database&, const typename odb::object_traits::id_type&); private: + // Post-commit/rollback callback. + // + static void + mark (unsigned short event, void* key, unsigned long long); + +private: typedef std::map, odb::details::type_info_comparator> type_map; type_map map_; + odb::transaction* tran_; }; #include "session.txx" diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index fd90b6a..31c08c7 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -128,9 +128,10 @@ erase (odb::database&, const typename odb::object_traits::id_type& id) } template -void session::object_map:: +bool session::object_map:: flush (odb::database& db) { + bool r (false); for (typename object_map::iterator i (this->begin ()), e (this->end ()); i != e; ++i) { @@ -138,12 +139,16 @@ flush (odb::database& db) if (d.state == changed || d.obj->changed (*d.orig)) db.update (d.obj); // State changed by the update() notification. + + r = r || d.state == flushed; } + + return r; } template void session::object_map:: -mark () +mark (unsigned short event) { for (typename object_map::iterator i (this->begin ()), e (this->end ()); i != e; ++i) @@ -151,6 +156,6 @@ mark () object_data& d (i->second); if (d.state == flushed) - d.state = tracking; + d.state = event == odb::transaction::event_commit ? tracking : changed; } } diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx new file mode 100644 index 0000000..984e9e8 --- /dev/null +++ b/common/transaction/basics/driver.cxx @@ -0,0 +1,149 @@ +// file : common/transaction/basics/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic transaction operations. +// + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; +using namespace odb::core; + +struct transaction_tracer: odb::tracer +{ + virtual void + execute (connection&, const char* s) + { + string str (s); + + if (str == "BEGIN") + cout << "begin transaction" << endl; + else if (str == "COMMIT") + cout << "commit transaction" << endl; + else if (str == "ROLLBACK") + cout << "rollback transaction" << endl; + } + + // Override the other version to get rid of a Sun CC warning. + // + virtual void + execute (connection& c, const statement& s) + { + execute (c, s.text ()); + } +}; + +int +main (int argc, char* argv[]) +{ + { + transaction_tracer tracer; + auto_ptr db (create_database (argc, argv, false)); + db->tracer (tracer); + + assert (!transaction::has_current ()); + + // Current and db accessors. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + assert (&t.database () == db.get ()); + 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 (odb_db::transaction) == sizeof (transaction)); + + odb_db::transaction t (static_cast (*db).begin ()); + odb_db::transaction& r (odb_db::transaction::current ()); + assert (&t == &r); + } + + // Transaction restart. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + t.commit (); + t.reset (db->begin ()); + t.commit (); + } + } + + // Test early connection release. + // + { + auto_ptr db (create_database (argc, argv, false, 1)); + transaction t1 (db->begin ()); + t1.commit (); + transaction t2 (db->begin ()); + t2.rollback (); + transaction t3 (db->begin ()); + t3.commit (); + } +} diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile new file mode 100644 index 0000000..dbee915 --- /dev/null +++ b/common/transaction/basics/makefile @@ -0,0 +1,89 @@ +# file : common/transaction/basics/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../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)) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/basics/test.std b/common/transaction/basics/test.std new file mode 100644 index 0000000..37d3598 --- /dev/null +++ b/common/transaction/basics/test.std @@ -0,0 +1,26 @@ +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 +test 007 +begin transaction +commit transaction +begin transaction +commit transaction diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx new file mode 100644 index 0000000..b74df4c --- /dev/null +++ b/common/transaction/callback/driver.cxx @@ -0,0 +1,212 @@ +// file : common/transaction/callback/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transaction callbacks. +// + +#include // std::size_t +#include +#include + +#include +#include + +#include + +using namespace std; +using namespace odb::core; + +struct callback +{ + callback (unsigned short v): v_ (v), t_ (0) {} + callback (unsigned short v, transaction& t): v_ (v), t_ (0) {register_ (t);} + ~callback () {if (t_ != 0) unregister ();} + + void + register_ (transaction& t) + { + t_ = &t; + t.register_ (&func, this, transaction::event_all, v_, &t_); + } + + void + unregister () + { + cout << " unregister callback " << v_ << endl; + t_->unregister (this); + t_ = 0; + } + +private: + static void + func (unsigned short event, void* key, unsigned long long data) + { + callback& c (*static_cast (key)); + + const char* en; + switch (event) + { + case transaction::event_commit: + en = "commit"; + break; + case transaction::event_rollback: + en = "rollback"; + break; + default: + en = "unknown"; + } + + cout << " callback " << c.v_ << " " << en << endl; + + assert (data == c.v_); + assert (c.t_ == 0); + } + + unsigned short v_; + transaction* t_; +}; + +struct failed {}; + +static void +throw_func (unsigned short, void*, unsigned long long) +{ + throw failed (); +} + +static void +dummy_func (unsigned short, void* key, unsigned long long data) +{ + assert (reinterpret_cast (key) == data); +} + +static void +fill (transaction& t) +{ + // 20 is from odb/transaction.hxx. + // + for (size_t i (0); i < 20; ++i) + t.register_ (&dummy_func, + reinterpret_cast (i), + transaction::event_all, + i); +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // We want to test both stack and dynamic slots. + // + for (unsigned short i (1); i < 3; ++i) + { + // Test basic logic. + // + cout << "test " << i << "/001" << endl; + + // Commit callback. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.commit (); + } + + // Rollback callback. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.rollback (); + } + + // Rollback via exception callback. + // + { + callback c1 (1); + + try + { + transaction t (db->begin ()); + if (i == 2) fill (t); + c1.register_ (t); + throw failed (); + } + catch (const failed&) + { + } + } + + // Unregister callback at the end. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + c1.unregister (); + t.unregister (&c1); // Test unregistering non-registered key. + t.commit (); + } + + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + c1.unregister (); + callback c2 (2, t); + t.commit (); + } + + // Unregister callback in the middle. + // + cout << "test " << i << "/002" << endl; + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + callback c2 (2, t); + callback c3 (3, t); + c2.unregister (); + t.commit (); + } + + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + callback c2 (2, t); + callback c3 (3, t); + c2.unregister (); + callback c4 (4, t); // Using the free slot. + t.commit (); + } + + // Test a callback in the middle that throws. + // + cout << "test " << i << "/003" << endl; + try + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.register_ (&throw_func, 0); + callback c2 (2, t); + t.commit (); + } + catch (const failed&) + { + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile new file mode 100644 index 0000000..936a02d --- /dev/null +++ b/common/transaction/callback/makefile @@ -0,0 +1,89 @@ +# file : common/transaction/callback/makefile +# copyright : Copyright (c) 2009-2012 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) + +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 + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../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)) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/callback/test.std b/common/transaction/callback/test.std new file mode 100644 index 0000000..f86579b --- /dev/null +++ b/common/transaction/callback/test.std @@ -0,0 +1,34 @@ +test 1/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit +test 1/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit +test 1/003 + callback 1 commit +test 2/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit +test 2/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit +test 2/003 + callback 1 commit diff --git a/common/transaction/driver.cxx b/common/transaction/driver.cxx deleted file mode 100644 index f785870..0000000 --- a/common/transaction/driver.cxx +++ /dev/null @@ -1,149 +0,0 @@ -// file : common/transaction/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction operations. -// - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -using namespace std; -using namespace odb::core; - -struct transaction_tracer: odb::tracer -{ - virtual void - execute (connection&, const char* s) - { - string str (s); - - if (str == "BEGIN") - cout << "begin transaction" << endl; - else if (str == "COMMIT") - cout << "commit transaction" << endl; - else if (str == "ROLLBACK") - cout << "rollback transaction" << endl; - } - - // Override the other version to get rid of a Sun CC warning. - // - virtual void - execute (connection& c, const statement& s) - { - execute (c, s.text ()); - } -}; - -int -main (int argc, char* argv[]) -{ - { - transaction_tracer tracer; - auto_ptr db (create_database (argc, argv, false)); - db->tracer (tracer); - - assert (!transaction::has_current ()); - - // Current and db accessors. - // - cout << "test 001" << endl; - { - transaction t (db->begin ()); - assert (&t.database () == db.get ()); - 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 (odb_db::transaction) == sizeof (transaction)); - - odb_db::transaction t (static_cast (*db).begin ()); - odb_db::transaction& r (odb_db::transaction::current ()); - assert (&t == &r); - } - - // Transaction restart. - // - cout << "test 007" << endl; - { - transaction t (db->begin ()); - t.commit (); - t.reset (db->begin ()); - t.commit (); - } - } - - // Test early connection release. - // - { - auto_ptr db (create_database (argc, argv, false, 1)); - transaction t1 (db->begin ()); - t1.commit (); - transaction t2 (db->begin ()); - t2.rollback (); - transaction t3 (db->begin ()); - t3.commit (); - } -} diff --git a/common/transaction/makefile b/common/transaction/makefile deleted file mode 100644 index 516990c..0000000 --- a/common/transaction/makefile +++ /dev/null @@ -1,89 +0,0 @@ -# file : common/transaction/makefile -# copyright : Copyright (c) 2009-2012 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) - -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 - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): db_id := @database@ -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../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)) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/test.std b/common/transaction/test.std deleted file mode 100644 index 37d3598..0000000 --- a/common/transaction/test.std +++ /dev/null @@ -1,26 +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 -test 007 -begin transaction -commit transaction -begin transaction -commit transaction -- cgit v1.1 From f73c92b7b61368fb60a112b1a44212ae95aad84d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 20 Jan 2013 08:18:30 +0200 Subject: Add extra headers to dist target variables --- common/session/custom/makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 6fb6c95..95bd58d 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -53,12 +53,13 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) +$(dist): export headers := session.hxx session.txx $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ $(call vc11projs,$(name)) $(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) -- cgit v1.1 From 539c92147e8d58c49f350c4070051a6ddf6b2354 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 20 Jan 2013 08:20:56 +0200 Subject: Add cache_ suffix to session cache functions This way they won't conflict with other functions (e.g., delayed database operations) that may have the same names. --- common/session/custom/session.hxx | 29 +++++++++++++++-------------- common/session/custom/session.txx | 21 +++++++++++---------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index ce7e43c..b0a6694 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -96,13 +96,13 @@ private: // public: template - struct position + struct cache_position { typedef object_map map; typedef typename map::iterator iterator; - position (): map_ (0) {} - position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + cache_position (): map_ (0) {} + cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} map* map_; iterator pos_; @@ -111,18 +111,18 @@ public: // Cache management. // template - static position - insert (odb::database&, - const typename odb::object_traits::id_type&, - const typename odb::object_traits::pointer_type&); + static cache_position + _cache_insert (odb::database&, + const typename odb::object_traits::id_type&, + const typename odb::object_traits::pointer_type&); template static typename odb::object_traits::pointer_type - find (odb::database&, const typename odb::object_traits::id_type&); + _cache_find (odb::database&, const typename odb::object_traits::id_type&); template static void - erase (const position& p) + _cache_erase (const cache_position& p) { if (p.map_ != 0) p.map_->erase (p.pos_); @@ -132,22 +132,23 @@ public: // template static void - persist (const position& p) + _cache_persist (const cache_position& p) { - load (p); + _cache_load (p); } template static void - load (const position&); + _cache_load (const cache_position&); template static void - update (odb::database&, const T&); + _cache_update (odb::database&, const T&); template static void - erase (odb::database&, const typename odb::object_traits::id_type&); + _cache_erase (odb::database&, + const typename odb::object_traits::id_type&); private: // Post-commit/rollback callback. diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index 31c08c7..de1f3f0 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -5,15 +5,15 @@ #include template -typename session::position session:: -insert (odb::database&, - const typename odb::object_traits::id_type& id, - const typename odb::object_traits::pointer_type& obj) +typename session::cache_position session:: +_cache_insert (odb::database&, + const typename odb::object_traits::id_type& id, + const typename odb::object_traits::pointer_type& obj) { typedef odb::object_traits object_traits; if (current == 0) - return position (); // No session, return empty position. + return cache_position (); // No session, return empty position. std::shared_ptr& pm (current->map_[&typeid (T)]); @@ -29,12 +29,12 @@ insert (odb::database&, // assert (r.second); - return position (m, r.first); + return cache_position (m, r.first); } template typename odb::object_traits::pointer_type session:: -find (odb::database&, const typename odb::object_traits::id_type& id) +_cache_find (odb::database&, const typename odb::object_traits::id_type& id) { typedef typename odb::object_traits::pointer_type pointer_type; @@ -57,7 +57,7 @@ find (odb::database&, const typename odb::object_traits::id_type& id) template void session:: -load (const position& p) +_cache_load (const cache_position& p) { typedef typename odb::object_traits::pointer_type pointer_type; @@ -75,7 +75,7 @@ load (const position& p) template void session:: -update (odb::database&, const T& obj) +_cache_update (odb::database&, const T& obj) { typedef odb::object_traits object_traits; typedef typename object_traits::pointer_type pointer_type; @@ -105,7 +105,8 @@ update (odb::database&, const T& obj) template void session:: -erase (odb::database&, const typename odb::object_traits::id_type& id) +_cache_erase (odb::database&, + const typename odb::object_traits::id_type& id) { if (current == 0) return; // No session. -- cgit v1.1 From 89de275db2b77d0abf9fa1ec066ef11e262c88af Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Jan 2013 15:10:22 +0200 Subject: Add support for mapping char[N] to CHAR/VARCHAR database types Also improve query support for arrays (decaying). --- common/makefile | 3 +- common/query/array/driver.cxx | 170 ++++++++++++ common/query/array/makefile | 116 ++++++++ common/query/array/test.hxx | 77 ++++++ common/query/array/test.std | 0 common/query/basics/driver.cxx | 607 +++++++++++++++++++++++++++++++++++++++++ common/query/basics/makefile | 115 ++++++++ common/query/basics/test.hxx | 84 ++++++ common/query/basics/test.std | 102 +++++++ common/query/driver.cxx | 607 ----------------------------------------- common/query/makefile | 115 -------- common/query/test.hxx | 84 ------ common/query/test.std | 102 ------- libcommon/common/common.hxx | 4 +- libcommon/common/common.txx | 2 +- mssql/types/driver.cxx | 47 ++++ mssql/types/test.hxx | 103 ++++++- mysql/types/driver.cxx | 28 ++ mysql/types/test.hxx | 47 +++- oracle/types/driver.cxx | 33 +++ oracle/types/test.hxx | 54 +++- pgsql/types/driver.cxx | 35 +++ pgsql/types/test.hxx | 48 +++- sqlite/types/driver.cxx | 34 +++ sqlite/types/test.hxx | 70 ++++- 25 files changed, 1737 insertions(+), 950 deletions(-) create mode 100644 common/query/array/driver.cxx create mode 100644 common/query/array/makefile create mode 100644 common/query/array/test.hxx create mode 100644 common/query/array/test.std create mode 100644 common/query/basics/driver.cxx create mode 100644 common/query/basics/makefile create mode 100644 common/query/basics/test.hxx create mode 100644 common/query/basics/test.std delete mode 100644 common/query/driver.cxx delete mode 100644 common/query/makefile delete mode 100644 common/query/test.hxx delete mode 100644 common/query/test.std diff --git a/common/makefile b/common/makefile index 9e6e319..eae7f7e 100644 --- a/common/makefile +++ b/common/makefile @@ -33,7 +33,8 @@ no-id \ optimistic \ pragma \ prepared \ -query \ +query/basics \ +query/array \ readonly \ relationship \ relationship-query \ diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx new file mode 100644 index 0000000..2bda0a9 --- /dev/null +++ b/common/query/array/driver.cxx @@ -0,0 +1,170 @@ +// file : common/query/array/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query support for C arrays. +// + +#include +#include // std::auto_ptr +#include +#include + +#include +#include + +#include // DATABASE_* +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +#if defined(DATABASE_MYSQL) +const odb::mysql::database_type_id bt = odb::mysql::id_blob; +const odb::mysql::database_type_id st = odb::mysql::id_string; +#elif defined(DATABASE_SQLITE) +const odb::sqlite::database_type_id bt = odb::sqlite::id_blob; +const odb::sqlite::database_type_id st = odb::sqlite::id_text; +#elif defined(DATABASE_PGSQL) +const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; +const odb::pgsql::database_type_id st = odb::pgsql::id_string; +#elif defined(DATABASE_ORACLE) +const odb::oracle::database_type_id bt = odb::oracle::id_raw; +const odb::oracle::database_type_id st = odb::oracle::id_string; +#elif defined(DATABASE_MSSQL) +const odb::mssql::database_type_id bt = odb::mssql::id_binary; +const odb::mssql::database_type_id st = odb::mssql::id_string; +#else +# error unknown database +#endif + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + typedef odb::query query; + + const char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}; + + // + // + { + object o1 (1, "abc", buf); + object o2 (2, "bcd", buf); + object o3 (3, "cde", buf); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + + // string + // + assert (size (db->query (query::s == "abc")) == 1); + assert (size (db->query (query::s == query::_val ("bcd"))) == 1); + assert (size (db->query ("s = " + query::_val ("bcd"))) == 1); + assert (size (db->query ("s = " + query::_ref ("bcd"))) == 1); + + { + char a[] = "bcd"; + char* ra = a; + assert (size (db->query (query::s == a)) == 1); + assert (size (db->query (query::s == query::_val (a))) == 1); + assert (size (db->query (query::s == query::_ref (ra))) == 1); + assert (size (db->query ("s = " + query::_val (a))) == 1); + assert (size (db->query ("s = " + query::_ref (a))) == 1); + } + + { + const char a[] = "bcd"; + const char* ra = a; + assert (size (db->query (query::s == a)) == 1); + assert (size (db->query (query::s == query::_val (a))) == 1); + assert (size (db->query (query::s == query::_ref (ra))) == 1); + assert (size (db->query ("s = " + query::_val (a))) == 1); + assert (size (db->query ("s = " + query::_ref (a))) == 1); + } + + { + const char* p = "cde"; + assert (size (db->query (query::s == p)) == 1); + assert (size (db->query (query::s == query::_val (p))) == 1); + assert (size (db->query (query::s == query::_ref (p))) == 1); + assert (size (db->query ("s = " + query::_val (p))) == 1); + assert (size (db->query ("s = " + query::_ref (p))) == 1); + } + + { + char a[] = "cde"; + char* p = a; + assert (size (db->query (query::s == p)) == 1); + assert (size (db->query (query::s == query::_val (p))) == 1); + assert (size (db->query (query::s == query::_ref (p))) == 1); + assert (size (db->query ("s = " + query::_val (p))) == 1); + assert (size (db->query ("s = " + query::_ref (p))) == 1); + } + + string s ("abc"); + //assert (size (db->query (query::s == s)) == 1); + assert (size (db->query (query::s == s.c_str ())) == 1); + //assert (size (db->query (query::s == query::_val (s))) == 1); + assert (size (db->query (query::s == query::_val (s.c_str ()))) == 1); + assert (size (db->query ("s = " + query::_val (s))) == 1); + assert (size (db->query ("s = " + query::_ref (s))) == 1); + + assert (size (db->query (query::s == query::s1)) == 3); + + // std::array + // +#ifdef ODB_CXX11 + array a; + strcpy (a.data (), "abc"); + + assert (size (db->query (query::a == a)) == 1); + assert (size (db->query (query::a == query::_val (a))) == 1); + assert (size (db->query (query::a == query::_ref (a))) == 1); + assert (size (db->query ("a = " + query::_val (a))) == 1); + assert (size (db->query ("a = " + query::_ref (a))) == 1); +#endif + + // char + // + assert (size (db->query (query::c == 'a')) == 1); + + char c ('b'); + assert (size (db->query (query::c == query::_val (c))) == 1); + assert (size (db->query (query::c == query::_ref (c))) == 1); + + assert (size (db->query ("c = " + query::_val ('c'))) == 1); + assert (size (db->query ("c = " + query::_ref (c))) == 1); + + assert (size (db->query (query::c == query::c1)) == 3); + + // buffer + // + assert (size (db->query (query::b == buf)) == 3); + assert (size (db->query (query::b == query::_val (buf))) == 3); + assert (size (db->query (query::b == query::_ref (buf))) == 3); + assert (size (db->query ("b = " + query::_val (buf))) == 3); + assert (size (db->query ("b = " + query::_ref (buf))) == 3); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/query/array/makefile b/common/query/array/makefile new file mode 100644 index 0000000..817828f --- /dev/null +++ b/common/query/array/makefile @@ -0,0 +1,116 @@ +# file : common/query/array/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --generate-prepared --sql-name-case oracle:upper \ +--table-prefix t_query_array_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx new file mode 100644 index 0000000..32ee413 --- /dev/null +++ b/common/query/array/test.hxx @@ -0,0 +1,77 @@ +// file : common/query/array/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include // std::strncpy + +#ifdef HAVE_CXX11 +# include +#endif + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id, const char* s, const char* b) + : id_ (id) + { + std::strncpy (s_, s, sizeof (s_)); + std::strncpy (s1_, s, sizeof (s1_)); +#ifdef HAVE_CXX11 + std::strncpy (a_.data (), s, a_.size ()); +#endif + c_ = c1_ = *s; + std::memcpy (b_, b, sizeof (b_)); + } + + #pragma db id + unsigned long id_; + + char s_[17]; + char s1_[17]; + +#ifdef HAVE_CXX11 +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) || \ + defined(ODB_DATABASE_PGSQL) || \ + defined(ODB_DATABASE_ORACLE) || \ + defined(ODB_DATABASE_MSSQL) +# pragma db type("VARCHAR(16)") +# elif defined(ODB_DATABASE_SQLITE) +# pragma db type("TEXT") +# else +# error unknown database +# endif +#endif + std::array a_; +#endif + + char c_; + char c1_; + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) +# pragma db type("BINARY(16)") +# elif defined(ODB_DATABASE_SQLITE) +# pragma db type("BLOB") +# elif defined(ODB_DATABASE_PGSQL) +# pragma db type("BYTEA") +# elif defined(ODB_DATABASE_ORACLE) +# pragma db type("RAW(16)") +# elif defined(ODB_DATABASE_MSSQL) +# pragma db type("BINARY(16)") +# else +# error unknown database +# endif +#endif + char b_[16]; +}; + +#endif // TEST_HXX diff --git a/common/query/array/test.std b/common/query/array/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx new file mode 100644 index 0000000..686b4b6 --- /dev/null +++ b/common/query/basics/driver.cxx @@ -0,0 +1,607 @@ +// file : common/query/basics/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic query support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include // DATABASE_XXX +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +void +print (result& r) +{ + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + auto_ptr o (i.load ()); + cout << *o << endl; + } + cout << endl; +} + +const char* names[] = { "John", "Jane", "Joe" }; +const char** names_end = names + sizeof (names)/sizeof (names[0]); + +const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; + +int +main (int argc, char* argv[]) +{ + buffer + key1 (key_data[0], key_data[0] + 3), + key2 (key_data[1], key_data[1] + 3), + key3 (key_data[2], key_data[2] + 3); + + try + { + auto_ptr db (create_database (argc, argv)); + + typedef odb::query query; + typedef odb::result result; + + // + // + { + person p1 (1, "John", "Doe", 30, true, key1); + person p2 (2, "Jane", "Doe", 29, true, key2); + person p3 (3, "Joe", "Dirt", 31, false, key3); + p3.middle_name_.reset (new string ("Squeaky")); + person p4 (4, "Johansen", "Johansen", 32, false); + p4.middle_name_.reset (new string ("J")); + + transaction t (db->begin ()); + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + t.commit (); + } + + // Compilation tests. + // + if (false) + { + string name; + unsigned short age; + + db->query ("age = " + query::_ref (age)); + db->query ("age = " + query::_val (age)); + + query age_q (query::_ref (age) + " = age"); + query name_q ("first = " + query::_val (name)); + query q (age_q + "AND" + name_q); + + db->query (q); + db->query (age_q + "OR" + + name_q + "OR" + + "age < " + query::_ref (age)); + + query q1 (query::_val (name)); + q1 += " = first"; + } + + // Select-all query. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + result r (db->query ()); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + person p; + i.load (p); + cout << p << endl; + } + + t.commit (); + } + + // Select-all query with order by. + // + cout << "test 002" << endl; + { + transaction t (db->begin ()); + result r (db->query ("ORDER BY" + query::age)); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + person& p (*i); + + cout << p.first_name_; + + if (i->middle_name_.get () != 0) + cout << ' ' << *i->middle_name_; + + cout << ' ' << i->last_name_ << ' ' << i->age_ << + (i->married_ ? " married" : " single") << endl; + } + cout << endl; + + t.commit (); + } + + // String query. + // + cout << "test 003" << endl; + { + transaction t (db->begin ()); +#ifndef DATABASE_ORACLE + result r (db->query ("age >= 30 AND last = 'Doe'")); +#else + result r (db->query ("\"age\" >= 30 AND \"last\" = 'Doe'")); +#endif + print (r); + t.commit (); + } + + // Value binding. + // + cout << "test 004" << endl; + { + transaction t (db->begin ()); + + const char* name = "Doe"; + +#ifndef DATABASE_ORACLE + result r ( + db->query ( + "age >= " + query::_ref (30) + "AND" + + "last = " + query::_val (name))); +#else + result r ( + db->query ( + "\"age\" >= " + query::_ref (30) + "AND" + + "\"last\" = " + query::_val (name))); +#endif + + print (r); + t.commit (); + } + + // Reference binding. + // + cout << "test 005" << endl; + { + transaction t (db->begin ()); + + string name; + unsigned short age; + +#ifndef DATABASE_ORACLE + query q ("age >= " + query::_ref (age) + "AND" + + "last = " + query::_ref (name)); +#else + query q ("\"age\" >= " + query::_ref (age) + "AND" + + "\"last\" = " + query::_ref (name)); +#endif + + name = "Doe"; + age = 30; + result r (db->query (q)); + print (r); + + name = "Dirt"; + age = 31; + r = db->query (q); + print (r); + + t.commit (); + } + + // + // Language-embedded queries. + // + + // Compilation tests. + // + if (false) + { + string name; + unsigned short age; + + // Column operators. + // + query q1 (query::married); + db->query (query::married); + db->query (query::married == true); + + //db->query (query::age); + + db->query (query::age == 30); + db->query (query::age == age); + db->query (query::age == query::_val (30)); + db->query (query::age == query::_val (age)); + db->query (query::age == query::_ref (age)); + //db->query (query::age == "123"); + //db->query ("123" == query::age); + //db->query (query::age == query::_val ("123")); + //db->query (query::age == query::_ref (name)); + db->query (query::last_name == "Doe"); + db->query (query::last_name == name); + db->query (query::last_name == query::_val ("Doe")); + db->query (query::last_name == query::_val (name)); + db->query (query::last_name == query::_ref (name)); + //db->query (query::last_name == 30); + //db->query (query::last_name == query::_val (30)); + //db->query (query::last_name == query::_ref (age)); + + db->query (query::last_name.is_null ()); + db->query (query::last_name.is_not_null ()); + + db->query (query::first_name == query::last_name); + + db->query (query::first_name.in ("John", "Jane")); + db->query (query::first_name.in_range (names, names_end)); + + // Query operators. + // + db->query (query::age == 30 && query::last_name == "Doe"); + db->query (query::age == 30 || query::last_name == "Doe"); + db->query (!(query::age == 30 || query::last_name == "Doe")); + db->query ((query::last_name == "Doe") + "ORDER BY age"); + } + + // Test is_null/is_not_null. + // + cout << "test 006" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::middle_name.is_null ())); + print (r); + r = db->query (query::middle_name.is_not_null ()); + print (r); + t.commit (); + } + + // Test boolean columns. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::married)); + print (r); + r = db->query (!query::married); + print (r); + t.commit (); + } + + // Test implicit by-value, explicit by-value, and by-reference. + // + cout << "test 008" << endl; + { + string name ("Dirt"); + + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + print (r); + r = db->query (query::last_name == query::_val (name)); + print (r); + query q (query::last_name == query::_ref (name)); + name = "Doe"; + r = db->query (q); + print (r); + t.commit (); + } + + // Test column operators (==, !=, <, >, <=, >=). + // + cout << "test 009" << endl; + { + transaction t (db->begin ()); + + // == + // + result r (db->query (query::last_name == "Doe")); + print (r); + + // != + // + r = db->query (query::last_name != "Doe"); + print (r); + + // < + // + r = db->query (query::age < 31); + print (r); + + // > + // + r = db->query (query::age > 30); + print (r); + + // <= + // + r = db->query (query::age <= 30); + print (r); + + // >= + // + r = db->query (query::age >= 31); + print (r); + + t.commit (); + } + + // Test query operators (&&, ||, (), !, +). + // + cout << "test 010" << endl; + { + transaction t (db->begin ()); + + // && + // + result r (db->query ( + query::last_name == "Doe" && query::age == 29)); + print (r); + + // || + // + r = db->query (query::last_name == "Doe" || query::age == 31); + print (r); + + // () + // + r = db->query ( + (query::last_name != "Doe" || query::age == 29) && query::married); + print (r); + + // != + // + r = db->query (!(query::last_name == "Doe")); + print (r); + + // + + // + r = db->query ((query::last_name == "Doe") + + "ORDER BY" + query::age); + print (r); + + t.commit (); + } + + // Test in/in_range. + // + cout << "test 011" << endl; + { + transaction t (db->begin ()); + + result r (db->query (query::first_name.in ("John", "Jane"))); + print (r); + + r = db->query (query::first_name.in_range (names, names_end)); + print (r); + + t.commit (); + } + + // Test column-to-column comparison. + // + cout << "test 012" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::first_name == query::last_name)); + print (r); + t.commit (); + } + + // Test value_traits::value_type != value_traits::query_type. + // + cout << "test 013" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::middle_name == "Squeaky")); + print (r); + t.commit (); + } + + // Test that loading of the same object type during iteration does + // not invalidate the result. + // + cout << "test 014" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + + { + auto_ptr joe (db->load (3)); + } + + { + person p (5, "Peter", "Peterson", 70, false, key3); + db->persist (p); + db->erase (p); + } + + // SQL Server does not support re-loading of an object with long data + // from a query result. + // +#ifndef DATABASE_MSSQL + assert (i->last_name_ == "Doe"); // Actual load. +#endif + + // Overwrite object image again. + // + auto_ptr joe (db->load (3)); + person p; + i.load (p); + assert (p.last_name_ == "Doe"); + + t.commit (); + } + + // Test uncached result. + // + cout << "test 015" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe", false)); + print (r); + t.commit (); + } + + // Test BLOB column operations. + // + cout << "test 016" << endl; + { + transaction t (db->begin ()); + + result r; + result::iterator i; + + // Oracle does not support LOB comparisons. + // +#ifndef DATABASE_ORACLE + // == + // + r = db->query (query::public_key == key2); + + i = r.begin (); + assert (i != r.end ()); + + assert (*i->public_key_ == key2); + assert (++i == r.end ()); +#endif + + // is_null + // + r = db->query (query::public_key.is_null ()); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen"); + assert (++i == r.end ()); + + // is_not_null + // + r = db->query (query::public_key.is_not_null ()); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "John" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Jane" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt"); + assert (++i == r.end ()); + + t.commit (); + } + + // Test iterator::id(). + // + cout << "test 017" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i.id () == 3); + + t.commit (); + } + + // Test empty result set. + // + cout << "test 018" << endl; + { + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.begin () == r.end ()); + t.commit (); + } + } + + // Test size() validity at the beginning/middle/end of result set. + // + cout << "test 019" << endl; +#if !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_ORACLE) && \ + !defined(DATABASE_MSSQL) + { + { + transaction t (db->begin ()); + result r (db->query ()); + assert (r.size () == 4); + result::iterator i (r.begin ()); + assert (r.size () == 4); + ++i; + ++i; + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + r.cache (); // Cache in the middle. + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + ++i; + r.cache (); // Cache at the end. + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.size () == 0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) ; + assert (r.size () == 0); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/query/basics/makefile b/common/query/basics/makefile new file mode 100644 index 0000000..0be5352 --- /dev/null +++ b/common/query/basics/makefile @@ -0,0 +1,115 @@ +# file : common/query/basics/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --generate-prepared --table-prefix t_query_basics_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx new file mode 100644 index 0000000..f572d75 --- /dev/null +++ b/common/query/basics/test.hxx @@ -0,0 +1,84 @@ +// file : common/query/basics/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include + +#include +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +typedef std::vector buffer; +typedef odb::nullable nullable_buffer; + +#pragma db object +struct person +{ + person (unsigned long id, + const std::string& fn, + const std::string& ln, + unsigned short age, + bool married, + const nullable_buffer& public_key = nullable_buffer ()) + : id_ (id), + first_name_ (fn), + last_name_ (ln), + age_ (age), + married_ (married), + public_key_ (public_key) + { + } + + person () + { + } + + #pragma db id + unsigned long id_; + + #pragma db column ("first") + std::string first_name_; + + #pragma db column ("middle") null + std::auto_ptr middle_name_; + + #pragma db column ("last") + std::string last_name_; + + unsigned short age_; + bool married_; + + #pragma db column ("key") type(BLOB_TYPE) null + nullable_buffer public_key_; +}; + +inline std::ostream& +operator<< (std::ostream& os, const person& p) +{ + os << p.first_name_; + + if (p.middle_name_.get () != 0) + os << ' ' << *p.middle_name_; + + os << ' ' << p.last_name_ << ' ' << p.age_ << + (p.married_ ? " married" : " single"); + + return os; +} + +#endif // TEST_HXX diff --git a/common/query/basics/test.std b/common/query/basics/test.std new file mode 100644 index 0000000..0548968 --- /dev/null +++ b/common/query/basics/test.std @@ -0,0 +1,102 @@ +test 001 +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single +test 002 +Jane Doe 29 married +John Doe 30 married +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 003 +John Doe 30 married + +test 004 +John Doe 30 married + +test 005 +John Doe 30 married + +Joe Squeaky Dirt 31 single + +test 006 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 007 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 008 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single + +John Doe 30 married +Jane Doe 29 married + +test 009 +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +John Doe 30 married +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +test 010 +Jane Doe 29 married + +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single + +Jane Doe 29 married + +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +Jane Doe 29 married +John Doe 30 married + +test 011 +John Doe 30 married +Jane Doe 29 married + +John Doe 30 married +Jane Doe 29 married +Joe Squeaky Dirt 31 single + +test 012 +Johansen J Johansen 32 single + +test 013 +Joe Squeaky Dirt 31 single + +test 014 +test 015 +John Doe 30 married +Jane Doe 29 married + +test 016 +test 017 +test 018 +test 019 diff --git a/common/query/driver.cxx b/common/query/driver.cxx deleted file mode 100644 index bec61fb..0000000 --- a/common/query/driver.cxx +++ /dev/null @@ -1,607 +0,0 @@ -// file : common/query/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test query support. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include // DATABASE_XXX -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -void -print (result& r) -{ - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - auto_ptr o (i.load ()); - cout << *o << endl; - } - cout << endl; -} - -const char* names[] = { "John", "Jane", "Joe" }; -const char** names_end = names + sizeof (names)/sizeof (names[0]); - -const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; - -int -main (int argc, char* argv[]) -{ - buffer - key1 (key_data[0], key_data[0] + 3), - key2 (key_data[1], key_data[1] + 3), - key3 (key_data[2], key_data[2] + 3); - - try - { - auto_ptr db (create_database (argc, argv)); - - typedef odb::query query; - typedef odb::result result; - - // - // - { - person p1 (1, "John", "Doe", 30, true, key1); - person p2 (2, "Jane", "Doe", 29, true, key2); - person p3 (3, "Joe", "Dirt", 31, false, key3); - p3.middle_name_.reset (new string ("Squeaky")); - person p4 (4, "Johansen", "Johansen", 32, false); - p4.middle_name_.reset (new string ("J")); - - transaction t (db->begin ()); - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - t.commit (); - } - - // Compilation tests. - // - if (false) - { - string name; - unsigned short age; - - db->query ("age = " + query::_ref (age)); - db->query ("age = " + query::_val (age)); - - query age_q (query::_ref (age) + " = age"); - query name_q ("first = " + query::_val (name)); - query q (age_q + "AND" + name_q); - - db->query (q); - db->query (age_q + "OR" + - name_q + "OR" + - "age < " + query::_ref (age)); - - query q1 (query::_val (name)); - q1 += " = first"; - } - - // Select-all query. - // - cout << "test 001" << endl; - { - transaction t (db->begin ()); - result r (db->query ()); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - person p; - i.load (p); - cout << p << endl; - } - - t.commit (); - } - - // Select-all query with order by. - // - cout << "test 002" << endl; - { - transaction t (db->begin ()); - result r (db->query ("ORDER BY" + query::age)); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - person& p (*i); - - cout << p.first_name_; - - if (i->middle_name_.get () != 0) - cout << ' ' << *i->middle_name_; - - cout << ' ' << i->last_name_ << ' ' << i->age_ << - (i->married_ ? " married" : " single") << endl; - } - cout << endl; - - t.commit (); - } - - // String query. - // - cout << "test 003" << endl; - { - transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - result r (db->query ("age >= 30 AND last = 'Doe'")); -#else - result r (db->query ("\"age\" >= 30 AND \"last\" = 'Doe'")); -#endif - print (r); - t.commit (); - } - - // Value binding. - // - cout << "test 004" << endl; - { - transaction t (db->begin ()); - - const char* name = "Doe"; - -#ifndef DATABASE_ORACLE - result r ( - db->query ( - "age >= " + query::_ref (30) + "AND" + - "last = " + query::_val (name))); -#else - result r ( - db->query ( - "\"age\" >= " + query::_ref (30) + "AND" + - "\"last\" = " + query::_val (name))); -#endif - - print (r); - t.commit (); - } - - // Reference binding. - // - cout << "test 005" << endl; - { - transaction t (db->begin ()); - - string name; - unsigned short age; - -#ifndef DATABASE_ORACLE - query q ("age >= " + query::_ref (age) + "AND" + - "last = " + query::_ref (name)); -#else - query q ("\"age\" >= " + query::_ref (age) + "AND" + - "\"last\" = " + query::_ref (name)); -#endif - - name = "Doe"; - age = 30; - result r (db->query (q)); - print (r); - - name = "Dirt"; - age = 31; - r = db->query (q); - print (r); - - t.commit (); - } - - // - // Language-embedded queries. - // - - // Compilation tests. - // - if (false) - { - string name; - unsigned short age; - - // Column operators. - // - query q1 (query::married); - db->query (query::married); - db->query (query::married == true); - - //db->query (query::age); - - db->query (query::age == 30); - db->query (query::age == age); - db->query (query::age == query::_val (30)); - db->query (query::age == query::_val (age)); - db->query (query::age == query::_ref (age)); - //db->query (query::age == "123"); - //db->query ("123" == query::age); - //db->query (query::age == query::_val ("123")); - //db->query (query::age == query::_ref (name)); - db->query (query::last_name == "Doe"); - db->query (query::last_name == name); - db->query (query::last_name == query::_val ("Doe")); - db->query (query::last_name == query::_val (name)); - db->query (query::last_name == query::_ref (name)); - //db->query (query::last_name == 30); - //db->query (query::last_name == query::_val (30)); - //db->query (query::last_name == query::_ref (age)); - - db->query (query::last_name.is_null ()); - db->query (query::last_name.is_not_null ()); - - db->query (query::first_name == query::last_name); - - db->query (query::first_name.in ("John", "Jane")); - db->query (query::first_name.in_range (names, names_end)); - - // Query operators. - // - db->query (query::age == 30 && query::last_name == "Doe"); - db->query (query::age == 30 || query::last_name == "Doe"); - db->query (!(query::age == 30 || query::last_name == "Doe")); - db->query ((query::last_name == "Doe") + "ORDER BY age"); - } - - // Test is_null/is_not_null. - // - cout << "test 006" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::middle_name.is_null ())); - print (r); - r = db->query (query::middle_name.is_not_null ()); - print (r); - t.commit (); - } - - // Test boolean columns. - // - cout << "test 007" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::married)); - print (r); - r = db->query (!query::married); - print (r); - t.commit (); - } - - // Test implicit by-value, explicit by-value, and by-reference. - // - cout << "test 008" << endl; - { - string name ("Dirt"); - - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe")); - print (r); - r = db->query (query::last_name == query::_val (name)); - print (r); - query q (query::last_name == query::_ref (name)); - name = "Doe"; - r = db->query (q); - print (r); - t.commit (); - } - - // Test column operators (==, !=, <, >, <=, >=). - // - cout << "test 009" << endl; - { - transaction t (db->begin ()); - - // == - // - result r (db->query (query::last_name == "Doe")); - print (r); - - // != - // - r = db->query (query::last_name != "Doe"); - print (r); - - // < - // - r = db->query (query::age < 31); - print (r); - - // > - // - r = db->query (query::age > 30); - print (r); - - // <= - // - r = db->query (query::age <= 30); - print (r); - - // >= - // - r = db->query (query::age >= 31); - print (r); - - t.commit (); - } - - // Test query operators (&&, ||, (), !, +). - // - cout << "test 010" << endl; - { - transaction t (db->begin ()); - - // && - // - result r (db->query ( - query::last_name == "Doe" && query::age == 29)); - print (r); - - // || - // - r = db->query (query::last_name == "Doe" || query::age == 31); - print (r); - - // () - // - r = db->query ( - (query::last_name != "Doe" || query::age == 29) && query::married); - print (r); - - // != - // - r = db->query (!(query::last_name == "Doe")); - print (r); - - // + - // - r = db->query ((query::last_name == "Doe") + - "ORDER BY" + query::age); - print (r); - - t.commit (); - } - - // Test in/in_range. - // - cout << "test 011" << endl; - { - transaction t (db->begin ()); - - result r (db->query (query::first_name.in ("John", "Jane"))); - print (r); - - r = db->query (query::first_name.in_range (names, names_end)); - print (r); - - t.commit (); - } - - // Test column-to-column comparison. - // - cout << "test 012" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::first_name == query::last_name)); - print (r); - t.commit (); - } - - // Test value_traits::value_type != value_traits::query_type. - // - cout << "test 013" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::middle_name == "Squeaky")); - print (r); - t.commit (); - } - - // Test that loading of the same object type during iteration does - // not invalidate the result. - // - cout << "test 014" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - ++i; - assert (i != r.end ()); - - { - auto_ptr joe (db->load (3)); - } - - { - person p (5, "Peter", "Peterson", 70, false, key3); - db->persist (p); - db->erase (p); - } - - // SQL Server does not support re-loading of an object with long data - // from a query result. - // -#ifndef DATABASE_MSSQL - assert (i->last_name_ == "Doe"); // Actual load. -#endif - - // Overwrite object image again. - // - auto_ptr joe (db->load (3)); - person p; - i.load (p); - assert (p.last_name_ == "Doe"); - - t.commit (); - } - - // Test uncached result. - // - cout << "test 015" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe", false)); - print (r); - t.commit (); - } - - // Test BLOB column operations. - // - cout << "test 016" << endl; - { - transaction t (db->begin ()); - - result r; - result::iterator i; - - // Oracle does not support LOB comparisons. - // -#ifndef DATABASE_ORACLE - // == - // - r = db->query (query::public_key == key2); - - i = r.begin (); - assert (i != r.end ()); - - assert (*i->public_key_ == key2); - assert (++i == r.end ()); -#endif - - // is_null - // - r = db->query (query::public_key.is_null ()); - - i = r.begin (); - assert (i != r.end ()); - - assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen"); - assert (++i == r.end ()); - - // is_not_null - // - r = db->query (query::public_key.is_not_null ()); - - i = r.begin (); - assert (i != r.end ()); - - assert (i->first_name_ == "John" && i->last_name_ == "Doe"); - assert (++i != r.end ()); - - assert (i->first_name_ == "Jane" && i->last_name_ == "Doe"); - assert (++i != r.end ()); - - assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt"); - assert (++i == r.end ()); - - t.commit (); - } - - // Test iterator::id(). - // - cout << "test 017" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Dirt")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i.id () == 3); - - t.commit (); - } - - // Test empty result set. - // - cout << "test 018" << endl; - { - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.begin () == r.end ()); - t.commit (); - } - } - - // Test size() validity at the beginning/middle/end of result set. - // - cout << "test 019" << endl; -#if !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_ORACLE) && \ - !defined(DATABASE_MSSQL) - { - { - transaction t (db->begin ()); - result r (db->query ()); - assert (r.size () == 4); - result::iterator i (r.begin ()); - assert (r.size () == 4); - ++i; - ++i; - ++i; - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (false)); - result::iterator i (r.begin ()); - ++i; - ++i; - r.cache (); // Cache in the middle. - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (false)); - result::iterator i (r.begin ()); - ++i; - ++i; - ++i; - r.cache (); // Cache at the end. - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.size () == 0); - for (result::iterator i (r.begin ()); i != r.end (); ++i) ; - assert (r.size () == 0); - } - } -#endif - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/query/makefile b/common/query/makefile deleted file mode 100644 index 6f25ba4..0000000 --- a/common/query/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/query/makefile -# copyright : Copyright (c) 2009-2012 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) --generate-schema \ ---generate-query --generate-prepared --table-prefix t_query_ -$(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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/test.hxx b/common/query/test.hxx deleted file mode 100644 index 948ba30..0000000 --- a/common/query/test.hxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : common/query/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include - -#include -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -# define BLOB_TYPE "VARBINARY(max)" -# else -# define BLOB_TYPE "BLOB" -# endif -#endif - -typedef std::vector buffer; -typedef odb::nullable nullable_buffer; - -#pragma db object -struct person -{ - person (unsigned long id, - const std::string& fn, - const std::string& ln, - unsigned short age, - bool married, - const nullable_buffer& public_key = nullable_buffer ()) - : id_ (id), - first_name_ (fn), - last_name_ (ln), - age_ (age), - married_ (married), - public_key_ (public_key) - { - } - - person () - { - } - - #pragma db id - unsigned long id_; - - #pragma db column ("first") - std::string first_name_; - - #pragma db column ("middle") null - std::auto_ptr middle_name_; - - #pragma db column ("last") - std::string last_name_; - - unsigned short age_; - bool married_; - - #pragma db column ("key") type(BLOB_TYPE) null - nullable_buffer public_key_; -}; - -inline std::ostream& -operator<< (std::ostream& os, const person& p) -{ - os << p.first_name_; - - if (p.middle_name_.get () != 0) - os << ' ' << *p.middle_name_; - - os << ' ' << p.last_name_ << ' ' << p.age_ << - (p.married_ ? " married" : " single"); - - return os; -} - -#endif // TEST_HXX diff --git a/common/query/test.std b/common/query/test.std deleted file mode 100644 index 0548968..0000000 --- a/common/query/test.std +++ /dev/null @@ -1,102 +0,0 @@ -test 001 -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single -test 002 -Jane Doe 29 married -John Doe 30 married -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 003 -John Doe 30 married - -test 004 -John Doe 30 married - -test 005 -John Doe 30 married - -Joe Squeaky Dirt 31 single - -test 006 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 007 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 008 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single - -John Doe 30 married -Jane Doe 29 married - -test 009 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 010 -Jane Doe 29 married - -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single - -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -Jane Doe 29 married -John Doe 30 married - -test 011 -John Doe 30 married -Jane Doe 29 married - -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single - -test 012 -Johansen J Johansen 32 single - -test 013 -Joe Squeaky Dirt 31 single - -test 014 -test 015 -John Doe 30 married -Jane Doe 29 married - -test 016 -test 017 -test 018 -test 019 diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 2b79a5a..0d56d7c 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -38,11 +38,11 @@ create_specific_database (int& argc, } // This function returns an accurate result only if the result iterator -// hasn't been advanced. +// hasn't been advanced and after the call the result is no longer valid. // template std::size_t -size (odb::result&); +size (odb::result); #include diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index 66ccac9..5c40520 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -11,7 +11,7 @@ size_available (); template std::size_t -size (odb::result& r) +size (odb::result r) { if (size_available ()) return r.size (); diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index a779079..6276bab 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -218,6 +218,53 @@ main (int argc, char* argv[]) } } + // Test char/wchar_t arrays. + // + { + char_array o1 (1, "", L""); + char_array o2 (2, "1234567890", L"12345678\x1FFF\xD7FF"); + char_array o3 (3, "1234567890123456", L"12345678901234\x1FFF\xD7FF"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // SQL Server returns padded values for CHAR(N)/NCHAR(N). + // + memcpy (o1.s2, " ", 16); + o1.s3[0] = o1.c1 = ' '; + memcpy (o2.s2, "1234567890 ", 16); + + memset (o1.ls2, ' ', 1025); + memset (o2.ls2 + 10, ' ', 1025 - 10); + + memcpy (o1.ws2, L" ", 16 * sizeof (wchar_t)); + o1.ws3[0] = o1.wc1 = L' '; + memcpy (o2.ws2, L"12345678\x1FFF\xD7FF ", 16 * sizeof (wchar_t)); + + for (size_t i (0); i < 257; ++i) + o1.lws2[i] = L' '; + + for (size_t i (10); i < 257; ++i) + o2.lws2[i] = L' '; + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + // Test optimistic concurrency using ROWVERSION. // { diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 3e20e73..884db35 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -23,7 +23,8 @@ typedef struct _GUID #include #include #include // std::auto_ptr -#include // std::memcmp +#include // std::memcmp, std::strncpy, std::str[n]cmp +#include // std::wcsncpy, std::wcs[n]cmp #include @@ -369,6 +370,106 @@ struct long_cont } }; +// Test char/wchar_t arrays. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s, const wchar_t* ws) + : id_ (id) + { + std::strncpy (s1, s, sizeof (s1)); + std::strncpy (s2, s, sizeof (s2)); + s3[0] = c1 = *s; + + std::wcsncpy (ws1, ws, sizeof (ws1) / sizeof(wchar_t)); + std::wcsncpy (ws2, ws, sizeof (ws2) / sizeof(wchar_t)); + ws3[0] = wc1 = *ws; + + if (std::strlen (s) == sizeof (s2)) + { + std::memset (ls1, '1', 1025); + ls1[1025] = '\0'; + std::memset (ls2, '2', 1025); + + for (std::size_t i (0); i < 257; ++i) + { + lws1[i] = L'1'; + lws2[i] = L'2'; + } + lws1[257] = L'\0'; + } + else + { + std::strcpy (ls1, s); + std::strcpy (ls2, s); + + std::wcscpy (lws1, ws); + std::wcscpy (lws2, ws); + } + } + + #pragma db id + unsigned long id_; + + // + // + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + // Long data. + // + char ls1[1026]; + + #pragma db type("CHAR(1025)") + char ls2[1025]; + + // + // + wchar_t ws1[17]; + + #pragma db type("NCHAR(16)") + wchar_t ws2[16]; + + wchar_t ws3[1]; + wchar_t wc1; + + // Long data. + // + wchar_t lws1[258]; + + #pragma db type("NCHAR(257)") + wchar_t lws2[257]; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1 && + + std::strcmp (ls1, y.ls1) == 0 && + std::strncmp (ls2, y.ls2, sizeof (ls2)) == 0 && + + std::wcscmp (ws1, y.ws1) == 0 && + std::wcsncmp (ws2, y.ws2, sizeof (ws2) / sizeof (wchar_t)) == 0 && + ws3[0] == y.ws3[0] && + wc1 == y.wc1 && + + std::wcscmp (lws1, y.lws1) == 0 && + std::wcsncmp (lws2, y.lws2, sizeof (lws2) / sizeof (wchar_t)) == 0; + } +}; + // Test optimistic concurrency using ROWVERSION. // #pragma db object optimistic diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index d2f159c..0a7155e 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -101,6 +101,34 @@ main (int argc, char* argv[]) assert (o == *o1); } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } } catch (const odb::exception& e) { diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index bf1ac9f..bc4c773 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -9,6 +9,7 @@ #include #include #include // std::auto_ptr +#include // std::strncpy, std::str[n]cmp #include @@ -87,14 +88,8 @@ enum color {red, green, blue}; #pragma db object struct object { - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } + object () {} + object (unsigned long id): id_ (id) {} #pragma db id unsigned long id_; @@ -274,4 +269,40 @@ struct object } }; +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::strncpy (s1, s, sizeof (s1)); + std::strncpy (s2, s, sizeof (s2)); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + #endif // TEST_HXX diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index be6251c..6370e44 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -272,6 +272,39 @@ main (int argc, char* argv[]) t.commit (); } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // Oracle returns padded values for CHAR(N) unless they are + // empty (represented as NULL). + // + memcpy (o2.s2, "1234567890 ", 16); + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } } catch (const odb::exception& e) { diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 0543598..51665c9 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -8,6 +8,7 @@ #include #include #include // std::auto_ptr +#include // std::strncpy, std::str[n]cmp #include @@ -101,14 +102,8 @@ typedef std::vector strings; #pragma db object struct object { - object (unsigned int id) - : id_ (id) - { - } - - object () - { - } + object () {} + object (unsigned long id): id_ (id) {} #pragma db id unsigned int id_; @@ -166,13 +161,13 @@ struct object #pragma db type ("CHAR(13)") std::string char_; - #pragma db type ("VARCHAR2(512)") + #pragma db type ("VARCHAR2(512)") null std::string varchar2_; #pragma db type ("NCHAR(8)") std::string nchar_; - #pragma db type ("NVARCHAR2(512)") + #pragma db type ("NVARCHAR2(512)") null std::string nvarchar2_; // Oracle treats empty and NULL VARCHAR2 the same. Test that we @@ -302,4 +297,43 @@ struct blob } }; +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::strncpy (s1, s, sizeof (s1)); + std::strncpy (s2, s, sizeof (s2)); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") null + char s2[16]; + + #pragma db null + char s3[1]; + + #pragma db null + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + #endif // TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 8b969aa..d2e5e80 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -85,6 +85,41 @@ main (int argc, char* argv[]) assert (o == *o1); } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // PostgreSQL returns padded values for CHAR(N). + // + memcpy (o1.s2, " ", 16); + o1.s3[0] = o1.c1 = ' '; + memcpy (o2.s2, "1234567890 ", 16); + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } } catch (const odb::exception& e) { diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 34f913f..3078576 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -9,7 +9,7 @@ #include #include #include // std::auto_ptr -#include // std::memcmp +#include // std::memcmp, std::strncpy, std::str[n]cmp #include // std::size_t #include @@ -79,14 +79,8 @@ enum color {red, green, blue}; #pragma db object struct object { - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } + object () {} + object (unsigned long id): id_ (id) {} #pragma db id unsigned long id_; @@ -188,4 +182,40 @@ struct object } }; +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::strncpy (s1, s, sizeof (s1)); + std::strncpy (s2, s, sizeof (s2)); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + #endif // TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 69e8473..4e619fb 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -69,6 +69,40 @@ main (int argc, char* argv[]) t.commit (); } #endif + + // Test char/wchar_t arrays + // + { +#ifndef _WIN32 + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "12345678901234567"); +#else + char_array o1 (1, "", L""); + char_array o2 (2, "1234567890", L"123456789\x00C8"); + char_array o3 (3, "12345678901234567", L"1234567890123456\x00C8"); +#endif + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } } catch (const odb::exception& e) { diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index fdaa541..a19cd20 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -9,6 +9,11 @@ #include #include #include // std::auto_ptr +#include // std::strncpy, std::str[n]cmp + +#ifdef _WIN32 +# include // std::wcsncpy, std::wcs[n]cmp +#endif #include @@ -17,14 +22,8 @@ typedef std::auto_ptr string_ptr; #pragma db object struct object { - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } + object () {} + object (unsigned long id): id_ (id) {} #pragma db id unsigned long id_; @@ -38,8 +37,7 @@ struct object #pragma db type("REAL") double real_; - #pragma db type("REAL") - double nan_; + double nan_; // Represented in SQLite as NULL. #pragma db type("TEXT") std::string text_; @@ -73,4 +71,56 @@ struct object } }; +// Test char/wchar_t arrays. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id + , const char* s +#ifdef _WIN32 + , const wchar_t* ws +#endif + ) + : id_ (id) + { + std::strncpy (s1, s, sizeof (s1)); + s2[0] = c1 = *s; + +#ifdef _WIN32 + std::wcsncpy (ws1, ws, sizeof (ws1) / 2); + ws2[0] = wc1 = *ws; +#endif + } + + #pragma db id + unsigned long id_; + + char s1[17]; + char s2[1]; + char c1; + +#ifdef _WIN32 + wchar_t ws1[17]; + wchar_t ws2[1]; + wchar_t wc1; +#endif + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ + && std::strncmp (s1, y.s1, sizeof (s1)) == 0 + && s2[0] == y.s2[0] + && c1 == y.c1 +#ifdef _WIN32 + && std::wcsncmp (ws1, y.ws1, sizeof (ws1) / 2) == 0 + && ws2[0] == y.ws2[0] + && wc1 == y.wc1 +#endif + ; + } +}; + #endif // TEST_HXX -- cgit v1.1 From 3eee63801cbe833f6557d6f85c5778b6209140be Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Jan 2013 12:44:16 +0200 Subject: By default map std::array to string instead of binary --- common/query/array/driver.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 2bda0a9..c71c25a 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -24,19 +24,14 @@ using namespace odb::core; #if defined(DATABASE_MYSQL) const odb::mysql::database_type_id bt = odb::mysql::id_blob; -const odb::mysql::database_type_id st = odb::mysql::id_string; #elif defined(DATABASE_SQLITE) const odb::sqlite::database_type_id bt = odb::sqlite::id_blob; -const odb::sqlite::database_type_id st = odb::sqlite::id_text; #elif defined(DATABASE_PGSQL) const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; -const odb::pgsql::database_type_id st = odb::pgsql::id_string; #elif defined(DATABASE_ORACLE) const odb::oracle::database_type_id bt = odb::oracle::id_raw; -const odb::oracle::database_type_id st = odb::oracle::id_string; #elif defined(DATABASE_MSSQL) const odb::mssql::database_type_id bt = odb::mssql::id_binary; -const odb::mssql::database_type_id st = odb::mssql::id_string; #else # error unknown database #endif @@ -134,8 +129,8 @@ main (int argc, char* argv[]) assert (size (db->query (query::a == a)) == 1); assert (size (db->query (query::a == query::_val (a))) == 1); assert (size (db->query (query::a == query::_ref (a))) == 1); - assert (size (db->query ("a = " + query::_val (a))) == 1); - assert (size (db->query ("a = " + query::_ref (a))) == 1); + assert (size (db->query ("a = " + query::_val (a))) == 1); + assert (size (db->query ("a = " + query::_ref (a))) == 1); #endif // char -- cgit v1.1 From 43fa55c1b8e389838c83be933bb30a2caaf7468d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Feb 2013 15:50:08 +0200 Subject: Add support for change-tracking containers ODB now supports "smart" ordered containers. Such containers get extra functions for updating and deleting individual elements. Based on this functionality implement two change-tracking containers: odb::vector (equivalent to std::vector) and QOdbList (equivalent to QList). New tests: common/container/change-tracking and qt/common/container/change- tracking. --- common/container/basics/driver.cxx | 516 ++++++++++++++++++ common/container/basics/makefile | 115 ++++ common/container/basics/test.hxx | 268 +++++++++ common/container/basics/test.std | 0 common/container/change-tracking/driver.cxx | 694 ++++++++++++++++++++++++ common/container/change-tracking/makefile | 115 ++++ common/container/change-tracking/test.hxx | 81 +++ common/container/change-tracking/test.std | 0 common/container/driver.cxx | 516 ------------------ common/container/makefile | 115 ---- common/container/test.hxx | 268 --------- common/container/test.std | 0 common/makefile | 85 +-- qt/common/containers/basics/driver.cxx | 570 +++++++++++++++++++ qt/common/containers/basics/makefile | 126 +++++ qt/common/containers/basics/test.hxx | 225 ++++++++ qt/common/containers/basics/test.std | 0 qt/common/containers/change-tracking/driver.cxx | 632 +++++++++++++++++++++ qt/common/containers/change-tracking/makefile | 126 +++++ qt/common/containers/change-tracking/test.hxx | 43 ++ qt/common/containers/change-tracking/test.std | 0 qt/common/containers/driver.cxx | 570 ------------------- qt/common/containers/makefile | 126 ----- qt/common/containers/test.hxx | 225 -------- qt/common/containers/test.std | 0 qt/common/makefile | 9 +- 26 files changed, 3559 insertions(+), 1866 deletions(-) create mode 100644 common/container/basics/driver.cxx create mode 100644 common/container/basics/makefile create mode 100644 common/container/basics/test.hxx create mode 100644 common/container/basics/test.std create mode 100644 common/container/change-tracking/driver.cxx create mode 100644 common/container/change-tracking/makefile create mode 100644 common/container/change-tracking/test.hxx create mode 100644 common/container/change-tracking/test.std delete mode 100644 common/container/driver.cxx delete mode 100644 common/container/makefile delete mode 100644 common/container/test.hxx delete mode 100644 common/container/test.std create mode 100644 qt/common/containers/basics/driver.cxx create mode 100644 qt/common/containers/basics/makefile create mode 100644 qt/common/containers/basics/test.hxx create mode 100644 qt/common/containers/basics/test.std create mode 100644 qt/common/containers/change-tracking/driver.cxx create mode 100644 qt/common/containers/change-tracking/makefile create mode 100644 qt/common/containers/change-tracking/test.hxx create mode 100644 qt/common/containers/change-tracking/test.std delete mode 100644 qt/common/containers/driver.cxx delete mode 100644 qt/common/containers/makefile delete mode 100644 qt/common/containers/test.hxx delete mode 100644 qt/common/containers/test.std diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx new file mode 100644 index 0000000..b50ab5a --- /dev/null +++ b/common/container/basics/driver.cxx @@ -0,0 +1,516 @@ +// file : common/container/basics/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic container persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + +#ifdef HAVE_CXX11 + // array + // + empty.na[0] = 123; + empty.na[1] = 234; + empty.na[2] = 345; + + empty.sa[0] = "aaa"; + empty.sa[1] = "bbbb"; + empty.sa[2] = "ccccc"; + + empty.ca[0] = comp (123, "aaa"); + empty.ca[1] = comp (234, "bbbb"); + empty.ca[2] = comp (345, "ccccc"); +#endif + + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + med.uv.push_back (123); + med.uv.push_back (234); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + med.cs.insert (comp (123, "aaa")); + med.cs.insert (comp (234, "bbbb")); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + +#ifdef HAVE_CXX11 + // array + // + med.na[0] = 123; + med.na[1] = 234; + med.na[2] = 345; + + med.sa[0] = "aaa"; + med.sa[1] = "bbbb"; + med.sa[2] = "ccccc"; + + med.ca[0] = comp (123, "aaa"); + med.ca[1] = comp (234, "bbbb"); + med.ca[2] = comp (345, "ccccc"); + + // forward_list + // + med.nfl.push_front (234); + med.nfl.push_front (123); + + med.sfl.push_front ("bbbb"); + med.sfl.push_front ("aaa"); + + med.cfl.push_front (comp (234, "bbbb")); + med.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + med.nus.insert (123); + med.nus.insert (234); + + med.sus.insert ("aaa"); + med.sus.insert ("bbbb"); + + med.cus.insert (comp (123, "aaa")); + med.cus.insert (comp (234, "bbbb")); + + // unordered_map + // + med.nsum[123] = "aaa"; + med.nsum[234] = "bbbb"; + + med.snum["aaa"] = 123; + med.snum["bbbb"] = 234; + + med.ncum[123] = comp (123, "aaa"); + med.ncum[234] = comp (234, "bbbb"); + + med.csum[comp (123, "aaa")] = "aaa"; + med.csum[comp (234, "bbbb")] = "bbbb"; +#endif + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + full.cs.insert (comp (1234, "aaaa")); + full.cs.insert (comp (2345, "bbbbb")); + full.cs.insert (comp (3456, "cccccc")); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbbb"] = 2345; + full.snm["cccccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbbb")] = "bbbbb"; + full.csm[comp (3456, "cccccc")] = "cccccc"; + +#ifdef HAVE_CXX11 + // array + // + full.na[0] = 123; + full.na[1] = 234; + full.na[2] = 345; + + full.sa[0] = "aaa"; + full.sa[1] = "bbbb"; + full.sa[2] = "ccccc"; + + full.ca[0] = comp (123, "aaa"); + full.ca[1] = comp (234, "bbbb"); + full.ca[2] = comp (345, "ccccc"); + + // forward_list + // + full.nfl.push_front (345); + full.nfl.push_front (234); + full.nfl.push_front (123); + + full.sfl.push_front ("ccccc"); + full.sfl.push_front ("bbbb"); + full.sfl.push_front ("aaa"); + + full.cfl.push_front (comp (345, "ccccc")); + full.cfl.push_front (comp (234, "bbbb")); + full.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + full.nus.insert (1234); + full.nus.insert (2345); + full.nus.insert (3456); + + full.sus.insert ("aaaa"); + full.sus.insert ("bbbbb"); + full.sus.insert ("cccccc"); + + full.cus.insert (comp (1234, "aaaa")); + full.cus.insert (comp (2345, "bbbbb")); + full.cus.insert (comp (3456, "cccccc")); + + // unordered_map + // + full.nsum[1234] = "aaaa"; + full.nsum[2345] = "bbbbb"; + full.nsum[3456] = "cccccc"; + + full.snum["aaaa"] = 1234; + full.snum["bbbbb"] = 2345; + full.snum["cccccc"] = 3456; + + full.ncum[1234] = comp (1234, "aaaa"); + full.ncum[2345] = comp (2345, "bbbbb"); + full.ncum[3456] = comp (3456, "cccccc"); + + full.csum[comp (1234, "aaaa")] = "aaaa"; + full.csum[comp (2345, "bbbbb")] = "bbbbb"; + full.csum[comp (3456, "cccccc")] = "cccccc"; +#endif + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); + empty.sl.push_back ("aa"); + + empty.ns.insert (12); + empty.ss.insert ("aa"); + empty.cs.insert (comp (12, "aa")); + + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + +#ifdef HAVE_CXX11 + empty.nfl.push_front (12); + empty.sfl.push_front ("aa"); + empty.cfl.push_front (comp (12, "aa")); + + empty.nus.insert (12); + empty.sus.insert ("aa"); + empty.cus.insert (comp (12, "aa")); + + empty.nsum[12] = "aa"; + empty.snum["aa"] = 12; + empty.ncum[12] = comp (12, "aa"); + empty.csum[comp (12, "aa")] = "aa"; +#endif + + // + // med + // + + med.num = 0; + med.str = ""; + + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + med.uv.clear (); + + med.sl.clear (); + + med.ns.clear (); + med.ss.clear (); + med.cs.clear (); + + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + +#ifdef HAVE_CXX11 + med.nfl.clear (); + med.sfl.clear (); + med.cfl.clear (); + + med.nus.clear (); + med.sus.clear (); + med.cus.clear (); + + med.nsum.clear (); + med.snum.clear (); + med.ncum.clear (); + med.csum.clear (); +#endif + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + full.uv.back ()++; + full.uv.push_back (4567); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + full.cs.insert (comp (4567, "ddddddd")); + + // map + // + full.nsm[3456] += 'c'; + full.nsm[4567] = "ddddddd"; + + full.snm["cccccc"]++; + full.snm["ddddddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += 'c'; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccccc")] += "c"; + full.csm[comp (4567, "ddddddd")] = "ddddddd"; + +#ifdef HAVE_CXX11 + // array + // + full.na[0]++; + full.sa[0] += 'a'; + full.ca[0].num++; + full.ca[0].str += 'a'; + + // forward_list + // + full.nfl.front ()++; + full.nfl.push_front (4567); + + full.sfl.front () += 'a'; + full.sfl.push_front ("ddddddd"); + + full.cfl.front ().num++; + full.cfl.front ().str += 'a'; + full.cfl.push_front (comp (4567, "ddddddd")); + + // unordered_set + // + full.nus.insert (4567); + full.sus.insert ("ddddddd1"); // 1 is to preserve order in VC++ 10. + full.cus.insert (comp (4567, "ddddddd1")); + + // unordered_map + // + full.nsum[3456] += 'c'; + full.nsum[4567] = "ddddddd"; + + full.snum["cccccc"]++; + full.snum["ddddddd1"] = 4567; + + full.ncum[3456].num++; + full.ncum[3456].str += 'c'; + full.ncum[4567] = comp (4567, "ddddddd"); + + full.csum[comp (3456, "cccccc")] += "c"; + full.csum[comp (4567, "ddddddd1")] = "ddddddd"; +#endif + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/container/basics/makefile b/common/container/basics/makefile new file mode 100644 index 0000000..58feb3b --- /dev/null +++ b/common/container/basics/makefile @@ -0,0 +1,115 @@ +# file : common/container/basics/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--table-prefix t_cont_bs_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx new file mode 100644 index 0000000..e88edd9 --- /dev/null +++ b/common/container/basics/test.hxx @@ -0,0 +1,268 @@ +// file : common/container/basics/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include +#include +#include +#include +#include + +#ifdef HAVE_CXX11 +# include +# include +# include +# include +#endif + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator!= (const comp& x, const comp& y) +{ + return !(x == y); +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef std::list str_list; + +typedef std::vector num_vector; +typedef std::vector str_vector; + +typedef std::set num_set; +typedef std::set str_set; +typedef std::set comp_set; + +typedef std::map num_str_map; +typedef std::map str_num_map; +typedef std::map num_comp_map; +typedef std::map comp_str_map; + +#ifdef HAVE_CXX11 +struct comp_hash +{ + std::size_t + operator() (comp const& x) const {return nh (x.num) + sh (x.str);} + + std::hash nh; + std::hash sh; +}; + +typedef std::array num_array; +typedef std::array str_array; +typedef std::array comp_array; + +typedef std::forward_list num_flist; +typedef std::forward_list str_flist; +typedef std::forward_list comp_flist; + +typedef std::unordered_set num_uset; +typedef std::unordered_set str_uset; +typedef std::unordered_set comp_uset; + +typedef std::unordered_map num_str_umap; +typedef std::unordered_map str_num_umap; +typedef std::unordered_map num_comp_umap; +typedef std::unordered_map comp_str_umap; +#endif + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflic" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + std::string str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const std::string& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + std::string id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + std::vector cv; + + #pragma db unordered + num_vector uv; + + // list + // + #pragma db transient + str_list& sl; + + // set + // + num_set ns; + str_set ss; + comp_set cs; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + +#ifdef HAVE_CXX11 + // array + // + num_array na; + str_array sa; + comp_array ca; + + // forward_list + // + num_flist nfl; + str_flist sfl; + comp_flist cfl; + + // unordered_set + // + num_uset nus; + str_uset sus; + comp_uset cus; + + // unordered_map + // + num_str_umap nsum; + str_num_umap snum; + num_comp_umap ncum; + comp_str_umap csum; +#else + // Dummy containers to get the equivalent DROP TABLE statements. + // + num_vector na; + num_vector sa; + num_vector ca; + + num_vector nfl; + num_vector sfl; + num_vector cfl; + + num_set nus; + str_set sus; + comp_set cus; + + num_str_map nsum; + str_num_map snum; + num_comp_map ncum; + comp_str_map csum; +#endif + + std::string str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + xs == ys && + + x.sl == y.sl && + + x.ns == y.ns && + x.ss == y.ss && + x.cs == y.cs && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + +#ifdef HAVE_CXX11 + x.na == y.na && + x.sa == y.sa && + x.ca == y.ca && + + x.nfl == y.nfl && + x.sfl == y.sfl && + x.cfl == y.cfl && + + x.nus == y.nus && + x.sus == y.sus && + x.cus == y.cus && + + x.nsum == y.nsum && + x.snum == y.snum && + x.ncum == y.ncum && + x.csum == y.csum && +#endif + + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/common/container/basics/test.std b/common/container/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx new file mode 100644 index 0000000..98d711c --- /dev/null +++ b/common/container/change-tracking/driver.cxx @@ -0,0 +1,694 @@ +// file : common/container/change-tracking/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test change-tracking containers. +// + +#include // HAVE_CXX11 + +#include // std::auto_ptr +#include +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct counting_tracer: odb::tracer +{ + void + reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} + + virtual void + execute (odb::connection&, const char* stmt) + { + string p (stmt, 6); + if (p == "UPDATE") + u++; + else if (p == "INSERT") + i++; + else if (p == "DELETE") + d++; + else if (p == "SELECT") + s++; + t++; + } + + size_t u, i, d, s, t; +}; + +static counting_tracer tr; + +// Compilation test: instantiate all the functions. In C++11 mode only +// do this if we have a fairly conforming compiler that implements the +// complete std::vector interface. +// + +#if defined (HAVE_CXX11) +#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 +struct item {}; +template class odb::vector; +template class odb::vector_iterator, + std::vector::iterator>; +template class odb::vector_iterator, + std::vector::reverse_iterator>; +#endif +#endif + +void +f (const std::vector&) {} + +int +main (int argc, char* argv[]) +{ + try + { + // Test extended interface. + // + { + typedef odb::vector vector; + + vector ov; + std::vector sv; + f (ov); // Implicit conversion to std::vector. + vector ov1 (sv); // Initialization from std::vector. + ov = sv; // Assignement from std::vector. + + // Container comparison. + // + if (ov != ov1 || + ov != sv || + sv != ov1) + ov.clear (); + + // Iterator comparison/conversion. + // + vector::const_iterator i (ov.begin ()); + if (i != ov.end ()) + i = ov.end (); + + vector::const_reverse_iterator j (ov.rbegin ()); + if (j != ov.rend ()) + j = ov.rend (); + } + + auto_ptr db (create_database (argc, argv)); + + // Test traits logic. + // + { + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + assert (!o.s._tracking ()); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // load + // + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + assert (p->s._tracking ()); + t.commit (); + } + + // update + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // erase + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + assert (!o.s._tracking ()); + } + + // Test change tracking. + // + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // push_back/pop_back + // + { + o.s.push_back ("b"); // insert + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.push_back ("c"); // update + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + for (int i (0); i != 1024; ++i) + o.s.push_back ("x"); // realloc + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.i == 1023 && tr.t == 1025); + assert (*db->load ("1") == o); + t.commit (); + } + + { + for (int i (0); i != 1024; ++i) + o.s.pop_back (); // delete + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("b"); + o.s.pop_back (); // no-op + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + assert (*db->load ("1") == o); + t.commit (); + } + + // insert + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin (), "a1"); // insert front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin () + 1, "a2"); // insert middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.end (), "b1"); // insert back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // erase + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin ()); // erase front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.d == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin () + 1); // erase middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.d == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.end () - 1); // erase back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // modify + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify (1) += 'b'; + o.s.modify_at (2) += 'c'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify_front () += 'a'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.begin ().modify () += 'a'; + o.s.rbegin ().modify () += 'c'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + (o.s.rbegin () + 1).modify (1) += 'a'; + (o.s.rbegin () + 1).modify (-1) += 'c'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.mbegin (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 5 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // clear + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.clear (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // assign + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.assign (4, "x"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.i == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // resize + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.resize (4, "x"); // expand + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.i == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("y"); + o.s.resize (3); // shrink + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // Transaction rollback. + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed copy. + // + { + auto_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + c.reset (new object (o)); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed swap. + // + { + object c (o); + + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking () && !c.s._tracking ()); + c.s.swap (o.s); + assert (!o.s._tracking () && c.s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed move. + // +#ifdef HAVE_CXX11 + { + auto_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking ()); + c.reset (new object (std::move (o))); + assert (!o.s._tracking () && c->s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } +#endif + + // Test mixing "smart" and "dumb" container (specifically, erase(obj)). + // + { + mix_object o (1); + o.ov.assign (3, 123); + o.sv.assign (3, 123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test using change tracking container as inverse member. + // + { + inv_object1 o1; + inv_object2 o2; + o1.o2 = &o2; + + { + transaction t (db->begin ()); + db->persist (o2); + db->persist (o1); + t.commit (); + } + + assert (!o2.o1._tracking ()); + + { + session s; + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id_)); + auto_ptr p2 (db->load (o2.id_)); + assert (p2->o1[0] == p1.get ()); + assert (!p2->o1._tracking ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile new file mode 100644 index 0000000..ffd149c --- /dev/null +++ b/common/container/change-tracking/makefile @@ -0,0 +1,115 @@ +# file : common/container/change-tracking/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--table-prefix t_cont_changet_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx new file mode 100644 index 0000000..0387faf --- /dev/null +++ b/common/container/change-tracking/test.hxx @@ -0,0 +1,81 @@ +// file : common/container/change-tracking/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include +#include +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include +#include + +#pragma db object pointer(std::auto_ptr) +struct object +{ + object () {} + object (const std::string& id): id_ (id) {} + +#ifdef HAVE_CXX11 + object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} + object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} +#endif + + #pragma db id + std::string id_; + + unsigned int i; + + odb::vector s; + + inline bool + operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;} +}; + +// Test mixing "smart" and "dumb" container (specifically, erase(obj)). +// +#pragma db object +struct mix_object +{ + mix_object () {} + mix_object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector ov; + std::vector sv; +}; + +// Test using change tracking container as inverse member. +// +struct inv_object2; + +#pragma db object session +struct inv_object1 +{ + #pragma db id auto + unsigned long id_; + + inv_object2* o2; +}; + +#pragma db object session +struct inv_object2 +{ + #pragma db id auto + unsigned long id_; + + #pragma db inverse(o2) + odb::vector o1; +}; + +#endif // TEST_HXX diff --git a/common/container/change-tracking/test.std b/common/container/change-tracking/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/container/driver.cxx b/common/container/driver.cxx deleted file mode 100644 index c4e1179..0000000 --- a/common/container/driver.cxx +++ /dev/null @@ -1,516 +0,0 @@ -// file : common/container/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test container persistence. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - empty.num = 0; - empty.str = ""; - -#ifdef HAVE_CXX11 - // array - // - empty.na[0] = 123; - empty.na[1] = 234; - empty.na[2] = 345; - - empty.sa[0] = "aaa"; - empty.sa[1] = "bbbb"; - empty.sa[2] = "ccccc"; - - empty.ca[0] = comp (123, "aaa"); - empty.ca[1] = comp (234, "bbbb"); - empty.ca[2] = comp (345, "ccccc"); -#endif - - - // - // med - // - - med.num = 999; - med.str = "xxx"; - - // vector - // - med.nv.push_back (123); - med.nv.push_back (234); - - med.sv.push_back ("aaa"); - med.sv.push_back ("bbbb"); - - med.cv.push_back (comp (123, "aaa")); - med.cv.push_back (comp (234, "bbbb")); - - med.uv.push_back (123); - med.uv.push_back (234); - - // list - // - med.sl.push_back ("aaa"); - med.sl.push_back ("bbbb"); - - // set - // - med.ns.insert (123); - med.ns.insert (234); - - med.ss.insert ("aaa"); - med.ss.insert ("bbbb"); - - med.cs.insert (comp (123, "aaa")); - med.cs.insert (comp (234, "bbbb")); - - // map - // - med.nsm[123] = "aaa"; - med.nsm[234] = "bbbb"; - - med.snm["aaa"] = 123; - med.snm["bbbb"] = 234; - - med.ncm[123] = comp (123, "aaa"); - med.ncm[234] = comp (234, "bbbb"); - - med.csm[comp (123, "aaa")] = "aaa"; - med.csm[comp (234, "bbbb")] = "bbbb"; - -#ifdef HAVE_CXX11 - // array - // - med.na[0] = 123; - med.na[1] = 234; - med.na[2] = 345; - - med.sa[0] = "aaa"; - med.sa[1] = "bbbb"; - med.sa[2] = "ccccc"; - - med.ca[0] = comp (123, "aaa"); - med.ca[1] = comp (234, "bbbb"); - med.ca[2] = comp (345, "ccccc"); - - // forward_list - // - med.nfl.push_front (234); - med.nfl.push_front (123); - - med.sfl.push_front ("bbbb"); - med.sfl.push_front ("aaa"); - - med.cfl.push_front (comp (234, "bbbb")); - med.cfl.push_front (comp (123, "aaa")); - - // unordered_set - // - med.nus.insert (123); - med.nus.insert (234); - - med.sus.insert ("aaa"); - med.sus.insert ("bbbb"); - - med.cus.insert (comp (123, "aaa")); - med.cus.insert (comp (234, "bbbb")); - - // unordered_map - // - med.nsum[123] = "aaa"; - med.nsum[234] = "bbbb"; - - med.snum["aaa"] = 123; - med.snum["bbbb"] = 234; - - med.ncum[123] = comp (123, "aaa"); - med.ncum[234] = comp (234, "bbbb"); - - med.csum[comp (123, "aaa")] = "aaa"; - med.csum[comp (234, "bbbb")] = "bbbb"; -#endif - - // - // full - // - - full.num = 9999; - full.str = "xxxx"; - - // vector - // - full.nv.push_back (1234); - full.nv.push_back (2345); - full.nv.push_back (3456); - - full.sv.push_back ("aaaa"); - full.sv.push_back ("bbbbb"); - full.sv.push_back ("cccccc"); - - full.cv.push_back (comp (1234, "aaaa")); - full.cv.push_back (comp (2345, "bbbbb")); - full.cv.push_back (comp (3456, "cccccc")); - - full.uv.push_back (1234); - full.uv.push_back (2345); - full.uv.push_back (3456); - - // list - // - full.sl.push_back ("aaaa"); - full.sl.push_back ("bbbbb"); - full.sl.push_back ("cccccc"); - - // set - // - full.ns.insert (1234); - full.ns.insert (2345); - full.ns.insert (3456); - - full.ss.insert ("aaaa"); - full.ss.insert ("bbbbb"); - full.ss.insert ("cccccc"); - - full.cs.insert (comp (1234, "aaaa")); - full.cs.insert (comp (2345, "bbbbb")); - full.cs.insert (comp (3456, "cccccc")); - - // map - // - full.nsm[1234] = "aaaa"; - full.nsm[2345] = "bbbbb"; - full.nsm[3456] = "cccccc"; - - full.snm["aaaa"] = 1234; - full.snm["bbbbb"] = 2345; - full.snm["cccccc"] = 3456; - - full.ncm[1234] = comp (1234, "aaaa"); - full.ncm[2345] = comp (2345, "bbbbb"); - full.ncm[3456] = comp (3456, "cccccc"); - - full.csm[comp (1234, "aaaa")] = "aaaa"; - full.csm[comp (2345, "bbbbb")] = "bbbbb"; - full.csm[comp (3456, "cccccc")] = "cccccc"; - -#ifdef HAVE_CXX11 - // array - // - full.na[0] = 123; - full.na[1] = 234; - full.na[2] = 345; - - full.sa[0] = "aaa"; - full.sa[1] = "bbbb"; - full.sa[2] = "ccccc"; - - full.ca[0] = comp (123, "aaa"); - full.ca[1] = comp (234, "bbbb"); - full.ca[2] = comp (345, "ccccc"); - - // forward_list - // - full.nfl.push_front (345); - full.nfl.push_front (234); - full.nfl.push_front (123); - - full.sfl.push_front ("ccccc"); - full.sfl.push_front ("bbbb"); - full.sfl.push_front ("aaa"); - - full.cfl.push_front (comp (345, "ccccc")); - full.cfl.push_front (comp (234, "bbbb")); - full.cfl.push_front (comp (123, "aaa")); - - // unordered_set - // - full.nus.insert (1234); - full.nus.insert (2345); - full.nus.insert (3456); - - full.sus.insert ("aaaa"); - full.sus.insert ("bbbbb"); - full.sus.insert ("cccccc"); - - full.cus.insert (comp (1234, "aaaa")); - full.cus.insert (comp (2345, "bbbbb")); - full.cus.insert (comp (3456, "cccccc")); - - // unordered_map - // - full.nsum[1234] = "aaaa"; - full.nsum[2345] = "bbbbb"; - full.nsum[3456] = "cccccc"; - - full.snum["aaaa"] = 1234; - full.snum["bbbbb"] = 2345; - full.snum["cccccc"] = 3456; - - full.ncum[1234] = comp (1234, "aaaa"); - full.ncum[2345] = comp (2345, "bbbbb"); - full.ncum[3456] = comp (3456, "cccccc"); - - full.csum[comp (1234, "aaaa")] = "aaaa"; - full.csum[comp (2345, "bbbbb")] = "bbbbb"; - full.csum[comp (3456, "cccccc")] = "cccccc"; -#endif - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // - // empty - // - - empty.num = 99; - empty.str = "xx"; - - empty.nv.push_back (12); - empty.sv.push_back ("aa"); - empty.cv.push_back (comp (12, "aa")); - empty.uv.push_back (12); - empty.sl.push_back ("aa"); - - empty.ns.insert (12); - empty.ss.insert ("aa"); - empty.cs.insert (comp (12, "aa")); - - empty.nsm[12] = "aa"; - empty.snm["aa"] = 12; - empty.ncm[12] = comp (12, "aa"); - empty.csm[comp (12, "aa")] = "aa"; - -#ifdef HAVE_CXX11 - empty.nfl.push_front (12); - empty.sfl.push_front ("aa"); - empty.cfl.push_front (comp (12, "aa")); - - empty.nus.insert (12); - empty.sus.insert ("aa"); - empty.cus.insert (comp (12, "aa")); - - empty.nsum[12] = "aa"; - empty.snum["aa"] = 12; - empty.ncum[12] = comp (12, "aa"); - empty.csum[comp (12, "aa")] = "aa"; -#endif - - // - // med - // - - med.num = 0; - med.str = ""; - - med.nv.clear (); - med.sv.clear (); - med.cv.clear (); - med.uv.clear (); - - med.sl.clear (); - - med.ns.clear (); - med.ss.clear (); - med.cs.clear (); - - med.nsm.clear (); - med.snm.clear (); - med.ncm.clear (); - med.csm.clear (); - -#ifdef HAVE_CXX11 - med.nfl.clear (); - med.sfl.clear (); - med.cfl.clear (); - - med.nus.clear (); - med.sus.clear (); - med.cus.clear (); - - med.nsum.clear (); - med.snum.clear (); - med.ncum.clear (); - med.csum.clear (); -#endif - - // - // full - // - - full.num++; - full.str += "x"; - - // vector - // - full.nv.back ()++; - full.nv.push_back (4567); - - full.sv.back () += "c"; - full.sv.push_back ("ddddddd"); - - full.cv.back ().num++; - full.cv.back ().str += "c"; - full.cv.push_back (comp (4567, "ddddddd")); - - full.uv.back ()++; - full.uv.push_back (4567); - - // list - // - full.sl.back () += "c"; - full.sl.push_back ("ddddddd"); - - // set - // - full.ns.insert (4567); - full.ss.insert ("ddddddd"); - full.cs.insert (comp (4567, "ddddddd")); - - // map - // - full.nsm[3456] += 'c'; - full.nsm[4567] = "ddddddd"; - - full.snm["cccccc"]++; - full.snm["ddddddd"] = 4567; - - full.ncm[3456].num++; - full.ncm[3456].str += 'c'; - full.ncm[4567] = comp (4567, "ddddddd"); - - full.csm[comp (3456, "cccccc")] += "c"; - full.csm[comp (4567, "ddddddd")] = "ddddddd"; - -#ifdef HAVE_CXX11 - // array - // - full.na[0]++; - full.sa[0] += 'a'; - full.ca[0].num++; - full.ca[0].str += 'a'; - - // forward_list - // - full.nfl.front ()++; - full.nfl.push_front (4567); - - full.sfl.front () += 'a'; - full.sfl.push_front ("ddddddd"); - - full.cfl.front ().num++; - full.cfl.front ().str += 'a'; - full.cfl.push_front (comp (4567, "ddddddd")); - - // unordered_set - // - full.nus.insert (4567); - full.sus.insert ("ddddddd1"); // 1 is to preserve order in VC++ 10. - full.cus.insert (comp (4567, "ddddddd1")); - - // unordered_map - // - full.nsum[3456] += 'c'; - full.nsum[4567] = "ddddddd"; - - full.snum["cccccc"]++; - full.snum["ddddddd1"] = 4567; - - full.ncum[3456].num++; - full.ncum[3456].str += 'c'; - full.ncum[4567] = comp (4567, "ddddddd"); - - full.csum[comp (3456, "cccccc")] += "c"; - full.csum[comp (4567, "ddddddd1")] = "ddddddd"; -#endif - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/container/makefile b/common/container/makefile deleted file mode 100644 index 7173c57..0000000 --- a/common/container/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/container/makefile -# copyright : Copyright (c) 2009-2012 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) --generate-schema \ ---table-prefix t_container_ -$(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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/container/test.hxx b/common/container/test.hxx deleted file mode 100644 index c531efb..0000000 --- a/common/container/test.hxx +++ /dev/null @@ -1,268 +0,0 @@ -// file : common/container/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11 - -#include -#include -#include -#include -#include - -#ifdef HAVE_CXX11 -# include -# include -# include -# include -#endif - -#include - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const std::string& s) : num (n), str (s) {} - - #pragma db column("number") - int num; - std::string str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -inline bool -operator!= (const comp& x, const comp& y) -{ - return !(x == y); -} - -inline bool -operator< (const comp& x, const comp& y) -{ - return x.num != y.num ? x.num < y.num : x.str < y.str; -} - -typedef std::list str_list; - -typedef std::vector num_vector; -typedef std::vector str_vector; - -typedef std::set num_set; -typedef std::set str_set; -typedef std::set comp_set; - -typedef std::map num_str_map; -typedef std::map str_num_map; -typedef std::map num_comp_map; -typedef std::map comp_str_map; - -#ifdef HAVE_CXX11 -struct comp_hash -{ - std::size_t - operator() (comp const& x) const {return nh (x.num) + sh (x.str);} - - std::hash nh; - std::hash sh; -}; - -typedef std::array num_array; -typedef std::array str_array; -typedef std::array comp_array; - -typedef std::forward_list num_flist; -typedef std::forward_list str_flist; -typedef std::forward_list comp_flist; - -typedef std::unordered_set num_uset; -typedef std::unordered_set str_uset; -typedef std::unordered_set comp_uset; - -typedef std::unordered_map num_str_umap; -typedef std::unordered_map str_num_umap; -typedef std::unordered_map num_comp_umap; -typedef std::unordered_map comp_str_umap; -#endif - -#pragma db value -struct cont_comp1 -{ - // This composite value does not have any columns. - // - num_vector sv; // Have the name "conflic" with the one in the object. -}; - -#pragma db value -struct cont_comp2 -{ - cont_comp2 (): num (777), str ("ggg") {} - - int num; - str_list sl; - std::string str; -}; - -#pragma db object -struct object -{ - object (): nv (comp1_.sv), sl (comp2_.sl) {} - object (const std::string& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} - - #pragma db id - std::string id_; - - int num; - - cont_comp1 comp1_; - cont_comp2 comp2_; - - // vector - // - #pragma db transient - num_vector& nv; - - #pragma db table("object_strings") id_column ("obj_id") - str_vector sv; - - #pragma db value_column("") - std::vector cv; - - #pragma db unordered - num_vector uv; - - // list - // - #pragma db transient - str_list& sl; - - // set - // - num_set ns; - str_set ss; - comp_set cs; - - // map - // - num_str_map nsm; - str_num_map snm; - num_comp_map ncm; - comp_str_map csm; - -#ifdef HAVE_CXX11 - // array - // - num_array na; - str_array sa; - comp_array ca; - - // forward_list - // - num_flist nfl; - str_flist sfl; - comp_flist cfl; - - // unordered_set - // - num_uset nus; - str_uset sus; - comp_uset cus; - - // unordered_map - // - num_str_umap nsum; - str_num_umap snum; - num_comp_umap ncum; - comp_str_umap csum; -#else - // Dummy containers to get the equivalent DROP TABLE statements. - // - num_vector na; - num_vector sa; - num_vector ca; - - num_vector nfl; - num_vector sfl; - num_vector cfl; - - num_set nus; - str_set sus; - comp_set cus; - - num_str_map nsum; - str_num_map snum; - num_comp_map ncum; - comp_str_map csum; -#endif - - std::string str; -}; - -inline bool -operator== (const object& x, const object& y) -{ - if (x.uv.size () != y.uv.size ()) - return false; - - int xs (0), ys (0); - - for (num_vector::size_type i (0); i < x.uv.size (); ++i) - { - xs += x.uv[i]; - ys += y.uv[i]; - } - - return - x.id_ == y.id_ && - x.num == y.num && - - x.comp2_.num == y.comp2_.num && - x.comp2_.str == y.comp2_.str && - - x.nv == y.nv && - x.sv == y.sv && - x.cv == y.cv && - xs == ys && - - x.sl == y.sl && - - x.ns == y.ns && - x.ss == y.ss && - x.cs == y.cs && - - x.nsm == y.nsm && - x.snm == y.snm && - x.ncm == y.ncm && - x.csm == y.csm && - -#ifdef HAVE_CXX11 - x.na == y.na && - x.sa == y.sa && - x.ca == y.ca && - - x.nfl == y.nfl && - x.sfl == y.sfl && - x.cfl == y.cfl && - - x.nus == y.nus && - x.sus == y.sus && - x.cus == y.cus && - - x.nsum == y.nsum && - x.snum == y.snum && - x.ncum == y.ncum && - x.csum == y.csum && -#endif - - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/common/container/test.std b/common/container/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/makefile b/common/makefile index eae7f7e..883fe3f 100644 --- a/common/makefile +++ b/common/makefile @@ -4,48 +4,49 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -access \ -auto \ -blob \ -callback \ -circular/single \ -circular/multiple \ -composite \ -composite-id \ -const-object \ -const-member \ -container \ -ctor \ -default \ -definition \ -enum \ -erase-query \ -include \ -index \ -inheritance/polymorphism \ -inheritance/reuse \ -inheritance/transient \ -inverse \ -lazy-ptr \ -lifecycle \ -no-id \ -optimistic \ -pragma \ -prepared \ -query/basics \ -query/array \ -readonly \ -relationship \ -relationship-query \ -schema \ -session/cache \ -template \ -transaction/basics \ -transaction/callback \ -types \ -view \ -virtual \ +tests := \ +access \ +auto \ +blob \ +callback \ +circular/single \ +circular/multiple \ +composite \ +composite-id \ +const-object \ +const-member \ +container/basics \ +container/change-tracking \ +ctor \ +default \ +definition \ +enum \ +erase-query \ +include \ +index \ +inheritance/polymorphism \ +inheritance/reuse \ +inheritance/transient \ +inverse \ +lazy-ptr \ +lifecycle \ +no-id \ +optimistic \ +pragma \ +prepared \ +query/basics \ +query/array \ +readonly \ +relationship \ +relationship-query \ +schema \ +session/cache \ +template \ +transaction/basics \ +transaction/callback \ +types \ +view \ +virtual \ wrapper thread_tests := threads diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx new file mode 100644 index 0000000..1d22962 --- /dev/null +++ b/qt/common/containers/basics/driver.cxx @@ -0,0 +1,570 @@ +// file : qt/common/containers/basics/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic Qt containers persistence. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + med.uv.push_back (123); + med.uv.push_back (234); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + med.nl.push_back (123); + med.nl.push_back (234); + + med.cl.push_back (comp (123, "aaa")); + med.cl.push_back (comp (234, "bbbb")); + + // linked list + // + med.sll.push_back ("aaa"); + med.sll.push_back ("bbbb"); + + med.nll.push_back (123); + med.nll.push_back (234); + + med.cll.push_back (comp (123, "aaa")); + med.cll.push_back (comp (234, "bbbb")); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + + // multimap + // + med.nsmm.insert (123, "aaa"); + med.nsmm.insert (123, "bbbb"); + med.nsmm.insert (234, "ccccc"); + + med.snmm.insert ("aaa", 123); + med.snmm.insert ("aaa", 234); + med.snmm.insert ("bbb", 345); + + med.ncmm.insert (123, comp (123, "aaa")); + med.ncmm.insert (123, comp (234, "bbbb")); + med.ncmm.insert (234, comp (345, "ccccc")); + + // hash + // + med.nsh[123] = "aaa"; + med.nsh[234] = "bbbb"; + + med.snh["aaa"] = 123; + med.snh["bbb"] = 234; + + med.sch["iii"] = comp (123, "aaa"); + med.sch["jjj"] = comp (234, "bbbb"); + + // multihash + // + med.nsmh.insert (123, "aaa"); + med.nsmh.insert (123, "bbbb"); + med.nsmh.insert (234, "ccccc"); + + med.snmh.insert ("aaa", 123); + med.snmh.insert ("aaa", 234); + med.snmh.insert ("bbb", 345); + + med.ncmh.insert (123, comp (123, "aaa")); + med.ncmh.insert (123, comp (234, "bbbb")); + med.ncmh.insert (234, comp (345, "ccccc")); + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + full.nl.push_back (1234); + full.nl.push_back (2345); + full.nl.push_back (3456); + + full.cl.push_back (comp (1234, "aaaa")); + full.cl.push_back (comp (2345, "bbbbb")); + full.cl.push_back (comp (3456, "cccccc")); + + // linked list + // + full.sll.push_back ("aaaa"); + full.sll.push_back ("bbbbb"); + full.sll.push_back ("cccccc"); + + full.nll.push_back (1234); + full.nll.push_back (2345); + full.nll.push_back (3456); + + full.cll.push_back (comp (1234, "aaaa")); + full.cll.push_back (comp (2345, "bbbbb")); + full.cll.push_back (comp (3456, "cccccc")); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbb"] = 2345; + full.snm["cccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbb")] = "bbbbb"; + full.csm[comp (3456, "cccc")] = "cccccc"; + + // multimap + // + full.nsmm.insert (1234, "aaaa"); + full.nsmm.insert (1234, "bbbbb"); + full.nsmm.insert (2345, "cccccc"); + full.nsmm.insert (2345, "ddddddd"); + + full.snmm.insert ("aaaa", 1234); + full.snmm.insert ("aaaa", 2345); + full.snmm.insert ("bbbb", 3456); + full.snmm.insert ("bbbb", 4567); + + full.ncmm.insert (1234, comp (1234, "aaaa")); + full.ncmm.insert (1234, comp (2345, "bbbbb")); + full.ncmm.insert (2345, comp (3456, "cccccc")); + full.ncmm.insert (2345, comp (4567, "ddddddd")); + + // hash + // + full.nsh[1234] = "aaaa"; + full.nsh[2345] = "bbbbb"; + full.nsh[3456] = "cccccc"; + + full.snh["aaaa"] = 1234; + full.snh["bbbb"] = 2345; + full.snh["cccc"] = 3456; + + full.sch["iiii"] = comp (1234, "aaaa"); + full.sch["jjjj"] = comp (2345, "bbbbb"); + full.sch["kkkk"] = comp (3456, "cccccc"); + + // multihash + // + full.nsmh.insert (1234, "aaaa"); + full.nsmh.insert (1234, "bbbbb"); + full.nsmh.insert (2345, "cccccc"); + full.nsmh.insert (2345, "ddddddd"); + + full.snmh.insert ("aaaa", 1234); + full.snmh.insert ("aaaa", 2345); + full.snmh.insert ("bbbb", 3456); + full.snmh.insert ("bbbb", 4567); + + full.ncmh.insert (1234, comp (1234, "aaaa")); + full.ncmh.insert (1234, comp (2345, "bbbbb")); + full.ncmh.insert (2345, comp (3456, "cccccc")); + full.ncmh.insert (2345, comp (4567, "ddddddd")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + + // vector + // + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); + + // list + // + empty.sl.push_back ("aa"); + empty.nl.push_back (12); + empty.cl.push_back (comp (12, "aa")); + + // linked list + // + empty.nll.push_back (12); + empty.sll.push_back ("aa"); + empty.cll.push_back (comp (12, "aa")); + + // set + // + empty.ns.insert (12); + empty.ss.insert ("aa"); + + // map + // + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + + // multimap + // + empty.nsmm.insert (12, "aa"); + empty.nsmm.insert (12, "bbb"); + empty.nsmm.insert (23, "cccc"); + empty.snmm.insert ("aa", 12); + empty.snmm.insert ("aa", 23); + empty.snmm.insert ("bb", 34); + empty.ncmm.insert (12, comp (12, "aa")); + empty.ncmm.insert (12, comp (23, "bb")); + empty.ncmm.insert (23, comp (34, "cc")); + + // hash + // + empty.nsh[12] = "aa"; + empty.snh["aa"] = 12; + empty.sch["ii"] = comp (12, "aa"); + + // multihash + // + empty.nsmh.insert (12, "aa"); + empty.nsmh.insert (12, "bbb"); + empty.nsmh.insert (23, "cccc"); + empty.snmh.insert ("aa", 12); + empty.snmh.insert ("aa", 23); + empty.snmh.insert ("bb", 34); + empty.ncmh.insert (12, comp (12, "aa")); + empty.ncmh.insert (12, comp (23, "bb")); + empty.ncmh.insert (23, comp (34, "cc")); + + // + // med + // + + med.num = 0; + med.str = ""; + + // vector + // + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + med.uv.clear (); + + // list + // + med.sl.clear (); + med.nl.clear (); + med.cl.clear (); + + // linked list + // + med.nll.clear (); + med.sll.clear (); + med.cll.clear (); + + // set + // + med.ns.clear (); + med.ss.clear (); + + // map + // + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + + // multimap + // + med.nsmm.clear (); + med.snmm.clear (); + med.ncmm.clear (); + + // hash + // + med.nsh.clear (); + med.snh.clear (); + med.sch.clear (); + + // multihash + // + med.nsmh.clear (); + med.snmh.clear (); + med.ncmh.clear (); + + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + full.uv.back ()++; + full.uv.push_back (4567); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + full.nl.back ()++; + full.nl.push_back (4567); + + full.cl.back ().num++; + full.cl.back ().str += "c"; + full.cl.push_back (comp (4567, "ddddddd")); + + // linked list + // + full.sll.back () += "c"; + full.sll.push_back ("ddddddd"); + + full.nll.back ()++; + full.nll.push_back (4567); + + full.cll.back ().num++; + full.cll.back ().str += "c"; + full.cll.push_back (comp (4567, "ddddddd")); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + + // map + // + full.nsm[3456] += "c"; + full.nsm[4567] = "ddddddd"; + + full.snm["cccc"]++; + full.snm["dddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += "c"; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccc")] += "c"; + full.csm[comp (4567, "dddd")] = "ddddddd"; + + // multimap + // + full.nsmm.find (2345).value () += "d"; + full.nsmm.insert (3456, "eeeeeeee"); + + full.snmm.find ("bbbb").value ()++; + full.snmm.insert ("cccc", 5678); + + full.ncmm.find (1234).value ().num++; + full.ncmm.find (2345).value ().str += "d"; + full.ncmm.insert (3456, comp (5678, "eeeeeeee")); + + // hash + // + full.nsh[3456] += "c"; + full.nsh[4567] = "ddddddd"; + + full.snh["cccc"]++; + full.snh["dddd"] = 4567; + + full.sch["iiii"].num++; + full.sch["jjjj"].str += "b"; + full.sch["kkkk"] = comp (4567, "dddddddd"); + + // multihash + // + full.nsmh.find (2345).value () += "d"; + full.nsmh.insert (3456, "eeeeeeee"); + + full.snmh.find ("bbbb").value ()++; + full.snmh.insert ("cccc", 5678); + + full.ncmh.find (1234).value ().num++; + full.ncmh.find (2345).value ().str += "d"; + full.ncmh.insert (3456, comp (5678, "eeeeeeee")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile new file mode 100644 index 0000000..2a88495 --- /dev/null +++ b/qt/common/containers/basics/makefile @@ -0,0 +1,126 @@ +# file : qt/common/containers/basics/makefile +# copyright : Copyright (c) 2009-2012 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/containers --profile qt/basic --generate-schema \ +--table-prefix qt_cont_bs_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx new file mode 100644 index 0000000..204d0f9 --- /dev/null +++ b/qt/common/containers/basics/test.hxx @@ -0,0 +1,225 @@ +// file : qt/common/containers/basics/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const QString& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + QString str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef QVector num_vector; +typedef QVector str_vector; +typedef QVector comp_vector; + +typedef QList num_list; +typedef QList str_list; +typedef QList comp_list; + +typedef QLinkedList num_linked_list; +typedef QLinkedList str_linked_list; +typedef QLinkedList comp_linked_list; + +typedef QSet num_set; +typedef QSet str_set; + +typedef QMap num_str_map; +typedef QMap str_num_map; +typedef QMap num_comp_map; +typedef QMap comp_str_map; + +typedef QMultiMap num_str_multimap; +typedef QMultiMap str_num_multimap; +typedef QMultiMap num_comp_multimap; + +typedef QHash num_str_hash; +typedef QHash str_num_hash; +typedef QHash str_comp_hash; + +typedef QMultiHash num_str_multihash; +typedef QMultiHash str_num_multihash; +typedef QMultiHash num_comp_multihash; + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflict" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + QString str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const QString& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + QString id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + comp_vector cv; + + #pragma db unordered + num_vector uv; + + // list + // + #pragma db transient + str_list& sl; + + num_list nl; + comp_list cl; + + // linked list + // + str_linked_list sll; + num_linked_list nll; + comp_linked_list cll; + + // set + // + num_set ns; + str_set ss; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + + // multimap + // + num_str_multimap nsmm; + str_num_multimap snmm; + num_comp_multimap ncmm; + + // hash + // + num_str_hash nsh; + str_num_hash snh; + str_comp_hash sch; + + // multihash + // + num_str_multihash nsmh; + str_num_multihash snmh; + num_comp_multihash ncmh; + + QString str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + xs == ys && + + x.sl == y.sl && + x.nl == y.nl && + x.cl == y.cl && + + x.nll == y.nll && + x.sll == y.sll && + x.cll == y.cll && + + x.ns == y.ns && + x.ss == y.ss && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + + x.nsmm.uniqueKeys () == y.nsmm.uniqueKeys () && + x.snmm.uniqueKeys () == y.snmm.uniqueKeys () && + x.ncmm.uniqueKeys () == y.ncmm.uniqueKeys () && + + x.nsh == y.nsh && + x.snh == y.snh && + x.sch == y.sch && + + x.nsmh.uniqueKeys () == y.nsmh.uniqueKeys () && + x.snmh.uniqueKeys () == y.snmh.uniqueKeys () && + x.ncmh.uniqueKeys () == y.ncmh.uniqueKeys () && + + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/qt/common/containers/basics/test.std b/qt/common/containers/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx new file mode 100644 index 0000000..15dd825 --- /dev/null +++ b/qt/common/containers/change-tracking/driver.cxx @@ -0,0 +1,632 @@ +// file : qt/common/containers/change-tracking/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test change-tracking Qt containers. +// + +#include // HAVE_CXX11 + +#include // std::auto_ptr +#include +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include // QT_VERSION, Q_FOREACH +#include + +#include +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct counting_tracer: odb::tracer +{ + void + reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} + + virtual void + execute (odb::connection&, const char* stmt) + { + string p (stmt, 6); + if (p == "UPDATE") + u++; + else if (p == "INSERT") + i++; + else if (p == "DELETE") + d++; + else if (p == "SELECT") + s++; + t++; + } + + size_t u, i, d, s, t; +}; + +static counting_tracer tr; + +// Compilation test: instantiate all the functions. Only do this if we +// have a fairly recent version of Qt, otherwise some underlying +// functions will be missing. +// +#if QT_VERSION >= 0x050000 +template class QOdbList; +template class QOdbListIteratorImpl >; +template class QOdbListIterator; +template class QMutableOdbListIterator; +#endif + +void +f (const QList&) {} + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + // Test extended interface. + // + { + typedef QOdbList list; + + list ol; + QList ql; + f (ol); // Implicit conversion to QList. + list ol1 (ql); // Initialization from QList. + ol = ql; // Assignement from QList. + + // Container comparison. + // + if (ol != ol1 || + ol != ql || + ql != ol1) + ol.clear (); + + // Container operators. + // + ol += ol1; + ol += ql; + ol = ol1 + ql; + ol = ql + ol1; + + // Iterator comparison/conversion. + // +#ifndef QT_STRICT_ITERATORS + list::const_iterator i (ol.begin ()); + if (i != ol.end ()) + i = ol.end (); +#endif + + Q_FOREACH (const int& i, ol) + cerr << i; + } + + auto_ptr db (create_database (argc, argv)); + + // Test traits logic. + // + { + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + assert (!o.s._tracking ()); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // load + // + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + assert (p->s._tracking ()); + t.commit (); + } + + // update + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // erase + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + assert (!o.s._tracking ()); + } + + // Test change tracking. + // + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // push_back/pop_back + // + { + o.s.push_back ("b"); // insert + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.push_back ("c"); // update + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); // delete + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("b"); + o.s.pop_back (); // no-op + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + assert (*db->load ("1") == o); + t.commit (); + } + + // insert + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin (), "a1"); // insert front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin () + 1, "a2"); // insert middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.end (), "b1"); // insert back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // erase + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin ()); // erase front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.d == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin () + 1); // erase middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.d == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.end () - 1); // erase back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // modify + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify (1) += 'b'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify_front () += 'a'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.begin ().modify () += 'a'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.mbegin (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 5 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // clear + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.clear (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // assign + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + QList v; + v.push_back ("1"); + v.push_back ("2"); + v.push_back ("3"); + v.push_back ("4"); + o.s = v; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.i == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // removeOne/removeAll + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("a"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.removeOne ("c"); + assert (o.s.size () == 5 && o.s[3] == "a"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.d == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.removeAll ("a"); + assert (o.s.size () == 2 && o.s[0] == "b" && o.s[1] == "d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.d == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + // Transaction rollback. + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed copy. + // + { + auto_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + c.reset (new object (o)); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed swap. + // + { + object c (o); + + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking () && !c.s._tracking ()); + c.s.swap (o.s); + assert (!o.s._tracking () && c.s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed move. + // +#ifdef HAVE_CXX11 + { + auto_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking ()); + c.reset (new object (std::move (o))); + assert (!o.s._tracking () && c->s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile new file mode 100644 index 0000000..7a25503 --- /dev/null +++ b/qt/common/containers/change-tracking/makefile @@ -0,0 +1,126 @@ +# file : qt/common/containers/change-tracking/makefile +# copyright : Copyright (c) 2009-2012 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) + +$(call import,\ + $(scf_root)/import/libodb-qt/stub.make,\ + l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libqt/core/stub.make,\ + l: qt_core.l,cpp-options: qt.l.cpp-options) + +# Build. +# +$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.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) \ +--profile qt/containers --profile qt/basic --generate-schema \ +--table-prefix qt_cont_ct_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ +$(qt_core.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/qt/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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx new file mode 100644 index 0000000..7ad230e --- /dev/null +++ b/qt/common/containers/change-tracking/test.hxx @@ -0,0 +1,43 @@ +// file : qt/common/containers/change-tracking/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include + +#include +#include + +#pragma db object pointer(std::auto_ptr) +struct object +{ + object () {} + object (const QString& id): id_ (id) {} + +#ifdef HAVE_CXX11 + object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} + object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} +#endif + + #pragma db id + QString id_; + + unsigned int i; + + QOdbList s; + + inline bool + operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;} +}; + +#endif // TEST_HXX diff --git a/qt/common/containers/change-tracking/test.std b/qt/common/containers/change-tracking/test.std new file mode 100644 index 0000000..e69de29 diff --git a/qt/common/containers/driver.cxx b/qt/common/containers/driver.cxx deleted file mode 100644 index 5de758c..0000000 --- a/qt/common/containers/driver.cxx +++ /dev/null @@ -1,570 +0,0 @@ -// file : qt/common/containers/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt containers persistence. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - empty.num = 0; - empty.str = ""; - - // - // med - // - - med.num = 999; - med.str = "xxx"; - - // vector - // - med.nv.push_back (123); - med.nv.push_back (234); - - med.sv.push_back ("aaa"); - med.sv.push_back ("bbbb"); - - med.cv.push_back (comp (123, "aaa")); - med.cv.push_back (comp (234, "bbbb")); - - med.uv.push_back (123); - med.uv.push_back (234); - - // list - // - med.sl.push_back ("aaa"); - med.sl.push_back ("bbbb"); - - med.nl.push_back (123); - med.nl.push_back (234); - - med.cl.push_back (comp (123, "aaa")); - med.cl.push_back (comp (234, "bbbb")); - - // linked list - // - med.sll.push_back ("aaa"); - med.sll.push_back ("bbbb"); - - med.nll.push_back (123); - med.nll.push_back (234); - - med.cll.push_back (comp (123, "aaa")); - med.cll.push_back (comp (234, "bbbb")); - - // set - // - med.ns.insert (123); - med.ns.insert (234); - - med.ss.insert ("aaa"); - med.ss.insert ("bbbb"); - - // map - // - med.nsm[123] = "aaa"; - med.nsm[234] = "bbbb"; - - med.snm["aaa"] = 123; - med.snm["bbbb"] = 234; - - med.ncm[123] = comp (123, "aaa"); - med.ncm[234] = comp (234, "bbbb"); - - med.csm[comp (123, "aaa")] = "aaa"; - med.csm[comp (234, "bbbb")] = "bbbb"; - - // multimap - // - med.nsmm.insert (123, "aaa"); - med.nsmm.insert (123, "bbbb"); - med.nsmm.insert (234, "ccccc"); - - med.snmm.insert ("aaa", 123); - med.snmm.insert ("aaa", 234); - med.snmm.insert ("bbb", 345); - - med.ncmm.insert (123, comp (123, "aaa")); - med.ncmm.insert (123, comp (234, "bbbb")); - med.ncmm.insert (234, comp (345, "ccccc")); - - // hash - // - med.nsh[123] = "aaa"; - med.nsh[234] = "bbbb"; - - med.snh["aaa"] = 123; - med.snh["bbb"] = 234; - - med.sch["iii"] = comp (123, "aaa"); - med.sch["jjj"] = comp (234, "bbbb"); - - // multihash - // - med.nsmh.insert (123, "aaa"); - med.nsmh.insert (123, "bbbb"); - med.nsmh.insert (234, "ccccc"); - - med.snmh.insert ("aaa", 123); - med.snmh.insert ("aaa", 234); - med.snmh.insert ("bbb", 345); - - med.ncmh.insert (123, comp (123, "aaa")); - med.ncmh.insert (123, comp (234, "bbbb")); - med.ncmh.insert (234, comp (345, "ccccc")); - - // - // full - // - - full.num = 9999; - full.str = "xxxx"; - - // vector - // - full.nv.push_back (1234); - full.nv.push_back (2345); - full.nv.push_back (3456); - - full.sv.push_back ("aaaa"); - full.sv.push_back ("bbbbb"); - full.sv.push_back ("cccccc"); - - full.cv.push_back (comp (1234, "aaaa")); - full.cv.push_back (comp (2345, "bbbbb")); - full.cv.push_back (comp (3456, "cccccc")); - - full.uv.push_back (1234); - full.uv.push_back (2345); - full.uv.push_back (3456); - - // list - // - full.sl.push_back ("aaaa"); - full.sl.push_back ("bbbbb"); - full.sl.push_back ("cccccc"); - - full.nl.push_back (1234); - full.nl.push_back (2345); - full.nl.push_back (3456); - - full.cl.push_back (comp (1234, "aaaa")); - full.cl.push_back (comp (2345, "bbbbb")); - full.cl.push_back (comp (3456, "cccccc")); - - // linked list - // - full.sll.push_back ("aaaa"); - full.sll.push_back ("bbbbb"); - full.sll.push_back ("cccccc"); - - full.nll.push_back (1234); - full.nll.push_back (2345); - full.nll.push_back (3456); - - full.cll.push_back (comp (1234, "aaaa")); - full.cll.push_back (comp (2345, "bbbbb")); - full.cll.push_back (comp (3456, "cccccc")); - - // set - // - full.ns.insert (1234); - full.ns.insert (2345); - full.ns.insert (3456); - - full.ss.insert ("aaaa"); - full.ss.insert ("bbbbb"); - full.ss.insert ("cccccc"); - - // map - // - full.nsm[1234] = "aaaa"; - full.nsm[2345] = "bbbbb"; - full.nsm[3456] = "cccccc"; - - full.snm["aaaa"] = 1234; - full.snm["bbbb"] = 2345; - full.snm["cccc"] = 3456; - - full.ncm[1234] = comp (1234, "aaaa"); - full.ncm[2345] = comp (2345, "bbbbb"); - full.ncm[3456] = comp (3456, "cccccc"); - - full.csm[comp (1234, "aaaa")] = "aaaa"; - full.csm[comp (2345, "bbbb")] = "bbbbb"; - full.csm[comp (3456, "cccc")] = "cccccc"; - - // multimap - // - full.nsmm.insert (1234, "aaaa"); - full.nsmm.insert (1234, "bbbbb"); - full.nsmm.insert (2345, "cccccc"); - full.nsmm.insert (2345, "ddddddd"); - - full.snmm.insert ("aaaa", 1234); - full.snmm.insert ("aaaa", 2345); - full.snmm.insert ("bbbb", 3456); - full.snmm.insert ("bbbb", 4567); - - full.ncmm.insert (1234, comp (1234, "aaaa")); - full.ncmm.insert (1234, comp (2345, "bbbbb")); - full.ncmm.insert (2345, comp (3456, "cccccc")); - full.ncmm.insert (2345, comp (4567, "ddddddd")); - - // hash - // - full.nsh[1234] = "aaaa"; - full.nsh[2345] = "bbbbb"; - full.nsh[3456] = "cccccc"; - - full.snh["aaaa"] = 1234; - full.snh["bbbb"] = 2345; - full.snh["cccc"] = 3456; - - full.sch["iiii"] = comp (1234, "aaaa"); - full.sch["jjjj"] = comp (2345, "bbbbb"); - full.sch["kkkk"] = comp (3456, "cccccc"); - - // multihash - // - full.nsmh.insert (1234, "aaaa"); - full.nsmh.insert (1234, "bbbbb"); - full.nsmh.insert (2345, "cccccc"); - full.nsmh.insert (2345, "ddddddd"); - - full.snmh.insert ("aaaa", 1234); - full.snmh.insert ("aaaa", 2345); - full.snmh.insert ("bbbb", 3456); - full.snmh.insert ("bbbb", 4567); - - full.ncmh.insert (1234, comp (1234, "aaaa")); - full.ncmh.insert (1234, comp (2345, "bbbbb")); - full.ncmh.insert (2345, comp (3456, "cccccc")); - full.ncmh.insert (2345, comp (4567, "ddddddd")); - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // - // empty - // - - empty.num = 99; - empty.str = "xx"; - - // vector - // - empty.nv.push_back (12); - empty.sv.push_back ("aa"); - empty.cv.push_back (comp (12, "aa")); - empty.uv.push_back (12); - - // list - // - empty.sl.push_back ("aa"); - empty.nl.push_back (12); - empty.cl.push_back (comp (12, "aa")); - - // linked list - // - empty.nll.push_back (12); - empty.sll.push_back ("aa"); - empty.cll.push_back (comp (12, "aa")); - - // set - // - empty.ns.insert (12); - empty.ss.insert ("aa"); - - // map - // - empty.nsm[12] = "aa"; - empty.snm["aa"] = 12; - empty.ncm[12] = comp (12, "aa"); - empty.csm[comp (12, "aa")] = "aa"; - - // multimap - // - empty.nsmm.insert (12, "aa"); - empty.nsmm.insert (12, "bbb"); - empty.nsmm.insert (23, "cccc"); - empty.snmm.insert ("aa", 12); - empty.snmm.insert ("aa", 23); - empty.snmm.insert ("bb", 34); - empty.ncmm.insert (12, comp (12, "aa")); - empty.ncmm.insert (12, comp (23, "bb")); - empty.ncmm.insert (23, comp (34, "cc")); - - // hash - // - empty.nsh[12] = "aa"; - empty.snh["aa"] = 12; - empty.sch["ii"] = comp (12, "aa"); - - // multihash - // - empty.nsmh.insert (12, "aa"); - empty.nsmh.insert (12, "bbb"); - empty.nsmh.insert (23, "cccc"); - empty.snmh.insert ("aa", 12); - empty.snmh.insert ("aa", 23); - empty.snmh.insert ("bb", 34); - empty.ncmh.insert (12, comp (12, "aa")); - empty.ncmh.insert (12, comp (23, "bb")); - empty.ncmh.insert (23, comp (34, "cc")); - - // - // med - // - - med.num = 0; - med.str = ""; - - // vector - // - med.nv.clear (); - med.sv.clear (); - med.cv.clear (); - med.uv.clear (); - - // list - // - med.sl.clear (); - med.nl.clear (); - med.cl.clear (); - - // linked list - // - med.nll.clear (); - med.sll.clear (); - med.cll.clear (); - - // set - // - med.ns.clear (); - med.ss.clear (); - - // map - // - med.nsm.clear (); - med.snm.clear (); - med.ncm.clear (); - med.csm.clear (); - - // multimap - // - med.nsmm.clear (); - med.snmm.clear (); - med.ncmm.clear (); - - // hash - // - med.nsh.clear (); - med.snh.clear (); - med.sch.clear (); - - // multihash - // - med.nsmh.clear (); - med.snmh.clear (); - med.ncmh.clear (); - - - // - // full - // - - full.num++; - full.str += "x"; - - // vector - // - full.nv.back ()++; - full.nv.push_back (4567); - - full.sv.back () += "c"; - full.sv.push_back ("ddddddd"); - - full.cv.back ().num++; - full.cv.back ().str += "c"; - full.cv.push_back (comp (4567, "ddddddd")); - - full.uv.back ()++; - full.uv.push_back (4567); - - // list - // - full.sl.back () += "c"; - full.sl.push_back ("ddddddd"); - - full.nl.back ()++; - full.nl.push_back (4567); - - full.cl.back ().num++; - full.cl.back ().str += "c"; - full.cl.push_back (comp (4567, "ddddddd")); - - // linked list - // - full.sll.back () += "c"; - full.sll.push_back ("ddddddd"); - - full.nll.back ()++; - full.nll.push_back (4567); - - full.cll.back ().num++; - full.cll.back ().str += "c"; - full.cll.push_back (comp (4567, "ddddddd")); - - // set - // - full.ns.insert (4567); - full.ss.insert ("ddddddd"); - - // map - // - full.nsm[3456] += "c"; - full.nsm[4567] = "ddddddd"; - - full.snm["cccc"]++; - full.snm["dddd"] = 4567; - - full.ncm[3456].num++; - full.ncm[3456].str += "c"; - full.ncm[4567] = comp (4567, "ddddddd"); - - full.csm[comp (3456, "cccc")] += "c"; - full.csm[comp (4567, "dddd")] = "ddddddd"; - - // multimap - // - full.nsmm.find (2345).value () += "d"; - full.nsmm.insert (3456, "eeeeeeee"); - - full.snmm.find ("bbbb").value ()++; - full.snmm.insert ("cccc", 5678); - - full.ncmm.find (1234).value ().num++; - full.ncmm.find (2345).value ().str += "d"; - full.ncmm.insert (3456, comp (5678, "eeeeeeee")); - - // hash - // - full.nsh[3456] += "c"; - full.nsh[4567] = "ddddddd"; - - full.snh["cccc"]++; - full.snh["dddd"] = 4567; - - full.sch["iiii"].num++; - full.sch["jjjj"].str += "b"; - full.sch["kkkk"] = comp (4567, "dddddddd"); - - // multihash - // - full.nsmh.find (2345).value () += "d"; - full.nsmh.insert (3456, "eeeeeeee"); - - full.snmh.find ("bbbb").value ()++; - full.snmh.insert ("cccc", 5678); - - full.ncmh.find (1234).value ().num++; - full.ncmh.find (2345).value ().str += "d"; - full.ncmh.insert (3456, comp (5678, "eeeeeeee")); - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile deleted file mode 100644 index 3cfc22f..0000000 --- a/qt/common/containers/makefile +++ /dev/null @@ -1,126 +0,0 @@ -# file : qt/common/containers/makefile -# copyright : Copyright (c) 2009-2012 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) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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) \ ---profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_cont_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/containers/test.hxx b/qt/common/containers/test.hxx deleted file mode 100644 index 2e452d6..0000000 --- a/qt/common/containers/test.hxx +++ /dev/null @@ -1,225 +0,0 @@ -// file : qt/common/containers/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const QString& s) : num (n), str (s) {} - - #pragma db column("number") - int num; - QString str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -inline bool -operator< (const comp& x, const comp& y) -{ - return x.num != y.num ? x.num < y.num : x.str < y.str; -} - -typedef QVector num_vector; -typedef QVector str_vector; -typedef QVector comp_vector; - -typedef QList num_list; -typedef QList str_list; -typedef QList comp_list; - -typedef QLinkedList num_linked_list; -typedef QLinkedList str_linked_list; -typedef QLinkedList comp_linked_list; - -typedef QSet num_set; -typedef QSet str_set; - -typedef QMap num_str_map; -typedef QMap str_num_map; -typedef QMap num_comp_map; -typedef QMap comp_str_map; - -typedef QMultiMap num_str_multimap; -typedef QMultiMap str_num_multimap; -typedef QMultiMap num_comp_multimap; - -typedef QHash num_str_hash; -typedef QHash str_num_hash; -typedef QHash str_comp_hash; - -typedef QMultiHash num_str_multihash; -typedef QMultiHash str_num_multihash; -typedef QMultiHash num_comp_multihash; - -#pragma db value -struct cont_comp1 -{ - // This composite value does not have any columns. - // - num_vector sv; // Have the name "conflict" with the one in the object. -}; - -#pragma db value -struct cont_comp2 -{ - cont_comp2 (): num (777), str ("ggg") {} - - int num; - str_list sl; - QString str; -}; - -#pragma db object -struct object -{ - object (): nv (comp1_.sv), sl (comp2_.sl) {} - object (const QString& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} - - #pragma db id - QString id_; - - int num; - - cont_comp1 comp1_; - cont_comp2 comp2_; - - // vector - // - #pragma db transient - num_vector& nv; - - #pragma db table("object_strings") id_column ("obj_id") - str_vector sv; - - #pragma db value_column("") - comp_vector cv; - - #pragma db unordered - num_vector uv; - - // list - // - #pragma db transient - str_list& sl; - - num_list nl; - comp_list cl; - - // linked list - // - str_linked_list sll; - num_linked_list nll; - comp_linked_list cll; - - // set - // - num_set ns; - str_set ss; - - // map - // - num_str_map nsm; - str_num_map snm; - num_comp_map ncm; - comp_str_map csm; - - // multimap - // - num_str_multimap nsmm; - str_num_multimap snmm; - num_comp_multimap ncmm; - - // hash - // - num_str_hash nsh; - str_num_hash snh; - str_comp_hash sch; - - // multihash - // - num_str_multihash nsmh; - str_num_multihash snmh; - num_comp_multihash ncmh; - - QString str; -}; - -inline bool -operator== (const object& x, const object& y) -{ - if (x.uv.size () != y.uv.size ()) - return false; - - int xs (0), ys (0); - - for (num_vector::size_type i (0); i < x.uv.size (); ++i) - { - xs += x.uv[i]; - ys += y.uv[i]; - } - - return - x.id_ == y.id_ && - x.num == y.num && - - x.comp2_.num == y.comp2_.num && - x.comp2_.str == y.comp2_.str && - - x.nv == y.nv && - x.sv == y.sv && - x.cv == y.cv && - xs == ys && - - x.sl == y.sl && - x.nl == y.nl && - x.cl == y.cl && - - x.nll == y.nll && - x.sll == y.sll && - x.cll == y.cll && - - x.ns == y.ns && - x.ss == y.ss && - - x.nsm == y.nsm && - x.snm == y.snm && - x.ncm == y.ncm && - x.csm == y.csm && - - x.nsmm.uniqueKeys () == y.nsmm.uniqueKeys () && - x.snmm.uniqueKeys () == y.snmm.uniqueKeys () && - x.ncmm.uniqueKeys () == y.ncmm.uniqueKeys () && - - x.nsh == y.nsh && - x.snh == y.snh && - x.sch == y.sch && - - x.nsmh.uniqueKeys () == y.nsmh.uniqueKeys () && - x.snmh.uniqueKeys () == y.snmh.uniqueKeys () && - x.ncmh.uniqueKeys () == y.ncmh.uniqueKeys () && - - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/qt/common/containers/test.std b/qt/common/containers/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/makefile b/qt/common/makefile index 33b17aa..2cadcee 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -4,10 +4,11 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -tests := \ -basic \ -containers \ -smart-ptr \ +tests := \ +basic \ +containers/basics \ +containers/change-tracking \ +smart-ptr \ template all_tests := $(tests) -- cgit v1.1 From 8d69c2d5012bc29656150ddd94cefeb740346aef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Feb 2013 07:43:11 +0200 Subject: Fix incorrect AC_LANG_SOURCE quoting Thanks to Hugo Mildenberger for the patch. --- m4/c++11.m4 | 6 +++--- m4/libboost.m4 | 30 +++++++++++++++--------------- m4/libodb-boost.m4 | 6 +++--- m4/libodb-mssql.m4 | 6 +++--- m4/libodb-mysql.m4 | 6 +++--- m4/libodb-oracle.m4 | 6 +++--- m4/libodb-pgsql.m4 | 6 +++--- m4/libodb-qt.m4 | 6 +++--- m4/libodb-sqlite.m4 | 6 +++--- m4/libodb.m4 | 6 +++--- m4/libqt.m4 | 30 +++++++++++++++--------------- m4/threads.m4 | 6 +++--- m4/tr1-memory.m4 | 6 +++--- 13 files changed, 63 insertions(+), 63 deletions(-) diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 774f20d..5df020f 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -13,8 +13,8 @@ cxx11=no AC_MSG_CHECKING([whether we are in C++11 mode]) -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include int @@ -23,7 +23,7 @@ main () std::shared_ptr p (new int (10)); *p = 11; } -]]), +])], [cxx11=yes]) if test x"$cxx11" = xyes; then diff --git a/m4/libboost.m4 b/m4/libboost.m4 index b1f53b4..c8132eb 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -28,8 +28,8 @@ if test x"$libboost_dir" != x; then LDFLAGS="$LDFLAGS -L$abs_libboost_dir/stage/lib" fi -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #ifndef BOOST_VERSION @@ -40,7 +40,7 @@ int main () { } -]]), +])], [ libboost_found=yes ]) @@ -113,8 +113,8 @@ dnl dnl LIBBOOST_SMART_PTR([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([LIBBOOST_SMART_PTR], [ -LIBBOOST_HEADER_LIB([smart_ptr], -AC_LANG_SOURCE([[ +LIBBOOST_HEADER_LIB([smart_ptr],[ +AC_LANG_SOURCE([ #include #include @@ -124,7 +124,7 @@ main () boost::shared_ptr sp (new int (10)); boost::weak_ptr wp (sp); } -]]), +])], [$1], [$2]) ])dnl @@ -132,8 +132,8 @@ dnl dnl LIBBOOST_UNORDERED([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([LIBBOOST_UNORDERED], [ -LIBBOOST_HEADER_LIB([unordered], -AC_LANG_SOURCE([[ +LIBBOOST_HEADER_LIB([unordered],[ +AC_LANG_SOURCE([ #include #include @@ -146,7 +146,7 @@ main () s.insert (1); return m.find (1) != m.end (); } -]]), +])], [$1], [$2]) ])dnl @@ -154,13 +154,13 @@ dnl dnl LIBBOOST_SYSTEM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([LIBBOOST_SYSTEM], [ -LIBBOOST_LIB([system], -AC_LANG_SOURCE([[ +LIBBOOST_LIB([system],[ +AC_LANG_SOURCE([ int main () { } -]]), +])], [$1], [$2]) ])dnl @@ -168,8 +168,8 @@ dnl dnl LIBBOOST_DATE_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([LIBBOOST_DATE_TIME], [ -LIBBOOST_LIB([date_time], -AC_LANG_SOURCE([[ +LIBBOOST_LIB([date_time],[ +AC_LANG_SOURCE([ #include int @@ -179,7 +179,7 @@ main () const char* s (m.as_short_string ()); return s == 0; } -]]), +])], [$1], [$2]) ])dnl diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 874597a..8ce86d1 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-boost $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_boost_found=yes]) if test x"$libodb_boost_found" = xno; then diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index cc1c627..578a2f2 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-mssql $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_mssql_found=yes]) if test x"$libodb_mssql_found" = xno; then diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index b369a09..cbac417 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-mysql $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_mysql_found=yes]) if test x"$libodb_mysql_found" = xno; then diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 2b85a83..6302368 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-oracle $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_oracle_found=yes]) if test x"$libodb_oracle_found" = xno; then diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index 30dcd4d..e50c65f 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-pgsql $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_pgsql_found=yes]) if test x"$libodb_pgsql_found" = xno; then diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index 6abf9cc..f0a1a0e 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-qt $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_qt_found=yes]) if test x"$libodb_qt_found" = xno; then diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index 2e1ab19..fd5f3d0 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -32,8 +32,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb-sqlite $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -61,7 +61,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_sqlite_found=yes]) if test x"$libodb_sqlite_found" = xno; then diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 6e282a6..7d3130b 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -31,8 +31,8 @@ fi save_LIBS="$LIBS" LIBS="-lodb $LIBS" -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include void @@ -60,7 +60,7 @@ main () const char* m (g ()); return m != 0; } -]]), +])], [libodb_found=yes]) if test x"$libodb_found" = xno; then diff --git a/m4/libqt.m4 b/m4/libqt.m4 index ef754a9..44cbd5c 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -16,8 +16,8 @@ AC_MSG_CHECKING([for QtCore]) # test allows the user to override the QtCore library name (e.g., # QtCored4) via the LIBS variable. # -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #include @@ -28,7 +28,7 @@ main () std::string ss (qs.toStdString ()); return ss.size () != 0; } -]]), +])], [ libqt_found=yes ]) @@ -40,8 +40,8 @@ if test x"$libqt_found" = xno; then save_LIBS="$LIBS" LIBS="-lQtCore $LIBS" - CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ + CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #include @@ -52,7 +52,7 @@ main () std::string ss (qs.toStdString ()); return ss.size () != 0; } -]]), +])], [ libqt_found=yes ]) @@ -69,8 +69,8 @@ if test x"$libqt_found" = xno; then save_LIBS="$LIBS" LIBS="-framework QtCore $LIBS" - CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ + CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #include @@ -81,7 +81,7 @@ main () std::string ss (qs.toStdString ()); return ss.size () != 0; } -]]), +])], [ libqt_found=yes ]) @@ -98,8 +98,8 @@ if test x"$libqt_found" = xno; then save_LIBS="$LIBS" LIBS="-lQtCore4 $LIBS" - CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ + CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #include @@ -110,7 +110,7 @@ main () std::string ss (qs.toStdString ()); return ss.size () != 0; } -]]), +])], [ libqt_found=yes ]) @@ -136,8 +136,8 @@ if test x"$libqt_found" = xno; then CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" LIBS="$LIBS $save_LIBS" - CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ + CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include #include @@ -148,7 +148,7 @@ main () std::string ss (qs.toStdString ()); return ss.size () != 0; } -]]), +])], [ libqt_found=yes ]) diff --git a/m4/threads.m4 b/m4/threads.m4 index fce3f39..4cd4c05 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -36,8 +36,8 @@ if test x$threads = xcheck; then # AC_MSG_CHECKING([for __thread keyword]) - CXX_LIBTOOL_LINK_IFELSE( - AC_LANG_SOURCE([[ + CXX_LIBTOOL_LINK_IFELSE([ + AC_LANG_SOURCE([ __thread int tls_var; int @@ -45,7 +45,7 @@ if test x$threads = xcheck; then { tls_var = 0; } - ]]), + ])], [threads_thread_keyword=yes]) AC_MSG_RESULT([$threads_thread_keyword]) diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index d207f1e..5df00a1 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -14,8 +14,8 @@ tr1_memory=no AC_MSG_CHECKING([for TR1 ]) -CXX_LIBTOOL_LINK_IFELSE( -AC_LANG_SOURCE([[ +CXX_LIBTOOL_LINK_IFELSE([ +AC_LANG_SOURCE([ #include int @@ -24,7 +24,7 @@ main () std::tr1::shared_ptr p (new int (10)); *p = 11; } -]]), +])], [tr1_memory=yes]) if test x"$tr1_memory" = xyes; then -- cgit v1.1 From d266b1bc868f2295b8030ab24de48523ad31c4ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Feb 2013 08:02:08 +0200 Subject: Add call to AM_PROG_AR which is required by newer automake Thanks to Hugo Mildenberger for the patch. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index d42da63..baa5573 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([common/template/driver.cxx]) AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. LT_INIT([win32-dll]) -- cgit v1.1 From 91909053d95f2373dbd2ddb4281bbaa0103dbe44 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Feb 2013 15:27:28 +0200 Subject: Fix incorrect dist variable --- common/session/custom/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 95bd58d..f989a76 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -53,7 +53,7 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export headers := session.hxx session.txx +$(dist): export extra_headers := session.hxx session.txx $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -- cgit v1.1 From 7aa23d94dd5dd487aa9752aec5944d2d225cafa0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Feb 2013 08:02:52 +0200 Subject: Use fromUtf8() instead of fromStdString() for NCHAR initialization --- qt/oracle/basic/driver.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 9b852d8..f50c45e 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -35,7 +35,9 @@ main (int argc, char* argv[]) string short_str (13, 's'); string medium_str (150, 'm'); string long_str (20000, 'v'); - string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"); + // Oracle UTF-8 support is limited to 3-byte sequences. + // + string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xE2\x82\xAC bcdef"); object o; @@ -43,8 +45,10 @@ main (int argc, char* argv[]) o.varchar2 = QString::fromStdString (medium_str); o.clob = QString::fromStdString (long_str); - o.nchar= QString::fromStdString (unicode_str); - o.nvarchar2 = QString::fromStdString (unicode_str); + // fromStdString() assumes ASCII in Qt4 and UTF-8 in Qt5. + // + o.nchar= QString::fromUtf8 (unicode_str.c_str (), unicode_str.size ()); + o.nvarchar2 = QString::fromUtf8 (unicode_str.c_str (), unicode_str.size ()); o.nclob = QString::fromStdString (long_str); o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); @@ -63,10 +67,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.varchar2); + std::auto_ptr p (db->load (o.varchar2)); t.commit (); - - assert (*ol == o); + assert (*p == o); } } catch (const odb::exception& e) -- cgit v1.1 From 056c73faed12bdd9e7800e3e464c107ca6e6ea84 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Feb 2013 08:07:00 +0200 Subject: Use auto_ptr instead of raw pointer --- qt/mssql/basic/driver.cxx | 4 ++-- qt/mysql/basic/driver.cxx | 4 ++-- qt/oracle/basic/driver.cxx | 2 +- qt/pgsql/basic/driver.cxx | 4 ++-- qt/sqlite/basic/driver.cxx | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 9fac8de..df12334 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -52,10 +52,10 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.id_); + auto_ptr p (db->load (o.id_)); t.commit (); - assert (*ol == o); + assert (*p == o); } } catch (const odb::exception& e) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index f0cc876..68d998a 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -47,10 +47,10 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.str); + auto_ptr p (db->load (o.str)); t.commit (); - assert (*ol == o); + assert (*p == o); } } catch (const odb::exception& e) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index f50c45e..8c8f192 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -67,7 +67,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - std::auto_ptr p (db->load (o.varchar2)); + auto_ptr p (db->load (o.varchar2)); t.commit (); assert (*p == o); } diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index ead2470..9e0fa4d 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -47,10 +47,10 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.str); + auto_ptr p (db->load (o.str)); t.commit (); - assert (*ol == o); + assert (*p == o); } } catch (const odb::exception& e) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index c0fb883..2cff023 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -47,10 +47,10 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - object* ol = db->load (o.str); + auto_ptr p (db->load (o.str)); t.commit (); - assert (*ol == o); + assert (*p == o); } } catch (const odb::exception& e) -- cgit v1.1 From b81096a979f96175efc6cd5a8e05cab801dfcf81 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Feb 2013 10:19:07 +0200 Subject: Autotools support for Qt5 --- m4/libqt.m4 | 178 ++++++++++++++++++++++-------------------------------------- 1 file changed, 65 insertions(+), 113 deletions(-) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 44cbd5c..0e96da8 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -2,22 +2,21 @@ dnl file : m4/libqt.m4 dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl -dnl LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) dnl +dnl LIBQTCORE_COMPILE() dnl -AC_DEFUN([LIBQTCORE], [ -libqt_found=no - -AC_PATH_PROG([pkg_config],[pkg-config]) - -AC_MSG_CHECKING([for QtCore]) - -# First check for QtCore using default CPPFLAGS/LDFLAGS/LIBS. This -# test allows the user to override the QtCore library name (e.g., -# QtCored4) via the LIBS variable. -# +AC_DEFUN([LIBQTCORE_COMPILE], [ CXX_LIBTOOL_LINK_IFELSE([ AC_LANG_SOURCE([ +// See libodb-qt/odb/qt/details/config.hxx for more information on +// what's going on here. +// +# if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__) +# include // QT_REDUCE_RELOCATIONS +# ifdef QT_REDUCE_RELOCATIONS +# define __PIE__ +# endif +# endif #include #include @@ -29,91 +28,55 @@ main () return ss.size () != 0; } ])], -[ -libqt_found=yes -]) +[libqt_found=yes]) +])dnl +dnl +dnl LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) +dnl +dnl +AC_DEFUN([LIBQTCORE], [ +libqt_found=no -# Then check for QtCore using default CPPFLAGS/LDFLAGS. +# QtCore libraries and pkg-config names in the order we should try +# them. # -if test x"$libqt_found" = xno; then - - save_LIBS="$LIBS" - LIBS="-lQtCore $LIBS" +libqt_lib_names="Qt5Core QtCore5 QtCore Qt4Core QtCore4" +libqt_pkg_names="Qt5Core QtCore" - CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include -#include +AC_PATH_PROG([pkg_config],[pkg-config]) -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[ -libqt_found=yes -]) +AC_MSG_CHECKING([for QtCore]) - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - fi -fi +# First check for QtCore using default CPPFLAGS/LDFLAGS/LIBS. This +# test allows the user to override the QtCore library name (e.g., +# QtCored4, Qt5Core) via the LIBS variable. +# +LIBQTCORE_COMPILE -# Try framework in case we are on Mac OS X. +# Then check for QtCore using default CPPFLAGS/LDFLAGS. # if test x"$libqt_found" = xno; then + for lib in $libqt_lib_names; do + save_LIBS="$LIBS" + LIBS="-l$lib $LIBS" - save_LIBS="$LIBS" - LIBS="-framework QtCore $LIBS" + LIBQTCORE_COMPILE - CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include -#include - -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[ -libqt_found=yes -]) - - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - fi + if test x"$libqt_found" = xno; then + LIBS="$save_LIBS" + else + break + fi + done fi -# If QtCore is not found, try its versioned variant, QtCore4. +# Try framework in case we are on Mac OS X. # if test x"$libqt_found" = xno; then - save_LIBS="$LIBS" - LIBS="-lQtCore4 $LIBS" + LIBS="-framework QtCore $LIBS" - CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include -#include - -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[ -libqt_found=yes -]) + LIBQTCORE_COMPILE if test x"$libqt_found" = xno; then LIBS="$save_LIBS" @@ -124,39 +87,28 @@ fi # them using pkg-config. # if test x"$libqt_found" = xno; then - if test x"$pkg_config" != x; then - if $pkg_config --exists QtCore; then - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - - CPPFLAGS=`$pkg_config --cflags QtCore` - LIBS=`$pkg_config --libs QtCore` - - CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" - LIBS="$LIBS $save_LIBS" - - CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include -#include - -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[ -libqt_found=yes -]) - if test x"$libqt_found" = xno; then - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - fi - fi + for pkg in $libqt_pkg_names; do + if $pkg_config --exists $pkg; then + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + CPPFLAGS=`$pkg_config --cflags $pkg` + LIBS=`$pkg_config --libs $pkg` + + CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" + LIBS="$LIBS $save_LIBS" + + LIBQTCORE_COMPILE + + if test x"$libqt_found" = xno; then + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + break + fi + fi + done fi fi -- cgit v1.1 From 14cc151f37a089784f8db162bb6f419ec8d1aecb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Feb 2013 12:32:10 +0200 Subject: Add Qt5 VC project/solution files --- build/bootstrap.make | 7 +- qt/build.bat | 31 +- qt/common/basic/makefile | 15 +- qt/common/containers/basics/makefile | 15 +- qt/common/containers/change-tracking/makefile | 15 +- qt/common/makefile | 18 +- qt/common/qt-common-qt4-vc10.sln | 15 + qt/common/qt-common-qt4-vc11.sln | 15 + qt/common/qt-common-qt4-vc9.sln | 15 + qt/common/qt-common-qt5-vc10.sln | 15 + qt/common/qt-common-qt5-vc11.sln | 15 + qt/common/qt-common-qt5-vc9.sln | 15 + qt/common/qt-common-vc10.sln | 15 - qt/common/qt-common-vc11.sln | 15 - qt/common/qt-common-vc9.sln | 15 - qt/common/smart-ptr/makefile | 15 +- qt/common/template/makefile | 15 +- qt/common/template/template-qt4-vc10.vcxproj | 177 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 24 ++ qt/common/template/template-qt4-vc11.vcxproj | 181 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 24 ++ qt/common/template/template-qt4-vc9.vcproj | 360 ++++++++++++++++++++ qt/common/template/template-qt5-vc10.vcxproj | 177 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 24 ++ qt/common/template/template-qt5-vc11.vcxproj | 181 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 24 ++ qt/common/template/template-qt5-vc9.vcproj | 360 ++++++++++++++++++++ qt/common/template/template-vc10.vcxproj | 177 ---------- qt/common/template/template-vc10.vcxproj.filters | 24 -- qt/common/template/template-vc11.vcxproj | 181 ----------- qt/common/template/template-vc11.vcxproj.filters | 24 -- qt/common/template/template-vc9.vcproj | 360 -------------------- qt/makefile | 2 +- qt/mssql/basic/makefile | 18 +- qt/mssql/date-time/makefile | 18 +- qt/mssql/makefile | 17 +- qt/mssql/qt-mssql-qt4-vc10.sln | 15 + qt/mssql/qt-mssql-qt4-vc11.sln | 15 + qt/mssql/qt-mssql-qt4-vc9.sln | 15 + qt/mssql/qt-mssql-qt5-vc10.sln | 15 + qt/mssql/qt-mssql-qt5-vc11.sln | 15 + qt/mssql/qt-mssql-qt5-vc9.sln | 15 + qt/mssql/qt-mssql-vc10.sln | 15 - qt/mssql/qt-mssql-vc11.sln | 15 - qt/mssql/qt-mssql-vc9.sln | 15 - qt/mssql/template/makefile | 18 +- qt/mssql/template/template-qt4-vc10.vcxproj | 180 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 25 ++ qt/mssql/template/template-qt4-vc11.vcxproj | 184 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 25 ++ qt/mssql/template/template-qt4-vc9.vcproj | 361 +++++++++++++++++++++ qt/mssql/template/template-qt5-vc10.vcxproj | 180 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 25 ++ qt/mssql/template/template-qt5-vc11.vcxproj | 184 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 25 ++ qt/mssql/template/template-qt5-vc9.vcproj | 361 +++++++++++++++++++++ qt/mssql/template/template-vc10.vcxproj | 180 ---------- qt/mssql/template/template-vc10.vcxproj.filters | 25 -- qt/mssql/template/template-vc11.vcxproj | 184 ----------- qt/mssql/template/template-vc11.vcxproj.filters | 25 -- qt/mssql/template/template-vc9.vcproj | 361 --------------------- qt/mysql/basic/makefile | 18 +- qt/mysql/date-time/makefile | 18 +- qt/mysql/makefile | 17 +- qt/mysql/qt-mysql-qt4-vc10.sln | 15 + qt/mysql/qt-mysql-qt4-vc11.sln | 15 + qt/mysql/qt-mysql-qt4-vc9.sln | 15 + qt/mysql/qt-mysql-qt5-vc10.sln | 15 + qt/mysql/qt-mysql-qt5-vc11.sln | 15 + qt/mysql/qt-mysql-qt5-vc9.sln | 15 + qt/mysql/qt-mysql-vc10.sln | 15 - qt/mysql/qt-mysql-vc11.sln | 15 - qt/mysql/qt-mysql-vc9.sln | 15 - qt/mysql/template/makefile | 18 +- qt/mysql/template/template-qt4-vc10.vcxproj | 180 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 25 ++ qt/mysql/template/template-qt4-vc11.vcxproj | 184 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 25 ++ qt/mysql/template/template-qt4-vc9.vcproj | 361 +++++++++++++++++++++ qt/mysql/template/template-qt5-vc10.vcxproj | 180 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 25 ++ qt/mysql/template/template-qt5-vc11.vcxproj | 184 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 25 ++ qt/mysql/template/template-qt5-vc9.vcproj | 361 +++++++++++++++++++++ qt/mysql/template/template-vc10.vcxproj | 180 ---------- qt/mysql/template/template-vc10.vcxproj.filters | 25 -- qt/mysql/template/template-vc11.vcxproj | 184 ----------- qt/mysql/template/template-vc11.vcxproj.filters | 25 -- qt/mysql/template/template-vc9.vcproj | 361 --------------------- qt/oracle/basic/makefile | 18 +- qt/oracle/date-time/makefile | 18 +- qt/oracle/makefile | 17 +- qt/oracle/qt-oracle-qt4-vc10.sln | 15 + qt/oracle/qt-oracle-qt4-vc11.sln | 15 + qt/oracle/qt-oracle-qt4-vc9.sln | 15 + qt/oracle/qt-oracle-qt5-vc10.sln | 15 + qt/oracle/qt-oracle-qt5-vc11.sln | 15 + qt/oracle/qt-oracle-qt5-vc9.sln | 15 + qt/oracle/qt-oracle-vc10.sln | 15 - qt/oracle/qt-oracle-vc11.sln | 15 - qt/oracle/qt-oracle-vc9.sln | 15 - qt/oracle/template/makefile | 18 +- qt/oracle/template/template-qt4-vc10.vcxproj | 180 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 25 ++ qt/oracle/template/template-qt4-vc11.vcxproj | 184 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 25 ++ qt/oracle/template/template-qt4-vc9.vcproj | 361 +++++++++++++++++++++ qt/oracle/template/template-qt5-vc10.vcxproj | 180 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 25 ++ qt/oracle/template/template-qt5-vc11.vcxproj | 184 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 25 ++ qt/oracle/template/template-qt5-vc9.vcproj | 361 +++++++++++++++++++++ qt/oracle/template/template-vc10.vcxproj | 180 ---------- qt/oracle/template/template-vc10.vcxproj.filters | 25 -- qt/oracle/template/template-vc11.vcxproj | 184 ----------- qt/oracle/template/template-vc11.vcxproj.filters | 25 -- qt/oracle/template/template-vc9.vcproj | 361 --------------------- qt/pgsql/basic/makefile | 18 +- qt/pgsql/date-time/makefile | 18 +- qt/pgsql/makefile | 17 +- qt/pgsql/qt-pgsql-qt4-vc10.sln | 15 + qt/pgsql/qt-pgsql-qt4-vc11.sln | 15 + qt/pgsql/qt-pgsql-qt4-vc9.sln | 15 + qt/pgsql/qt-pgsql-qt5-vc10.sln | 15 + qt/pgsql/qt-pgsql-qt5-vc11.sln | 15 + qt/pgsql/qt-pgsql-qt5-vc9.sln | 15 + qt/pgsql/qt-pgsql-vc10.sln | 15 - qt/pgsql/qt-pgsql-vc11.sln | 15 - qt/pgsql/qt-pgsql-vc9.sln | 15 - qt/pgsql/template/makefile | 18 +- qt/pgsql/template/template-qt4-vc10.vcxproj | 180 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 25 ++ qt/pgsql/template/template-qt4-vc11.vcxproj | 184 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 25 ++ qt/pgsql/template/template-qt4-vc9.vcproj | 361 +++++++++++++++++++++ qt/pgsql/template/template-qt5-vc10.vcxproj | 180 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 25 ++ qt/pgsql/template/template-qt5-vc11.vcxproj | 184 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 25 ++ qt/pgsql/template/template-qt5-vc9.vcproj | 361 +++++++++++++++++++++ qt/pgsql/template/template-vc10.vcxproj | 180 ---------- qt/pgsql/template/template-vc10.vcxproj.filters | 25 -- qt/pgsql/template/template-vc11.vcxproj | 184 ----------- qt/pgsql/template/template-vc11.vcxproj.filters | 25 -- qt/pgsql/template/template-vc9.vcproj | 361 --------------------- qt/sqlite/basic/makefile | 18 +- qt/sqlite/date-time/makefile | 18 +- qt/sqlite/makefile | 17 +- qt/sqlite/qt-sqlite-qt4-vc10.sln | 15 + qt/sqlite/qt-sqlite-qt4-vc11.sln | 15 + qt/sqlite/qt-sqlite-qt4-vc9.sln | 15 + qt/sqlite/qt-sqlite-qt5-vc10.sln | 15 + qt/sqlite/qt-sqlite-qt5-vc11.sln | 15 + qt/sqlite/qt-sqlite-qt5-vc9.sln | 15 + qt/sqlite/qt-sqlite-vc10.sln | 15 - qt/sqlite/qt-sqlite-vc11.sln | 15 - qt/sqlite/qt-sqlite-vc9.sln | 15 - qt/sqlite/template/makefile | 18 +- qt/sqlite/template/template-qt4-vc10.vcxproj | 180 ++++++++++ .../template/template-qt4-vc10.vcxproj.filters | 25 ++ qt/sqlite/template/template-qt4-vc11.vcxproj | 184 +++++++++++ .../template/template-qt4-vc11.vcxproj.filters | 25 ++ qt/sqlite/template/template-qt4-vc9.vcproj | 361 +++++++++++++++++++++ qt/sqlite/template/template-qt5-vc10.vcxproj | 180 ++++++++++ .../template/template-qt5-vc10.vcxproj.filters | 25 ++ qt/sqlite/template/template-qt5-vc11.vcxproj | 184 +++++++++++ .../template/template-qt5-vc11.vcxproj.filters | 25 ++ qt/sqlite/template/template-qt5-vc9.vcproj | 361 +++++++++++++++++++++ qt/sqlite/template/template-vc10.vcxproj | 180 ---------- qt/sqlite/template/template-vc10.vcxproj.filters | 25 -- qt/sqlite/template/template-vc11.vcxproj | 184 ----------- qt/sqlite/template/template-vc11.vcxproj.filters | 25 -- qt/sqlite/template/template-vc9.vcproj | 361 --------------------- 173 files changed, 10151 insertions(+), 5070 deletions(-) create mode 100644 qt/common/qt-common-qt4-vc10.sln create mode 100644 qt/common/qt-common-qt4-vc11.sln create mode 100644 qt/common/qt-common-qt4-vc9.sln create mode 100644 qt/common/qt-common-qt5-vc10.sln create mode 100644 qt/common/qt-common-qt5-vc11.sln create mode 100644 qt/common/qt-common-qt5-vc9.sln delete mode 100644 qt/common/qt-common-vc10.sln delete mode 100644 qt/common/qt-common-vc11.sln delete mode 100644 qt/common/qt-common-vc9.sln create mode 100644 qt/common/template/template-qt4-vc10.vcxproj create mode 100644 qt/common/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/common/template/template-qt4-vc11.vcxproj create mode 100644 qt/common/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/common/template/template-qt4-vc9.vcproj create mode 100644 qt/common/template/template-qt5-vc10.vcxproj create mode 100644 qt/common/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/common/template/template-qt5-vc11.vcxproj create mode 100644 qt/common/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/common/template/template-qt5-vc9.vcproj delete mode 100644 qt/common/template/template-vc10.vcxproj delete mode 100644 qt/common/template/template-vc10.vcxproj.filters delete mode 100644 qt/common/template/template-vc11.vcxproj delete mode 100644 qt/common/template/template-vc11.vcxproj.filters delete mode 100644 qt/common/template/template-vc9.vcproj create mode 100644 qt/mssql/qt-mssql-qt4-vc10.sln create mode 100644 qt/mssql/qt-mssql-qt4-vc11.sln create mode 100644 qt/mssql/qt-mssql-qt4-vc9.sln create mode 100644 qt/mssql/qt-mssql-qt5-vc10.sln create mode 100644 qt/mssql/qt-mssql-qt5-vc11.sln create mode 100644 qt/mssql/qt-mssql-qt5-vc9.sln delete mode 100644 qt/mssql/qt-mssql-vc10.sln delete mode 100644 qt/mssql/qt-mssql-vc11.sln delete mode 100644 qt/mssql/qt-mssql-vc9.sln create mode 100644 qt/mssql/template/template-qt4-vc10.vcxproj create mode 100644 qt/mssql/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/mssql/template/template-qt4-vc11.vcxproj create mode 100644 qt/mssql/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/mssql/template/template-qt4-vc9.vcproj create mode 100644 qt/mssql/template/template-qt5-vc10.vcxproj create mode 100644 qt/mssql/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/mssql/template/template-qt5-vc11.vcxproj create mode 100644 qt/mssql/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/mssql/template/template-qt5-vc9.vcproj delete mode 100644 qt/mssql/template/template-vc10.vcxproj delete mode 100644 qt/mssql/template/template-vc10.vcxproj.filters delete mode 100644 qt/mssql/template/template-vc11.vcxproj delete mode 100644 qt/mssql/template/template-vc11.vcxproj.filters delete mode 100644 qt/mssql/template/template-vc9.vcproj create mode 100644 qt/mysql/qt-mysql-qt4-vc10.sln create mode 100644 qt/mysql/qt-mysql-qt4-vc11.sln create mode 100644 qt/mysql/qt-mysql-qt4-vc9.sln create mode 100644 qt/mysql/qt-mysql-qt5-vc10.sln create mode 100644 qt/mysql/qt-mysql-qt5-vc11.sln create mode 100644 qt/mysql/qt-mysql-qt5-vc9.sln delete mode 100644 qt/mysql/qt-mysql-vc10.sln delete mode 100644 qt/mysql/qt-mysql-vc11.sln delete mode 100644 qt/mysql/qt-mysql-vc9.sln create mode 100644 qt/mysql/template/template-qt4-vc10.vcxproj create mode 100644 qt/mysql/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/mysql/template/template-qt4-vc11.vcxproj create mode 100644 qt/mysql/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/mysql/template/template-qt4-vc9.vcproj create mode 100644 qt/mysql/template/template-qt5-vc10.vcxproj create mode 100644 qt/mysql/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/mysql/template/template-qt5-vc11.vcxproj create mode 100644 qt/mysql/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/mysql/template/template-qt5-vc9.vcproj delete mode 100644 qt/mysql/template/template-vc10.vcxproj delete mode 100644 qt/mysql/template/template-vc10.vcxproj.filters delete mode 100644 qt/mysql/template/template-vc11.vcxproj delete mode 100644 qt/mysql/template/template-vc11.vcxproj.filters delete mode 100644 qt/mysql/template/template-vc9.vcproj create mode 100644 qt/oracle/qt-oracle-qt4-vc10.sln create mode 100644 qt/oracle/qt-oracle-qt4-vc11.sln create mode 100644 qt/oracle/qt-oracle-qt4-vc9.sln create mode 100644 qt/oracle/qt-oracle-qt5-vc10.sln create mode 100644 qt/oracle/qt-oracle-qt5-vc11.sln create mode 100644 qt/oracle/qt-oracle-qt5-vc9.sln delete mode 100644 qt/oracle/qt-oracle-vc10.sln delete mode 100644 qt/oracle/qt-oracle-vc11.sln delete mode 100644 qt/oracle/qt-oracle-vc9.sln create mode 100644 qt/oracle/template/template-qt4-vc10.vcxproj create mode 100644 qt/oracle/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/oracle/template/template-qt4-vc11.vcxproj create mode 100644 qt/oracle/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/oracle/template/template-qt4-vc9.vcproj create mode 100644 qt/oracle/template/template-qt5-vc10.vcxproj create mode 100644 qt/oracle/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/oracle/template/template-qt5-vc11.vcxproj create mode 100644 qt/oracle/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/oracle/template/template-qt5-vc9.vcproj delete mode 100644 qt/oracle/template/template-vc10.vcxproj delete mode 100644 qt/oracle/template/template-vc10.vcxproj.filters delete mode 100644 qt/oracle/template/template-vc11.vcxproj delete mode 100644 qt/oracle/template/template-vc11.vcxproj.filters delete mode 100644 qt/oracle/template/template-vc9.vcproj create mode 100644 qt/pgsql/qt-pgsql-qt4-vc10.sln create mode 100644 qt/pgsql/qt-pgsql-qt4-vc11.sln create mode 100644 qt/pgsql/qt-pgsql-qt4-vc9.sln create mode 100644 qt/pgsql/qt-pgsql-qt5-vc10.sln create mode 100644 qt/pgsql/qt-pgsql-qt5-vc11.sln create mode 100644 qt/pgsql/qt-pgsql-qt5-vc9.sln delete mode 100644 qt/pgsql/qt-pgsql-vc10.sln delete mode 100644 qt/pgsql/qt-pgsql-vc11.sln delete mode 100644 qt/pgsql/qt-pgsql-vc9.sln create mode 100644 qt/pgsql/template/template-qt4-vc10.vcxproj create mode 100644 qt/pgsql/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/pgsql/template/template-qt4-vc11.vcxproj create mode 100644 qt/pgsql/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/pgsql/template/template-qt4-vc9.vcproj create mode 100644 qt/pgsql/template/template-qt5-vc10.vcxproj create mode 100644 qt/pgsql/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/pgsql/template/template-qt5-vc11.vcxproj create mode 100644 qt/pgsql/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/pgsql/template/template-qt5-vc9.vcproj delete mode 100644 qt/pgsql/template/template-vc10.vcxproj delete mode 100644 qt/pgsql/template/template-vc10.vcxproj.filters delete mode 100644 qt/pgsql/template/template-vc11.vcxproj delete mode 100644 qt/pgsql/template/template-vc11.vcxproj.filters delete mode 100644 qt/pgsql/template/template-vc9.vcproj create mode 100644 qt/sqlite/qt-sqlite-qt4-vc10.sln create mode 100644 qt/sqlite/qt-sqlite-qt4-vc11.sln create mode 100644 qt/sqlite/qt-sqlite-qt4-vc9.sln create mode 100644 qt/sqlite/qt-sqlite-qt5-vc10.sln create mode 100644 qt/sqlite/qt-sqlite-qt5-vc11.sln create mode 100644 qt/sqlite/qt-sqlite-qt5-vc9.sln delete mode 100644 qt/sqlite/qt-sqlite-vc10.sln delete mode 100644 qt/sqlite/qt-sqlite-vc11.sln delete mode 100644 qt/sqlite/qt-sqlite-vc9.sln create mode 100644 qt/sqlite/template/template-qt4-vc10.vcxproj create mode 100644 qt/sqlite/template/template-qt4-vc10.vcxproj.filters create mode 100644 qt/sqlite/template/template-qt4-vc11.vcxproj create mode 100644 qt/sqlite/template/template-qt4-vc11.vcxproj.filters create mode 100644 qt/sqlite/template/template-qt4-vc9.vcproj create mode 100644 qt/sqlite/template/template-qt5-vc10.vcxproj create mode 100644 qt/sqlite/template/template-qt5-vc10.vcxproj.filters create mode 100644 qt/sqlite/template/template-qt5-vc11.vcxproj create mode 100644 qt/sqlite/template/template-qt5-vc11.vcxproj.filters create mode 100644 qt/sqlite/template/template-qt5-vc9.vcproj delete mode 100644 qt/sqlite/template/template-vc10.vcxproj delete mode 100644 qt/sqlite/template/template-vc10.vcxproj.filters delete mode 100644 qt/sqlite/template/template-vc11.vcxproj delete mode 100644 qt/sqlite/template/template-vc11.vcxproj.filters delete mode 100644 qt/sqlite/template/template-vc9.vcproj diff --git a/build/bootstrap.make b/build/bootstrap.make index ed52a80..3cde55f 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -99,20 +99,21 @@ vc11projs = $(addprefix $1-,$(addsuffix -vc11.vcxproj,$(databases))) \ $(addprefix $1-,$(addsuffix -vc11.vcxproj.filters,$(databases))) # $1 solution name without the -vcN.sln suffix. +# $2 extra project suffix in addition to --vcN.vcproj (optional) # $(dist): meta-vc9slns = \ $(foreach d,$(databases),$(call \ -meta-vc9sln,$1-vc9.sln,$1-$d-vc9.sln,-$d-vc9.vcproj,database,$d)$(literal_newline)\ +meta-vc9sln,$1-vc9.sln,$1-$d-vc9.sln,$2-$d-vc9.vcproj,database,$d)$(literal_newline)\ $(literal_tab))@: $(dist): meta-vc10slns = \ $(foreach d,$(databases),$(call \ -meta-vc10sln,$1-vc10.sln,$1-$d-vc10.sln,-$d-vc10.vcxproj,database,$d)$(literal_newline)\ +meta-vc10sln,$1-vc10.sln,$1-$d-vc10.sln,$2-$d-vc10.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: $(dist): meta-vc11slns = \ $(foreach d,$(databases),$(call \ -meta-vc11sln,$1-vc11.sln,$1-$d-vc11.sln,-$d-vc11.vcxproj,database,$d)$(literal_newline)\ +meta-vc11sln,$1-vc11.sln,$1-$d-vc11.sln,$2-$d-vc11.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) diff --git a/qt/build.bat b/qt/build.bat index 186101c..1d82cf9 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -6,7 +6,7 @@ rem license : GNU GPL v2; see accompanying LICENSE file rem rem Build Qt tests using the VC++ batch mode compilation. rem -rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] +rem build.bat database qt-version vc-version conf plat [/Build|/Clean|/Rebuild] rem rem conf: {Debug,Release}|all rem plat: {Win32,x64}|all @@ -20,25 +20,38 @@ if "_%1_" == "__" ( ) if "_%2_" == "__" ( + echo no Qt version specified + goto usage +) + +if "_%3_" == "__" ( echo no VC++ version specified goto usage ) -if "_%~3_" == "__" ( +if "_%~4_" == "__" ( echo no configuration specified goto usage ) -if "_%~4_" == "__" ( +if "_%~5_" == "__" ( echo no platform specified goto usage ) set "failed=" -if "_%2_" == "_9_" set "vcver=9" -if "_%2_" == "_10_" set "vcver=10" -if "_%2_" == "_11_" set "vcver=11" +if "_%2_" == "_4_" set "qtver=4" +if "_%2_" == "_5_" set "qtver=5" + +if "_%qtver%_" == "__" ( + echo unknown Qt version %2 + goto usage +) + +if "_%3_" == "_9_" set "vcver=9" +if "_%3_" == "_10_" set "vcver=10" +if "_%3_" == "_11_" set "vcver=11" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 @@ -76,14 +89,14 @@ goto :eof for %%d in (%1) do ( for %%c in (%confs%) do ( for %%p in (%plats%) do ( - call :run_build %%d/qt-%%d-vc%vcver%.sln %%c %%p + call :run_build %%d/qt-%%d-qt%qtver%-vc%vcver%.sln %%c %%p ) ) ) for %%c in (%confs%) do ( for %%p in (%plats%) do ( - call :run_build common/qt-common-%1-vc%vcver%.sln %%c %%p + call :run_build common/qt-common-qt%qtver%-%1-vc%vcver%.sln %%c %%p ) ) @@ -96,7 +109,7 @@ goto end :usage echo. -echo usage: build.bat database vc-version conf plat [action] +echo usage: build.bat database qt-version vc-version conf plat [action] echo valid configurations are: {Debug,Release}|all echo valid platforms are: {Win32,x64}|all echo valid actions are: /Build (default), /Clean, and /Rebuild diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index f6a8728..40e210e 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -65,14 +65,19 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) \ +$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ +$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) # Test. # diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 2a88495..887df7f 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -65,14 +65,19 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) \ +$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ +$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(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)) - $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) # Test. # diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 7a25503..b330f8a 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -65,14 +65,19 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) \ +$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ +$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(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)) - $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) # Test. # diff --git a/qt/common/makefile b/qt/common/makefile index 2cadcee..6132c7b 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -24,14 +24,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := qt-common $(dist): name := $(name) $(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(dist): export extra_dist := test.bat \ +$(call vc9slns,$(name)-qt4) $(call vc9slns,$(name)-qt5) \ +$(call vc10slns,$(name)-qt4) $(call vc10slns,$(name)-qt5) \ +$(call vc11slns,$(name)-qt4) $(call vc11slns,$(name)-qt5) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) - $(call meta-vc9slns,$(name)) - $(call meta-vc10slns,$(name)) - $(call meta-vc11slns,$(name)) - $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) + $(call meta-vc9slns,$(name)-qt4,-qt4) + $(call meta-vc9slns,$(name)-qt5,-qt5) + $(call meta-vc10slns,$(name)-qt4,-qt4) + $(call meta-vc10slns,$(name)-qt5,-qt5) + $(call meta-vc11slns,$(name)-qt4,-qt4) + $(call meta-vc11slns,$(name)-qt5,-qt5) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) diff --git a/qt/common/qt-common-qt4-vc10.sln b/qt/common/qt-common-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/common/qt-common-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/common/qt-common-qt4-vc11.sln b/qt/common/qt-common-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/common/qt-common-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/qt-common-qt4-vc9.sln b/qt/common/qt-common-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/common/qt-common-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/common/qt-common-qt5-vc10.sln b/qt/common/qt-common-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/common/qt-common-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/common/qt-common-qt5-vc11.sln b/qt/common/qt-common-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/common/qt-common-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/qt-common-qt5-vc9.sln b/qt/common/qt-common-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/common/qt-common-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/common/qt-common-vc10.sln b/qt/common/qt-common-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/common/qt-common-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/qt/common/qt-common-vc11.sln b/qt/common/qt-common-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/common/qt-common-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-vc9.sln b/qt/common/qt-common-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/common/qt-common-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/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 84972c5..d1cb02d 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -65,14 +65,19 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) \ +$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ +$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) # Test. # diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 1b58ef1..140cb07 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -65,14 +65,19 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) \ +$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ +$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(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)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) # Test. # diff --git a/qt/common/template/template-qt4-vc10.vcxproj b/qt/common/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..1c4b458 --- /dev/null +++ b/qt/common/template/template-qt4-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt4-vc10.vcxproj.filters b/qt/common/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-qt4-vc11.vcxproj b/qt/common/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..b9a0bc4 --- /dev/null +++ b/qt/common/template/template-qt4-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt4-vc11.vcxproj.filters b/qt/common/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-qt4-vc9.vcproj b/qt/common/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..e8a6a3c --- /dev/null +++ b/qt/common/template/template-qt4-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/qt/common/template/template-qt5-vc10.vcxproj b/qt/common/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..f39a37d --- /dev/null +++ b/qt/common/template/template-qt5-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt5-vc10.vcxproj.filters b/qt/common/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc11.vcxproj b/qt/common/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..2e6f8be --- /dev/null +++ b/qt/common/template/template-qt5-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt5-vc11.vcxproj.filters b/qt/common/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc9.vcproj b/qt/common/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..0a87423 --- /dev/null +++ b/qt/common/template/template-qt5-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/qt/common/template/template-vc10.vcxproj b/qt/common/template/template-vc10.vcxproj deleted file mode 100644 index 1c4b458..0000000 --- a/qt/common/template/template-vc10.vcxproj +++ /dev/null @@ -1,177 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-vc10.vcxproj.filters b/qt/common/template/template-vc10.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-vc11.vcxproj b/qt/common/template/template-vc11.vcxproj deleted file mode 100644 index b9a0bc4..0000000 --- a/qt/common/template/template-vc11.vcxproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-vc11.vcxproj.filters b/qt/common/template/template-vc11.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-vc9.vcproj b/qt/common/template/template-vc9.vcproj deleted file mode 100644 index e8a6a3c..0000000 --- a/qt/common/template/template-vc9.vcproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/qt/makefile b/qt/makefile index dd90f8a..0c6af5f 100644 --- a/qt/makefile +++ b/qt/makefile @@ -17,7 +17,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export extra_dist := build.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) - $(call meta-vctest,common/qt-common-mysql-vc10.sln,build.bat) + $(call meta-vctest,common/qt-common-qt4-mysql-vc10.sln,build.bat) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 8dc9255..f522057 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 69ff484..5f4fe2d 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 8f8c848..e8c52c4 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -18,13 +18,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := test.bat \ +$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ +$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vctest,$(name)-vc10.sln,test.bat) + $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) + $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) + $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) + $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) + $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) + $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/qt/mssql/qt-mssql-qt4-vc10.sln b/qt/mssql/qt-mssql-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mssql/qt-mssql-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/qt-mssql-qt4-vc11.sln b/qt/mssql/qt-mssql-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mssql/qt-mssql-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/qt-mssql-qt4-vc9.sln b/qt/mssql/qt-mssql-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mssql/qt-mssql-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/qt-mssql-qt5-vc10.sln b/qt/mssql/qt-mssql-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mssql/qt-mssql-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/qt-mssql-qt5-vc11.sln b/qt/mssql/qt-mssql-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mssql/qt-mssql-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/qt-mssql-qt5-vc9.sln b/qt/mssql/qt-mssql-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mssql/qt-mssql-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mssql/qt-mssql-vc10.sln b/qt/mssql/qt-mssql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mssql/qt-mssql-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/qt/mssql/qt-mssql-vc11.sln b/qt/mssql/qt-mssql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mssql/qt-mssql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-vc9.sln b/qt/mssql/qt-mssql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mssql/qt-mssql-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/qt/mssql/template/makefile b/qt/mssql/template/makefile index 3ba03b2..7b4df59 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -55,15 +55,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mssql/template/template-qt4-vc10.vcxproj b/qt/mssql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..e4902d0 --- /dev/null +++ b/qt/mssql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt4-vc10.vcxproj.filters b/qt/mssql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/template/template-qt4-vc11.vcxproj b/qt/mssql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..d58282a --- /dev/null +++ b/qt/mssql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt4-vc11.vcxproj.filters b/qt/mssql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/template/template-qt4-vc9.vcproj b/qt/mssql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..da1b5ab --- /dev/null +++ b/qt/mssql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mssql/template/template-qt5-vc10.vcxproj b/qt/mssql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..2edf4fe --- /dev/null +++ b/qt/mssql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt5-vc10.vcxproj.filters b/qt/mssql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj b/qt/mssql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..60399ca --- /dev/null +++ b/qt/mssql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj.filters b/qt/mssql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc9.vcproj b/qt/mssql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..4b1b20e --- /dev/null +++ b/qt/mssql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mssql/template/template-vc10.vcxproj b/qt/mssql/template/template-vc10.vcxproj deleted file mode 100644 index e4902d0..0000000 --- a/qt/mssql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-vc10.vcxproj.filters b/qt/mssql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-vc11.vcxproj b/qt/mssql/template/template-vc11.vcxproj deleted file mode 100644 index d58282a..0000000 --- a/qt/mssql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-vc11.vcxproj.filters b/qt/mssql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-vc9.vcproj b/qt/mssql/template/template-vc9.vcproj deleted file mode 100644 index da1b5ab..0000000 --- a/qt/mssql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index bb12751..cb8eb03 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 6060d91..54d2c3e 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 6f4cb87..c3d40cb 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -18,13 +18,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := test.bat \ +$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ +$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vctest,$(name)-vc10.sln,test.bat) + $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) + $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) + $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) + $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) + $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) + $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/qt/mysql/qt-mysql-qt4-vc10.sln b/qt/mysql/qt-mysql-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mysql/qt-mysql-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/qt-mysql-qt4-vc11.sln b/qt/mysql/qt-mysql-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mysql/qt-mysql-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/qt-mysql-qt4-vc9.sln b/qt/mysql/qt-mysql-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mysql/qt-mysql-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/qt-mysql-qt5-vc10.sln b/qt/mysql/qt-mysql-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/mysql/qt-mysql-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/qt-mysql-qt5-vc11.sln b/qt/mysql/qt-mysql-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/mysql/qt-mysql-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/qt-mysql-qt5-vc9.sln b/qt/mysql/qt-mysql-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/mysql/qt-mysql-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/mysql/qt-mysql-vc10.sln b/qt/mysql/qt-mysql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mysql/qt-mysql-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/qt/mysql/qt-mysql-vc11.sln b/qt/mysql/qt-mysql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mysql/qt-mysql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-vc9.sln b/qt/mysql/qt-mysql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mysql/qt-mysql-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/qt/mysql/template/makefile b/qt/mysql/template/makefile index ac6f0c9..3bb815f 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -55,15 +55,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/mysql/template/template-qt4-vc10.vcxproj b/qt/mysql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..0f57bbe --- /dev/null +++ b/qt/mysql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt4-vc10.vcxproj.filters b/qt/mysql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/template/template-qt4-vc11.vcxproj b/qt/mysql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..fc8ac4e --- /dev/null +++ b/qt/mysql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt4-vc11.vcxproj.filters b/qt/mysql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/template/template-qt4-vc9.vcproj b/qt/mysql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..a904d40 --- /dev/null +++ b/qt/mysql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mysql/template/template-qt5-vc10.vcxproj b/qt/mysql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..038f199 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt5-vc10.vcxproj.filters b/qt/mysql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj b/qt/mysql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..18a0d11 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj.filters b/qt/mysql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc9.vcproj b/qt/mysql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..687d887 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mysql/template/template-vc10.vcxproj b/qt/mysql/template/template-vc10.vcxproj deleted file mode 100644 index 0f57bbe..0000000 --- a/qt/mysql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-vc10.vcxproj.filters b/qt/mysql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-vc11.vcxproj b/qt/mysql/template/template-vc11.vcxproj deleted file mode 100644 index fc8ac4e..0000000 --- a/qt/mysql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-vc11.vcxproj.filters b/qt/mysql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-vc9.vcproj b/qt/mysql/template/template-vc9.vcproj deleted file mode 100644 index a904d40..0000000 --- a/qt/mysql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index b076d58..b04da93 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 9d7f776..f377109 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 5a06b62..488f6b1 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -18,13 +18,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := test.bat \ +$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ +$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vctest,$(name)-vc10.sln,test.bat) + $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) + $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) + $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) + $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) + $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) + $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/qt/oracle/qt-oracle-qt4-vc10.sln b/qt/oracle/qt-oracle-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/oracle/qt-oracle-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/qt-oracle-qt4-vc11.sln b/qt/oracle/qt-oracle-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/oracle/qt-oracle-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/qt-oracle-qt4-vc9.sln b/qt/oracle/qt-oracle-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/oracle/qt-oracle-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/qt-oracle-qt5-vc10.sln b/qt/oracle/qt-oracle-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/oracle/qt-oracle-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/qt-oracle-qt5-vc11.sln b/qt/oracle/qt-oracle-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/oracle/qt-oracle-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/qt-oracle-qt5-vc9.sln b/qt/oracle/qt-oracle-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/oracle/qt-oracle-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/oracle/qt-oracle-vc10.sln b/qt/oracle/qt-oracle-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/oracle/qt-oracle-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/qt/oracle/qt-oracle-vc11.sln b/qt/oracle/qt-oracle-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/oracle/qt-oracle-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-vc9.sln b/qt/oracle/qt-oracle-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/oracle/qt-oracle-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/qt/oracle/template/makefile b/qt/oracle/template/makefile index 75a1f35..aecc38c 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -55,15 +55,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/oracle/template/template-qt4-vc10.vcxproj b/qt/oracle/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..6e7c369 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt4-vc10.vcxproj.filters b/qt/oracle/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/template/template-qt4-vc11.vcxproj b/qt/oracle/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..1f4248d --- /dev/null +++ b/qt/oracle/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt4-vc11.vcxproj.filters b/qt/oracle/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/template/template-qt4-vc9.vcproj b/qt/oracle/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..292b899 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/oracle/template/template-qt5-vc10.vcxproj b/qt/oracle/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..29bbb2b --- /dev/null +++ b/qt/oracle/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt5-vc10.vcxproj.filters b/qt/oracle/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj b/qt/oracle/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..a06f15b --- /dev/null +++ b/qt/oracle/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj.filters b/qt/oracle/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc9.vcproj b/qt/oracle/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..34ab18f --- /dev/null +++ b/qt/oracle/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/oracle/template/template-vc10.vcxproj b/qt/oracle/template/template-vc10.vcxproj deleted file mode 100644 index 6e7c369..0000000 --- a/qt/oracle/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-vc10.vcxproj.filters b/qt/oracle/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-vc11.vcxproj b/qt/oracle/template/template-vc11.vcxproj deleted file mode 100644 index 1f4248d..0000000 --- a/qt/oracle/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-vc11.vcxproj.filters b/qt/oracle/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-vc9.vcproj b/qt/oracle/template/template-vc9.vcproj deleted file mode 100644 index 292b899..0000000 --- a/qt/oracle/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 1fddeea..7661ae2 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 5da2649..ef27e40 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 1d6fa4f..e70178d 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -18,13 +18,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := test.bat \ +$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ +$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vctest,$(name)-vc10.sln,test.bat) + $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) + $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) + $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) + $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) + $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) + $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/qt/pgsql/qt-pgsql-qt4-vc10.sln b/qt/pgsql/qt-pgsql-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/qt-pgsql-qt4-vc11.sln b/qt/pgsql/qt-pgsql-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt4-vc9.sln b/qt/pgsql/qt-pgsql-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/qt-pgsql-qt5-vc10.sln b/qt/pgsql/qt-pgsql-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/qt-pgsql-qt5-vc11.sln b/qt/pgsql/qt-pgsql-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt5-vc9.sln b/qt/pgsql/qt-pgsql-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/pgsql/qt-pgsql-vc10.sln b/qt/pgsql/qt-pgsql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/pgsql/qt-pgsql-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/qt/pgsql/qt-pgsql-vc11.sln b/qt/pgsql/qt-pgsql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/pgsql/qt-pgsql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-vc9.sln b/qt/pgsql/qt-pgsql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/pgsql/qt-pgsql-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/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 7b40f65..d495251 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -55,15 +55,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/pgsql/template/template-qt4-vc10.vcxproj b/qt/pgsql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..1c1e1a7 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt4-vc10.vcxproj.filters b/qt/pgsql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/template/template-qt4-vc11.vcxproj b/qt/pgsql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..69278cd --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt4-vc11.vcxproj.filters b/qt/pgsql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/template/template-qt4-vc9.vcproj b/qt/pgsql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..2e9e84b --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/pgsql/template/template-qt5-vc10.vcxproj b/qt/pgsql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..1194212 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt5-vc10.vcxproj.filters b/qt/pgsql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj b/qt/pgsql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..f17cbaa --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj.filters b/qt/pgsql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc9.vcproj b/qt/pgsql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..bfb8b72 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/pgsql/template/template-vc10.vcxproj b/qt/pgsql/template/template-vc10.vcxproj deleted file mode 100644 index 1c1e1a7..0000000 --- a/qt/pgsql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-vc10.vcxproj.filters b/qt/pgsql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-vc11.vcxproj b/qt/pgsql/template/template-vc11.vcxproj deleted file mode 100644 index 69278cd..0000000 --- a/qt/pgsql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-vc11.vcxproj.filters b/qt/pgsql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-vc9.vcproj b/qt/pgsql/template/template-vc9.vcproj deleted file mode 100644 index 2e9e84b..0000000 --- a/qt/pgsql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 48c6e76..dd8060e 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index a3bc0a4..0bff04a 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -61,15 +61,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 149c118..3db3efb 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -18,13 +18,20 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := test.bat \ +$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ +$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vctest,$(name)-vc10.sln,test.bat) + $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) + $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) + $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) + $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) + $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) + $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + # Can't have Qt-version specific tests. + $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) diff --git a/qt/sqlite/qt-sqlite-qt4-vc10.sln b/qt/sqlite/qt-sqlite-qt4-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt4-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/qt-sqlite-qt4-vc11.sln b/qt/sqlite/qt-sqlite-qt4-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt4-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt4-vc9.sln b/qt/sqlite/qt-sqlite-qt4-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt4-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/qt-sqlite-qt5-vc10.sln b/qt/sqlite/qt-sqlite-qt5-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt5-vc10.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/qt-sqlite-qt5-vc11.sln b/qt/sqlite/qt-sqlite-qt5-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt5-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt5-vc9.sln b/qt/sqlite/qt-sqlite-qt5-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt5-vc9.sln @@ -0,0 +1,15 @@ + +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/qt/sqlite/qt-sqlite-vc10.sln b/qt/sqlite/qt-sqlite-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/sqlite/qt-sqlite-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/qt/sqlite/qt-sqlite-vc11.sln b/qt/sqlite/qt-sqlite-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/sqlite/qt-sqlite-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-vc9.sln b/qt/sqlite/qt-sqlite-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/sqlite/qt-sqlite-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/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 0b1b565..d04ae42 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -55,15 +55,21 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ +$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ +$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ +$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.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) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) + $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) + $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) + $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) + $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) + $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) # Test. # diff --git a/qt/sqlite/template/template-qt4-vc10.vcxproj b/qt/sqlite/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..5d4cd02 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt4-vc10.vcxproj.filters b/qt/sqlite/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/template/template-qt4-vc11.vcxproj b/qt/sqlite/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..c7f0438 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt4-vc11.vcxproj.filters b/qt/sqlite/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/template/template-qt4-vc9.vcproj b/qt/sqlite/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..b52f2ec --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/sqlite/template/template-qt5-vc10.vcxproj b/qt/sqlite/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..f48f19d --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt5-vc10.vcxproj.filters b/qt/sqlite/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj b/qt/sqlite/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..4b55399 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj.filters b/qt/sqlite/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc9.vcproj b/qt/sqlite/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..414d138 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/sqlite/template/template-vc10.vcxproj b/qt/sqlite/template/template-vc10.vcxproj deleted file mode 100644 index 5d4cd02..0000000 --- a/qt/sqlite/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-vc10.vcxproj.filters b/qt/sqlite/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-vc11.vcxproj b/qt/sqlite/template/template-vc11.vcxproj deleted file mode 100644 index c7f0438..0000000 --- a/qt/sqlite/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-vc11.vcxproj.filters b/qt/sqlite/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-vc9.vcproj b/qt/sqlite/template/template-vc9.vcproj deleted file mode 100644 index b52f2ec..0000000 --- a/qt/sqlite/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - -- cgit v1.1 From 7dbf58f9486fb3b3a021bbfab9df03af5a8f0fb3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Feb 2013 17:52:49 +0200 Subject: Use multi-pass table creation in MySQL This deals with table creation order and circular dependencies. Unfortunately, there doesn't seem to be a way in MySQL to drop a foreign key only if it exists without resorting to stored procedures. --- common/makefile | 3 +- common/schema/driver.cxx | 112 ----------------------- common/schema/embedded/order/driver.cxx | 60 ++++++++++++ common/schema/embedded/order/makefile | 119 ++++++++++++++++++++++++ common/schema/embedded/order/test.std | 0 common/schema/embedded/order/test1.hxx | 24 +++++ common/schema/embedded/order/test2.hxx | 18 ++++ common/schema/makefile | 115 ----------------------- common/schema/namespace/driver.cxx | 112 +++++++++++++++++++++++ common/schema/namespace/makefile | 115 +++++++++++++++++++++++ common/schema/namespace/test.hxx | 157 ++++++++++++++++++++++++++++++++ common/schema/namespace/test.std | 0 common/schema/test.hxx | 157 -------------------------------- common/schema/test.std | 0 14 files changed, 607 insertions(+), 385 deletions(-) delete mode 100644 common/schema/driver.cxx create mode 100644 common/schema/embedded/order/driver.cxx create mode 100644 common/schema/embedded/order/makefile create mode 100644 common/schema/embedded/order/test.std create mode 100644 common/schema/embedded/order/test1.hxx create mode 100644 common/schema/embedded/order/test2.hxx delete mode 100644 common/schema/makefile create mode 100644 common/schema/namespace/driver.cxx create mode 100644 common/schema/namespace/makefile create mode 100644 common/schema/namespace/test.hxx create mode 100644 common/schema/namespace/test.std delete mode 100644 common/schema/test.hxx delete mode 100644 common/schema/test.std diff --git a/common/makefile b/common/makefile index 883fe3f..551a0f8 100644 --- a/common/makefile +++ b/common/makefile @@ -39,7 +39,8 @@ query/array \ readonly \ relationship \ relationship-query \ -schema \ +schema/namespace \ +schema/embedded/order \ session/cache \ template \ transaction/basics \ diff --git a/common/schema/driver.cxx b/common/schema/driver.cxx deleted file mode 100644 index a47d1f6..0000000 --- a/common/schema/driver.cxx +++ /dev/null @@ -1,112 +0,0 @@ -// file : common/schema/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test various aspects of database schema. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // Test database schema (aka database namespace). - // - using ns::object2; - - object2 o2; - o2.id = "aaa"; - o2.nums.push_back (1); - o2.nums.push_back (2); - o2.nums.push_back (3); - o2.obj1 = new object1; - o2.obj1->str = "aaa"; - - { - transaction t (db->begin ()); - db->persist (o2.obj1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p2 (db->load ("aaa")); - t.commit (); - - assert (o2 == *p2); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result r (db->query (query::id == "aaa")); - assert (size (r) == 1); - } - - { - result r (db->query (query::obj1->str == "aaa")); - assert (size (r) == 1); - } - - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object2::id == "aaa")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id2 == "aaa" && i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ()); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx new file mode 100644 index 0000000..7503cf5 --- /dev/null +++ b/common/schema/embedded/order/driver.cxx @@ -0,0 +1,60 @@ +// file : common/schema/embedded/order/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test statement execution order in embedded schemas. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test1.hxx" +#include "test2.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Create the database schema. + // + { + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for SQLite. + // +#if defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=OFF"); +#endif + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + +#if defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=ON"); +#endif + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile new file mode 100644 index 0000000..b706345 --- /dev/null +++ b/common/schema/embedded/order/makefile @@ -0,0 +1,119 @@ +# file : common/schema/embedded/order/makefile +# copyright : Copyright (c) 2009-2012 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 := test2.hxx test1.hxx # Reverse order. +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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +--schema-format embedded --table-prefix schema_embd_ordr_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +# Extra dependecy for the ODB-generated code. +# +$(gen): $(addprefix $(src_base)/,$(odb_hdr)) + +$(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 odb_header_stem := $(basename $(odb_hdr)) +$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../../../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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/embedded/order/test.std b/common/schema/embedded/order/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx new file mode 100644 index 0000000..d7e0622 --- /dev/null +++ b/common/schema/embedded/order/test1.hxx @@ -0,0 +1,24 @@ +// file : common/schema/embedded/order/test1.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include + +#include + +#pragma db object polymorphic +struct base +{ + virtual + ~base () {} + + #pragma db auto id + unsigned long id; + + std::string str; +}; + +#endif // TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx new file mode 100644 index 0000000..870ca51 --- /dev/null +++ b/common/schema/embedded/order/test2.hxx @@ -0,0 +1,18 @@ +// file : common/schema/embedded/order/test2.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include + +#include "test1.hxx" + +#pragma db object +struct derived: base +{ + int num; +}; + +#endif // TEST2_HXX diff --git a/common/schema/makefile b/common/schema/makefile deleted file mode 100644 index e7f03df..0000000 --- a/common/schema/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/schema/makefile -# copyright : Copyright (c) 2009-2012 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) --generate-schema \ ---generate-query --table-prefix schema_ -$(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)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(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/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx new file mode 100644 index 0000000..d74461c --- /dev/null +++ b/common/schema/namespace/driver.cxx @@ -0,0 +1,112 @@ +// file : common/schema/namespace/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database schemas (aka database namespaces). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test database schema (aka database namespace). + // + using ns::object2; + + object2 o2; + o2.id = "aaa"; + o2.nums.push_back (1); + o2.nums.push_back (2); + o2.nums.push_back (3); + o2.obj1 = new object1; + o2.obj1->str = "aaa"; + + { + transaction t (db->begin ()); + db->persist (o2.obj1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2 (db->load ("aaa")); + t.commit (); + + assert (o2 == *p2); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::id == "aaa")); + assert (size (r) == 1); + } + + { + result r (db->query (query::obj1->str == "aaa")); + assert (size (r) == 1); + } + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object2::id == "aaa")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id2 == "aaa" && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile new file mode 100644 index 0000000..e15ee10 --- /dev/null +++ b/common/schema/namespace/makefile @@ -0,0 +1,115 @@ +# file : common/schema/namespace/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--generate-query --table-prefix schema_ns_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +$(test): $(driver) $(src_base)/test.std + $(call schema) + $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx new file mode 100644 index 0000000..44d5c60 --- /dev/null +++ b/common/schema/namespace/test.hxx @@ -0,0 +1,157 @@ +// file : common/schema/namespace/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Table names. +// +#pragma db object table("TABLE_EXPLICIT") +struct table_explicit +{ + #pragma db id + unsigned long id_; +}; + +#pragma db object +struct table_implicit +{ + #pragma db id + unsigned long id_; +}; + +// Column names. +// +#pragma db object +struct column +{ + #pragma db id + int m1; + + #pragma db column("foo") + int m2; + + int m_m3; + int _m4; + int m5_; + int m_; + int m__; +}; + +// Column types. +// +#pragma db object +struct type +{ + #pragma db id + std::string id; + + // Test default C++ to DB type mapping. + // + bool b; + char c; + signed char sc; + unsigned char uc; + short s; + unsigned short us; + int i; + unsigned int ui; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + float f; + double d; + std::string str; + + #pragma db type("INTEGER") + bool m1; + + #pragma db transient + char* m2; +}; + +// Test database schema (aka database namespace). +// +#ifdef ODB_COMPILER +#if defined (ODB_DATABASE_MYSQL) +//# define DB_SCHEMA "odb_test" +# define DB_SCHEMA "" +#elif defined (ODB_DATABASE_SQLITE) +# define DB_SCHEMA "main" +#elif defined (ODB_DATABASE_PGSQL) +# define DB_SCHEMA "public" +#elif defined (ODB_DATABASE_ORACLE) +//# define DB_SCHEMA "ODB_TEST" +# define DB_SCHEMA "" +#elif defined(ODB_DATABASE_MSSQL) +# define DB_SCHEMA "dbo" +#else +# error unknown database +#endif +#endif + +namespace ns {typedef int my_int;} // Original. + +#pragma db object table(DB_SCHEMA."object_1") +struct object1 +{ + #pragma db id auto + unsigned long id; + + #pragma db column("str") + std::string str; +}; + +inline bool +operator== (const object1& x, const object1& y) +{ + return x.id == y.id && x.str == y.str; +} + +#pragma db namespace schema(DB_SCHEMA) +namespace ns // Extension. +{ + #pragma db object + struct object2 + { + object2 (): obj1 (0) {} + ~object2 () {delete obj1;} + + #pragma db id + std::string id; + + std::vector nums; + object1* obj1; + }; + + inline bool + operator== (const object2& x, const object2& y) + { + return x.id == y.id && x.nums == y.nums && *x.obj1 == *y.obj1; + } +} + +#pragma db view object(object1) object(ns::object2) +struct object_view +{ + #pragma db column(ns::object2::id) + std::string id2; + + std::string str; +}; + +#pragma db view table(DB_SCHEMA."schema_object_1") +struct table_view +{ + #pragma db column(DB_SCHEMA."schema_object_1"."str") + std::string str; +}; + +#endif // TEST_HXX diff --git a/common/schema/namespace/test.std b/common/schema/namespace/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/schema/test.hxx b/common/schema/test.hxx deleted file mode 100644 index 5e30518..0000000 --- a/common/schema/test.hxx +++ /dev/null @@ -1,157 +0,0 @@ -// file : common/schema/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Table names. -// -#pragma db object table("TABLE_EXPLICIT") -struct table_explicit -{ - #pragma db id - unsigned long id_; -}; - -#pragma db object -struct table_implicit -{ - #pragma db id - unsigned long id_; -}; - -// Column names. -// -#pragma db object -struct column -{ - #pragma db id - int m1; - - #pragma db column("foo") - int m2; - - int m_m3; - int _m4; - int m5_; - int m_; - int m__; -}; - -// Column types. -// -#pragma db object -struct type -{ - #pragma db id - std::string id; - - // Test default C++ to DB type mapping. - // - bool b; - char c; - signed char sc; - unsigned char uc; - short s; - unsigned short us; - int i; - unsigned int ui; - long l; - unsigned long ul; - long long ll; - unsigned long long ull; - float f; - double d; - std::string str; - - #pragma db type("INTEGER") - bool m1; - - #pragma db transient - char* m2; -}; - -// Test database schema (aka database namespace). -// -#ifdef ODB_COMPILER -#if defined (ODB_DATABASE_MYSQL) -//# define DB_SCHEMA "odb_test" -# define DB_SCHEMA "" -#elif defined (ODB_DATABASE_SQLITE) -# define DB_SCHEMA "main" -#elif defined (ODB_DATABASE_PGSQL) -# define DB_SCHEMA "public" -#elif defined (ODB_DATABASE_ORACLE) -//# define DB_SCHEMA "ODB_TEST" -# define DB_SCHEMA "" -#elif defined(ODB_DATABASE_MSSQL) -# define DB_SCHEMA "dbo" -#else -# error unknown database -#endif -#endif - -namespace ns {typedef int my_int;} // Original. - -#pragma db object table(DB_SCHEMA."object_1") -struct object1 -{ - #pragma db id auto - unsigned long id; - - #pragma db column("str") - std::string str; -}; - -inline bool -operator== (const object1& x, const object1& y) -{ - return x.id == y.id && x.str == y.str; -} - -#pragma db namespace schema(DB_SCHEMA) -namespace ns // Extension. -{ - #pragma db object - struct object2 - { - object2 (): obj1 (0) {} - ~object2 () {delete obj1;} - - #pragma db id - std::string id; - - std::vector nums; - object1* obj1; - }; - - inline bool - operator== (const object2& x, const object2& y) - { - return x.id == y.id && x.nums == y.nums && *x.obj1 == *y.obj1; - } -} - -#pragma db view object(object1) object(ns::object2) -struct object_view -{ - #pragma db column(ns::object2::id) - std::string id2; - - std::string str; -}; - -#pragma db view table(DB_SCHEMA."schema_object_1") -struct table_view -{ - #pragma db column(DB_SCHEMA."schema_object_1"."str") - std::string str; -}; - -#endif // TEST_HXX diff --git a/common/schema/test.std b/common/schema/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1 From f4131327a7d768689b18dd9cc1c1c64fa6c21d1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Feb 2013 06:33:31 +0200 Subject: Misc fixes --- common/schema/embedded/order/makefile | 8 ++++---- common/schema/namespace/test.hxx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index b706345..8fe897f 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -63,10 +63,10 @@ $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(call vc11projs,$(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)) - $(call meta-vc11projs,../../../../template/template,$(name)) + $(call meta-automake,../../../template/Makefile.am) + $(call meta-vc9projs,../../../template/template,$(name)) + $(call meta-vc10projs,../../../template/template,$(name)) + $(call meta-vc11projs,../../../template/template,$(name)) # Test. # diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index 44d5c60..70b19aa 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -147,10 +147,10 @@ struct object_view std::string str; }; -#pragma db view table(DB_SCHEMA."schema_object_1") +#pragma db view table(DB_SCHEMA."schema_ns_object_1") struct table_view { - #pragma db column(DB_SCHEMA."schema_object_1"."str") + #pragma db column(DB_SCHEMA."schema_ns_object_1"."str") std::string str; }; -- cgit v1.1 From 261863a5037ba892ec33eb037d77736c8e599369 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Feb 2013 12:22:04 +0200 Subject: Test change-tracking container and reuse inheritance --- common/inheritance/reuse/driver.cxx | 54 +++++++++++++++++++++++++++++++++++++ common/inheritance/reuse/test.hxx | 12 ++++++--- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 78c2703..89a1926 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -29,51 +29,73 @@ main (int argc, char* argv[]) base b; b.comp_.bools.push_back (true); + b.comp_.obools.push_back (true); b.comp_.num = 10; b.comp_.str = "comp bbb"; b.comp_.nums.push_back (101); b.comp_.nums.push_back (102); + b.comp_.onums.push_back (101); + b.comp_.onums.push_back (102); b.num_ = 0; b.str_ = "bbb"; b.strs_.push_back ("bbb one"); b.strs_.push_back ("bbb two"); + b.ostrs_.push_back ("bbb one"); + b.ostrs_.push_back ("bbb two"); object1 o1; o1.comp_.bools.push_back (false); + o1.comp_.obools.push_back (false); o1.comp_.num = 11; o1.comp_.str = "comp o1o1o1"; o1.comp_.nums.push_back (111); o1.comp_.nums.push_back (112); + o1.comp_.onums.push_back (111); + o1.comp_.onums.push_back (112); static_cast (o1).num_ = 1; o1.num1_ = 21; o1.str_ = "base o1o1o1"; o1.strs_.push_back ("base o1o1o1 one"); o1.strs_.push_back ("base o1o1o1 two"); + o1.ostrs_.push_back ("base o1o1o1 one"); + o1.ostrs_.push_back ("base o1o1o1 two"); object2 o2; o2.comp_.bools.push_back (true); o2.comp_.bools.push_back (false); + o2.comp_.obools.push_back (true); + o2.comp_.obools.push_back (false); o2.comp_.num = 12; o2.comp_.str = "comp o2o2o2"; o2.comp_.nums.push_back (121); o2.comp_.nums.push_back (122); + o2.comp_.onums.push_back (121); + o2.comp_.onums.push_back (122); o2.num_ = 2; static_cast (o2).str_ = "base o2o2o2"; o2.str_ = "o2o2o2"; o2.strs_.push_back ("base o2o2o2 one"); o2.strs_.push_back ("base o2o2o2 two"); + o2.ostrs_.push_back ("base o2o2o2 one"); + o2.ostrs_.push_back ("base o2o2o2 two"); object3 o3; o3.comp_.bools.push_back (false); o3.comp_.bools.push_back (false); + o3.comp_.obools.push_back (false); + o3.comp_.obools.push_back (false); o3.comp_.num = 13; o3.comp_.str = "comp o3o3o3"; o3.comp_.nums.push_back (131); o3.comp_.nums.push_back (132); + o3.comp_.onums.push_back (131); + o3.comp_.onums.push_back (132); o3.num_ = 3; o3.str_ = "base o3o3o3"; o3.strs_.push_back ("base o3o3o3 one"); o3.strs_.push_back ("base o3o3o3 two"); + o3.ostrs_.push_back ("base o3o3o3 one"); + o3.ostrs_.push_back ("base o3o3o3 two"); reference r; r.o1_ = &o1; @@ -81,14 +103,20 @@ main (int argc, char* argv[]) empty e; e.comp_.bools.push_back (true); e.comp_.bools.push_back (true); + e.comp_.obools.push_back (true); + e.comp_.obools.push_back (true); e.comp_.num = 14; e.comp_.str = "comp eee"; e.comp_.nums.push_back (141); e.comp_.nums.push_back (142); + e.comp_.onums.push_back (141); + e.comp_.onums.push_back (142); e.num_ = 4; e.str_ = "base eee"; e.strs_.push_back ("base eee one"); e.strs_.push_back ("base eee two"); + e.ostrs_.push_back ("base eee one"); + e.ostrs_.push_back ("base eee two"); // persist // @@ -125,6 +153,19 @@ main (int argc, char* argv[]) delete lr->o1_; } + // update + // + { + transaction t (db->begin ()); + db->update (b); + db->update (o1); + db->update (o2); + db->update (o3); + db->update (r); + db->update (e); + t.commit (); + } + // query // { @@ -173,6 +214,19 @@ main (int argc, char* argv[]) t.commit (); } + + // erase + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (o1); + db->erase (o2); + db->erase (o3); + db->erase (r); + db->erase (e); + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 8222f97..2b566ef 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -9,16 +9,18 @@ #include #include +#include #pragma db value struct comp_base { std::vector bools; + odb::vector obools; bool operator== (const comp_base& y) const { - return bools == y.bools; + return bools == y.bools && obools == y.obools; } }; @@ -29,6 +31,7 @@ struct comp: comp_base std::string str; std::vector nums; + odb::vector onums; bool operator== (const comp& y) const @@ -37,7 +40,8 @@ struct comp: comp_base static_cast (*this) == y && num == y.num && str == y.str && - nums == y.nums; + nums == y.nums && + onums == y.onums; } }; @@ -50,6 +54,7 @@ struct abstract_base std::string str_; std::vector strs_; + odb::vector ostrs_; bool operator== (const abstract_base& y) const @@ -58,7 +63,8 @@ struct abstract_base comp_ == y.comp_ && num_ == y.num_ && str_ == y.str_ && - strs_ == y.strs_; + strs_ == y.strs_ && + ostrs_ == y.ostrs_; } }; -- cgit v1.1 From 42123e65fab590f5b052f53ad755fba9bded0c24 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Feb 2013 12:55:28 +0200 Subject: Add callback_ prefix to transaction callback functions Also test callback_update(). --- common/session/custom/session.cxx | 5 +++-- common/transaction/callback/driver.cxx | 33 +++++++++++++++++++++++++-------- common/transaction/callback/test.std | 2 ++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index 0009d79..d82ab3d 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -22,7 +22,7 @@ session:: // Unregister from transaction. // if (tran_ != 0) - tran_->unregister (this); + tran_->callback_unregister (this); assert (current == this); current = 0; @@ -44,7 +44,8 @@ flush (odb::database& db) if (flushed) { tran_ = &odb::transaction::current (); - tran_->register_ (&mark, this, odb::transaction::event_all, 0, &tran_); + tran_->callback_register ( + &mark, this, odb::transaction::event_all, 0, &tran_); } } diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index b74df4c..b4c3d85 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -27,17 +27,24 @@ struct callback register_ (transaction& t) { t_ = &t; - t.register_ (&func, this, transaction::event_all, v_, &t_); + t.callback_register (&func, this, transaction::event_all, v_, &t_); } void unregister () { cout << " unregister callback " << v_ << endl; - t_->unregister (this); + t_->callback_unregister (this); t_ = 0; } + void + update (unsigned short v) + { + v_ = v; + t_->callback_update (this, transaction::event_all, v_, &t_); + } + private: static void func (unsigned short event, void* key, unsigned long long data) @@ -87,10 +94,10 @@ fill (transaction& t) // 20 is from odb/transaction.hxx. // for (size_t i (0); i < 20; ++i) - t.register_ (&dummy_func, - reinterpret_cast (i), - transaction::event_all, - i); + t.callback_register (&dummy_func, + reinterpret_cast (i), + transaction::event_all, + i); } int @@ -150,7 +157,7 @@ main (int argc, char* argv[]) if (i == 2) fill (t); callback c1 (1, t); c1.unregister (); - t.unregister (&c1); // Test unregistering non-registered key. + t.callback_unregister (&c1); // Test unregistering non-registered key. t.commit (); } @@ -195,13 +202,23 @@ main (int argc, char* argv[]) transaction t (db->begin ()); if (i == 2) fill (t); callback c1 (1, t); - t.register_ (&throw_func, 0); + t.callback_register (&throw_func, 0); callback c2 (2, t); t.commit (); } catch (const failed&) { } + + // Test callback_update(). + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c (1, t); + c.update (2); + t.commit (); + } } } catch (const odb::exception& e) diff --git a/common/transaction/callback/test.std b/common/transaction/callback/test.std index f86579b..4298c1e 100644 --- a/common/transaction/callback/test.std +++ b/common/transaction/callback/test.std @@ -15,6 +15,7 @@ test 1/002 callback 3 commit test 1/003 callback 1 commit + callback 2 commit test 2/001 callback 1 commit callback 1 rollback @@ -32,3 +33,4 @@ test 2/002 callback 3 commit test 2/003 callback 1 commit + callback 2 commit -- cgit v1.1 From 9208de71c16ce8d676f9da1b71020c12384018c9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Feb 2013 18:21:32 +0200 Subject: Add schema_catalog::exists() function --- common/makefile | 1 + common/schema/embedded/basics/driver.cxx | 61 +++++++++++++++++ common/schema/embedded/basics/makefile | 114 +++++++++++++++++++++++++++++++ common/schema/embedded/basics/test.hxx | 24 +++++++ common/schema/embedded/basics/test.std | 0 common/schema/embedded/order/driver.cxx | 2 +- 6 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 common/schema/embedded/basics/driver.cxx create mode 100644 common/schema/embedded/basics/makefile create mode 100644 common/schema/embedded/basics/test.hxx create mode 100644 common/schema/embedded/basics/test.std diff --git a/common/makefile b/common/makefile index 551a0f8..502690e 100644 --- a/common/makefile +++ b/common/makefile @@ -40,6 +40,7 @@ readonly \ relationship \ relationship-query \ schema/namespace \ +schema/embedded/basics \ schema/embedded/order \ session/cache \ template \ diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx new file mode 100644 index 0000000..2e65b52 --- /dev/null +++ b/common/schema/embedded/basics/driver.cxx @@ -0,0 +1,61 @@ +// file : common/schema/embedded/basics/driver.cxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic embedded schema functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for SQLite. + // +#if defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=OFF"); +#endif + + assert (schema_catalog::exists (*db, "test")); + assert (!schema_catalog::exists (*db, "test1")); + assert (!schema_catalog::exists (*db, "")); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db, "test"); + t.commit (); + +#if defined(DATABASE_SQLITE) + c->execute ("PRAGMA foreign_keys=ON"); +#endif + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile new file mode 100644 index 0000000..d134ba1 --- /dev/null +++ b/common/schema/embedded/basics/makefile @@ -0,0 +1,114 @@ +# file : common/schema/embedded/basics/makefile +# copyright : Copyright (c) 2009-2012 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) --generate-schema \ +--schema-format embedded --schema-name test --table-prefix schema_embd_bscs_ +$(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)) $(call vc11projs,$(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)) + $(call meta-vc11projs,../../../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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx new file mode 100644 index 0000000..99e1aac --- /dev/null +++ b/common/schema/embedded/basics/test.hxx @@ -0,0 +1,24 @@ +// file : common/schema/embedded/basics/test.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db object +struct object +{ + #pragma db auto id + unsigned long id; + + std::string str; + + std::vector nums; +}; + +#endif // TEST_HXX diff --git a/common/schema/embedded/basics/test.std b/common/schema/embedded/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index 7503cf5..78de801 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -30,7 +30,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); // Create the database schema. // -- cgit v1.1 From e5df4d02dad94caaaae590ac6ea803a44d6179ca Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Feb 2013 10:03:20 +0200 Subject: Shorten table prefix for Oracle --- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/transient/makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 744c688..fe09af6 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --table-prefix inherit_p_ +--generate-query --generate-prepared --table-prefix inhrt_p_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index a02edd2..b517b49 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inherit_r_ +--generate-query --table-prefix inhrt_r_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index e6dd6d8..3b9ac45 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -35,7 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inherit_t_ +--generate-query --table-prefix inhrt_t_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From 73ec71168651c90160635fa9c990edc716c0dd34 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Feb 2013 10:05:31 +0200 Subject: Escape m4 macro --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index baa5573..4291806 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([common/template/driver.cxx]) AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) -m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. +m4_equote()[m4_ifdef]m4_dquote()([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. LT_INIT([win32-dll]) -- cgit v1.1 From d56f7077de2a985b9e105df3fd70253381a01401 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Feb 2013 10:19:19 +0200 Subject: Update copyright year --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/multi-index/driver.cxx | 2 +- boost/common/multi-index/makefile | 2 +- boost/common/multi-index/test.hxx | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/common/uuid/driver.cxx | 2 +- boost/common/uuid/makefile | 2 +- boost/common/uuid/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/access/driver.cxx | 2 +- common/access/makefile | 2 +- common/access/test.hxx | 2 +- common/auto/driver.cxx | 2 +- common/auto/makefile | 2 +- common/auto/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/circular/multiple/driver.cxx | 2 +- common/circular/multiple/makefile | 2 +- common/circular/multiple/test1.hxx | 2 +- common/circular/multiple/test2.hxx | 2 +- common/circular/single/driver.cxx | 2 +- common/circular/single/makefile | 2 +- common/circular/single/test.hxx | 2 +- common/composite-id/driver.cxx | 2 +- common/composite-id/makefile | 2 +- common/composite-id/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/basics/driver.cxx | 2 +- common/container/basics/makefile | 2 +- common/container/basics/test.hxx | 2 +- common/container/change-tracking/driver.cxx | 2 +- common/container/change-tracking/makefile | 2 +- common/container/change-tracking/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/definition/driver.cxx | 2 +- common/definition/makefile | 2 +- common/definition/test.hxx | 2 +- common/definition/time-mapping.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/index/driver.cxx | 2 +- common/index/makefile | 2 +- common/index/test.hxx | 2 +- common/inheritance/polymorphism/driver.cxx | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test1.hxx | 2 +- common/inheritance/polymorphism/test10.hxx | 2 +- common/inheritance/polymorphism/test11.hxx | 2 +- common/inheritance/polymorphism/test12.hxx | 2 +- common/inheritance/polymorphism/test2.hxx | 2 +- common/inheritance/polymorphism/test3.hxx | 2 +- common/inheritance/polymorphism/test4.hxx | 2 +- common/inheritance/polymorphism/test5.hxx | 2 +- common/inheritance/polymorphism/test6.hxx | 2 +- common/inheritance/polymorphism/test7.hxx | 2 +- common/inheritance/polymorphism/test8.hxx | 2 +- common/inheritance/polymorphism/test9.hxx | 2 +- common/inheritance/reuse/driver.cxx | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/transient/driver.cxx | 2 +- common/inheritance/transient/makefile | 2 +- common/inheritance/transient/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/prepared/driver.cxx | 2 +- common/prepared/makefile | 2 +- common/prepared/test.hxx | 2 +- common/query/array/driver.cxx | 2 +- common/query/array/makefile | 2 +- common/query/array/test.hxx | 2 +- common/query/basics/driver.cxx | 2 +- common/query/basics/makefile | 2 +- common/query/basics/test.hxx | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship-query/driver.cxx | 2 +- common/relationship-query/makefile | 2 +- common/relationship-query/test.hxx | 2 +- common/relationship/driver.cxx | 2 +- common/relationship/makefile | 2 +- common/relationship/test.hxx | 2 +- common/schema/embedded/basics/driver.cxx | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/basics/test.hxx | 2 +- common/schema/embedded/order/driver.cxx | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/embedded/order/test1.hxx | 2 +- common/schema/embedded/order/test2.hxx | 2 +- common/schema/namespace/driver.cxx | 2 +- common/schema/namespace/makefile | 2 +- common/schema/namespace/test.hxx | 2 +- common/session/cache/driver.cxx | 2 +- common/session/cache/makefile | 2 +- common/session/cache/test.hxx | 2 +- common/session/custom/driver.cxx | 2 +- common/session/custom/makefile | 2 +- common/session/custom/session.cxx | 2 +- common/session/custom/session.hxx | 2 +- common/session/custom/session.txx | 2 +- common/session/custom/test.hxx | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/basics/driver.cxx | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/driver.cxx | 2 +- common/transaction/callback/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/driver.cxx | 2 +- common/view/makefile | 2 +- common/view/test.hxx | 2 +- common/virtual/driver.cxx | 2 +- common/virtual/makefile | 2 +- common/virtual/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/c++11.m4 | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/custom/driver.cxx | 2 +- mssql/custom/makefile | 2 +- mssql/custom/query.hxx | 2 +- mssql/custom/test.hxx | 2 +- mssql/custom/traits.hxx | 2 +- mssql/database/driver.cxx | 2 +- mssql/database/makefile | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/custom/driver.cxx | 2 +- mysql/custom/makefile | 2 +- mysql/custom/query.hxx | 2 +- mysql/custom/test.hxx | 2 +- mysql/custom/traits.hxx | 2 +- mysql/database/driver.cxx | 2 +- mysql/database/makefile | 2 +- mysql/index/driver.cxx | 2 +- mysql/index/makefile | 2 +- mysql/index/test.hxx | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/custom/driver.cxx | 2 +- oracle/custom/makefile | 2 +- oracle/custom/test.hxx | 2 +- oracle/custom/traits.hxx | 2 +- oracle/database/driver.cxx | 2 +- oracle/database/makefile | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/custom/driver.cxx | 2 +- pgsql/custom/makefile | 2 +- pgsql/custom/query.hxx | 2 +- pgsql/custom/test.hxx | 2 +- pgsql/custom/traits.hxx | 2 +- pgsql/database/driver.cxx | 2 +- pgsql/database/makefile | 2 +- pgsql/index/driver.cxx | 2 +- pgsql/index/makefile | 2 +- pgsql/index/test.hxx | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/basic/driver.cxx | 2 +- qt/common/basic/makefile | 2 +- qt/common/basic/test.hxx | 2 +- qt/common/containers/basics/driver.cxx | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/basics/test.hxx | 2 +- qt/common/containers/change-tracking/driver.cxx | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/containers/change-tracking/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/custom/driver.cxx | 2 +- sqlite/custom/makefile | 2 +- sqlite/custom/test.hxx | 2 +- sqlite/database/driver.cxx | 2 +- sqlite/database/makefile | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 546 files changed, 546 insertions(+), 546 deletions(-) diff --git a/Makefile.am b/Makefile.am index 831f993..ed99581 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common diff --git a/boost/Makefile.am b/boost/Makefile.am index 86d1701..f218a4e 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index d9a2e4f..07876be 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index 53d4fd6..a52dc66 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index c85a808..266d9b9 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index 662ffb2..f0b47a8 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 9ffdb0f..de891e6 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,5 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index 4018b61..4ca3191 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index c32edb2..d14921e 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 3f3c1e8..f46c931 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 915afc6..7baf380 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index 906efa2..bd51298 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 18eeceb..d183e0b 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 93b53a3..049ec31 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index d242a61..f136cff 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index d754acf..147da34 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index d9dc969..a3cf2c7 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index 8c89b4f..f6ee513 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index ee8dcd2..16cdcb6 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 8a6589f..538772a 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index e50f3a7..471944b 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 17e4e0e..41517ca 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index 952890f..e72dc93 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 6d89098..9379b6a 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,5 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index d0138e4..684513c 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index a7430c7..264655a 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index c0fc1c4..c958291 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index 4164174..3f8999f 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 7c267a0..a085b11 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index 505d1c1..34f2ca3 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 145bb34..81c0ebb 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 5f194a7..3488804 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 212c5b5..14ad0f1 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 2d03374..1d7c4c8 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index 84e5bcc..3746583 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index 4b73df6..1f5b2e7 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index ad4ad3a..12bd942 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index d90310d..49d94b7 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 19e7ccf..e136fcf 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index dcfb20b..6244177 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 217c902..069d6e0 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index c7305cc..6ba944c 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index da31a63..0f9236a 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 3753564..2ef239a 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index cb901fc..ce207a9 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 603d4df..1e349d1 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 1b65c84..ce4e1e6 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index a1a12fb..7247220 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index c94ca46..4c7b3fc 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index e7afe8f..0912dc6 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 18f5179..3294e24 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 3eec093..91444dd 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index c4aa21d..6ecde1b 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index d98a808..50b6be4 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 8251a6d..924b4bb 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index a17ecd6..2d13c75 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index c925995..09e068d 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index afd4657..7e65791 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 5d812bc..a60f648 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index b197037..3541a10 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 8f3d4ae..94e993f 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 24a0206..6fab9cc 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 0c1b33d..de6b3c8 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 35ec75b..c27ffad 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 605bc5b..22d26a1 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 835bcda..0453bc3 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index a98bfa2..b167423 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index c719fc7..8aab2d6 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 99c1761..a61f077 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index afff640..660a401 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 0bb7672..e76501d 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index ba7b102..0a7f915 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index 0959213..d0594b7 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index ccbdf3f..1001473 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index a4e938a..cea28f0 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index 52f2228..ee57c6f 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index 39910bb..b1b4f3d 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index 421a307..0f55142 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 3cde55f..cabe15c 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 3a3051b..5576495 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index 622c2b9..f843b05 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 7125e52..aecf319 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 8d5737e..61ad49f 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index d5e6a9f..ef39001 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index d184b72..f6ae20d 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index 8b9a5bd..c3508c1 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index a54a446..f88fc34 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index b92076f..bd90cf6 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index eecd4e1..97094b8 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index ea786da..0cb9466 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index f0f10f3..4cac27e 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 3f7549f..701b58a 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index 3ad6b90..1952f07 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 020617d..419c86d 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index b399190..6e0de0c 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index 2b62914..06d5da4 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index 8a731b7..b610119 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index 2541bb9..d2beb6b 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 0afcec2..1339fbc 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 7119fa6..7a62a09 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index fdc71dd..a041f8c 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 7830bb5..25c6eb0 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index 86596b6..ab13e37 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index c40da43..034a8db 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index f1e39ad..8eed8ac 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index abb2680..1a34cdf 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index f5787e8..5981921 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index cf14ccd..41b07f4 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 872aa63..956d037 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 1fe7152..b25ddbb 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 1217fee..cbf9f7d 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 65ac80b..90eb372 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 03fb341..63efaf8 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 2350822..cd02836 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index a6d102c..c54e996 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 464b0ab..d71790a 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 9839d51..525d633 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index 7aa5a68..f7933cc 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index a416cf8..86c98fe 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index e793478..e71fd4f 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 24b9644..33fbf7b 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index 39b613e..4520816 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index f76ceea..afbf849 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index 6eb9178..d5c7d6f 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index c643451..bcd3c6c 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index ccff3af..b6d99de 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index 9d70583..2e78a13 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index e12ced3..6cdb952 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index 0111c94..75a4773 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index 1b0c91e..ddbd35d 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 79c63bf..4ec8433 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,5 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index 7381beb..d3d4438 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,5 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index 8e1c209..4073766 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,5 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 54ca735..3482e45 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/auto/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/auto/makefile b/common/auto/makefile index 7b9321f..baaf756 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -1,5 +1,5 @@ # file : common/auto/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 1234720..61fbcc6 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/auto/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index ec507ce..b56bc64 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index cdf35f7..82d6523 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 5d88d8b..0bfd29c 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index a43fa03..0597645 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index 5538707..7f0e8aa 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index 99d7089..b913cbd 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index 1b80218..cc730be 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 0ad17d6..5093f56 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,5 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index 5ba4b92..967b0a4 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index 8f6ae5e..e5215c3 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index e4b0be6..dec9041 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 955a81e..81c01a7 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,5 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 8dd39fe..3f0d0dc 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,5 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx index 8a230eb..86d13b0 100644 --- a/common/composite-id/driver.cxx +++ b/common/composite-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite-id/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 25970aa..3c557ed 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -1,5 +1,5 @@ # file : common/composite-id/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index 9c2b2b3..a2773d0 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -1,5 +1,5 @@ // file : common/composite-id/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index a7bc26e..0d61a3c 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 015f2b8..92da67f 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index fe578cb..040d39c 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index 06b4798..d2a8094 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index 8c8b932..8e1780e 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index f89c878..d5529d3 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 1bf66d8..82aced4 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index 1826dbe..38881fa 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index feb0040..22a3b26 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index b50ab5a..b880b56 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 58feb3b..29d70bb 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,5 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index e88edd9..517da0a 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index 98d711c..b4f09ad 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index ffd149c..9135405 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,5 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 0387faf..6281322 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index d74c44d..3054e97 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index 4b79e2c..1290cb2 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 234119d..3c5107d 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 49677c2..515cb38 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index 653b395..82e268f 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index 091b91a..5980003 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index d23b9e2..debd86f 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,5 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index 11b8d94..a7c87e6 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,5 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index 51a5029..2d3e792 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,5 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index d55159d..409dba1 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,5 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index cbc8192..6cc41af 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index a69e3f0..ce2e6c2 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index bf6121e..c1609fd 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 5bfa6a7..6c69bfc 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index caac9cc..7856090 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 8cc47ee..e4ba0f8 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index fc86730..a368620 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index 7320605..3a74738 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index 50ca970..c7c8e4d 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index 63c7e0f..11d8433 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index df85700..1c7b7e6 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index d6d83cf..7165276 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index f7b711a..ed0c07f 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 9831ee8..950f5e8 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index f9a18c2..595d133 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index 4db3caa..2687b2a 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 51e492b..8800252 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 6aaf47c..13dfc94 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 8eaf3f7..c35e1f4 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index 175aaee..c5c91c1 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,5 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index ddc9f11..c412619 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,5 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index 5948365..d6cfe65 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,5 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 4f18c15..cd0c02e 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index fe09af6..f2131f4 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index f3015cd..1e784e2 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index d534498..146545c 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index 0622c37..74d1578 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index 94054ce..f822ed2 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index a238190..e2905b0 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index c219bfc..9de72a5 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index b268548..22ccb9b 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index ecc92ad..54b8fd1 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index a40d8c1..1b2709a 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index 10f604f..9e99149 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index ee5829a..b07248a 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index b059464..51719ac 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 89a1926..a684896 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index b517b49..6541680 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 2b566ef..b0130c4 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index 099506b..c0c5ca7 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 3b9ac45..4e1ad99 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index df5d0c1..851168d 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index a88ceee..974cab2 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index 0f17e8c..ed5f1f9 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 83b6a3c..3e9d384 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index ffe692c..cc7835c 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index f3bcd76..e4424ec 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 2813c50..434b7d6 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index efe50b5..3806e86 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 0fffed1..0959a83 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index fca0320..5800090 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index 502690e..e6eca1e 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index b613f0c..b9f98ca 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 04f8b03..3c4a4aa 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 5e86c31..5602e6a 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 2ee15b8..84e72f9 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 9042931..57836d3 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 9363d22..df753c4 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 1d31134..0217fcb 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index d576667..4ce8294 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index cbe46b8..aee3f8b 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 1b4ad0e..5c622c0 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,5 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index 4126b54..09a27cb 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,5 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 7ea0ce8..c6e2c1e 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,5 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index c71c25a..c449566 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index 817828f..296e9a2 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,5 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index 32ee413..e086a44 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,5 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index 686b4b6..a87a0b0 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index 0be5352..e5ae0d1 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,5 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index f572d75..1fd86dc 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 991e000..e97a0cb 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index 822bf0e..f0a0fcc 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 0b73d94..2b3d8ef 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx index 94a6141..785aa94 100644 --- a/common/relationship-query/driver.cxx +++ b/common/relationship-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 617c1dd..c8157c5 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx index 671c849..b2f9568 100644 --- a/common/relationship-query/test.hxx +++ b/common/relationship-query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index c6f4b01..127a894 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/makefile b/common/relationship/makefile index c3b3c66..9a8ce7d 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -1,5 +1,5 @@ # file : common/relationship/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index 5383db6..ecfd6a3 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 2e65b52..5a14149 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index d134ba1..2feb937 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index 99e1aac..b5e08ff 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index 78de801..63d9c35 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 8fe897f..941e183 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index d7e0622..1e01ebf 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index 870ca51..0d9f005 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index d74461c..45ebaa9 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index e15ee10..370d6ca 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,5 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index 70b19aa..351b574 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 9487afa..114d0ac 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index cbbf600..5309cd9 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,5 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index ff59249..a801db2 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,5 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 1b00ada..2baa122 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index f989a76..5d998ac 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,5 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index d82ab3d..64fea10 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index b0a6694..cda0258 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index de1f3f0..803a27b 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,5 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index 1c4a713..ffcd518 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 0aa8f83..3571bc2 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index d4f62fc..2379d46 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index bbb65f1..e589b35 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index bf3545c..3d2f481 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 0b47bb4..6fd6ffb 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 3f7f171..0714d4a 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index a9f2a66..02dc303 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index dff900a..8619f2e 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index 984e9e8..a2faaea 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index dbee915..23932d1 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,5 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index b4c3d85..c65b695 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 936a02d..2ccadcd 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,5 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 24105a3..136bfca 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index 5df5a0a..54c6ba3 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index b7813de..97c4776 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/driver.cxx b/common/view/driver.cxx index e000e06..b8a8f3e 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test views. diff --git a/common/view/makefile b/common/view/makefile index bb78891..097ae7d 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -1,5 +1,5 @@ # file : common/view/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/view/test.hxx b/common/view/test.hxx index 04b8cef..f9bc8e8 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -1,5 +1,5 @@ // file : common/view/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index 1083cab..5bac449 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,5 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index a5d24f9..c7d5f3f 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,5 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index a6caf2c..8d66cde 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,5 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index b434dba..6aa0f05 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 79d39d9..5e7e5ff 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index f308409..fc08bf9 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 4291806..9dc69be 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index da72069..f610ac0 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 38862f3..8b59116 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 9674c70..44d58c3 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 24238a5..65fbcfe 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 0d56d7c..114dbdd 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index 5c40520..fafd9bc 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 0d91172..3141ba4 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index d2e631d..1f05206 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index ed600ac..1bf49fb 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 14644f7..da45841 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 09f305d..94a6666 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index e6fc755..53df875 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index c64ab99..9d9b6e9 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 5df020f..889f510 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,5 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index 83a3154..b454d9b 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 3762641..7f9ba5a 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index c8132eb..b43f9f0 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 8ce86d1..fb0f840 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index 578a2f2..64ec0f4 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index cbac417..88a441e 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 6302368..2a410db 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index e50c65f..0fec6bd 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index f0a1a0e..b80cbcc 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index fd5f3d0..59c1702 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 7d3130b..9ce2580 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 0e96da8..9ffa609 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index adecac1..c4972db 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index 89fa30c..dea9b98 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index b0c1b98..6efc2b7 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index c13f559..7574ca7 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index a46139b..920e981 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 464d8d9..29d7433 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 318a873..9dc616a 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 6e0f45b..99c4a82 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index 4cd4c05..9a7da53 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 5df00a1..561293f 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 1fdc6aa..1391a20 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index e47e3bd..562e6b1 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index ef043a8..2563560 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 3e69f97..142d35c 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 9945c44..94be7b2 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,5 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index 0c5f1f2..d2e29e6 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 5548baa..6f44a77 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index 34081ed..421f288 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 47a1559..2dd4fec 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index 1d8848d..c9e2c59 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,5 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index 0708fb0..df8e9c1 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 710c3c5..588b3fd 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index 3a09c6c..17ff8a5 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index 03b3284..bb0b740 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index cd3a457..98d1f68 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index ae1a76e..7f1c1f6 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 500c758..4e7904a 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 26488fc..9e6b481 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index 441e45d..2218018 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index 805312b..7eca09b 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index 74d692a..2fbfb34 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 6276bab..1c2d7d8 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index fcac4f3..eeb9d8b 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 884db35..82f8147 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index 659a89e..725e449 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index 3b09c12..0dbb6dc 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 49bac08..a51fee2 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index 83aac7e..95b3517 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 7700323..91c0a89 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,5 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index ccd00e7..ad607b1 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index 5d739a1..510082b 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index bf4ceb4..45eee48 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index f385b3f..bdafff1 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index d6d9787..ef3e673 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,5 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index 3b1a1af..ac8b6e6 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index c594679..d3e7740 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,5 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index 65870ff..ea12559 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index eec0791..e657da7 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 9eaf504..2912a91 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index 4a43cc4..ce0a283 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 0ba50ba..1e7e7a7 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 0789891..7d9ff71 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 6bb505f..c4afa1e 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index 48d084d..ce6436e 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index 1cd54e2..81f3864 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index da870d0..df69b5e 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 95f951b..0825d67 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index b1aae1a..03bb120 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 0a7155e..07487a2 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 0770d8b..ef1fe9f 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index bc4c773..73160c2 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index c437faa..f1d98b7 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index c400abd..0727ae5 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index e4c46c3..69b8ec0 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index 16b81da..827ba74 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index b3d5e15..866b4e2 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,5 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index cc46512..cc1482b 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,5 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index 8f3e81e..1797e05 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index 53dda69..dd3c96f 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 862b08e..6b0e4af 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,5 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index 9c9b143..0033d89 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 9530692..8eb673c 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index 1fa5fe5..5137a8a 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 135eb4e..3ad710e 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 35a2b39..68206dc 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index c931305..19e8a34 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index c642aef..bcfb71e 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 1a3ed8e..093fe27 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 6370e44..ab7ae24 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index df6fefa..d303cea 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 51665c9..a3dac3f 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 51ff2e2..edd790a 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index f840511..8d131b0 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index ea93c9c..5a7e21b 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index 7188f74..30a4c83 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 4cdc1a2..27a4a34 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,5 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index 432d25b..fa8c7da 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index 68b6dd6..ab6de49 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index 800bfdb..bcc5a16 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 68c34ab..b6c0af5 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 268af78..f112d4d 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,5 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 4c46b58..185cfde 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index cb898f2..89b6f09 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,5 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index 8635eec..be55f82 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index 320d2b5..1111993 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 3e4b680..551e266 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 02aabe6..8f64144 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 0d632cc..91fb3c3 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 9297ab0..54acbbc 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index f62cd55..f556c26 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 7f7bb99..5361b4a 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index fb0389e..3950954 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index fe72780..8133dcd 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 63300c2..055aa6f 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 531cbfa..338b198 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index d2e5e80..9fb4e20 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 2a8cd93..eb173ec 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 3078576..d6fdcf0 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 10dcb24..487ba11 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index be36c0a..f038f76 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index 1d82cf9..fa0f96b 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 60826ae..6ea7818 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index 5a31674..2aa5a90 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 40e210e..82500c4 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,5 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index 3c7cb28..637130d 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index 1d22962..f422084 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 887df7f..975c2c7 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index 204d0f9..7160d88 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 15dd825..05f885f 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index b330f8a..f957328 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index 7ad230e..f66ac6b 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index 6132c7b..1544fff 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 28ad9a2..a8a41bb 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index d1cb02d..d504bc3 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index a3c3b94..2fe8d7c 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index 4101392..80ef463 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 0cdf655..32dfd8d 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 140cb07..372cb1e 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index 2ccb3ef..d0e49f2 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index eabcd0a..bddd22d 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index 0c6af5f..6050ec1 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index b3c6307..872333c 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index df12334..43da7d6 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index f522057..4fe510b 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index c75153c..246ef51 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 00ae30e..4557993 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 5f4fe2d..c1fcc99 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index bb31af5..2fa3c42 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index e8c52c4..5f8f9a9 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index f05c501..e83b262 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index b07f8b1..bf0f0da 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 7b4df59..c047418 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index 9e94dad..4eb2d95 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index 32e22e7..f513008 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index f84cca0..3350019 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index 68d998a..22cdece 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index cb8eb03..73c54c1 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index a91f3cb..5b6eba8 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 19b28df..57eab2c 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 54d2c3e..59ad1ed 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 09c44ba..7e58376 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index c3d40cb..97ac45d 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 55c7643..e56f493 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index ac95bb9..fbdc152 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 3bb815f..c45aa0d 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index 4f9d094..cc82492 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index 7e17e86..a5de2e3 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index 7b45bdc..a3117bd 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 8c8f192..a570d74 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index b04da93..4625fbc 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 9269954..a594c68 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 20fe9db..1a567c0 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index f377109..e5f0bbd 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 45ccfd9..ea9c446 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 488f6b1..8ae7df9 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index df3e7c4..e1d2f20 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index e626c4b..a266696 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index aecc38c..5f1a392 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index b840a29..b88591c 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index 066836e..145f71c 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index aef28e9..3a9a9ca 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 9e0fa4d..1dabff3 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 7661ae2..7699006 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index da594ec..cf8c2c3 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index 4ceaed8..8203678 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index ef27e40..25a279b 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index f9edcbe..fe7b712 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index e70178d..fb89608 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 18fe499..91ca8a4 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 27d83ba..ede32b0 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index d495251..d22ca13 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index c0ece6b..b92540e 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index 5364b03..233fe49 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 2d89d3b..72468fc 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 2cff023..ea53627 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index dd8060e..4457e60 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 542c179..be2d9ec 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 5c18a51..1c46a64 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 0bff04a..586ee90 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 9c9235a..d9b0b43 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 3db3efb..ccf700a 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index d6a565a..4690850 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 6b368b1..3f34418 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index d04ae42..8577e54 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index 4900420..42878d5 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index 794653c..fe06460 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 9b81766..08d5e72 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index d189767..080146d 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index d61dc95..ffc1836 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,5 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index ea20912..af0ee93 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index 6e09d30..c5a09f4 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 3f567c9..6f5c1c8 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,5 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index 8f1648c..1d87470 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 91b04e6..defecea 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 763bed9..b9418ef 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 5d9d107..bd2d007 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index c7979df..b2035d4 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 4341cc8..a9453d4 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index 2b961f3..f001379 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index 2629151..89b55a9 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 70fde25..136b503 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 9fedbd1..ccc80fa 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 9f7023d..b921288 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 4e619fb..1e148e0 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 0dbdee4..a588db4 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index a19cd20..3407218 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 7a58946..4d74869 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index 7662f68..bb7b3a9 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index 9cee8ea..95513fd 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index 2fa3caf..c9873d4 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From c2a6956f4ccced9cb9bd890295e48d95461de922 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Feb 2013 10:33:14 +0200 Subject: Bump version to 2.2.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 90d185b..ccbccc3 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.0.a3 +2.2.0 -- cgit v1.1 From cdd4d1ad5df91ebac5fc117cba57469c83e467a6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Feb 2013 14:19:08 +0200 Subject: Make generated files depend on config.h to enforce order --- build/bootstrap.make | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index cabe15c..cef108e 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -127,15 +127,22 @@ endif # To do this we make the object files ($2) depend in order-only on # generated files ($3). # +# Also make generated files depend on config.h so that we don't get +# annoying noise during dependency auto-generation. +# ifeq ($(cxx_id),generic) define include-dep -$(if $2,$(eval $2: | $3)) +$(if $2,$(eval $2: | $3)) \ +$(if $(and $3,$(subst $(out_root)/libcommon/common/config.h,,$3)),$(eval \ +$3: $(out_root)/libcommon/common/config.h)) endef else define include-dep +$(if $(and $3,$(subst $(out_root)/libcommon/common/config.h,,$3)),$(eval \ +$3: $(out_root)/libcommon/common/config.h)) \ $(call -include,$1) endef -- cgit v1.1 From 0b983110372926a6ee96ef97fb5779aa4a6d12fa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Feb 2013 10:15:34 +0200 Subject: Detect POSIX threads on MinGW-W64 --- m4/threads.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/m4/threads.m4 b/m4/threads.m4 index 9a7da53..1609a04 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -22,7 +22,16 @@ if test x$threads = xcheck; then CXXFLAGS="$CXXFLAGS -mthreads" ;; esac - threads=win32 + + # Newer versions of GCC can be configured to use either Win32 or POSIX + # threads. It appears that -mthreads should be used in both cases but + # if the model is POSIX then GCC will also link -lpthread by default. + # Use that fact to test which model we have. + # + AC_TRY_LINK([#include ], + [pthread_create(0,0,0,0);], + [threads=posix], + [threads=win32]) ;; *) ACX_PTHREAD -- cgit v1.1 From 72d6556cc3b71517f55bd5938d4f272de794892b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Feb 2013 13:07:12 +0200 Subject: Fix bugs in Qt build batch file --- qt/build.bat | 256 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/qt/build.bat b/qt/build.bat index fa0f96b..b9c988b 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,128 +1,128 @@ -@echo off -rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Build Qt tests using the VC++ batch mode compilation. -rem -rem build.bat database qt-version vc-version conf plat [/Build|/Clean|/Rebuild] -rem -rem conf: {Debug,Release}|all -rem plat: {Win32,x64}|all -rem - -setlocal - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -if "_%2_" == "__" ( - echo no Qt version specified - goto usage -) - -if "_%3_" == "__" ( - echo no VC++ version specified - goto usage -) - -if "_%~4_" == "__" ( - echo no configuration specified - goto usage -) - -if "_%~5_" == "__" ( - echo no platform specified - goto usage -) - -set "failed=" - -if "_%2_" == "_4_" set "qtver=4" -if "_%2_" == "_5_" set "qtver=5" - -if "_%qtver%_" == "__" ( - echo unknown Qt version %2 - goto usage -) - -if "_%3_" == "_9_" set "vcver=9" -if "_%3_" == "_10_" set "vcver=10" -if "_%3_" == "_11_" set "vcver=11" - -if "_%vcver%_" == "__" ( - echo unknown VC++ version %2 - goto usage -) - -set "confs=%~3" -set "plats=%~4" - -if "_%confs%_" == "_all_" set "confs=__path__(configurations)" -if "_%plats%_" == "_all_" set "plats=__path__(platforms)" - -set "action=%5" -if "_%action%_" == "__" set "action=/Build" - -set "devenv=%DEVENV%" -if "_%devenv%_" == "__" set "devenv=devenv.com" - -goto start - -rem -rem %1 - solution name -rem %2 - configuration to build -rem %3 - platform to build -rem -:run_build - echo. - echo building qt/%1 %3 %2 - "%devenv%" %1 %action% "%2|%3" 2>&1 - if errorlevel 1 set "failed=%failed% qt/%1\%3\%2" -goto :eof - -:start - -for %%d in (%1) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build %%d/qt-%%d-qt%qtver%-vc%vcver%.sln %%c %%p - ) - ) -) - -for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build common/qt-common-qt%qtver%-%1-vc%vcver%.sln %%c %%p - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL BUILDS SUCCEEDED -echo. -goto end - -:usage -echo. -echo usage: build.bat database qt-version vc-version conf plat [action] -echo valid configurations are: {Debug,Release}|all -echo valid platforms are: {Win32,x64}|all -echo valid actions are: /Build (default), /Clean, and /Rebuild -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal +@echo off +rem file : qt/build.bat +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem Build Qt tests using the VC++ batch mode compilation. +rem +rem build.bat database qt-version vc-version conf plat [/Build|/Clean|/Rebuild] +rem +rem conf: {Debug,Release}|all +rem plat: {Win32,x64}|all +rem + +setlocal + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +if "_%2_" == "__" ( + echo no Qt version specified + goto usage +) + +if "_%3_" == "__" ( + echo no VC++ version specified + goto usage +) + +if "_%~4_" == "__" ( + echo no configuration specified + goto usage +) + +if "_%~5_" == "__" ( + echo no platform specified + goto usage +) + +set "failed=" + +if "_%2_" == "_4_" set "qtver=4" +if "_%2_" == "_5_" set "qtver=5" + +if "_%qtver%_" == "__" ( + echo unknown Qt version %2 + goto usage +) + +if "_%3_" == "_9_" set "vcver=9" +if "_%3_" == "_10_" set "vcver=10" +if "_%3_" == "_11_" set "vcver=11" + +if "_%vcver%_" == "__" ( + echo unknown VC++ version %3 + goto usage +) + +set "confs=%~4" +set "plats=%~5" + +if "_%confs%_" == "_all_" set "confs=Debug Release" +if "_%plats%_" == "_all_" set "plats=Win32 x64" + +set "action=%6" +if "_%action%_" == "__" set "action=/Build" + +set "devenv=%DEVENV%" +if "_%devenv%_" == "__" set "devenv=devenv.com" + +goto start + +rem +rem %1 - solution name +rem %2 - configuration to build +rem %3 - platform to build +rem +:run_build + echo. + echo building qt/%1 %3 %2 + "%devenv%" %1 %action% "%2|%3" 2>&1 + if errorlevel 1 set "failed=%failed% qt/%1\%3\%2" +goto :eof + +:start + +for %%d in (%1) do ( + for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_build %%d/qt-%%d-qt%qtver%-vc%vcver%.sln %%c %%p + ) + ) +) + +for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_build common/qt-common-qt%qtver%-%1-vc%vcver%.sln %%c %%p + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL BUILDS SUCCEEDED +echo. +goto end + +:usage +echo. +echo usage: build.bat database qt-version vc-version conf plat [action] +echo valid configurations are: {Debug,Release}|all +echo valid platforms are: {Win32,x64}|all +echo valid actions are: /Build (default), /Clean, and /Rebuild +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal -- cgit v1.1 From f05b0f063942a65f7a9c04609b9e5b7aa3b6a89c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Feb 2013 13:07:36 +0200 Subject: Account for C++11 compilers without default function template arguments --- common/session/custom/driver.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 2baa122..ab111b2 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -14,6 +14,7 @@ #include #include #include +#include // ODB_CXX11_* #include @@ -88,7 +89,11 @@ main (int argc, char* argv[]) transaction t (db->begin ()); st = db->load ("Simple Tech Ltd"); +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT ste = db->load (st->employees ()[0].object_id ()); +#else + ste = db->load (st->employees ()[0].object_id ()); +#endif // Test object cache. // @@ -103,7 +108,11 @@ main (int argc, char* argv[]) transaction t (db->begin ()); cs = db->load ("Complex Systems Inc"); +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT cse = db->load (cs->employees ()[0].object_id ()); +#else + cse = db->load (cs->employees ()[0].object_id ()); +#endif cs->employees ()[0].load (); t.commit (); -- cgit v1.1 From b0700a1895268de34afb11a67c39434ed87ec36f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Feb 2013 13:08:52 +0200 Subject: Add extra source to dist --- common/session/custom/makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 5d998ac..89d2296 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -54,6 +54,7 @@ $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := session.hxx session.txx +$(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -- cgit v1.1 From 7c1756cacfff6e8e9c19d1aa8477447bc2c02805 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Feb 2013 13:10:15 +0200 Subject: QList::swap(Qlist) is only available since Qt 4.8 --- qt/common/containers/change-tracking/driver.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 05f885f..c77947f 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -558,6 +558,7 @@ main (int argc, char* argv[]) // Armed swap. // +#if QT_VERSION >= 0x040800 { object c (o); @@ -588,6 +589,7 @@ main (int argc, char* argv[]) t.commit (); } } +#endif // Armed move. // -- cgit v1.1 From 2baa7856aaa9e5f4ff3ec1d56e3e0ea317c15c7b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 05:42:51 +0200 Subject: Suppress cast warnings --- qt/oracle/basic/driver.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index a570d74..a3c919a 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -47,8 +47,10 @@ main (int argc, char* argv[]) // fromStdString() assumes ASCII in Qt4 and UTF-8 in Qt5. // - o.nchar= QString::fromUtf8 (unicode_str.c_str (), unicode_str.size ()); - o.nvarchar2 = QString::fromUtf8 (unicode_str.c_str (), unicode_str.size ()); + o.nchar= QString::fromUtf8 (unicode_str.c_str (), + static_cast (unicode_str.size ())); + o.nvarchar2 = QString::fromUtf8 (unicode_str.c_str (), + static_cast (unicode_str.size ())); o.nclob = QString::fromStdString (long_str); o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); -- cgit v1.1 From be7e2755e5f187af7bd9902576379421c2a06e2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 08:01:33 +0200 Subject: Disable constraint checking in MySQL This test can either create tables or drop them in the "wrong" order, depending on the static initialization order. For MySQL we can create things but not drop (no IF EXISTS or similar support). --- common/schema/embedded/order/driver.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index 63d9c35..685693d 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -37,9 +37,13 @@ main (int argc, char* argv[]) { connection_ptr c (db->connection ()); - // Temporarily disable foreign key constraints for SQLite. + // Temporarily disable foreign key constraints for MySQL and SQLite. + // For MySQL we can actually create the tables in any order. It is + // dropping them that's the problem (there is no IF EXISTS). // -#if defined(DATABASE_SQLITE) +#if defined(DATABASE_MYSQL) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); +#elif defined(DATABASE_SQLITE) c->execute ("PRAGMA foreign_keys=OFF"); #endif @@ -47,7 +51,9 @@ main (int argc, char* argv[]) schema_catalog::create_schema (*db); t.commit (); -#if defined(DATABASE_SQLITE) +#if defined(DATABASE_MYSQL) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); +#elif defined(DATABASE_SQLITE) c->execute ("PRAGMA foreign_keys=ON"); #endif } -- cgit v1.1 From eb61314cc5c8d224cb3bc47f40d725b7a01bb064 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 11:03:06 +0200 Subject: Workarounds for non-standard Sun CC STL --- common/container/change-tracking/driver.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index b4f09ad..eaf23e1 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -58,8 +58,9 @@ static counting_tracer tr; // complete std::vector interface. // -#if defined (HAVE_CXX11) -#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC +#if !defined (HAVE_CXX11) || \ + (defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) struct item {}; template class odb::vector; template class odb::vector_iterator, @@ -101,9 +102,11 @@ main (int argc, char* argv[]) if (i != ov.end ()) i = ov.end (); +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC vector::const_reverse_iterator j (ov.rbegin ()); if (j != ov.rend ()) j = ov.rend (); +#endif } auto_ptr db (create_database (argc, argv)); @@ -369,16 +372,23 @@ main (int argc, char* argv[]) { o.s.begin ().modify () += 'a'; +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC o.s.rbegin ().modify () += 'c'; +#endif transaction t (db->begin ()); tr.reset (t); db->update (o); +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC assert (tr.u == 3 && tr.t == 3); +#else + assert (tr.u == 2 && tr.t == 2); +#endif assert (*db->load ("1") == o); t.commit (); } +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC { (o.s.rbegin () + 1).modify (1) += 'a'; (o.s.rbegin () + 1).modify (-1) += 'c'; @@ -390,6 +400,7 @@ main (int argc, char* argv[]) assert (*db->load ("1") == o); t.commit (); } +#endif { o.s.mbegin (); -- cgit v1.1 From 913087c4e2bea1f36f8126feb0b58904666f237c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 13:45:45 +0200 Subject: Use consistent types in object and view --- common/inheritance/polymorphism/test4.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index 22ccb9b..0bd53bd 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -69,7 +69,7 @@ namespace test4 struct view2 { #pragma db column("min(" + base2::num + ")") - std::size_t min_num; + unsigned long min_num; }; } -- cgit v1.1 From 6446d20030cbc75944af43479be379775d4736b6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 16:50:25 +0200 Subject: Disable non-const to const iterator comparison test for Sun CC's STLPort --- common/container/change-tracking/driver.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index eaf23e1..78f7a7f 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -102,7 +102,10 @@ main (int argc, char* argv[]) if (i != ov.end ()) i = ov.end (); -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC + // Things are just really borken in Sun CC, no matter which STL + // you use. + // +#ifndef __SUNPRO_CC vector::const_reverse_iterator j (ov.rbegin ()); if (j != ov.rend ()) j = ov.rend (); -- cgit v1.1 From 162eb7de6b2da9a28f224e33c72ebc3925b9632d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 16:53:07 +0200 Subject: Fix incorrect Qt5 library name --- qt/common/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/common/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/common/template/template-qt5-vc9.vcproj | 8 ++++---- qt/mssql/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/mssql/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/mssql/template/template-qt5-vc9.vcproj | 8 ++++---- qt/mysql/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/mysql/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/mysql/template/template-qt5-vc9.vcproj | 8 ++++---- qt/oracle/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/oracle/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/oracle/template/template-qt5-vc9.vcproj | 8 ++++---- qt/pgsql/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/pgsql/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/pgsql/template/template-qt5-vc9.vcproj | 8 ++++---- qt/sqlite/template/template-qt5-vc10.vcxproj | 8 ++++---- qt/sqlite/template/template-qt5-vc11.vcxproj | 8 ++++---- qt/sqlite/template/template-qt5-vc9.vcproj | 8 ++++---- 18 files changed, 72 insertions(+), 72 deletions(-) diff --git a/qt/common/template/template-qt5-vc10.vcxproj b/qt/common/template/template-qt5-vc10.vcxproj index f39a37d..2e721ee 100644 --- a/qt/common/template/template-qt5-vc10.vcxproj +++ b/qt/common/template/template-qt5-vc10.vcxproj @@ -93,7 +93,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/common/template/template-qt5-vc11.vcxproj b/qt/common/template/template-qt5-vc11.vcxproj index 2e6f8be..afcc020 100644 --- a/qt/common/template/template-qt5-vc11.vcxproj +++ b/qt/common/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/common/template/template-qt5-vc9.vcproj b/qt/common/template/template-qt5-vc9.vcproj index 0a87423..dab4913 100644 --- a/qt/common/template/template-qt5-vc9.vcproj +++ b/qt/common/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj b/qt/mssql/template/template-qt5-vc11.vcxproj index 60399ca..e986b42 100644 --- a/qt/mssql/template/template-qt5-vc11.vcxproj +++ b/qt/mssql/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mssql/template/template-qt5-vc9.vcproj b/qt/mssql/template/template-qt5-vc9.vcproj index 4b1b20e..66ea9ab 100644 --- a/qt/mssql/template/template-qt5-vc9.vcproj +++ b/qt/mssql/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj b/qt/mysql/template/template-qt5-vc11.vcxproj index 18a0d11..b974e80 100644 --- a/qt/mysql/template/template-qt5-vc11.vcxproj +++ b/qt/mysql/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/mysql/template/template-qt5-vc9.vcproj b/qt/mysql/template/template-qt5-vc9.vcproj index 687d887..c17267b 100644 --- a/qt/mysql/template/template-qt5-vc9.vcproj +++ b/qt/mysql/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj b/qt/oracle/template/template-qt5-vc11.vcxproj index a06f15b..ae3b1bd 100644 --- a/qt/oracle/template/template-qt5-vc11.vcxproj +++ b/qt/oracle/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/oracle/template/template-qt5-vc9.vcproj b/qt/oracle/template/template-qt5-vc9.vcproj index 34ab18f..2712157 100644 --- a/qt/oracle/template/template-qt5-vc9.vcproj +++ b/qt/oracle/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj b/qt/pgsql/template/template-qt5-vc11.vcxproj index f17cbaa..6b547d0 100644 --- a/qt/pgsql/template/template-qt5-vc11.vcxproj +++ b/qt/pgsql/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/pgsql/template/template-qt5-vc9.vcproj b/qt/pgsql/template/template-qt5-vc9.vcproj index bfb8b72..b32a1e7 100644 --- a/qt/pgsql/template/template-qt5-vc9.vcproj +++ b/qt/pgsql/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -109,7 +109,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -127,7 +127,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -147,7 +147,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj b/qt/sqlite/template/template-qt5-vc11.vcxproj index 4b55399..aae5c68 100644 --- a/qt/sqlite/template/template-qt5-vc11.vcxproj +++ b/qt/sqlite/template/template-qt5-vc11.vcxproj @@ -97,7 +97,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -113,7 +113,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) Console true @@ -131,7 +131,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true @@ -151,7 +151,7 @@ 4068;4355;4800;4290;%(DisableSpecificWarnings) - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore5.lib;%(AdditionalDependencies) + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) Console true true diff --git a/qt/sqlite/template/template-qt5-vc9.vcproj b/qt/sqlite/template/template-qt5-vc9.vcproj index 414d138..79c9389 100644 --- a/qt/sqlite/template/template-qt5-vc9.vcproj +++ b/qt/sqlite/template/template-qt5-vc9.vcproj @@ -65,7 +65,7 @@ /> Date: Tue, 12 Feb 2013 19:19:44 +0200 Subject: Don't use uninitialized iterator on the rhs of assignment --- common/session/custom/session.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index cda0258..6de140e 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -104,6 +104,17 @@ public: cache_position (): map_ (0) {} cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + cache_position& + operator= (const cache_position& p) + { + // It might not be ok to use an uninitialized iterator on the rhs. + // + if (p.map_ != 0) + pos_ = p.pos_; + map_ = p.map_; + return *this; + } + map* map_; iterator pos_; }; -- cgit v1.1 From f06485aab7bb076a2e5a35db50920377de1dc1b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Feb 2013 08:39:48 +0200 Subject: Minor documentation fix --- m4/pgsql.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 29d7433..0ee4a4c 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -96,7 +96,7 @@ fi AC_MSG_CHECKING([for pgsql database host]) AC_ARG_WITH( [pgsql-host], - [AC_HELP_STRING([--with-pgsql-host=HOST], [PostgreSQL database host (localhost by default)])], + [AC_HELP_STRING([--with-pgsql-host=HOST], [PostgreSQL database host (local host by default)])], [case $withval in yes) pgsql_host= -- cgit v1.1 From 34d177d03f5020ca0ec4bf9b77e20951ed17ff29 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Feb 2013 11:07:26 +0200 Subject: Add support for pattern matching (SQL LIKE) --- common/query/basics/driver.cxx | 32 ++++++++++++++++++++++++++++++++ common/query/basics/test.std | 10 ++++++++++ 2 files changed, 42 insertions(+) diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index a87a0b0..ee8e3b1 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -247,6 +247,9 @@ main (int argc, char* argv[]) db->query (query::first_name.in ("John", "Jane")); db->query (query::first_name.in_range (names, names_end)); + db->query (query::first_name.like ("J%")); + db->query (query::first_name.like ("J%!%", "!")); + // Query operators. // db->query (query::age == 30 && query::last_name == "Doe"); @@ -598,6 +601,35 @@ main (int argc, char* argv[]) } } #endif + + // Test like. + // + cout << "test 020" << endl; + { + transaction t (db->begin ()); + + result r (db->query (query::first_name.like ("Jo%"))); + print (r); + + r = db->query (!query::first_name.like ("Jo%")); + print (r); + + r = db->query (query::first_name.like ("Jo!%", "!")); + print (r); + + // In Oracle one can only escape special characters (% and _). + // +#if defined(DATABASE_ORACLE) + string v ("Ja%"); +#else + string v ("!Ja%"); +#endif + + r = db->query (query::first_name.like (query::_ref (v), "!")); + print (r); + + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/query/basics/test.std b/common/query/basics/test.std index 0548968..d420dc4 100644 --- a/common/query/basics/test.std +++ b/common/query/basics/test.std @@ -100,3 +100,13 @@ test 016 test 017 test 018 test 019 +test 020 +John Doe 30 married +Joe Squeaky Dirt 31 single +Johansen J Johansen 32 single + +Jane Doe 29 married + + +Jane Doe 29 married + -- cgit v1.1 From e76ab3a1ac2487e0dcb16ecdfe0c6e53c3f1e86c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 29 Mar 2013 18:51:07 +0200 Subject: Add test for custom-mapping SQL Server SQL_VARIANT type --- mssql/custom/custom.sql | 42 ++++++++++++++++ mssql/custom/driver.cxx | 11 +++++ mssql/custom/makefile | 6 +-- mssql/custom/test.hxx | 44 +++++++++++++++++ mssql/custom/traits.cxx | 129 ++++++++++++++++++++++++++++++++++++++++++++++++ mssql/custom/traits.hxx | 61 ++++++++++++++++++++++- 6 files changed, 289 insertions(+), 4 deletions(-) create mode 100644 mssql/custom/custom.sql create mode 100644 mssql/custom/traits.cxx diff --git a/mssql/custom/custom.sql b/mssql/custom/custom.sql new file mode 100644 index 0000000..44ef512 --- /dev/null +++ b/mssql/custom/custom.sql @@ -0,0 +1,42 @@ +/* This file contains helper functions. + */ + +IF OBJECT_ID('dbo.variant_to_string', 'FN') IS NOT NULL + DROP FUNCTION dbo.variant_to_string; +GO + +IF OBJECT_ID('dbo.string_to_variant', 'FN') IS NOT NULL + DROP FUNCTION dbo.string_to_variant; +GO + +CREATE FUNCTION dbo.variant_to_string (@val SQL_VARIANT) RETURNS VARCHAR(max) +AS +BEGIN + RETURN CAST(SQL_VARIANT_PROPERTY(@val, 'BaseType') AS SYSNAME) + ' ' + + CAST(@val AS VARCHAR(max)) +END; +GO + +CREATE FUNCTION dbo.string_to_variant (@val VARCHAR(max)) RETURNS SQL_VARIANT +AS +BEGIN + DECLARE @ret SQL_VARIANT + + DECLARE @pos BIGINT + DECLARE @vtype SYSNAME + DECLARE @vtext VARCHAR(max) + + SET @pos = CHARINDEX(' ', @val) + SET @vtype = SUBSTRING(@val, 1, @pos - 1) + SET @vtext = SUBSTRING(@val, @pos + 1, LEN(@val)) + + IF @vtype = 'tinyint' SET @ret = CAST(@vtext AS TINYINT) + ELSE IF @vtype = 'smallint' SET @ret = CAST(@vtext AS SMALLINT) + ELSE IF @vtype = 'int' SET @ret = CAST(@vtext AS INT) + ELSE IF @vtype = 'bigint' SET @ret = CAST(@vtext AS BIGINT) + ELSE IF @vtype = 'char' SET @ret = CAST(@vtext AS CHAR(8000)) + ELSE IF @vtype = 'varchar' SET @ret = CAST(@vtext AS VARCHAR(8000)) + + RETURN @ret +END; +GO diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 142d35c..ebaa790 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -30,6 +30,10 @@ main (int argc, char* argv[]) object o (1); + o.v = variant (123); + o.vv.push_back (variant (string (1024, 'a'))); + o.vv.push_back (variant (123)); + #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 o.p = point (1.1111, 2222222222.2); o.pv.push_back (point (1.1234, 2.2345)); @@ -65,6 +69,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + // Variant comparison. + // + { + result r (db->query (query::v == o.v)); + assert (!r.empty ()); + } + #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 // Point comparison. // diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 94be7b2..03dfd7d 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -4,7 +4,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -cxx_tun := driver.cxx +cxx_tun := driver.cxx traits.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) @@ -37,7 +37,7 @@ $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database mssql --default-database \ common --generate-schema --generate-query --hxx-prologue \ '\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ ---table-prefix mssql_custom_ +--sql-interlude ":r $(src_base)/custom.sql" --table-prefix mssql_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -52,7 +52,7 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx query.hxx -$(dist): data_dist := test.std +$(dist): data_dist := test.std custom.sql $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 6f44a77..7e6e81c 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -10,6 +10,46 @@ #include +// Map SQL Server SQL_VARIANT type to our variant C++ class that is capable +// of storing either an integer or a string (QVariant and boost::variant +// would be natural alternatives to our own type). The SQL Server functions +// that are used in the 'to' and 'from' expressions below are defined in +// the custom.sql file. The other half of this mapping is in traits.hxx +// (value_traits). +// +#pragma db map type("SQL_VARIANT") \ + as("VARCHAR(max)") \ + to("dbo.string_to_variant((?))") \ + from("dbo.variant_to_string((?))") + +#pragma db value type("SQL_VARIANT") +struct variant +{ + variant (unsigned long v = 0): val_type (type_int), int_val (v) {} + variant (const std::string& v): val_type (type_str), str_val (v) {} + + enum {type_int, type_str} val_type; + unsigned long int_val; + std::string str_val; +}; + +inline bool +operator== (const variant& a, const variant& b) +{ + if (a.val_type != b.val_type) + return false; + + switch (a.val_type) + { + case variant::type_int: + return a.int_val == b.int_val; + case variant::type_str: + return a.str_val == b.str_val; + } + + return false; +} + #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 // Map GEOMETRY SQL Server type to the point C++ struct. The other half // of this mapping is in traits.hxx (value_traits). @@ -55,6 +95,9 @@ struct object #pragma db id unsigned long id; + variant v; + std::vector vv; + #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 point p; std::vector pv; @@ -67,6 +110,7 @@ struct object operator== (const object& y) const { return id == y.id + && vv == y.vv #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 && p == y.p && pv == y.pv diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx new file mode 100644 index 0000000..80fe42f --- /dev/null +++ b/mssql/custom/traits.cxx @@ -0,0 +1,129 @@ +// file : mssql/types/traits.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include "traits.hxx" + +using namespace std; + +namespace odb +{ + namespace mssql + { + void value_traits:: + param_callback (const void* context, + size_t*, + const void** buffer, + size_t* size, + chunk_type* chunk, + void* tmp_buf, + size_t tmp_capacity) + { + const variant& v (*static_cast (context)); + string str; + + switch (v.val_type) + { + case variant::type_int: + { + ostringstream os; + os << v.int_val; + + str = "bigint "; + str += os.str (); + break; + } + case variant::type_str: + { + str = "varchar "; + str += v.str_val; + break; + } + } + + // Here we assume that the temoprary buffer is large enough to fit + // the whole string in one go. If that were not the case, then we + // would have had to chunk it. + // + assert (tmp_capacity >= str.size ()); + memcpy (tmp_buf, str.c_str (), str.size ()); + + *buffer = tmp_buf; + *size = str.size (); + *chunk = chunk_one; + } + + void value_traits:: + result_callback (void* context, + size_t*, + void** buffer, + size_t* size, + chunk_type chunk, + size_t, + void* tmp_buf, + size_t tmp_capacity) + { + variant& v (*static_cast (context)); + + switch (chunk) + { + case chunk_null: + case chunk_one: + { + assert (false); // The value cannot be NULL or empty. + break; + } + case chunk_first: + { + // Use the variant's string value as a temporary buffer. If this + // were not possible, we could have allocated one as part of + // context. + // + v.str_val.clear (); + + *buffer = tmp_buf; + *size = tmp_capacity; + break; + } + case chunk_next: + { + v.str_val.append (static_cast (tmp_buf), *size); + + *buffer = tmp_buf; + *size = tmp_capacity; + break; + } + case chunk_last: + { + v.str_val.append (static_cast (tmp_buf), *size); + + // Figure out what we've got. + // + string::size_type p (v.str_val.find (' ')); + assert (p != string::npos); // Must have type followed by value. + string type (v.str_val, 0, p); + string text (v.str_val, p + 1, string::npos); + + if (type == "tinyint" || + type == "smallint" || + type == "int" || + type == "bigint") + { + istringstream is (text); + is >> v.int_val; + v.val_type = variant::type_int; + } + else if (type == "char" || type == "varchar") + { + v.str_val = text; + v.val_type = variant::type_str; + } + else + assert (false); // Unknown type. + + break; + } + } + } + } +} diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index 421f288..a35fa49 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -12,12 +12,71 @@ #include -#include "test.hxx" // point +#include "test.hxx" // variant, point namespace odb { namespace mssql { + template <> + class value_traits + { + public: + typedef variant value_type; + typedef variant query_type; + typedef long_callback image_type; + + static void + set_value (variant& v, + result_callback_type& cb, + void*& context) + { + cb = &result_callback; + context = &v; + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const variant& v) + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + + static void + param_callback (const void* context, + std::size_t* position, + const void** buffer, + std::size_t* size, + chunk_type* chunk, + void* tmp_buffer, + std::size_t tmp_capacity); + + static void + result_callback (void* context, + std::size_t* position, + void** buffer, + std::size_t* size, + chunk_type chunk, + std::size_t size_left, + void* tmp_buffer, + std::size_t tmp_capacity); + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_long_string; + + struct conversion + { + static const char* to () {return "dbo.string_to_variant((?))";} + }; + }; + #if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 template <> class value_traits -- cgit v1.1 From 7b7a7b9a2a557535837c8d4b0b2af3e44b14594d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 Apr 2013 17:16:49 +0200 Subject: Handle inverse member in base class of polymorphic hierarchy --- common/inheritance/polymorphism/driver.cxx | 81 +++++++++++++++++++++++ common/inheritance/polymorphism/makefile | 3 +- common/inheritance/polymorphism/test14.hxx | 100 +++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 common/inheritance/polymorphism/test14.hxx diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index cd0c02e..7ab6346 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -28,6 +28,7 @@ #include "test11.hxx" #include "test12.hxx" #include "test13.hxx" +#include "test14.hxx" #include "test1-odb.hxx" #include "test2-odb.hxx" @@ -42,6 +43,7 @@ #include "test11-odb.hxx" #include "test12-odb.hxx" #include "test13-odb.hxx" +#include "test14-odb.hxx" using namespace std; using namespace odb::core; @@ -1921,6 +1923,85 @@ main (int argc, char* argv[]) assert (rb1.id == b1.id); } } + + // Test 14: inverse pointer in polymorphic base. + // + { + using namespace test14; + + derived d; + d.num = 123; + + d.o1 = new object1; + d.o2 = new object2; + d.o3.push_back (new object3); + d.o4.push_back (new object4); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (d.o1); + db->persist (d.o2); + db->persist (d.o3[0]); + db->persist (d.o4[0]); + db->persist (d); + t.commit (); + } + + // Load. + // + { + session s; + + transaction t (db->begin ()); + object1* p1 (db->load (d.o1->id)); + object2* p2 (db->load (d.o2->id)); + object3* p3 (db->load (d.o3[0]->id)); + object4* p4 (db->load (d.o4[0]->id)); + t.commit (); + + assert (p1->d->num = d.num); + assert (p2->d[0]->num = d.num); + assert (p3->d[0]->num = d.num); + assert (p4->d->num = d.num); + delete p1->d; + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::d->num == d.num)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i->d->num == d.num); + delete i.load ()->d; + assert (++i == e); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::d->num == d.num)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i->d->num == d.num); + delete i.load ()->d; + assert (++i == e); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index f2131f4..d250541 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -6,7 +6,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx +test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx \ +test14.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx new file mode 100644 index 0000000..95baf61 --- /dev/null +++ b/common/inheritance/polymorphism/test14.hxx @@ -0,0 +1,100 @@ +// file : common/inheritance/polymorphism/test14.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST14_HXX +#define TEST14_HXX + +#include + +#include + +// Test inverse pointer in polymorphic base. +// +#pragma db namespace table("t14_") +namespace test14 +{ + struct object1; + struct object2; + struct object3; + struct object4; + + #pragma db object polymorphic session + struct base + { + virtual ~base (); + + #pragma db id auto + unsigned long id; + + object1* o1; + object2* o2; + std::vector o3; + std::vector o4; + }; + + #pragma db object + struct derived: base + { + unsigned long num; + }; + + // one-to-one(i) + // + #pragma db object session + struct object1 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o1) + derived* d; + }; + + // one-to-many(i) + // + #pragma db object session + struct object2 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o2) + std::vector d; + }; + + // many-to-many(i) + // + #pragma db object session + struct object3 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o3) + std::vector d; + }; + + // many-to-one(i) + // + #pragma db object session + struct object4 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o4) + derived* d; + }; + + inline base:: + ~base () + { + delete o1; + delete o2; + delete o3[0]; + delete o4[0]; + } +} + +#endif // TEST14_HXX -- cgit v1.1 From 31d4f4c0a03013fc8989213de5259e632fe45898 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Mar 2013 11:10:19 +0200 Subject: Fix bug in ODB make rules --- build/import/odb/hxx-cxx.make | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 86c98fe..a67d6b7 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -32,19 +32,19 @@ ifeq ($(out_base),$(src_base)) $(odb_pattern): $(src_base)/%.$(cxx_h_suffix) $(call message,odb $<,$(odb) $(cpp_options) \ -$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ --output-dir $(dir $@) $<) else $(odb_pattern): $(src_base)/%.$(cxx_h_suffix) | $$(dir $$@). $(call message,odb $<,$(odb) $(cpp_options) \ -$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ --output-dir $(dir $@) $<) $(odb_pattern): $(out_base)/%.$(cxx_h_suffix) | $$(dir $$@). $(call message,odb $<,$(odb) $(cpp_options) \ -$(call expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ +$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ --output-dir $(dir $@) $<) endif -- cgit v1.1 From 15c6024da6a15e2d6e3302e4df375092959edbe2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Mar 2013 13:55:18 +0200 Subject: Add changelog test --- common/changelog/add-table-mssql-diff.xml | 45 +++++++++++++ common/changelog/add-table-mssql-patch.xml | 42 ++++++++++++ common/changelog/add-table-mysql-diff.xml | 45 +++++++++++++ common/changelog/add-table-mysql-patch.xml | 42 ++++++++++++ common/changelog/add-table-oracle-diff.xml | 45 +++++++++++++ common/changelog/add-table-oracle-patch.xml | 42 ++++++++++++ common/changelog/add-table-pgsql-diff.xml | 45 +++++++++++++ common/changelog/add-table-pgsql-patch.xml | 42 ++++++++++++ common/changelog/add-table-sqlite-diff.xml | 45 +++++++++++++ common/changelog/add-table-sqlite-patch.xml | 42 ++++++++++++ common/changelog/add-table.hxx | 35 ++++++++++ common/changelog/drop-table-mssql-diff.xml | 47 ++++++++++++++ common/changelog/drop-table-mssql-patch.xml | 11 ++++ common/changelog/drop-table-mysql-diff.xml | 47 ++++++++++++++ common/changelog/drop-table-mysql-patch.xml | 11 ++++ common/changelog/drop-table-oracle-diff.xml | 47 ++++++++++++++ common/changelog/drop-table-oracle-patch.xml | 11 ++++ common/changelog/drop-table-pgsql-diff.xml | 47 ++++++++++++++ common/changelog/drop-table-pgsql-patch.xml | 11 ++++ common/changelog/drop-table-sqlite-diff.xml | 47 ++++++++++++++ common/changelog/drop-table-sqlite-patch.xml | 11 ++++ common/changelog/drop-table.hxx | 35 ++++++++++ common/changelog/makefile | 97 ++++++++++++++++++++++++++++ common/changelog/model-mssql-diff.xml | 1 + common/changelog/model-mssql-patch.xml | 1 + common/changelog/model-mssql.xml | 56 ++++++++++++++++ common/changelog/model-mysql-diff.xml | 1 + common/changelog/model-mysql-patch.xml | 1 + common/changelog/model-mysql.xml | 56 ++++++++++++++++ common/changelog/model-oracle-diff.xml | 1 + common/changelog/model-oracle-patch.xml | 1 + common/changelog/model-oracle.xml | 56 ++++++++++++++++ common/changelog/model-pgsql-diff.xml | 1 + common/changelog/model-pgsql-patch.xml | 1 + common/changelog/model-pgsql.xml | 56 ++++++++++++++++ common/changelog/model-sqlite-diff.xml | 1 + common/changelog/model-sqlite-patch.xml | 1 + common/changelog/model-sqlite.xml | 56 ++++++++++++++++ common/changelog/model.hxx | 47 ++++++++++++++ common/makefile | 5 +- 40 files changed, 1233 insertions(+), 1 deletion(-) create mode 100644 common/changelog/add-table-mssql-diff.xml create mode 100644 common/changelog/add-table-mssql-patch.xml create mode 100644 common/changelog/add-table-mysql-diff.xml create mode 100644 common/changelog/add-table-mysql-patch.xml create mode 100644 common/changelog/add-table-oracle-diff.xml create mode 100644 common/changelog/add-table-oracle-patch.xml create mode 100644 common/changelog/add-table-pgsql-diff.xml create mode 100644 common/changelog/add-table-pgsql-patch.xml create mode 100644 common/changelog/add-table-sqlite-diff.xml create mode 100644 common/changelog/add-table-sqlite-patch.xml create mode 100644 common/changelog/add-table.hxx create mode 100644 common/changelog/drop-table-mssql-diff.xml create mode 100644 common/changelog/drop-table-mssql-patch.xml create mode 100644 common/changelog/drop-table-mysql-diff.xml create mode 100644 common/changelog/drop-table-mysql-patch.xml create mode 100644 common/changelog/drop-table-oracle-diff.xml create mode 100644 common/changelog/drop-table-oracle-patch.xml create mode 100644 common/changelog/drop-table-pgsql-diff.xml create mode 100644 common/changelog/drop-table-pgsql-patch.xml create mode 100644 common/changelog/drop-table-sqlite-diff.xml create mode 100644 common/changelog/drop-table-sqlite-patch.xml create mode 100644 common/changelog/drop-table.hxx create mode 100644 common/changelog/makefile create mode 120000 common/changelog/model-mssql-diff.xml create mode 120000 common/changelog/model-mssql-patch.xml create mode 100644 common/changelog/model-mssql.xml create mode 120000 common/changelog/model-mysql-diff.xml create mode 120000 common/changelog/model-mysql-patch.xml create mode 100644 common/changelog/model-mysql.xml create mode 120000 common/changelog/model-oracle-diff.xml create mode 120000 common/changelog/model-oracle-patch.xml create mode 100644 common/changelog/model-oracle.xml create mode 120000 common/changelog/model-pgsql-diff.xml create mode 120000 common/changelog/model-pgsql-patch.xml create mode 100644 common/changelog/model-pgsql.xml create mode 120000 common/changelog/model-sqlite-diff.xml create mode 120000 common/changelog/model-sqlite-patch.xml create mode 100644 common/changelog/model-sqlite.xml create mode 100644 common/changelog/model.hxx diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml new file mode 100644 index 0000000..8d3a95d --- /dev/null +++ b/common/changelog/add-table-mssql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml new file mode 100644 index 0000000..204a5a9 --- /dev/null +++ b/common/changelog/add-table-mssql-patch.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml new file mode 100644 index 0000000..019e51c --- /dev/null +++ b/common/changelog/add-table-mysql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml new file mode 100644 index 0000000..127139a --- /dev/null +++ b/common/changelog/add-table-mysql-patch.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml new file mode 100644 index 0000000..e04ba2b --- /dev/null +++ b/common/changelog/add-table-oracle-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml new file mode 100644 index 0000000..b0e32c0 --- /dev/null +++ b/common/changelog/add-table-oracle-patch.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml new file mode 100644 index 0000000..61c4985 --- /dev/null +++ b/common/changelog/add-table-pgsql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml new file mode 100644 index 0000000..33f8850 --- /dev/null +++ b/common/changelog/add-table-pgsql-patch.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml new file mode 100644 index 0000000..97b7e24 --- /dev/null +++ b/common/changelog/add-table-sqlite-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml new file mode 100644 index 0000000..84c9d75 --- /dev/null +++ b/common/changelog/add-table-sqlite-patch.xml @@ -0,0 +1,42 @@ + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx new file mode 100644 index 0000000..8dfabc6 --- /dev/null +++ b/common/changelog/add-table.hxx @@ -0,0 +1,35 @@ +// file : common/changelog/add-table.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_TABLE_HXX +#define ADD_TABLE_HXX + +#include + +#pragma db model version(BVER, CVER, true) + +struct object1; + +#if CVER > 1 +#pragma db object +struct object +{ + #pragma db id auto + int id; + int num; + + std::vector nums; + object1* o1; +}; +#endif + +#pragma db object +struct object1 +{ + #pragma db id + int id; + int num; +}; + +#endif // ADD_TABLE_HXX diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml new file mode 100644 index 0000000..7d6779e --- /dev/null +++ b/common/changelog/drop-table-mssql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/common/changelog/drop-table-mssql-patch.xml b/common/changelog/drop-table-mssql-patch.xml new file mode 100644 index 0000000..c6003ea --- /dev/null +++ b/common/changelog/drop-table-mssql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml new file mode 100644 index 0000000..4b223fb --- /dev/null +++ b/common/changelog/drop-table-mysql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml new file mode 100644 index 0000000..c6003ea --- /dev/null +++ b/common/changelog/drop-table-mysql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml new file mode 100644 index 0000000..9334585 --- /dev/null +++ b/common/changelog/drop-table-oracle-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/common/changelog/drop-table-oracle-patch.xml b/common/changelog/drop-table-oracle-patch.xml new file mode 100644 index 0000000..309aa86 --- /dev/null +++ b/common/changelog/drop-table-oracle-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml new file mode 100644 index 0000000..18d01f6 --- /dev/null +++ b/common/changelog/drop-table-pgsql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/common/changelog/drop-table-pgsql-patch.xml b/common/changelog/drop-table-pgsql-patch.xml new file mode 100644 index 0000000..393a20f --- /dev/null +++ b/common/changelog/drop-table-pgsql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml new file mode 100644 index 0000000..5277fd8 --- /dev/null +++ b/common/changelog/drop-table-sqlite-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/common/changelog/drop-table-sqlite-patch.xml b/common/changelog/drop-table-sqlite-patch.xml new file mode 100644 index 0000000..393a20f --- /dev/null +++ b/common/changelog/drop-table-sqlite-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx new file mode 100644 index 0000000..a28c0d4 --- /dev/null +++ b/common/changelog/drop-table.hxx @@ -0,0 +1,35 @@ +// file : common/changelog/drop-table.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_TABLE_HXX +#define DROP_TABLE_HXX + +#include + +#pragma db model version(BVER, CVER, true) + +struct object1; + +#if CVER == 1 +#pragma db object +struct object +{ + #pragma db id auto + int id; + int num; + + std::vector nums; + object1* o1; +}; +#endif + +#pragma db object +struct object1 +{ + #pragma db id + int id; + int num; +}; + +#endif // DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile new file mode 100644 index 0000000..0819616 --- /dev/null +++ b/common/changelog/makefile @@ -0,0 +1,97 @@ +# file : common/changelog/makefile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +odb_hdr := model.hxx add-table.hxx drop-table.hxx + +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +default := $(out_base)/ +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. +# +$(default): + +genf := $(foreach f,$(odb_hdr:.hxx=-odb),$(addprefix $f,.hxx .ixx .cxx)) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): $(odb) FORCE # Force regeneration even if up to date. +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database $(db_id) \ +--generate-schema-only --schema-format sql --changelog-dir $(out_base) +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifdef STEP + +ifeq ($(STEP),1) +$(gen): cpp_options += -DBVER=1 -DCVER=1 # Initialize. +else ifeq ($(STEP),2) +$(gen): cpp_options += -DBVER=1 -DCVER=2 # Diff. +else ifeq ($(STEP),3) +$(gen): cpp_options += -DBVER=2 -DCVER=3 # Patch (via rewind). +else +$(error unexpected STEP value $(STEP) +endif + +$(default): $(gen) +else +$(default): ;@: +endif + +# Dist: not supported. +# +$(dist): + +# Test. +# +$(test): tests := $(odb_hdr:.hxx=) +$(test): diff = $(call message,,diff -u $(src_base)/$1-$(db_id)-$2.xml \ +$(out_base)/$1.xml)$(literal_newline)$(literal_tab) +$(test): | $(out_base)/. + $(call message,,rm -f $(addprefix $(out_base)/,$(addsuffix .xml,$(tests)))) + $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=1) + $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=2) + $(foreach t,$(tests),$(call diff,$t,diff)) + $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=3) + $(foreach t,$(tests),$(call diff,$t,patch)) + +# Clean. +# +$(clean): changelogs := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.xml)) +$(clean): $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(call message,,rm -f $(changelogs)) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(default) $(test): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/changelog/model-mssql-diff.xml b/common/changelog/model-mssql-diff.xml new file mode 120000 index 0000000..e1f812d --- /dev/null +++ b/common/changelog/model-mssql-diff.xml @@ -0,0 +1 @@ +model-mssql.xml \ No newline at end of file diff --git a/common/changelog/model-mssql-patch.xml b/common/changelog/model-mssql-patch.xml new file mode 120000 index 0000000..e1f812d --- /dev/null +++ b/common/changelog/model-mssql-patch.xml @@ -0,0 +1 @@ +model-mssql.xml \ No newline at end of file diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml new file mode 100644 index 0000000..d9689a0 --- /dev/null +++ b/common/changelog/model-mssql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/common/changelog/model-mysql-diff.xml b/common/changelog/model-mysql-diff.xml new file mode 120000 index 0000000..9100280 --- /dev/null +++ b/common/changelog/model-mysql-diff.xml @@ -0,0 +1 @@ +model-mysql.xml \ No newline at end of file diff --git a/common/changelog/model-mysql-patch.xml b/common/changelog/model-mysql-patch.xml new file mode 120000 index 0000000..9100280 --- /dev/null +++ b/common/changelog/model-mysql-patch.xml @@ -0,0 +1 @@ +model-mysql.xml \ No newline at end of file diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml new file mode 100644 index 0000000..ed46ebe --- /dev/null +++ b/common/changelog/model-mysql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/common/changelog/model-oracle-diff.xml b/common/changelog/model-oracle-diff.xml new file mode 120000 index 0000000..36e4479 --- /dev/null +++ b/common/changelog/model-oracle-diff.xml @@ -0,0 +1 @@ +model-oracle.xml \ No newline at end of file diff --git a/common/changelog/model-oracle-patch.xml b/common/changelog/model-oracle-patch.xml new file mode 120000 index 0000000..36e4479 --- /dev/null +++ b/common/changelog/model-oracle-patch.xml @@ -0,0 +1 @@ +model-oracle.xml \ No newline at end of file diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml new file mode 100644 index 0000000..756a355 --- /dev/null +++ b/common/changelog/model-oracle.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/common/changelog/model-pgsql-diff.xml b/common/changelog/model-pgsql-diff.xml new file mode 120000 index 0000000..b39ce26 --- /dev/null +++ b/common/changelog/model-pgsql-diff.xml @@ -0,0 +1 @@ +model-pgsql.xml \ No newline at end of file diff --git a/common/changelog/model-pgsql-patch.xml b/common/changelog/model-pgsql-patch.xml new file mode 120000 index 0000000..b39ce26 --- /dev/null +++ b/common/changelog/model-pgsql-patch.xml @@ -0,0 +1 @@ +model-pgsql.xml \ No newline at end of file diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml new file mode 100644 index 0000000..6dad23b --- /dev/null +++ b/common/changelog/model-pgsql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/common/changelog/model-sqlite-diff.xml b/common/changelog/model-sqlite-diff.xml new file mode 120000 index 0000000..3454f51 --- /dev/null +++ b/common/changelog/model-sqlite-diff.xml @@ -0,0 +1 @@ +model-sqlite.xml \ No newline at end of file diff --git a/common/changelog/model-sqlite-patch.xml b/common/changelog/model-sqlite-patch.xml new file mode 120000 index 0000000..3454f51 --- /dev/null +++ b/common/changelog/model-sqlite-patch.xml @@ -0,0 +1 @@ +model-sqlite.xml \ No newline at end of file diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml new file mode 100644 index 0000000..9f22af0 --- /dev/null +++ b/common/changelog/model-sqlite.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx new file mode 100644 index 0000000..e4c630e --- /dev/null +++ b/common/changelog/model.hxx @@ -0,0 +1,47 @@ +// file : common/changelog/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_HXX +#define MODEL_HXX + +#include + +#pragma db model version(1, 1, true) + +#pragma db value +struct value +{ + int x; + int y; +}; + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + + #pragma db null default(0) options("DUMMY=1") + int num; + + #pragma db index unique member(num, "DESC") method("BTREE") options("DUMMY=1") + + #pragma db index + value v; // Multi-column. + + std::vector nums; + object1* o1; +}; + +#pragma db object +struct object1 +{ + #pragma db id + value id; // Multi-column. + int num; +}; + +#endif // MODEL_HXX diff --git a/common/makefile b/common/makefile index e6eca1e..3eb05e2 100644 --- a/common/makefile +++ b/common/makefile @@ -9,6 +9,7 @@ access \ auto \ blob \ callback \ +changelog \ circular/single \ circular/multiple \ composite \ @@ -54,6 +55,8 @@ wrapper thread_tests := threads cxx11_tests := session/custom +no_dist_tests := changelog include + default := $(out_base)/ dist := $(out_base)/.dist test := $(out_base)/.test @@ -73,7 +76,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := common $(dist): name := $(name) -$(dist): export dirs := $(filter-out include,$(tests)) +$(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export cxx11_dirs := $(cxx11_tests) $(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -- cgit v1.1 From a8dfcfcff2534695ae19015fd33cb26fd2fb88c6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Mar 2013 13:03:13 +0200 Subject: Add changelog support for add, drop, and later column --- common/changelog/add-column-mssql-diff.xml | 16 ++++++++++++++++ common/changelog/add-column-mssql-patch.xml | 11 +++++++++++ common/changelog/add-column-mysql-diff.xml | 16 ++++++++++++++++ common/changelog/add-column-mysql-patch.xml | 11 +++++++++++ common/changelog/add-column-oracle-diff.xml | 16 ++++++++++++++++ common/changelog/add-column-oracle-patch.xml | 11 +++++++++++ common/changelog/add-column-pgsql-diff.xml | 16 ++++++++++++++++ common/changelog/add-column-pgsql-patch.xml | 11 +++++++++++ common/changelog/add-column-sqlite-diff.xml | 16 ++++++++++++++++ common/changelog/add-column-sqlite-patch.xml | 11 +++++++++++ common/changelog/add-column.hxx | 21 +++++++++++++++++++++ common/changelog/alter-column-mssql-diff.xml | 17 +++++++++++++++++ common/changelog/alter-column-mssql-patch.xml | 11 +++++++++++ common/changelog/alter-column-mysql-diff.xml | 17 +++++++++++++++++ common/changelog/alter-column-mysql-patch.xml | 11 +++++++++++ common/changelog/alter-column-oracle-diff.xml | 17 +++++++++++++++++ common/changelog/alter-column-oracle-patch.xml | 11 +++++++++++ common/changelog/alter-column-pgsql-diff.xml | 17 +++++++++++++++++ common/changelog/alter-column-pgsql-patch.xml | 11 +++++++++++ common/changelog/alter-column-sqlite-diff.xml | 17 +++++++++++++++++ common/changelog/alter-column-sqlite-patch.xml | 11 +++++++++++ common/changelog/alter-column.hxx | 22 ++++++++++++++++++++++ common/changelog/drop-column-mssql-diff.xml | 17 +++++++++++++++++ common/changelog/drop-column-mssql-patch.xml | 10 ++++++++++ common/changelog/drop-column-mysql-diff.xml | 17 +++++++++++++++++ common/changelog/drop-column-mysql-patch.xml | 10 ++++++++++ common/changelog/drop-column-oracle-diff.xml | 17 +++++++++++++++++ common/changelog/drop-column-oracle-patch.xml | 10 ++++++++++ common/changelog/drop-column-pgsql-diff.xml | 17 +++++++++++++++++ common/changelog/drop-column-pgsql-patch.xml | 10 ++++++++++ common/changelog/drop-column-sqlite-diff.xml | 17 +++++++++++++++++ common/changelog/drop-column-sqlite-patch.xml | 10 ++++++++++ common/changelog/drop-column.hxx | 21 +++++++++++++++++++++ common/changelog/makefile | 8 +++++++- 34 files changed, 481 insertions(+), 1 deletion(-) create mode 100644 common/changelog/add-column-mssql-diff.xml create mode 100644 common/changelog/add-column-mssql-patch.xml create mode 100644 common/changelog/add-column-mysql-diff.xml create mode 100644 common/changelog/add-column-mysql-patch.xml create mode 100644 common/changelog/add-column-oracle-diff.xml create mode 100644 common/changelog/add-column-oracle-patch.xml create mode 100644 common/changelog/add-column-pgsql-diff.xml create mode 100644 common/changelog/add-column-pgsql-patch.xml create mode 100644 common/changelog/add-column-sqlite-diff.xml create mode 100644 common/changelog/add-column-sqlite-patch.xml create mode 100644 common/changelog/add-column.hxx create mode 100644 common/changelog/alter-column-mssql-diff.xml create mode 100644 common/changelog/alter-column-mssql-patch.xml create mode 100644 common/changelog/alter-column-mysql-diff.xml create mode 100644 common/changelog/alter-column-mysql-patch.xml create mode 100644 common/changelog/alter-column-oracle-diff.xml create mode 100644 common/changelog/alter-column-oracle-patch.xml create mode 100644 common/changelog/alter-column-pgsql-diff.xml create mode 100644 common/changelog/alter-column-pgsql-patch.xml create mode 100644 common/changelog/alter-column-sqlite-diff.xml create mode 100644 common/changelog/alter-column-sqlite-patch.xml create mode 100644 common/changelog/alter-column.hxx create mode 100644 common/changelog/drop-column-mssql-diff.xml create mode 100644 common/changelog/drop-column-mssql-patch.xml create mode 100644 common/changelog/drop-column-mysql-diff.xml create mode 100644 common/changelog/drop-column-mysql-patch.xml create mode 100644 common/changelog/drop-column-oracle-diff.xml create mode 100644 common/changelog/drop-column-oracle-patch.xml create mode 100644 common/changelog/drop-column-pgsql-diff.xml create mode 100644 common/changelog/drop-column-pgsql-patch.xml create mode 100644 common/changelog/drop-column-sqlite-diff.xml create mode 100644 common/changelog/drop-column-sqlite-patch.xml create mode 100644 common/changelog/drop-column.hxx diff --git a/common/changelog/add-column-mssql-diff.xml b/common/changelog/add-column-mssql-diff.xml new file mode 100644 index 0000000..7485d9c --- /dev/null +++ b/common/changelog/add-column-mssql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/add-column-mssql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml new file mode 100644 index 0000000..7485d9c --- /dev/null +++ b/common/changelog/add-column-mysql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/add-column-mysql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml new file mode 100644 index 0000000..cbd2451 --- /dev/null +++ b/common/changelog/add-column-oracle-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml new file mode 100644 index 0000000..a517a59 --- /dev/null +++ b/common/changelog/add-column-oracle-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-pgsql-diff.xml b/common/changelog/add-column-pgsql-diff.xml new file mode 100644 index 0000000..f19e9e9 --- /dev/null +++ b/common/changelog/add-column-pgsql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/add-column-pgsql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-sqlite-diff.xml b/common/changelog/add-column-sqlite-diff.xml new file mode 100644 index 0000000..f19e9e9 --- /dev/null +++ b/common/changelog/add-column-sqlite-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/add-column-sqlite-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx new file mode 100644 index 0000000..b185ad9 --- /dev/null +++ b/common/changelog/add-column.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/add-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_COLUMN_HXX +#define ADD_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + int num; +#endif +}; + +#endif // ADD_COLUMN_HXX diff --git a/common/changelog/alter-column-mssql-diff.xml b/common/changelog/alter-column-mssql-diff.xml new file mode 100644 index 0000000..907fb8d --- /dev/null +++ b/common/changelog/alter-column-mssql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml new file mode 100644 index 0000000..a1d25da --- /dev/null +++ b/common/changelog/alter-column-mssql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml new file mode 100644 index 0000000..907fb8d --- /dev/null +++ b/common/changelog/alter-column-mysql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml new file mode 100644 index 0000000..a1d25da --- /dev/null +++ b/common/changelog/alter-column-mysql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml new file mode 100644 index 0000000..4a2b0df --- /dev/null +++ b/common/changelog/alter-column-oracle-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml new file mode 100644 index 0000000..2245880 --- /dev/null +++ b/common/changelog/alter-column-oracle-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-pgsql-diff.xml b/common/changelog/alter-column-pgsql-diff.xml new file mode 100644 index 0000000..0027190 --- /dev/null +++ b/common/changelog/alter-column-pgsql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml new file mode 100644 index 0000000..dd954ad --- /dev/null +++ b/common/changelog/alter-column-pgsql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-sqlite-diff.xml b/common/changelog/alter-column-sqlite-diff.xml new file mode 100644 index 0000000..0027190 --- /dev/null +++ b/common/changelog/alter-column-sqlite-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml new file mode 100644 index 0000000..dd954ad --- /dev/null +++ b/common/changelog/alter-column-sqlite-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx new file mode 100644 index 0000000..769553b --- /dev/null +++ b/common/changelog/alter-column.hxx @@ -0,0 +1,22 @@ +// file : common/changelog/alter-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ALTER_COLUMN_HXX +#define ALTER_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + #pragma db null +#endif + int num; +}; + +#endif // ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column-mssql-diff.xml b/common/changelog/drop-column-mssql-diff.xml new file mode 100644 index 0000000..496f8c7 --- /dev/null +++ b/common/changelog/drop-column-mssql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml new file mode 100644 index 0000000..1a38c38 --- /dev/null +++ b/common/changelog/drop-column-mssql-patch.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml new file mode 100644 index 0000000..496f8c7 --- /dev/null +++ b/common/changelog/drop-column-mysql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml new file mode 100644 index 0000000..1a38c38 --- /dev/null +++ b/common/changelog/drop-column-mysql-patch.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml new file mode 100644 index 0000000..00b8394 --- /dev/null +++ b/common/changelog/drop-column-oracle-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml new file mode 100644 index 0000000..a53c3aa --- /dev/null +++ b/common/changelog/drop-column-oracle-patch.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-pgsql-diff.xml b/common/changelog/drop-column-pgsql-diff.xml new file mode 100644 index 0000000..ae2e6b9 --- /dev/null +++ b/common/changelog/drop-column-pgsql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml new file mode 100644 index 0000000..8f19f4b --- /dev/null +++ b/common/changelog/drop-column-pgsql-patch.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-sqlite-diff.xml b/common/changelog/drop-column-sqlite-diff.xml new file mode 100644 index 0000000..ae2e6b9 --- /dev/null +++ b/common/changelog/drop-column-sqlite-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml new file mode 100644 index 0000000..8f19f4b --- /dev/null +++ b/common/changelog/drop-column-sqlite-patch.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx new file mode 100644 index 0000000..70fbcba --- /dev/null +++ b/common/changelog/drop-column.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/drop-column.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_COLUMN_HXX +#define DROP_COLUMN_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + int num; +#endif +}; + +#endif // DROP_COLUMN_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 0819616..1349509 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -4,7 +4,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -odb_hdr := model.hxx add-table.hxx drop-table.hxx +odb_hdr := \ +model.hxx \ +add-table.hxx \ +drop-table.hxx \ +add-column.hxx \ +drop-column.hxx \ +alter-column.hxx common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -- cgit v1.1 From e7f6315882ef16939f99dd757eaf800b9f12e92b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Mar 2013 16:04:48 +0200 Subject: Add changelog support for add/drop index/foreign key Also diagnose changes to primary keys and establish the 'alters' association. --- common/changelog/add-foreign-key-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-mssql-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-mssql-patch.xml | 23 +++++++++++++++++ common/changelog/add-foreign-key-mysql-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-mysql-patch.xml | 23 +++++++++++++++++ common/changelog/add-foreign-key-oracle-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-oracle-patch.xml | 23 +++++++++++++++++ common/changelog/add-foreign-key-pgsql-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-pgsql-patch.xml | 23 +++++++++++++++++ common/changelog/add-foreign-key-sqlite-diff.xml | 28 ++++++++++++++++++++ common/changelog/add-foreign-key-sqlite-patch.xml | 23 +++++++++++++++++ common/changelog/add-foreign-key.hxx | 30 ++++++++++++++++++++++ common/changelog/add-index-mssql-diff.xml | 21 +++++++++++++++ common/changelog/add-index-mssql-patch.xml | 16 ++++++++++++ common/changelog/add-index-mysql-diff.xml | 21 +++++++++++++++ common/changelog/add-index-mysql-patch.xml | 16 ++++++++++++ common/changelog/add-index-oracle-diff.xml | 21 +++++++++++++++ common/changelog/add-index-oracle-patch.xml | 16 ++++++++++++ common/changelog/add-index-pgsql-diff.xml | 21 +++++++++++++++ common/changelog/add-index-pgsql-patch.xml | 16 ++++++++++++ common/changelog/add-index-sqlite-diff.xml | 21 +++++++++++++++ common/changelog/add-index-sqlite-patch.xml | 16 ++++++++++++ common/changelog/add-index.hxx | 25 ++++++++++++++++++ common/changelog/drop-foreign-key-mssql-diff.xml | 30 ++++++++++++++++++++++ common/changelog/drop-foreign-key-mssql-patch.xml | 16 ++++++++++++ common/changelog/drop-foreign-key-mysql-diff.xml | 30 ++++++++++++++++++++++ common/changelog/drop-foreign-key-mysql-patch.xml | 16 ++++++++++++ common/changelog/drop-foreign-key-oracle-diff.xml | 30 ++++++++++++++++++++++ common/changelog/drop-foreign-key-oracle-patch.xml | 16 ++++++++++++ common/changelog/drop-foreign-key-pgsql-diff.xml | 30 ++++++++++++++++++++++ common/changelog/drop-foreign-key-pgsql-patch.xml | 16 ++++++++++++ common/changelog/drop-foreign-key-sqlite-diff.xml | 30 ++++++++++++++++++++++ common/changelog/drop-foreign-key-sqlite-patch.xml | 16 ++++++++++++ common/changelog/drop-foreign-key.hxx | 30 ++++++++++++++++++++++ common/changelog/drop-index-mssql-diff.xml | 20 +++++++++++++++ common/changelog/drop-index-mssql-patch.xml | 11 ++++++++ common/changelog/drop-index-mysql-diff.xml | 20 +++++++++++++++ common/changelog/drop-index-mysql-patch.xml | 11 ++++++++ common/changelog/drop-index-oracle-diff.xml | 20 +++++++++++++++ common/changelog/drop-index-oracle-patch.xml | 11 ++++++++ common/changelog/drop-index-pgsql-diff.xml | 20 +++++++++++++++ common/changelog/drop-index-pgsql-patch.xml | 11 ++++++++ common/changelog/drop-index-sqlite-diff.xml | 20 +++++++++++++++ common/changelog/drop-index-sqlite-patch.xml | 11 ++++++++ common/changelog/drop-index.hxx | 22 ++++++++++++++++ common/changelog/makefile | 18 ++++++++----- 46 files changed, 971 insertions(+), 7 deletions(-) create mode 100644 common/changelog/add-foreign-key-diff.xml create mode 100644 common/changelog/add-foreign-key-mssql-diff.xml create mode 100644 common/changelog/add-foreign-key-mssql-patch.xml create mode 100644 common/changelog/add-foreign-key-mysql-diff.xml create mode 100644 common/changelog/add-foreign-key-mysql-patch.xml create mode 100644 common/changelog/add-foreign-key-oracle-diff.xml create mode 100644 common/changelog/add-foreign-key-oracle-patch.xml create mode 100644 common/changelog/add-foreign-key-pgsql-diff.xml create mode 100644 common/changelog/add-foreign-key-pgsql-patch.xml create mode 100644 common/changelog/add-foreign-key-sqlite-diff.xml create mode 100644 common/changelog/add-foreign-key-sqlite-patch.xml create mode 100644 common/changelog/add-foreign-key.hxx create mode 100644 common/changelog/add-index-mssql-diff.xml create mode 100644 common/changelog/add-index-mssql-patch.xml create mode 100644 common/changelog/add-index-mysql-diff.xml create mode 100644 common/changelog/add-index-mysql-patch.xml create mode 100644 common/changelog/add-index-oracle-diff.xml create mode 100644 common/changelog/add-index-oracle-patch.xml create mode 100644 common/changelog/add-index-pgsql-diff.xml create mode 100644 common/changelog/add-index-pgsql-patch.xml create mode 100644 common/changelog/add-index-sqlite-diff.xml create mode 100644 common/changelog/add-index-sqlite-patch.xml create mode 100644 common/changelog/add-index.hxx create mode 100644 common/changelog/drop-foreign-key-mssql-diff.xml create mode 100644 common/changelog/drop-foreign-key-mssql-patch.xml create mode 100644 common/changelog/drop-foreign-key-mysql-diff.xml create mode 100644 common/changelog/drop-foreign-key-mysql-patch.xml create mode 100644 common/changelog/drop-foreign-key-oracle-diff.xml create mode 100644 common/changelog/drop-foreign-key-oracle-patch.xml create mode 100644 common/changelog/drop-foreign-key-pgsql-diff.xml create mode 100644 common/changelog/drop-foreign-key-pgsql-patch.xml create mode 100644 common/changelog/drop-foreign-key-sqlite-diff.xml create mode 100644 common/changelog/drop-foreign-key-sqlite-patch.xml create mode 100644 common/changelog/drop-foreign-key.hxx create mode 100644 common/changelog/drop-index-mssql-diff.xml create mode 100644 common/changelog/drop-index-mssql-patch.xml create mode 100644 common/changelog/drop-index-mysql-diff.xml create mode 100644 common/changelog/drop-index-mysql-patch.xml create mode 100644 common/changelog/drop-index-oracle-diff.xml create mode 100644 common/changelog/drop-index-oracle-patch.xml create mode 100644 common/changelog/drop-index-pgsql-diff.xml create mode 100644 common/changelog/drop-index-pgsql-patch.xml create mode 100644 common/changelog/drop-index-sqlite-diff.xml create mode 100644 common/changelog/drop-index-sqlite-patch.xml create mode 100644 common/changelog/drop-index.hxx diff --git a/common/changelog/add-foreign-key-diff.xml b/common/changelog/add-foreign-key-diff.xml new file mode 100644 index 0000000..34c0952 --- /dev/null +++ b/common/changelog/add-foreign-key-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-mssql-diff.xml b/common/changelog/add-foreign-key-mssql-diff.xml new file mode 100644 index 0000000..594f253 --- /dev/null +++ b/common/changelog/add-foreign-key-mssql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml new file mode 100644 index 0000000..17e5d14 --- /dev/null +++ b/common/changelog/add-foreign-key-mssql-patch.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml new file mode 100644 index 0000000..594f253 --- /dev/null +++ b/common/changelog/add-foreign-key-mysql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml new file mode 100644 index 0000000..17e5d14 --- /dev/null +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml new file mode 100644 index 0000000..14f2357 --- /dev/null +++ b/common/changelog/add-foreign-key-oracle-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml new file mode 100644 index 0000000..6168736 --- /dev/null +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-pgsql-diff.xml b/common/changelog/add-foreign-key-pgsql-diff.xml new file mode 100644 index 0000000..34c0952 --- /dev/null +++ b/common/changelog/add-foreign-key-pgsql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml new file mode 100644 index 0000000..e70ad87 --- /dev/null +++ b/common/changelog/add-foreign-key-pgsql-patch.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-sqlite-diff.xml b/common/changelog/add-foreign-key-sqlite-diff.xml new file mode 100644 index 0000000..34c0952 --- /dev/null +++ b/common/changelog/add-foreign-key-sqlite-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml new file mode 100644 index 0000000..e70ad87 --- /dev/null +++ b/common/changelog/add-foreign-key-sqlite-patch.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx new file mode 100644 index 0000000..d6cec68 --- /dev/null +++ b/common/changelog/add-foreign-key.hxx @@ -0,0 +1,30 @@ +// file : common/changelog/add-foreign-key.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_FOREIGN_KEY_HXX +#define ADD_FOREIGN_KEY_HXX + +#pragma db model version(BVER, CVER, true) + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + object1* o1; +#endif +}; + +#pragma db object +struct object1 +{ + #pragma db id + int id; +}; + +#endif // ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index-mssql-diff.xml b/common/changelog/add-index-mssql-diff.xml new file mode 100644 index 0000000..33634f8 --- /dev/null +++ b/common/changelog/add-index-mssql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-mssql-patch.xml b/common/changelog/add-index-mssql-patch.xml new file mode 100644 index 0000000..cac5886 --- /dev/null +++ b/common/changelog/add-index-mssql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-mysql-diff.xml b/common/changelog/add-index-mysql-diff.xml new file mode 100644 index 0000000..33634f8 --- /dev/null +++ b/common/changelog/add-index-mysql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml new file mode 100644 index 0000000..cac5886 --- /dev/null +++ b/common/changelog/add-index-mysql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-oracle-diff.xml b/common/changelog/add-index-oracle-diff.xml new file mode 100644 index 0000000..d32bada --- /dev/null +++ b/common/changelog/add-index-oracle-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml new file mode 100644 index 0000000..91353a9 --- /dev/null +++ b/common/changelog/add-index-oracle-patch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-pgsql-diff.xml b/common/changelog/add-index-pgsql-diff.xml new file mode 100644 index 0000000..969abd8 --- /dev/null +++ b/common/changelog/add-index-pgsql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-pgsql-patch.xml b/common/changelog/add-index-pgsql-patch.xml new file mode 100644 index 0000000..559dd4d --- /dev/null +++ b/common/changelog/add-index-pgsql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-sqlite-diff.xml b/common/changelog/add-index-sqlite-diff.xml new file mode 100644 index 0000000..969abd8 --- /dev/null +++ b/common/changelog/add-index-sqlite-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index-sqlite-patch.xml b/common/changelog/add-index-sqlite-patch.xml new file mode 100644 index 0000000..559dd4d --- /dev/null +++ b/common/changelog/add-index-sqlite-patch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx new file mode 100644 index 0000000..92437ab --- /dev/null +++ b/common/changelog/add-index.hxx @@ -0,0 +1,25 @@ +// file : common/changelog/add-index.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_INDEX_HXX +#define ADD_INDEX_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + + int x; + +#if CVER > 1 + int y; + #pragma db index ("xy_i") unique member(x) member(y, "DESC") +#endif + +}; + +#endif // ADD_INDEX_HXX diff --git a/common/changelog/drop-foreign-key-mssql-diff.xml b/common/changelog/drop-foreign-key-mssql-diff.xml new file mode 100644 index 0000000..30dba42 --- /dev/null +++ b/common/changelog/drop-foreign-key-mssql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-mssql-patch.xml b/common/changelog/drop-foreign-key-mssql-patch.xml new file mode 100644 index 0000000..b6d6e63 --- /dev/null +++ b/common/changelog/drop-foreign-key-mssql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml new file mode 100644 index 0000000..30dba42 --- /dev/null +++ b/common/changelog/drop-foreign-key-mysql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml new file mode 100644 index 0000000..b6d6e63 --- /dev/null +++ b/common/changelog/drop-foreign-key-mysql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml new file mode 100644 index 0000000..8a36172 --- /dev/null +++ b/common/changelog/drop-foreign-key-oracle-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml new file mode 100644 index 0000000..f544817 --- /dev/null +++ b/common/changelog/drop-foreign-key-oracle-patch.xml @@ -0,0 +1,16 @@ + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-pgsql-diff.xml b/common/changelog/drop-foreign-key-pgsql-diff.xml new file mode 100644 index 0000000..8f7c6f1 --- /dev/null +++ b/common/changelog/drop-foreign-key-pgsql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-pgsql-patch.xml b/common/changelog/drop-foreign-key-pgsql-patch.xml new file mode 100644 index 0000000..a666b86 --- /dev/null +++ b/common/changelog/drop-foreign-key-pgsql-patch.xml @@ -0,0 +1,16 @@ + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-sqlite-diff.xml b/common/changelog/drop-foreign-key-sqlite-diff.xml new file mode 100644 index 0000000..8f7c6f1 --- /dev/null +++ b/common/changelog/drop-foreign-key-sqlite-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key-sqlite-patch.xml b/common/changelog/drop-foreign-key-sqlite-patch.xml new file mode 100644 index 0000000..a666b86 --- /dev/null +++ b/common/changelog/drop-foreign-key-sqlite-patch.xml @@ -0,0 +1,16 @@ + + + + + + + +
+ + + + + +
+
+
diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx new file mode 100644 index 0000000..4a70c6b --- /dev/null +++ b/common/changelog/drop-foreign-key.hxx @@ -0,0 +1,30 @@ +// file : common/changelog/drop-foreign-key.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_FOREIGN_KEY_HXX +#define DROP_FOREIGN_KEY_HXX + +#pragma db model version(BVER, CVER, true) + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + object1* o1; +#endif +}; + +#pragma db object +struct object1 +{ + #pragma db id + int id; +}; + +#endif // DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index-mssql-diff.xml b/common/changelog/drop-index-mssql-diff.xml new file mode 100644 index 0000000..4bf9fb8 --- /dev/null +++ b/common/changelog/drop-index-mssql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-mssql-patch.xml b/common/changelog/drop-index-mssql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/drop-index-mssql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-mysql-diff.xml b/common/changelog/drop-index-mysql-diff.xml new file mode 100644 index 0000000..4bf9fb8 --- /dev/null +++ b/common/changelog/drop-index-mysql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml new file mode 100644 index 0000000..44de8f2 --- /dev/null +++ b/common/changelog/drop-index-mysql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-oracle-diff.xml b/common/changelog/drop-index-oracle-diff.xml new file mode 100644 index 0000000..9c717e6 --- /dev/null +++ b/common/changelog/drop-index-oracle-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml new file mode 100644 index 0000000..a517a59 --- /dev/null +++ b/common/changelog/drop-index-oracle-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-pgsql-diff.xml b/common/changelog/drop-index-pgsql-diff.xml new file mode 100644 index 0000000..e3c0d1d --- /dev/null +++ b/common/changelog/drop-index-pgsql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-pgsql-patch.xml b/common/changelog/drop-index-pgsql-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/drop-index-pgsql-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-sqlite-diff.xml b/common/changelog/drop-index-sqlite-diff.xml new file mode 100644 index 0000000..e3c0d1d --- /dev/null +++ b/common/changelog/drop-index-sqlite-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index-sqlite-patch.xml b/common/changelog/drop-index-sqlite-patch.xml new file mode 100644 index 0000000..10958e6 --- /dev/null +++ b/common/changelog/drop-index-sqlite-patch.xml @@ -0,0 +1,11 @@ + + + + + + + + +
+
+
diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx new file mode 100644 index 0000000..f1f1846 --- /dev/null +++ b/common/changelog/drop-index.hxx @@ -0,0 +1,22 @@ +// file : common/changelog/drop-index.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_INDEX_HXX +#define DROP_INDEX_HXX + +#pragma db model version(BVER, CVER, true) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + #pragma db index +#endif + int num; +}; + +#endif // DROP_INDEX_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 1349509..0e4ecf9 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -4,13 +4,17 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -odb_hdr := \ -model.hxx \ -add-table.hxx \ -drop-table.hxx \ -add-column.hxx \ -drop-column.hxx \ -alter-column.hxx +odb_hdr := \ +model.hxx \ +add-table.hxx \ +drop-table.hxx \ +add-column.hxx \ +drop-column.hxx \ +alter-column.hxx \ +add-index.hxx \ +drop-index.hxx \ +add-foreign-key.hxx \ +drop-foreign-key.hxx common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -- cgit v1.1 From 516523183fad016a26c7400d784eb9c0343b7964 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Apr 2013 11:22:42 +0200 Subject: Generate add/drop table migration statements --- Makefile.am | 2 +- build.bat | 6 + common/changelog/makefile | 5 +- common/makefile | 2 +- evolution/Makefile.am | 6 + evolution/add-table/driver.cxx | 107 +++++++ evolution/add-table/makefile | 142 +++++++++ evolution/add-table/model.hxx | 49 +++ evolution/add-table/test1.hxx | 12 + evolution/add-table/test2.hxx | 12 + evolution/drop-table/driver.cxx | 111 +++++++ evolution/drop-table/makefile | 142 +++++++++ evolution/drop-table/model.hxx | 49 +++ evolution/drop-table/test1.hxx | 12 + evolution/drop-table/test2.hxx | 12 + evolution/evolution-vc10.sln | 15 + evolution/evolution-vc11.sln | 15 + evolution/evolution-vc9.sln | 15 + evolution/makefile | 52 ++++ evolution/template/Makefile.am | 49 +++ evolution/template/driver.cxx | 100 ++++++ evolution/template/makefile | 142 +++++++++ evolution/template/model.hxx | 41 +++ evolution/template/template-vc10.vcxproj | 187 ++++++++++++ evolution/template/template-vc10.vcxproj.filters | 28 ++ evolution/template/template-vc11.vcxproj | 191 ++++++++++++ evolution/template/template-vc11.vcxproj.filters | 28 ++ evolution/template/template-vc9.vcproj | 370 +++++++++++++++++++++++ evolution/template/test1.hxx | 12 + evolution/template/test2.hxx | 12 + evolution/test.bat | 80 +++++ evolution/tester | 38 +++ evolution/tester.bat | 82 +++++ makefile | 4 +- test.bat | 2 +- 35 files changed, 2125 insertions(+), 7 deletions(-) create mode 100644 evolution/Makefile.am create mode 100644 evolution/add-table/driver.cxx create mode 100644 evolution/add-table/makefile create mode 100644 evolution/add-table/model.hxx create mode 100644 evolution/add-table/test1.hxx create mode 100644 evolution/add-table/test2.hxx create mode 100644 evolution/drop-table/driver.cxx create mode 100644 evolution/drop-table/makefile create mode 100644 evolution/drop-table/model.hxx create mode 100644 evolution/drop-table/test1.hxx create mode 100644 evolution/drop-table/test2.hxx create mode 100644 evolution/evolution-vc10.sln create mode 100644 evolution/evolution-vc11.sln create mode 100644 evolution/evolution-vc9.sln create mode 100644 evolution/makefile create mode 100644 evolution/template/Makefile.am create mode 100644 evolution/template/driver.cxx create mode 100644 evolution/template/makefile create mode 100644 evolution/template/model.hxx create mode 100644 evolution/template/template-vc10.vcxproj create mode 100644 evolution/template/template-vc10.vcxproj.filters create mode 100644 evolution/template/template-vc11.vcxproj create mode 100644 evolution/template/template-vc11.vcxproj.filters create mode 100644 evolution/template/template-vc9.vcproj create mode 100644 evolution/template/test1.hxx create mode 100644 evolution/template/test2.hxx create mode 100644 evolution/test.bat create mode 100755 evolution/tester create mode 100644 evolution/tester.bat diff --git a/Makefile.am b/Makefile.am index ed99581..1c7c524 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ # copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -SUBDIRS = libcommon common +SUBDIRS = libcommon common evolution if ODB_TESTS_BOOST SUBDIRS += boost diff --git a/build.bat b/build.bat index 0f55142..8c7b5ad 100644 --- a/build.bat +++ b/build.bat @@ -93,6 +93,12 @@ for %%c in (%confs%) do ( ) ) +for %%c in (%confs%) do ( + for %%p in (%plats%) do ( + call :run_build evolution/evolution-%1-vc%vcver%.sln %%c %%p + ) +) + if not "_%failed%_" == "__" goto error echo. diff --git a/common/changelog/makefile b/common/changelog/makefile index 0e4ecf9..8d5e96d 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -38,8 +38,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) FORCE # Force regeneration even if up to date. $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---generate-schema-only --schema-format sql --changelog-dir $(out_base) +$(gen): export odb_options += --database $(db_id) --generate-schema-only \ +--schema-format sql --suppress-migration --changelog-dir $(out_base) $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -47,6 +47,7 @@ ifdef STEP ifeq ($(STEP),1) $(gen): cpp_options += -DBVER=1 -DCVER=1 # Initialize. +$(gen): odb_options += --init-changelog # Suppress notice. else ifeq ($(STEP),2) $(gen): cpp_options += -DBVER=1 -DCVER=2 # Diff. else ifeq ($(STEP),3) diff --git a/common/makefile b/common/makefile index 3eb05e2..ebf969a 100644 --- a/common/makefile +++ b/common/makefile @@ -79,7 +79,7 @@ $(dist): name := $(name) $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export cxx11_dirs := $(cxx11_tests) -$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ +$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ $(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) diff --git a/evolution/Makefile.am b/evolution/Makefile.am new file mode 100644 index 0000000..1c12027 --- /dev/null +++ b/evolution/Makefile.am @@ -0,0 +1,6 @@ +# file : evolution/Makefile.am +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) +EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx new file mode 100644 index 0000000..7e9b2ad --- /dev/null +++ b/evolution/add-table/driver.cxx @@ -0,0 +1,107 @@ +// file : evolution/add-table/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new table (object, container). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + object1 o1; + o1.nums.push_back (1); + o1.nums.push_back (2); + o1.nums.push_back (3); + + { + transaction t (db->begin ()); + o1.o = db->load (1); + db->persist (o1); + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o->str == "abc")); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && + i->o->id_ == 1 && + i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); + assert (++i == e); + + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile new file mode 100644 index 0000000..36639ac --- /dev/null +++ b/evolution/add-table/makefile @@ -0,0 +1,142 @@ +# file : evolution/add-table/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_add_t_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx new file mode 100644 index 0000000..808e647 --- /dev/null +++ b/evolution/add-table/model.hxx @@ -0,0 +1,49 @@ +// file : evolution/add-table/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db object + struct object1 + { + object1 (): o (0) {} + ~object1 () {delete o;} + + #pragma db id auto + unsigned long id_; + + object* o; + std::vector nums; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx new file mode 100644 index 0000000..2e9b12d --- /dev/null +++ b/evolution/add-table/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-table/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx new file mode 100644 index 0000000..0de1de5 --- /dev/null +++ b/evolution/add-table/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-table/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx new file mode 100644 index 0000000..2a48ed5 --- /dev/null +++ b/evolution/drop-table/driver.cxx @@ -0,0 +1,111 @@ +// file : evolution/drop-table/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a table (object, container). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object1 o1; + o1.o = new object (1); + o1.o->str = "abc"; + o1.nums.push_back (1); + o1.nums.push_back (2); + o1.nums.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o1.o); + db->persist (o1); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; // @@ v3; soft immediate drop + + // Both object and object1 are still there so we can migrate the data. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o->str == "abc")); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && + i->o->id_ == 1 && + i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); + assert (++i == e); + + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + // Only object is still there. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc"); + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile new file mode 100644 index 0000000..be85fd6 --- /dev/null +++ b/evolution/drop-table/makefile @@ -0,0 +1,142 @@ +# file : evolution/drop-table/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_add_t_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx new file mode 100644 index 0000000..f5bbd9e --- /dev/null +++ b/evolution/drop-table/model.hxx @@ -0,0 +1,49 @@ +// file : evolution/drop-table/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + }; + +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (): o (0) {} + ~object1 () {delete o;} + + #pragma db id auto + unsigned long id_; + + object* o; + std::vector nums; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx new file mode 100644 index 0000000..c1319c8 --- /dev/null +++ b/evolution/drop-table/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-table/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx new file mode 100644 index 0000000..2178732 --- /dev/null +++ b/evolution/drop-table/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-table/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/evolution-vc10.sln b/evolution/evolution-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/evolution/evolution-vc10.sln @@ -0,0 +1,15 @@ + +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/evolution/evolution-vc11.sln b/evolution/evolution-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/evolution/evolution-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/evolution/evolution-vc9.sln b/evolution/evolution-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/evolution/evolution-vc9.sln @@ -0,0 +1,15 @@ + +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/evolution/makefile b/evolution/makefile new file mode 100644 index 0000000..f9e1d25 --- /dev/null +++ b/evolution/makefile @@ -0,0 +1,52 @@ +# file : evolution/makefile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : GNU GPL; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make + +tests := \ +add-table \ +drop-table \ +template + +default := $(out_base)/ +dist := $(out_base)/.dist +test := $(out_base)/.test +clean := $(out_base)/.clean + +all_tests := $(tests) +build_tests := $(tests) + +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) + +name := evolution +$(dist): name := $(name) +$(dist): data_dist := tester.bat +$(dist): exec_dist := tester +$(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) +$(dist): export extra_dist := $(data_dist) $(exec_dist) test.bat \ +$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) + $(call dist-data,$(data_dist)) + $(call dist-exec,$(exec_dist)) + $(call meta-automake) + $(call meta-vc9slns,$(name)) + $(call meta-vc10slns,$(name)) + $(call meta-vc11slns,$(name)) + $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) + +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) + +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc9sln.make) +$(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vctest.make) +$(call include,$(bld_root)/meta/automake.make) + +ifneq ($(filter $(MAKECMDGOALS),dist clean),) +$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) +else +$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) +endif diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am new file mode 100644 index 0000000..b5cd2d7 --- /dev/null +++ b/evolution/template/Makefile.am @@ -0,0 +1,49 @@ +# file : evolution/template/Makefile.am +# copyright : Copyright (c) 2009-2013 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) +LDADD = $(top_builddir)/libcommon/common/libcommon.la +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' +AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' + +TESTS=$(top_srcdir)/evolution/tester +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; + +ODB = @ODB@ +ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ + +if HAVE_CXX11 +ODBFLAGS += --std c++11 +endif + +# test1.hxx +# +driver_SOURCES += test1.hxx +nodist_driver_SOURCES = test1-odb.cxx +BUILT_SOURCES = test1-odb.hxx +CLEANFILES = test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml + +test1-odb.hxx: test1.hxx + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options1) --changelog model.xml $< + +# test2.hxx +# +driver_SOURCES += test2.hxx +nodist_driver_SOURCES += test2-odb.cxx +BUILT_SOURCES += test2-odb.hxx +CLEANFILES += test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql + +test2-odb.hxx: test2.hxx + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options2) --changelog model.xml $< + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +test2-odb.hxx: test1-odb.hxx +test1-odb.hxx test2-odb.hxx: model.hxx diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx new file mode 100644 index 0000000..1e2ad90 --- /dev/null +++ b/evolution/template/driver.cxx @@ -0,0 +1,100 @@ +// file : evolution/template/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + { + transaction t (db->begin ()); + dummy d (1); + db->persist (d); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + object o; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/template/makefile b/evolution/template/makefile new file mode 100644 index 0000000..0ac359f --- /dev/null +++ b/evolution/template/makefile @@ -0,0 +1,142 @@ +# file : evolution/template/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_template_ #@@ CHANGE THIS +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx new file mode 100644 index 0000000..ef6c9d0 --- /dev/null +++ b/evolution/template/model.hxx @@ -0,0 +1,41 @@ +// file : evolution/template/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 3 + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + }; +#endif + + // The presence of this object makes sure that there are no empty + // changesets and we get the complete set of migration files. + // + #pragma db object + struct dummy + { + dummy (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/template/template-vc10.vcxproj b/evolution/template/template-vc10.vcxproj new file mode 100644 index 0000000..d5e7ac8 --- /dev/null +++ b/evolution/template/template-vc10.vcxproj @@ -0,0 +1,187 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;test2-002-pre.sql;test2-002-post.sql;test2-003-pre.sql;test2-003-post.sql, +model.xml;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/evolution/template/template-vc10.vcxproj.filters b/evolution/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..c467cdc --- /dev/null +++ b/evolution/template/template-vc10.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/evolution/template/template-vc11.vcxproj b/evolution/template/template-vc11.vcxproj new file mode 100644 index 0000000..d3bfc99 --- /dev/null +++ b/evolution/template/template-vc11.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;test2-002-pre.sql;test2-002-post.sql;test2-003-pre.sql;test2-003-post.sql, +model.xml;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/evolution/template/template-vc11.vcxproj.filters b/evolution/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..c467cdc --- /dev/null +++ b/evolution/template/template-vc11.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/evolution/template/template-vc9.vcproj b/evolution/template/template-vc9.vcproj new file mode 100644 index 0000000..79cfb0a --- /dev/null +++ b/evolution/template/template-vc9.vcproj @@ -0,0 +1,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test1.hxx, +odb test1.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__file_entry__(test1-odb.hxx) +__file_entry__(test1-odb.ixx) +__file_entry_custom_build__( +test2.hxx, +odb test2.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;test2-002-pre.sql;test2-002-post.sql;test2-003-pre.sql;test2-003-post.sql, +model.xml;model.hxx) +__file_entry__(test2-odb.hxx) +__file_entry__(test2-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx new file mode 100644 index 0000000..668033d --- /dev/null +++ b/evolution/template/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/template/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx new file mode 100644 index 0000000..5b8e48c --- /dev/null +++ b/evolution/template/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/template/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/test.bat b/evolution/test.bat new file mode 100644 index 0000000..b86171c --- /dev/null +++ b/evolution/test.bat @@ -0,0 +1,80 @@ +@echo off +rem file : evolution/test.bat +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +setlocal + +set "tests=__path__(dirs) __path__(thread_dirs)" +set "confs=__path__(configurations)" +set "plats=__path__(platforms)" +set "curdir=%CD%" +set "topdir=%curdir%\.." +set "failed=" + +if "_%1_" == "__" ( + echo no database specified + goto usage +) + +goto start + +rem +rem %1 - test directory +rem %2 - configuration +rem %3 - platform +rem %4 - database +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%\evolution\tester.bat %4 %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 %1 + ) + ) +) + +if not "_%failed%_" == "__" goto error + +echo. +echo ALL TESTS PASSED +echo. +goto end + +:usage +echo. +echo usage: test.bat database +echo. + +:error +if not "_%failed%_" == "__" ( + echo. + for %%t in (%failed%) do echo FAILED: %%t + echo. +) +endlocal +exit /b 1 + +:end +endlocal diff --git a/evolution/tester b/evolution/tester new file mode 100755 index 0000000..5ccb839 --- /dev/null +++ b/evolution/tester @@ -0,0 +1,38 @@ +#! /bin/sh + +# file : evolution/tester.in +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# Run an evolution test. The test driver is in the current directory. The +# data files, if any, are in $srcdir. +# + +if test -f test1.sql; then + # Standalone schema. + # + + # Drop everything. + $top_builddir/db-driver test1.sql || exit 1 + $top_builddir/db-driver test2.sql || exit 1 + + # Base schema (-post is always empty). + $top_builddir/db-driver test2-002-pre.sql || exit 1 + ./driver --options-file "$top_builddir/db.options" 1 || exit 1 + + # Migration. + $top_builddir/db-driver test2-003-pre.sql || exit 1 + ./driver --options-file "$top_builddir/db.options" 2 || exit 1 + $top_builddir/db-driver test2-003-post.sql || exit 1 + + # Current schema. + ./driver --options-file "$top_builddir/db.options" 3 || exit 1 + +else + # Embedded schema. Just run the driver. + # + ./driver --options-file "$top_builddir/db.options" 1 || exit 1 + ./driver --options-file "$top_builddir/db.options" 2 || exit 1 + ./driver --options-file "$top_builddir/db.options" 3 || exit 1 +fi diff --git a/evolution/tester.bat b/evolution/tester.bat new file mode 100644 index 0000000..ea40b35 --- /dev/null +++ b/evolution/tester.bat @@ -0,0 +1,82 @@ +@echo off +rem file : evolution/tester.bat +rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem license : GNU GPL v2; see accompanying LICENSE file + +rem +rem Run an evolution test. The test directory is the current directory. +rem +rem %1 database +rem %2 configuration, for example, Debug or Release +rem %3 platform, for example Win32 or x64 +rem topdir variable containing the path to top project directory +rem + +setlocal + +set "PATH=%topdir%\libcommon\bin64;%topdir%\libcommon\bin;%PATH%" + +if "_%3_" == "_Win32_" ( + set "dir=%2" +) else ( + set "dir=%3\%2" +) + +if exist test*.sql ( + rem Standalone schema. + rem + + rem Drop everything. + rem + call %topdir%\%1-driver.bat test1.sql + if errorlevel 1 goto error + + call %topdir%\%1-driver.bat test2.sql + if errorlevel 1 goto error + + rem Base schema (-post is always empty). + rem + call %topdir%\%1-driver.bat test2-002-pre.sql + if errorlevel 1 goto error + + %dir%\driver.exe --options-file %topdir%\%1.options 1 + if errorlevel 1 goto error + + rem Migration. + rem + call %topdir%\%1-driver.bat test2-003-pre.sql + if errorlevel 1 goto error + + %dir%\driver.exe --options-file %topdir%\%1.options 2 + if errorlevel 1 goto error + + call %topdir%\%1-driver.bat test2-003-post.sql + if errorlevel 1 goto error + + rem Current schema. + rem + %dir%\driver.exe --options-file %topdir%\%1.options 3 + if errorlevel 1 goto error + +) else ( + + rem Embedded schema. Just run the driver. + rem + %dir%\driver.exe --options-file %topdir%\%1.options 1 + if errorlevel 1 goto error + + %dir%\driver.exe --options-file %topdir%\%1.options 2 + if errorlevel 1 goto error + + %dir%\driver.exe --options-file %topdir%\%1.options 3 + if errorlevel 1 goto error +) + +goto end + +:error +endlocal +exit /b 1 + +:end +endlocal diff --git a/makefile b/makefile index 1391a20..99c61e7 100644 --- a/makefile +++ b/makefile @@ -4,8 +4,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make -all_dirs := libcommon common mysql sqlite pgsql oracle mssql boost qt -dirs := common boost qt +all_dirs := libcommon common evolution mysql sqlite pgsql oracle mssql boost qt +dirs := common evolution boost qt dirs += $(db_id) default := $(out_base)/ diff --git a/test.bat b/test.bat index bb7b3a9..8e40afd 100644 --- a/test.bat +++ b/test.bat @@ -38,7 +38,7 @@ goto :eof :start -for %%d in (common %1 boost\common boost\%1 qt\common qt\%1) do ( +for %%d in (common evolution %1 boost\common boost\%1 qt\common qt\%1) do ( call :run_test %%d %1 ) -- cgit v1.1 From 31b400b73be9aa98c0fd448423677db212667c43 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Apr 2013 09:47:33 +0200 Subject: Generate add/drop index migration statements --- evolution/add-index/driver.cxx | 142 ++++++++++++++++++++++++++++++++++++++++ evolution/add-index/makefile | 142 ++++++++++++++++++++++++++++++++++++++++ evolution/add-index/model.hxx | 34 ++++++++++ evolution/add-index/test1.hxx | 12 ++++ evolution/add-index/test2.hxx | 12 ++++ evolution/drop-index/driver.cxx | 131 ++++++++++++++++++++++++++++++++++++ evolution/drop-index/makefile | 142 ++++++++++++++++++++++++++++++++++++++++ evolution/drop-index/model.hxx | 34 ++++++++++ evolution/drop-index/test1.hxx | 12 ++++ evolution/drop-index/test2.hxx | 12 ++++ evolution/makefile | 2 + 11 files changed, 675 insertions(+) create mode 100644 evolution/add-index/driver.cxx create mode 100644 evolution/add-index/makefile create mode 100644 evolution/add-index/model.hxx create mode 100644 evolution/add-index/test1.hxx create mode 100644 evolution/add-index/test2.hxx create mode 100644 evolution/drop-index/driver.cxx create mode 100644 evolution/drop-index/makefile create mode 100644 evolution/drop-index/model.hxx create mode 100644 evolution/drop-index/test1.hxx create mode 100644 evolution/drop-index/test2.hxx diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx new file mode 100644 index 0000000..e4a6e17 --- /dev/null +++ b/evolution/add-index/driver.cxx @@ -0,0 +1,142 @@ +// file : evolution/add-index/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new index. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o0 (0); + o0.num = 123; + + object o1 (1); + o1.num = 234; + + object o2 (2); + o2.num = 234; + + // Duplicates are ok. + // + { + transaction t (db->begin ()); + db->persist (o0); + db->persist (o1); + db->persist (o2); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + object o3 (3); + o3.num = 234; + + // Duplicates are still ok but we need to remove them before the + // post migration step. + // + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::num + "," + query::id)); + + unsigned long prev (0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->num == prev) + db->erase (*i); + + prev = i->num; + } + + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p0 (db->load (0)); + auto_ptr p1 (db->load (1)); + + assert (p0->num == 123); + assert (p1->num == 234); + + t.commit (); + } + + try + { + object o2 (2); + o2.num = 234; + + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile new file mode 100644 index 0000000..cf2beca --- /dev/null +++ b/evolution/add-index/makefile @@ -0,0 +1,142 @@ +# file : evolution/add-index/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_add_i_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx new file mode 100644 index 0000000..f268bc4 --- /dev/null +++ b/evolution/add-index/model.hxx @@ -0,0 +1,34 @@ +// file : evolution/add-index/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db unique +#endif + unsigned long num; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx new file mode 100644 index 0000000..bf8fa79 --- /dev/null +++ b/evolution/add-index/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-index/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx new file mode 100644 index 0000000..25e4401 --- /dev/null +++ b/evolution/add-index/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-index/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx new file mode 100644 index 0000000..0b85164 --- /dev/null +++ b/evolution/drop-index/driver.cxx @@ -0,0 +1,131 @@ +// file : evolution/drop-index/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping an index. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o0 (0); + o0.num = 123; + + object o1 (1); + o1.num = 234; + + object o2 (2); + o2.num = 234; + + { + transaction t (db->begin ()); + db->persist (o0); + db->persist (o1); + t.commit (); + } + + // Duplicates are not ok. + // + try + { + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + + break; + } + case 2: + { + using namespace v3; + + // Duplicates are now ok. + // + object o2 (2); + o2.num = 234; + + { + transaction t (db->begin ()); + db->persist (o2); + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p0 (db->load (0)); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + + assert (p0->num == 123); + assert (p1->num == 234); + assert (p2->num == 234); + + t.commit (); + } + + // Duplicates are still ok. + // + object o3 (3); + o3.num = 234; + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile new file mode 100644 index 0000000..4f407eb --- /dev/null +++ b/evolution/drop-index/makefile @@ -0,0 +1,142 @@ +# file : evolution/drop-index/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_drop_i_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx new file mode 100644 index 0000000..f3e5e2e --- /dev/null +++ b/evolution/drop-index/model.hxx @@ -0,0 +1,34 @@ +// file : evolution/drop-index/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + #pragma db unique +#endif + unsigned long num; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx new file mode 100644 index 0000000..bfac5ba --- /dev/null +++ b/evolution/drop-index/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-index/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx new file mode 100644 index 0000000..28198b5 --- /dev/null +++ b/evolution/drop-index/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-index/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/makefile b/evolution/makefile index f9e1d25..3cead91 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -7,6 +7,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ add-table \ drop-table \ +add-index \ +drop-index \ template default := $(out_base)/ -- cgit v1.1 From a72909d40ce4b10d8d5950bec8f52c8a561e4596 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Apr 2013 07:30:19 +0200 Subject: Generate add/drop column migration statements --- evolution/add-column/driver.cxx | 101 ++++++++++++++++++++++++++++ evolution/add-column/makefile | 142 +++++++++++++++++++++++++++++++++++++++ evolution/add-column/model.hxx | 39 +++++++++++ evolution/add-column/test1.hxx | 12 ++++ evolution/add-column/test2.hxx | 12 ++++ evolution/drop-column/driver.cxx | 97 ++++++++++++++++++++++++++ evolution/drop-column/makefile | 142 +++++++++++++++++++++++++++++++++++++++ evolution/drop-column/model.hxx | 37 ++++++++++ evolution/drop-column/test1.hxx | 12 ++++ evolution/drop-column/test2.hxx | 12 ++++ evolution/makefile | 12 ++-- 11 files changed, 613 insertions(+), 5 deletions(-) create mode 100644 evolution/add-column/driver.cxx create mode 100644 evolution/add-column/makefile create mode 100644 evolution/add-column/model.hxx create mode 100644 evolution/add-column/test1.hxx create mode 100644 evolution/add-column/test2.hxx create mode 100644 evolution/drop-column/driver.cxx create mode 100644 evolution/drop-column/makefile create mode 100644 evolution/drop-column/model.hxx create mode 100644 evolution/drop-column/test1.hxx create mode 100644 evolution/drop-column/test2.hxx diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx new file mode 100644 index 0000000..85a10f4 --- /dev/null +++ b/evolution/add-column/driver.cxx @@ -0,0 +1,101 @@ +// file : evolution/add-column/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (!p->str); + assert (p->num == 999); + + // Migration. + // + p->str = "abc"; + p->num = 123; + db->update (*p); + + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str && *p->str == "abc"); + assert (p->num == 123); + + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile new file mode 100644 index 0000000..62d3aa9 --- /dev/null +++ b/evolution/add-column/makefile @@ -0,0 +1,142 @@ +# file : evolution/add-column/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_add_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx new file mode 100644 index 0000000..e1e805a --- /dev/null +++ b/evolution/add-column/model.hxx @@ -0,0 +1,39 @@ +// file : evolution/add-column/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + odb::nullable str; + + #pragma db default(999) + unsigned long num; +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx new file mode 100644 index 0000000..fb62777 --- /dev/null +++ b/evolution/add-column/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-column/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx new file mode 100644 index 0000000..7aa2697 --- /dev/null +++ b/evolution/add-column/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-column/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx new file mode 100644 index 0000000..02d453c --- /dev/null +++ b/evolution/drop-column/driver.cxx @@ -0,0 +1,97 @@ +// file : evolution/drop-column/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; // @@ soft delete + + // Things are still there. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str == "abc"); + assert (p->num == 123); + + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Now they are gone. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile new file mode 100644 index 0000000..1e8945d --- /dev/null +++ b/evolution/drop-column/makefile @@ -0,0 +1,142 @@ +# file : evolution/drop-column/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_drop_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx new file mode 100644 index 0000000..0c54252 --- /dev/null +++ b/evolution/drop-column/model.hxx @@ -0,0 +1,37 @@ +// file : evolution/drop-column/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + std::string str; + unsigned long num; +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx new file mode 100644 index 0000000..af02f02 --- /dev/null +++ b/evolution/drop-column/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-column/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx new file mode 100644 index 0000000..8b91e72 --- /dev/null +++ b/evolution/drop-column/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-column/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/makefile b/evolution/makefile index 3cead91..7560ec0 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -4,11 +4,13 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -add-table \ -drop-table \ -add-index \ -drop-index \ +tests := \ +add-table \ +drop-table \ +add-column \ +drop-column \ +add-index \ +drop-index \ template default := $(out_base)/ -- cgit v1.1 From f0a8672c2128041001d6badba42ff672126581bb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Apr 2013 10:16:48 +0200 Subject: Generate alter column migration statements --- evolution/alter-column/driver.cxx | 116 +++++++++++++++++++++++++++++++ evolution/alter-column/makefile | 142 ++++++++++++++++++++++++++++++++++++++ evolution/alter-column/model.hxx | 50 ++++++++++++++ evolution/alter-column/test1.hxx | 12 ++++ evolution/alter-column/test2.hxx | 12 ++++ evolution/makefile | 15 ++-- 6 files changed, 340 insertions(+), 7 deletions(-) create mode 100644 evolution/alter-column/driver.cxx create mode 100644 evolution/alter-column/makefile create mode 100644 evolution/alter-column/model.hxx create mode 100644 evolution/alter-column/test1.hxx create mode 100644 evolution/alter-column/test2.hxx diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx new file mode 100644 index 0000000..28e6e7c --- /dev/null +++ b/evolution/alter-column/driver.cxx @@ -0,0 +1,116 @@ +// file : evolution/alter-column/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test altering a column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + // NULL is already in effect; NOT NULL is not yet. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (!p->str); + assert (p->num && *p->num == 123); + + // Migration. + // + p->str = "abc"; + p->num.reset (); + db->update (*p); + + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str && *p->str == "abc"); + assert (!p->num); + + t.commit (); + } + + // NOT NULL is now in effect. + // + try + { + object o2 (2); + + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile new file mode 100644 index 0000000..2a35005 --- /dev/null +++ b/evolution/alter-column/makefile @@ -0,0 +1,142 @@ +# file : evolution/alter-column/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_alter_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx new file mode 100644 index 0000000..c244eb0 --- /dev/null +++ b/evolution/alter-column/model.hxx @@ -0,0 +1,50 @@ +// file : evolution/alter-column/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + odb::nullable str; + + unsigned long num; + + #pragma db null + unsigned long dummy; // Test multiple ALTER COLUMN clauses. +#else + // Use nullable to be able to access during migration. + // + #pragma db not_null + odb::nullable str; + + odb::nullable num; + + unsigned long dummy; +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx new file mode 100644 index 0000000..cf08732 --- /dev/null +++ b/evolution/alter-column/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/alter-column/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx new file mode 100644 index 0000000..e99a465 --- /dev/null +++ b/evolution/alter-column/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/alter-column/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/makefile b/evolution/makefile index 7560ec0..6c38b0f 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -4,13 +4,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -add-table \ -drop-table \ -add-column \ -drop-column \ -add-index \ -drop-index \ +tests := \ +add-table \ +drop-table \ +add-column \ +drop-column \ +alter-column \ +add-index \ +drop-index \ template default := $(out_base)/ -- cgit v1.1 From 0429c7b008594a874696f91c29b17ae4ee40efff Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Apr 2013 12:27:59 +0200 Subject: Add NOT NULL column without default value initially as NULL --- evolution/alter-column/driver.cxx | 15 +++++++++++++++ evolution/alter-column/model.hxx | 9 +++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index 28e6e7c..193289f 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -63,11 +63,13 @@ main (int argc, char* argv[]) assert (!p->str); assert (p->num && *p->num == 123); + assert (!p->num1); // Migration. // p->str = "abc"; p->num.reset (); + p->num1 = 123; db->update (*p); t.commit (); @@ -93,12 +95,25 @@ main (int argc, char* argv[]) try { object o2 (2); + o2.num1 = 234; // str is NULL transaction t (db->begin ()); db->persist (o2); assert (false); } catch (const odb::exception& ) {} + + try + { + object o3 (3); + o3.str = "bcd"; // num1 is NULL + + transaction t (db->begin ()); + db->persist (o3); + assert (false); + } + catch (const odb::exception& ) {} + break; } default: diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index c244eb0..0b31e1c 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -30,9 +30,6 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) odb::nullable str; unsigned long num; - - #pragma db null - unsigned long dummy; // Test multiple ALTER COLUMN clauses. #else // Use nullable to be able to access during migration. // @@ -41,7 +38,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) odb::nullable num; - unsigned long dummy; + // Test adding NOT NULL column. It should be added NULL in pre + // and then converted to NOT NULL in post. + // + #pragma db not_null + odb::nullable num1; #endif }; } -- cgit v1.1 From acd66db1ce8aa960b34710857ce990dd048cd3ae Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Apr 2013 11:13:52 +0200 Subject: Generate add/drop foreign key migration statements Also add the --fkeys-deferrable-mode option. General schemas generation rework. --- common/changelog/add-foreign-key-diff.xml | 2 +- common/changelog/add-foreign-key-mssql-diff.xml | 2 +- common/changelog/add-foreign-key-mssql-patch.xml | 2 +- common/changelog/add-foreign-key-mysql-diff.xml | 2 +- common/changelog/add-foreign-key-mysql-patch.xml | 2 +- common/changelog/add-foreign-key-oracle-diff.xml | 2 +- common/changelog/add-foreign-key-oracle-patch.xml | 2 +- common/changelog/add-foreign-key-pgsql-diff.xml | 2 +- common/changelog/add-foreign-key-pgsql-patch.xml | 2 +- common/changelog/add-foreign-key-sqlite-diff.xml | 2 +- common/changelog/add-foreign-key-sqlite-patch.xml | 2 +- common/changelog/add-table-mssql-diff.xml | 2 +- common/changelog/add-table-mssql-patch.xml | 2 +- common/changelog/add-table-mysql-diff.xml | 2 +- common/changelog/add-table-mysql-patch.xml | 2 +- common/changelog/add-table-oracle-diff.xml | 2 +- common/changelog/add-table-oracle-patch.xml | 2 +- common/changelog/add-table-pgsql-diff.xml | 2 +- common/changelog/add-table-pgsql-patch.xml | 2 +- common/changelog/add-table-sqlite-diff.xml | 2 +- common/changelog/add-table-sqlite-patch.xml | 2 +- common/changelog/drop-foreign-key-mssql-diff.xml | 2 +- common/changelog/drop-foreign-key-mysql-diff.xml | 2 +- common/changelog/drop-foreign-key-oracle-diff.xml | 2 +- common/changelog/drop-foreign-key-pgsql-diff.xml | 2 +- common/changelog/drop-foreign-key-sqlite-diff.xml | 2 +- common/changelog/drop-table-mssql-diff.xml | 2 +- common/changelog/drop-table-mysql-diff.xml | 2 +- common/changelog/drop-table-oracle-diff.xml | 2 +- common/changelog/drop-table-pgsql-diff.xml | 2 +- common/changelog/drop-table-sqlite-diff.xml | 2 +- common/changelog/model-mssql.xml | 2 +- common/changelog/model-mysql.xml | 2 +- common/changelog/model-oracle.xml | 2 +- common/changelog/model-pgsql.xml | 2 +- common/changelog/model-sqlite.xml | 2 +- evolution/add-foreign-key/driver.cxx | 140 +++++++++++++++++++++ evolution/add-foreign-key/makefile | 143 ++++++++++++++++++++++ evolution/add-foreign-key/model.hxx | 61 +++++++++ evolution/add-foreign-key/test1.hxx | 12 ++ evolution/add-foreign-key/test2.hxx | 12 ++ evolution/drop-foreign-key/driver.cxx | 116 ++++++++++++++++++ evolution/drop-foreign-key/makefile | 143 ++++++++++++++++++++++ evolution/drop-foreign-key/model.hxx | 45 +++++++ evolution/drop-foreign-key/test1.hxx | 12 ++ evolution/drop-foreign-key/test2.hxx | 12 ++ evolution/drop-table/makefile | 2 +- evolution/makefile | 18 +-- 48 files changed, 743 insertions(+), 45 deletions(-) create mode 100644 evolution/add-foreign-key/driver.cxx create mode 100644 evolution/add-foreign-key/makefile create mode 100644 evolution/add-foreign-key/model.hxx create mode 100644 evolution/add-foreign-key/test1.hxx create mode 100644 evolution/add-foreign-key/test2.hxx create mode 100644 evolution/drop-foreign-key/driver.cxx create mode 100644 evolution/drop-foreign-key/makefile create mode 100644 evolution/drop-foreign-key/model.hxx create mode 100644 evolution/drop-foreign-key/test1.hxx create mode 100644 evolution/drop-foreign-key/test2.hxx diff --git a/common/changelog/add-foreign-key-diff.xml b/common/changelog/add-foreign-key-diff.xml index 34c0952..06079b8 100644 --- a/common/changelog/add-foreign-key-diff.xml +++ b/common/changelog/add-foreign-key-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-mssql-diff.xml b/common/changelog/add-foreign-key-mssql-diff.xml index 594f253..cc231a2 100644 --- a/common/changelog/add-foreign-key-mssql-diff.xml +++ b/common/changelog/add-foreign-key-mssql-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml index 17e5d14..e15f436 100644 --- a/common/changelog/add-foreign-key-mssql-patch.xml +++ b/common/changelog/add-foreign-key-mssql-patch.xml @@ -6,7 +6,7 @@ - + diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml index 594f253..cc231a2 100644 --- a/common/changelog/add-foreign-key-mysql-diff.xml +++ b/common/changelog/add-foreign-key-mysql-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml index 17e5d14..e15f436 100644 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -6,7 +6,7 @@ - + diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml index 14f2357..3131542 100644 --- a/common/changelog/add-foreign-key-oracle-diff.xml +++ b/common/changelog/add-foreign-key-oracle-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml index 6168736..7984282 100644 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -6,7 +6,7 @@ - + diff --git a/common/changelog/add-foreign-key-pgsql-diff.xml b/common/changelog/add-foreign-key-pgsql-diff.xml index 34c0952..06079b8 100644 --- a/common/changelog/add-foreign-key-pgsql-diff.xml +++ b/common/changelog/add-foreign-key-pgsql-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml index e70ad87..6422322 100644 --- a/common/changelog/add-foreign-key-pgsql-patch.xml +++ b/common/changelog/add-foreign-key-pgsql-patch.xml @@ -6,7 +6,7 @@ - + diff --git a/common/changelog/add-foreign-key-sqlite-diff.xml b/common/changelog/add-foreign-key-sqlite-diff.xml index 34c0952..06079b8 100644 --- a/common/changelog/add-foreign-key-sqlite-diff.xml +++ b/common/changelog/add-foreign-key-sqlite-diff.xml @@ -2,7 +2,7 @@ - + diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml index e70ad87..6422322 100644 --- a/common/changelog/add-foreign-key-sqlite-patch.xml +++ b/common/changelog/add-foreign-key-sqlite-patch.xml @@ -6,7 +6,7 @@ - + diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml index 8d3a95d..4e9c97f 100644 --- a/common/changelog/add-table-mssql-diff.xml +++ b/common/changelog/add-table-mssql-diff.xml @@ -7,7 +7,7 @@ - + diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml index 204a5a9..0edc34d 100644 --- a/common/changelog/add-table-mssql-patch.xml +++ b/common/changelog/add-table-mssql-patch.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml index 019e51c..f158c9c 100644 --- a/common/changelog/add-table-mysql-diff.xml +++ b/common/changelog/add-table-mysql-diff.xml @@ -7,7 +7,7 @@ - + diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index 127139a..1781451 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml index e04ba2b..642d06e 100644 --- a/common/changelog/add-table-oracle-diff.xml +++ b/common/changelog/add-table-oracle-diff.xml @@ -7,7 +7,7 @@ - + diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index b0e32c0..461f3eb 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml index 61c4985..6bec713 100644 --- a/common/changelog/add-table-pgsql-diff.xml +++ b/common/changelog/add-table-pgsql-diff.xml @@ -7,7 +7,7 @@ - + diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml index 33f8850..f20d442 100644 --- a/common/changelog/add-table-pgsql-patch.xml +++ b/common/changelog/add-table-pgsql-patch.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml index 97b7e24..3971906 100644 --- a/common/changelog/add-table-sqlite-diff.xml +++ b/common/changelog/add-table-sqlite-diff.xml @@ -7,7 +7,7 @@ - + diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml index 84c9d75..dd25b79 100644 --- a/common/changelog/add-table-sqlite-patch.xml +++ b/common/changelog/add-table-sqlite-patch.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/drop-foreign-key-mssql-diff.xml b/common/changelog/drop-foreign-key-mssql-diff.xml index 30dba42..6840f2e 100644 --- a/common/changelog/drop-foreign-key-mssql-diff.xml +++ b/common/changelog/drop-foreign-key-mssql-diff.xml @@ -13,7 +13,7 @@ - + diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml index 30dba42..6840f2e 100644 --- a/common/changelog/drop-foreign-key-mysql-diff.xml +++ b/common/changelog/drop-foreign-key-mysql-diff.xml @@ -13,7 +13,7 @@ - + diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml index 8a36172..b9dc4a8 100644 --- a/common/changelog/drop-foreign-key-oracle-diff.xml +++ b/common/changelog/drop-foreign-key-oracle-diff.xml @@ -13,7 +13,7 @@ - + diff --git a/common/changelog/drop-foreign-key-pgsql-diff.xml b/common/changelog/drop-foreign-key-pgsql-diff.xml index 8f7c6f1..6821cca 100644 --- a/common/changelog/drop-foreign-key-pgsql-diff.xml +++ b/common/changelog/drop-foreign-key-pgsql-diff.xml @@ -13,7 +13,7 @@ - + diff --git a/common/changelog/drop-foreign-key-sqlite-diff.xml b/common/changelog/drop-foreign-key-sqlite-diff.xml index 8f7c6f1..6821cca 100644 --- a/common/changelog/drop-foreign-key-sqlite-diff.xml +++ b/common/changelog/drop-foreign-key-sqlite-diff.xml @@ -13,7 +13,7 @@ - + diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml index 7d6779e..3f46d65 100644 --- a/common/changelog/drop-table-mssql-diff.xml +++ b/common/changelog/drop-table-mssql-diff.xml @@ -12,7 +12,7 @@ - + diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml index 4b223fb..5cf2490 100644 --- a/common/changelog/drop-table-mysql-diff.xml +++ b/common/changelog/drop-table-mysql-diff.xml @@ -12,7 +12,7 @@ - + diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml index 9334585..70c06a1 100644 --- a/common/changelog/drop-table-oracle-diff.xml +++ b/common/changelog/drop-table-oracle-diff.xml @@ -12,7 +12,7 @@ - + diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml index 18d01f6..6a4d523 100644 --- a/common/changelog/drop-table-pgsql-diff.xml +++ b/common/changelog/drop-table-pgsql-diff.xml @@ -12,7 +12,7 @@ - + diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml index 5277fd8..61d06d2 100644 --- a/common/changelog/drop-table-sqlite-diff.xml +++ b/common/changelog/drop-table-sqlite-diff.xml @@ -12,7 +12,7 @@ - + diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml index d9689a0..95bc102 100644 --- a/common/changelog/model-mssql.xml +++ b/common/changelog/model-mssql.xml @@ -10,7 +10,7 @@ - + diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml index ed46ebe..a6a811a 100644 --- a/common/changelog/model-mysql.xml +++ b/common/changelog/model-mysql.xml @@ -10,7 +10,7 @@ - + diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml index 756a355..73fb592 100644 --- a/common/changelog/model-oracle.xml +++ b/common/changelog/model-oracle.xml @@ -10,7 +10,7 @@ - + diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml index 6dad23b..8679129 100644 --- a/common/changelog/model-pgsql.xml +++ b/common/changelog/model-pgsql.xml @@ -10,7 +10,7 @@ - + diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml index 9f22af0..1690d2d 100644 --- a/common/changelog/model-sqlite.xml +++ b/common/changelog/model-sqlite.xml @@ -10,7 +10,7 @@ - + diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx new file mode 100644 index 0000000..0d62889 --- /dev/null +++ b/evolution/add-foreign-key/driver.cxx @@ -0,0 +1,140 @@ +// file : evolution/add-foreign-key/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a foreign key. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + // Both pointers are now NULL. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->o1 == 0 && p->o2 == 0); + + // Migration. The foreign key constraint is not yet there. + // + p->o1 = new object1 (1); + p->o2 = new object2 (1); + db->update (*p); + + t.commit (); + } + + // Migration. Add the missing objects. + // + object1 o1 (1); + object2 o2 (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->o1->id_ == 1); + assert (p->o2->id_ == 1); + t.commit (); + } + + // Now the foreign key constraint is there. + // + try + { + object o (2); + o.o1 = new object1 (2); + o.o2 = new object2 (2); + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} + + // As well as the NOT NULL. + // + try + { + object o (3); + o.o2 = 0; + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile new file mode 100644 index 0000000..88942b3 --- /dev/null +++ b/evolution/add-foreign-key/makefile @@ -0,0 +1,143 @@ +# file : evolution/add-foreign-key/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --fkeys-deferrable-mode \ +not_deferrable --table-prefix evo_add_fk_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx new file mode 100644 index 0000000..e73e47a --- /dev/null +++ b/evolution/add-foreign-key/model.hxx @@ -0,0 +1,61 @@ +// file : evolution/add-foreign-key/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 3 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; +#endif + + #pragma db object + struct object + { + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + object (unsigned long id = 0): id_ (id) {} +#else + object1* o1; + + #pragma db not_null + object2* o2; + + object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} + ~object () {delete o1; delete o2;} +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx new file mode 100644 index 0000000..c4281dc --- /dev/null +++ b/evolution/add-foreign-key/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-foreign-key/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx new file mode 100644 index 0000000..e2d8262 --- /dev/null +++ b/evolution/add-foreign-key/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-foreign-key/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx new file mode 100644 index 0000000..a63886b --- /dev/null +++ b/evolution/drop-foreign-key/driver.cxx @@ -0,0 +1,116 @@ +// file : evolution/drop-foreign-key/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a foreign key. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o (1); + o.o1 = new object (2); + o.o2 = new object (3); + + { + transaction t (db->begin ()); + db->persist (o.o1); + db->persist (o.o2); + db->persist (o); + t.commit (); + } + + // The foreign key constraint is there. + // + try + { + object o (11); + o.o1 = new object (12); + o.o2 = new object (13); + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} + break; + } + case 2: + { + using namespace v3; + + // The data is still there but the constraints are gone. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->o1 == 2); + assert (p->o2 == 3); + + db->erase (p->o1); + db->erase (p->o2); + + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->o1 == 2); + assert (p->o2 == 3); + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile new file mode 100644 index 0000000..6082e0f --- /dev/null +++ b/evolution/drop-foreign-key/makefile @@ -0,0 +1,143 @@ +# file : evolution/drop-foreign-key/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --fkeys-deferrable-mode \ +not_deferrable --table-prefix evo_drop_fk_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test1.sql) + $(call schema,$(out_base)/test2.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx new file mode 100644 index 0000000..4f41329 --- /dev/null +++ b/evolution/drop-foreign-key/model.hxx @@ -0,0 +1,45 @@ +// file : evolution/drop-foreign-key/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + object* o1; + object* o2; + + object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} + ~object () {delete o1; delete o2;} +#else + #pragma db null + unsigned long o1; + + #pragma db null + unsigned long o2; + + object (unsigned long id = 0): id_ (id) {} +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx new file mode 100644 index 0000000..572f0a7 --- /dev/null +++ b/evolution/drop-foreign-key/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-foreign-key/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx new file mode 100644 index 0000000..b445292 --- /dev/null +++ b/evolution/drop-foreign-key/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-foreign-key/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index be85fd6..def245e 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -42,7 +42,7 @@ gen := $(gen1) $(gen2) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_add_t_ +--generate-schema --omit-create --at-once --table-prefix evo_drop_t_ $(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ test1 --init-changelog --suppress-migration $(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ diff --git a/evolution/makefile b/evolution/makefile index 6c38b0f..867fd3e 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -4,14 +4,16 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -tests := \ -add-table \ -drop-table \ -add-column \ -drop-column \ -alter-column \ -add-index \ -drop-index \ +tests := \ +add-table \ +drop-table \ +add-column \ +drop-column \ +alter-column \ +add-foreign-key \ +drop-foreign-key \ +add-index \ +drop-index \ template default := $(out_base)/ -- cgit v1.1 From f57a6e7a73e425c2301e62b49c728c12ee801bcc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Apr 2013 15:41:25 +0200 Subject: Add combined schema evolution test --- evolution/combined/driver.cxx | 122 +++++++++++++++++++++++++++++++++ evolution/combined/makefile | 142 ++++++++++++++++++++++++++++++++++++++ evolution/combined/model.hxx | 156 ++++++++++++++++++++++++++++++++++++++++++ evolution/combined/test1.hxx | 12 ++++ evolution/combined/test2.hxx | 12 ++++ evolution/makefile | 1 + 6 files changed, 445 insertions(+) create mode 100644 evolution/combined/driver.cxx create mode 100644 evolution/combined/makefile create mode 100644 evolution/combined/model.hxx create mode 100644 evolution/combined/test1.hxx create mode 100644 evolution/combined/test2.hxx diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx new file mode 100644 index 0000000..c87b14e --- /dev/null +++ b/evolution/combined/driver.cxx @@ -0,0 +1,122 @@ +// file : evolution/combined/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Combined schema evolution test. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + object o ("1"); + o.dui = 1; + o.dfk = new object1 (1); + o.acn = 1; + o.anui = 1; + o.dnui = 1; + o.dt.push_back (1); + o.dc = 1; + o.acnn.reset (); + o.afk = 1; + o.aui = 1; + + { + transaction t (db->begin ()); + db->persist (o.dfk); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + + assert (p->ac1 == 999); + assert (!p->ac2); + assert (!p->ac3); + + // Migrate. + // + p->dfk = 999; + p->at.push_back ("abc"); + p->ac3 = 1; + p->acn.reset (); + p->acnn = 1; + + db->update (*p); + + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + + // Check post-migration. + // + assert (p->dfk == 999); + assert (p->at[0] == "abc"); + assert (*p->ac3 == 1); + assert (!p->acn); + assert (*p->acnn == 1); + + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/combined/makefile b/evolution/combined/makefile new file mode 100644 index 0000000..493f022 --- /dev/null +++ b/evolution/combined/makefile @@ -0,0 +1,142 @@ +# file : evolution/combined/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ +test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf := $(genf1) $(genf2) +gen := $(gen1) $(gen2) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --omit-create --at-once --table-prefix evo_comb_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ +test1 --init-changelog --suppress-migration +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ +test2 +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure test2.hxx is compiled before test1.hxx since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) + # Base schema (-post is always empty). + $(call schema,$(out_base)/test2-002-pre.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test2-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test2-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + +# 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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx new file mode 100644 index 0000000..2aede90 --- /dev/null +++ b/evolution/combined/model.hxx @@ -0,0 +1,156 @@ +// file : evolution/combined/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object + { + #pragma db id + std::string id_; + + // + // Pre pass 1. + // + + // Drop unique index. + // +#if MODEL_VERSION == 2 + #pragma db unique +#endif + unsigned long dui; + + // Alter table drop foreign key. + // +#if MODEL_VERSION == 2 + object1* dfk; +#else + #pragma db null + unsigned long dfk; +#endif + + // Add table. + // +#if MODEL_VERSION == 3 + std::vector at; +#endif + + // Add column. + // +#if MODEL_VERSION == 3 + #pragma db default(999) + unsigned long ac1; + + odb::nullable ac2; + + #pragma db not_null // Initially added as NULL, converted to NOT NULL. + odb::nullable ac3; +#endif + + // Alter column NULL. + // +#if MODEL_VERSION == 2 + unsigned long acn; +#else + odb::nullable acn; +#endif + + // + // Pre pass 2. + // + + // Add non-unique indexes. + // +#if MODEL_VERSION == 3 + #pragma db index +#endif + unsigned long anui; + + // + // Post pass 1. + // + + // Drop non-unique indexes. + // +#if MODEL_VERSION == 2 + #pragma db index +#endif + unsigned long dnui; + + // + // Post pass 2. + // + + // Drop table. + // +#if MODEL_VERSION == 2 + std::vector dt; +#endif + + // Drop column. + // +#if MODEL_VERSION == 2 + unsigned long dc; +#endif + + // Alter column NOT NULL. + // +#if MODEL_VERSION == 3 + #pragma db not_null +#endif + odb::nullable acnn; + + // Alter table add foreign key. + // +#if MODEL_VERSION == 2 + #pragma db null + unsigned long afk; +#else + object1* afk; +#endif + + // Add unique index. + // +#if MODEL_VERSION == 3 + #pragma db unique +#endif + unsigned long aui; + + public: +#if MODEL_VERSION == 2 + object (std::string id = ""): id_ (id), dfk (0) {} + ~object () {delete dfk;} +#else + object (std::string id = ""): id_ (id), afk (0) {} + ~object () {delete afk;} +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx new file mode 100644 index 0000000..ead9591 --- /dev/null +++ b/evolution/combined/test1.hxx @@ -0,0 +1,12 @@ +// file : evolution/combined/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx new file mode 100644 index 0000000..2c75fac --- /dev/null +++ b/evolution/combined/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/combined/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/makefile b/evolution/makefile index 867fd3e..9406d55 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -14,6 +14,7 @@ add-foreign-key \ drop-foreign-key \ add-index \ drop-index \ +combined \ template default := $(out_base)/ -- cgit v1.1 From 7d1e16930e37c4109f439f5ebe1e789b9619a57e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Apr 2013 15:41:43 +0200 Subject: First use drop statements corresponding to latest model Otherwise we may be dropping an object table that still has container tables referencing it. --- evolution/add-column/makefile | 2 +- evolution/add-foreign-key/makefile | 2 +- evolution/add-index/makefile | 2 +- evolution/add-table/makefile | 2 +- evolution/alter-column/makefile | 2 +- evolution/drop-column/makefile | 2 +- evolution/drop-foreign-key/makefile | 2 +- evolution/drop-index/makefile | 2 +- evolution/drop-table/makefile | 2 +- evolution/template/makefile | 2 +- evolution/tester | 2 +- evolution/tester.bat | 4 ++-- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 62d3aa9..f6dd0f3 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 88942b3..d06a50e 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -87,8 +87,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index cf2beca..32e2e04 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 36639ac..76cb897 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 2a35005..fffbef8 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 1e8945d..af51386 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 6082e0f..97509a6 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -87,8 +87,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 4f407eb..e96b66d 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index def245e..091a679 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/template/makefile b/evolution/template/makefile index 0ac359f..a914292 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -86,8 +86,8 @@ $(dist): # $(test): $(driver) # Drop everything. - $(call schema,$(out_base)/test1.sql) $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) # Base schema (-post is always empty). $(call schema,$(out_base)/test2-002-pre.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) diff --git a/evolution/tester b/evolution/tester index 5ccb839..3f9e7e8 100755 --- a/evolution/tester +++ b/evolution/tester @@ -14,8 +14,8 @@ if test -f test1.sql; then # # Drop everything. - $top_builddir/db-driver test1.sql || exit 1 $top_builddir/db-driver test2.sql || exit 1 + $top_builddir/db-driver test1.sql || exit 1 # Base schema (-post is always empty). $top_builddir/db-driver test2-002-pre.sql || exit 1 diff --git a/evolution/tester.bat b/evolution/tester.bat index ea40b35..5b949b4 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -28,10 +28,10 @@ if exist test*.sql ( rem Drop everything. rem - call %topdir%\%1-driver.bat test1.sql + call %topdir%\%1-driver.bat test2.sql if errorlevel 1 goto error - call %topdir%\%1-driver.bat test2.sql + call %topdir%\%1-driver.bat test1.sql if errorlevel 1 goto error rem Base schema (-post is always empty). -- cgit v1.1 From b0c2c30dd0b83ea67fb2c8375ae2061dad0d1770 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Apr 2013 16:17:27 +0200 Subject: Add support for embedded schema migration --- evolution/add-column/driver.cxx | 27 +++++++++++++++++- evolution/add-column/makefile | 9 +++--- evolution/add-foreign-key/driver.cxx | 36 ++++++++++++++++++++++- evolution/add-foreign-key/makefile | 9 +++--- evolution/add-foreign-key/model.hxx | 4 +++ evolution/add-index/driver.cxx | 26 ++++++++++++++++- evolution/add-index/makefile | 9 +++--- evolution/add-table/driver.cxx | 26 ++++++++++++++++- evolution/add-table/makefile | 9 +++--- evolution/alter-column/driver.cxx | 32 ++++++++++++++++++++- evolution/alter-column/makefile | 9 +++--- evolution/alter-column/model.hxx | 6 ++++ evolution/combined/driver.cxx | 54 +++++++++++++++++++++++++++++------ evolution/combined/makefile | 9 +++--- evolution/combined/model.hxx | 33 +++++++++++++++++---- evolution/drop-column/driver.cxx | 32 ++++++++++++++++++++- evolution/drop-column/makefile | 9 +++--- evolution/drop-column/model.hxx | 6 ++++ evolution/drop-foreign-key/driver.cxx | 32 ++++++++++++++++++++- evolution/drop-foreign-key/makefile | 9 +++--- evolution/drop-foreign-key/model.hxx | 6 ++++ evolution/drop-index/driver.cxx | 26 ++++++++++++++++- evolution/drop-index/makefile | 9 +++--- evolution/drop-table/driver.cxx | 26 ++++++++++++++++- evolution/drop-table/makefile | 9 +++--- evolution/template/driver.cxx | 27 +++++++++++++++++- evolution/template/makefile | 9 +++--- 27 files changed, 429 insertions(+), 69 deletions(-) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 85a10f4..3503010 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); { @@ -54,6 +65,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + { transaction t (db->begin ()); auto_ptr p (db->load (1)); @@ -69,6 +87,13 @@ main (int argc, char* argv[]) t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index f6dd0f3..5e64a45 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index 0d62889..26c1f57 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -11,7 +11,9 @@ #include #include +#include +#include // DATABASE_XXX #include #include "test1.hxx" @@ -27,7 +29,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +44,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); { @@ -54,6 +66,20 @@ main (int argc, char* argv[]) { using namespace v3; +#ifdef DATABASE_SQLITE + // In SQLite we can only add foreign keys inline in the column + // definition. + // + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // Both pointers are now NULL. // { @@ -83,6 +109,12 @@ main (int argc, char* argv[]) t.commit (); } + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: @@ -113,6 +145,7 @@ main (int argc, char* argv[]) // As well as the NOT NULL. // +#ifndef DATABASE_SQLITE try { object o (3); @@ -123,6 +156,7 @@ main (int argc, char* argv[]) assert (false); } catch (const odb::exception& ) {} +#endif break; } default: diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index d06a50e..165cf37 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -114,7 +115,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index e73e47a..6b116e9 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -48,7 +48,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #else object1* o1; + // There is no support for changing a column to NOT NULL in SQLite. + // +#ifndef ODB_DATABASE_SQLITE #pragma db not_null +#endif object2* o2; object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index e4a6e17..ba9f837 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o0 (0); o0.num = 123; @@ -65,6 +76,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + object o3 (3); o3.num = 234; @@ -97,6 +115,12 @@ main (int argc, char* argv[]) t.commit (); } + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 32e2e04..1fe6f0a 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index 7e9b2ad..d64e991 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); o.str = "abc"; @@ -55,6 +66,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + object1 o1; o1.nums.push_back (1); o1.nums.push_back (2); @@ -67,6 +85,12 @@ main (int argc, char* argv[]) t.commit (); } + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 76cb897..a645e7d 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index 193289f..976f539 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,12 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + + // SQLite doesn't support altering of columns. + // +#ifndef DATABASE_SQLITE + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +47,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); o.num = 123; @@ -55,6 +70,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // NULL is already in effect; NOT NULL is not yet. // { @@ -74,6 +96,13 @@ main (int argc, char* argv[]) t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: @@ -122,6 +151,7 @@ main (int argc, char* argv[]) return 1; } } +#endif // DATABASE_SQLITE } catch (const odb::exception& e) { diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index fffbef8..de0d3e0 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index 0b31e1c..a9a3aeb 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -11,6 +11,8 @@ #include #include +#include // DATABASE_XXX + #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -26,6 +28,9 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db id unsigned long id_; + // SQLite doesn't support altering of columns. + // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 odb::nullable str; @@ -44,6 +49,7 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db not_null odb::nullable num1; #endif +#endif }; } diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index c87b14e..9cb2853 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,21 +43,35 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o ("1"); o.dui = 1; - o.dfk = new object1 (1); - o.acn = 1; o.anui = 1; o.dnui = 1; o.dt.push_back (1); + o.aui = 1; + +#ifndef DATABASE_SQLITE + o.dfk = new object1 (1); + o.acn = 1; o.dc = 1; o.acnn.reset (); o.afk = 1; - o.aui = 1; +#endif { transaction t (db->begin ()); +#ifndef DATABASE_SQLITE db->persist (o.dfk); +#endif db->persist (o); t.commit (); } @@ -65,26 +81,44 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + { transaction t (db->begin ()); auto_ptr p (db->load ("1")); assert (p->ac1 == 999); assert (!p->ac2); - assert (!p->ac3); +#ifndef DATABASE_SQLITE + assert (!p->ac3); +#endif // Migrate. // - p->dfk = 999; p->at.push_back ("abc"); + +#ifndef DATABASE_SQLITE + p->dfk = 999; p->ac3 = 1; p->acn.reset (); p->acnn = 1; - +#endif db->update (*p); t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: @@ -97,12 +131,14 @@ main (int argc, char* argv[]) // Check post-migration. // - assert (p->dfk == 999); assert (p->at[0] == "abc"); + +#ifndef DATABASE_SQLITE + assert (p->dfk == 999); assert (*p->ac3 == 1); assert (!p->acn); assert (*p->acnn == 1); - +#endif t.commit (); } break; diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 493f022..a489287 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 2aede90..2cdc9d7 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -12,6 +12,8 @@ #include #include +#include // DATABASE_XXX + #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -45,14 +47,16 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif unsigned long dui; - // Alter table drop foreign key. + // Alter table drop foreign key. Not supported by SQLite. // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 object1* dfk; #else #pragma db null unsigned long dfk; #endif +#endif // Add table. // @@ -68,17 +72,23 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) odb::nullable ac2; - #pragma db not_null // Initially added as NULL, converted to NOT NULL. + // Initially added as NULL, converted to NOT NULL. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE + #pragma db not_null odb::nullable ac3; #endif +#endif - // Alter column NULL. + // Alter column NULL. Not supported by SQLite. // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 unsigned long acn; #else odb::nullable acn; #endif +#endif // // Pre pass 2. @@ -112,27 +122,33 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::vector dt; #endif - // Drop column. + // Drop column. Not supported by SQLite. // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 unsigned long dc; #endif +#endif - // Alter column NOT NULL. + // Alter column NOT NULL. Not supported by SQLite. // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 3 #pragma db not_null #endif odb::nullable acnn; +#endif - // Alter table add foreign key. + // Alter table add foreign key. Not supported by SQLite. // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 #pragma db null unsigned long afk; #else object1* afk; #endif +#endif // Add unique index. // @@ -142,13 +158,18 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) unsigned long aui; public: +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 + object (std::string id = ""): id_ (id), dfk (0) {} ~object () {delete dfk;} #else object (std::string id = ""): id_ (id), afk (0) {} ~object () {delete afk;} #endif +#else + object (std::string id = ""): id_ (id) {} +#endif }; } diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 02d453c..2fddf3a 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,12 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +47,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); o.str = "abc"; o.num = 123; @@ -56,6 +71,13 @@ main (int argc, char* argv[]) { using namespace v2; // @@ soft delete + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // Things are still there. // { @@ -67,6 +89,13 @@ main (int argc, char* argv[]) t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: @@ -88,6 +117,7 @@ main (int argc, char* argv[]) return 1; } } +#endif // DATABASE_SQLITE } catch (const odb::exception& e) { diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index af51386..6bc42fd 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index 0c54252..42a8f54 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -11,6 +11,8 @@ #include #include +#include // DATABASE_XXX + #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -26,10 +28,14 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db id unsigned long id_; + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 std::string str; unsigned long num; #endif +#endif }; } diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index a63886b..8fe332b 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,12 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + + // SQLite doesn't support dropping of foreign keys. + // +#ifndef DATABASE_SQLITE + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +47,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o (1); o.o1 = new object (2); o.o2 = new object (3); @@ -72,6 +87,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // The data is still there but the constraints are gone. // { @@ -86,6 +108,13 @@ main (int argc, char* argv[]) t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: @@ -107,6 +136,7 @@ main (int argc, char* argv[]) return 1; } } +#endif // DATABASE_SQLITE } catch (const odb::exception& e) { diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 97509a6..d83546b 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -114,7 +115,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index 4f41329..b58aa92 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -10,6 +10,8 @@ #include +#include // DATABASE_XXX + #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -23,6 +25,9 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db id unsigned long id_; + // SQLite doesn't support dropping of foreign keys. + // +#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 object* o1; object* o2; @@ -38,6 +43,7 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) object (unsigned long id = 0): id_ (id) {} #endif +#endif }; } diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 0b85164..f0740ef 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object o0 (0); o0.num = 123; @@ -73,6 +84,13 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // Duplicates are now ok. // object o2 (2); @@ -84,6 +102,12 @@ main (int argc, char* argv[]) t.commit (); } + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index e96b66d..fc45fdb 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 2a48ed5..6ab29f0 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + object1 o1; o1.o = new object (1); o1.o->str = "abc"; @@ -60,6 +71,13 @@ main (int argc, char* argv[]) { using namespace v2; // @@ v3; soft immediate drop + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + // Both object and object1 are still there so we can migrate the data. // typedef odb::query query; @@ -79,6 +97,12 @@ main (int argc, char* argv[]) t.commit (); } + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 091a679..a08f0a1 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 1e2ad90..357055d 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -11,6 +11,7 @@ #include #include +#include #include @@ -27,7 +28,8 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db, "test2")); // 1 - base version // 2 - migration @@ -41,6 +43,15 @@ main (int argc, char* argv[]) { using namespace v2; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "test2"); + schema_catalog::create_schema (*db, "test1"); + schema_catalog::migrate_schema (*db, 2, "test2"); + t.commit (); + } + { transaction t (db->begin ()); dummy d (1); @@ -53,11 +64,25 @@ main (int argc, char* argv[]) { using namespace v3; + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3, "test2"); + t.commit (); + } + { transaction t (db->begin ()); auto_ptr p (db->load (1)); t.commit (); } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3, "test2"); + t.commit (); + } break; } case 3: diff --git a/evolution/template/makefile b/evolution/template/makefile index a914292..c3fc5f7 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -29,15 +29,16 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) genf := $(genf1) $(genf2) gen := $(gen1) $(gen2) +gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ +test2-003-pre.sql test2-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) @@ -113,7 +114,7 @@ $(clean): \ ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) +$(out_base)/.gitignore: files := driver $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) -- cgit v1.1 From 502926d96b0b5d79dc639b8388fbf19b11cda277 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 10 Apr 2013 18:51:59 +0200 Subject: Fix invalid option format in documentation --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index ba1251c..c0f6c60 100644 --- a/INSTALL +++ b/INSTALL @@ -32,7 +32,7 @@ After unpacking the source code archive, change to the odb-tests package directory (referred to as odb-tests/ from now on) and run the configure script, for example: -./configure --with-database +./configure --with-database= To see the available configuration options run configure with --help: -- cgit v1.1 From 40ae3082645ed3790eb1d5d6f04fb2ca36c19187 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Apr 2013 07:35:45 +0200 Subject: Add support for schema version table --- evolution/add-column/driver.cxx | 17 +-- evolution/add-column/makefile | 43 +++--- evolution/add-column/test1.hxx | 4 +- evolution/add-column/test2.hxx | 2 +- evolution/add-column/test3.hxx | 12 ++ evolution/add-foreign-key/driver.cxx | 17 +-- evolution/add-foreign-key/makefile | 45 ++++--- evolution/add-foreign-key/test1.hxx | 4 +- evolution/add-foreign-key/test2.hxx | 2 +- evolution/add-foreign-key/test3.hxx | 12 ++ evolution/add-index/driver.cxx | 17 +-- evolution/add-index/makefile | 43 +++--- evolution/add-index/test1.hxx | 4 +- evolution/add-index/test2.hxx | 2 +- evolution/add-index/test3.hxx | 12 ++ evolution/add-table/driver.cxx | 17 +-- evolution/add-table/makefile | 43 +++--- evolution/add-table/test1.hxx | 4 +- evolution/add-table/test2.hxx | 2 +- evolution/add-table/test3.hxx | 12 ++ evolution/alter-column/driver.cxx | 17 +-- evolution/alter-column/makefile | 43 +++--- evolution/alter-column/test1.hxx | 4 +- evolution/alter-column/test2.hxx | 2 +- evolution/alter-column/test3.hxx | 12 ++ evolution/combined/driver.cxx | 17 +-- evolution/combined/makefile | 43 +++--- evolution/combined/test1.hxx | 4 +- evolution/combined/test2.hxx | 2 +- evolution/combined/test3.hxx | 12 ++ evolution/drop-column/driver.cxx | 17 +-- evolution/drop-column/makefile | 43 +++--- evolution/drop-column/test1.hxx | 4 +- evolution/drop-column/test2.hxx | 2 +- evolution/drop-column/test3.hxx | 12 ++ evolution/drop-foreign-key/driver.cxx | 17 +-- evolution/drop-foreign-key/makefile | 45 ++++--- evolution/drop-foreign-key/test1.hxx | 4 +- evolution/drop-foreign-key/test2.hxx | 2 +- evolution/drop-foreign-key/test3.hxx | 12 ++ evolution/drop-index/driver.cxx | 17 +-- evolution/drop-index/makefile | 43 +++--- evolution/drop-index/test1.hxx | 4 +- evolution/drop-index/test2.hxx | 2 +- evolution/drop-index/test3.hxx | 12 ++ evolution/drop-table/driver.cxx | 17 +-- evolution/drop-table/makefile | 43 +++--- evolution/drop-table/test1.hxx | 4 +- evolution/drop-table/test2.hxx | 2 +- evolution/drop-table/test3.hxx | 12 ++ evolution/embedded/driver.cxx | 160 +++++++++++++++++++++++ evolution/embedded/makefile | 139 ++++++++++++++++++++ evolution/embedded/model.hxx | 46 +++++++ evolution/embedded/test1.hxx | 10 ++ evolution/embedded/test2.hxx | 12 ++ evolution/embedded/test3.hxx | 12 ++ evolution/makefile | 2 + evolution/template/Makefile.am | 23 +++- evolution/template/driver.cxx | 17 +-- evolution/template/makefile | 43 +++--- evolution/template/template-vc10.vcxproj | 13 +- evolution/template/template-vc10.vcxproj.filters | 4 + evolution/template/template-vc11.vcxproj | 13 +- evolution/template/template-vc11.vcxproj.filters | 4 + evolution/template/template-vc9.vcproj | 13 +- evolution/template/test1.hxx | 4 +- evolution/template/test2.hxx | 2 +- evolution/template/test3.hxx | 12 ++ evolution/tester | 10 +- evolution/tester.bat | 14 +- evolution/version/driver.cxx | 158 ++++++++++++++++++++++ evolution/version/makefile | 150 +++++++++++++++++++++ evolution/version/model.hxx | 46 +++++++ evolution/version/test1.hxx | 10 ++ evolution/version/test2.hxx | 12 ++ evolution/version/test3.hxx | 12 ++ 76 files changed, 1373 insertions(+), 352 deletions(-) create mode 100644 evolution/add-column/test3.hxx create mode 100644 evolution/add-foreign-key/test3.hxx create mode 100644 evolution/add-index/test3.hxx create mode 100644 evolution/add-table/test3.hxx create mode 100644 evolution/alter-column/test3.hxx create mode 100644 evolution/combined/test3.hxx create mode 100644 evolution/drop-column/test3.hxx create mode 100644 evolution/drop-foreign-key/test3.hxx create mode 100644 evolution/drop-index/test3.hxx create mode 100644 evolution/drop-table/test3.hxx create mode 100644 evolution/embedded/driver.cxx create mode 100644 evolution/embedded/makefile create mode 100644 evolution/embedded/model.hxx create mode 100644 evolution/embedded/test1.hxx create mode 100644 evolution/embedded/test2.hxx create mode 100644 evolution/embedded/test3.hxx create mode 100644 evolution/template/test3.hxx create mode 100644 evolution/version/driver.cxx create mode 100644 evolution/version/makefile create mode 100644 evolution/version/model.hxx create mode 100644 evolution/version/test1.hxx create mode 100644 evolution/version/test2.hxx create mode 100644 evolution/version/test3.hxx diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 3503010..a619895 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -68,7 +69,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -91,7 +92,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 5e64a45..0447ad4 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_add_c_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_add_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index fb62777..23470b9 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index 7aa2697..0f286b7 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx new file mode 100644 index 0000000..88051d3 --- /dev/null +++ b/evolution/add-column/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-column/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index 26c1f57..a05804a 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -16,10 +16,10 @@ #include // DATABASE_XXX #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -30,7 +30,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -47,9 +47,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -76,7 +77,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -112,7 +113,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 165cf37..c4eaef2 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,37 +29,42 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --fkeys-deferrable-mode \ -not_deferrable --table-prefix evo_add_fk_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ +--table-prefix evo_add_fk_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -88,15 +93,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -108,14 +115,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index c4281dc..0c82e25 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index e2d8262..a1ba8df 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx new file mode 100644 index 0000000..c24a09c --- /dev/null +++ b/evolution/add-foreign-key/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-foreign-key/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index ba9f837..bb369e5 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -79,7 +80,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -118,7 +119,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 1fe6f0a..26ba8f0 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_add_i_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_add_i_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index bf8fa79..213ce2f 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index 25e4401..db1e85c 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx new file mode 100644 index 0000000..34f074a --- /dev/null +++ b/evolution/add-index/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-index/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index d64e991..163fe30 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -69,7 +70,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -88,7 +89,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index a645e7d..8bcacb1 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_add_t_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_add_t_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index 2e9b12d..c91193e 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index 0de1de5..96983e5 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx new file mode 100644 index 0000000..e709f25 --- /dev/null +++ b/evolution/add-table/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/add-table/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index 976f539..a51d09a 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // SQLite doesn't support altering of columns. // #ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -50,9 +50,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -73,7 +74,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -100,7 +101,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index de0d3e0..f1cef39 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_alter_c_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_alter_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index cf08732..43297b9 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index e99a465..3c01eeb 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx new file mode 100644 index 0000000..f17b630 --- /dev/null +++ b/evolution/alter-column/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/alter-column/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index 9cb2853..8eb3eb2 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -84,7 +85,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -116,7 +117,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/combined/makefile b/evolution/combined/makefile index a489287..81bfd3a 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_comb_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_comb_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index ead9591..af73407 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 2c75fac..753b673 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx new file mode 100644 index 0000000..26626a3 --- /dev/null +++ b/evolution/combined/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/combined/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 2fddf3a..099fe0f 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // SQLite doesn't support dropping of columns. // #ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -50,9 +50,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -74,7 +75,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -93,7 +94,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 6bc42fd..5c02c01 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_drop_c_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_drop_c_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index af02f02..91df52e 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index 8b91e72..7adb321 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx new file mode 100644 index 0000000..55be2a2 --- /dev/null +++ b/evolution/drop-column/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-column/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index 8fe332b..bd42f5d 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // SQLite doesn't support dropping of foreign keys. // #ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -50,9 +50,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -90,7 +91,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -112,7 +113,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index d83546b..db62bfa 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,37 +29,42 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --fkeys-deferrable-mode \ -not_deferrable --table-prefix evo_drop_fk_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ +--table-prefix evo_drop_fk_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -88,15 +93,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -108,14 +115,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index 572f0a7..0748126 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index b445292..c620179 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx new file mode 100644 index 0000000..f9f1947 --- /dev/null +++ b/evolution/drop-foreign-key/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-foreign-key/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index f0740ef..7a04322 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -87,7 +88,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -105,7 +106,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index fc45fdb..1bda96f 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_drop_i_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_drop_i_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index bfac5ba..6fb8583 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index 28198b5..d4722d2 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx new file mode 100644 index 0000000..e672f15 --- /dev/null +++ b/evolution/drop-index/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-index/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 6ab29f0..1eca664 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -74,7 +75,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -100,7 +101,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index a08f0a1..a9ad2f9 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_drop_t_ -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_drop_t_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index c1319c8..4e2413c 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index 2178732..d842d5b 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx new file mode 100644 index 0000000..9fde448 --- /dev/null +++ b/evolution/drop-table/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/drop-table/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx new file mode 100644 index 0000000..964af16 --- /dev/null +++ b/evolution/embedded/driver.cxx @@ -0,0 +1,160 @@ +// file : evolution/embedded/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test embedded schema migration. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + t.commit (); + } + + // PostgreSQL cannot continue a transaction after a query failed. + // + assert (db->schema_version () == 0); + + { + transaction t (db->begin ()); + schema_catalog::create_schema (*db, "", false); + + assert (db->schema_version () == 1 && !db->schema_migration ()); + + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + assert (db->schema_version () == 2 && !db->schema_migration ()); + + { + transaction t (db->begin ()); + object1 o1 (1); + o1.num = 123; + db->persist (o1); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; + using namespace v3; + + { + assert (db->schema_version () == 2 && !db->schema_migration ()); + + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + assert (db->schema_version () == 3 && db->schema_migration ()); + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + object2 o2 (1); + o2.num = o1->num; + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + + assert (db->schema_version () == 3 && !db->schema_migration ()); + } + break; + } + case 3: + { + using namespace v3; + + // In transaction. + // + { + transaction t (db->begin ()); + assert (db->schema_version () == 3 && !db->schema_migration ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + t.commit (); + } + + // Test the case where there is still no version table. + // + db->schema_version (0, false); + + { + transaction t (db->begin ()); + +#ifdef DATABASE_ORACLE + db->execute ("DROP TABLE \"schema_version\""); +#else + db->execute ("DROP TABLE schema_version"); +#endif + t.commit (); + } + + assert (db->schema_version () == 0); + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile new file mode 100644 index 0000000..dfa675a --- /dev/null +++ b/evolution/embedded/makefile @@ -0,0 +1,139 @@ +# file : evolution/embedded/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.hxx test3.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --schema-format embedded --at-once --table-prefix evo_embedded_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure testN.hxx are compiled serially since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen3): $(gen2) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Base schema. + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver model.xml $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx new file mode 100644 index 0000000..f5e6beb --- /dev/null +++ b/evolution/embedded/model.hxx @@ -0,0 +1,46 @@ +// file : evolution/embedded/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx new file mode 100644 index 0000000..6e7748d --- /dev/null +++ b/evolution/embedded/test1.hxx @@ -0,0 +1,10 @@ +// file : evolution/embedded/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx new file mode 100644 index 0000000..78578e4 --- /dev/null +++ b/evolution/embedded/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/embedded/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx new file mode 100644 index 0000000..ce613b6 --- /dev/null +++ b/evolution/embedded/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/embedded/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 9406d55..98816a3 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -15,6 +15,8 @@ drop-foreign-key \ add-index \ drop-index \ combined \ +embedded \ +version \ template default := $(out_base)/ diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index b5cd2d7..2d71bc3 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -34,16 +34,27 @@ test1-odb.hxx: test1.hxx # test2.hxx # driver_SOURCES += test2.hxx -nodist_driver_SOURCES += test2-odb.cxx -BUILT_SOURCES += test2-odb.hxx -CLEANFILES += test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql \ -test2-002-pre.sql test2-002-post.sql test2-003-pre.sql test2-003-post.sql +nodist_driver_SOURCES = test2-odb.cxx +BUILT_SOURCES = test2-odb.hxx +CLEANFILES = test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql test2-odb.hxx: test2.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options2) --changelog model.xml $< -# Make sure test2.hxx is compiled before test1.hxx since they share the +# test3.hxx +# +driver_SOURCES += test3.hxx +nodist_driver_SOURCES += test3-odb.cxx +BUILT_SOURCES += test3-odb.hxx +CLEANFILES += test3-odb.hxx test3-odb.ixx test3-odb.cxx test3.sql \ +test3-002-pre.sql test3-002-post.sql test3-003-pre.sql test3-003-post.sql + +test3-odb.hxx: test3.hxx + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options3) --changelog model.xml $< + +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # test2-odb.hxx: test1-odb.hxx -test1-odb.hxx test2-odb.hxx: model.hxx +test3-odb.hxx: test2-odb.hxx +test1-odb.hxx test2-odb.hxx test3-odb.hxx: model.hxx diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 357055d..b2ff10e 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -15,10 +15,10 @@ #include -#include "test1.hxx" #include "test2.hxx" -#include "test1-odb.hxx" +#include "test3.hxx" #include "test2-odb.hxx" +#include "test3-odb.hxx" using namespace std; using namespace odb::core; @@ -29,7 +29,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db, "test2")); + bool embedded (schema_catalog::exists (*db)); // 1 - base version // 2 - migration @@ -46,9 +46,10 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::create_schema (*db, "test2"); - schema_catalog::create_schema (*db, "test1"); - schema_catalog::migrate_schema (*db, 2, "test2"); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); t.commit (); } @@ -67,7 +68,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3, "test2"); + schema_catalog::migrate_schema_pre (*db, 3); t.commit (); } @@ -80,7 +81,7 @@ main (int argc, char* argv[]) if (embedded) { transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3, "test2"); + schema_catalog::migrate_schema_post (*db, 3); t.commit (); } break; diff --git a/evolution/template/makefile b/evolution/template/makefile index c3fc5f7..f3a19bd 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -29,36 +29,41 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx model.xml +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx gen1 := $(addprefix $(out_base)/,$(genf1)) genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx gen2 := $(addprefix $(out_base)/,$(genf2)) -genf := $(genf1) $(genf2) -gen := $(gen1) $(gen2) -gens := test1.sql test2.sql test2-002-pre.sql test2-002-post.sql \ -test2-003-pre.sql test2-003-post.sql +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ ---generate-schema --omit-create --at-once --table-prefix evo_template_ #@@ CHANGE THIS -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --schema-name \ -test1 --init-changelog --suppress-migration -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --schema-name \ -test2 +--generate-schema --at-once --table-prefix evo_template_ #@@ CHANGE THIS +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) -# Make sure test2.hxx is compiled before test1.hxx since they share the +# Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx # $(gen2): $(gen1) +$(gen3): $(gen2) $(gen): $(src_base)/model.hxx # Alias for default target. @@ -87,15 +92,17 @@ $(dist): # $(test): $(driver) # Drop everything. + $(call schema,$(out_base)/test3.sql) $(call schema,$(out_base)/test2.sql) $(call schema,$(out_base)/test1.sql) - # Base schema (-post is always empty). - $(call schema,$(out_base)/test2-002-pre.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) # Migration. - $(call schema,$(out_base)/test2-003-pre.sql) + $(call schema,$(out_base)/test3-003-pre.sql) $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) - $(call schema,$(out_base)/test2-003-post.sql) + $(call schema,$(out_base)/test3-003-post.sql) # Current schema. $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) @@ -107,14 +114,14 @@ $(clean): \ $(addsuffix .cxx.clean,$(cxx_od)) \ $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test2-*.sql) # Migration files. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. # Generated .gitignore. # ifeq ($(out_base),$(src_base)) $(driver): | $(out_base)/.gitignore -$(out_base)/.gitignore: files := driver $(genf) $(gens) +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) $(clean): $(out_base)/.gitignore.clean $(call include,$(bld_root)/git/gitignore.make) diff --git a/evolution/template/template-vc10.vcxproj b/evolution/template/template-vc10.vcxproj index d5e7ac8..70b8687 100644 --- a/evolution/template/template-vc10.vcxproj +++ b/evolution/template/template-vc10.vcxproj @@ -165,20 +165,29 @@ __custom_build_entry__( test2.hxx, odb test2.hxx, odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;test2-002-pre.sql;test2-002-post.sql;test2-003-pre.sql;test2-003-post.sql, -model.xml;model.hxx) +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options3), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) __header_entry__(test1-odb.hxx) __header_entry__(test1-odb.ixx) __header_entry__(test2-odb.hxx) __header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) __header_entries__(extra_headers) __source_entry__(driver.cxx) __source_entry__(test1-odb.cxx) __source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) __source_entries__(extra_sources) diff --git a/evolution/template/template-vc10.vcxproj.filters b/evolution/template/template-vc10.vcxproj.filters index c467cdc..d6ac66e 100644 --- a/evolution/template/template-vc10.vcxproj.filters +++ b/evolution/template/template-vc10.vcxproj.filters @@ -17,12 +17,16 @@ __header_filter_entry__(test1-odb.ixx) __header_filter_entry__(test2.hxx) __header_filter_entry__(test2-odb.hxx) __header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) __source_filter_entry__(test1-odb.cxx) __source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) __source_filter_entries__(extra_sources) diff --git a/evolution/template/template-vc11.vcxproj b/evolution/template/template-vc11.vcxproj index d3bfc99..5895a46 100644 --- a/evolution/template/template-vc11.vcxproj +++ b/evolution/template/template-vc11.vcxproj @@ -169,20 +169,29 @@ __custom_build_entry__( test2.hxx, odb test2.hxx, odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;test2-002-pre.sql;test2-002-post.sql;test2-003-pre.sql;test2-003-post.sql, -model.xml;model.hxx) +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options3), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) __header_entry__(test1-odb.hxx) __header_entry__(test1-odb.ixx) __header_entry__(test2-odb.hxx) __header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) __header_entries__(extra_headers) __source_entry__(driver.cxx) __source_entry__(test1-odb.cxx) __source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) __source_entries__(extra_sources) diff --git a/evolution/template/template-vc11.vcxproj.filters b/evolution/template/template-vc11.vcxproj.filters index c467cdc..d6ac66e 100644 --- a/evolution/template/template-vc11.vcxproj.filters +++ b/evolution/template/template-vc11.vcxproj.filters @@ -17,12 +17,16 @@ __header_filter_entry__(test1-odb.ixx) __header_filter_entry__(test2.hxx) __header_filter_entry__(test2-odb.hxx) __header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) __header_filter_entries__(extra_headers) __source_filter_entry__(driver.cxx) __source_filter_entry__(test1-odb.cxx) __source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) __source_filter_entries__(extra_sources) diff --git a/evolution/template/template-vc9.vcproj b/evolution/template/template-vc9.vcproj index 79cfb0a..4c9b465 100644 --- a/evolution/template/template-vc9.vcproj +++ b/evolution/template/template-vc9.vcproj @@ -339,6 +339,7 @@ __source_entry__(driver.cxx) __source_entry__(test1-odb.cxx) __source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) __source_entries__(extra_sources) diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index 668033d..d6d4ac7 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -5,8 +5,6 @@ #ifndef TEST1_HXX #define TEST1_HXX -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION +#pragma db model version(1, 1) #endif // TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index 5b8e48c..a349f54 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -5,7 +5,7 @@ #ifndef TEST2_HXX #define TEST2_HXX -#define MODEL_VERSION 3 +#define MODEL_VERSION 2 #include "model.hxx" #undef MODEL_VERSION diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx new file mode 100644 index 0000000..68366f4 --- /dev/null +++ b/evolution/template/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/template/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/tester b/evolution/tester index 3f9e7e8..9bb1ec7 100755 --- a/evolution/tester +++ b/evolution/tester @@ -14,17 +14,19 @@ if test -f test1.sql; then # # Drop everything. + $top_builddir/db-driver test3.sql || exit 1 $top_builddir/db-driver test2.sql || exit 1 $top_builddir/db-driver test1.sql || exit 1 - # Base schema (-post is always empty). - $top_builddir/db-driver test2-002-pre.sql || exit 1 + # Base schema. + $top_builddir/db-driver test3-002-pre.sql || exit 1 + $top_builddir/db-driver test3-002-post.sql || exit 1 ./driver --options-file "$top_builddir/db.options" 1 || exit 1 # Migration. - $top_builddir/db-driver test2-003-pre.sql || exit 1 + $top_builddir/db-driver test3-003-pre.sql || exit 1 ./driver --options-file "$top_builddir/db.options" 2 || exit 1 - $top_builddir/db-driver test2-003-post.sql || exit 1 + $top_builddir/db-driver test3-003-post.sql || exit 1 # Current schema. ./driver --options-file "$top_builddir/db.options" 3 || exit 1 diff --git a/evolution/tester.bat b/evolution/tester.bat index 5b949b4..e815522 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -28,15 +28,21 @@ if exist test*.sql ( rem Drop everything. rem + call %topdir%\%1-driver.bat test3.sql + if errorlevel 1 goto error + call %topdir%\%1-driver.bat test2.sql if errorlevel 1 goto error call %topdir%\%1-driver.bat test1.sql if errorlevel 1 goto error - rem Base schema (-post is always empty). + rem Base schema. rem - call %topdir%\%1-driver.bat test2-002-pre.sql + call %topdir%\%1-driver.bat test3-002-pre.sql + if errorlevel 1 goto error + + call %topdir%\%1-driver.bat test3-002-post.sql if errorlevel 1 goto error %dir%\driver.exe --options-file %topdir%\%1.options 1 @@ -44,13 +50,13 @@ if exist test*.sql ( rem Migration. rem - call %topdir%\%1-driver.bat test2-003-pre.sql + call %topdir%\%1-driver.bat test3-003-pre.sql if errorlevel 1 goto error %dir%\driver.exe --options-file %topdir%\%1.options 2 if errorlevel 1 goto error - call %topdir%\%1-driver.bat test2-003-post.sql + call %topdir%\%1-driver.bat test3-003-post.sql if errorlevel 1 goto error rem Current schema. diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx new file mode 100644 index 0000000..d69e195 --- /dev/null +++ b/evolution/version/driver.cxx @@ -0,0 +1,158 @@ +// file : evolution/version/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test schema version access via the database instance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + + assert (db->schema_version () == 0); + + schema_catalog::create_schema (*db, "", false); + + assert (db->schema_version () == 1 && !db->schema_migration ()); + + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + assert (db->schema_version () == 2 && !db->schema_migration ()); + + { + transaction t (db->begin ()); + object1 o1 (1); + o1.num = 123; + db->persist (o1); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; + using namespace v3; + + if (embedded) + { + assert (db->schema_version () == 2 && !db->schema_migration ()); + + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + assert (db->schema_version () == 3 && db->schema_migration ()); + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + object2 o2 (1); + o2.num = o1->num; + db->persist (o2); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + + assert (db->schema_version () == 3 && !db->schema_migration ()); + } + break; + } + case 3: + { + using namespace v3; + + // In transaction. + // + { + transaction t (db->begin ()); + assert (db->schema_version () == 3 && !db->schema_migration ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + t.commit (); + } + + // Test the case where there is still no version table. + // + db->schema_version (0, false); + + { + transaction t (db->begin ()); + +#ifdef DATABASE_ORACLE + db->execute ("DROP TABLE \"schema_version\""); +#else + db->execute ("DROP TABLE schema_version"); +#endif + t.commit (); + } + + assert (db->schema_version () == 0); + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/version/makefile b/evolution/version/makefile new file mode 100644 index 0000000..eab7cb8 --- /dev/null +++ b/evolution/version/makefile @@ -0,0 +1,150 @@ +# file : evolution/version/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.hxx test3.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --at-once --table-prefix evo_version_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure testN.hxx are compiled serially since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen3): $(gen2) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test3.sql) + $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test3-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test3-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) +$(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx new file mode 100644 index 0000000..b30a194 --- /dev/null +++ b/evolution/version/model.hxx @@ -0,0 +1,46 @@ +// file : evolution/version/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx new file mode 100644 index 0000000..138fd09 --- /dev/null +++ b/evolution/version/test1.hxx @@ -0,0 +1,10 @@ +// file : evolution/version/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx new file mode 100644 index 0000000..60af1c0 --- /dev/null +++ b/evolution/version/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/version/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx new file mode 100644 index 0000000..1e4deb3 --- /dev/null +++ b/evolution/version/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/version/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX -- cgit v1.1 From 8653e24fba1721fe4a87397b31f911d7fe33f32c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 25 Apr 2013 10:46:33 +0200 Subject: Add support for data migration --- evolution/data/driver.cxx | 181 ++++++++++++++++++++++++++++++++++++++++++++++ evolution/data/makefile | 147 +++++++++++++++++++++++++++++++++++++ evolution/data/model.hxx | 46 ++++++++++++ evolution/data/test1.hxx | 10 +++ evolution/data/test2.hxx | 12 +++ evolution/data/test3.hxx | 12 +++ evolution/makefile | 1 + 7 files changed, 409 insertions(+) create mode 100644 evolution/data/driver.cxx create mode 100644 evolution/data/makefile create mode 100644 evolution/data/model.hxx create mode 100644 evolution/data/test1.hxx create mode 100644 evolution/data/test2.hxx create mode 100644 evolution/data/test3.hxx diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx new file mode 100644 index 0000000..0a700c7 --- /dev/null +++ b/evolution/data/driver.cxx @@ -0,0 +1,181 @@ +// file : evolution/data/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test data migration support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX, HAVE_CXX11 +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +void +migrate1 (database& db) +{ + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (1)); + object2 o2 (1); + o2.num = o1->num; + db.persist (o2); +} + +void +migrate2 (database& db) +{ + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (2)); + object2 o2 (2); + o2.num = o1->num; + db.persist (o2); +} + +static const data_migration_entry migrate2_entry (3, &migrate2); + +int +main (int argc, char* argv[]) +{ + schema_catalog::data_migration_function (3, &migrate1); + +#ifdef HAVE_CXX11 + schema_catalog::data_migration_function ( + 3, + [] (database& db) + { + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (11)); + object2 o2 (11); + o2.num = o1->num; + db.persist (o2); + }); +#endif + + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + { + transaction t (db->begin ()); + + { + object1 o1 (1); + o1.num = 123; + db->persist (o1); + } + + { + object1 o1 (2); + o1.num = 123; + db->persist (o1); + } + +#ifdef HAVE_CXX11 + { + object1 o1 (11); + o1.num = 123; + db->persist (o1); + } +#endif + t.commit (); + } + break; + } + case 2: + { + { + transaction t (db->begin ()); + + if (embedded) + schema_catalog::migrate (*db); + else + schema_catalog::migrate_data (*db); + + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + + { + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + } + + { + auto_ptr o2 (db->load (2)); + assert (o2->num == 123); + } + +#ifdef HAVE_CXX11 + { + auto_ptr o2 (db->load (11)); + assert (o2->num == 123); + } +#endif + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/data/makefile b/evolution/data/makefile new file mode 100644 index 0000000..7b1cc8e --- /dev/null +++ b/evolution/data/makefile @@ -0,0 +1,147 @@ +# file : evolution/data/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.hxx test3.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) + +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) + +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) + +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) + +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +--generate-schema --at-once --table-prefix evo_data_ +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure testN.hxx are compiled serially since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen3): $(gen2) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): db_id := @database@ +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc9projs,$(name)) \ +$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test3.sql) + $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + # Migration. + $(call schema,$(out_base)/test3-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call schema,$(out_base)/test3-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + +# 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)/model.xml) # Changelog. + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver model.xml $(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/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx new file mode 100644 index 0000000..db49a44 --- /dev/null +++ b/evolution/data/model.hxx @@ -0,0 +1,46 @@ +// file : evolution/data/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx new file mode 100644 index 0000000..52b1873 --- /dev/null +++ b/evolution/data/test1.hxx @@ -0,0 +1,10 @@ +// file : evolution/data/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx new file mode 100644 index 0000000..8aa60fe --- /dev/null +++ b/evolution/data/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/data/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx new file mode 100644 index 0000000..7decfc5 --- /dev/null +++ b/evolution/data/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/data/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 98816a3..9f85cf8 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -17,6 +17,7 @@ drop-index \ combined \ embedded \ version \ +data \ template default := $(out_base)/ -- cgit v1.1 From 794581217b71bf1705732360625a25369df15cdd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Apr 2013 11:43:10 +0200 Subject: Add database name to changelog --- common/changelog/add-column-mssql-diff.xml | 2 +- common/changelog/add-column-mssql-patch.xml | 2 +- common/changelog/add-column-mysql-diff.xml | 2 +- common/changelog/add-column-mysql-patch.xml | 2 +- common/changelog/add-column-oracle-diff.xml | 2 +- common/changelog/add-column-oracle-patch.xml | 2 +- common/changelog/add-column-pgsql-diff.xml | 2 +- common/changelog/add-column-pgsql-patch.xml | 2 +- common/changelog/add-column-sqlite-diff.xml | 2 +- common/changelog/add-column-sqlite-patch.xml | 2 +- common/changelog/add-foreign-key-mssql-diff.xml | 2 +- common/changelog/add-foreign-key-mssql-patch.xml | 2 +- common/changelog/add-foreign-key-mysql-diff.xml | 2 +- common/changelog/add-foreign-key-mysql-patch.xml | 2 +- common/changelog/add-foreign-key-oracle-diff.xml | 2 +- common/changelog/add-foreign-key-oracle-patch.xml | 2 +- common/changelog/add-foreign-key-pgsql-diff.xml | 2 +- common/changelog/add-foreign-key-pgsql-patch.xml | 2 +- common/changelog/add-foreign-key-sqlite-diff.xml | 2 +- common/changelog/add-foreign-key-sqlite-patch.xml | 2 +- common/changelog/add-index-mssql-diff.xml | 2 +- common/changelog/add-index-mssql-patch.xml | 2 +- common/changelog/add-index-mysql-diff.xml | 2 +- common/changelog/add-index-mysql-patch.xml | 2 +- common/changelog/add-index-oracle-diff.xml | 2 +- common/changelog/add-index-oracle-patch.xml | 2 +- common/changelog/add-index-pgsql-diff.xml | 2 +- common/changelog/add-index-pgsql-patch.xml | 2 +- common/changelog/add-index-sqlite-diff.xml | 2 +- common/changelog/add-index-sqlite-patch.xml | 2 +- common/changelog/add-table-mssql-diff.xml | 2 +- common/changelog/add-table-mssql-patch.xml | 2 +- common/changelog/add-table-mysql-diff.xml | 2 +- common/changelog/add-table-mysql-patch.xml | 2 +- common/changelog/add-table-oracle-diff.xml | 2 +- common/changelog/add-table-oracle-patch.xml | 2 +- common/changelog/add-table-pgsql-diff.xml | 2 +- common/changelog/add-table-pgsql-patch.xml | 2 +- common/changelog/add-table-sqlite-diff.xml | 2 +- common/changelog/add-table-sqlite-patch.xml | 2 +- common/changelog/alter-column-mssql-diff.xml | 2 +- common/changelog/alter-column-mssql-patch.xml | 2 +- common/changelog/alter-column-mysql-diff.xml | 2 +- common/changelog/alter-column-mysql-patch.xml | 2 +- common/changelog/alter-column-oracle-diff.xml | 2 +- common/changelog/alter-column-oracle-patch.xml | 2 +- common/changelog/alter-column-pgsql-diff.xml | 2 +- common/changelog/alter-column-pgsql-patch.xml | 2 +- common/changelog/alter-column-sqlite-diff.xml | 2 +- common/changelog/alter-column-sqlite-patch.xml | 2 +- common/changelog/drop-column-mssql-diff.xml | 2 +- common/changelog/drop-column-mssql-patch.xml | 2 +- common/changelog/drop-column-mysql-diff.xml | 2 +- common/changelog/drop-column-mysql-patch.xml | 2 +- common/changelog/drop-column-oracle-diff.xml | 2 +- common/changelog/drop-column-oracle-patch.xml | 2 +- common/changelog/drop-column-pgsql-diff.xml | 2 +- common/changelog/drop-column-pgsql-patch.xml | 2 +- common/changelog/drop-column-sqlite-diff.xml | 2 +- common/changelog/drop-column-sqlite-patch.xml | 2 +- common/changelog/drop-foreign-key-mssql-diff.xml | 2 +- common/changelog/drop-foreign-key-mssql-patch.xml | 2 +- common/changelog/drop-foreign-key-mysql-diff.xml | 2 +- common/changelog/drop-foreign-key-mysql-patch.xml | 2 +- common/changelog/drop-foreign-key-oracle-diff.xml | 2 +- common/changelog/drop-foreign-key-oracle-patch.xml | 2 +- common/changelog/drop-foreign-key-pgsql-diff.xml | 2 +- common/changelog/drop-foreign-key-pgsql-patch.xml | 2 +- common/changelog/drop-foreign-key-sqlite-diff.xml | 2 +- common/changelog/drop-foreign-key-sqlite-patch.xml | 2 +- common/changelog/drop-index-mssql-diff.xml | 2 +- common/changelog/drop-index-mssql-patch.xml | 2 +- common/changelog/drop-index-mysql-diff.xml | 2 +- common/changelog/drop-index-mysql-patch.xml | 2 +- common/changelog/drop-index-oracle-diff.xml | 2 +- common/changelog/drop-index-oracle-patch.xml | 2 +- common/changelog/drop-index-pgsql-diff.xml | 2 +- common/changelog/drop-index-pgsql-patch.xml | 2 +- common/changelog/drop-index-sqlite-diff.xml | 2 +- common/changelog/drop-index-sqlite-patch.xml | 2 +- common/changelog/drop-table-mssql-diff.xml | 2 +- common/changelog/drop-table-mssql-patch.xml | 2 +- common/changelog/drop-table-mysql-diff.xml | 2 +- common/changelog/drop-table-mysql-patch.xml | 2 +- common/changelog/drop-table-oracle-diff.xml | 2 +- common/changelog/drop-table-oracle-patch.xml | 2 +- common/changelog/drop-table-pgsql-diff.xml | 2 +- common/changelog/drop-table-pgsql-patch.xml | 2 +- common/changelog/drop-table-sqlite-diff.xml | 2 +- common/changelog/drop-table-sqlite-patch.xml | 2 +- common/changelog/model-mssql.xml | 2 +- common/changelog/model-mysql.xml | 2 +- common/changelog/model-oracle.xml | 2 +- common/changelog/model-pgsql.xml | 2 +- common/changelog/model-sqlite.xml | 2 +- 95 files changed, 95 insertions(+), 95 deletions(-) diff --git a/common/changelog/add-column-mssql-diff.xml b/common/changelog/add-column-mssql-diff.xml index 7485d9c..7294eb8 100644 --- a/common/changelog/add-column-mssql-diff.xml +++ b/common/changelog/add-column-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml index 44de8f2..cea9815 100644 --- a/common/changelog/add-column-mssql-patch.xml +++ b/common/changelog/add-column-mssql-patch.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml index 7485d9c..4d37d92 100644 --- a/common/changelog/add-column-mysql-diff.xml +++ b/common/changelog/add-column-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml index 44de8f2..0d58e11 100644 --- a/common/changelog/add-column-mysql-patch.xml +++ b/common/changelog/add-column-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml index cbd2451..122e5e1 100644 --- a/common/changelog/add-column-oracle-diff.xml +++ b/common/changelog/add-column-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml index a517a59..2d864a6 100644 --- a/common/changelog/add-column-oracle-patch.xml +++ b/common/changelog/add-column-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-column-pgsql-diff.xml b/common/changelog/add-column-pgsql-diff.xml index f19e9e9..b72aced 100644 --- a/common/changelog/add-column-pgsql-diff.xml +++ b/common/changelog/add-column-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml index 10958e6..a6ce808 100644 --- a/common/changelog/add-column-pgsql-patch.xml +++ b/common/changelog/add-column-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-column-sqlite-diff.xml b/common/changelog/add-column-sqlite-diff.xml index f19e9e9..2f32915 100644 --- a/common/changelog/add-column-sqlite-diff.xml +++ b/common/changelog/add-column-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml index 10958e6..8f80bfc 100644 --- a/common/changelog/add-column-sqlite-patch.xml +++ b/common/changelog/add-column-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-foreign-key-mssql-diff.xml b/common/changelog/add-foreign-key-mssql-diff.xml index cc231a2..ce050d6 100644 --- a/common/changelog/add-foreign-key-mssql-diff.xml +++ b/common/changelog/add-foreign-key-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml index e15f436..833687c 100644 --- a/common/changelog/add-foreign-key-mssql-patch.xml +++ b/common/changelog/add-foreign-key-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml index cc231a2..6657898 100644 --- a/common/changelog/add-foreign-key-mysql-diff.xml +++ b/common/changelog/add-foreign-key-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml index e15f436..b4d2f48 100644 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml index 3131542..22c687d 100644 --- a/common/changelog/add-foreign-key-oracle-diff.xml +++ b/common/changelog/add-foreign-key-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml index 7984282..c58f162 100644 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-foreign-key-pgsql-diff.xml b/common/changelog/add-foreign-key-pgsql-diff.xml index 06079b8..e14cf32 100644 --- a/common/changelog/add-foreign-key-pgsql-diff.xml +++ b/common/changelog/add-foreign-key-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml index 6422322..e70d737 100644 --- a/common/changelog/add-foreign-key-pgsql-patch.xml +++ b/common/changelog/add-foreign-key-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-foreign-key-sqlite-diff.xml b/common/changelog/add-foreign-key-sqlite-diff.xml index 06079b8..dece240 100644 --- a/common/changelog/add-foreign-key-sqlite-diff.xml +++ b/common/changelog/add-foreign-key-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml index 6422322..5bc48d5 100644 --- a/common/changelog/add-foreign-key-sqlite-patch.xml +++ b/common/changelog/add-foreign-key-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-index-mssql-diff.xml b/common/changelog/add-index-mssql-diff.xml index 33634f8..47ca82d 100644 --- a/common/changelog/add-index-mssql-diff.xml +++ b/common/changelog/add-index-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-index-mssql-patch.xml b/common/changelog/add-index-mssql-patch.xml index cac5886..5f41f15 100644 --- a/common/changelog/add-index-mssql-patch.xml +++ b/common/changelog/add-index-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-index-mysql-diff.xml b/common/changelog/add-index-mysql-diff.xml index 33634f8..48a6062 100644 --- a/common/changelog/add-index-mysql-diff.xml +++ b/common/changelog/add-index-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml index cac5886..e617c26 100644 --- a/common/changelog/add-index-mysql-patch.xml +++ b/common/changelog/add-index-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-index-oracle-diff.xml b/common/changelog/add-index-oracle-diff.xml index d32bada..3a8cfc0 100644 --- a/common/changelog/add-index-oracle-diff.xml +++ b/common/changelog/add-index-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml index 91353a9..e29595c 100644 --- a/common/changelog/add-index-oracle-patch.xml +++ b/common/changelog/add-index-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-index-pgsql-diff.xml b/common/changelog/add-index-pgsql-diff.xml index 969abd8..8030b25 100644 --- a/common/changelog/add-index-pgsql-diff.xml +++ b/common/changelog/add-index-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-index-pgsql-patch.xml b/common/changelog/add-index-pgsql-patch.xml index 559dd4d..f42d591 100644 --- a/common/changelog/add-index-pgsql-patch.xml +++ b/common/changelog/add-index-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-index-sqlite-diff.xml b/common/changelog/add-index-sqlite-diff.xml index 969abd8..fc8fb44 100644 --- a/common/changelog/add-index-sqlite-diff.xml +++ b/common/changelog/add-index-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-index-sqlite-patch.xml b/common/changelog/add-index-sqlite-patch.xml index 559dd4d..effbe72 100644 --- a/common/changelog/add-index-sqlite-patch.xml +++ b/common/changelog/add-index-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml index 4e9c97f..1173f1e 100644 --- a/common/changelog/add-table-mssql-diff.xml +++ b/common/changelog/add-table-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml index 0edc34d..55ac287 100644 --- a/common/changelog/add-table-mssql-patch.xml +++ b/common/changelog/add-table-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml index f158c9c..19bca23 100644 --- a/common/changelog/add-table-mysql-diff.xml +++ b/common/changelog/add-table-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index 1781451..5178d70 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml index 642d06e..344f125 100644 --- a/common/changelog/add-table-oracle-diff.xml +++ b/common/changelog/add-table-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index 461f3eb..ed2e1fd 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml index 6bec713..1c498f8 100644 --- a/common/changelog/add-table-pgsql-diff.xml +++ b/common/changelog/add-table-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml index f20d442..cb26141 100644 --- a/common/changelog/add-table-pgsql-patch.xml +++ b/common/changelog/add-table-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml index 3971906..d2abe2f 100644 --- a/common/changelog/add-table-sqlite-diff.xml +++ b/common/changelog/add-table-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml index dd25b79..868fbab 100644 --- a/common/changelog/add-table-sqlite-patch.xml +++ b/common/changelog/add-table-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/alter-column-mssql-diff.xml b/common/changelog/alter-column-mssql-diff.xml index 907fb8d..05515d5 100644 --- a/common/changelog/alter-column-mssql-diff.xml +++ b/common/changelog/alter-column-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml index a1d25da..04bee32 100644 --- a/common/changelog/alter-column-mssql-patch.xml +++ b/common/changelog/alter-column-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml index 907fb8d..6b7d024 100644 --- a/common/changelog/alter-column-mysql-diff.xml +++ b/common/changelog/alter-column-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml index a1d25da..702d928 100644 --- a/common/changelog/alter-column-mysql-patch.xml +++ b/common/changelog/alter-column-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml index 4a2b0df..8a2953e 100644 --- a/common/changelog/alter-column-oracle-diff.xml +++ b/common/changelog/alter-column-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml index 2245880..e0c003b 100644 --- a/common/changelog/alter-column-oracle-patch.xml +++ b/common/changelog/alter-column-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/alter-column-pgsql-diff.xml b/common/changelog/alter-column-pgsql-diff.xml index 0027190..6b0c284 100644 --- a/common/changelog/alter-column-pgsql-diff.xml +++ b/common/changelog/alter-column-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml index dd954ad..a615303 100644 --- a/common/changelog/alter-column-pgsql-patch.xml +++ b/common/changelog/alter-column-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/alter-column-sqlite-diff.xml b/common/changelog/alter-column-sqlite-diff.xml index 0027190..26c7cb6 100644 --- a/common/changelog/alter-column-sqlite-diff.xml +++ b/common/changelog/alter-column-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml index dd954ad..ac6ccf1 100644 --- a/common/changelog/alter-column-sqlite-patch.xml +++ b/common/changelog/alter-column-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-column-mssql-diff.xml b/common/changelog/drop-column-mssql-diff.xml index 496f8c7..1b2c433 100644 --- a/common/changelog/drop-column-mssql-diff.xml +++ b/common/changelog/drop-column-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml index 1a38c38..13b4d50 100644 --- a/common/changelog/drop-column-mssql-patch.xml +++ b/common/changelog/drop-column-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml index 496f8c7..b1b6abb 100644 --- a/common/changelog/drop-column-mysql-diff.xml +++ b/common/changelog/drop-column-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml index 1a38c38..024d4b8 100644 --- a/common/changelog/drop-column-mysql-patch.xml +++ b/common/changelog/drop-column-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml index 00b8394..2f7636c 100644 --- a/common/changelog/drop-column-oracle-diff.xml +++ b/common/changelog/drop-column-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml index a53c3aa..1851872 100644 --- a/common/changelog/drop-column-oracle-patch.xml +++ b/common/changelog/drop-column-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-column-pgsql-diff.xml b/common/changelog/drop-column-pgsql-diff.xml index ae2e6b9..45bd5ff 100644 --- a/common/changelog/drop-column-pgsql-diff.xml +++ b/common/changelog/drop-column-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml index 8f19f4b..2c89e9c 100644 --- a/common/changelog/drop-column-pgsql-patch.xml +++ b/common/changelog/drop-column-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-column-sqlite-diff.xml b/common/changelog/drop-column-sqlite-diff.xml index ae2e6b9..9ed1245 100644 --- a/common/changelog/drop-column-sqlite-diff.xml +++ b/common/changelog/drop-column-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml index 8f19f4b..cc3f86c 100644 --- a/common/changelog/drop-column-sqlite-patch.xml +++ b/common/changelog/drop-column-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-foreign-key-mssql-diff.xml b/common/changelog/drop-foreign-key-mssql-diff.xml index 6840f2e..d110266 100644 --- a/common/changelog/drop-foreign-key-mssql-diff.xml +++ b/common/changelog/drop-foreign-key-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-foreign-key-mssql-patch.xml b/common/changelog/drop-foreign-key-mssql-patch.xml index b6d6e63..84af5fe 100644 --- a/common/changelog/drop-foreign-key-mssql-patch.xml +++ b/common/changelog/drop-foreign-key-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml index 6840f2e..6ddc103 100644 --- a/common/changelog/drop-foreign-key-mysql-diff.xml +++ b/common/changelog/drop-foreign-key-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml index b6d6e63..c5fb28e 100644 --- a/common/changelog/drop-foreign-key-mysql-patch.xml +++ b/common/changelog/drop-foreign-key-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml index b9dc4a8..c8a04b2 100644 --- a/common/changelog/drop-foreign-key-oracle-diff.xml +++ b/common/changelog/drop-foreign-key-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml index f544817..54bee06 100644 --- a/common/changelog/drop-foreign-key-oracle-patch.xml +++ b/common/changelog/drop-foreign-key-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-foreign-key-pgsql-diff.xml b/common/changelog/drop-foreign-key-pgsql-diff.xml index 6821cca..9d0c7c1 100644 --- a/common/changelog/drop-foreign-key-pgsql-diff.xml +++ b/common/changelog/drop-foreign-key-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-foreign-key-pgsql-patch.xml b/common/changelog/drop-foreign-key-pgsql-patch.xml index a666b86..14844d3 100644 --- a/common/changelog/drop-foreign-key-pgsql-patch.xml +++ b/common/changelog/drop-foreign-key-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-foreign-key-sqlite-diff.xml b/common/changelog/drop-foreign-key-sqlite-diff.xml index 6821cca..af0f7bc 100644 --- a/common/changelog/drop-foreign-key-sqlite-diff.xml +++ b/common/changelog/drop-foreign-key-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-foreign-key-sqlite-patch.xml b/common/changelog/drop-foreign-key-sqlite-patch.xml index a666b86..e856d5d 100644 --- a/common/changelog/drop-foreign-key-sqlite-patch.xml +++ b/common/changelog/drop-foreign-key-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-index-mssql-diff.xml b/common/changelog/drop-index-mssql-diff.xml index 4bf9fb8..cf68fd7 100644 --- a/common/changelog/drop-index-mssql-diff.xml +++ b/common/changelog/drop-index-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-index-mssql-patch.xml b/common/changelog/drop-index-mssql-patch.xml index 44de8f2..cea9815 100644 --- a/common/changelog/drop-index-mssql-patch.xml +++ b/common/changelog/drop-index-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-index-mysql-diff.xml b/common/changelog/drop-index-mysql-diff.xml index 4bf9fb8..7688aa1 100644 --- a/common/changelog/drop-index-mysql-diff.xml +++ b/common/changelog/drop-index-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml index 44de8f2..0d58e11 100644 --- a/common/changelog/drop-index-mysql-patch.xml +++ b/common/changelog/drop-index-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-index-oracle-diff.xml b/common/changelog/drop-index-oracle-diff.xml index 9c717e6..f4ccba6 100644 --- a/common/changelog/drop-index-oracle-diff.xml +++ b/common/changelog/drop-index-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml index a517a59..2d864a6 100644 --- a/common/changelog/drop-index-oracle-patch.xml +++ b/common/changelog/drop-index-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-index-pgsql-diff.xml b/common/changelog/drop-index-pgsql-diff.xml index e3c0d1d..6e1661f 100644 --- a/common/changelog/drop-index-pgsql-diff.xml +++ b/common/changelog/drop-index-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-index-pgsql-patch.xml b/common/changelog/drop-index-pgsql-patch.xml index 10958e6..a6ce808 100644 --- a/common/changelog/drop-index-pgsql-patch.xml +++ b/common/changelog/drop-index-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-index-sqlite-diff.xml b/common/changelog/drop-index-sqlite-diff.xml index e3c0d1d..bbc1ae4 100644 --- a/common/changelog/drop-index-sqlite-diff.xml +++ b/common/changelog/drop-index-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-index-sqlite-patch.xml b/common/changelog/drop-index-sqlite-patch.xml index 10958e6..8f80bfc 100644 --- a/common/changelog/drop-index-sqlite-patch.xml +++ b/common/changelog/drop-index-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml index 3f46d65..d905b2f 100644 --- a/common/changelog/drop-table-mssql-diff.xml +++ b/common/changelog/drop-table-mssql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-table-mssql-patch.xml b/common/changelog/drop-table-mssql-patch.xml index c6003ea..225550a 100644 --- a/common/changelog/drop-table-mssql-patch.xml +++ b/common/changelog/drop-table-mssql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml index 5cf2490..218adca 100644 --- a/common/changelog/drop-table-mysql-diff.xml +++ b/common/changelog/drop-table-mysql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml index c6003ea..d6db3ae 100644 --- a/common/changelog/drop-table-mysql-patch.xml +++ b/common/changelog/drop-table-mysql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml index 70c06a1..311e57e 100644 --- a/common/changelog/drop-table-oracle-diff.xml +++ b/common/changelog/drop-table-oracle-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-table-oracle-patch.xml b/common/changelog/drop-table-oracle-patch.xml index 309aa86..7983066 100644 --- a/common/changelog/drop-table-oracle-patch.xml +++ b/common/changelog/drop-table-oracle-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml index 6a4d523..5cb9551 100644 --- a/common/changelog/drop-table-pgsql-diff.xml +++ b/common/changelog/drop-table-pgsql-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-table-pgsql-patch.xml b/common/changelog/drop-table-pgsql-patch.xml index 393a20f..8574207 100644 --- a/common/changelog/drop-table-pgsql-patch.xml +++ b/common/changelog/drop-table-pgsql-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml index 61d06d2..a91d643 100644 --- a/common/changelog/drop-table-sqlite-diff.xml +++ b/common/changelog/drop-table-sqlite-diff.xml @@ -1,4 +1,4 @@ - + diff --git a/common/changelog/drop-table-sqlite-patch.xml b/common/changelog/drop-table-sqlite-patch.xml index 393a20f..b4bcaca 100644 --- a/common/changelog/drop-table-sqlite-patch.xml +++ b/common/changelog/drop-table-sqlite-patch.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml index 95bc102..8a32d25 100644 --- a/common/changelog/model-mssql.xml +++ b/common/changelog/model-mssql.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml index a6a811a..054e9fb 100644 --- a/common/changelog/model-mysql.xml +++ b/common/changelog/model-mysql.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml index 73fb592..8b61d1c 100644 --- a/common/changelog/model-oracle.xml +++ b/common/changelog/model-oracle.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml index 8679129..dd6b2d6 100644 --- a/common/changelog/model-pgsql.xml +++ b/common/changelog/model-pgsql.xml @@ -1,4 +1,4 @@ - +
diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml index 1690d2d..4b1b473 100644 --- a/common/changelog/model-sqlite.xml +++ b/common/changelog/model-sqlite.xml @@ -1,4 +1,4 @@ - +
-- cgit v1.1 From 08c135da0bc2f63f8381c690affae0d6b5804cff Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Apr 2013 14:43:01 +0200 Subject: Use open, closed names in version pragma --- common/changelog/add-column.hxx | 2 +- common/changelog/add-foreign-key.hxx | 2 +- common/changelog/add-index.hxx | 2 +- common/changelog/add-table.hxx | 2 +- common/changelog/alter-column.hxx | 2 +- common/changelog/drop-column.hxx | 2 +- common/changelog/drop-foreign-key.hxx | 2 +- common/changelog/drop-index.hxx | 2 +- common/changelog/drop-table.hxx | 2 +- common/changelog/model.hxx | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index b185ad9..07a6c53 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -5,7 +5,7 @@ #ifndef ADD_COLUMN_HXX #define ADD_COLUMN_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) #pragma db object struct object diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index d6cec68..4ce5551 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -5,7 +5,7 @@ #ifndef ADD_FOREIGN_KEY_HXX #define ADD_FOREIGN_KEY_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) struct object1; diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index 92437ab..9163cff 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -5,7 +5,7 @@ #ifndef ADD_INDEX_HXX #define ADD_INDEX_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) #pragma db object struct object diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index 8dfabc6..b012148 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -7,7 +7,7 @@ #include -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) struct object1; diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index 769553b..5eed54a 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -5,7 +5,7 @@ #ifndef ALTER_COLUMN_HXX #define ALTER_COLUMN_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) #pragma db object struct object diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index 70fbcba..f88d931 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -5,7 +5,7 @@ #ifndef DROP_COLUMN_HXX #define DROP_COLUMN_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) #pragma db object struct object diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index 4a70c6b..97628f1 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -5,7 +5,7 @@ #ifndef DROP_FOREIGN_KEY_HXX #define DROP_FOREIGN_KEY_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) struct object1; diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index f1f1846..3358832 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -5,7 +5,7 @@ #ifndef DROP_INDEX_HXX #define DROP_INDEX_HXX -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) #pragma db object struct object diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index a28c0d4..8de6376 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -7,7 +7,7 @@ #include -#pragma db model version(BVER, CVER, true) +#pragma db model version(BVER, CVER, open) struct object1; diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index e4c630e..1b8a6da 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -7,7 +7,7 @@ #include -#pragma db model version(1, 1, true) +#pragma db model version(1, 1, open) #pragma db value struct value -- cgit v1.1 From 08998bc4e38c07222f0d995824d576a4b424ed6b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Apr 2013 15:54:19 +0200 Subject: Add support for table options in changelog, use to handle MySQL engine --- common/changelog/add-column-mysql-diff.xml | 2 +- common/changelog/add-column-mysql-patch.xml | 2 +- common/changelog/add-foreign-key-mysql-diff.xml | 4 ++-- common/changelog/add-foreign-key-mysql-patch.xml | 4 ++-- common/changelog/add-index-mysql-diff.xml | 2 +- common/changelog/add-index-mysql-patch.xml | 2 +- common/changelog/add-table-mysql-diff.xml | 6 +++--- common/changelog/add-table-mysql-patch.xml | 6 +++--- common/changelog/alter-column-mysql-diff.xml | 2 +- common/changelog/alter-column-mysql-patch.xml | 2 +- common/changelog/drop-column-mysql-diff.xml | 2 +- common/changelog/drop-column-mysql-patch.xml | 2 +- common/changelog/drop-foreign-key-mysql-diff.xml | 4 ++-- common/changelog/drop-foreign-key-mysql-patch.xml | 4 ++-- common/changelog/drop-index-mysql-diff.xml | 2 +- common/changelog/drop-index-mysql-patch.xml | 2 +- common/changelog/drop-table-mysql-diff.xml | 6 +++--- common/changelog/drop-table-mysql-patch.xml | 2 +- common/changelog/model-mysql.xml | 6 +++--- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml index 4d37d92..15ff759 100644 --- a/common/changelog/add-column-mysql-diff.xml +++ b/common/changelog/add-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml index 0d58e11..445ad0d 100644 --- a/common/changelog/add-column-mysql-patch.xml +++ b/common/changelog/add-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml index 6657898..44aa42e 100644 --- a/common/changelog/add-foreign-key-mysql-diff.xml +++ b/common/changelog/add-foreign-key-mysql-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml index b4d2f48..fa21c84 100644 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-index-mysql-diff.xml b/common/changelog/add-index-mysql-diff.xml index 48a6062..5abe640 100644 --- a/common/changelog/add-index-mysql-diff.xml +++ b/common/changelog/add-index-mysql-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml index e617c26..dec530a 100644 --- a/common/changelog/add-index-mysql-patch.xml +++ b/common/changelog/add-index-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml index 19bca23..f899cb2 100644 --- a/common/changelog/add-table-mysql-diff.xml +++ b/common/changelog/add-table-mysql-diff.xml @@ -1,6 +1,6 @@ - + @@ -14,7 +14,7 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index 5178d70..4d0af47 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -1,13 +1,13 @@ -
+
- +
@@ -21,7 +21,7 @@
- +
diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml index 6b7d024..5f964fd 100644 --- a/common/changelog/alter-column-mysql-diff.xml +++ b/common/changelog/alter-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml index 702d928..3987abf 100644 --- a/common/changelog/alter-column-mysql-patch.xml +++ b/common/changelog/alter-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml index b1b6abb..7b6d172 100644 --- a/common/changelog/drop-column-mysql-diff.xml +++ b/common/changelog/drop-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml index 024d4b8..f69268d 100644 --- a/common/changelog/drop-column-mysql-patch.xml +++ b/common/changelog/drop-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml index 6ddc103..137f05f 100644 --- a/common/changelog/drop-foreign-key-mysql-diff.xml +++ b/common/changelog/drop-foreign-key-mysql-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml index c5fb28e..d690c42 100644 --- a/common/changelog/drop-foreign-key-mysql-patch.xml +++ b/common/changelog/drop-foreign-key-mysql-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-index-mysql-diff.xml b/common/changelog/drop-index-mysql-diff.xml index 7688aa1..c944e40 100644 --- a/common/changelog/drop-index-mysql-diff.xml +++ b/common/changelog/drop-index-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml index 0d58e11..445ad0d 100644 --- a/common/changelog/drop-index-mysql-patch.xml +++ b/common/changelog/drop-index-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml index 218adca..5fd5a97 100644 --- a/common/changelog/drop-table-mysql-diff.xml +++ b/common/changelog/drop-table-mysql-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -19,7 +19,7 @@
- +
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml index d6db3ae..a6778df 100644 --- a/common/changelog/drop-table-mysql-patch.xml +++ b/common/changelog/drop-table-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml index 054e9fb..9398955 100644 --- a/common/changelog/model-mysql.xml +++ b/common/changelog/model-mysql.xml @@ -1,6 +1,6 @@ -
+
@@ -26,7 +26,7 @@
- +
@@ -43,7 +43,7 @@
- +
-- cgit v1.1 From 5ad792c3b4ee4d2cc558f320c0c26210e4fa31bf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Apr 2013 17:18:13 +0200 Subject: Add support for extra database info in primary key Use that to handle Oracle sequence name and SQLite lax auto ids. --- common/changelog/add-column-oracle-diff.xml | 2 +- common/changelog/add-column-oracle-patch.xml | 2 +- common/changelog/add-foreign-key-oracle-diff.xml | 2 +- common/changelog/add-foreign-key-oracle-patch.xml | 2 +- common/changelog/add-index-oracle-diff.xml | 2 +- common/changelog/add-index-oracle-patch.xml | 2 +- common/changelog/add-table-oracle-diff.xml | 2 +- common/changelog/add-table-oracle-patch.xml | 2 +- common/changelog/alter-column-oracle-diff.xml | 2 +- common/changelog/alter-column-oracle-patch.xml | 2 +- common/changelog/drop-column-oracle-diff.xml | 2 +- common/changelog/drop-column-oracle-patch.xml | 2 +- common/changelog/drop-foreign-key-oracle-diff.xml | 2 +- common/changelog/drop-foreign-key-oracle-patch.xml | 2 +- common/changelog/drop-index-oracle-diff.xml | 2 +- common/changelog/drop-index-oracle-patch.xml | 2 +- common/changelog/drop-table-oracle-diff.xml | 2 +- common/changelog/model-oracle.xml | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml index 122e5e1..3ebaa7b 100644 --- a/common/changelog/add-column-oracle-diff.xml +++ b/common/changelog/add-column-oracle-diff.xml @@ -8,7 +8,7 @@
- +
diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml index 2d864a6..b934c83 100644 --- a/common/changelog/add-column-oracle-patch.xml +++ b/common/changelog/add-column-oracle-patch.xml @@ -3,7 +3,7 @@ - +
diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml index 22c687d..75bcbe2 100644 --- a/common/changelog/add-foreign-key-oracle-diff.xml +++ b/common/changelog/add-foreign-key-oracle-diff.xml @@ -14,7 +14,7 @@ - +
diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml index c58f162..fcadec0 100644 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -3,7 +3,7 @@ - + diff --git a/common/changelog/add-index-oracle-diff.xml b/common/changelog/add-index-oracle-diff.xml index 3a8cfc0..4f1afbe 100644 --- a/common/changelog/add-index-oracle-diff.xml +++ b/common/changelog/add-index-oracle-diff.xml @@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml index e29595c..9ceb77a 100644 --- a/common/changelog/add-index-oracle-patch.xml +++ b/common/changelog/add-index-oracle-patch.xml @@ -4,7 +4,7 @@ - + diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml index 344f125..dd394a9 100644 --- a/common/changelog/add-table-oracle-diff.xml +++ b/common/changelog/add-table-oracle-diff.xml @@ -4,7 +4,7 @@ - + diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index ed2e1fd..78f555a 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -11,7 +11,7 @@ - + diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml index 8a2953e..d49ea52 100644 --- a/common/changelog/alter-column-oracle-diff.xml +++ b/common/changelog/alter-column-oracle-diff.xml @@ -9,7 +9,7 @@ - +
diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml index e0c003b..0f48155 100644 --- a/common/changelog/alter-column-oracle-patch.xml +++ b/common/changelog/alter-column-oracle-patch.xml @@ -3,7 +3,7 @@ - +
diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml index 2f7636c..5109339 100644 --- a/common/changelog/drop-column-oracle-diff.xml +++ b/common/changelog/drop-column-oracle-diff.xml @@ -9,7 +9,7 @@ - +
diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml index 1851872..18e5dee 100644 --- a/common/changelog/drop-column-oracle-patch.xml +++ b/common/changelog/drop-column-oracle-patch.xml @@ -2,7 +2,7 @@ - +
diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml index c8a04b2..5203218 100644 --- a/common/changelog/drop-foreign-key-oracle-diff.xml +++ b/common/changelog/drop-foreign-key-oracle-diff.xml @@ -10,7 +10,7 @@ - + diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml index 54bee06..e44645b 100644 --- a/common/changelog/drop-foreign-key-oracle-patch.xml +++ b/common/changelog/drop-foreign-key-oracle-patch.xml @@ -2,7 +2,7 @@
- +
diff --git a/common/changelog/drop-index-oracle-diff.xml b/common/changelog/drop-index-oracle-diff.xml index f4ccba6..2ed5e65 100644 --- a/common/changelog/drop-index-oracle-diff.xml +++ b/common/changelog/drop-index-oracle-diff.xml @@ -9,7 +9,7 @@ - + diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml index 2d864a6..b934c83 100644 --- a/common/changelog/drop-index-oracle-patch.xml +++ b/common/changelog/drop-index-oracle-patch.xml @@ -3,7 +3,7 @@
- +
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml index 311e57e..39ed9be 100644 --- a/common/changelog/drop-table-oracle-diff.xml +++ b/common/changelog/drop-table-oracle-diff.xml @@ -9,7 +9,7 @@ - + diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml index 8b61d1c..bbe2660 100644 --- a/common/changelog/model-oracle.xml +++ b/common/changelog/model-oracle.xml @@ -7,7 +7,7 @@ - + -- cgit v1.1 From 4964bf912004c9190421ef573df6d1df4897e64c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 May 2013 18:12:57 -0400 Subject: Handle no rows case in returning UPDATE statement --- mssql/types/driver.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 1c2d7d8..33b606e 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -285,8 +286,17 @@ main (int argc, char* argv[]) p->str += 'd'; db->update (*p); assert (p->version > o.version); + o.str += 'D'; + try + { + db->update (o); + assert (false); + } + catch (const odb::object_changed&) {} db->reload (o); assert (o.version == p->version); + o.str += 'D'; + db->update (o); t.commit (); } } -- cgit v1.1 From 6ec616d6ad29bcf00f3a4d9ed8bf53d44e589228 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Jun 2013 06:23:18 -0400 Subject: Fix incorrect file name in comment --- evolution/tester | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evolution/tester b/evolution/tester index 9bb1ec7..2aecea6 100755 --- a/evolution/tester +++ b/evolution/tester @@ -1,6 +1,6 @@ #! /bin/sh -# file : evolution/tester.in +# file : evolution/tester # copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file -- cgit v1.1 From d83890c0c2c95da9e190a8f9a7ddc29cd621bef7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Jun 2013 13:22:37 +0200 Subject: Use database name in options and driver files (build part) This way we will be able to have several databases configured at the same time, which is needed for multi-database support testing. --- .gitignore | 4 ++-- boost/common/multi-index/makefile | 2 +- boost/common/optional/makefile | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/template/makefile | 2 +- boost/common/unordered/makefile | 2 +- boost/common/uuid/makefile | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/template/makefile | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/template/makefile | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/template/makefile | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/template/makefile | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/template/makefile | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 4 ++-- build/mssql/configure | 4 ++-- build/mysql/configure | 4 ++-- build/oracle/configure | 4 ++-- build/pgsql/configure | 4 ++-- build/sqlite/configure | 2 +- common/access/makefile | 2 +- common/auto/makefile | 2 +- common/blob/makefile | 2 +- common/callback/makefile | 2 +- common/circular/multiple/makefile | 2 +- common/circular/single/makefile | 2 +- common/composite-id/makefile | 2 +- common/composite/makefile | 2 +- common/const-member/makefile | 2 +- common/const-object/makefile | 2 +- common/container/basics/makefile | 2 +- common/container/change-tracking/makefile | 2 +- common/ctor/makefile | 2 +- common/default/makefile | 2 +- common/definition/makefile | 2 +- common/enum/makefile | 2 +- common/erase-query/makefile | 2 +- common/include/makefile | 2 +- common/index/makefile | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/transient/makefile | 2 +- common/inverse/makefile | 2 +- common/lazy-ptr/makefile | 2 +- common/lifecycle/makefile | 2 +- common/no-id/makefile | 2 +- common/optimistic/makefile | 2 +- common/pragma/makefile | 2 +- common/prepared/makefile | 2 +- common/query/array/makefile | 2 +- common/query/basics/makefile | 2 +- common/readonly/makefile | 2 +- common/relationship-query/makefile | 2 +- common/relationship/makefile | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/namespace/makefile | 2 +- common/session/cache/makefile | 2 +- common/session/custom/makefile | 2 +- common/template/makefile | 2 +- common/threads/makefile | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/makefile | 2 +- common/types/makefile | 2 +- common/view/makefile | 2 +- common/virtual/makefile | 2 +- common/wrapper/makefile | 2 +- evolution/add-column/makefile | 6 +++--- evolution/add-foreign-key/makefile | 6 +++--- evolution/add-index/makefile | 6 +++--- evolution/add-table/makefile | 6 +++--- evolution/alter-column/makefile | 6 +++--- evolution/combined/makefile | 6 +++--- evolution/data/makefile | 6 +++--- evolution/drop-column/makefile | 6 +++--- evolution/drop-foreign-key/makefile | 6 +++--- evolution/drop-index/makefile | 6 +++--- evolution/drop-table/makefile | 6 +++--- evolution/embedded/makefile | 6 +++--- evolution/template/makefile | 6 +++--- evolution/version/makefile | 6 +++--- mssql/custom/makefile | 2 +- mssql/database/makefile | 2 +- mssql/native/makefile | 2 +- mssql/query/makefile | 2 +- mssql/template/makefile | 2 +- mssql/types/makefile | 2 +- mysql/custom/makefile | 2 +- mysql/database/makefile | 2 +- mysql/index/makefile | 2 +- mysql/native/makefile | 2 +- mysql/template/makefile | 2 +- mysql/truncation/makefile | 2 +- mysql/types/makefile | 2 +- oracle/custom/makefile | 2 +- oracle/database/makefile | 2 +- oracle/native/makefile | 2 +- oracle/template/makefile | 2 +- oracle/types/makefile | 2 +- pgsql/custom/makefile | 2 +- pgsql/database/makefile | 2 +- pgsql/index/makefile | 2 +- pgsql/native/makefile | 2 +- pgsql/template/makefile | 2 +- pgsql/truncation/makefile | 2 +- pgsql/types/makefile | 2 +- qt/common/basic/makefile | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/template/makefile | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/template/makefile | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/template/makefile | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/template/makefile | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/template/makefile | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/template/makefile | 2 +- sqlite/custom/makefile | 2 +- sqlite/database/makefile | 2 +- sqlite/native/makefile | 2 +- sqlite/template/makefile | 2 +- sqlite/truncation/makefile | 2 +- sqlite/types/makefile | 2 +- 136 files changed, 170 insertions(+), 170 deletions(-) diff --git a/.gitignore b/.gitignore index 15db638..405cbcc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,8 @@ # Generated build system files. # *-dynamic.make -build/db.options -build/db-driver +build/*.options +build/*-driver # Generated .gitignore files. # diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index de891e6..bde0ebb 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index f46c931..6dc5c31 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index d183e0b..9225155 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index a3cf2c7..133177e 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 471944b..c88a8ec 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 9379b6a..7d39469 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -78,7 +78,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index a085b11..f7ce059 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -80,7 +80,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 1d7c4c8..fa9149c 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index e136fcf..401e5cc 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -79,7 +79,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 2ef239a..33b2440 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 4c7b3fc..9c804c0 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -80,7 +80,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 50b6be4..ca488c0 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index a60f648..a899d40 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -79,7 +79,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index c27ffad..1c63146 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -79,7 +79,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index a61f077..732cb09 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -79,7 +79,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 1001473..77500d2 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -79,7 +79,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/build/bootstrap.make b/build/bootstrap.make index cef108e..178f2aa 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -52,7 +52,7 @@ $(out_base)/.dist: export odb_header_stem := test # ifeq ($(filter $(db_id),sqlite),) $(out_base)/.test: schema-body = \ -$(call message,sql $$1,$(dcf_root)/db-driver $$1,$1)$(literal_newline)$(literal_tab) +$(call message,sql $$1,$(dcf_root)/$(db_id)-driver $$1,$1)$(literal_newline)$(literal_tab) $(out_base)/.test: schema = \ $(foreach s,$(if $1,$1,$(out_base)/test.sql),$(call schema-body,$s))@: endif diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 5576495..fb9f51f 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -9,8 +9,8 @@ ifndef %foreign% disfigure:: $(call message,rm $$1,rm -f $$1,$(dcf_root)/configuration-dynamic.make) - $(call message,rm $$1,rm -f $$1,$(dcf_root)/db.options) - $(call message,rm $$1,rm -f $$1,$(dcf_root)/db-driver) + $(call message,rm $$1,rm -f $$1,$(dcf_root)/*.options) + $(call message,rm $$1,rm -f $$1,$(dcf_root)/*-driver) endif diff --git a/build/mssql/configure b/build/mssql/configure index 33fbf7b..9603c10 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -39,8 +39,8 @@ $echo server=`read_value ""` -opt=$dcf_root/db.options -drv=$dcf_root/db-driver +opt=$dcf_root/mssql.options +drv=$dcf_root/mssql-driver echo "--user '$user'" >$opt echo "--password '$passwd'" >>$opt diff --git a/build/mysql/configure b/build/mysql/configure index afbf849..704a96f 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -53,8 +53,8 @@ $echo socket=`read_value "NULL"` -opt=$dcf_root/db.options -drv=$dcf_root/db-driver +opt=$dcf_root/mysql.options +drv=$dcf_root/mysql-driver echo "--user '$user'" >$opt diff --git a/build/oracle/configure b/build/oracle/configure index bcd3c6c..0366b76 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -55,8 +55,8 @@ $echo service=`read_value ""` -opt=$dcf_root/db.options -drv=$dcf_root/db-driver +opt=$dcf_root/oracle.options +drv=$dcf_root/oracle-driver if [ -n "$user" ]; then echo "--user '$user'" >$opt diff --git a/build/pgsql/configure b/build/pgsql/configure index 2e78a13..d129b54 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -44,8 +44,8 @@ $echo port=`read_value ""` -opt=$dcf_root/db.options -drv=$dcf_root/db-driver +opt=$dcf_root/pgsql.options +drv=$dcf_root/pgsql-driver echo "--user '$user'" >$opt echo "--database '$db'" >>$opt diff --git a/build/sqlite/configure b/build/sqlite/configure index 75a4773..a454df9 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -16,6 +16,6 @@ $echo db=`read_value "/tmp/odb-test.db"` -opt=$dcf_root/db.options +opt=$dcf_root/sqlite.options echo "--database '$db'" >$opt diff --git a/common/access/makefile b/common/access/makefile index d3d4438..7a8a86a 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/auto/makefile b/common/auto/makefile index baaf756..c317894 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/blob/makefile b/common/blob/makefile index 82d6523..ee9785f 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/callback/makefile b/common/callback/makefile index 7f0e8aa..f7b0ab6 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 5093f56..026d6db 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -71,7 +71,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 81c01a7..e5f645e 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 3c557ed..1b080e3 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/composite/makefile b/common/composite/makefile index 92da67f..1892ba1 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/const-member/makefile b/common/const-member/makefile index 8e1780e..83a398d 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/const-object/makefile b/common/const-object/makefile index 38881fa..043ab76 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 29d70bb..baddb9f 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index 9135405..b24f8ea 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/ctor/makefile b/common/ctor/makefile index 1290cb2..67f5656 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/default/makefile b/common/default/makefile index 82e268f..27ad049 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/definition/makefile b/common/definition/makefile index a7c87e6..837d5d6 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -72,7 +72,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/enum/makefile b/common/enum/makefile index ce2e6c2..466498f 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 7856090..378103f 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/include/makefile b/common/include/makefile index 3a74738..19d2705 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -53,7 +53,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/index/makefile b/common/index/makefile index c412619..82e0835 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index d250541..2be6810 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -71,7 +71,7 @@ $(dist): $(test): schemas := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.sql)) $(test): $(driver) $(src_base)/test.std $(call schema,$(schemas)) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 6541680..f116b0d 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 4e1ad99..65b1afa 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/inverse/makefile b/common/inverse/makefile index ed5f1f9..6089d8d 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index e4424ec..b5bafcf 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 0959a83..4caff60 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/no-id/makefile b/common/no-id/makefile index 3c4a4aa..d56c120 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 57836d3..9b5f06a 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/pragma/makefile b/common/pragma/makefile index 4ce8294..563809c 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/prepared/makefile b/common/prepared/makefile index 09a27cb..4c2bf28 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/query/array/makefile b/common/query/array/makefile index 296e9a2..0d65398 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/query/basics/makefile b/common/query/basics/makefile index e5ae0d1..2952b21 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/readonly/makefile b/common/readonly/makefile index f0a0fcc..adde950 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index c8157c5..164b0f0 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/relationship/makefile b/common/relationship/makefile index 9a8ce7d..4babd5e 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 2feb937..7989195 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -66,7 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 941e183..e8d840d 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -71,7 +71,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 370d6ca..c1157c9 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 5309cd9..c26b394 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 89d2296..e822b7a 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -69,7 +69,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/template/makefile b/common/template/makefile index e589b35..63768df 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/threads/makefile b/common/threads/makefile index 02dc303..cfd0e3f 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 23932d1..b384d47 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -48,7 +48,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 2ccadcd..f4ed18b 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -48,7 +48,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/types/makefile b/common/types/makefile index 54c6ba3..ec58785 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -65,7 +65,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/view/makefile b/common/view/makefile index 097ae7d..bc74e97 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/virtual/makefile b/common/virtual/makefile index c7d5f3f..a98a69d 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 5e7e5ff..8511bd9 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 0447ad4..a49ff52 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index c4eaef2..d3c9873 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -99,13 +99,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 26ba8f0..c46222f 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 8bcacb1..4d92861 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index f1cef39..3c198a2 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 81bfd3a..b243f60 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/data/makefile b/evolution/data/makefile index 7b1cc8e..ea711ed 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -96,13 +96,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 5c02c01..6f6cc6b 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index db62bfa..b22ce9d 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -99,13 +99,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 1bda96f..072e830 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index a9ad2f9..9165559 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index dfa675a..e8f5892 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -90,11 +90,11 @@ $(dist): # $(test): $(driver) # Base schema. - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/template/makefile b/evolution/template/makefile index f3a19bd..9df8125 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/evolution/version/makefile b/evolution/version/makefile index eab7cb8..fa365d6 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -98,13 +98,13 @@ $(test): $(driver) # Base schema. $(call schema,$(out_base)/test3-002-pre.sql) $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/db.options 1) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) # Migration. $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/db.options 2) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) $(call schema,$(out_base)/test3-003-post.sql) # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/db.options 3) + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) # Clean. # diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 03dfd7d..e9fa371 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mssql/database/makefile b/mssql/database/makefile index c9e2c59..2e64258 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mssql/native/makefile b/mssql/native/makefile index 17ff8a5..ac4e3ac 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mssql/query/makefile b/mssql/query/makefile index 98d1f68..166482f 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -66,7 +66,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mssql/template/makefile b/mssql/template/makefile index 2218018..a62384c 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mssql/types/makefile b/mssql/types/makefile index eeb9d8b..247d7a0 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 91c0a89..2b8afb8 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/database/makefile b/mysql/database/makefile index ef3e673..7ff07f0 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/index/makefile b/mysql/index/makefile index d3e7740..54b4974 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/native/makefile b/mysql/native/makefile index ce0a283..2e654ba 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/template/makefile b/mysql/template/makefile index c4afa1e..0a6c880 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 0825d67..0aa9bf6 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/mysql/types/makefile b/mysql/types/makefile index ef1fe9f..61d3898 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 866b4e2..dc9af00 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/oracle/database/makefile b/oracle/database/makefile index 6b0e4af..5873734 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/oracle/native/makefile b/oracle/native/makefile index 5137a8a..80d2fd1 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/oracle/template/makefile b/oracle/template/makefile index 19e8a34..5106239 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/oracle/types/makefile b/oracle/types/makefile index d303cea..448bcc1 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 27a4a34..f934bdb 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/database/makefile b/pgsql/database/makefile index f112d4d..585aaed 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 89b6f09..a97bd27 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 8f64144..9e625d7 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index f556c26..3367c4a 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 055aa6f..5f8d286 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index eb173ec..f20ae1e 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 82500c4..eea4f93 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -83,7 +83,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 975c2c7..a992a2f 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -83,7 +83,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index f957328..c14aeaf 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -83,7 +83,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index d504bc3..2619fd2 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -83,7 +83,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 372cb1e..3ec25d2 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -83,7 +83,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 4fe510b..43fa876 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index c1fcc99..f2ded55 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index c047418..33ebd1e 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 73c54c1..8b174a5 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 59ad1ed..448cdcd 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index c45aa0d..91c5afe 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 4625fbc..046bc90 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index e5f0bbd..2dc6c38 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 5f1a392..9b2863d 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 7699006..eaa4fdd 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 25a279b..8c75ef3 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index d22ca13..8ffa434 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 4457e60..1689df6 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 586ee90..a5f21ea 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -81,7 +81,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 8577e54..ee53224 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -75,7 +75,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index ffc1836..132d767 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 6f5c1c8..66051e4 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/native/makefile b/sqlite/native/makefile index b9418ef..5c31952 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/template/makefile b/sqlite/template/makefile index a9453d4..00f3770 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index ccc80fa..020e298 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index a588db4..f4abc56 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/db.options \ + $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) -- cgit v1.1 From e6b93ff477d7c789b786b059dcab1f66e5aae013 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Jun 2013 15:02:51 +0200 Subject: Use database name in options and driver files (autotools part) --- configure.ac | 2 +- evolution/makefile | 2 +- evolution/tester | 40 ---------------------------------------- evolution/tester.in | 43 +++++++++++++++++++++++++++++++++++++++++++ m4/mssql.m4 | 38 +++++++++++++++++++------------------- m4/mysql.m4 | 42 +++++++++++++++++++++--------------------- m4/oracle.m4 | 40 ++++++++++++++++++++-------------------- m4/pgsql.m4 | 40 ++++++++++++++++++++-------------------- m4/sqlite.m4 | 4 ++-- tester.in | 11 +++++++---- 10 files changed, 134 insertions(+), 128 deletions(-) delete mode 100755 evolution/tester create mode 100755 evolution/tester.in diff --git a/configure.ac b/configure.ac index 9dc69be..4a3af31 100644 --- a/configure.ac +++ b/configure.ac @@ -112,5 +112,5 @@ STATIC_LIB([LIBCOMMON_STATIC_LIB], [Static library interface.]) # AC_CONFIG_HEADERS([config.h libcommon/common/config.h]) AC_CONFIG_FILES([__path__(config_files)]) -AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester]) +AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester evolution/tester]) AC_OUTPUT diff --git a/evolution/makefile b/evolution/makefile index 9f85cf8..d83995e 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -33,7 +33,7 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := evolution $(dist): name := $(name) $(dist): data_dist := tester.bat -$(dist): exec_dist := tester +$(dist): exec_dist := tester.in $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export extra_dist := $(data_dist) $(exec_dist) test.bat \ $(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) diff --git a/evolution/tester b/evolution/tester deleted file mode 100755 index 2aecea6..0000000 --- a/evolution/tester +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh - -# file : evolution/tester -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Run an evolution test. The test driver is in the current directory. The -# data files, if any, are in $srcdir. -# - -if test -f test1.sql; then - # Standalone schema. - # - - # Drop everything. - $top_builddir/db-driver test3.sql || exit 1 - $top_builddir/db-driver test2.sql || exit 1 - $top_builddir/db-driver test1.sql || exit 1 - - # Base schema. - $top_builddir/db-driver test3-002-pre.sql || exit 1 - $top_builddir/db-driver test3-002-post.sql || exit 1 - ./driver --options-file "$top_builddir/db.options" 1 || exit 1 - - # Migration. - $top_builddir/db-driver test3-003-pre.sql || exit 1 - ./driver --options-file "$top_builddir/db.options" 2 || exit 1 - $top_builddir/db-driver test3-003-post.sql || exit 1 - - # Current schema. - ./driver --options-file "$top_builddir/db.options" 3 || exit 1 - -else - # Embedded schema. Just run the driver. - # - ./driver --options-file "$top_builddir/db.options" 1 || exit 1 - ./driver --options-file "$top_builddir/db.options" 2 || exit 1 - ./driver --options-file "$top_builddir/db.options" 3 || exit 1 -fi diff --git a/evolution/tester.in b/evolution/tester.in new file mode 100755 index 0000000..805b360 --- /dev/null +++ b/evolution/tester.in @@ -0,0 +1,43 @@ +#! /bin/sh + +# file : evolution/tester.in +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : GNU GPL v2; see accompanying LICENSE file + +# +# Run an evolution test. The test driver is in the current directory. The +# data files, if any, are in $srcdir. +# + +db_driver="$top_builddir/@database@-driver" +db_options="$top_builddir/@database@.options" + +if test -f test1.sql; then + # Standalone schema. + # + + # Drop everything. + $db_driver test3.sql || exit 1 + $db_driver test2.sql || exit 1 + $db_driver test1.sql || exit 1 + + # Base schema. + $db_driver test3-002-pre.sql || exit 1 + $db_driver test3-002-post.sql || exit 1 + ./driver --options-file "$db_options" 1 || exit 1 + + # Migration. + $db_driver test3-003-pre.sql || exit 1 + ./driver --options-file "$db_options" 2 || exit 1 + $db_driver test3-003-post.sql || exit 1 + + # Current schema. + ./driver --options-file "$db_options" 3 || exit 1 + +else + # Embedded schema. Just run the driver. + # + ./driver --options-file "$db_options" 1 || exit 1 + ./driver --options-file "$db_options" 2 || exit 1 + ./driver --options-file "$db_options" 3 || exit 1 +fi diff --git a/m4/mssql.m4 b/m4/mssql.m4 index dea9b98..38f2cee 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -176,39 +176,39 @@ fi # AC_CONFIG_COMMANDS([mssql.options], [ - rm -f db.options - echo '#! /bin/sh' >db-driver + rm -f mssql.options + echo '#! /bin/sh' >mssql-driver - echo 'opt=' >>db-driver + echo 'opt=' >>mssql-driver if test x$mssql_user_set = xyes; then - echo "--user '$mssql_user'" >>db.options - echo 'opt="$opt -U '"$mssql_user"'"' >>db-driver + echo "--user '$mssql_user'" >>mssql.options + echo 'opt="$opt -U '"$mssql_user"'"' >>mssql-driver - echo "--password '$mssql_password'" >>db.options - echo 'opt="$opt -P '"$mssql_password"'"' >>db-driver + echo "--password '$mssql_password'" >>mssql.options + echo 'opt="$opt -P '"$mssql_password"'"' >>mssql-driver fi if test x$mssql_db_set = xyes; then - echo "--database '$mssql_db'" >>db.options - echo 'opt="$opt -d '"$mssql_db"'"' >>db-driver + echo "--database '$mssql_db'" >>mssql.options + echo 'opt="$opt -d '"$mssql_db"'"' >>mssql-driver fi - echo "--server '$mssql_server'" >>db.options - echo 'opt="$opt -S '"$mssql_server"'"' >>db-driver + echo "--server '$mssql_server'" >>mssql.options + echo 'opt="$opt -S '"$mssql_server"'"' >>mssql-driver if test x$mssql_driver_set = xyes; then - echo "--driver '$mssql_driver'" >>db.options + echo "--driver '$mssql_driver'" >>mssql.options fi - echo 'opt="$opt -x -r -b"' >>db-driver - echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $mssql_client "'$opt -i $[]1' >>db-driver - echo "else" >>db-driver - echo " exec $mssql_client "'$opt' >>db-driver - echo "fi" >>db-driver + echo 'opt="$opt -x -r -b"' >>mssql-driver + echo 'if test x$[]1 != x; then' >>mssql-driver + echo " exec $mssql_client "'$opt -i $[]1' >>mssql-driver + echo "else" >>mssql-driver + echo " exec $mssql_client "'$opt' >>mssql-driver + echo "fi" >>mssql-driver - chmod +x db-driver + chmod +x mssql-driver ], [ mssql_client="$mssql_client" diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 6efc2b7..fd41025 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -203,48 +203,48 @@ fi # AC_CONFIG_COMMANDS([mysql.options], [ - rm -f db.options - echo '#! /bin/sh' >db-driver + rm -f mysql.options + echo '#! /bin/sh' >mysql-driver - echo 'opt=' >>db-driver + echo 'opt=' >>mysql-driver if test x$mysql_user_set = xyes; then - echo "--user '$mysql_user'" >>db.options - echo 'opt="$opt --user='"$mysql_user"'"' >>db-driver + echo "--user '$mysql_user'" >>mysql.options + echo 'opt="$opt --user='"$mysql_user"'"' >>mysql-driver fi if test x$mysql_password_set = xyes; then - echo "--password '$mysql_password'" >>db.options - echo 'opt="$opt --password='"$mysql_password"'"' >>db-driver + echo "--password '$mysql_password'" >>mysql.options + echo 'opt="$opt --password='"$mysql_password"'"' >>mysql-driver fi if test x$mysql_db_set = xyes; then - echo "--database '$mysql_db'" >>db.options - echo 'opt="$opt --database='"$mysql_db"'"' >>db-driver + echo "--database '$mysql_db'" >>mysql.options + echo 'opt="$opt --database='"$mysql_db"'"' >>mysql-driver fi if test x$mysql_host_set = xyes; then - echo "--host '$mysql_host'" >>db.options - echo 'opt="$opt --host='"$mysql_host"'"' >>db-driver + echo "--host '$mysql_host'" >>mysql.options + echo 'opt="$opt --host='"$mysql_host"'"' >>mysql-driver fi if test x$mysql_port_set = xyes; then - echo "--port '$mysql_port'" >>db.options - echo 'opt="$opt --port='"$mysql_port"'"' >>db-driver + echo "--port '$mysql_port'" >>mysql.options + echo 'opt="$opt --port='"$mysql_port"'"' >>mysql-driver fi if test x$mysql_socket_set = xyes; then - echo "--socket '$mysql_socket'" >>db.options - echo 'opt="$opt --socket='"$mysql_socket"'"' >>db-driver + echo "--socket '$mysql_socket'" >>mysql.options + echo 'opt="$opt --socket='"$mysql_socket"'"' >>mysql-driver fi - echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $mysql_client "'$opt <$[]1' >>db-driver - echo "else" >>db-driver - echo " exec $mysql_client "'$opt' >>db-driver - echo "fi" >>db-driver + echo 'if test x$[]1 != x; then' >>mysql-driver + echo " exec $mysql_client "'$opt <$[]1' >>mysql-driver + echo "else" >>mysql-driver + echo " exec $mysql_client "'$opt' >>mysql-driver + echo "fi" >>mysql-driver - chmod +x db-driver + chmod +x mysql-driver ], [ mysql_client="$mysql_client" diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 920e981..ba8b7d6 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -180,47 +180,47 @@ fi # AC_CONFIG_COMMANDS([oracle.options], [ - rm -f db.options - echo '#! /bin/sh' >db-driver + rm -f oracle.options + echo '#! /bin/sh' >oracle-driver - echo 'conn_str=' >>db-driver + echo 'conn_str=' >>oracle-driver if test x$oracle_user_set = xyes; then - echo "--user '$oracle_user'" >>db.options - echo 'conn_str="'"$oracle_user"'"' >>db-driver + echo "--user '$oracle_user'" >>oracle.options + echo 'conn_str="'"$oracle_user"'"' >>oracle-driver fi if test x$oracle_password_set = xyes; then - echo "--password '$oracle_password'" >>db.options - echo 'conn_str="$conn_str/'"$oracle_password"'"' >>db-driver + echo "--password '$oracle_password'" >>oracle.options + echo 'conn_str="$conn_str/'"$oracle_password"'"' >>oracle-driver fi if test x$oracle_host_set = xyes; then - echo "--host '$oracle_host'" >>db.options - echo 'conn_str="$conn_str@//'"$oracle_host"'"' >>db-driver + echo "--host '$oracle_host'" >>oracle.options + echo 'conn_str="$conn_str@//'"$oracle_host"'"' >>oracle-driver if test x$oracle_port_set = xyes; then - echo "--port '$oracle_port'" >>db.options - echo 'conn_str="$conn_str:'"$oracle_port"'"' >>db-driver + echo "--port '$oracle_port'" >>oracle.options + echo 'conn_str="$conn_str:'"$oracle_port"'"' >>oracle-driver fi fi if test x$oracle_service != x; then if test x$oracle_host_set = xno; then - echo 'conn_str="$conn_str@"' >>db-driver + echo 'conn_str="$conn_str@"' >>oracle-driver fi - echo "--service '$oracle_service'" >>db.options - echo 'conn_str="$conn_str/'"$oracle_service"'"' >>db-driver + echo "--service '$oracle_service'" >>oracle.options + echo 'conn_str="$conn_str/'"$oracle_service"'"' >>oracle-driver fi - echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $oracle_client -L -S "'$conn_str @$[]1' >>db-driver - echo "else" >>db-driver - echo " exec $oracle_client -L -S "'$conn_str' >>db-driver - echo "fi" >>db-driver + echo 'if test x$[]1 != x; then' >>oracle-driver + echo " exec $oracle_client -L -S "'$conn_str @$[]1' >>oracle-driver + echo "else" >>oracle-driver + echo " exec $oracle_client -L -S "'$conn_str' >>oracle-driver + echo "fi" >>oracle-driver - chmod +x db-driver + chmod +x oracle-driver ], [ oracle_client="$oracle_client" diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index 0ee4a4c..bb3c26e 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -149,42 +149,42 @@ fi # AC_CONFIG_COMMANDS([pgsql.options], [ - rm -f db.options - echo '#! /bin/sh' >db-driver + rm -f pgsql.options + echo '#! /bin/sh' >pgsql-driver - echo 'opt=' >>db-driver + echo 'opt=' >>pgsql-driver if test x$pgsql_user_set = xyes; then - echo "--username '$pgsql_user'" >>db.options - echo 'opt="$opt --username='"$pgsql_user"'"' >>db-driver + echo "--username '$pgsql_user'" >>pgsql.options + echo 'opt="$opt --username='"$pgsql_user"'"' >>pgsql-driver fi if test x$pgsql_db_set = xyes; then - echo "--dbname '$pgsql_db'" >>db.options - echo 'opt="$opt --dbname='"$pgsql_db"'"' >>db-driver + echo "--dbname '$pgsql_db'" >>pgsql.options + echo 'opt="$opt --dbname='"$pgsql_db"'"' >>pgsql-driver fi if test x$pgsql_host_set = xyes; then - echo "--host '$pgsql_host'" >>db.options - echo 'opt="$opt --host='"$pgsql_host"'"' >>db-driver + echo "--host '$pgsql_host'" >>pgsql.options + echo 'opt="$opt --host='"$pgsql_host"'"' >>pgsql-driver fi if test x$pgsql_port_set = xyes; then - echo "--port '$pgsql_port'" >>db.options - echo 'opt="$opt --port='"$pgsql_port"'"' >>db-driver + echo "--port '$pgsql_port'" >>pgsql.options + echo 'opt="$opt --port='"$pgsql_port"'"' >>pgsql-driver fi - echo 'opt="$opt --quiet"' >>db-driver - echo 'PGOPTIONS=--client-min-messages=warning' >>db-driver - echo 'export PGOPTIONS' >>db-driver + echo 'opt="$opt --quiet"' >>pgsql-driver + echo 'PGOPTIONS=--client-min-messages=warning' >>pgsql-driver + echo 'export PGOPTIONS' >>pgsql-driver - echo 'if test x$[]1 != x; then' >>db-driver - echo " exec $pgsql_client "'$opt --set ON_ERROR_STOP=1 -f $[]1' >>db-driver - echo "else" >>db-driver - echo " exec $pgsql_client "'$opt' >>db-driver - echo "fi" >>db-driver + echo 'if test x$[]1 != x; then' >>pgsql-driver + echo " exec $pgsql_client "'$opt --set ON_ERROR_STOP=1 -f $[]1' >>pgsql-driver + echo "else" >>pgsql-driver + echo " exec $pgsql_client "'$opt' >>pgsql-driver + echo "fi" >>pgsql-driver - chmod +x db-driver + chmod +x pgsql-driver ], [ pgsql_client="$pgsql_client" diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 9dc616a..247382e 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -46,10 +46,10 @@ fi # AC_CONFIG_COMMANDS([sqlite.options], [ - rm -f db.options + rm -f sqlite.options if test x$sqlite_db_set = xyes; then - echo "--database '$sqlite_db'" >>db.options + echo "--database '$sqlite_db'" >>sqlite.options fi ], [ diff --git a/tester.in b/tester.in index c9873d4..e2d5297 100755 --- a/tester.in +++ b/tester.in @@ -9,11 +9,14 @@ # data files, if any, are in $srcdir. # +db_driver="$top_builddir/@database@-driver" +db_options="$top_builddir/@database@.options" + # Globbing returns files in alphabetic order. # for f in `echo test*.sql`; do if test -f $f; then - $top_builddir/db-driver $f + $db_driver $f if test $? -ne 0; then exit 1 @@ -21,10 +24,10 @@ for f in `echo test*.sql`; do fi done -echo ./driver --options-file "$top_builddir/db.options" +echo ./driver --options-file "$db_options" if test -f "$srcdir/test.std"; then - ./driver --options-file "$top_builddir/db.options" >test.out + ./driver --options-file "$db_options" >test.out if test $? -ne 0; then exit 1 @@ -35,5 +38,5 @@ if test -f "$srcdir/test.std"; then rm -f test.out exit $r else - ./driver --options-file "$top_builddir/db.options" + ./driver --options-file "$db_options" fi -- cgit v1.1 From 2b03a8fa879bd583c889b101f567927a959cdc0f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Jun 2013 12:46:23 +0200 Subject: Use fixed options file names in database-specific tests --- mssql/custom/makefile | 2 +- mssql/database/makefile | 2 +- mssql/native/makefile | 2 +- mssql/query/makefile | 2 +- mssql/template/makefile | 2 +- mssql/types/makefile | 2 +- mysql/custom/makefile | 2 +- mysql/database/makefile | 2 +- mysql/index/makefile | 2 +- mysql/native/makefile | 2 +- mysql/template/makefile | 2 +- mysql/truncation/makefile | 2 +- mysql/types/makefile | 2 +- oracle/custom/makefile | 2 +- oracle/database/makefile | 2 +- oracle/native/makefile | 2 +- oracle/template/makefile | 2 +- oracle/types/makefile | 2 +- pgsql/custom/makefile | 2 +- pgsql/database/makefile | 2 +- pgsql/index/makefile | 2 +- pgsql/native/makefile | 2 +- pgsql/template/makefile | 2 +- pgsql/truncation/makefile | 2 +- pgsql/types/makefile | 2 +- sqlite/custom/makefile | 3 +-- sqlite/database/makefile | 2 +- sqlite/native/makefile | 2 +- sqlite/template/makefile | 3 +-- sqlite/truncation/makefile | 3 +-- sqlite/types/makefile | 3 +-- 31 files changed, 31 insertions(+), 35 deletions(-) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index e9fa371..9acc2f5 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mssql/database/makefile b/mssql/database/makefile index 2e64258..e1bf4ba 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mssql/native/makefile b/mssql/native/makefile index ac4e3ac..24d88ae 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mssql/query/makefile b/mssql/query/makefile index 166482f..6f7106e 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -66,7 +66,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mssql/template/makefile b/mssql/template/makefile index a62384c..8bfaa68 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mssql/types/makefile b/mssql/types/makefile index 247d7a0..58636bd 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 2b8afb8..fa1dce3 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/database/makefile b/mysql/database/makefile index 7ff07f0..63aa90d 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/index/makefile b/mysql/index/makefile index 54b4974..a2ceec8 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/native/makefile b/mysql/native/makefile index 2e654ba..520c7ed 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/template/makefile b/mysql/template/makefile index 0a6c880..e34f486 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 0aa9bf6..179c830 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/mysql/types/makefile b/mysql/types/makefile index 61d3898..a1fa920 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) diff --git a/oracle/custom/makefile b/oracle/custom/makefile index dc9af00..7bae1fa 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) diff --git a/oracle/database/makefile b/oracle/database/makefile index 5873734..0eeb978 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) diff --git a/oracle/native/makefile b/oracle/native/makefile index 80d2fd1..9b7449e 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) diff --git a/oracle/template/makefile b/oracle/template/makefile index 5106239..743b405 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) diff --git a/oracle/types/makefile b/oracle/types/makefile index 448bcc1..ebbfc19 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index f934bdb..5c98b1d 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -68,7 +68,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 585aaed..490fd4e 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index a97bd27..e030f35 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 9e625d7..a23b4a8 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 3367c4a..2f503a4 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 5f8d286..099927e 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -65,7 +65,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index f20ae1e..7fe798c 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -67,7 +67,7 @@ $(dist): # $(test): $(driver) $(src_base)/test.std $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 132d767..62d5539 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -64,8 +64,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 66051e4..b2ec5cd 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 5c31952..0d6a314 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -46,7 +46,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 00f3770..c4bb3f0 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -64,8 +64,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 020e298..6cfed59 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -64,8 +64,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index f4abc56..cc6f7ff 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -66,8 +66,7 @@ $(dist): # Test. # $(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).options \ + $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) -- cgit v1.1 From 236cd9bb1dd022e64d690c9b0080d1a15c5f61c7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Jun 2013 21:57:07 +0200 Subject: Handle --database option directly in automake and VC++ projects --- boost/common/multi-index/makefile | 8 ++++---- boost/common/optional/makefile | 8 ++++---- boost/common/smart-ptr/makefile | 8 ++++---- boost/common/template/Makefile.am | 2 +- boost/common/template/makefile | 8 ++++---- boost/common/template/template-vc10.vcxproj | 2 +- boost/common/template/template-vc11.vcxproj | 2 +- boost/common/template/template-vc9.vcproj | 2 +- boost/common/unordered/makefile | 8 ++++---- boost/common/uuid/makefile | 8 ++++---- common/access/makefile | 5 +++-- common/auto/makefile | 6 +++--- common/blob/makefile | 6 +++--- common/callback/makefile | 7 ++++--- common/circular/multiple/makefile | 7 ++++--- common/circular/single/makefile | 7 ++++--- common/composite-id/makefile | 7 ++++--- common/composite/makefile | 7 ++++--- common/const-member/makefile | 6 +++--- common/const-object/makefile | 7 ++++--- common/container/basics/makefile | 5 +++-- common/container/change-tracking/makefile | 5 +++-- common/ctor/makefile | 7 ++++--- common/default/makefile | 7 ++++--- common/definition/makefile | 5 +++-- common/enum/makefile | 7 ++++--- common/erase-query/makefile | 7 ++++--- common/include/makefile | 3 +-- common/index/makefile | 6 +++--- common/inheritance/polymorphism/makefile | 7 ++++--- common/inheritance/reuse/makefile | 7 ++++--- common/inheritance/transient/makefile | 7 ++++--- common/inverse/makefile | 7 ++++--- common/lazy-ptr/makefile | 7 ++++--- common/lifecycle/makefile | 5 +++-- common/no-id/makefile | 7 ++++--- common/optimistic/makefile | 7 ++++--- common/pragma/makefile | 6 +++--- common/prepared/makefile | 7 ++++--- common/query/array/makefile | 8 ++++---- common/query/basics/makefile | 7 ++++--- common/readonly/makefile | 5 +++-- common/relationship-query/makefile | 7 ++++--- common/relationship/makefile | 7 ++++--- common/schema/embedded/basics/makefile | 5 +++-- common/schema/embedded/order/makefile | 5 +++-- common/schema/namespace/makefile | 7 ++++--- common/session/cache/makefile | 7 ++++--- common/session/custom/makefile | 9 +++++---- common/template/Makefile.am | 2 +- common/template/makefile | 5 +++-- common/template/template-vc10.vcxproj | 2 +- common/template/template-vc11.vcxproj | 2 +- common/template/template-vc9.vcproj | 2 +- common/threads/makefile | 7 ++++--- common/transaction/basics/makefile | 1 - common/transaction/callback/makefile | 1 - common/types/makefile | 5 +++-- common/view/makefile | 7 ++++--- common/virtual/makefile | 7 ++++--- common/wrapper/makefile | 6 +++--- evolution/add-column/makefile | 5 +++-- evolution/add-foreign-key/makefile | 5 +++-- evolution/add-index/makefile | 5 +++-- evolution/add-table/makefile | 5 +++-- evolution/alter-column/makefile | 5 +++-- evolution/combined/makefile | 5 +++-- evolution/data/makefile | 5 +++-- evolution/drop-column/makefile | 5 +++-- evolution/drop-foreign-key/makefile | 5 +++-- evolution/drop-index/makefile | 5 +++-- evolution/drop-table/makefile | 5 +++-- evolution/embedded/makefile | 5 +++-- evolution/template/Makefile.am | 6 +++--- evolution/template/makefile | 5 +++-- evolution/template/template-vc10.vcxproj | 6 +++--- evolution/template/template-vc11.vcxproj | 6 +++--- evolution/template/template-vc9.vcproj | 6 +++--- evolution/version/makefile | 5 +++-- qt/common/basic/makefile | 8 ++++---- qt/common/containers/basics/makefile | 8 ++++---- qt/common/containers/change-tracking/makefile | 8 ++++---- qt/common/smart-ptr/makefile | 8 ++++---- qt/common/template/Makefile.am | 2 +- qt/common/template/makefile | 8 ++++---- qt/common/template/template-qt4-vc10.vcxproj | 2 +- qt/common/template/template-qt4-vc11.vcxproj | 2 +- qt/common/template/template-qt4-vc9.vcproj | 2 +- qt/common/template/template-qt5-vc10.vcxproj | 2 +- qt/common/template/template-qt5-vc11.vcxproj | 2 +- qt/common/template/template-qt5-vc9.vcproj | 2 +- 91 files changed, 275 insertions(+), 227 deletions(-) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index bde0ebb..fabf4b7 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/multi-index --generate-schema \ ---table-prefix boost_multi_index_ +$(gen) $(dist): export odb_options += --generate-schema \ +--profile boost/multi-index --table-prefix boost_multi_index_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 6dc5c31..5502501 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/optional --generate-schema --generate-query \ ---table-prefix boost_optional_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--profile boost/optional --table-prefix boost_optional_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 9225155..4574160 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/smart-ptr --generate-schema --generate-session \ ---table-prefix boost_smart_ptr_ +$(gen) $(dist): export odb_options += --generate-schema --generate-session \ +--profile boost/smart-ptr --table-prefix boost_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index f136cff..fcaa178 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -29,4 +29,4 @@ ODBFLAGS += --std c++11 endif test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 133177e..ee924b1 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/version --generate-schema \ ---table-prefix boost_template_ #@@ CHANGE table prefix, boost/version +$(gen) $(dist): export odb_options += --generate-schema \ +--profile boost/version --table-prefix boost_template_ #@@ CHANGE prefix, profile $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj index af7987e..3c606f9 100644 --- a/boost/common/template/template-vc10.vcxproj +++ b/boost/common/template/template-vc10.vcxproj @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/boost/common/template/template-vc11.vcxproj b/boost/common/template/template-vc11.vcxproj index 72fb7e3..59da6d0 100644 --- a/boost/common/template/template-vc11.vcxproj +++ b/boost/common/template/template-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj index bf900d0..b8bf4bc 100644 --- a/boost/common/template/template-vc9.vcproj +++ b/boost/common/template/template-vc9.vcproj @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index c88a8ec..88cad51 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/unordered --generate-schema \ ---table-prefix boost_unordered_ +$(gen) $(dist): export odb_options += --generate-schema \ +--profile boost/unordered --table-prefix boost_unordered_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 7d39469..dbb3016 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile boost/uuid --generate-schema --generate-query \ ---table-prefix boost_uuid_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--profile boost/uuid --table-prefix boost_uuid_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/common/access/makefile b/common/access/makefile index 7a8a86a..1cb1d2f 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -34,12 +34,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix access_ --accessor-regex "\#(.+)\#Get\u\1\#" \ --modifier-regex "\#(.+)\#Set\u\1\#" $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -50,7 +52,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/auto/makefile b/common/auto/makefile index c317894..ed5e3f9 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix auto_ +$(gen) $(dist): export odb_options += --generate-schema --table-prefix auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/blob/makefile b/common/blob/makefile index ee9785f..4deb80e 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix blob_ +$(gen) $(dist): export odb_options += --generate-schema --table-prefix blob_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/callback/makefile b/common/callback/makefile index f7b0ab6..f38fa60 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix callback_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix callback_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 026d6db..92784d1 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -34,8 +34,8 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---schema-format embedded --generate-query --table-prefix circular_m_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--schema-format embedded --table-prefix circular_m_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -43,6 +43,8 @@ $(gen): $(common.l.cpp-options) # $(gen): $(addprefix $(src_base)/,$(odb_hdr)) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -53,7 +55,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/circular/single/makefile b/common/circular/single/makefile index e5f645e..1708b6c 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix circular_s_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix circular_s_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 1b080e3..29227ae 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-session --table-prefix t_comp_id_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix t_comp_id_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/composite/makefile b/common/composite/makefile index 1892ba1..a1fed9b 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_comp_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_comp_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/const-member/makefile b/common/const-member/makefile index 83a398d..fc855c5 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix constm_ +$(gen) $(dist): export odb_options += --generate-schema --table-prefix constm_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/const-object/makefile b/common/const-object/makefile index 043ab76..d8015cf 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix consto_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix consto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/container/basics/makefile b/common/container/basics/makefile index baddb9f..d6c4949 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix t_cont_bs_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index b24f8ea..de4c148 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix t_cont_changet_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/ctor/makefile b/common/ctor/makefile index 67f5656..a94a113 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix ctor_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix ctor_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/default/makefile b/common/default/makefile index 27ad049..44e6d04 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix default_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix default_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/definition/makefile b/common/definition/makefile index 837d5d6..370a739 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -34,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix definition_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -43,6 +43,8 @@ $(gen): $(common.l.cpp-options) # $(gen): $(src_base)/time-mapping.hxx +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -53,7 +55,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/enum/makefile b/common/enum/makefile index 466498f..466ad98 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix enum_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix enum_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 378103f..949064e 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix erase_query_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix erase_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/include/makefile b/common/include/makefile index 19d2705..eb25d9f 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -35,8 +35,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---table-prefix include_ +$(gen): 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) diff --git a/common/index/makefile b/common/index/makefile index 82e0835..610aec3 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix index_ +$(gen) $(dist): export odb_options += --generate-schema --table-prefix index_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 2be6810..d7a8e2f 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -36,11 +36,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --table-prefix inhrt_p_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix inhrt_p_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -51,7 +53,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index f116b0d..874d48b 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inhrt_r_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix inhrt_r_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 65b1afa..f20894e 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix inhrt_t_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix inhrt_t_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/inverse/makefile b/common/inverse/makefile index 6089d8d..a1c3202 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-session --table-prefix t_inverse_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix t_inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index b5bafcf..cfb7010 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-session --table-prefix lazy_ptr_ +$(gen) $(dist): export odb_options += --generate-schema --generate-session \ +--table-prefix lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 4caff60..3d700d9 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/no-id/makefile b/common/no-id/makefile index d56c120..439e883 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix no_id_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix no_id_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 9b5f06a..8da011e 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_optimistic_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_optimistic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/pragma/makefile b/common/pragma/makefile index 563809c..bb54f7a 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---table-prefix pragma_ +$(gen) $(dist): export odb_options += --table-prefix pragma_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/prepared/makefile b/common/prepared/makefile index 4c2bf28..72d0974 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --omit-unprepared --table-prefix prepared_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --omit-unprepared --table-prefix prepared_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/query/array/makefile b/common/query/array/makefile index 0d65398..3708b9d 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -34,12 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --sql-name-case oracle:upper \ ---table-prefix t_query_array_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --sql-name-case oracle:upper --table-prefix t_query_array_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -50,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/query/basics/makefile b/common/query/basics/makefile index 2952b21..ec63728 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --table-prefix t_query_basics_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix t_query_basics_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/readonly/makefile b/common/readonly/makefile index adde950..3c586bd 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix readonly_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 164b0f0..56994b5 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-session --table-prefix relationship_query_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix relationship_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/relationship/makefile b/common/relationship/makefile index 4babd5e..c469a93 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix t_relationship_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_relationship_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 7989195..96e987a 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --schema-format embedded --schema-name test --table-prefix schema_embd_bscs_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index e8d840d..e8897d5 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -34,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --schema-format embedded --table-prefix schema_embd_ordr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) @@ -43,6 +43,8 @@ $(gen): $(common.l.cpp-options) # $(gen): $(addprefix $(src_base)/,$(odb_hdr)) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -53,7 +55,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index c1157c9..38f6be1 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix schema_ns_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix schema_ns_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/session/cache/makefile b/common/session/cache/makefile index c26b394..3219565 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-session --table-prefix session_cache_ +$(gen) $(dist): export odb_options += --generate-schema --generate-session \ +--table-prefix session_cache_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/session/custom/makefile b/common/session/custom/makefile index e822b7a..2342b04 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -34,12 +34,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-session --session-type ::session --hxx-prologue \ -'\#include "session.hxx"' --table-prefix session_custom_ +$(gen) $(dist): export odb_options += --generate-schema --generate-session \ +--session-type ::session --hxx-prologue '\#include "session.hxx"' \ +--table-prefix session_custom_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -50,7 +52,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := session.hxx session.txx diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 3571bc2..50ad1bc 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -35,6 +35,6 @@ BUILT_SOURCES += __f-odb.hxx CLEANFILES += __f-odb.hxx __f-odb.ixx __f-odb.cxx __f-odb.hxx: __f.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< )) diff --git a/common/template/makefile b/common/template/makefile index 63768df..0d8cf60 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index c1229ea..fb21140 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -161,7 +161,7 @@ m4_dnl __custom_build_entry__( __f.hxx, odb __f.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) ) ) diff --git a/common/template/template-vc11.vcxproj b/common/template/template-vc11.vcxproj index 048f160..c1f1b0d 100644 --- a/common/template/template-vc11.vcxproj +++ b/common/template/template-vc11.vcxproj @@ -165,7 +165,7 @@ m4_dnl __custom_build_entry__( __f.hxx, odb __f.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) ) ) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index a09174c..976b870 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -352,7 +352,7 @@ __ifelse__(__value__(odb_options),,, __file_entry_custom_build__( __f.hxx, odb __f.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) __file_entry__(__f-odb.hxx) __file_entry__(__f-odb.ixx))) diff --git a/common/threads/makefile b/common/threads/makefile index cfd0e3f..91adc8d 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --table-prefix threads_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix threads_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index b384d47..a399e8c 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -32,7 +32,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index f4ed18b..e60c936 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -32,7 +32,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) diff --git a/common/types/makefile b/common/types/makefile index ec58785..f47e4d4 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -34,10 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --table-prefix types_ +$(gen) $(dist): export odb_options += --table-prefix types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -48,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/view/makefile b/common/view/makefile index bc74e97..6aad221 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-prepared --table-prefix t_view_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix t_view_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/virtual/makefile b/common/virtual/makefile index a98a69d..168c969 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --generate-session --table-prefix virtual_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix virtual_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # 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 diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 8511bd9..68492c1 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -34,11 +34,12 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix wrapper_ +$(gen) $(dist): export odb_options += --generate-schema --table-prefix wrapper_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +50,6 @@ $(out_base)/: $(driver) # 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 diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index a49ff52..7da8b71 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_add_c_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index d3c9873..3446e5b 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -45,9 +45,10 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ --table-prefix evo_add_fk_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -75,7 +76,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index c46222f..50a6673 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_add_i_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 4d92861..a57e56e 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_add_t_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 3c198a2..998c915 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_alter_c_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/combined/makefile b/evolution/combined/makefile index b243f60..33c5176 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_comb_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/data/makefile b/evolution/data/makefile index ea711ed..6787527 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -43,8 +43,9 @@ gen := $(gen1) $(gen2) $(gen3) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_data_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -72,7 +73,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 6f6cc6b..26b31ac 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_drop_c_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index b22ce9d..78d1602 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -45,9 +45,10 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ --table-prefix evo_drop_fk_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -75,7 +76,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 072e830..2e849c1 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_drop_i_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 9165559..ff6014f 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_drop_t_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index e8f5892..8503ce7 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -43,8 +43,9 @@ gen := $(gen1) $(gen2) $(gen3) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --schema-format embedded --at-once --table-prefix evo_embedded_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -72,7 +73,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 2d71bc3..b81650d 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -29,7 +29,7 @@ BUILT_SOURCES = test1-odb.hxx CLEANFILES = test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml test1-odb.hxx: test1.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options1) --changelog model.xml $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options1) --changelog model.xml $< # test2.hxx # @@ -39,7 +39,7 @@ BUILT_SOURCES = test2-odb.hxx CLEANFILES = test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql test2-odb.hxx: test2.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options2) --changelog model.xml $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options2) --changelog model.xml $< # test3.hxx # @@ -50,7 +50,7 @@ CLEANFILES += test3-odb.hxx test3-odb.ixx test3-odb.cxx test3.sql \ test3-002-pre.sql test3-002-post.sql test3-003-pre.sql test3-003-post.sql test3-odb.hxx: test3.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options3) --changelog model.xml $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options3) --changelog model.xml $< # Make sure testN.hxx are compiled serially since they share the # changelog. Also add dependency on model.hxx diff --git a/evolution/template/makefile b/evolution/template/makefile index 9df8125..88bf49a 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_template_ #@@ CHANGE THIS +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/evolution/template/template-vc10.vcxproj b/evolution/template/template-vc10.vcxproj index 70b8687..a98b681 100644 --- a/evolution/template/template-vc10.vcxproj +++ b/evolution/template/template-vc10.vcxproj @@ -158,19 +158,19 @@ __custom_build_entry__( test1.hxx, odb test1.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __custom_build_entry__( test2.hxx, odb test2.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __custom_build_entry__( test3.hxx, odb test3.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options3), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) diff --git a/evolution/template/template-vc11.vcxproj b/evolution/template/template-vc11.vcxproj index 5895a46..0bdafd9 100644 --- a/evolution/template/template-vc11.vcxproj +++ b/evolution/template/template-vc11.vcxproj @@ -162,19 +162,19 @@ __custom_build_entry__( test1.hxx, odb test1.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __custom_build_entry__( test2.hxx, odb test2.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __custom_build_entry__( test3.hxx, odb test3.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options3), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) diff --git a/evolution/template/template-vc9.vcproj b/evolution/template/template-vc9.vcproj index 4c9b465..536f154 100644 --- a/evolution/template/template-vc9.vcproj +++ b/evolution/template/template-vc9.vcproj @@ -350,7 +350,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test1.hxx, odb test1.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options1), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __file_entry__(test1-odb.hxx) @@ -358,7 +358,7 @@ __file_entry__(test1-odb.ixx) __file_entry_custom_build__( test2.hxx, odb test2.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options2), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __file_entry__(test2-odb.hxx) @@ -366,7 +366,7 @@ __file_entry__(test2-odb.ixx) __file_entry_custom_build__( test3.hxx, odb test3.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options3), @database@, __value__(database)) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) __file_entry__(test3-odb.hxx) diff --git a/evolution/version/makefile b/evolution/version/makefile index fa365d6..bcb4819 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -45,8 +45,9 @@ test3-003-pre.sql test3-003-post.sql $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --database $(db_id) --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query \ --generate-schema --at-once --table-prefix evo_version_ +$(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ --schema-name 2 --suppress-migration @@ -74,7 +75,7 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) -$(dist): db_id := @database@ + $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index eea4f93..05d3375 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/basic --generate-schema --generate-query \ ---table-prefix qt_basic_ +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--profile qt/basic --table-prefix qt_basic_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index a992a2f..a14a29f 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_cont_bs_ +$(gen) $(dist): export odb_options += --generate-schema \ +--profile qt/containers --profile qt/basic --table-prefix qt_cont_bs_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index c14aeaf..4cfee92 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_cont_ct_ +$(gen) $(dist): export odb_options += --generate-schema \ +--profile qt/containers --profile qt/basic --table-prefix qt_cont_ct_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 2619fd2..b539e08 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/smart-ptr --generate-schema --generate-session \ ---table-prefix qt_smart_ptr_ +$(gen) $(dist): export odb_options += --generate-schema --generate-session \ +--profile qt/smart-ptr --table-prefix qt_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index 80ef463..c65ad21 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -29,4 +29,4 @@ ODBFLAGS += --std c++11 endif test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 3ec25d2..9836dca 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -43,13 +43,14 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/version --generate-schema \ ---table-prefix qt_template_ #@@ CHANGE table prefix, qt/version +$(gen) $(dist): export odb_options += --generate-schema \ +--profile qt/version --table-prefix qt_template_ #@@ CHANGE prefix, profile $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -60,7 +61,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/qt/common/template/template-qt4-vc10.vcxproj b/qt/common/template/template-qt4-vc10.vcxproj index 1c4b458..fddcac3 100644 --- a/qt/common/template/template-qt4-vc10.vcxproj +++ b/qt/common/template/template-qt4-vc10.vcxproj @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-qt4-vc11.vcxproj b/qt/common/template/template-qt4-vc11.vcxproj index b9a0bc4..cecfe53 100644 --- a/qt/common/template/template-qt4-vc11.vcxproj +++ b/qt/common/template/template-qt4-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-qt4-vc9.vcproj b/qt/common/template/template-qt4-vc9.vcproj index e8a6a3c..b37675e 100644 --- a/qt/common/template/template-qt4-vc9.vcproj +++ b/qt/common/template/template-qt4-vc9.vcproj @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/qt/common/template/template-qt5-vc10.vcxproj b/qt/common/template/template-qt5-vc10.vcxproj index 2e721ee..add071a 100644 --- a/qt/common/template/template-qt5-vc10.vcxproj +++ b/qt/common/template/template-qt5-vc10.vcxproj @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-qt5-vc11.vcxproj b/qt/common/template/template-qt5-vc11.vcxproj index afcc020..2af597c 100644 --- a/qt/common/template/template-qt5-vc11.vcxproj +++ b/qt/common/template/template-qt5-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-qt5-vc9.vcproj b/qt/common/template/template-qt5-vc9.vcproj index dab4913..57b4edc 100644 --- a/qt/common/template/template-qt5-vc9.vcproj +++ b/qt/common/template/template-qt5-vc9.vcproj @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) -- cgit v1.1 From 6cd8b9f561b912f264ba4f723845935c40a3cb95 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jun 2013 10:39:59 +0200 Subject: Add support for running tests in dynamic multi-database mode Only possible in the development build system at this stage. --- boost/common/makefile | 10 +- boost/common/multi-index/makefile | 29 ++- boost/common/optional/makefile | 29 ++- boost/common/smart-ptr/makefile | 29 ++- boost/common/template/makefile | 29 ++- boost/common/unordered/makefile | 29 ++- boost/common/uuid/makefile | 29 ++- boost/makefile | 15 +- boost/mssql/date-time/makefile | 21 +- boost/mssql/makefile | 5 - boost/mssql/template/makefile | 21 +- boost/mysql/date-time/makefile | 21 +- boost/mysql/makefile | 5 - boost/mysql/template/makefile | 21 +- boost/oracle/date-time/makefile | 21 +- boost/oracle/makefile | 5 - boost/oracle/template/makefile | 21 +- boost/pgsql/date-time/makefile | 21 +- boost/pgsql/makefile | 5 - boost/pgsql/template/makefile | 21 +- boost/sqlite/date-time/makefile | 21 +- boost/sqlite/makefile | 5 - boost/sqlite/template/makefile | 21 +- build/bootstrap.make | 107 +++++++-- build/configure | 15 +- build/import/odb/hxx-cxx.make | 97 ++++++-- common/access/makefile | 29 ++- common/access/test.hxx | 2 + common/auto/makefile | 29 ++- common/blob/makefile | 29 ++- common/callback/driver.cxx | 1 - common/callback/makefile | 29 ++- common/changelog/makefile | 12 +- common/circular/multiple/driver.cxx | 19 +- common/circular/multiple/makefile | 28 ++- common/circular/single/makefile | 29 ++- common/composite-id/makefile | 29 ++- common/composite/makefile | 29 ++- common/const-member/makefile | 29 ++- common/const-object/makefile | 29 ++- common/container/basics/makefile | 29 ++- common/container/change-tracking/makefile | 29 ++- common/ctor/makefile | 29 ++- common/default/driver.cxx | 11 +- common/default/makefile | 29 ++- common/definition/makefile | 29 ++- common/enum/makefile | 29 ++- common/erase-query/driver.cxx | 30 +-- common/erase-query/makefile | 29 ++- common/include/makefile | 20 +- common/index/makefile | 29 ++- common/inheritance/polymorphism/makefile | 30 ++- common/inheritance/reuse/makefile | 29 ++- common/inheritance/transient/makefile | 29 ++- common/inverse/makefile | 29 ++- common/lazy-ptr/makefile | 29 ++- common/lifecycle/makefile | 29 ++- common/makefile | 14 +- common/no-id/makefile | 29 ++- common/optimistic/makefile | 29 ++- common/pragma/makefile | 28 ++- common/prepared/makefile | 29 ++- common/query/array/driver.cxx | 34 +++ common/query/array/makefile | 29 ++- common/query/array/test.hxx | 3 + common/query/basics/driver.cxx | 88 +++++--- common/query/basics/makefile | 29 ++- common/readonly/driver.cxx | 3 + common/readonly/makefile | 29 ++- common/relationship-query/makefile | 29 ++- common/relationship/makefile | 29 ++- common/schema/embedded/basics/driver.cxx | 11 +- common/schema/embedded/basics/makefile | 28 ++- common/schema/embedded/order/driver.cxx | 20 +- common/schema/embedded/order/makefile | 28 ++- common/schema/namespace/makefile | 29 ++- common/schema/namespace/test.hxx | 2 + common/session/cache/makefile | 29 ++- common/session/custom/makefile | 29 ++- common/template/makefile | 29 ++- common/threads/driver.cxx | 18 +- common/threads/makefile | 29 ++- common/transaction/basics/makefile | 15 +- common/transaction/callback/makefile | 15 +- common/types/makefile | 28 ++- common/view/driver.cxx | 84 +++---- common/view/makefile | 29 ++- common/virtual/makefile | 29 ++- common/wrapper/makefile | 29 ++- evolution/add-column/makefile | 34 +-- evolution/add-foreign-key/makefile | 34 +-- evolution/add-index/makefile | 34 +-- evolution/add-table/makefile | 34 +-- evolution/alter-column/makefile | 34 +-- evolution/combined/makefile | 34 +-- evolution/data/makefile | 30 +-- evolution/drop-column/makefile | 34 +-- evolution/drop-foreign-key/makefile | 34 +-- evolution/drop-index/makefile | 34 +-- evolution/drop-table/makefile | 34 +-- evolution/embedded/makefile | 30 +-- evolution/makefile | 5 - evolution/template/makefile | 34 +-- evolution/version/makefile | 34 +-- libcommon/common/common.cxx | 314 ++++++++++++++++++-------- libcommon/common/common.hxx | 13 +- libcommon/common/concrete.hxx | 9 + libcommon/common/makefile | 44 +++- libcommon/makefile | 4 - makefile | 18 +- mssql/custom/makefile | 21 +- mssql/database/makefile | 11 +- mssql/makefile | 5 - mssql/native/makefile | 11 +- mssql/query/makefile | 21 +- mssql/template/makefile | 21 +- mssql/types/makefile | 21 +- mysql/custom/makefile | 21 +- mysql/database/makefile | 11 +- mysql/index/makefile | 21 +- mysql/makefile | 5 - mysql/native/makefile | 11 +- mysql/template/makefile | 21 +- mysql/truncation/makefile | 21 +- mysql/types/makefile | 21 +- oracle/custom/makefile | 21 +- oracle/database/makefile | 11 +- oracle/makefile | 5 - oracle/native/makefile | 11 +- oracle/template/makefile | 21 +- oracle/types/makefile | 21 +- pgsql/custom/makefile | 21 +- pgsql/database/makefile | 11 +- pgsql/index/makefile | 17 +- pgsql/makefile | 5 - pgsql/native/makefile | 11 +- pgsql/template/makefile | 17 +- pgsql/truncation/makefile | 21 +- pgsql/types/makefile | 21 +- qt/common/basic/makefile | 29 ++- qt/common/containers/basics/makefile | 29 ++- qt/common/containers/change-tracking/makefile | 29 ++- qt/common/makefile | 10 +- qt/common/smart-ptr/makefile | 29 ++- qt/common/template/makefile | 29 ++- qt/makefile | 15 +- qt/mssql/basic/makefile | 21 +- qt/mssql/date-time/makefile | 21 +- qt/mssql/makefile | 5 - qt/mssql/template/makefile | 21 +- qt/mysql/basic/makefile | 21 +- qt/mysql/date-time/makefile | 21 +- qt/mysql/makefile | 5 - qt/mysql/template/makefile | 21 +- qt/oracle/basic/makefile | 21 +- qt/oracle/date-time/makefile | 21 +- qt/oracle/makefile | 5 - qt/oracle/template/makefile | 21 +- qt/pgsql/basic/makefile | 21 +- qt/pgsql/date-time/makefile | 21 +- qt/pgsql/makefile | 5 - qt/pgsql/template/makefile | 21 +- qt/sqlite/basic/makefile | 21 +- qt/sqlite/date-time/makefile | 21 +- qt/sqlite/makefile | 5 - qt/sqlite/template/makefile | 21 +- sqlite/custom/makefile | 20 +- sqlite/database/makefile | 11 +- sqlite/makefile | 5 - sqlite/native/makefile | 11 +- sqlite/template/makefile | 20 +- sqlite/truncation/makefile | 20 +- sqlite/types/makefile | 20 +- 173 files changed, 1851 insertions(+), 2425 deletions(-) diff --git a/boost/common/makefile b/boost/common/makefile index 266d9b9..4c81d25 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -15,11 +15,6 @@ uuid all_tests := $(tests) build_tests := $(tests) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := boost-common @@ -35,6 +30,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(tests)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index fabf4b7..2aa5651 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 5502501..e29b486 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema --generate-query \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 4574160..f41eb40 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema --generate-session \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/template/makefile b/boost/common/template/makefile index ee924b1..881ac76 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 88cad51..0ed08d8 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index dbb3016..3498175 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 += --generate-schema --generate-query \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -76,12 +74,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -89,7 +86,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/makefile b/boost/makefile index 264655a..ff5f003 100644 --- a/boost/makefile +++ b/boost/makefile @@ -6,12 +6,12 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make all_dirs := common mysql sqlite pgsql oracle mssql dirs := common -dirs += $(db_id) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +# Database-specific tests are not run in the multi-database configuration. +# +ifneq ($(db_id),common) +dirs += $(db_id) +endif $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) @@ -21,6 +21,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) $(call include,$(bld_root)/dist.make) diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index f7ce059..cc9dff1 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 mssql \ @@ -78,12 +72,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -91,7 +80,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 81c0ebb..6751f63 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mssql diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index fa9149c..6c472e0 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 mssql --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 401e5cc..aaff422 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 mysql --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 069d6e0..748c54a 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mysql diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 33b2440..5ca6481 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 mysql --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 9c804c0..0b386ca 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 oracle \ @@ -78,12 +72,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -91,7 +80,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 3294e24..e7e72ab 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-oracle diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index ca488c0..18e3307 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 oracle --profile boost \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index a899d40..5915e53 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 pgsql --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 94e993f..4834247 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-pgsql diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 1c63146..5423cbc 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 pgsql --profile boost \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 732cb09..8f4e620 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 sqlite --profile boost/date-time \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index e76501d..c0a26f5 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -8,11 +8,6 @@ tests := \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-sqlite diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 77500d2..b6b1fb0 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -42,9 +39,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.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 sqlite --profile boost \ @@ -77,12 +71,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -90,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/build/bootstrap.make b/build/bootstrap.make index 178f2aa..7d5b84e 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -27,21 +27,64 @@ def_goal := $(.DEFAULT_GOAL) # $(call include,$(bld_root)/cxx/configuration.make) +# Databases. +# +databases := mysql sqlite pgsql oracle mssql +$(dist): databases := $(databases) + # Aliases # -.PHONY: $(out_base)/ \ - $(out_base)/.test \ - $(out_base)/.dist \ - $(out_base)/.clean +default := $(out_base)/ +driver := $(out_base)/driver +test := $(out_base)/.test +dist := $(out_base)/.dist +clean := $(out_base)/.clean + +.PHONY: $(default) \ + $(test) \ + $(dist) \ + $(clean) + +ifeq ($(db_id),common) +define db-test-target +test_$1 := $$(out_base)/.test-$1 +.PHONY: $$(test_$1) +$$(test): $$(test_$1) -ifdef %interactive% +endef +$(foreach d,$(databases),$(eval $(call db-test-target,$d))) + +define db-test-dir +$$(test_$1): $$(addprefix $$(out_base)/,$$(addsuffix /.test-$1,$2)) + +endef +endif +ifdef %interactive% .PHONY: test dist clean +test: $(test) +dist: $(dist) +clean: $(clean) -test: $(out_base)/.test -dist: $(out_base)/.dist -clean: $(out_base)/.clean +ifeq ($(db_id),common) +define db-test-alias +.PHONY: test-$1 +test-$1: $$(test_$1) +endef +$(foreach d,$(databases),$(eval $(call db-test-alias,$d))) +endif +endif + +# Return the list of ODB-generated files given a list of header files. +# +ifdef db_id +ifneq ($(db_id),common) +odb-gen = $(foreach f,$(1:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) +else +odb-gen = $(foreach f,$(1:.hxx=),$(addprefix $f, -odb.hxx -odb.ixx -odb.cxx \ +$(foreach d,$(databases),-odb-$d.hxx -odb-$d.ixx -odb-$d.cxx -$d.sql))) +endif endif # By default the ODB header is called test.hxx. @@ -50,13 +93,50 @@ $(out_base)/.dist: export odb_header_stem := test # Database schema creation. # -ifeq ($(filter $(db_id),sqlite),) -$(out_base)/.test: schema-body = \ -$(call message,sql $$1,$(dcf_root)/$(db_id)-driver $$1,$1)$(literal_newline)$(literal_tab) +ifneq ($(db_id),sqlite) +$(out_base)/.test $(addprefix $(out_base)/.test-,$(databases)): schema-body = \ +$(call message,sql $$1,$(dcf_root)/$1-driver $$1,$2)$(literal_newline)$(literal_tab) + +ifneq ($(db_id),common) $(out_base)/.test: schema = \ -$(foreach s,$(if $1,$1,$(out_base)/test.sql),$(call schema-body,$s))@: +$(foreach s,$(if $1,$1,$(out_base)/test.sql),$(call schema-body,$(db_id),$s))@: +else +define db-schema +$$(out_base)/.test-$1: schema-$1 = \ +$$(foreach s,$$(if $$1,$$(filter %-$1.sql,$$1),$$(out_base)/test-$1.sql),$$(call schema-body,$1,$$s))@: + +endef +$(foreach d,$(filter-out sqlite,$(databases)),$(eval $(call db-schema,$d))) +endif endif +# Test rule templates. +# + +# $1 database name in the multi-database mode and empty otherwise +# +define test-schemaless-rule +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std + $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ +$$(dcf_root)/$(if $1,$1,$(db_id)).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) + +endef + +# $1 database name in the multi-database mode and empty otherwise +# $2 optional list of schema files, by default test.sql +# +define test-rule +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std + $$(call schema$(if $1,-$1),$2) + $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ +$$(dcf_root)/$(if $1,$1,$(db_id)).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) + +endef + # Dist setup. # ifneq ($(filter $(MAKECMDGOALS),dist),) @@ -67,9 +147,6 @@ ifeq ($(dist_prefix),) $(error dist_prefix is not set) endif -databases := mysql sqlite pgsql oracle mssql -$(dist): databases := $(databases) - # $1 project template without the -vcN.vc[x]proj suffix. # $2 project name without the -vcN.vc[x]proj suffix. # diff --git a/build/configure b/build/configure index aecf319..1184b5b 100755 --- a/build/configure +++ b/build/configure @@ -18,6 +18,8 @@ $echo "configuring '$project_name'" $echo $echo +databases="mysql sqlite pgsql oracle mssql" + $echo $echo "Please select the database you would like to use:" $echo @@ -26,10 +28,19 @@ $echo "(2) SQLite" $echo "(3) PostgreSQL" $echo "(4) Oracle" $echo "(5) Microsoft SQL Server" +$echo "(6) Dynamic multi-database support (all above databases)" $echo -db_id=`read_option "mysql sqlite pgsql oracle mssql"` +db_id=`read_option "$databases common"` echo "db_id := $db_id" >$1 -source $scf_root/$db_id/configure +if [ $db_id != "common" ]; then + source $scf_root/$db_id/configure +else + # For multi-database support we configure every database. + # + for db in $databases; do + source $scf_root/$db/configure + done +fi diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index a67d6b7..683827e 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -9,45 +9,95 @@ # $(call include,$(bld_root)/cxx/configuration.make) +odb_databases := mysql sqlite pgsql oracle mssql + odb_pattern := \ $(out_base)/%-odb.$(cxx_s_suffix) \ $(out_base)/%-odb.$(cxx_h_suffix) \ $(out_base)/%-odb.$(cxx_i_suffix) \ $(out_base)/%.sql -$(odb_pattern): odb_options := \ ---hxx-suffix .$(cxx_h_suffix) \ ---ixx-suffix .$(cxx_i_suffix) \ +odb_patterns := $(odb_pattern) + +define odb-db-pattern +odb_$1_pattern := \ +$$(out_base)/%-odb-$1.$$(cxx_s_suffix) \ +$$(out_base)/%-odb-$1.$$(cxx_h_suffix) \ +$$(out_base)/%-odb-$1.$$(cxx_i_suffix) \ +$$(out_base)/%-$1.sql + +odb_patterns += $$(odb_$1_pattern) + +endef # Trailing newline is important. + +$(foreach d,$(odb_databases),$(eval $(call odb-db-pattern,$d))) + +$(odb_patterns): odb_options := \ +--hxx-suffix .$(cxx_h_suffix) \ +--ixx-suffix .$(cxx_i_suffix) \ --cxx-suffix .$(cxx_s_suffix) -$(odb_pattern): odb-expand-cpp-options-impl = \ +$(odb_patterns): odb-expand-cpp-options-impl = \ $(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) -$(odb_pattern): odb-expand-cpp-options = \ +$(odb_patterns): odb-expand-cpp-options = \ $(call odb-expand-cpp-options-impl,$(filter %.cpp-options,$1)) -.PRECIOUS: $(odb_pattern) +# We only check for the long option name to avoid false positives. +# +$(odb_pattern): odb-default-database = \ +$(if $(filter --multi-database ,$(odb_options)),--database common ) + +$(odb_pattern): odb-default-database-message = \ +$(if $(filter --multi-database ,$(odb_options)),[common] ) + +.PRECIOUS: $(odb_patterns) ifeq ($(out_base),$(src_base)) $(odb_pattern): $(src_base)/%.$(cxx_h_suffix) - $(call message,odb $<,$(odb) $(cpp_options) \ -$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ ---output-dir $(dir $@) $<) + $(call message,odb $(call odb-default-database-message)$<,$(odb) \ +$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(odb_options) $(call odb-default-database)--output-dir $(dir $@) $<) + +define odb-db-rule +$$(odb_$1_pattern): $$(src_base)/%.$$(cxx_h_suffix) + $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ +$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ +--database $1 --output-dir $$(dir $$@) $$<) + +endef # Trailing newline is important. else $(odb_pattern): $(src_base)/%.$(cxx_h_suffix) | $$(dir $$@). - $(call message,odb $<,$(odb) $(cpp_options) \ -$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ ---output-dir $(dir $@) $<) + $(call message,odb $(call odb-default-database-message)$<,$(odb) \ +$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(odb_options) $(call odb-default-database)--output-dir $(dir $@) $<) $(odb_pattern): $(out_base)/%.$(cxx_h_suffix) | $$(dir $$@). - $(call message,odb $<,$(odb) $(cpp_options) \ -$(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) $(odb_options) \ ---output-dir $(dir $@) $<) + $(call message,odb $(call odb-default-database-message)$<,$(odb) \ +$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ +$(odb_options) $(call odb-default-database) --output-dir $(dir $@) $<) + +define odb-db-rule +$$(odb_$1_pattern): $$(src_base)/%.$$(cxx_h_suffix) | $$$$(dir $$$$@). + $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ +$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ +--database $1 --output-dir $$(dir $$@) $$<) + +$$(odb_$1_pattern): $$(out_base)/%.$$(cxx_h_suffix) | $$$$(dir $$$$@). + $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ +$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ +--database $1 --output-dir $$(dir $$@) $$<) + +endef # Trailing newline is important. endif +$(foreach d,$(odb_databases),$(eval $(call odb-db-rule,$d))) + +# Clean. +# .PHONY: $(out_base)/%-odb.cxx.hxx.clean $(out_base)/%-odb.cxx.hxx.clean: cxx_s_suffix := $(cxx_s_suffix) @@ -59,3 +109,20 @@ $(out_base)/%-odb.cxx.hxx.clean: $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_h_suffix))) $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_i_suffix))) $(call message,rm $$1,rm -f $$1,$(@:-odb.cxx.hxx.clean=.sql)) + +define odb-db-clean-rule +.PHONY: $$(out_base)/%-odb-$1.cxx.hxx.clean + +$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_s_suffix := $$(cxx_s_suffix) +$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_h_suffix := $$(cxx_h_suffix) +$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_i_suffix := $$(cxx_i_suffix) + +$$(out_base)/%-odb-$1.cxx.hxx.clean: + $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_s_suffix))) + $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_h_suffix))) + $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_i_suffix))) + $$(call message,rm $$$$1,rm -f $$$$1,$$(@:-odb-$1.cxx.hxx.clean=-$1.sql)) + +endef # Trailing newline is important. + +$(foreach d,$(odb_databases),$(eval $(call odb-db-clean-rule,$d))) diff --git a/common/access/makefile b/common/access/makefile index 1cb1d2f..9d9da3b 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -40,7 +34,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -67,12 +65,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -80,7 +77,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/access/test.hxx b/common/access/test.hxx index 4073766..6c4516e 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -26,6 +26,8 @@ # define BINARY16_TYPE "RAW(16)" # elif defined(ODB_DATABASE_MSSQL) # define BINARY16_TYPE "BINARY(16)" +# elif defined(ODB_DATABASE_COMMON) +# define BINARY16_TYPE "" # else # error unknown database # endif diff --git a/common/auto/makefile b/common/auto/makefile index ed5e3f9..409d5b6 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --generate-schema --table-prefix auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,12 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -78,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/blob/makefile b/common/blob/makefile index 4deb80e..4cdfd01 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --generate-schema --table-prefix blob_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,12 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -78,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 0597645..d8e91db 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -13,7 +13,6 @@ #include #include -#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" diff --git a/common/callback/makefile b/common/callback/makefile index f38fa60..35e2254 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/changelog/makefile b/common/changelog/makefile index 8d5e96d..bd0f243 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -15,14 +15,11 @@ add-index.hxx \ drop-index.hxx \ add-foreign-key.hxx \ drop-foreign-key.hxx +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(call import,\ # $(default): -genf := $(foreach f,$(odb_hdr:.hxx=-odb),$(addprefix $f,.hxx .ixx .cxx)) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) FORCE # Force regeneration even if up to date. $(gen): odb := $(odb) $(gen): export odb_options += --database $(db_id) --generate-schema-only \ @@ -81,7 +75,7 @@ $(test): | $(out_base)/. # Clean. # $(clean): changelogs := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.xml)) -$(clean): $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) +$(clean): $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(changelogs)) # Generated .gitignore. diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index cc730be..09a34e7 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -15,7 +15,6 @@ #include #include -#include // DATABASE_XXX #include #include "test1.hxx" @@ -43,21 +42,19 @@ main (int argc, char* argv[]) // For these databases this is the only way to drop circularly- // dependant tables. // -#if defined(DATABASE_MYSQL) - c->execute ("SET FOREIGN_KEY_CHECKS=0"); -#elif defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=OFF"); -#endif + if (db->id () == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); + else if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); transaction t (c->begin ()); schema_catalog::create_schema (*db); t.commit (); -#if defined(DATABASE_MYSQL) - c->execute ("SET FOREIGN_KEY_CHECKS=1"); -#elif defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=ON"); -#endif + if (db->id () == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); + else if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); } query bq (query::d->id != 0); diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 92784d1..d603c82 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema --generate-query \ @@ -43,7 +37,11 @@ $(gen): $(common.l.cpp-options) # $(gen): $(addprefix $(src_base)/,$(odb_hdr)) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -71,11 +69,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # @@ -83,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 1708b6c..1e88748 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 29227ae..59ffd1b 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/composite/makefile b/common/composite/makefile index a1fed9b..c32f9c8 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/const-member/makefile b/common/const-member/makefile index fc855c5..d366517 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --generate-schema --table-prefix constm_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,12 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -78,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/const-object/makefile b/common/const-object/makefile index d8015cf..46c968c 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index d6c4949..433d610 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index de4c148..354059f 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/ctor/makefile b/common/ctor/makefile index a94a113..ab1dc32 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 515cb38..56f9a3d 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -13,7 +13,6 @@ #include #include -#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" @@ -34,11 +33,11 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); -#else - db->execute ("INSERT INTO \"default_object\" (\"obj_id\") VALUES (1)"); -#endif + if (db->id () != odb::id_oracle) + db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); + else + db->execute ("INSERT INTO \"default_object\" (\"obj_id\") VALUES (1)"); + t.commit (); } diff --git a/common/default/makefile b/common/default/makefile index 44e6d04..652af83 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/definition/makefile b/common/definition/makefile index 370a739..280a27c 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test.hxx time-mapping.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema \ @@ -43,7 +37,11 @@ $(gen): $(common.l.cpp-options) # $(gen): $(src_base)/time-mapping.hxx +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -71,12 +69,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -84,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/enum/makefile b/common/enum/makefile index 466ad98..00e7da4 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 6c69bfc..302e506 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -12,7 +12,6 @@ #include #include -#include // DATABASE_XXX #include #include "test.hxx" @@ -62,13 +61,14 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - assert (db->erase_query ( - "erase_query_object.id < 3") == 2); -#else - assert (db->erase_query ( - "\"erase_query_object\".\"id\" < 3") == 2); -#endif + + if (db->id () != odb::id_oracle) + assert (db->erase_query ( + "erase_query_object.id < 3") == 2); + else + assert (db->erase_query ( + "\"erase_query_object\".\"id\" < 3") == 2); + db->erase_query (); t.commit (); } @@ -162,13 +162,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - assert (db->execute ("SELECT * FROM erase_query_object_v " - "WHERE object_id = 1") == 0); -#else - assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " - "WHERE \"object_id\" = 1") == 0); -#endif + + if (db->id () != odb::id_oracle) + assert (db->execute ("SELECT * FROM erase_query_object_v " + "WHERE object_id = 1") == 0); + else + assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " + "WHERE \"object_id\" = 1") == 0); t.commit (); } } diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 949064e..f66d840 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/include/makefile b/common/include/makefile index eb25d9f..9428c59 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -30,9 +27,6 @@ $(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): odb_options += --database $(db_id) --table-prefix include_ @@ -51,11 +45,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -63,7 +53,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/index/makefile b/common/index/makefile index 610aec3..690e2ab 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --generate-schema --table-prefix index_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,12 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -78,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index d7a8e2f..2609151 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -8,17 +8,14 @@ cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx \ test14.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -31,9 +28,6 @@ $(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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema --generate-query \ @@ -41,7 +35,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -69,13 +67,11 @@ $(dist): # Test. # -$(test): schemas := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.sql)) -$(test): $(driver) $(src_base)/test.std - $(call schema,$(schemas)) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule,,$(filter %.sql,$(gen)))) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d,$(filter %.sql,$(gen))))) +endif # Clean. # @@ -83,7 +79,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 874d48b..f240640 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index f20894e..4d6ba4d 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/inverse/makefile b/common/inverse/makefile index a1c3202..89c98ee 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index cfb7010..03e39af 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-session \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-session \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 3d700d9..f047e0f 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/makefile b/common/makefile index ebf969a..44adcc7 100644 --- a/common/makefile +++ b/common/makefile @@ -57,10 +57,7 @@ cxx11_tests := session/custom no_dist_tests := changelog include -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +no_multi_tests := changelog include $(default): $(call include,$(bld_root)/cxx/standard.make) # cxx_standard @@ -72,6 +69,10 @@ ifeq ($(cxx_standard),c++11) build_tests += $(cxx11_tests) endif +ifeq ($(db_id),common) +build_tests := $(filter-out $(no_multi_tests),$(build_tests)) +endif + $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := common @@ -89,6 +90,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(build_tests)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) diff --git a/common/no-id/makefile b/common/no-id/makefile index 439e883..99df92d 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 8da011e..ac61e5a 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/pragma/makefile b/common/pragma/makefile index bb54f7a..1ea8ba1 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --table-prefix pragma_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,11 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # @@ -77,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/prepared/makefile b/common/prepared/makefile index 72d0974..d905419 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index c449566..5b0d378 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -32,6 +32,7 @@ const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; const odb::oracle::database_type_id bt = odb::oracle::id_raw; #elif defined(DATABASE_MSSQL) const odb::mssql::database_type_id bt = odb::mssql::id_binary; +#elif defined(DATABASE_COMMON) #else # error unknown database #endif @@ -66,57 +67,78 @@ main (int argc, char* argv[]) // string // +#ifndef DATABASE_COMMON assert (size (db->query (query::s == "abc")) == 1); assert (size (db->query (query::s == query::_val ("bcd"))) == 1); assert (size (db->query ("s = " + query::_val ("bcd"))) == 1); assert (size (db->query ("s = " + query::_ref ("bcd"))) == 1); +#endif { char a[] = "bcd"; char* ra = a; +#ifndef DATABASE_COMMON assert (size (db->query (query::s == a)) == 1); assert (size (db->query (query::s == query::_val (a))) == 1); +#endif assert (size (db->query (query::s == query::_ref (ra))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("s = " + query::_val (a))) == 1); assert (size (db->query ("s = " + query::_ref (a))) == 1); +#endif } { const char a[] = "bcd"; const char* ra = a; +#ifndef DATABASE_COMMON assert (size (db->query (query::s == a)) == 1); assert (size (db->query (query::s == query::_val (a))) == 1); +#endif assert (size (db->query (query::s == query::_ref (ra))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("s = " + query::_val (a))) == 1); assert (size (db->query ("s = " + query::_ref (a))) == 1); +#endif } { const char* p = "cde"; +#ifndef DATABASE_COMMON assert (size (db->query (query::s == p)) == 1); assert (size (db->query (query::s == query::_val (p))) == 1); +#endif assert (size (db->query (query::s == query::_ref (p))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("s = " + query::_val (p))) == 1); assert (size (db->query ("s = " + query::_ref (p))) == 1); +#endif } { char a[] = "cde"; char* p = a; +#ifndef DATABASE_COMMON assert (size (db->query (query::s == p)) == 1); assert (size (db->query (query::s == query::_val (p))) == 1); +#endif assert (size (db->query (query::s == query::_ref (p))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("s = " + query::_val (p))) == 1); assert (size (db->query ("s = " + query::_ref (p))) == 1); +#endif } +#ifndef DATABASE_COMMON string s ("abc"); //assert (size (db->query (query::s == s)) == 1); assert (size (db->query (query::s == s.c_str ())) == 1); //assert (size (db->query (query::s == query::_val (s))) == 1); assert (size (db->query (query::s == query::_val (s.c_str ()))) == 1); + assert (size (db->query ("s = " + query::_val (s))) == 1); assert (size (db->query ("s = " + query::_ref (s))) == 1); +#endif assert (size (db->query (query::s == query::s1)) == 3); @@ -126,12 +148,16 @@ main (int argc, char* argv[]) array a; strcpy (a.data (), "abc"); +#ifndef DATABASE_COMMON assert (size (db->query (query::a == a)) == 1); assert (size (db->query (query::a == query::_val (a))) == 1); +#endif assert (size (db->query (query::a == query::_ref (a))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("a = " + query::_val (a))) == 1); assert (size (db->query ("a = " + query::_ref (a))) == 1); #endif +#endif // char // @@ -141,18 +167,26 @@ main (int argc, char* argv[]) assert (size (db->query (query::c == query::_val (c))) == 1); assert (size (db->query (query::c == query::_ref (c))) == 1); +#ifndef DATABASE_COMMON assert (size (db->query ("c = " + query::_val ('c'))) == 1); assert (size (db->query ("c = " + query::_ref (c))) == 1); +#endif assert (size (db->query (query::c == query::c1)) == 3); // buffer // +#ifndef DATABASE_COMMON assert (size (db->query (query::b == buf)) == 3); assert (size (db->query (query::b == query::_val (buf))) == 3); +#endif + assert (size (db->query (query::b == query::_ref (buf))) == 3); + +#ifndef DATABASE_COMMON assert (size (db->query ("b = " + query::_val (buf))) == 3); assert (size (db->query ("b = " + query::_ref (buf))) == 3); +#endif t.commit (); } diff --git a/common/query/array/makefile b/common/query/array/makefile index 3708b9d..d8fa45b 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index e086a44..e9cbd15 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -46,6 +46,8 @@ struct object # pragma db type("VARCHAR(16)") # elif defined(ODB_DATABASE_SQLITE) # pragma db type("TEXT") +# elif defined(ODB_DATABASE_COMMON) +# pragma db type("DYMMU") // Necessary to make it a value. # else # error unknown database # endif @@ -67,6 +69,7 @@ struct object # pragma db type("RAW(16)") # elif defined(ODB_DATABASE_MSSQL) # pragma db type("BINARY(16)") +# elif defined(ODB_DATABASE_COMMON) # else # error unknown database # endif diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index ee8e3b1..be45237 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -48,6 +48,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv)); + odb::database_id db_id (db->id ()); typedef odb::query query; typedef odb::result result; @@ -70,8 +71,13 @@ main (int argc, char* argv[]) t.commit (); } + // + // Native queries. + // + // Compilation tests. // +#ifndef DATABASE_COMMON if (false) { string name; @@ -92,6 +98,7 @@ main (int argc, char* argv[]) query q1 (query::_val (name)); q1 += " = first"; } +#endif // Select-all query. // @@ -139,11 +146,13 @@ main (int argc, char* argv[]) cout << "test 003" << endl; { transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - result r (db->query ("age >= 30 AND last = 'Doe'")); -#else - result r (db->query ("\"age\" >= 30 AND \"last\" = 'Doe'")); -#endif + + result r; + if (db_id != odb::id_oracle) + r = db->query ("age >= 30 AND last = 'Doe'"); + else + r = db->query ("\"age\" >= 30 AND \"last\" = 'Doe'"); + print (r); t.commit (); } @@ -156,16 +165,22 @@ main (int argc, char* argv[]) const char* name = "Doe"; -#ifndef DATABASE_ORACLE +#if defined(DATABASE_COMMON) result r ( db->query ( - "age >= " + query::_ref (30) + "AND" + - "last = " + query::_val (name))); -#else + query::age >= query::_val (30) && + query::last_name == query::_val (name))); + +#elif defined(DATABASE_ORACLE) result r ( db->query ( - "\"age\" >= " + query::_ref (30) + "AND" + + "\"age\" >= " + query::_val (30) + "AND" + "\"last\" = " + query::_val (name))); +#else + result r ( + db->query ( + "age >= " + query::_val (30) + "AND" + + "last = " + query::_val (name))); #endif print (r); @@ -181,12 +196,15 @@ main (int argc, char* argv[]) string name; unsigned short age; -#ifndef DATABASE_ORACLE - query q ("age >= " + query::_ref (age) + "AND" + - "last = " + query::_ref (name)); -#else +#if defined(DATABASE_COMMON) + query q (query::age >= query::_ref (age) && + query::last_name == query::_ref (name)); +#elif defined(DATABASE_ORACLE) query q ("\"age\" >= " + query::_ref (age) + "AND" + "\"last\" = " + query::_ref (name)); +#else + query q ("age >= " + query::_ref (age) + "AND" + + "last = " + query::_ref (name)); #endif name = "Doe"; @@ -232,7 +250,9 @@ main (int argc, char* argv[]) //db->query (query::age == query::_ref (name)); db->query (query::last_name == "Doe"); db->query (query::last_name == name); +#ifndef DATABASE_COMMON db->query (query::last_name == query::_val ("Doe")); +#endif db->query (query::last_name == query::_val (name)); db->query (query::last_name == query::_ref (name)); //db->query (query::last_name == 30); @@ -437,9 +457,8 @@ main (int argc, char* argv[]) // SQL Server does not support re-loading of an object with long data // from a query result. // -#ifndef DATABASE_MSSQL - assert (i->last_name_ == "Doe"); // Actual load. -#endif + if (db_id != odb::id_mssql) + assert (i->last_name_ == "Doe"); // Actual load. // Overwrite object image again. // @@ -470,18 +489,22 @@ main (int argc, char* argv[]) result r; result::iterator i; + // == + // + // Oracle does not support LOB comparisons. // #ifndef DATABASE_ORACLE - // == - // - r = db->query (query::public_key == key2); + if (db_id != odb::id_oracle) + { + r = db->query (query::public_key == key2); - i = r.begin (); - assert (i != r.end ()); + i = r.begin (); + assert (i != r.end ()); - assert (*i->public_key_ == key2); - assert (++i == r.end ()); + assert (*i->public_key_ == key2); + assert (++i == r.end ()); + } #endif // is_null @@ -549,9 +572,9 @@ main (int argc, char* argv[]) // Test size() validity at the beginning/middle/end of result set. // cout << "test 019" << endl; -#if !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_ORACLE) && \ - !defined(DATABASE_MSSQL) + if (db_id != odb::id_sqlite && + db_id != odb::id_oracle && + db_id != odb::id_mssql) { { transaction t (db->begin ()); @@ -600,7 +623,6 @@ main (int argc, char* argv[]) assert (r.size () == 0); } } -#endif // Test like. // @@ -619,11 +641,11 @@ main (int argc, char* argv[]) // In Oracle one can only escape special characters (% and _). // -#if defined(DATABASE_ORACLE) - string v ("Ja%"); -#else - string v ("!Ja%"); -#endif + string v; + if (db_id != odb::id_oracle) + v = "!Ja%"; + else + v = "Ja%"; r = db->query (query::first_name.like (query::_ref (v), "!")); print (r); diff --git a/common/query/basics/makefile b/common/query/basics/makefile index ec63728..fc26133 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index e97a0cb..2bb7ce9 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -14,6 +14,7 @@ #include #include +#include // DATABASE_* #include #include "test.hxx" @@ -204,6 +205,7 @@ main (int argc, char* argv[]) // Readonly object. // { +#ifndef DATABASE_COMMON typedef odb::object_traits_impl so_traits; typedef odb::object_traits_impl ro_traits; typedef odb::object_traits_impl rw_traits; @@ -216,6 +218,7 @@ main (int argc, char* argv[]) assert (rw_traits::column_count != rw_traits::id_column_count + rw_traits::readonly_column_count); +#endif simple_object so (1, 1); ro_object ro_o (1, 1); diff --git a/common/readonly/makefile b/common/readonly/makefile index 3c586bd..92bc2cf 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index 56994b5..caf72ea 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/relationship/makefile b/common/relationship/makefile index c469a93..95ad959 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 5a14149..a67529c 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -13,7 +13,6 @@ #include #include -#include // DATABASE_XXX #include #include "test.hxx" @@ -36,9 +35,8 @@ main (int argc, char* argv[]) // Temporarily disable foreign key constraints for SQLite. // -#if defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=OFF"); -#endif + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); assert (schema_catalog::exists (*db, "test")); assert (!schema_catalog::exists (*db, "test1")); @@ -48,9 +46,8 @@ main (int argc, char* argv[]) schema_catalog::create_schema (*db, "test"); t.commit (); -#if defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=ON"); -#endif + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); } } catch (const odb::exception& e) diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 96e987a..07a246f 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,11 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # @@ -78,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index 685693d..0545442 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -13,7 +13,6 @@ #include #include -#include // DATABASE_XXX #include #include "test1.hxx" @@ -31,6 +30,7 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); + odb::database_id db_id (db->id ()); // Create the database schema. // @@ -41,21 +41,19 @@ main (int argc, char* argv[]) // For MySQL we can actually create the tables in any order. It is // dropping them that's the problem (there is no IF EXISTS). // -#if defined(DATABASE_MYSQL) - c->execute ("SET FOREIGN_KEY_CHECKS=0"); -#elif defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=OFF"); -#endif + if (db_id == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); + else if (db_id == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); transaction t (c->begin ()); schema_catalog::create_schema (*db); t.commit (); -#if defined(DATABASE_MYSQL) - c->execute ("SET FOREIGN_KEY_CHECKS=1"); -#elif defined(DATABASE_SQLITE) - c->execute ("PRAGMA foreign_keys=ON"); -#endif + if (db_id == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); + else if (db_id == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); } } catch (const odb::exception& e) diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index e8897d5..10242cf 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test2.hxx test1.hxx # Reverse order. -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 := $(foreach f,$(odb_hdr:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -gen := $(addprefix $(out_base)/,$(genf)) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --generate-schema \ @@ -43,7 +37,11 @@ $(gen): $(common.l.cpp-options) # $(gen): $(addprefix $(src_base)/,$(odb_hdr)) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -71,11 +69,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # @@ -83,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 38f6be1..8d34d43 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index 351b574..dfaaf19 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -92,6 +92,8 @@ struct type # define DB_SCHEMA "" #elif defined(ODB_DATABASE_MSSQL) # define DB_SCHEMA "dbo" +#elif defined(ODB_DATABASE_COMMON) +# define DB_SCHEMA "dummy" #else # error unknown database #endif diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 3219565..165a7b3 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-session \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-session \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 2342b04..da19443 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx session.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-session \ @@ -40,7 +34,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-session \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -68,12 +66,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -81,7 +78,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/template/makefile b/common/template/makefile index 0d8cf60..2498cce 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 0714d4a..3114072 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -17,10 +17,10 @@ #include #include -#include // DATABASE_SQLITE +#include // DATABASE_* #include -#ifdef DATABASE_SQLITE +#if defined(DATABASE_SQLITE) || defined(DATABASE_COMMON) # include #endif @@ -70,7 +70,7 @@ struct task { try { -#ifndef DATABASE_SQLITE +#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) transaction t (db_.begin ()); #else // SQLite has a peculiar table locking mode (shared cache) @@ -79,10 +79,16 @@ struct task // perspective. One way to work around this problem is to // start a "write" transaction as such right away. // - transaction t ( - static_cast (db_).begin_immediate ()); -#endif + transaction t; + if (db_.id () != odb::id_sqlite) + t.reset (db_.begin ()); + else + { + t.reset ( + static_cast (db_).begin_immediate ()); + } +#endif auto_ptr o (db_.load (id)); assert (o->str_ == "first object"); o->str_ = "another value"; diff --git a/common/threads/makefile b/common/threads/makefile index 91adc8d..92d00d7 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index a399e8c..07b1ba6 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -46,11 +41,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index e60c936..012dd2f 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -46,11 +41,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # diff --git a/common/types/makefile b/common/types/makefile index f47e4d4..c28964a 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --table-prefix types_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,11 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif # Clean. # @@ -77,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/view/driver.cxx b/common/view/driver.cxx index b8a8f3e..2c5c65c 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -58,11 +58,11 @@ view2_test (const auto_ptr& db) } { -#ifndef DATABASE_ORACLE - result r (db->query ("age < 31")); -#else - result r (db->query ("\"age\" < 31")); -#endif + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31"); + else + r = db->query ("\"age\" < 31"); iterator i (r.begin ()); assert (i != r.end ()); @@ -90,11 +90,11 @@ view4_test (const auto_ptr& db) transaction t (db->begin ()); { -#ifndef DATABASE_ORACLE - result r (db->query ((query::person::age > 30) + "ORDER BY age")); -#else - result r (db->query ((query::person::age > 30) + "ORDER BY \"age\"")); -#endif + result r; + if (db->id () != odb::id_oracle) + r = db->query ((query::person::age > 30) + "ORDER BY age"); + else + r = db->query ((query::person::age > 30) + "ORDER BY \"age\""); iterator i (r.begin ()); @@ -237,20 +237,22 @@ main (int argc, char* argv[]) } { -#ifndef DATABASE_ORACLE - result r (db->query ("ORDER BY age")); -#else - result r (db->query ("ORDER BY \"age\"")); -#endif + result r; + if (db->id () != odb::id_oracle) + r = db->query ("ORDER BY age"); + else + r = db->query ("ORDER BY \"age\""); + assert (size (r) == 4); } { -#ifndef DATABASE_ORACLE - result r (db->query ("age < 31 ORDER BY age")); -#else - result r (db->query ("\"age\" < 31 ORDER BY \"age\"")); -#endif + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + view1_check (r); } @@ -289,6 +291,9 @@ main (int argc, char* argv[]) t.commit (); } + // No native parameter support in dynamic multi-database mode. + // +#ifndef DATABASE_COMMON { transaction t (db->begin ()); @@ -306,6 +311,7 @@ main (int argc, char* argv[]) t.commit (); } +#endif } } @@ -317,20 +323,15 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifndef DATABASE_ORACLE - result r ( - db->query ( - "SELECT first, last, age " - "FROM t_view_person " - "WHERE age < 31 ORDER BY age")); -#else - result r ( - db->query ( - "SELECT \"first\", \"last\", \"age\" " - "FROM \"t_view_person\" " - "WHERE \"age\" < 31 ORDER BY \"age\"")); -#endif - + result r; + if (db->id () != odb::id_oracle) + r = db->query ("SELECT first, last, age " + "FROM t_view_person " + "WHERE age < 31 ORDER BY age"); + else + r = db->query ("SELECT \"first\", \"last\", \"age\" " + "FROM \"t_view_person\" " + "WHERE \"age\" < 31 ORDER BY \"age\""); view1_check (r); t.commit (); @@ -346,11 +347,12 @@ main (int argc, char* argv[]) transaction t (db->begin ()); { -#ifndef DATABASE_ORACLE - result r (db->query ("age < 31 ORDER BY age")); -#else - result r (db->query ("\"age\" < 31 ORDER BY \"age\"")); -#endif + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + view1_check (r); } @@ -466,12 +468,16 @@ main (int argc, char* argv[]) view6_test ( db, odb::query::employer::name == "Simple Tech, Inc"); + // No native parameter support in dynamic multi-database mode. + // +#ifndef DATABASE_COMMON view6_test ( #ifndef DATABASE_ORACLE db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); #else db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); #endif +#endif // view7 // diff --git a/common/view/makefile b/common/view/makefile index 6aad221..d13e7c6 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/virtual/makefile b/common/virtual/makefile index 168c969..ef27eff 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 += --generate-schema --generate-query \ @@ -39,7 +33,11 @@ $(gen) $(dist): export odb_options += --generate-schema --generate-query \ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -66,12 +64,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -79,7 +76,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 68492c1..1c2cd3f 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,16 +26,17 @@ $(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 += --generate-schema --table-prefix wrapper_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -65,12 +63,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -78,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 7da8b71..9c397b9 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 3446e5b..295598f 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -76,7 +67,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -114,7 +104,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 50a6673..07b817b 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index a57e56e..88c4cde 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 998c915..bbfa0bf 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 33c5176..f49d1a7 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/data/makefile b/evolution/data/makefile index 6787527..8023594 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -6,17 +6,20 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,18 +32,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -73,7 +64,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -111,7 +101,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. # Generated .gitignore. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 26b31ac..244181c 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 78d1602..9a12aa8 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -76,7 +67,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -114,7 +104,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 2e849c1..5d90d38 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index ff6014f..99339d7 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 8503ce7..3639f85 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -6,17 +6,20 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,18 +32,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -73,7 +64,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -103,7 +93,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. # Generated .gitignore. diff --git a/evolution/makefile b/evolution/makefile index d83995e..fddde1b 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -20,11 +20,6 @@ version \ data \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - all_tests := $(tests) build_tests := $(tests) diff --git a/evolution/template/makefile b/evolution/template/makefile index 88bf49a..c7777b1 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/evolution/version/makefile b/evolution/version/makefile index bcb4819..63bbe72 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -6,17 +6,22 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,20 +34,6 @@ $(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) -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) - -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) - -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) - -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql - $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ @@ -75,7 +66,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx @@ -113,7 +103,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/model.xml) # Changelog. $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 65fbcfe..4ca2b68 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -6,80 +6,26 @@ #include // std::move #include -#include - #include -#if defined(DATABASE_MYSQL) -# include -# include -#elif defined(DATABASE_SQLITE) -# include -# include -# include -# include -# include -#elif defined(DATABASE_PGSQL) -# include -# include -#elif defined(DATABASE_ORACLE) -# include -# include -#elif defined(DATABASE_MSSQL) -# include -# include -#else -# error unknown database -#endif - +#include #include using namespace std; using namespace odb::core; -#if defined(DATABASE_MYSQL) -namespace mysql = odb::mysql; -#elif defined(DATABASE_SQLITE) -namespace sqlite = odb::sqlite; -#elif defined(DATABASE_PGSQL) -namespace pgsql = odb::pgsql; -#elif defined(DATABASE_ORACLE) -namespace oracle = odb::oracle; -#elif defined(DATABASE_MSSQL) -namespace mssql = odb::mssql; -#endif - -auto_ptr -create_database (int& argc, - char* argv[], -#if defined(DATABASE_SQLITE) - bool schema, -#else - bool, -#endif - size_t max_connections) -{ - if (argc > 1 && argv[1] == string ("--help")) - { - cout << "Usage: " << argv[0] << " [options]" << endl - << "Options:" << endl; - -#if defined(DATABASE_MYSQL) - mysql::database::print_usage (cout); -#elif defined(DATABASE_SQLITE) - sqlite::database::print_usage (cout); -#elif defined(DATABASE_PGSQL) - pgsql::database::print_usage (cout); -#elif defined(DATABASE_ORAClE) - oracle::database::print_usage (cout); -#endif - exit (0); - } +// MySQL. +// +#if defined(DATABASE_MYSQL) || defined(DATABASE_COMMON) - auto_ptr db; +#include +#include -#if defined(DATABASE_MYSQL) +static auto_ptr +create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mysql = odb::mysql; #ifdef HAVE_CXX11 unique_ptr f; @@ -90,15 +36,35 @@ create_database (int& argc, if (max_connections != 0) f.reset (new mysql::connection_pool_factory (max_connections)); - db.reset (new mysql::database (argc, argv, false, "", 0, + return auto_ptr ( + new mysql::database (argc, argv, false, "", 0, #ifdef HAVE_CXX11 - move (f) + move (f) #else - f + f #endif - )); + )); +} +#endif // MySQL -#elif defined(DATABASE_SQLITE) + +// SQLite. +// +#if defined(DATABASE_SQLITE) || defined(DATABASE_COMMON) + +#include +#include +#include +#include +#include + +static auto_ptr +create_sqlite_database (int& argc, + char* argv[], + bool schema, + size_t max_connections) +{ + namespace sqlite = odb::sqlite; #ifdef HAVE_CXX11 unique_ptr f; @@ -109,7 +75,7 @@ create_database (int& argc, if (max_connections != 0) f.reset (new sqlite::connection_pool_factory (max_connections)); - db.reset ( + auto_ptr db ( new sqlite::database ( argc, argv, false, SQLITE_OPEN_READWRITE @@ -144,7 +110,22 @@ create_database (int& argc, c->execute ("PRAGMA foreign_keys=ON"); } -#elif defined(DATABASE_PGSQL) + return db; +} +#endif // SQLite + + +// PostgreSQL. +// +#if defined(DATABASE_PGSQL) || defined(DATABASE_COMMON) + +#include +#include + +static auto_ptr +create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace pgsql = odb::pgsql; #ifdef HAVE_CXX11 unique_ptr f; @@ -155,15 +136,29 @@ create_database (int& argc, if (max_connections != 0) f.reset (new pgsql::connection_pool_factory (max_connections)); - db.reset (new pgsql::database (argc, argv, false, "", + return auto_ptr ( + new pgsql::database (argc, argv, false, "", #ifdef HAVE_CXX11 - move (f) + move (f) #else - f + f #endif - )); + )); +} +#endif // PostgreSQL -#elif defined(DATABASE_ORACLE) + +// Oracle. +// +#if defined(DATABASE_ORACLE) || defined(DATABASE_COMMON) + +#include +#include + +static auto_ptr +create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace oracle = odb::oracle; #ifdef HAVE_CXX11 unique_ptr f; @@ -177,15 +172,28 @@ create_database (int& argc, // Set client database character set and client national character set // to UTF-8. // - db.reset (new oracle::database (argc, argv, false, 873, 873, 0, + return auto_ptr ( + new oracle::database (argc, argv, false, 873, 873, 0, #ifdef HAVE_CXX11 - move (f) + move (f) #else - f + f #endif - )); + )); +} +#endif // Oracle -#elif defined(DATABASE_MSSQL) +// SQL Server. +// +#if defined(DATABASE_MSSQL) || defined(DATABASE_COMMON) + +#include +#include + +static auto_ptr +create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mssql = odb::mssql; #ifdef HAVE_CXX11 unique_ptr f; @@ -196,18 +204,147 @@ create_database (int& argc, if (max_connections != 0) f.reset (new mssql::connection_pool_factory (max_connections)); - db.reset (new mssql::database (argc, argv, false, "", - mssql::isolation_read_committed, 0, + return auto_ptr ( + new mssql::database (argc, argv, false, "", + mssql::isolation_read_committed, 0, #ifdef HAVE_CXX11 - move (f) + move (f) #else - f + f #endif - )); + )); +} +#endif // SQL Server + +// +// +auto_ptr +create_database (int argc, + char* argv[], + bool schema, + size_t max_connections, +#if defined(DATABASE_COMMON) + odb::database_id db +#else + odb::database_id #endif +) +{ + char** argp (argv + 1); // Position of the next argument. + int argn (argc - 1); // Number of arguments left. - return db; +#if defined(DATABASE_COMMON) + // Figure out which database we are creating. We may be given the + // database name as a program argument or as an id. + // + if (db == odb::id_common && argn != 0) + { + string s (*argp); + + if (s == "mysql") + db = odb::id_mysql; + else if (s == "sqlite") + db = odb::id_sqlite; + else if (s == "pgsql") + db = odb::id_pgsql; + else if (s == "oracle") + db = odb::id_oracle; + else if (s == "mssql") + db = odb::id_mssql; + + if (db != odb::id_common) + { + argp++; + argn--; + } + } + + if (db == odb::id_common) + { + cerr << "Usage: " << argv[0] << " [options]" << endl; + exit (1); + } +#endif + + if (argn != 0 && *argp == string ("--help")) + { +#if defined(DATABASE_COMMON) + cout << "Usage: " << argv[0] << " [options]" << endl; +#else + cout << "Usage: " << argv[0] << " [options]" << endl; +#endif + + cout << "Options:" << endl; + +#if defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#elif defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#elif defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#elif defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#elif defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#elif defined(DATABASE_COMMON) + switch (db) + { + case odb::id_mysql: + odb::mysql::database::print_usage (cout); + break; + case odb::id_sqlite: + odb::sqlite::database::print_usage (cout); + break; + case odb::id_pgsql: + odb::pgsql::database::print_usage (cout); + break; + case odb::id_oracle: + odb::oracle::database::print_usage (cout); + break; + case odb::id_mssql: + odb::mssql::database::print_usage (cout); + break; + case odb::id_common: + assert (false); + } +#else +# error unknown database +#endif + + exit (0); + } + +#if defined(DATABASE_MYSQL) + return create_mysql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_SQLITE) + return create_sqlite_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_PGSQL) + return create_pgsql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_ORACLE) + return create_oracle_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_MSSQL) + return create_mssql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_COMMON) + switch (db) + { + case odb::id_mysql: + return create_mysql_database (argc, argv, schema, max_connections); + case odb::id_sqlite: + return create_sqlite_database (argc, argv, schema, max_connections); + case odb::id_pgsql: + return create_pgsql_database (argc, argv, schema, max_connections); + case odb::id_oracle: + return create_oracle_database (argc, argv, schema, max_connections); + case odb::id_mssql: + return create_mssql_database (argc, argv, schema, max_connections); + case odb::id_common: + assert (false); + } + return auto_ptr (); +#else +# error unknown database +#endif } bool @@ -215,7 +352,8 @@ size_available () { #if defined(DATABASE_SQLITE) || \ defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) + defined(DATABASE_MSSQL) || \ + defined(DATABASE_COMMON) return false; #else return true; diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 114dbdd..f9bbd4d 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -20,20 +20,25 @@ #endif LIBCOMMON_EXPORT std::auto_ptr -create_database (int& argc, +create_database (int argc, char* argv[], bool create_schema = true, - std::size_t max_connections = 0); + std::size_t max_connections = 0, + odb::database_id db = odb::id_common); template std::auto_ptr -create_specific_database (int& argc, +create_specific_database (int argc, char* argv[], bool create_schema = true, std::size_t max_connections = 0) { std::auto_ptr r ( - create_database (argc, argv, create_schema, max_connections)); + create_database (argc, argv, + create_schema, + max_connections, + T::database_id)); + return std::auto_ptr (&dynamic_cast (*r.release ())); } diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 3141ba4..5c28b63 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -44,6 +44,15 @@ namespace odb_db = odb::oracle; namespace odb_db = odb::mssql; +#elif defined(DATABASE_COMMON) + +// Fallback to common interface. +// +#include +#include + +namespace odb_db = odb; + #endif #endif // LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 53df875..5d23fa9 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -12,10 +12,6 @@ cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_base)/common.l common.l.cpp-options := $(out_base)/common.l.cpp-options -default := $(out_base)/ -dist := $(out_base)/.dist -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -23,9 +19,47 @@ $(call import,\ l: odb.l,cpp-options: odb.l.cpp-options) ifdef db_id +ifneq ($(db_id),common) $(call import,\ $(scf_root)/import/libodb-$(db_id)/stub.make,\ l: odb_db.l,cpp-options: odb_db.l.cpp-options) +else +# Import all database runtimes. +# +$(call import,\ + $(scf_root)/import/libodb-mysql/stub.make,\ + l: odb_mysql.l,cpp-options: odb_mysql.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libodb-sqlite/stub.make,\ + l: odb_sqlite.l,cpp-options: odb_sqlite.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libodb-pgsql/stub.make,\ + l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libodb-oracle/stub.make,\ + l: odb_oracle.l,cpp-options: odb_oracle.l.cpp-options) + +$(call import,\ + $(scf_root)/import/libodb-mssql/stub.make,\ + l: odb_mssql.l,cpp-options: odb_mssql.l.cpp-options) + +odb_db.l := \ +$(odb_mysql.l) \ +$(odb_sqlite.l) \ +$(odb_pgsql.l) \ +$(odb_oracle.l) \ +$(odb_mssql.l) + +odb_db.l.cpp-options := \ +$(odb_mysql.l.cpp-options) \ +$(odb_sqlite.l.cpp-options) \ +$(odb_pgsql.l.cpp-options) \ +$(odb_oracle.l.cpp-options) \ +$(odb_mssql.l.cpp-options) +endif endif ifeq ($(odb_db.l.cpp-options),) @@ -62,6 +96,8 @@ else ifeq ($(db_id),oracle) @echo '#define DATABASE_ORACLE 1' >>$@ else ifeq ($(db_id),mssql) @echo '#define DATABASE_MSSQL 1' >>$@ +else ifeq ($(db_id),common) + @echo '#define DATABASE_COMMON 1' >>$@ endif ifeq ($(cxx_standard),c++11) @echo '#define HAVE_CXX11 1' >>$@ diff --git a/libcommon/makefile b/libcommon/makefile index 9d9b6e9..cade0e7 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -6,10 +6,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make dirs := common -default := $(out_base)/ -dist := $(out_base)/.dist -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export dirs := $(dirs) diff --git a/makefile b/makefile index 99c61e7..63a3982 100644 --- a/makefile +++ b/makefile @@ -5,13 +5,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make all_dirs := libcommon common evolution mysql sqlite pgsql oracle mssql boost qt -dirs := common evolution boost qt -dirs += $(db_id) +dirs := common boost qt -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +# Evolution and database-specific tests are not run in the multi-database +# configuration. +# +ifneq ($(db_id),common) +dirs += evolution $(db_id) +endif $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) @@ -32,6 +33,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call meta-autoconf) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) $(call include,$(bld_root)/dist.make) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 9acc2f5..98c0869 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -6,17 +6,14 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make cxx_tun := driver.cxx traits.cxx odb_hdr := test.hxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mssql --default-database \ @@ -66,12 +60,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-rule)) # Clean. # @@ -79,7 +68,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mssql/database/makefile b/mssql/database/makefile index e1bf4ba..b8281c5 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/mssql/makefile b/mssql/makefile index df8e9c1..4891a0a 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -12,11 +12,6 @@ native \ query \ types -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mssql diff --git a/mssql/native/makefile b/mssql/native/makefile index 24d88ae..95fbd77 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/mssql/query/makefile b/mssql/query/makefile index 6f7106e..6194671 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mssql --default-database \ @@ -64,12 +58,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-rule)) # Clean. # @@ -77,7 +66,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mssql/template/makefile b/mssql/template/makefile index 8bfaa68..325cb8d 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mssql --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mssql/types/makefile b/mssql/types/makefile index 58636bd..8f86027 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mssql --default-database \ @@ -65,12 +59,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mssql.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) +$(eval $(call test-rule)) # Clean. # @@ -78,7 +67,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index fa1dce3..f857ea4 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mysql --default-database \ @@ -66,12 +60,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-rule)) # Clean. # @@ -79,7 +68,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mysql/database/makefile b/mysql/database/makefile index 63aa90d..d2426f6 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/mysql/index/makefile b/mysql/index/makefile index a2ceec8..5c8838e 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mysql --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mysql/makefile b/mysql/makefile index e657da7..02bb64f 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -13,11 +13,6 @@ native \ truncation \ types -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mysql diff --git a/mysql/native/makefile b/mysql/native/makefile index 520c7ed..859c17a 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/mysql/template/makefile b/mysql/template/makefile index e34f486..4109f3e 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mysql --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 179c830..1a1f75b 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mysql --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/mysql/types/makefile b/mysql/types/makefile index a1fa920..8cdc014 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 mysql --default-database \ @@ -65,12 +59,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/mysql.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) +$(eval $(call test-rule)) # Clean. # @@ -78,7 +67,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 7bae1fa..4022c16 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 oracle --default-database \ @@ -66,12 +60,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) +$(eval $(call test-rule)) # Clean. # @@ -79,7 +68,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/oracle/database/makefile b/oracle/database/makefile index 0eeb978..fe6bab6 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/oracle/makefile b/oracle/makefile index 0033d89..918ec23 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -11,11 +11,6 @@ database \ native \ types -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := oracle diff --git a/oracle/native/makefile b/oracle/native/makefile index 9b7449e..5d799a8 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/oracle/template/makefile b/oracle/template/makefile index 743b405..7433e36 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 oracle --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/oracle/types/makefile b/oracle/types/makefile index ebbfc19..5e7015f 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 oracle --default-database \ @@ -65,12 +59,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/oracle.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) +$(eval $(call test-rule)) # Clean. # @@ -78,7 +67,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 5c98b1d..d675915 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 pgsql --default-database \ @@ -66,12 +60,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-rule)) # Clean. # @@ -79,7 +68,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 490fd4e..398164d 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/pgsql/index/makefile b/pgsql/index/makefile index e030f35..772802e 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -12,11 +12,6 @@ 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,\ @@ -29,9 +24,6 @@ $(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 pgsql --default-database \ @@ -63,12 +55,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +63,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/pgsql/makefile b/pgsql/makefile index 1111993..7dd15da 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -13,11 +13,6 @@ native \ truncation \ types -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := pgsql diff --git a/pgsql/native/makefile b/pgsql/native/makefile index a23b4a8..2c39100 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 2f503a4..3d84b9b 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -12,11 +12,6 @@ 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,\ @@ -29,9 +24,6 @@ $(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 pgsql --default-database \ @@ -63,12 +55,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +63,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 099927e..416f2c2 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 pgsql --default-database \ @@ -63,12 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-rule)) # Clean. # @@ -76,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 7fe798c..94be6c0 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 pgsql --default-database \ @@ -65,12 +59,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/pgsql.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) +$(eval $(call test-rule)) # Clean. # @@ -78,7 +67,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 05d3375..db50659 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 += --generate-schema --generate-query \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -81,12 +79,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -94,7 +91,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index a14a29f..5f3b201 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -81,12 +79,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -94,7 +91,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 4cfee92..582c8c4 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -81,12 +79,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -94,7 +91,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/common/makefile b/qt/common/makefile index 1544fff..6b72fb0 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -14,11 +14,6 @@ template all_tests := $(tests) build_tests := $(tests) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := qt-common @@ -40,6 +35,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vctest,$(name)-qt4-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(tests)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/meta/vc9sln.make) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index b539e08..7dad2e7 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -DQWEAKPOINTER_ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 += --generate-schema --generate-session \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -81,12 +79,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -94,7 +91,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 9836dca..407094c 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 += --generate-schema \ @@ -49,7 +43,11 @@ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) +ifneq ($(db_id),common) $(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) @@ -81,12 +79,11 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif # Clean. # @@ -94,7 +91,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/makefile b/qt/makefile index 6050ec1..ea1e772 100644 --- a/qt/makefile +++ b/qt/makefile @@ -6,12 +6,12 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make all_dirs := common mysql sqlite pgsql oracle mssql dirs := common -dirs += $(db_id) -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean +# Database-specific tests are not run in the multi-database configuration. +# +ifneq ($(db_id),common) +dirs += $(db_id) +endif $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) @@ -21,6 +21,11 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) $(call meta-automake) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) + +ifeq ($(db_id),common) +$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) +endif + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) $(call include,$(bld_root)/dist.make) diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 43fa876..4da6e63 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 mssql --profile qt/basic \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index f2ded55..4354696 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 mssql --profile qt/date-time \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 5f8f9a9..e3dc361 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -9,11 +9,6 @@ basic \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mssql diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 33ebd1e..b126962 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mssql --profile qt \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 8b174a5..f0e8814 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 mysql --profile qt/basic \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 448cdcd..039b952 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 mysql --profile qt/date-time \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 97ac45d..e94b718 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -9,11 +9,6 @@ basic \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mysql diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 91c5afe..9870235 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 mysql --profile qt \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 046bc90..2069a29 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 oracle --profile qt/basic \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 2dc6c38..b2f25ac 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 oracle --profile qt/date-time \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 8ae7df9..138e91c 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -9,11 +9,6 @@ basic \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-oracle diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 9b2863d..cc055cc 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 oracle --profile qt \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index eaa4fdd..9dea1b1 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 pgsql --profile qt/basic \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 8c75ef3..46bccbb 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 pgsql --profile qt/date-time \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index fb89608..70df91b 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -9,11 +9,6 @@ basic \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-pgsql diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 8ffa434..9a1e72f 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 pgsql --profile qt \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 1689df6..2bac21a 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 sqlite --profile qt/basic \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index a5f21ea..1af2338 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -38,9 +35,6 @@ $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.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 sqlite --profile qt/date-time \ @@ -79,12 +73,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -92,7 +81,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index ccf700a..0ee2bf4 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -9,11 +9,6 @@ basic \ date-time \ template -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-sqlite diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index ee53224..c0b8274 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -33,9 +30,6 @@ $(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.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 sqlite --profile qt \ @@ -73,12 +67,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call schema) - $(call message,test $<,$< --options-file $(dcf_root)/$(db_id).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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -86,7 +75,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 62d5539..f7a1cdb 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 sqlite --default-database \ @@ -63,11 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -75,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index b2ec5cd..a96f6a7 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/sqlite/makefile b/sqlite/makefile index 1d87470..0fa93d8 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -12,11 +12,6 @@ native \ truncation \ types -default := $(out_base)/ -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := sqlite diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 0d6a314..fe2404f 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -11,11 +11,6 @@ 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 - # Build. # $(driver): $(cxx_obj) $(common.l) @@ -45,11 +40,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # diff --git a/sqlite/template/makefile b/sqlite/template/makefile index c4bb3f0..46a33e5 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 sqlite --default-database \ @@ -63,11 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -75,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 6cfed59..4af9fef 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 sqlite --default-database \ @@ -63,11 +57,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -75,7 +65,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index cc6f7ff..3c7ae9b 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -6,17 +6,14 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options -driver := $(out_base)/driver -dist := $(out_base)/.dist -test := $(out_base)/.test -clean := $(out_base)/.clean - # Import. # $(call import,\ @@ -29,9 +26,6 @@ $(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 sqlite --default-database \ @@ -65,11 +59,7 @@ $(dist): # Test. # -$(test): $(driver) $(src_base)/test.std - $(call message,test $<,$< --options-file $(dcf_root)/sqlite.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) +$(eval $(call test-schemaless-rule)) # Clean. # @@ -77,7 +67,7 @@ $(clean): \ $(driver).o.clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addprefix $(out_base)/,$(odb_hdr:.hxx=-odb.cxx.hxx.clean)) + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) $(call message,,rm -f $(out_base)/test.out) # Generated .gitignore. -- cgit v1.1 From d31e96535e3f41c36646f375680d7a4efc5772b2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 3 Jul 2013 11:59:08 +0200 Subject: Test MySQL sub-second precision support --- boost/mysql/date-time/driver.cxx | 47 +++++++++++++++++++++++++++++++++++----- boost/mysql/date-time/makefile | 4 ++-- boost/mysql/date-time/test.hxx | 17 +++++++++++++++ mysql/types/driver.cxx | 29 +++++++++++++++++++++++++ mysql/types/test.hxx | 27 ++++++++++++++++++++--- mysql/types/traits.hxx | 3 ++- qt/mysql/date-time/driver.cxx | 34 ++++++++++++++++++++++++----- qt/mysql/date-time/makefile | 4 ++-- qt/mysql/date-time/test.hxx | 17 +++++++++++++++ 9 files changed, 164 insertions(+), 18 deletions(-) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 49d94b7..6ffe051 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -37,6 +37,35 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + // If we are running against MySQL 5.6.4 or later alter the tables + // to allow sub-second precision. + // + bool fs (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))); + if (fs) + { + transaction t (db->begin ()); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_durations`" \ + " MODIFY COLUMN `value` TIME(6)"); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_times`" \ + " MODIFY COLUMN `value` DATETIME(6)"); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_timestamps`" \ + " MODIFY COLUMN `value` TIMESTAMP(6) NULL"); + + t.commit (); + } + object o; // Test all valid date-time mappings. @@ -46,13 +75,16 @@ main (int argc, char* argv[]) o.dates.push_back (date (max_date_time)); o.dates.push_back (date (min_date_time)); - o.times.push_back (second_clock::local_time ()); + if (fs) + o.times.push_back (microsec_clock::local_time ()); + else + o.times.push_back (second_clock::local_time ()); o.times.push_back (not_a_date_time); o.times.push_back (min_date_time); - // MySQL time interface does not support fraction seconds. Construct - // with zero fractional seconds so that comparison test does not - // fail for invalid reasons. + // MySQL prior to 5.6.4 does not support fraction seconds. Construct + // with zero fractional seconds so that comparison test does not fail + // for invalid reasons. // o.times.push_back ( ptime ( @@ -62,10 +94,15 @@ main (int argc, char* argv[]) ptime (max_date_time).time_of_day ().minutes (), ptime (max_date_time).time_of_day ().seconds ()))); - o.timestamps.push_back (second_clock::local_time ()); + if (fs) + o.timestamps.push_back (microsec_clock::local_time ()); + else + o.timestamps.push_back (second_clock::local_time ()); o.timestamps.push_back (not_a_date_time); o.durations.push_back (time_duration (1, 2, 3)); + if (fs) + o.durations.back () += time_duration (microseconds (123456)); o.durations.push_back (time_duration (-1, 2, 3)); o.durations.push_back (not_a_date_time); diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index aaff422..c6c60fd 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -41,8 +41,8 @@ $(boost.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --profile boost/date-time \ ---generate-schema --table-prefix boost_mysql_dt_ +$(gen) $(dist): export odb_options += --database mysql --generate-schema \ +--generate-query --profile boost/date-time --table-prefix boost_mysql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index 6244177..253ebb1 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -46,4 +46,21 @@ struct object std::vector durations; }; +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + #endif // TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 07487a2..12610d8 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -28,6 +28,16 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + //cerr << "MySQL " << v.major << '.' << v.minor << '.' << v.release + // << " protocol " << v.protocol << endl; + object o (1); o.bool_ = true; @@ -53,6 +63,25 @@ main (int argc, char* argv[]) o.timestamp_ = date_time (false, 2010, 8, 29, 12, 26, 59); o.year_ = 2010; + // If we are running against MySQL 5.6.4 or later, add fractional + // seconds and also alter the table to allow sub-second precision. + // + if (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))) + { + o.time_.microseconds = 123456; + o.date_time_.microseconds = 234567; + o.timestamp_.microseconds = 345678; + + transaction t (db->begin ()); + db->execute ("ALTER TABLE `mysql_types_object`" \ + " MODIFY COLUMN `time` TIME(6)," \ + " MODIFY COLUMN `date_time` DATETIME(6)," \ + " MODIFY COLUMN `timestamp` TIMESTAMP(6)"); + t.commit (); + } + string short_str (128, 's'); string medium_str (250, 'm'); string long_str (2040, 'l'); diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 73160c2..c46175d 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -27,14 +27,16 @@ struct date_time unsigned int d, unsigned int h, unsigned int min, - unsigned int sec) + unsigned int sec, + unsigned int msec = 0) : negative (n), year (y), month (m), day (d), hour (h), minute (min), - second (sec) + second (sec), + microseconds (msec) { } @@ -48,7 +50,8 @@ struct date_time day == y.day && hour == y.hour && minute == y.minute && - second == y.second; + second == y.second && + microseconds == y.microseconds; } bool negative; @@ -58,6 +61,7 @@ struct date_time unsigned int hour; unsigned int minute; unsigned int second; + unsigned int microseconds; }; struct bitfield @@ -305,4 +309,21 @@ struct char_array } }; +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + #endif // TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index f1d98b7..53a130c 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -35,6 +35,7 @@ namespace odb v.hour = i.hour; v.minute = i.minute; v.second = i.second; + v.microseconds = static_cast (i.second_part); } else v = date_time (); @@ -51,7 +52,7 @@ namespace odb i.hour = v.hour; i.minute = v.minute; i.second = v.second; - i.second_part = 0; + i.second_part = v.microseconds; } }; diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 57eab2c..f26879c 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -35,6 +35,29 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + // If we are running against MySQL 5.6.4 or later alter the tables + // to allow sub-second precision. + // + bool fs (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))); + if (fs) + { + transaction t (db->begin ()); + db->execute ("ALTER TABLE `qt_mysql_dt_object`" \ + " MODIFY COLUMN `date_time` DATETIME(3)," \ + " MODIFY COLUMN `timestamp` TIMESTAMP(3) NULL," \ + " MODIFY COLUMN `time` TIME(3)"); + t.commit (); + } + // // Check valid dates and times. // @@ -61,14 +84,15 @@ main (int argc, char* argv[]) // // Create a QDateTime containing the current date and time - // but with the milliseconds zeroed. MySQL does not currently - // support millisecond times. + // but with the milliseconds zeroed. MySQL prior to 5.6.4 + // does not support sub-second prevision. // QDateTime t (QDateTime::currentDateTime ()); - t.setTime (QTime (t.time ().hour (), - t.time ().minute (), - t.time ().second ())); + if (!fs) + t.setTime (QTime (t.time ().hour (), + t.time ().minute (), + t.time ().second ())); o.date = t.date (); o.date_time = t; diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 039b952..ded9a6c 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -37,8 +37,8 @@ $(qt_core.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --profile qt/date-time \ ---generate-schema --table-prefix qt_mysql_dt_ +$(gen) $(dist): export odb_options += --database mysql --generate-schema \ +--generate-query --profile qt/date-time --table-prefix qt_mysql_dt_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 7e58376..2570285 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -51,4 +51,21 @@ struct object QTime time; }; +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + #endif // TEST_HXX -- cgit v1.1 From 0d85e6af034e306f671cea33f2d6760d741e6111 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jul 2013 08:59:37 +0200 Subject: Fix invalid redefinition of automake variables --- evolution/template/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index b81650d..0746050 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -34,9 +34,9 @@ test1-odb.hxx: test1.hxx # test2.hxx # driver_SOURCES += test2.hxx -nodist_driver_SOURCES = test2-odb.cxx -BUILT_SOURCES = test2-odb.hxx -CLEANFILES = test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql +nodist_driver_SOURCES += test2-odb.cxx +BUILT_SOURCES += test2-odb.hxx +CLEANFILES += test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql test2-odb.hxx: test2.hxx $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options2) --changelog model.xml $< -- cgit v1.1 From 9d516749457284f093306b5e4673cec1818c3d53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jul 2013 12:53:18 +0200 Subject: Define DATABASE_XXX macro during ODB compilation --- evolution/template/template-vc10.vcxproj | 6 +++--- evolution/template/template-vc11.vcxproj | 6 +++--- evolution/template/template-vc9.vcproj | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/evolution/template/template-vc10.vcxproj b/evolution/template/template-vc10.vcxproj index a98b681..c0ebe18 100644 --- a/evolution/template/template-vc10.vcxproj +++ b/evolution/template/template-vc10.vcxproj @@ -158,19 +158,19 @@ __custom_build_entry__( test1.hxx, odb test1.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __custom_build_entry__( test2.hxx, odb test2.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __custom_build_entry__( test3.hxx, odb test3.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) diff --git a/evolution/template/template-vc11.vcxproj b/evolution/template/template-vc11.vcxproj index 0bdafd9..f51fd0c 100644 --- a/evolution/template/template-vc11.vcxproj +++ b/evolution/template/template-vc11.vcxproj @@ -162,19 +162,19 @@ __custom_build_entry__( test1.hxx, odb test1.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __custom_build_entry__( test2.hxx, odb test2.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __custom_build_entry__( test3.hxx, odb test3.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) diff --git a/evolution/template/template-vc9.vcproj b/evolution/template/template-vc9.vcproj index 536f154..9177928 100644 --- a/evolution/template/template-vc9.vcproj +++ b/evolution/template/template-vc9.vcproj @@ -350,7 +350,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test1.hxx, odb test1.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test1.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, model.hxx) __file_entry__(test1-odb.hxx) @@ -358,7 +358,7 @@ __file_entry__(test1-odb.ixx) __file_entry_custom_build__( test2.hxx, odb test2.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test2.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, test1-odb.hxx;model.hxx) __file_entry__(test2-odb.hxx) @@ -366,7 +366,7 @@ __file_entry__(test2-odb.ixx) __file_entry_custom_build__( test3.hxx, odb test3.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test3.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, test2-odb.hxx;model.hxx) __file_entry__(test3-odb.hxx) -- cgit v1.1 From 7b31bf12b9f517e2a9795d63a1701cdf23279d5a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jul 2013 14:54:20 +0200 Subject: Add support for Visual Studio 2005 --- boost/build.bat | 1 + boost/common/boost-common-vc8.sln | 15 ++ boost/common/makefile | 6 +- boost/common/multi-index/makefile | 6 +- boost/common/optional/makefile | 6 +- boost/common/smart-ptr/makefile | 6 +- boost/common/template/makefile | 6 +- boost/common/template/template-vc8.vcproj | 353 ++++++++++++++++++++++++ boost/common/unordered/makefile | 6 +- boost/common/uuid/makefile | 6 +- boost/mssql/boost-mssql-vc8.sln | 15 ++ boost/mssql/date-time/makefile | 5 +- boost/mssql/makefile | 5 +- boost/mssql/template/makefile | 5 +- boost/mssql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ boost/mysql/boost-mysql-vc8.sln | 15 ++ boost/mysql/date-time/makefile | 5 +- boost/mysql/makefile | 5 +- boost/mysql/template/makefile | 5 +- boost/mysql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ boost/oracle/boost-oracle-vc8.sln | 15 ++ boost/oracle/date-time/makefile | 5 +- boost/oracle/makefile | 5 +- boost/oracle/template/makefile | 5 +- boost/oracle/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ boost/pgsql/boost-pgsql-vc8.sln | 15 ++ boost/pgsql/date-time/makefile | 5 +- boost/pgsql/makefile | 5 +- boost/pgsql/template/makefile | 5 +- boost/pgsql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ boost/sqlite/boost-sqlite-vc8.sln | 15 ++ boost/sqlite/date-time/makefile | 5 +- boost/sqlite/makefile | 5 +- boost/sqlite/template/makefile | 5 +- boost/sqlite/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ build.bat | 1 + build/bootstrap.make | 13 + common/access/makefile | 6 +- common/auto/makefile | 6 +- common/blob/makefile | 6 +- common/callback/makefile | 6 +- common/circular/multiple/makefile | 6 +- common/circular/single/makefile | 6 +- common/common-vc8.sln | 15 ++ common/composite-id/makefile | 6 +- common/composite/makefile | 6 +- common/const-member/makefile | 6 +- common/const-object/makefile | 6 +- common/container/basics/makefile | 6 +- common/container/change-tracking/makefile | 6 +- common/ctor/makefile | 6 +- common/default/makefile | 6 +- common/definition/makefile | 6 +- common/enum/makefile | 6 +- common/erase-query/makefile | 6 +- common/index/makefile | 6 +- common/inheritance/polymorphism/makefile | 6 +- common/inheritance/reuse/makefile | 6 +- common/inheritance/transient/makefile | 6 +- common/inverse/makefile | 6 +- common/lazy-ptr/makefile | 6 +- common/lifecycle/makefile | 6 +- common/makefile | 6 +- common/no-id/makefile | 6 +- common/optimistic/makefile | 6 +- common/pragma/makefile | 6 +- common/prepared/makefile | 6 +- common/query/array/makefile | 6 +- common/query/basics/makefile | 6 +- common/readonly/makefile | 6 +- common/relationship-query/makefile | 6 +- common/relationship/makefile | 6 +- common/schema/embedded/basics/makefile | 6 +- common/schema/embedded/order/makefile | 6 +- common/schema/namespace/makefile | 6 +- common/session/cache/makefile | 6 +- common/template/makefile | 6 +- common/template/template-vc8.vcproj | 357 ++++++++++++++++++++++++ common/threads/makefile | 6 +- common/transaction/basics/makefile | 6 +- common/transaction/callback/makefile | 6 +- common/types/makefile | 6 +- common/view/makefile | 6 +- common/virtual/makefile | 6 +- common/wrapper/makefile | 6 +- evolution/add-column/makefile | 6 +- evolution/add-foreign-key/makefile | 6 +- evolution/add-index/makefile | 6 +- evolution/add-table/makefile | 6 +- evolution/alter-column/makefile | 6 +- evolution/combined/makefile | 6 +- evolution/data/makefile | 6 +- evolution/drop-column/makefile | 6 +- evolution/drop-foreign-key/makefile | 6 +- evolution/drop-index/makefile | 6 +- evolution/drop-table/makefile | 6 +- evolution/embedded/makefile | 6 +- evolution/evolution-vc8.sln | 15 ++ evolution/makefile | 5 +- evolution/template/makefile | 6 +- evolution/template/template-vc8.vcproj | 372 ++++++++++++++++++++++++++ evolution/version/makefile | 6 +- libcommon/common/common.cxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/libcommon-vc8.vcproj | 352 ++++++++++++++++++++++++ libcommon/common/makefile | 7 +- libcommon/libcommon-vc8.sln | 26 ++ libcommon/makefile | 6 +- mssql/custom/makefile | 6 +- mssql/database/makefile | 5 +- mssql/makefile | 5 +- mssql/mssql-vc8.sln | 15 ++ mssql/native/makefile | 5 +- mssql/query/makefile | 5 +- mssql/template/Makefile.am | 2 +- mssql/template/makefile | 5 +- mssql/template/template-vc10.vcxproj | 2 +- mssql/template/template-vc11.vcxproj | 2 +- mssql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ mssql/template/template-vc9.vcproj | 2 +- mssql/types/makefile | 5 +- mysql/custom/driver.cxx | 3 + mysql/custom/makefile | 5 +- mysql/database/makefile | 5 +- mysql/index/makefile | 5 +- mysql/makefile | 5 +- mysql/mysql-vc8.sln | 15 ++ mysql/native/makefile | 5 +- mysql/template/makefile | 5 +- mysql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ mysql/truncation/makefile | 5 +- mysql/types/makefile | 5 +- oracle/custom/makefile | 5 +- oracle/database/makefile | 5 +- oracle/makefile | 5 +- oracle/native/makefile | 5 +- oracle/oracle-vc8.sln | 15 ++ oracle/template/makefile | 5 +- oracle/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ oracle/types/makefile | 5 +- pgsql/custom/makefile | 5 +- pgsql/database/makefile | 5 +- pgsql/index/makefile | 5 +- pgsql/makefile | 5 +- pgsql/native/makefile | 5 +- pgsql/pgsql-vc8.sln | 15 ++ pgsql/template/makefile | 5 +- pgsql/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ pgsql/truncation/makefile | 5 +- pgsql/types/makefile | 5 +- qt/build.bat | 1 + qt/common/basic/makefile | 3 + qt/common/containers/basics/makefile | 3 + qt/common/containers/change-tracking/makefile | 3 + qt/common/makefile | 3 + qt/common/qt-common-qt4-vc8.sln | 15 ++ qt/common/smart-ptr/makefile | 3 + qt/common/template/makefile | 3 + qt/common/template/template-qt4-vc8.vcproj | 353 ++++++++++++++++++++++++ qt/mssql/basic/makefile | 3 + qt/mssql/date-time/makefile | 3 + qt/mssql/makefile | 3 + qt/mssql/qt-mssql-qt4-vc8.sln | 15 ++ qt/mssql/template/makefile | 3 + qt/mssql/template/template-qt4-vc8.vcproj | 354 ++++++++++++++++++++++++ qt/mysql/basic/makefile | 3 + qt/mysql/date-time/makefile | 3 + qt/mysql/makefile | 3 + qt/mysql/qt-mysql-qt4-vc8.sln | 15 ++ qt/mysql/template/makefile | 3 + qt/mysql/template/template-qt4-vc8.vcproj | 354 ++++++++++++++++++++++++ qt/oracle/basic/makefile | 3 + qt/oracle/date-time/makefile | 3 + qt/oracle/makefile | 3 + qt/oracle/qt-oracle-qt4-vc8.sln | 15 ++ qt/oracle/template/makefile | 3 + qt/oracle/template/template-qt4-vc8.vcproj | 354 ++++++++++++++++++++++++ qt/pgsql/basic/makefile | 3 + qt/pgsql/date-time/makefile | 3 + qt/pgsql/makefile | 3 + qt/pgsql/qt-pgsql-qt4-vc8.sln | 15 ++ qt/pgsql/template/makefile | 3 + qt/pgsql/template/template-qt4-vc8.vcproj | 354 ++++++++++++++++++++++++ qt/sqlite/basic/makefile | 3 + qt/sqlite/date-time/makefile | 3 + qt/sqlite/makefile | 3 + qt/sqlite/qt-sqlite-qt4-vc8.sln | 15 ++ qt/sqlite/template/makefile | 3 + qt/sqlite/template/template-qt4-vc8.vcproj | 354 ++++++++++++++++++++++++ sqlite/custom/makefile | 5 +- sqlite/database/makefile | 5 +- sqlite/makefile | 5 +- sqlite/native/makefile | 5 +- sqlite/sqlite-vc8.sln | 15 ++ sqlite/template/makefile | 5 +- sqlite/template/template-vc8.vcproj | 354 ++++++++++++++++++++++++ sqlite/truncation/makefile | 5 +- sqlite/types/makefile | 5 +- 198 files changed, 7997 insertions(+), 196 deletions(-) create mode 100644 boost/common/boost-common-vc8.sln create mode 100644 boost/common/template/template-vc8.vcproj create mode 100644 boost/mssql/boost-mssql-vc8.sln create mode 100644 boost/mssql/template/template-vc8.vcproj create mode 100644 boost/mysql/boost-mysql-vc8.sln create mode 100644 boost/mysql/template/template-vc8.vcproj create mode 100644 boost/oracle/boost-oracle-vc8.sln create mode 100644 boost/oracle/template/template-vc8.vcproj create mode 100644 boost/pgsql/boost-pgsql-vc8.sln create mode 100644 boost/pgsql/template/template-vc8.vcproj create mode 100644 boost/sqlite/boost-sqlite-vc8.sln create mode 100644 boost/sqlite/template/template-vc8.vcproj create mode 100644 common/common-vc8.sln create mode 100644 common/template/template-vc8.vcproj create mode 100644 evolution/evolution-vc8.sln create mode 100644 evolution/template/template-vc8.vcproj create mode 100644 libcommon/common/libcommon-vc8.vcproj create mode 100644 libcommon/libcommon-vc8.sln create mode 100644 mssql/mssql-vc8.sln create mode 100644 mssql/template/template-vc8.vcproj create mode 100644 mysql/mysql-vc8.sln create mode 100644 mysql/template/template-vc8.vcproj create mode 100644 oracle/oracle-vc8.sln create mode 100644 oracle/template/template-vc8.vcproj create mode 100644 pgsql/pgsql-vc8.sln create mode 100644 pgsql/template/template-vc8.vcproj create mode 100644 qt/common/qt-common-qt4-vc8.sln create mode 100644 qt/common/template/template-qt4-vc8.vcproj create mode 100644 qt/mssql/qt-mssql-qt4-vc8.sln create mode 100644 qt/mssql/template/template-qt4-vc8.vcproj create mode 100644 qt/mysql/qt-mysql-qt4-vc8.sln create mode 100644 qt/mysql/template/template-qt4-vc8.vcproj create mode 100644 qt/oracle/qt-oracle-qt4-vc8.sln create mode 100644 qt/oracle/template/template-qt4-vc8.vcproj create mode 100644 qt/pgsql/qt-pgsql-qt4-vc8.sln create mode 100644 qt/pgsql/template/template-qt4-vc8.vcproj create mode 100644 qt/sqlite/qt-sqlite-qt4-vc8.sln create mode 100644 qt/sqlite/template/template-qt4-vc8.vcproj create mode 100644 sqlite/sqlite-vc8.sln create mode 100644 sqlite/template/template-vc8.vcproj diff --git a/boost/build.bat b/boost/build.bat index 07876be..93bb9db 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -36,6 +36,7 @@ if "_%~4_" == "__" ( set "failed=" +if "_%2_" == "_8_" set "vcver=8" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" if "_%2_" == "_11_" set "vcver=11" diff --git a/boost/common/boost-common-vc8.sln b/boost/common/boost-common-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/common/boost-common-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/common/makefile b/boost/common/makefile index 4c81d25..17ea5f8 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -20,10 +20,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) name := boost-common $(dist): name := $(name) $(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ +$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) + $(call meta-vc8slns,$(name)) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) @@ -37,6 +38,7 @@ endif $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 2aa5651..12b8cc8 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index e29b486..b088799 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index f41eb40..6f1dc97 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 881ac76..fdb817a 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/common/template/template-vc8.vcproj b/boost/common/template/template-vc8.vcproj new file mode 100644 index 0000000..e0ac609 --- /dev/null +++ b/boost/common/template/template-vc8.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 0ed08d8..b50de0c 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 3498175..6ac7e74 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -63,11 +63,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -103,6 +104,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/mssql/boost-mssql-vc8.sln b/boost/mssql/boost-mssql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/mssql/boost-mssql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index cc9dff1..24a60a2 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -60,12 +60,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -97,6 +99,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 6751f63..b124952 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -12,9 +12,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -23,6 +25,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 6c472e0..55544fb 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -55,12 +55,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/mssql/template/template-vc8.vcproj b/boost/mssql/template/template-vc8.vcproj new file mode 100644 index 0000000..6d1c40b --- /dev/null +++ b/boost/mssql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/boost/mysql/boost-mysql-vc8.sln b/boost/mysql/boost-mysql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/mysql/boost-mysql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index c6c60fd..7bfe910 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -59,12 +59,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -96,6 +98,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 748c54a..e469c81 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -12,9 +12,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -23,6 +25,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 5ca6481..18d7f7a 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -55,12 +55,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/mysql/template/template-vc8.vcproj b/boost/mysql/template/template-vc8.vcproj new file mode 100644 index 0000000..2ef0383 --- /dev/null +++ b/boost/mysql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/boost/oracle/boost-oracle-vc8.sln b/boost/oracle/boost-oracle-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/oracle/boost-oracle-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 0b386ca..277fb46 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -60,12 +60,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -97,6 +99,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/oracle/makefile b/boost/oracle/makefile index e7e72ab..df30557 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -12,9 +12,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -23,6 +25,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 18e3307..692ad41 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -55,12 +55,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/oracle/template/template-vc8.vcproj b/boost/oracle/template/template-vc8.vcproj new file mode 100644 index 0000000..c13f330 --- /dev/null +++ b/boost/oracle/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/boost/pgsql/boost-pgsql-vc8.sln b/boost/pgsql/boost-pgsql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/pgsql/boost-pgsql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 5915e53..1111fda 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -59,12 +59,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -96,6 +98,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 4834247..9b2a71a 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -12,9 +12,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -23,6 +25,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 5423cbc..1b941f6 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -59,12 +59,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -96,6 +98,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/pgsql/template/template-vc8.vcproj b/boost/pgsql/template/template-vc8.vcproj new file mode 100644 index 0000000..65773c9 --- /dev/null +++ b/boost/pgsql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/boost/sqlite/boost-sqlite-vc8.sln b/boost/sqlite/boost-sqlite-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/boost/sqlite/boost-sqlite-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 8f4e620..40a79ac 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -59,12 +59,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -96,6 +98,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index c0a26f5..0fcfa38 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -12,9 +12,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -23,6 +25,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index b6b1fb0..b4066e4 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -59,12 +59,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -96,6 +98,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/boost/sqlite/template/template-vc8.vcproj b/boost/sqlite/template/template-vc8.vcproj new file mode 100644 index 0000000..df92637 --- /dev/null +++ b/boost/sqlite/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/build.bat b/build.bat index 8c7b5ad..b57a88b 100644 --- a/build.bat +++ b/build.bat @@ -36,6 +36,7 @@ if "_%~4_" == "__" ( set "failed=" +if "_%2_" == "_8_" set "vcver=8" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" if "_%2_" == "_11_" set "vcver=11" diff --git a/build/bootstrap.make b/build/bootstrap.make index 7d5b84e..4e0b0c2 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -150,6 +150,11 @@ endif # $1 project template without the -vcN.vc[x]proj suffix. # $2 project name without the -vcN.vc[x]proj suffix. # +$(dist): meta-vc8projs = \ +$(foreach d,$(databases),$(call \ +meta-vc8proj,$1-vc8.vcproj,$(if $2,$2,$(notdir \ +$1))-$d-vc8.vcproj,database,$d)$(literal_newline)$(literal_tab))@: + $(dist): meta-vc9projs = \ $(foreach d,$(databases),$(call \ meta-vc9proj,$1-vc9.vcproj,$(if $2,$2,$(notdir \ @@ -167,6 +172,8 @@ $1))-$d-vc11.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: # $1 project name without the -vcN.vc[x]proj suffix. # +vc8projs = $(addprefix $1-,$(addsuffix -vc8.vcproj,$(databases))) + vc9projs = $(addprefix $1-,$(addsuffix -vc9.vcproj,$(databases))) vc10projs = $(addprefix $1-,$(addsuffix -vc10.vcxproj,$(databases))) \ @@ -178,6 +185,11 @@ $(addprefix $1-,$(addsuffix -vc11.vcxproj.filters,$(databases))) # $1 solution name without the -vcN.sln suffix. # $2 extra project suffix in addition to --vcN.vcproj (optional) # +$(dist): meta-vc8slns = \ +$(foreach d,$(databases),$(call \ +meta-vc8sln,$1-vc8.sln,$1-$d-vc8.sln,$2-$d-vc8.vcproj,database,$d)$(literal_newline)\ +$(literal_tab))@: + $(dist): meta-vc9slns = \ $(foreach d,$(databases),$(call \ meta-vc9sln,$1-vc9.sln,$1-$d-vc9.sln,$2-$d-vc9.vcproj,database,$d)$(literal_newline)\ @@ -193,6 +205,7 @@ $(foreach d,$(databases),$(call \ meta-vc11sln,$1-vc11.sln,$1-$d-vc11.sln,$2-$d-vc11.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: +vc8slns = $(addprefix $1-,$(addsuffix -vc8.sln,$(databases))) vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) vc10slns = $(addprefix $1-,$(addsuffix -vc10.sln,$(databases))) vc11slns = $(addprefix $1-,$(addsuffix -vc11.sln,$(databases))) diff --git a/common/access/makefile b/common/access/makefile index 9d9da3b..00c1262 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -54,11 +54,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -94,6 +95,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/auto/makefile b/common/auto/makefile index 409d5b6..525ea5a 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/blob/makefile b/common/blob/makefile index 4cdfd01..08120fa 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/callback/makefile b/common/callback/makefile index 35e2254..53c746b 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index d603c82..feef2f4 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -58,11 +58,12 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -98,6 +99,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 1e88748..f65ca66 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/common-vc8.sln b/common/common-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/common/common-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 59ffd1b..12411b4 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/composite/makefile b/common/composite/makefile index c32f9c8..6c9e66b 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/const-member/makefile b/common/const-member/makefile index d366517..bb73bd4 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/const-object/makefile b/common/const-object/makefile index 46c968c..41857f6 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 433d610..eaf948d 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index 354059f..f817436 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/ctor/makefile b/common/ctor/makefile index ab1dc32..760d85b 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/default/makefile b/common/default/makefile index 652af83..89f00b5 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/definition/makefile b/common/definition/makefile index 280a27c..72883ae 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -58,11 +58,12 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -98,6 +99,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/enum/makefile b/common/enum/makefile index 00e7da4..8c3e746 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/erase-query/makefile b/common/erase-query/makefile index f66d840..9d6c8c2 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/index/makefile b/common/index/makefile index 690e2ab..7cc004d 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 2609151..c0d16eb 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -56,11 +56,12 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -96,6 +97,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index f240640..e326533 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 4d6ba4d..1e53bde 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/inverse/makefile b/common/inverse/makefile index 89c98ee..012340e 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 03e39af..615cf31 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index f047e0f..04b14c8 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/makefile b/common/makefile index 44adcc7..82743a1 100644 --- a/common/makefile +++ b/common/makefile @@ -80,10 +80,11 @@ $(dist): name := $(name) $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export cxx11_dirs := $(cxx11_tests) -$(dist): export extra_dist := test.bat $(call vc9slns,$(name)) \ -$(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ +$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) + $(call meta-vc8slns,$(name)) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) @@ -97,6 +98,7 @@ endif $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/common/no-id/makefile b/common/no-id/makefile index 99df92d..ff66a4c 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/optimistic/makefile b/common/optimistic/makefile index ac61e5a..05fb22c 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/pragma/makefile b/common/pragma/makefile index 1ea8ba1..c420313 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/prepared/makefile b/common/prepared/makefile index d905419..44f8562 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/query/array/makefile b/common/query/array/makefile index d8fa45b..b12aeae 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/query/basics/makefile b/common/query/basics/makefile index fc26133..d4813cd 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/readonly/makefile b/common/readonly/makefile index 92bc2cf..f4d6d36 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index caf72ea..14d5e5c 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/relationship/makefile b/common/relationship/makefile index 95ad959..5857ca0 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 07a246f..d9e764e 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../../template/Makefile.am) + $(call meta-vc8projs,../../../template/template,$(name)) $(call meta-vc9projs,../../../template/template,$(name)) $(call meta-vc10projs,../../../template/template,$(name)) $(call meta-vc11projs,../../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 10242cf..7c92a68 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -58,11 +58,12 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../../template/Makefile.am) + $(call meta-vc8projs,../../../template/template,$(name)) $(call meta-vc9projs,../../../template/template,$(name)) $(call meta-vc10projs,../../../template/template,$(name)) $(call meta-vc11projs,../../../template/template,$(name)) @@ -98,6 +99,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 8d34d43..6877980 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 165a7b3..11db37b 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/template/makefile b/common/template/makefile index 2498cce..b4df945 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/template/template-vc8.vcproj b/common/template/template-vc8.vcproj new file mode 100644 index 0000000..33ad5ae --- /dev/null +++ b/common/template/template-vc8.vcproj @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), + __source_entry__(__f-odb.cxx))) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), + __file_entry_custom_build__( +__f.hxx, +odb __f.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) __f.hxx, +__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) +__file_entry__(__f-odb.hxx) +__file_entry__(__f-odb.ixx))) +__file_entries__(extra_headers) + + + + + diff --git a/common/threads/makefile b/common/threads/makefile index 92d00d7..59c5c71 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 07b1ba6..3b028b6 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -30,11 +30,12 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -69,6 +70,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 012dd2f..091ac21 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -30,11 +30,12 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) @@ -69,6 +70,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/types/makefile b/common/types/makefile index c28964a..9c274fe 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/view/makefile b/common/view/makefile index d13e7c6..992bb15 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/virtual/makefile b/common/virtual/makefile index ef27eff..79901fd 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -53,11 +53,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -93,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 1c2cd3f..3c0a2d5 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -52,11 +52,12 @@ $(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)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -92,6 +93,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 9c397b9..52b5371 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 295598f..a385184 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -71,11 +71,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -122,6 +123,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 07b817b..0b889aa 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 88c4cde..337263a 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index bbfa0bf..095620c 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/combined/makefile b/evolution/combined/makefile index f49d1a7..8aecc83 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/data/makefile b/evolution/data/makefile index 8023594..98e852a 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -68,11 +68,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -118,6 +119,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 244181c..135c3fc 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 9a12aa8..39e1633 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -71,11 +71,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -122,6 +123,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 5d90d38..eec3cf7 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 99339d7..ed46f61 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 3639f85..3e351ad 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -68,11 +68,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -110,6 +111,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/evolution-vc8.sln b/evolution/evolution-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/evolution/evolution-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/evolution/makefile b/evolution/makefile index fddde1b..0b24422 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -31,11 +31,13 @@ $(dist): data_dist := tester.bat $(dist): exec_dist := tester.in $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export extra_dist := $(data_dist) $(exec_dist) test.bat \ -$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(call vc8slns,$(name)) $(call vc9slns,$(name)) $(call vc10slns,$(name)) \ +$(call vc11slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call dist-data,$(data_dist)) $(call dist-exec,$(exec_dist)) $(call meta-automake) + $(call meta-vc8slns,$(name)) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) @@ -45,6 +47,7 @@ $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/evolution/template/makefile b/evolution/template/makefile index c7777b1..1911ea8 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/evolution/template/template-vc8.vcproj b/evolution/template/template-vc8.vcproj new file mode 100644 index 0000000..d6c5f15 --- /dev/null +++ b/evolution/template/template-vc8.vcproj @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test1.hxx, +odb test1.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__file_entry__(test1-odb.hxx) +__file_entry__(test1-odb.ixx) +__file_entry_custom_build__( +test2.hxx, +odb test2.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__file_entry__(test2-odb.hxx) +__file_entry__(test2-odb.ixx) +__file_entry_custom_build__( +test3.hxx, +odb test3.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) +__file_entry__(test3-odb.hxx) +__file_entry__(test3-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/evolution/version/makefile b/evolution/version/makefile index 63bbe72..4a2721f 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -70,11 +70,12 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) -$(dist): export extra_dist := $(call vc9projs,$(name)) \ -$(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) @@ -121,6 +122,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 4ca2b68..ba7118a 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -231,7 +231,7 @@ create_database (int argc, #endif ) { - char** argp (argv + 1); // Position of the next argument. + char** argp = argv + 1; // Position of the next argument. Assignment for VC8. int argn (argc - 1); // Number of arguments left. #if defined(DATABASE_COMMON) diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 1f05206..17d1bd0 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -10,7 +10,7 @@ #define HAVE_TR1_MEMORY -/* VC++10 has C++11 always enabled. +/* VC++10 and later has C++11 always enabled. */ #if (defined(_MSC_VER) && _MSC_VER >= 1600) || \ (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1600) diff --git a/libcommon/common/libcommon-vc8.vcproj b/libcommon/common/libcommon-vc8.vcproj new file mode 100644 index 0000000..ab5656a --- /dev/null +++ b/libcommon/common/libcommon-vc8.vcproj @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entries__(sources) + + +__file_entries__(headers) + + + + + diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 5d23fa9..5647ba2 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -120,12 +120,14 @@ $(dist): export sources := $(cxx_tun) $(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) $(dist): data_dist := config.h.in config-vc.h -$(dist): export extra_dist := $(data_dist) $(call vc9projs,libcommon) \ -$(call vc10projs,libcommon) $(call vc11projs,libcommon) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,libcommon) \ +$(call vc9projs,libcommon) $(call vc10projs,libcommon) \ +$(call vc11projs,libcommon) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake) + $(call meta-vc8projs,libcommon) $(call meta-vc9projs,libcommon) $(call meta-vc10projs,libcommon) $(call meta-vc11projs,libcommon) @@ -152,6 +154,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/libcommon/libcommon-vc8.sln b/libcommon/libcommon-vc8.sln new file mode 100644 index 0000000..73326f5 --- /dev/null +++ b/libcommon/libcommon-vc8.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc8.vcproj", "{8575F058-1BD6-4F97-8901-83D0110C2B6B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.ActiveCfg = Debug|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.Build.0 = Debug|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.ActiveCfg = Debug|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.Build.0 = Debug|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.ActiveCfg = Release|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.Build.0 = Release|Win32 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.ActiveCfg = Release|x64 + {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libcommon/makefile b/libcommon/makefile index cade0e7..e1fc2db 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -9,16 +9,18 @@ dirs := common $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export dirs := $(dirs) -$(dist): export extra_dist := $(call vc9slns,libcommon) \ -$(call vc10slns,libcommon) $(call vc11slns,libcommon) +$(dist): export extra_dist := $(call vc8slns,libcommon) \ +$(call vc9slns,libcommon) $(call vc10slns,libcommon) $(call vc11slns,libcommon) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) $(call meta-automake) + $(call meta-vc8slns,libcommon) $(call meta-vc9slns,libcommon) $(call meta-vc10slns,libcommon) $(call meta-vc11slns,libcommon) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 98c0869..da1def2 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -46,14 +46,17 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx query.hxx +$(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) $(dist): data_dist := test.std custom.sql $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -85,6 +88,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mssql/database/makefile b/mssql/database/makefile index b8281c5..c01f888 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mssql/makefile b/mssql/makefile index 4891a0a..1b831a6 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -16,9 +16,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mssql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -27,6 +29,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/mssql/mssql-vc8.sln b/mssql/mssql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/mssql/mssql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mssql/native/makefile b/mssql/native/makefile index 95fbd77..1104857 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mssql/query/makefile b/mssql/query/makefile index 6194671..b23b9d8 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -46,12 +46,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -83,6 +85,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 4e7904a..379b77a 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -31,5 +31,5 @@ ODBFLAGS += --std c++11 endif test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) m4_patsubst(__value__(odb_options), __value__(src_base), $(srcdir)) $< ) diff --git a/mssql/template/makefile b/mssql/template/makefile index 325cb8d..1b2b97b 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mssql/template/template-vc10.vcxproj b/mssql/template/template-vc10.vcxproj index cf9c6ff..5875d9b 100644 --- a/mssql/template/template-vc10.vcxproj +++ b/mssql/template/template-vc10.vcxproj @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mssql/template/template-vc11.vcxproj b/mssql/template/template-vc11.vcxproj index 3d2a5ae..93f2be8 100644 --- a/mssql/template/template-vc11.vcxproj +++ b/mssql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mssql/template/template-vc8.vcproj b/mssql/template/template-vc8.vcproj new file mode 100644 index 0000000..cfd697f --- /dev/null +++ b/mssql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/mssql/template/template-vc9.vcproj b/mssql/template/template-vc9.vcproj index 50e7e17..72a95d9 100644 --- a/mssql/template/template-vc9.vcproj +++ b/mssql/template/template-vc9.vcproj @@ -349,7 +349,7 @@ __ifelse__(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/mssql/types/makefile b/mssql/types/makefile index 8f86027..ab57f1f 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -47,12 +47,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -84,6 +86,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index 95b3517..d9453ec 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -32,7 +32,10 @@ main (int argc, char* argv[]) o.p = point (1.1111, 2222222222.2); o.pv.push_back (point (1.1234, 2.2345)); o.pv.push_back (point (3.3456, 4.4567)); + // VC8 just cannot roundtrip this. +#if !defined(_MSC_VER) || _MSC_VER >= 1500 o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. +#endif // Persist. // diff --git a/mysql/custom/makefile b/mysql/custom/makefile index f857ea4..428a869 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -48,12 +48,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx query.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -85,6 +87,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/database/makefile b/mysql/database/makefile index d2426f6..7ffed22 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/index/makefile b/mysql/index/makefile index 5c8838e..67991af 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/makefile b/mysql/makefile index 02bb64f..ed2da6a 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -17,9 +17,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mysql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -28,6 +30,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/mysql/mysql-vc8.sln b/mysql/mysql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/mysql/mysql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql/native/makefile b/mysql/native/makefile index 859c17a..c813fda 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/template/makefile b/mysql/template/makefile index 4109f3e..cef4a16 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/template/template-vc8.vcproj b/mysql/template/template-vc8.vcproj new file mode 100644 index 0000000..afe88c4 --- /dev/null +++ b/mysql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 1a1f75b..8cb89e6 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/mysql/types/makefile b/mysql/types/makefile index 8cdc014..cd0c948 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -47,12 +47,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -84,6 +86,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 4022c16..e746117 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -48,12 +48,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std custom.sql $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -85,6 +87,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/oracle/database/makefile b/oracle/database/makefile index fe6bab6..7f891af 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/oracle/makefile b/oracle/makefile index 918ec23..8bd09d4 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -15,9 +15,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := oracle $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -26,6 +28,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/oracle/native/makefile b/oracle/native/makefile index 5d799a8..6bb6608 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/oracle/oracle-vc8.sln b/oracle/oracle-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/oracle/oracle-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/oracle/template/makefile b/oracle/template/makefile index 7433e36..ec767ca 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/oracle/template/template-vc8.vcproj b/oracle/template/template-vc8.vcproj new file mode 100644 index 0000000..71e2b52 --- /dev/null +++ b/oracle/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/oracle/types/makefile b/oracle/types/makefile index 5e7015f..89a5698 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -47,12 +47,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -84,6 +86,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index d675915..317f90f 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -48,12 +48,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx query.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -85,6 +87,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 398164d..3284b2d 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 772802e..7ac33a9 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -43,12 +43,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -80,6 +82,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/makefile b/pgsql/makefile index 7dd15da..9508e43 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -17,9 +17,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := pgsql $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -28,6 +30,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 2c39100..8ec2ae9 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/pgsql-vc8.sln b/pgsql/pgsql-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/pgsql/pgsql-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 3d84b9b..53e817c 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -43,12 +43,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -80,6 +82,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/template/template-vc8.vcproj b/pgsql/template/template-vc8.vcproj new file mode 100644 index 0000000..3b2bbc3 --- /dev/null +++ b/pgsql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 416f2c2..e0006ea 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 94be6c0..0895e23 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -47,12 +47,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -84,6 +86,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/build.bat b/qt/build.bat index b9c988b..69e1bc5 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -49,6 +49,7 @@ if "_%qtver%_" == "__" ( goto usage ) +if "_%3_" == "_8_" set "vcver=8" if "_%3_" == "_9_" set "vcver=9" if "_%3_" == "_10_" set "vcver=10" if "_%3_" == "_11_" set "vcver=11" diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index db50659..c61d160 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -64,12 +64,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) \ +$(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ $(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) @@ -108,6 +110,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 5f3b201..caad81a 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -64,12 +64,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) \ +$(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ $(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) @@ -108,6 +110,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 582c8c4..1e05409 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -64,12 +64,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) \ +$(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ $(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) @@ -108,6 +110,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/common/makefile b/qt/common/makefile index 6b72fb0..d03d843 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -20,11 +20,13 @@ name := qt-common $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(call vc9slns,$(name)-qt4) \ $(call vc9slns,$(name)-qt4) $(call vc9slns,$(name)-qt5) \ $(call vc10slns,$(name)-qt4) $(call vc10slns,$(name)-qt5) \ $(call vc11slns,$(name)-qt4) $(call vc11slns,$(name)-qt5) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) + $(call meta-vc8slns,$(name)-qt4,-qt4) $(call meta-vc9slns,$(name)-qt4,-qt4) $(call meta-vc9slns,$(name)-qt5,-qt5) $(call meta-vc10slns,$(name)-qt4,-qt4) @@ -42,6 +44,7 @@ endif $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/common/qt-common-qt4-vc8.sln b/qt/common/qt-common-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/common/qt-common-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 7dad2e7..67cf8c3 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -64,12 +64,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) \ +$(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ $(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) @@ -108,6 +110,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 407094c..ff5d230 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -64,12 +64,14 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) \ +$(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ $(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) @@ -108,6 +110,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/common/template/template-qt4-vc8.vcproj b/qt/common/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..63fc22c --- /dev/null +++ b/qt/common/template/template-qt4-vc8.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 4da6e63..8976d17 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 4354696..bbc377f 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mssql/makefile b/qt/mssql/makefile index e3dc361..7313e6a 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -14,11 +14,13 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mssql $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) @@ -31,6 +33,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/mssql/qt-mssql-qt4-vc8.sln b/qt/mssql/qt-mssql-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/mssql/qt-mssql-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index b126962..b18aed0 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -50,6 +50,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -58,6 +59,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mssql/template/template-qt4-vc8.vcproj b/qt/mssql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..38916fa --- /dev/null +++ b/qt/mssql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index f0e8814..5d8d0fc 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index ded9a6c..2327f49 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mysql/makefile b/qt/mysql/makefile index e94b718..eeffed7 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -14,11 +14,13 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-mysql $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) @@ -31,6 +33,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/mysql/qt-mysql-qt4-vc8.sln b/qt/mysql/qt-mysql-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/mysql/qt-mysql-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 9870235..e35f84e 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -50,6 +50,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -58,6 +59,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/mysql/template/template-qt4-vc8.vcproj b/qt/mysql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..25e096f --- /dev/null +++ b/qt/mysql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 2069a29..4e515fd 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index b2f25ac..1fb7d00 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 138e91c..efa2888 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -14,11 +14,13 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-oracle $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) @@ -31,6 +33,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/oracle/qt-oracle-qt4-vc8.sln b/qt/oracle/qt-oracle-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/oracle/qt-oracle-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index cc055cc..70fbf1f 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -50,6 +50,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -58,6 +59,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/oracle/template/template-qt4-vc8.vcproj b/qt/oracle/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..187254b --- /dev/null +++ b/qt/oracle/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 9dea1b1..d51d796 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 46bccbb..e774aae 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 70df91b..971add2 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -14,11 +14,13 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-pgsql $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) @@ -31,6 +33,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/pgsql/qt-pgsql-qt4-vc8.sln b/qt/pgsql/qt-pgsql-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 9a1e72f..70a7183 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -50,6 +50,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -58,6 +59,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/pgsql/template/template-qt4-vc8.vcproj b/qt/pgsql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..3f364d2 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 2bac21a..6c9744e 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 1af2338..d257419 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -56,6 +56,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -64,6 +65,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -98,6 +100,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 0ee2bf4..22478df 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -14,11 +14,13 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := qt-sqlite $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat \ +$(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) @@ -31,6 +33,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/qt/sqlite/qt-sqlite-qt4-vc8.sln b/qt/sqlite/qt-sqlite-qt4-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt4-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index c0b8274..8f92eb2 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -50,6 +50,7 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/qt/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ +$(name)-qt4-vc8.vcproj \ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ @@ -58,6 +59,7 @@ $(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) @@ -92,6 +94,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/qt/sqlite/template/template-qt4-vc8.vcproj b/qt/sqlite/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..16623a8 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index f7a1cdb..c5d7046 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/sqlite/database/makefile b/sqlite/database/makefile index a96f6a7..78103c1 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/sqlite/makefile b/sqlite/makefile index 0fa93d8..7348436 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -16,9 +16,11 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := sqlite $(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln $(name)-vc11.sln test.bat +$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ +$(name)-vc10.sln $(name)-vc11.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) @@ -27,6 +29,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) diff --git a/sqlite/native/makefile b/sqlite/native/makefile index fe2404f..b763983 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -28,12 +28,14 @@ $(out_base)/: $(driver) $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -64,6 +66,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/sqlite/sqlite-vc8.sln b/sqlite/sqlite-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/sqlite/sqlite-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 46a33e5..558aa94 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/sqlite/template/template-vc8.vcproj b/sqlite/template/template-vc8.vcproj new file mode 100644 index 0000000..ef608ba --- /dev/null +++ b/sqlite/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 4af9fef..d307dea 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -45,12 +45,14 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -82,6 +84,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 3c7ae9b..1559671 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -47,12 +47,14 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx $(dist): data_dist := test.std $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ $(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) @@ -84,6 +86,7 @@ endif # How to. # $(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) -- cgit v1.1 From a781acfa28312b4bb9549f43117e730ecf9ab13d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jul 2013 14:56:55 +0200 Subject: Fix incorrect ODB_MSC_VER version in VC11 projects --- boost/common/template/template-vc11.vcxproj | 2 +- boost/mssql/template/template-vc11.vcxproj | 2 +- boost/mysql/template/template-vc11.vcxproj | 2 +- boost/oracle/template/template-vc11.vcxproj | 2 +- boost/pgsql/template/template-vc11.vcxproj | 2 +- boost/sqlite/template/template-vc11.vcxproj | 2 +- common/template/template-vc11.vcxproj | 2 +- mssql/template/template-vc11.vcxproj | 2 +- mysql/template/template-vc11.vcxproj | 2 +- oracle/template/template-vc11.vcxproj | 2 +- pgsql/template/template-vc11.vcxproj | 2 +- qt/common/template/template-qt4-vc11.vcxproj | 2 +- qt/common/template/template-qt5-vc11.vcxproj | 2 +- qt/mssql/template/template-qt4-vc11.vcxproj | 2 +- qt/mssql/template/template-qt5-vc11.vcxproj | 2 +- qt/mysql/template/template-qt4-vc11.vcxproj | 2 +- qt/mysql/template/template-qt5-vc11.vcxproj | 2 +- qt/oracle/template/template-qt4-vc11.vcxproj | 2 +- qt/oracle/template/template-qt5-vc11.vcxproj | 2 +- qt/pgsql/template/template-qt4-vc11.vcxproj | 2 +- qt/pgsql/template/template-qt5-vc11.vcxproj | 2 +- qt/sqlite/template/template-qt4-vc11.vcxproj | 2 +- qt/sqlite/template/template-qt5-vc11.vcxproj | 2 +- sqlite/template/template-vc11.vcxproj | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/boost/common/template/template-vc11.vcxproj b/boost/common/template/template-vc11.vcxproj index 59da6d0..83d20c5 100644 --- a/boost/common/template/template-vc11.vcxproj +++ b/boost/common/template/template-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/boost/mssql/template/template-vc11.vcxproj b/boost/mssql/template/template-vc11.vcxproj index 2cc9f28..d5951f1 100644 --- a/boost/mssql/template/template-vc11.vcxproj +++ b/boost/mssql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/mysql/template/template-vc11.vcxproj b/boost/mysql/template/template-vc11.vcxproj index 85fd7ac..bc4b5a4 100644 --- a/boost/mysql/template/template-vc11.vcxproj +++ b/boost/mysql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/oracle/template/template-vc11.vcxproj b/boost/oracle/template/template-vc11.vcxproj index d29652e..4df5f5b 100644 --- a/boost/oracle/template/template-vc11.vcxproj +++ b/boost/oracle/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/pgsql/template/template-vc11.vcxproj b/boost/pgsql/template/template-vc11.vcxproj index 1615292..9f8d2f0 100644 --- a/boost/pgsql/template/template-vc11.vcxproj +++ b/boost/pgsql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/boost/sqlite/template/template-vc11.vcxproj b/boost/sqlite/template/template-vc11.vcxproj index 4056905..1c1a279 100644 --- a/boost/sqlite/template/template-vc11.vcxproj +++ b/boost/sqlite/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/common/template/template-vc11.vcxproj b/common/template/template-vc11.vcxproj index c1f1b0d..d336611 100644 --- a/common/template/template-vc11.vcxproj +++ b/common/template/template-vc11.vcxproj @@ -165,7 +165,7 @@ m4_dnl __custom_build_entry__( __f.hxx, odb __f.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) ) ) diff --git a/mssql/template/template-vc11.vcxproj b/mssql/template/template-vc11.vcxproj index 93f2be8..0bee18f 100644 --- a/mssql/template/template-vc11.vcxproj +++ b/mssql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mysql/template/template-vc11.vcxproj b/mysql/template/template-vc11.vcxproj index c29cc09..5fb45bb 100644 --- a/mysql/template/template-vc11.vcxproj +++ b/mysql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/oracle/template/template-vc11.vcxproj b/oracle/template/template-vc11.vcxproj index 68ba938..a92e437 100644 --- a/oracle/template/template-vc11.vcxproj +++ b/oracle/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/pgsql/template/template-vc11.vcxproj b/pgsql/template/template-vc11.vcxproj index afccb7e..9e7c682 100644 --- a/pgsql/template/template-vc11.vcxproj +++ b/pgsql/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/common/template/template-qt4-vc11.vcxproj b/qt/common/template/template-qt4-vc11.vcxproj index cecfe53..a71ac6b 100644 --- a/qt/common/template/template-qt4-vc11.vcxproj +++ b/qt/common/template/template-qt4-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/common/template/template-qt5-vc11.vcxproj b/qt/common/template/template-qt5-vc11.vcxproj index 2af597c..07daa25 100644 --- a/qt/common/template/template-qt5-vc11.vcxproj +++ b/qt/common/template/template-qt5-vc11.vcxproj @@ -162,7 +162,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/qt/mssql/template/template-qt4-vc11.vcxproj b/qt/mssql/template/template-qt4-vc11.vcxproj index d58282a..b9dd89c 100644 --- a/qt/mssql/template/template-qt4-vc11.vcxproj +++ b/qt/mssql/template/template-qt4-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj b/qt/mssql/template/template-qt5-vc11.vcxproj index e986b42..a974034 100644 --- a/qt/mssql/template/template-qt5-vc11.vcxproj +++ b/qt/mssql/template/template-qt5-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/mysql/template/template-qt4-vc11.vcxproj b/qt/mysql/template/template-qt4-vc11.vcxproj index fc8ac4e..33cb785 100644 --- a/qt/mysql/template/template-qt4-vc11.vcxproj +++ b/qt/mysql/template/template-qt4-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj b/qt/mysql/template/template-qt5-vc11.vcxproj index b974e80..7a2e2b9 100644 --- a/qt/mysql/template/template-qt5-vc11.vcxproj +++ b/qt/mysql/template/template-qt5-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/oracle/template/template-qt4-vc11.vcxproj b/qt/oracle/template/template-qt4-vc11.vcxproj index 1f4248d..ad1e888 100644 --- a/qt/oracle/template/template-qt4-vc11.vcxproj +++ b/qt/oracle/template/template-qt4-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj b/qt/oracle/template/template-qt5-vc11.vcxproj index ae3b1bd..79d5d15 100644 --- a/qt/oracle/template/template-qt5-vc11.vcxproj +++ b/qt/oracle/template/template-qt5-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/pgsql/template/template-qt4-vc11.vcxproj b/qt/pgsql/template/template-qt4-vc11.vcxproj index 69278cd..a7e7a86 100644 --- a/qt/pgsql/template/template-qt4-vc11.vcxproj +++ b/qt/pgsql/template/template-qt4-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj b/qt/pgsql/template/template-qt5-vc11.vcxproj index 6b547d0..863bd51 100644 --- a/qt/pgsql/template/template-qt5-vc11.vcxproj +++ b/qt/pgsql/template/template-qt5-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/sqlite/template/template-qt4-vc11.vcxproj b/qt/sqlite/template/template-qt4-vc11.vcxproj index c7f0438..217b75e 100644 --- a/qt/sqlite/template/template-qt4-vc11.vcxproj +++ b/qt/sqlite/template/template-qt4-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj b/qt/sqlite/template/template-qt5-vc11.vcxproj index aae5c68..d0ca5d9 100644 --- a/qt/sqlite/template/template-qt5-vc11.vcxproj +++ b/qt/sqlite/template/template-qt5-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/sqlite/template/template-vc11.vcxproj b/sqlite/template/template-vc11.vcxproj index e62ab19..54fc9ef 100644 --- a/sqlite/template/template-vc11.vcxproj +++ b/sqlite/template/template-vc11.vcxproj @@ -164,7 +164,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) -- cgit v1.1 From 0947d7889b104722134b55971f7fd04320731ce1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Aug 2013 14:42:58 +0200 Subject: Get rid of warning --- sqlite/types/driver.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 1e148e0..fa0002f 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -58,11 +58,11 @@ main (int argc, char* argv[]) assert (o == *o1); } - typedef sqlite::query query; - typedef odb::result result; - #ifdef _WIN32 { + typedef sqlite::query query; + typedef odb::result result; + transaction t (db->begin ()); result r (db->query (query::wtext == L"t\x00C8st string")); assert (!r.empty ()); -- cgit v1.1 From e923e350cd29afa4765cf4fadfb2f63553943aa6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Aug 2013 15:14:47 +0200 Subject: Get rid of warning --- common/view/driver.cxx | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 2c5c65c..7ef8272 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -278,41 +278,40 @@ main (int argc, char* argv[]) // view1b // { - typedef odb::query query; typedef odb::result result; { - { - transaction t (db->begin ()); + transaction t (db->begin ()); - result r (db->query ()); - view1_check (r); + result r (db->query ()); + view1_check (r); - t.commit (); - } + t.commit (); + } - // No native parameter support in dynamic multi-database mode. - // + // No native parameter support in dynamic multi-database mode. + // #ifndef DATABASE_COMMON - { - transaction t (db->begin ()); + { + typedef odb::query query; + + transaction t (db->begin ()); #ifndef DATABASE_ORACLE - result r (db->query ("first = " + query::_val ("Jane"))); + result r (db->query ("first = " + query::_val ("Jane"))); #else - result r (db->query ("\"first\" = " + query::_val ("Jane"))); + result r (db->query ("\"first\" = " + query::_val ("Jane"))); #endif - result::iterator i (r.begin ()); + result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe"); - assert (++i == r.end ()); + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe"); + assert (++i == r.end ()); - t.commit (); - } -#endif + t.commit (); } +#endif } // view1c -- cgit v1.1 From dcb6d84266a0b291781855cf623aa4d4c395f14d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 12 Jul 2013 12:00:18 +0200 Subject: Add support for object sections Sections are an optimization mechanism that allows the partitioning of data members of a persistent class into groups that can be separately loaded and/or updated. --- common/makefile | 2 + common/section/basics/driver.cxx | 1689 ++++++++++++++++++++++++++++++ common/section/basics/makefile | 115 +++ common/section/basics/test.hxx | 600 +++++++++++ common/section/basics/test.std | 0 common/section/polymorphism/driver.cxx | 1763 ++++++++++++++++++++++++++++++++ common/section/polymorphism/makefile | 115 +++ common/section/polymorphism/test.hxx | 495 +++++++++ common/section/polymorphism/test.std | 0 9 files changed, 4779 insertions(+) create mode 100644 common/section/basics/driver.cxx create mode 100644 common/section/basics/makefile create mode 100644 common/section/basics/test.hxx create mode 100644 common/section/basics/test.std create mode 100644 common/section/polymorphism/driver.cxx create mode 100644 common/section/polymorphism/makefile create mode 100644 common/section/polymorphism/test.hxx create mode 100644 common/section/polymorphism/test.std diff --git a/common/makefile b/common/makefile index 82743a1..3263410 100644 --- a/common/makefile +++ b/common/makefile @@ -43,6 +43,8 @@ relationship-query \ schema/namespace \ schema/embedded/basics \ schema/embedded/order \ +section/basics \ +section/polymorphism \ session/cache \ template \ transaction/basics \ diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx new file mode 100644 index 0000000..67e09ef --- /dev/null +++ b/common/section/basics/driver.cxx @@ -0,0 +1,1689 @@ +// file : common/section/basics/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object section basics. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test lazy-loaded, always updating section. + // + { + using namespace test1; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // Test updating unloaded section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.unload (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Test reloading of loaded/unloaded sections. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.unload (); + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + db->reload (o); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + db->load (o, o.s); + t.commit (); + } + + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + db->reload (o); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + typedef odb::query query; + typedef odb::result result; + + // Make sure we can access section members in queries. + // + { + transaction t (db->begin ()); + + result r (db->query (query::ss == o.ss)); + result::iterator i (r.begin ()); + + assert (i != r.end () && !i->s.loaded ()); + + db->load (*i, i->s); + assert (i->n == o.n && + i->sn == o.sn && i->ss == o.ss && i->sv == o.sv); + + assert (++i == r.end ()); + + t.commit (); + } + + // Make sure we can load/update sections without messing up the + // loaded object's image. + // + { + transaction t (db->begin ()); + + result r (db->query (query::ss == o.ss)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + + object o1; + i.load (o1); + db->load (o1, o1.s); + assert (o1.n == o.n && + o1.sn == o.sn && o1.ss == o.ss && o1.sv == o.sv); + + o.sn++; + o.ss += 'd'; + o.sv[0]++; + db->update (o, o.s); + + object o2; + i.load (o2); + db->load (o2, o2.s); + assert (o2.n == o1.n && + o2.sn == o.sn && o2.ss == o.ss && o2.sv == o.sv); + + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test lazy-loaded, change-updated section. + // + { + using namespace test2; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Mark as changed. + // + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section manually. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o, o.s); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test lazy-loaded, manually-updated section. + // + { + using namespace test3; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update the object only. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Update both the object and section. + // + o.n++; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // Test detection of unloaded section update. + // + try + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->update (*p, p->s); + assert (false); + } + catch (const section_not_loaded&) + { + } + } + + // Test eager-loaded, change-updated section. + // + { + using namespace test4; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Mark as changed. + // + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test eager-loaded, manually-updated section. + // + { + using namespace test5; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update the object only. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Update both the object and section. + // + o.n++; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test value-only and container-only section. Also multiple sections + // in an object. + // + { + using namespace test6; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s1); + assert (p->s1.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv != o.sv); + + db->load (*p, p->s2); + assert (p->s2.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s1); + db->update (o, o.s2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test value-only and container-only section. Also multiple sections + // in an object. + // + { + using namespace test7; + + object o (123, "abc", true); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && + p->sn2 != o.sn2 && p->ss2 != o.ss2 && p->sb2 != o.sb2); + + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->s1.loaded ()); + assert (p->s2.loaded ()); + assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + + + t.commit (); + } + + // Update. + // + o.sn1++; + o.sn2++; + o.ss1 += 'd'; + o.ss2 += 'd'; + o.sb2 = !o.sb2; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + t.commit (); + } + + // Manual update of just the section. + // + o.sn1++; + o.sn2++; + o.ss1 += 'd'; + o.ss2 += 'd'; + o.sb2 = !o.sb2; + + { + transaction t (db->begin ()); + db->update (o, o.s2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + t.commit (); + } + } + + // Test readonly and inverse section members. + // + { + using namespace test8; + + object1 o1 (new object (123, "abc")); + object& o (*o1.p); + o.sp = &o1; + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (o1); + t.commit (); + + assert (o.s.loaded ()); + } + + { + session s; + + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + object* p (p1->p); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sp == 0); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sp->id == o.sp->id); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + session s; + + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + object* p (p1->p); + + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss == o.ss && p->sp->id == o.sp->id); + + t.commit (); + } + } + + // Test object without any columns to load or update. + // + { + using namespace test9; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (o.id == o.id && + p->sn != o.sn && p->ss != o.ss); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (o.id == o.id && + p->sn == o.sn && p->ss == o.ss); + + t.commit (); + } + + // Update object. + // + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); // No-op. + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (o.id == o.id && + p->sn != o.sn && p->ss != o.ss); + t.commit (); + } + + // Update section. + // + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (o.id == o.id && + p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + } + + // Test section without any columns or containers to update. + // + { + using namespace test10; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && p->sn != o.sn); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && p->sn == o.sn); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + + { + transaction t (db->begin ()); + db->update (o); + //db->update (o, o.s); // Error. + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn != o.sn); + t.commit (); + } + } + + // Test section with composite member. + // + { + using namespace test11; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->sc.s != o.sc.s && p->sc.v != o.sc.v); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.sc.s += 'd'; + o.sc.v[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); + t.commit (); + } + } + + // Test change state restoration on transaction rollback. + // + { + using namespace test12; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.s.change (); + + try + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + throw failed (); + } + catch (const failed&) + { + assert (o.s.changed ()); + } + + // Retry. Also test the object destruction before transaction + // termination case. + // + { + transaction t (db->begin ()); + { + object c (o); + db->update (c); + assert (!c.s.changed ()); + } + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + } + + // Test section accessor/modifier. + // + { + using namespace test13; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s ().loaded ()); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s ().loaded ()); + assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss); + + db->load (*p, p->rw_s ()); + + assert (p->s ().loaded ()); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->rw_s ()); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + + // Test detection of section copy. + // + try + { + transaction t (db->begin ()); + section c (o.s ()); + db->update (o, c); + assert (false); + } + catch (const section_not_in_object&) + { + } + } + + // Test LOB in section streaming, column re-ordering. + // + { + using namespace test14; + + object o (123, "\x01\x02\x03\x04\x05"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && p->sn != o.sn && p->sb != o.sb); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.sb.push_back ('\x06'); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.sb.push_back ('\x07'); + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && p->sn == o.sn && p->sb == o.sb); + t.commit (); + } + } + + // Test sections and optimistic concurrency. + // + { + using namespace test15; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update object. + // + object o1 (o); + o1.n++; + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->n == o1.n && + p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.n == o1.n && + o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); + t.commit (); + } + + // Update section. + // + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->update (o1, o1.s); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->n == o1.n && + p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.n == o1.n && + o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); + t.commit (); + } + + // Update changed section. + // + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o1, o1.s); + + try + { + db->update (o, o.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + db->update (o, o.s); + } + + t.commit (); + } + } + + // Test container-only sections and optimistic concurrency. + // + { + using namespace test16; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->sv == o.sv); + + t.commit (); + } + + // Update object. + // + object o1 (o); + o1.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.sv == o1.sv); + t.commit (); + } + + // Update section. + // + o1.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->update (o1, o1.s); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.sv == o1.sv); + t.commit (); + } + + // Update changed section. + // + o1.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o1, o1.s); + + try + { + db->update (o, o.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + db->update (o, o.s); + } + + t.commit (); + } + } + + // Test reuse-inheritance, sections, and optimistic concurrency. + // + { + using namespace test17; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->s1n != o.s1n && p->s2v != o.s2v); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1.loaded ()); + assert (p->s2.loaded ()); + assert (p->s1n == o.s1n && p->s2v == o.s2v); + + t.commit (); + } + + object o1 (o); + + // Update object. + // + for (unsigned short s (1); s < 3; ++s) + { + o1.s1n++; + o1.s2v[0]++; + + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + switch (s) + { + case 1: db->load (*p, p->s1); break; + case 2: db->load (*p, p->s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1n == o1.s1n && p->s2v == o1.s2v); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.s1n == o1.s1n && o.s2v == o1.s2v); + t.commit (); + } + + // Update section. + // + for (unsigned short s (1); s < 3; ++s) + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + switch (s) + { + case 1: + o1.s1n++; + db->update (o1, o1.s1); + assert (o.v != o1.v); + break; + case 2: + o1.s2v[0]++; + db->update (o1, o1.s2); + assert (o.v != o1.v); + break; + default: break; + } + + try + { + switch (s) + { + case 1: db->load (*p, p->s1); break; + case 2: db->load (*p, p->s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1n == o1.s1n && p->s2v == o1.s2v); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.s1n == o1.s1n && o.s2v == o1.s2v); + t.commit (); + } + + // Update changed section. + // + for (unsigned short s (1); s < 3; ++s) + { + transaction t (db->begin ()); + + switch (s) + { + case 1: + o1.s1n++; + db->update (o1, o1.s1); + break; + case 2: + o1.s2v[0]++; + db->update (o1, o1.s2); + break; + default: break; + } + + try + { + switch (s) + { + case 1: db->update (o, o.s1); break; + case 2: db->update (o, o.s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + + switch (s) + { + case 1: db->update (o, o.s1); break; + case 2: db->update (o, o.s2); break; + default: break; + } + } + + db->reload (o1); + + t.commit (); + } + } + + // Test change-updated section and change-tracking container. + // + { + using namespace test18; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->sn != o.sn && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->sn == o.sn && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.sn++; + o.sv.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); // Automatically marked as changed. + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->sn == o.sn && p->sv == o.sv); + t.commit (); + } + + // Test updating just the section manually. + // + o.sn++; + o.sv.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->sn == o.sn && p->sv == o.sv); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/section/basics/makefile b/common/section/basics/makefile new file mode 100644 index 0000000..f0484e8 --- /dev/null +++ b/common/section/basics/makefile @@ -0,0 +1,115 @@ +# file : common/section/basics/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_section_b_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx new file mode 100644 index 0000000..c129f3e --- /dev/null +++ b/common/section/basics/test.hxx @@ -0,0 +1,600 @@ +// file : common/section/basics/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +// Test lazy-loaded, always-updated section. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test lazy-loaded, change-updated section. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test lazy-loaded, manually-updated section. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(manual) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test eager-loaded, change-updated section. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db section(s) + int sn; + + #pragma db update(change) + odb::section s; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test eager-loaded, manually-updated section. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db section(s) + int sn; + + #pragma db update(manual) + odb::section s; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test value-only and container-only section. Also multiple sections +// in an object. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s1; + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s1) + int sn; + + #pragma db section(s1) + std::string ss; + + #pragma db section(s2) + std::vector sv; + }; +} + +// Test sections and reuse inheritance. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object abstract + struct base + { + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s1; // Empty section. + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + int sn2; + }; + + #pragma db object abstract + struct interm: base + { + // Section s1 is still empty. + + #pragma db section(s2) + std::string ss2; + }; + + #pragma db object + struct derived: interm + { + #pragma db section(s1) + int sn1; + }; + + #pragma db object + struct object: derived + { + object (int n = 999, const std::string& s = "xxx", bool b = false) + { + sn1 = sn2 = n; + ss1 = ss2 = s; + sb2 = b; + } + + #pragma db section(s1) + std::string ss1; + + #pragma db section(s2) + bool sb2; + }; +} + +// Test readonly and inverse section members. +// +#pragma db namespace table("t8_") +namespace test8 +{ + struct object1; + + #pragma db object session + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx", object1* p_ = 0) + : n (n_), sn (n_), ss (s_), sp (p_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) readonly + int sn; + + #pragma db section(s) + std::string ss; + + #pragma db inverse(p) section(s) + object1* sp; + }; + + #pragma db object session + struct object1 + { + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + + #pragma db id auto + unsigned long id; + + object* p; + }; +} + +// Test object without any columns to load or update. +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx"): sn (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(manual) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + std::string ss; + }; +} + +// Test section without any columns or containers to update. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object + struct object + { + object (int n_ = 999): n (n_), sn (n_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) readonly + int sn; + }; +} + +// Test section with composite member. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db value + struct comp + { + comp (int n_, const std::string& s_): s (s_) {v.push_back (n_);} + + std::string s; + std::vector v; + }; + + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), sc (n_, s_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + comp sc; + }; +} + +// Test change state restoration on transaction rollback. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + }; +} + +// Test section accessor/modifier. +// +#pragma db namespace table("t13_") +namespace test13 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db section(s_) + int sn; + + #pragma db section(s_) + std::string ss; + + public: + const odb::section& + s () const {return s_;} + + odb::section& + rw_s () {return s_;} + + private: + #pragma db load(lazy) update(manual) + odb::section s_; + }; +} + +// Test LOB in section streaming, column re-ordering. +// +#pragma db namespace table("t14_") +namespace test14 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sb (s_.begin (), s_.end ()), sn (n_), n (n_) {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) type(BLOB_TYPE) + std::vector sb; // Comes before sn. + + #pragma db section(s) + int sn; + + int n; + }; +} + +// Test sections and optimistic concurrency. +// +#pragma db namespace table("t15_") +namespace test15 +{ + #pragma db object optimistic + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test container-only sections and optimistic concurrency. +// +#pragma db namespace table("t16_") +namespace test16 +{ + #pragma db object optimistic + struct object + { + object (int n = 999) {sv.push_back (n);} + + #pragma db id auto + unsigned long id; + + #pragma db version // mssql:type("ROWVERSION") + unsigned long long v; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test reuse-inheritance, sections, and optimistic concurrency. +// +#pragma db namespace table("t17_") +namespace test17 +{ + #pragma db object optimistic sectionable abstract + struct root + { + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object + struct base: root + { + }; + + #pragma db object + struct object: base + { + object (int n = 999): s1n (n) {s2v.push_back (n);} + + #pragma db load(lazy) + odb::section s1; + + #pragma db section(s1) + int s1n; + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + std::vector s2v; + }; +} + +// Test change-updated section and change-tracking container. +// +#pragma db namespace table("t18_") +namespace test18 +{ + #pragma db object + struct object + { + object (int n = 999): sn (n) {sv.push_back (n);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + odb::vector sv; + }; +} + +#endif // TEST_HXX diff --git a/common/section/basics/test.std b/common/section/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx new file mode 100644 index 0000000..8c38035 --- /dev/null +++ b/common/section/polymorphism/driver.cxx @@ -0,0 +1,1763 @@ +// file : common/section/polymorphism/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test sections in polymorphic objects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test basic polymorphic section functionality. + // + { + using namespace test1; + + base b (123, "abc"); + derived d (234, "bcd", true); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.rs1.loaded ()); + assert (b.rs2.loaded ()); + assert (b.rs3.loaded ()); + assert (b.rs4.loaded ()); + assert (b.bs1.loaded ()); + + assert (d.rs1.loaded ()); + assert (d.rs2.loaded ()); + assert (d.rs3.loaded ()); + assert (d.rs4.loaded ()); + assert (d.bs1.loaded ()); + assert (d.ds1.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && + pb->rs2n != b.rs2n && pb->rs2v != b.rs2v && + pb->rs3v != b.rs3v && + pb->rs4n != b.rs4n && + pb->bs1n != b.bs1n); + + assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && + pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && + pd->rs2n != d.rs2n && pd->rs2v != d.rs2v && + pd->rs3v != d.rs3v && pd->rs3n != d.rs3n && + pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && + pd->bs1n != d.bs1n && pd->bs1s != d.bs1s && + pd->ds1n != d.ds1n); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + root* pr (pd.get ()); + db->load (*pr, pr->rs1); // Via base. + db->load (*pd, pd->rs2); + db->load (*pr, pr->rs3); // Via base. + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + try + { + db->load (*pr, pd->bs1); // Object-section association is static. + assert (false); + } + catch (const section_not_in_object&) {} + + assert (pb->rs1.loaded ()); + assert (pb->rs2.loaded ()); + assert (pb->rs3.loaded ()); + assert (pb->rs4.loaded ()); + assert (pb->bs1.loaded ()); + + assert (pd->rs1.loaded ()); + assert (pd->rs2.loaded ()); + assert (pd->rs3.loaded ()); + assert (pd->rs4.loaded ()); + assert (pd->bs1.loaded ()); + assert (pd->ds1.loaded ()); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Update object. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs1.change (); + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs1.change (); + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + + assert (!b.rs1.changed ()); + assert (!d.rs1.changed ()); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Update section. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + db->update (b, b.rs1); + db->update (b, b.rs2); + db->update (b, b.rs3); + db->update (b, b.rs4); + db->update (b, b.bs1); + + db->update (d, d.rs1); + db->update (d, d.rs2); + db->update (d, d.rs3); + db->update (d, d.rs4); + db->update (d, d.bs1); + db->update (d, d.ds1); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Reload. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs1.change (); + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs1.change (); + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + db->update (b); + db->update (d); + + db->reload (*pb); + db->reload (*pd); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + + t.commit (); + } + } + + // Test empty section and override "gap". + // + { + using namespace test2; + + derived d (234); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn && pd->sv != d.sv); + + root* pr (pd.get ()); + db->load (*pr, pr->s); // Via root. + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Update object. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + root* pr (&d); + db->update (pr); // Via root. + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + base* pb (pd.get ()); + db->load (*pb, pb->s); // Via base. + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Update section. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + root* pr (&d); + db->update (*pr, pr->s); // Via root. + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->load (*pd, pd->s); + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Reload. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->load (*pd, pd->s); + + db->update (d); + + root* pr (pd.get ()); + db->reload (*pr); + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + } + + // Test value-only/container-only base/override combinations. + // + { + using namespace test3; + + root r (123); + base b (234); + derived d (345, "abc"); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + + assert (r.s1.loaded ()); + assert (r.s2.loaded ()); + assert (r.s3.loaded ()); + assert (r.s4.loaded ()); + + assert (b.s1.loaded ()); + assert (b.s2.loaded ()); + assert (b.s3.loaded ()); + assert (b.s4.loaded ()); + + assert (d.s1.loaded ()); + assert (d.s2.loaded ()); + assert (d.s3.loaded ()); + assert (d.s4.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + assert (!pr->s1.loaded ()); + assert (!pr->s2.loaded ()); + assert (!pr->s3.loaded ()); + assert (!pr->s4.loaded ()); + + assert (!pb->s1.loaded ()); + assert (!pb->s2.loaded ()); + assert (!pb->s3.loaded ()); + assert (!pb->s4.loaded ()); + + assert (!pd->s1.loaded ()); + assert (!pd->s2.loaded ()); + assert (!pd->s3.loaded ()); + assert (!pd->s4.loaded ()); + + assert (pr->s1n != r.s1n && + pr->s2n != r.s2n && + pr->s3v != r.s3v && + pr->s4nv != r.s4nv); + + assert (pb->s1n != b.s1n && + pb->s2n != b.s2n && + pb->s3v != b.s3v && + pb->s4nv != b.s4nv); + + assert (pd->s1n != d.s1n && pd->s1s != d.s1s && + pd->s2n != d.s2n && pd->s2v != d.s2v && + pd->s3v != d.s3v && pd->s3n != d.s3n && + pd->s4nv != d.s4nv && pd->s4sv != d.s4sv); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + root* pdr (pd.get ()); + db->load (*pdr, pdr->s1); + db->load (*pdr, pdr->s2); + db->load (*pdr, pdr->s3); + db->load (*pdr, pdr->s4); + + assert (pr->s1.loaded ()); + assert (pr->s2.loaded ()); + assert (pr->s3.loaded ()); + assert (pr->s4.loaded ()); + + assert (pb->s1.loaded ()); + assert (pb->s2.loaded ()); + assert (pb->s3.loaded ()); + assert (pb->s4.loaded ()); + + assert (pd->s1.loaded ()); + assert (pd->s2.loaded ()); + assert (pd->s3.loaded ()); + assert (pd->s4.loaded ()); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Update object. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + db->update (r); + db->update (b); + db->update (d); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Update section. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + db->update (r, r.s1); + db->update (r, r.s2); + db->update (r, r.s3); + db->update (r, r.s4); + + db->update (b, b.s1); + db->update (b, b.s2); + db->update (b, b.s3); + db->update (b, b.s4); + + root& rr (d); + db->update (rr, rr.s1); + db->update (rr, rr.s2); + db->update (rr, rr.s3); + db->update (rr, rr.s4); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Reload. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + auto_ptr pr (db->load (r.id)); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + db->update (r); + db->update (b); + db->update (d); + + db->reload (*pr); + db->reload (*pb); + db->reload (*pd); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + } + + // Test basic polymorphic optimistic section functionality. + // + { + using namespace test4; + + base b (123, "abc"); + derived d (234, "bcd", true); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.rs1.loaded ()); + assert (b.rs2.loaded ()); + assert (b.rs3.loaded ()); + assert (b.rs4.loaded ()); + assert (b.bs1.loaded ()); + + assert (d.rs1.loaded ()); + assert (d.rs2.loaded ()); + assert (d.rs3.loaded ()); + assert (d.rs4.loaded ()); + assert (d.bs1.loaded ()); + assert (d.ds1.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && + pb->rs2n != b.rs2n && + pb->rs3n != b.rs3n && + pb->rs4n != b.rs4n && pb->rs4s != b.rs4s); + + assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && + pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && + pd->rs2n != d.rs2n && + pd->rs3n != d.rs3n && pd->rs3s != d.rs3s && + pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && + pd->rs4v != d.rs4v && + pd->bs1n != d.bs1n && + pd->ds1v != d.ds1v); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + root* pr (pd.get ()); + db->load (*pr, pr->rs1); // Via base. + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pr, pr->rs4); // Via base. + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1.loaded ()); + assert (pb->rs2.loaded ()); + assert (pb->rs3.loaded ()); + assert (pb->rs4.loaded ()); + assert (pb->bs1.loaded ()); + + assert (pd->rs1.loaded ()); + assert (pd->rs2.loaded ()); + assert (pd->rs3.loaded ()); + assert (pd->rs4.loaded ()); + assert (pd->bs1.loaded ()); + assert (pd->ds1.loaded ()); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && + pb->rs3n == b.rs3n && + pb->rs4n == b.rs4n && pb->rs4s == b.rs4s); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && + pd->rs3n == d.rs3n && pd->rs3s == d.rs3s && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->rs4v == d.rs4v && + pd->bs1n == d.bs1n && + pd->ds1v == d.ds1v); + t.commit (); + } + + base b1 (b); + derived d1 (d); + + // Update object. + // + for (unsigned short s (1); s < 7; ++s) + { + b1.rs1n++; + b1.rs1s += 'd'; + b1.rs1.change (); + b1.rs4s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + d1.rs1.change (); + d1.rs4s += 'e'; + d1.rs4v[0]++; + d1.bs1n++; + d1.ds1v[0]++; + + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + db->update (b1); + db->update (d1); + + assert (!b1.rs1.changed ()); + assert (!d1.rs1.changed ()); + + assert (b.v != b1.v); + assert (d.v != d1.v); + + try + { + bool a (false); + switch (s) + { + case 1: db->load (*pb, pb->rs1); break; + case 2: db->load (*pb, pb->rs2); break; + case 3: db->load (*pb, pb->rs3); break; + case 4: db->load (*pb, pb->rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (*pb); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->bs1.loaded ()); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && + pb->rs2n == b1.rs2n && + pb->rs3n == b1.rs3n && + pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); + } + + try + { + switch (s) + { + case 1: db->load (*pd, pd->rs1); break; + case 2: db->load (*pd, pd->rs2); break; + case 3: db->load (*pd, pd->rs3); break; + case 4: db->load (*pd, pd->rs4); break; + case 5: db->load (*pd, pd->bs1); break; + case 6: db->load (*pd, pd->ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && + pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && + pd->rs2n == d1.rs2n && + pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && + pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && + pd->rs4v == d1.rs4v && + pd->bs1n == d1.bs1n && + pd->ds1v == d1.ds1v); + } + + db->reload (b); + db->reload (d); + + assert (b.v == b1.v); + assert (d.v == d1.v); + + assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && + b.rs2n == b1.rs2n && + b.rs3n == b1.rs3n && + b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); + + assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && + d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && + d.rs2n == d1.rs2n && + d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && + d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && + d.rs4v == d1.rs4v && + d.bs1n == d1.bs1n && + d.ds1v == d1.ds1v); + + t.commit (); + } + + // Update section. + // + for (unsigned short s (1); s < 7; ++s) + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + switch (s) + { + case 1: + b1.rs1n++; + b1.rs1s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + + db->update (b1, b1.rs1); + db->update (d1, d1.rs1); + + assert (b.v != b1.v); + assert (d.v != d1.v); + break; + case 2: + db->update (b1, b1.rs2); // No-op. + db->update (d1, d1.rs2); // No-op. + + assert (b.v == b1.v); + assert (d.v == d1.v); + continue; // Object hasn't changed. + case 3: + db->update (b1, b1.rs3); // No-op. + db->update (d1, d1.rs3); // No-op. + + assert (b.v == b1.v); + assert (d.v == d1.v); + continue; // Object hasn't changed. + case 4: + b1.rs4s += 'd'; + + d1.rs4s += 'e'; + d1.rs4v[0]++; + + db->update (b1, b1.rs4); + db->update (d1, d1.rs4); + + assert (b.v != b1.v); + assert (d.v != d1.v); + break; + case 5: + d1.bs1n++; + + db->update (b1, b1.bs1); // No-op. + db->update (d1, d1.bs1); + + assert (b.v == b1.v); + assert (d.v != d1.v); + break; + case 6: + d1.ds1v[0]++; + + db->update (d1, d1.ds1); + + assert (d.v != d1.v); + break; + default: break; + } + + try + { + bool a (false); + switch (s) + { + case 1: db->load (*pb, pb->rs1); break; + case 4: db->load (*pb, pb->rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (*pb); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && + pb->rs2n == b1.rs2n && + pb->rs3n == b1.rs3n && + pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); + } + + try + { + switch (s) + { + case 1: db->load (*pd, pd->rs1); break; + case 4: db->load (*pd, pd->rs4); break; + case 5: db->load (*pd, pd->bs1); break; + case 6: db->load (*pd, pd->ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && + pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && + pd->rs2n == d1.rs2n && + pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && + pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && + pd->rs4v == d1.rs4v && + pd->bs1n == d1.bs1n && + pd->ds1v == d1.ds1v); + } + + db->reload (b); + db->reload (d); + + assert (b.v == b1.v); + assert (d.v == d1.v); + + assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && + b.rs2n == b1.rs2n && + b.rs3n == b1.rs3n && + b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); + + assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && + d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && + d.rs2n == d1.rs2n && + d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && + d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && + d.rs4v == d1.rs4v && + d.bs1n == d1.bs1n && + d.ds1v == d1.ds1v); + + t.commit (); + } + + // Update changed section. + // + for (unsigned short s (1); s < 7; ++s) + { + if (s == 2 || s == 3) // Readonly sections. + continue; + + transaction t (db->begin ()); + + switch (s) + { + case 1: + b1.rs1n++; + b1.rs1s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + + db->update (b1, b1.rs1); + db->update (d1, d1.rs1); + break; + case 4: + b1.rs4s += 'd'; + + d1.rs4s += 'e'; + d1.rs4v[0]++; + + db->update (b1, b1.rs4); + db->update (d1, d1.rs4); + break; + case 5: + d1.bs1n++; + + db->update (b1, b1.bs1); // No-op. + db->update (d1, d1.bs1); + break; + case 6: + d1.ds1v[0]++; + + db->update (d1, d1.bs1); + break; + default: break; + } + + try + { + bool a (false); + switch (s) + { + case 1: db->update (b, b.rs1); break; + case 4: db->update (b, b.rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (b); + + switch (s) + { + case 1: db->update (b, b.rs1); break; + case 4: db->update (b, b.rs4); break; + default: break; + } + } + + try + { + switch (s) + { + case 1: db->update (d, d.rs1); break; + case 4: db->update (d, d.rs4); break; + case 5: db->update (d, d.bs1); break; + case 6: db->update (d, d.ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + + switch (s) + { + case 1: db->update (d, d.rs1); break; + case 4: db->update (d, d.rs4); break; + case 5: db->update (d, d.bs1); break; + case 6: db->update (d, d.ds1); break; + default: break; + } + } + + db->reload (b1); + db->reload (d1); + + t.commit (); + } + } + + // Test polymorphic optimistic readonly/empty to readwrite section + // override. + // + { + using namespace test5; + + base b; + derived d (123); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.s.loaded ()); + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + assert (!pb->s.loaded ()); + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pb, pb->s); // No-op. + db->load (*pd, pd->s); + + assert (pb->s.loaded ()); + assert (pd->s.loaded ()); + + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + base b1 (b); + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (b1, b1.s); // No-op. + db->update (d1, d1.s); + + assert (b.v == b1.v); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test polymorphic optimistic readonly/empty to readwrite section + // override, eager-loaded case. + // + { + using namespace test6; + + derived d (123); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + + db->update (d1, d1.s); + assert (d.v != d1.v); + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test polymorphic optimistic section added in derived. + // + { + using namespace test7; + + base b; + derived d (123); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.s.loaded ()); + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pb (db->load (b.id)); + auto_ptr pd (db->load (d.id)); + + assert (!pb->s.loaded ()); + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pb, pb->s); // No-op. + db->load (*pd, pd->s); + + assert (pb->s.loaded ()); + assert (pd->s.loaded ()); + + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + base b1 (b); + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (b1, b1.s); // No-op. + db->update (d1, d1.s); + + assert (b.v == b1.v); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test reuse/polymorphic inheritance and optimistic mix. + // + { + using namespace test8; + + derived d (123); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pd, pd->s); + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + auto_ptr pd (db->load (d.id)); + + db->update (d1, d1.s); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile new file mode 100644 index 0000000..deb13dc --- /dev/null +++ b/common/section/polymorphism/makefile @@ -0,0 +1,115 @@ +# file : common/section/polymorphism/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_section_p_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx new file mode 100644 index 0000000..f2081c2 --- /dev/null +++ b/common/section/polymorphism/test.hxx @@ -0,0 +1,495 @@ +// file : common/section/polymorphism/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include + +// Test basic polymorphic section functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic abstract + struct root + { + root (int n): rs1n (n), rs2n (n), rs4n (n) {rs2v.push_back (n);} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + // rs1: override in base and derived + // + #pragma db load(lazy) update(change) + odb::section rs1; + + #pragma db section(rs1) + int rs1n; + + // rs2: no override + // + #pragma db load(lazy) + odb::section rs2; + + #pragma db section(rs2) + int rs2n; + + #pragma db section(rs2) + std::vector rs2v; + + // rs3: empty + // + #pragma db load(lazy) + odb::section rs3; + + // rs4: override "gap" + // + #pragma db load(lazy) + odb::section rs4; + + #pragma db section(rs4) + int rs4n; + }; + + #pragma db object + struct base: root + { + base (int n = 999, const std::string& s = "xxx") + : root (n), rs1s (s), bs1n (n) {rs3v.push_back (n);} + + // rs1 + // + #pragma db section(rs1) + std::string rs1s; + + // rs3 + // + #pragma db section(rs3) + std::vector rs3v; + + // bs1: override in derived + // + #pragma db load(lazy) + odb::section bs1; + + #pragma db section(bs1) + int bs1n; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx", bool b = false) + : base (n, s), rs1b (b), rs3n (n), rs4s (s), bs1s (s), ds1n (n) + {rs1v.push_back (n);} + + // rs1 + // + #pragma db section(rs1) + bool rs1b; + + #pragma db section(rs1) + std::vector rs1v; + + // rs3 + // + #pragma db section(rs3) + int rs3n; + + // rs4 + // + #pragma db section(rs4) + std::string rs4s; + + // bs1 + // + #pragma db section(bs1) + std::string bs1s; + + // ds1: no override + // + #pragma db load(lazy) + odb::section ds1; + + #pragma db section(ds1) + int ds1n; + }; +} + +// Test empty section and override "gap". +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object polymorphic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s; + }; + + #pragma db object abstract + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {sv.push_back (n);} + + #pragma db section(s) + int sn; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test value-only/container-only base/override combinations. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + root (int n = 999) + : s1n (n), s2n (n) {s3v.push_back (n); s4nv.push_back (n);} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + // value/value + // + #pragma db load(lazy) + odb::section s1; + + #pragma db section(s1) + int s1n; + + // value/container + // + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + int s2n; + + // container/value + // + #pragma db load(lazy) + odb::section s3; + + #pragma db section(s3) + std::vector s3v; + + // container/container + // + #pragma db load(lazy) + odb::section s4; + + #pragma db section(s4) + std::vector s4nv; + }; + + #pragma db object + struct base: root + { + base (int n = 999): root (n) {} + + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx") + : base (n), s1s (s), s3n (n) {s2v.push_back (n); s4sv.push_back (s);} + + #pragma db section(s1) + std::string s1s; + + #pragma db section(s2) + std::vector s2v; + + #pragma db section(s3) + int s3n; + + #pragma db section(s4) + std::vector s4sv; + }; +} + +// Test basic polymorphic optimistic section functionality. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic optimistic abstract sectionable + struct root + { + root (int n): rs1n (n), rs2n (n), rs3n (n), rs4n (n) {} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + // rs1: readwrite, override + // + #pragma db load(lazy) update(change) + odb::section rs1; + + #pragma db section(rs1) + int rs1n; + + // rs2: readonly, no override + // + #pragma db load(lazy) + odb::section rs2; + + #pragma db section(rs2) + const int rs2n; + + // rs3: readonly, readonly override + // + #pragma db load(lazy) + odb::section rs3; + + #pragma db section(rs3) + const int rs3n; + + // rs4: readonly, readwrite override + // + #pragma db load(lazy) + odb::section rs4; + + #pragma db section(rs4) + const int rs4n; + }; + + #pragma db object + struct base: root + { + base (int n = 999, const std::string& s = "xxx") + : root (n), rs1s (s), rs4s (s) {} + + // rs1 + // + #pragma db section(rs1) + std::string rs1s; + + // rs4 + // + #pragma db section(rs4) + std::string rs4s; + + // bs2: empty, readwrite override + // + #pragma db load(lazy) + odb::section bs1; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx", bool b = false) + : base (n, s), rs1b (b), rs3s (s), bs1n (n) + { + rs1v.push_back (n); + rs4v.push_back (n); + ds1v.push_back (n); + } + + // rs1 + // + #pragma db section(rs1) + bool rs1b; + + #pragma db section(rs1) + std::vector rs1v; + + // rs3 + // + #pragma db section(rs3) + const std::string rs3s; + + // rs4 + // + #pragma db section(rs4) + std::vector rs4v; + + // bs1 + // + #pragma db section(bs1) + int bs1n; + + // ds1: readwrite + // + #pragma db load(lazy) + odb::section ds1; + + #pragma db section(ds1) + std::vector ds1v; + }; +} + +// Test polymorphic optimistic readonly/empty to readwrite section override. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + #pragma db load(lazy) update(change) + odb::section s; + }; + + #pragma db object + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test polymorphic optimistic readonly/empty to readwrite section override, +// eager-loaded case. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic optimistic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + #pragma db update(change) + odb::section s; + }; + + #pragma db object abstract + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test polymorphic optimistic section added in derived. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object polymorphic optimistic sectionable + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object + struct base: root + { + #pragma db load(lazy) update(change) + odb::section s; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test reuse/polymorphic inheritance and optimistic mix. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object optimistic sectionable abstract + struct root + { + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object polymorphic sectionable + struct base: root + { + virtual ~base () {} + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + }; +} + +#endif // TEST_HXX diff --git a/common/section/polymorphism/test.std b/common/section/polymorphism/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From e8b23f12981a754757c49471f4e4a2376368909b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Sep 2013 14:40:50 +0200 Subject: Handle SQLite commit failures that don't automatically rollback transaction --- sqlite/makefile | 1 + sqlite/transaction/driver.cxx | 60 ++++++++++++++++++++++++ sqlite/transaction/makefile | 105 ++++++++++++++++++++++++++++++++++++++++++ sqlite/transaction/test.hxx | 27 +++++++++++ sqlite/transaction/test.std | 0 5 files changed, 193 insertions(+) create mode 100644 sqlite/transaction/driver.cxx create mode 100644 sqlite/transaction/makefile create mode 100644 sqlite/transaction/test.hxx create mode 100644 sqlite/transaction/test.std diff --git a/sqlite/makefile b/sqlite/makefile index 7348436..ebc9cde 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -9,6 +9,7 @@ template \ custom \ database \ native \ +transaction \ truncation \ types diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx new file mode 100644 index 0000000..a70e1fd --- /dev/null +++ b/sqlite/transaction/driver.cxx @@ -0,0 +1,60 @@ +// file : sqlite/transaction/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test esoteric SQLite transaction semantics aspects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + // In SQLite, when a commit fails because of the deferred foreign + // key constraint violation, the transaction is not automatically + // rolled back. Make sure we compensate for that. + // + try + { + object o; + o.p = odb::lazy_ptr (*db, 0); + + transaction t (db->begin ()); + db->persist(o); + t.commit (); + } + catch (const odb::exception&) + { + } + + // Make sure we can start a new transaction. + // + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile new file mode 100644 index 0000000..21d1c7d --- /dev/null +++ b/sqlite/transaction/makefile @@ -0,0 +1,105 @@ +# file : sqlite/transaction/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-schema --table-prefix sqlitex_transaction_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + +# Test. +# +$(eval $(call test-schemaless-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx new file mode 100644 index 0000000..ae47107 --- /dev/null +++ b/sqlite/transaction/test.hxx @@ -0,0 +1,27 @@ +// file : sqlite/transaction/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object1 +{ + #pragma db id + unsigned long id_; +}; + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + odb::lazy_ptr p; +}; + +#endif // TEST_HXX diff --git a/sqlite/transaction/test.std b/sqlite/transaction/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 82466170040f5ccdfbeaf88e1d450add7b866f4b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Aug 2013 10:57:32 +0200 Subject: Implement soft delete for persistent classes --- evolution/drop-table/driver.cxx | 2 +- evolution/drop-table/model.hxx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 1eca664..0a005b5 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -70,7 +70,7 @@ main (int argc, char* argv[]) } case 2: { - using namespace v2; // @@ v3; soft immediate drop + using namespace v3; if (embedded) { diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index f5bbd9e..64022bb 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -29,8 +29,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::string str; }; -#if MODEL_VERSION == 2 +#if MODEL_VERSION > 1 #pragma db object +#if MODEL_VERSION == 3 + #pragma db deleted(3) +#endif struct object1 { object1 (): o (0) {} -- cgit v1.1 From 7417ee383bc5fb69d90253414446a8b5eff79ecb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Aug 2013 08:23:02 +0200 Subject: Add support for statement processing --- common/makefile | 1 + common/statement/processing/driver.cxx | 613 +++++++++++++++++++++++++++++++++ common/statement/processing/makefile | 85 +++++ common/statement/processing/test.std | 0 4 files changed, 699 insertions(+) create mode 100644 common/statement/processing/driver.cxx create mode 100644 common/statement/processing/makefile create mode 100644 common/statement/processing/test.std diff --git a/common/makefile b/common/makefile index 3263410..1ad2389 100644 --- a/common/makefile +++ b/common/makefile @@ -46,6 +46,7 @@ schema/embedded/order \ section/basics \ section/polymorphism \ session/cache \ +statement/processing \ template \ transaction/basics \ transaction/callback \ diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx new file mode 100644 index 0000000..34def73 --- /dev/null +++ b/common/statement/processing/driver.cxx @@ -0,0 +1,613 @@ +// file : common/statement/processing/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test internal statement processing machinery. +// + +#include +#include +#include + +#include + +using namespace std; + +static bool +insert (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_insert ( + stmt, bind, bind_size, sizeof (void*), '$', r); + return r == expected; +} + +static bool +update (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_update ( + stmt, bind, bind_size, sizeof (void*), '$', r); + return r == expected; +} + +static bool +select (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_select ( + stmt, bind, bind_size, sizeof (void*), '[', ']', true, r); + return r == expected; +} + +int +main (int, char* argv[]) +{ + // + // INSERT + // + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "VALUES\n" + "(DEFAULT,\n$1)", + "INSERT INTO [foo] ([a], [b]) VALUES (DEFAULT, $1)", + b, 2)); + } + + // Empty via statement. + // + /* LIBODB_DEBUG_STATEMENT_PROCESSING + { + assert (insert ("INSERT INTO [foo]\n" + "DEFAULT VALUES", + "INSERT INTO [foo] DEFAULT VALUES", + 0, 0)); + } + */ + + // Empty via bind. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a])\n" + "VALUES\n" + "($1)", + "INSERT INTO [foo] DEFAULT VALUES", + b, 1)); + } + + // Empty with OUTPUT. + // + { + void* b[] = {0, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "OUTPUT INSERTED.[id]\n" + "VALUES\n" + "($1,\n$2)", + "INSERT INTO [foo] OUTPUT INSERTED.[id] DEFAULT VALUES", + b, 2)); + } + + // Empty with RETURNING. + // + { + void* b[] = {0, 0, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$1,\n$2)\n" + "RETURNING [id]", + "INSERT INTO [foo] DEFAULT VALUES RETURNING [id]", + b, 3)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "VALUES\n" + "(1,\n$1)", + "INSERT INTO [foo] ([a]) VALUES (1)", + b, 1)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "(1,\n$1,\nDEFAULT)", + "INSERT INTO [foo] ([a], [c]) VALUES (1, DEFAULT)", + b, 1)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([b], [c]) VALUES ($2, $3)", + b, 3)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [b]) VALUES ($1, $2)", + b, 3)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3)", + b, 3)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c],\n[d],\n[e])\n" + "VALUES\n" + "($1,\n$2,\n$3,\n$4,\n$5)", + "INSERT INTO [foo] ([b], [d]) VALUES ($2, $4)", + b, 5)); + } + + // Not present and OUTPUT. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "OUTPUT INSERTED.[id]\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [c]) OUTPUT INSERTED.[id] " + "VALUES ($1, $3)", + b, 3)); + } + + // Not present and RETURNING. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)\n" + "RETURNING [id]", + "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3) " + "RETURNING [id]", + b, 3)); + } + + // Value expressions. + // + { + void* b[] = {argv, argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\nCAST($2, TEXT),\n$3)", + "INSERT INTO [foo] ([a], [b], [c]) " + "VALUES ($1, CAST($2, TEXT), $3)", + b, 3)); + } + + // + // UPDATE + // + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "ver=ver+1,\n[a]=$1\n" + "WHERE [id]=$2", + "UPDATE [foo] SET ver=ver+1, [a]=$1 WHERE [id]=$2", + b, 2)); + } + + // Empty via statement. + // + { + void* b[] = {argv}; + assert (update ("UPDATE [foo]\n" + "WHERE [id]=$1", + "UPDATE [foo] WHERE [id]=$1", + b, 1)); + } + + // Empty via bind. + // + { + void* b[] = {0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1\n" + "WHERE [id]=$2", + "UPDATE [foo] WHERE [id]=$2", + b, 2)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "ver=ver+1,\n[a]=$1\n" + "WHERE [id]=$2", + "UPDATE [foo] SET ver=ver+1 WHERE [id]=$2", + b, 2)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [b]=$2, [c]=$3 WHERE [id]=$4", + b, 4)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [b]=$2 WHERE [id]=$4", + b, 4)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [c]=$3 WHERE [id]=$4", + b, 4)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3,\n" + "[d]=$4\n" + "WHERE [id]=$5", + "UPDATE [foo] SET [b]=$2, [d]=$4 WHERE [id]=$5", + b, 5)); + } + + // Not present and OUTPUT. + // + { + void* b[] = {argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "OUTPUT INSERTED.[ver] " + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [c]=$3 OUTPUT INSERTED.[ver] " + "WHERE [id]=$4", + b, 4)); + } + + // Value expressions. + // + { + void* b[] = {argv, argv, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=CAST($2, TEXT),\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [b]=CAST($2, TEXT), [c]=$3 " + "WHERE [id]=$4", + b, 4)); + } + + // No OUTPUT/WHERE clause. + // + { + void* b[] = {argv, 0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3", + "UPDATE [foo] SET [a]=$1, [c]=$3", + b, 4)); + } + + // + // SELECT + // + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (select ("SELECT\n" + "[s].[t].[x],\n" + "[a].[y]\n" + "FROM [s].[t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id]\n" + "WHERE [s].[t].[id]=$1", + "SELECT [s].[t].[x], [a].[y] FROM [s].[t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id] " + "WHERE [s].[t].[id]=$1", + b, 2)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv}; + assert (select ("SELECT\n" + "[a].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[y], [t].[z] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[t].[y],\n" + "[a].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [t].[y] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [t].[z] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv}; + assert (select ("SELECT\n" + "[a1].[w],\n" + "[t].[x],\n" + "[a2].[y],\n" + "[a3].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a1] ON [a1].[id]=[t].[id]\n" + "LEFT JOIN [t2] AS [a2] ON [a2].[id]=[t].[id]\n" + "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [a3].[z] FROM [t] " + "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 4)); + } + + // Column expression. + // + { + void* b[] = {argv, argv, 0}; + assert (select ("SELECT\n" + "[t].[x],\n" + "CAST([a].[y], TEXT),\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], CAST([a].[y], TEXT) FROM [t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // No WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]", + "SELECT [t].[x], [t].[z] FROM [t]", + b, 3)); + } + + // JOIN without WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]", + "SELECT [t].[x], [t].[z] FROM [t]", + b, 3)); + } + + // JOIN presence because of WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1 AND [a].[id]=$2", + "SELECT [t].[x], [t].[z] FROM [t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " + "WHERE [t].[id]=$1 AND [a].[id]=$2", + b, 3)); + } + + + // JOIN presence because of dependent JOIN. + // + { + void* b[] = {argv, argv, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a_b].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id]\n" + "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [a_b].[y], [t].[z] FROM [t] " + "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id] " + "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // JOIN without alias and with schema. + // + { + void* b[] = {argv, argv, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[s].[t1].[y],\n" + "[t2].[z]\n" + "FROM [t]\n" + "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id]\n" + "LEFT JOIN [t2] ON [t2].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [s].[t1].[y], [t2].[z] FROM [t] " + "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id] " + "LEFT JOIN [t2] ON [t2].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // JOIN alias top-level qualifer test. + // + { + void* b[] = {argv, 0}; + assert (select ("SELECT\n" + "[s].[a].[x],\n" + "[a].[y]\n" + "FROM [s].[a]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[a].[id]\n" + "WHERE [s].[a].[id]=$1", + "SELECT [s].[a].[x] FROM [s].[a] WHERE [s].[a].[id]=$1", + b, 2)); + } + + // JOIN alias bottom-level qualifer test (FROM case). + // + { + void* b[] = {argv, 0}; + assert (select ("SELECT\n" + "[a].[t].[x],\n" + "[a].[y]\n" + "FROM [a].[t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[a].[t].[id]\n" + "WHERE [a].[t].[id]=$1", + "SELECT [a].[t].[x] FROM [a].[t] WHERE [a].[t].[id]=$1", + b, 2)); + } + + // JOIN alias bottom-level qualifer test (LEFT JOIN case). + // + { + void* b[] = {0, argv}; + assert (select ("SELECT\n" + "[a].[y],\n" + "[a].[t2].[x]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [a].[t2].[x] FROM [t] " + "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 2)); + } +} diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile new file mode 100644 index 0000000..48ecf1d --- /dev/null +++ b/common/statement/processing/makefile @@ -0,0 +1,85 @@ +# file : common/statement/processing/makefile +# copyright : Copyright (c) 2009-2013 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) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) + +$(dist): sources := $(cxx_tun) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-schemaless-rule)) +else +$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/statement/processing/test.std b/common/statement/processing/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From aa12a6286a51c21cbae51ff1d880d10fc6f4e617 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 28 Aug 2013 07:52:50 +0200 Subject: Support for added and deleted data member pragmas --- evolution/embedded/driver.cxx | 2 +- evolution/version/driver.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 964af16..ef274ee 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -129,7 +129,7 @@ main (int argc, char* argv[]) // Test the case where there is still no version table. // - db->schema_version (0, false); + db->schema_version_migration (0, false); { transaction t (db->begin ()); diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index d69e195..81ce4cf 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -127,7 +127,7 @@ main (int argc, char* argv[]) // Test the case where there is still no version table. // - db->schema_version (0, false); + db->schema_version_migration (0, false); { transaction t (db->begin ()); -- cgit v1.1 From 179eb696191958bae891916eec2708c4d3e34983 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Sep 2013 09:22:39 +0200 Subject: Fix UPDATE statement for smart containers with read-only value members Here we have to include them (think what happens when we erase an element somewhere in the middle of a container). --- common/container/change-tracking/driver.cxx | 28 ++++++++++++++++++++++++ common/container/change-tracking/test.hxx | 33 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index 78f7a7f..9baf6a2 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -699,6 +699,34 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test read-only values. + { + ro_object o (1); + o.v.push_back (ro_value (1, 1)); + o.v.push_back (ro_value (2, 2)); + o.v.push_back (ro_value (3, 3)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.v.erase (o.v.begin ()); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->load (1)->v == o.v); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 6281322..edbff0a 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -78,4 +78,37 @@ struct inv_object2 odb::vector o1; }; +// Test read-only values (we still need to include them in the UPDATE +// statement). +// +#pragma db value +struct ro_value +{ + ro_value (int i_ = 0, int j_ = 0): i (i_), j (j_) {} + + #pragma db readonly + int i; + + #pragma db readonly + int j; +}; + +inline bool +operator== (const ro_value& x, const ro_value& y) +{ + return x.i == y.i && x.j == y.j; +} + +#pragma db object +struct ro_object +{ + ro_object () {} + ro_object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector v; +}; + #endif // TEST_HXX -- cgit v1.1 From d3689b6cd0b01ea4872cefbe99dbaef95febd64d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Sep 2013 12:49:15 +0200 Subject: Handling of dynamic empty statements as result of versioning --- common/statement/processing/driver.cxx | 17 +- common/view/test.hxx | 2 +- evolution/drop-column/driver.cxx | 3 +- evolution/drop-column/model.hxx | 11 +- evolution/makefile | 1 + evolution/soft-delete/driver.cxx | 339 +++++++++++++++++++++++++++++++++ evolution/soft-delete/makefile | 143 ++++++++++++++ evolution/soft-delete/model.hxx | 123 ++++++++++++ evolution/soft-delete/test1.hxx | 10 + evolution/soft-delete/test2.hxx | 12 ++ evolution/soft-delete/test3.hxx | 12 ++ 11 files changed, 669 insertions(+), 4 deletions(-) create mode 100644 evolution/soft-delete/driver.cxx create mode 100644 evolution/soft-delete/makefile create mode 100644 evolution/soft-delete/model.hxx create mode 100644 evolution/soft-delete/test1.hxx create mode 100644 evolution/soft-delete/test2.hxx create mode 100644 evolution/soft-delete/test3.hxx diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 34def73..99a9be9 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -264,7 +264,7 @@ main (int, char* argv[]) "SET\n" "[a]=$1\n" "WHERE [id]=$2", - "UPDATE [foo] WHERE [id]=$2", + "", b, 2)); } @@ -385,6 +385,21 @@ main (int, char* argv[]) // SELECT // + // Empty. + // + { + void* b[] = {0, 0, 0}; + assert (select ("SELECT\n" + "[a].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "", + b, 3)); + } + // Fast path. // { diff --git a/common/view/test.hxx b/common/view/test.hxx index f9bc8e8..e543466 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -394,7 +394,7 @@ struct view6b #ifndef ODB_DATABASE_ORACLE # pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "ee.object_id = e.name") + table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") #else # pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 099fe0f..4078c58 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -70,7 +70,7 @@ main (int argc, char* argv[]) } case 2: { - using namespace v2; // @@ soft delete + using namespace v3; if (embedded) { @@ -108,6 +108,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); auto_ptr p (db->load (1)); + assert (p->str == ""); t.commit (); } break; diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index 42a8f54..feff041 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -31,9 +31,18 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) // SQLite doesn't support dropping of columns. // #ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 +#if MODEL_VERSION >= 2 + +#if MODEL_VERSION == 3 + #pragma db deleted(3) +#endif std::string str; + +#if MODEL_VERSION == 3 + #pragma db deleted(3) +#endif unsigned long num; + #endif #endif }; diff --git a/evolution/makefile b/evolution/makefile index 0b24422..b58efb2 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -16,6 +16,7 @@ add-index \ drop-index \ combined \ embedded \ +soft-delete \ version \ data \ template diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx new file mode 100644 index 0000000..8577819 --- /dev/null +++ b/evolution/soft-delete/driver.cxx @@ -0,0 +1,339 @@ +// file : evolution/soft-delete/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test soft-delete functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + // Test soft-deleted objects. + // + { + using namespace test1; + + object o (1); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + +#endif // DATABASE_SQLITE + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Test soft-deleted objects. + // + { + using namespace test1; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123); + t.commit (); + } + } + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + // All the database operations should still include the deleted + // member + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + +#endif // DATABASE_SQLITE + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Test soft-deleted objects. + // + { + using namespace test1; + + try + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); // No such table. + assert (false); + } + catch (const odb::exception&) {} + } + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + // Now none of the database operations should include the + // deleted member. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test empty statement handling (INSERT, UPDATE). + // + { + using namespace test3; + + // Now none of the database operations should include the + // deleted member. + // + object o; + o.str = "bcd"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + o.str += 'e'; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + { + using namespace test4; + + // Now none of the database operations should include the + // deleted member. + // + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (1)); + assert (static_cast (*p).str == ""); + t.commit (); + } + } + +#endif // DATABASE_SQLITE + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile new file mode 100644 index 0000000..da284c7 --- /dev/null +++ b/evolution/soft-delete/makefile @@ -0,0 +1,143 @@ +# file : evolution/soft-delete/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.hxx test3.hxx +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --generate-query \ +--generate-schema --at-once --table-prefix evo_soft_d_ +$(gen): odb_common_options += --database $(db_id) +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure testN.hxx are compiled serially since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen3): $(gen2) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test3.sql) + $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) + # Migration. + $(call schema,$(out_base)/test3-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) + $(call schema,$(out_base)/test3-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx new file mode 100644 index 0000000..1690583 --- /dev/null +++ b/evolution/soft-delete/model.hxx @@ -0,0 +1,123 @@ +// file : evolution/soft-delete/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#include // DATABASE_XXX + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + // Test soft-deleted objects. + // + #pragma db namespace table("t1_") + namespace test1 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db object(object) deleted(3) +#endif + } + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + + // Test basic soft-deleted member logic. + // + #pragma db namespace table("t2_") + namespace test2 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test empty statement handling (INSERT, UPDATE). + // + #pragma db namespace table("t3_") + namespace test3 + { + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + #pragma db namespace table("t4_") + namespace test4 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + +#endif // DATABASE_SQLITE + +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx new file mode 100644 index 0000000..5bd4729 --- /dev/null +++ b/evolution/soft-delete/test1.hxx @@ -0,0 +1,10 @@ +// file : evolution/soft-delete/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx new file mode 100644 index 0000000..b1886cb --- /dev/null +++ b/evolution/soft-delete/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/soft-delete/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx new file mode 100644 index 0000000..00ac7ca --- /dev/null +++ b/evolution/soft-delete/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/soft-delete/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX -- cgit v1.1 From a53a1dc7361ac340d7942e5b41d72cb918ead2a7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Sep 2013 12:57:25 +0200 Subject: Container versioning support --- evolution/soft-delete/driver.cxx | 262 +++++++++++++++++++++++++++++++++++++-- evolution/soft-delete/model.hxx | 56 ++++++++- 2 files changed, 306 insertions(+), 12 deletions(-) diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 8577819..23f0c9b 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -80,6 +80,22 @@ main (int argc, char* argv[]) object o (1); o.str = "abc"; o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + object o (1); + o.vec.push_back (value ("abc", 123)); { transaction t (db->begin ()); @@ -89,6 +105,23 @@ main (int argc, char* argv[]) } #endif // DATABASE_SQLITE + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + object o (1); + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + break; } case 2: @@ -125,12 +158,12 @@ main (int argc, char* argv[]) using namespace test2; // All the database operations should still include the deleted - // member + // members. // { transaction t (db->begin ()); auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); t.commit (); } @@ -141,30 +174,77 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::str == "abc")); result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); + assert (i != r.end () && + i->str == "abc" && i->num == 123 && i->vec[0] == 123); t.commit (); } object o (2); o.str = "bcd"; o.num = 234; + o.vec.push_back (234); { transaction t (db->begin ()); db->persist (o); auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); t.commit (); } o.str += 'e'; o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; { transaction t (db->begin ()); db->update (o); auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235); + assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); t.commit (); } @@ -177,6 +257,62 @@ main (int argc, char* argv[]) #endif // DATABASE_SQLITE + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + if (embedded) { transaction t (db->begin ()); @@ -213,12 +349,12 @@ main (int argc, char* argv[]) using namespace test2; // Now none of the database operations should include the - // deleted member. + // deleted members. // { transaction t (db->begin ()); auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); t.commit (); } @@ -229,7 +365,8 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::num == 123)); result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); + assert (i != r.end () && + i->str == "" && i->num == 123 && i->vec.empty ()); try { @@ -244,29 +381,31 @@ main (int argc, char* argv[]) object o (2); o.str = "bcd"; o.num = 234; + o.vec.push_back (234); { transaction t (db->begin ()); db->persist (o); auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); t.commit (); } o.str += 'e'; o.num++; + o.vec.modify (0)++; { transaction t (db->begin ()); db->update (o); auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); t.commit (); } { transaction t (db->begin ()); - db->erase (o); + db->erase (2); t.commit (); } } @@ -321,7 +460,108 @@ main (int argc, char* argv[]) } } + // Test container with soft-deleted value member. + // + { + using namespace test5; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + #endif // DATABASE_SQLITE + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + break; } default: diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 1690583..78a4cfe 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -9,7 +9,7 @@ #include #include -#include +#include #include // DATABASE_XXX @@ -60,10 +60,12 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::string str; unsigned long num; + odb::vector vec; }; #if MODEL_VERSION == 3 #pragma db member(object::str) deleted(3) + #pragma db member(object::vec) deleted(3) #endif } @@ -115,8 +117,60 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test container with soft-deleted value member. + // + #pragma db namespace table("t5_") + namespace test5 + { + #pragma db value + struct value + { + value () {} + value (const std::string& s, unsigned long n): str (s), num (n) {} + + std::string str; + unsigned long num; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) deleted(3) +#endif + } + #endif // DATABASE_SQLITE + // Test soft-deleted container member in a non-versioned object. + // + #pragma db namespace table("t21_") + namespace test21 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) deleted(3) +#endif + } } #undef MODEL_NAMESPACE -- cgit v1.1 From 59293cddb0d37a2bf37e579aa42da00fc9cfc5dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Sep 2013 13:40:31 +0200 Subject: View versioning support --- evolution/soft-delete/driver.cxx | 64 ++++++++++++++++++++++++++++++++++++++++ evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 30 +++++++++++++++++++ 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 23f0c9b..d0debce 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -104,6 +104,22 @@ main (int argc, char* argv[]) } } + // Test view with soft-deleted member. + // + { + using namespace test6; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -255,6 +271,26 @@ main (int argc, char* argv[]) } } + // Test view with soft-deleted member. + // + { + using namespace test6; + + // All the database operations should still include the deleted + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -504,6 +540,34 @@ main (int argc, char* argv[]) } } + // Test view with soft-deleted member. + // + { + using namespace test6; + + // Now none of the database operations should include the + // deleted members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index da284c7..12d02a3 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -36,7 +36,7 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ +$(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ --generate-schema --at-once --table-prefix evo_soft_d_ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 78a4cfe..6abdd39 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -148,6 +148,36 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test view with soft-deleted member. + // + #pragma db namespace table("t6_") + namespace test6 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + }; + + #pragma db view object(object) + struct view + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(view::str) deleted(3) +#endif + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. -- cgit v1.1 From 2c3dcfeee4fd2adb5a7dbd9af1c8ee02d4664d39 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 5 Sep 2013 13:02:10 +0200 Subject: Versioned section support --- common/statement/processing/driver.cxx | 10 - evolution/soft-delete/driver.cxx | 442 +++++++++++++++++++++++++++++++++ evolution/soft-delete/model.hxx | 91 +++++++ 3 files changed, 533 insertions(+), 10 deletions(-) diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 99a9be9..2064315 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -246,16 +246,6 @@ main (int, char* argv[]) b, 2)); } - // Empty via statement. - // - { - void* b[] = {argv}; - assert (update ("UPDATE [foo]\n" - "WHERE [id]=$1", - "UPDATE [foo] WHERE [id]=$1", - b, 1)); - } - // Empty via bind. // { diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index d0debce..b81cca0 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -120,6 +120,40 @@ main (int argc, char* argv[]) } } + // Test soft-deleted section member. + // + { + using namespace test7; + + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -138,6 +172,22 @@ main (int argc, char* argv[]) } } + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + object o (1); + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + break; } case 2: @@ -291,6 +341,132 @@ main (int argc, char* argv[]) } } + // Test soft-deleted section member. + // + { + using namespace test7; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -349,6 +525,67 @@ main (int argc, char* argv[]) } } + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // Automatically marks section as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + if (embedded) { transaction t (db->begin ()); @@ -568,6 +805,139 @@ main (int argc, char* argv[]) } } + // Test soft-deleted section member. + // + { + using namespace test7; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "" && i->num == 123 && i->vec.empty ()); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // No longer automatically marked as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -626,6 +996,78 @@ main (int argc, char* argv[]) } } + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // No longer automatically marks as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + break; } default: diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 6abdd39..5defcac 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -10,6 +10,7 @@ #include #include +#include #include // DATABASE_XXX @@ -178,6 +179,68 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test soft-deleted section member. + // + #pragma db namespace table("t7_") + namespace test7 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string str; + + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::s) deleted(3) +#endif + } + + // Test soft-deleted members of a section. + // + #pragma db namespace table("t8_") + namespace test8 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string str; + + #pragma db section(s) + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(object::vec) deleted(3) +#endif + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -201,6 +264,34 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db member(object::vec) deleted(3) #endif } + + // Test soft-deleted container member in a non-versioned section. + // + #pragma db namespace table("t22_") + namespace test22 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) deleted(3) +#endif + } } #undef MODEL_NAMESPACE -- cgit v1.1 From a204ad2d0926919fb19d4f14a2d2c0a5e98acd37 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Sep 2013 08:59:19 +0200 Subject: Additional soft-delete tests --- evolution/soft-delete/driver.cxx | 1132 ++++++++++++++++++++++++++++++++------ evolution/soft-delete/model.hxx | 174 +++++- 2 files changed, 1130 insertions(+), 176 deletions(-) diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index b81cca0..7acf6e1 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -81,10 +81,13 @@ main (int argc, char* argv[]) o.str = "abc"; o.num = 123; o.vec.push_back (123); + o.ptr = new object1 (1); + o.ptr->ptrs.push_back (&o); { transaction t (db->begin ()); db->persist (o); + db->persist (*o.ptr); t.commit (); } } @@ -154,6 +157,98 @@ main (int argc, char* argv[]) } } + // Test basic soft-deleted member logic in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test9; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted section member in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test10; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted members of a section in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test11; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted member and optimistic concurrency. + // + { + using namespace test12; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted member in an object without id. + // + { + using namespace test13; + + object o; + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -229,7 +324,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); t.commit (); } @@ -238,10 +334,12 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::str == "abc")); + result r (db->query (query::str == "abc" && + query::ptr->id == 1)); result::iterator i (r.begin ()); assert (i != r.end () && - i->str == "abc" && i->num == 123 && i->vec[0] == 123); + i->str == "abc" && i->num == 123 && + i->vec[0] == 123 && i->ptr->id_ == 1); t.commit (); } @@ -249,24 +347,32 @@ main (int argc, char* argv[]) o.str = "bcd"; o.num = 234; o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); { transaction t (db->begin ()); db->persist (o); + db->persist (*o.ptr); auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + assert (p->str == "bcd" && p->num == 234 && + p->vec[0] == 234 && p->ptr->id_ == 2); t.commit (); } o.str += 'e'; o.num++; o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; { transaction t (db->begin ()); + db->erase (2); db->update (o); auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + assert (p->str == "bcde" && p->num == 235 && + p->vec[0] == 235 && p->ptr == 0); t.commit (); } @@ -467,355 +573,877 @@ main (int argc, char* argv[]) } } -#endif // DATABASE_SQLITE - - // Test soft-deleted container member in a non-versioned object. + // Test basic soft-deleted member logic in polymorphic classes. // { - using namespace test21; + using namespace test9; // All the database operations should still include the deleted // members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec[0] == 123); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); t.commit (); } { - typedef odb::query query; - typedef odb::result result; + typedef odb::query query; + typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::num == 123)); + result r (db->query (query::bstr == "ab")); result::iterator i (r.begin ()); - assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); t.commit (); } object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; o.num = 234; - o.vec.push_back (234); { transaction t (db->begin ()); - db->persist (o); + db->persist (static_cast (o)); auto_ptr p (db->load (2)); - assert (p->num == 234 && p->vec[0] == 234); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); t.commit (); } + o.bstr += 'd'; + o.dstr += 'e'; o.num++; - o.vec.modify (0)++; { transaction t (db->begin ()); - db->update (o); + db->update (static_cast (o)); auto_ptr p (db->load (2)); - assert (p->num == 235 && p->vec[0] == 235); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); t.commit (); } { transaction t (db->begin ()); - db->erase (o); + db->erase (static_cast (o)); t.commit (); } } - // Test soft-deleted container member in a non-versioned section. + // Test soft-deleted section member in polymorphic classes. // { - using namespace test22; + using namespace test10; // All the database operations should still include the deleted // members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); + auto_ptr p (db->load (1)); db->load (*p, p->s); - assert (p->num == 123 && p->vec[0] == 123); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); t.commit (); } { - typedef odb::query query; - typedef odb::result result; + typedef odb::query query; + typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::num == 123)); + result r (db->query (query::bstr == "ab")); result::iterator i (r.begin ()); assert (i != r.end ()); db->load (*i, i->s); - assert (i->num == 123 && i->vec[0] == 123); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); t.commit (); } object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; o.num = 234; - o.vec.push_back (234); { transaction t (db->begin ()); - db->persist (o); + db->persist (static_cast (o)); auto_ptr p (db->load (2)); db->load (*p, p->s); - assert (p->num == 234 && p->vec[0] == 234); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); t.commit (); } + o.bstr += 'd'; + o.dstr += 'e'; o.num++; - o.vec.modify (0)++; // Automatically marks section as changed. + o.s.change (); { transaction t (db->begin ()); - db->update (o); + db->update (static_cast (o)); auto_ptr p (db->load (2)); db->load (*p, p->s); - assert (p->num == 235 && p->vec[0] == 235); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); t.commit (); } { transaction t (db->begin ()); - db->erase (o); + db->erase (static_cast (o)); t.commit (); } } - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - // Test soft-deleted objects. - // - { - using namespace test1; - - try - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); // No such table. - assert (false); - } - catch (const odb::exception&) {} - } - - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE - - // Test basic soft-deleted member logic. + // Test soft-deleted members of a section in polymorphic classes. // { - using namespace test2; + using namespace test11; - // Now none of the database operations should include the - // deleted members. + // All the database operations should still include the deleted + // members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123 && p->vec.empty ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); t.commit (); } { - typedef odb::query query; - typedef odb::result result; + typedef odb::query query; + typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::num == 123)); + result r (db->query (query::bstr == "ab")); result::iterator i (r.begin ()); - assert (i != r.end () && - i->str == "" && i->num == 123 && i->vec.empty ()); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); t.commit (); } object o (2); - o.str = "bcd"; + o.bstr = "bc"; + o.dstr = "bcd"; o.num = 234; - o.vec.push_back (234); { transaction t (db->begin ()); - db->persist (o); + db->persist (static_cast (o)); auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); t.commit (); } - o.str += 'e'; + o.bstr += 'd'; + o.dstr += 'e'; o.num++; - o.vec.modify (0)++; + o.s.change (); { transaction t (db->begin ()); - db->update (o); + db->update (static_cast (o)); auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235 && p->vec.empty ()); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); t.commit (); } { transaction t (db->begin ()); - db->erase (2); + db->erase (static_cast (o)); t.commit (); } } - // Test empty statement handling (INSERT, UPDATE). + // Test soft-deleted member and optimistic concurrency. // { - using namespace test3; + using namespace test12; - // Now none of the database operations should include the - // deleted member. + // All the database operations should still include the deleted + // members. // - object o; + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o (2); o.str = "bcd"; + o.num = 234; { transaction t (db->begin ()); db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234); t.commit (); } o.str += 'e'; + o.num++; { transaction t (db->begin ()); + unsigned long long v (o.v_); db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); t.commit (); } - } - - // Test empty statement handling (SELECT in polymorphic loader). - // - { - using namespace test4; - - // Now none of the database operations should include the - // deleted member. - // - object o (1); - o.str = "abc"; { transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (1)); - assert (static_cast (*p).str == ""); + db->erase (o); t.commit (); } } - // Test container with soft-deleted value member. + // Test soft-deleted member in an object without id. // { - using namespace test5; + using namespace test13; - // Now none of the database operations should include the - // deleted members. + typedef odb::query query; + typedef odb::result result; + + // All the database operations should still include the deleted + // members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "" && p->vec[0].num == 123); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); t.commit (); } - object o (2); - o.vec.push_back (value ("bcd", 234)); + object o; + o.str = "bcd"; + o.num = 234; { transaction t (db->begin ()); db->persist (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 234); - t.commit (); - } - o.vec.modify (0).str += 'e'; - o.vec.modify (0).num++; + result r (db->query (query::str == "bcd")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "bcd" && i->num == 234); - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 235); t.commit (); } { transaction t (db->begin ()); - db->erase (2); + db->erase_query (query::str == "bcd"); t.commit (); } } - // Test view with soft-deleted member. - // +#endif // DATABASE_SQLITE + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // Automatically marks section as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Test soft-deleted objects. + // + { + using namespace test1; + + try + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); // No such table. + assert (false); + } + catch (const odb::exception&) {} + } + + // SQLite doesn't support dropping of columns. + // +#ifndef DATABASE_SQLITE + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "" && i->num == 123 && + i->vec.empty () && i->ptr == 0); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test empty statement handling (INSERT, UPDATE). + // + { + using namespace test3; + + // Now none of the database operations should include the + // deleted member. + // + object o; + o.str = "bcd"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + o.str += 'e'; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + { + using namespace test4; + + // Now none of the database operations should include the + // deleted member. + // + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (1)); + assert (static_cast (*p).str == ""); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test view with soft-deleted member. + // + { + using namespace test6; + + // Now none of the database operations should include the + // deleted members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + } + + // Test soft-deleted section member. + // + { + using namespace test7; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "" && i->num == 123 && i->vec.empty ()); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // No longer automatically marked as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test basic soft-deleted member logic in polymorphic classes. + // { - using namespace test6; + using namespace test9; // Now none of the database operations should include the // deleted members. // { - typedef odb::query query; - typedef odb::result result; + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "" && p->dstr == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::num == 123)); + result r (db->query (query::id == 1)); result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); try { - db->query (query::str == "abc"); // No such column. + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + try + { + db->query (query::dstr == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} t.commit (); } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } } - // Test soft-deleted section member. + // Test soft-deleted section member in polymorphic classes. // { - using namespace test7; + using namespace test10; // Now none of the database operations should include the // deleted members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); + auto_ptr p (db->load (1)); try { @@ -828,47 +1456,70 @@ main (int argc, char* argv[]) } object o (2); - o.str = "bcd"; + o.bstr = "bc"; + o.dstr = "bcd"; o.num = 234; - o.vec.push_back (234); { transaction t (db->begin ()); - db->persist (o); + db->persist (static_cast (o)); t.commit (); } - o.str += 'e'; + o.bstr += 'd'; + o.dstr += 'e'; o.num++; - o.vec.modify (0)++; o.s.change (); { transaction t (db->begin ()); - db->update (o); + db->update (static_cast (o)); t.commit (); } { transaction t (db->begin ()); - db->erase (2); + db->erase (2); t.commit (); } } - // Test soft-deleted members of a section. + // Test soft-deleted members of a section in polymorphic classes. // { - using namespace test8; + using namespace test11; // Now none of the database operations should include the // deleted members. // { transaction t (db->begin ()); - auto_ptr p (db->load (1)); + auto_ptr p (db->load (1)); db->load (*p, p->s); - assert (p->str == "" && p->num == 123 && p->vec.empty ()); + object& o (static_cast (*p)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + t.commit (); } @@ -879,13 +1530,13 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query (query::num == 123)); result::iterator i (r.begin ()); - assert (i != r.end ()); db->load (*i, i->s); - assert (i->str == "" && i->num == 123 && i->vec.empty ()); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); try { - db->query (query::str == "abc"); // No such column. + db->query (query::dstr == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} @@ -894,40 +1545,122 @@ main (int argc, char* argv[]) } object o (2); - o.str = "bcd"; + o.bstr = "bc"; + o.dstr = "bcd"; o.num = 234; - o.vec.push_back (234); { transaction t (db->begin ()); - db->persist (o); + db->persist (static_cast (o)); auto_ptr p (db->load (2)); db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); t.commit (); } - o.str += 'e'; + o.bstr += 'd'; + o.dstr += 'e'; o.num++; - o.vec.modify (0)++; // No longer automatically marked as changed. + o.s.change (); { transaction t (db->begin ()); - db->update (o); + db->update (static_cast (o)); auto_ptr p (db->load (2)); db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); t.commit (); } - o.s.change (); + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + + // Test empty statement detection in sections. + // + base b (3); + b.bstr = "bc"; + + { + transaction t (db->begin ()); + db->persist (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + b.bstr += 'd'; + b.s.change (); + + { + transaction t (db->begin ()); + db->update (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + } + + // Test soft-deleted member and optimistic concurrency. + // + { + using namespace test12; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; { transaction t (db->begin ()); + unsigned long long v (o.v_); db->update (o); + assert (o.v_ != v); auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 235 && p->vec.empty ()); + assert (p->str == "" && p->num == 235 && p->v_ == o.v_); t.commit (); } @@ -938,6 +1671,55 @@ main (int argc, char* argv[]) } } + // Test soft-deleted member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::num == 234)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::num == 234); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 5defcac..5df2cee 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -11,6 +11,7 @@ #include #include #include +#include #include // DATABASE_XXX @@ -51,10 +52,24 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db namespace table("t2_") namespace test2 { + struct object; + + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector > ptrs; + }; + #pragma db object struct object { - object (unsigned long id = 0): id_ (id) {} + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} #pragma db id unsigned long id_; @@ -62,11 +77,15 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::string str; unsigned long num; odb::vector vec; + + #pragma db inverse(ptrs) + object1* ptr; }; #if MODEL_VERSION == 3 #pragma db member(object::str) deleted(3) #pragma db member(object::vec) deleted(3) + #pragma db member(object::ptr) deleted(3) #endif } @@ -241,6 +260,159 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test basic soft-deleted member logic in polymorphic classes. + // + #pragma db namespace table("t9_") + namespace test9 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) deleted(3) + #pragma db member(object::dstr) deleted(3) +#endif + } + + // Test soft-deleted section member in polymorphic classes. + // + #pragma db namespace table("t10_") + namespace test10 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + #pragma db section(s) + std::string dstr; + + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::s) deleted(3) +#endif + } + + // Test soft-deleted members of a section in polymorphic classes. + // + #pragma db namespace table("t11_") + namespace test11 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + #pragma db section(s) + std::string dstr; + + #pragma db section(s) + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) deleted(3) + #pragma db member(object::dstr) deleted(3) +#endif + } + + // Test soft-deleted member and optimistic concurrency. + // + #pragma db namespace table("t12_") + namespace test12 + { + #pragma db object optimistic + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v_; + + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test soft-deleted member in an object without id. + // + #pragma db namespace table("t13_") + namespace test13 + { + #pragma db object no_id + struct object + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. -- cgit v1.1 From a4ebbfe92e3974413410a142d66174d89b7be738 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Sep 2013 13:15:22 +0200 Subject: Add soft-add test --- evolution/makefile | 1 + evolution/soft-add/driver.cxx | 2047 +++++++++++++++++++++++++++++++++++++++++ evolution/soft-add/makefile | 143 +++ evolution/soft-add/model.hxx | 478 ++++++++++ evolution/soft-add/test1.hxx | 10 + evolution/soft-add/test2.hxx | 12 + evolution/soft-add/test3.hxx | 12 + 7 files changed, 2703 insertions(+) create mode 100644 evolution/soft-add/driver.cxx create mode 100644 evolution/soft-add/makefile create mode 100644 evolution/soft-add/model.hxx create mode 100644 evolution/soft-add/test1.hxx create mode 100644 evolution/soft-add/test2.hxx create mode 100644 evolution/soft-add/test3.hxx diff --git a/evolution/makefile b/evolution/makefile index b58efb2..bbe0650 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -16,6 +16,7 @@ add-index \ drop-index \ combined \ embedded \ +soft-add \ soft-delete \ version \ data \ diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx new file mode 100644 index 0000000..4703a8a --- /dev/null +++ b/evolution/soft-add/driver.cxx @@ -0,0 +1,2047 @@ +// file : evolution/soft-add/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test soft-add functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v3; // NOTE: not v2. + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::drop_schema (*db, "2"); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + o.ptr = new object1 (1); + o.ptr->ptrs.push_back (&o); + + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "" && i->num == 123 && + i->vec.empty () && i->ptr == 0); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test empty statement handling (INSERT, UPDATE). + // + { + using namespace test3; + + // None of the database operations should yet include the + // added members. + // + object o; + o.str = "bcd"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + o.str += 'e'; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + { + using namespace test4; + + // None of the database operations should yet include the + // added members. + // + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (1)); + assert (static_cast (*p).str == ""); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.vec.push_back (value ("abc", 123)); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "" && i->num == 123 && i->vec.empty ()); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // No longer automatically marked as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "" && p->dstr == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + + // Test empty statement detection in sections. + // + base b (3); + b.bstr = "bc"; + + { + transaction t (db->begin ()); + db->persist (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + b.bstr += 'd'; + b.s.change (); + + { + transaction t (db->begin ()); + db->update (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (b); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // None of the database operations should yet include the + // added members. + // + { + object o; + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::num == 234)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::num == 234); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // No longer automatically marks as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + p->vec.push_back (123); + p->ptr = new object1 (1); + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc" && + query::ptr->id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "abc" && i->num == 123 && + i->vec[0] == 123 && i->ptr->id_ == 1); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234 && + p->vec[0] == 234 && p->ptr->id_ == 2); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && + p->vec[0] == 235 && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->vec.modify (0).str = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + db->update (*p); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->str = "abc"; + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->str = "abc"; + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::str == "bcd")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "bcd" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::str == "bcd"); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->vec.push_back (123); + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // Automatically marks section as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // All the database operations should still include the added + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile new file mode 100644 index 0000000..87a8aa9 --- /dev/null +++ b/evolution/soft-add/makefile @@ -0,0 +1,143 @@ +# file : evolution/soft-add/makefile +# copyright : Copyright (c) 2009-2013 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 := test1.hxx test2.hxx test3.hxx +genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx +gen1 := $(addprefix $(out_base)/,$(genf1)) +genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx +gen2 := $(addprefix $(out_base)/,$(genf2)) +genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx +gen3 := $(addprefix $(out_base)/,$(genf3)) +genf := $(genf1) $(genf2) $(genf3) +gen := $(gen1) $(gen2) $(gen3) +gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ +test3-003-pre.sql test3-003-post.sql +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ +--generate-schema --at-once --table-prefix evo_soft_a_ +$(gen): odb_common_options += --database $(db_id) +$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog +$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ +--schema-name 2 --suppress-migration +$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create +$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml +$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml +$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Make sure testN.hxx are compiled serially since they share the +# changelog. Also add dependency on model.hxx +# +$(gen2): $(gen1) +$(gen3): $(gen2) +$(gen): $(src_base)/model.hxx + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) + +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): export extra_headers := model.hxx +$(dist): export name := $(name) +$(dist): export extra_dist := $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(extra_headers)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +$(test): $(driver) + # Drop everything. + $(call schema,$(out_base)/test3.sql) + $(call schema,$(out_base)/test2.sql) + $(call schema,$(out_base)/test1.sql) + # Base schema. + $(call schema,$(out_base)/test3-002-pre.sql) + $(call schema,$(out_base)/test3-002-post.sql) + $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) + # Migration. + $(call schema,$(out_base)/test3-003-pre.sql) + $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) + $(call schema,$(out_base)/test3-003-post.sql) + # Current schema. + $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/model.xml) # Changelog. + $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx new file mode 100644 index 0000000..1a7520a --- /dev/null +++ b/evolution/soft-add/model.hxx @@ -0,0 +1,478 @@ +// file : evolution/soft-add/model.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + // The test numbers are made to correspond to the soft-delete ones. + // + + // Test basic soft-added member logic. + // + #pragma db namespace table("t2_") + namespace test2 + { + struct object; + + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector > ptrs; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + odb::vector vec; + + #pragma db inverse(ptrs) + object1* ptr; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) + #pragma db member(object::vec) added(3) + #pragma db member(object::ptr) added(3) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient + #pragma db member(object::ptr) transient +#endif + } + + // Test empty statement handling (INSERT, UPDATE). + // + #pragma db namespace table("t3_") + namespace test3 + { + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + #pragma db namespace table("t4_") + namespace test4 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test container with soft-added value member. + // + #pragma db namespace table("t5_") + namespace test5 + { + #pragma db value + struct value + { + value () {} + value (const std::string& s, unsigned long n): str (s), num (n) {} + + std::string str; + unsigned long num; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) added(3) +#else + #pragma db member(value::str) transient +#endif + } + + // Test view with soft-added member. + // + #pragma db namespace table("t6_") + namespace test6 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + }; + + #pragma db view object(object) + struct view + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) + #pragma db member(view::str) added(3) +#else + #pragma db member(object::str) transient + #pragma db member(view::str) transient +#endif + } + + // Test soft-added section member. + // + #pragma db namespace table("t7_") + namespace test7 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db load(lazy) update(change) added(3) + odb::section s; +#endif + + #pragma db section(s) + std::string str; + + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) section(s) + #pragma db member(object::vec) section(s) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient +#endif + } + + // Test soft-added members of a section. + // + #pragma db namespace table("t8_") + namespace test8 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + std::string str; + + #pragma db section(s) + unsigned long num; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) section(s) + #pragma db member(object::vec) added(3) section(s) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient +#endif + } + + // Test basic soft-added member logic in polymorphic classes. + // + #pragma db namespace table("t9_") + namespace test9 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) added(3) + #pragma db member(object::dstr) added(3) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added section member in polymorphic classes. + // + #pragma db namespace table("t10_") + namespace test10 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db load(lazy) update(change) added(3) + odb::section s; +#endif + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) section(s) + #pragma db member(object::dstr) section(s) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added members of a section in polymorphic classes. + // + #pragma db namespace table("t11_") + namespace test11 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + + #pragma db section(s) + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) added(3) section(s) + #pragma db member(object::dstr) added(3) section(s) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added member and optimistic concurrency. + // + #pragma db namespace table("t12_") + namespace test12 + { + #pragma db object optimistic + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v_; + + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added member in an object without id. + // + #pragma db namespace table("t13_") + namespace test13 + { + #pragma db object no_id + struct object + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) default("abc") +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added container member in a non-versioned object. + // + #pragma db namespace table("t21_") + namespace test21 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) added(3) +#else + #pragma db member(object::vec) transient +#endif + } + + // Test soft-added container member in a non-versioned section. + // + #pragma db namespace table("t22_") + namespace test22 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + unsigned long num; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) added(3) section(s) +#else + #pragma db member(object::vec) transient +#endif + } +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx new file mode 100644 index 0000000..2619325 --- /dev/null +++ b/evolution/soft-add/test1.hxx @@ -0,0 +1,10 @@ +// file : evolution/soft-add/test1.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx new file mode 100644 index 0000000..7b65fdb --- /dev/null +++ b/evolution/soft-add/test2.hxx @@ -0,0 +1,12 @@ +// file : evolution/soft-add/test2.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx new file mode 100644 index 0000000..a3a34ab --- /dev/null +++ b/evolution/soft-add/test3.hxx @@ -0,0 +1,12 @@ +// file : evolution/soft-add/test3.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX -- cgit v1.1 From 22415f5ec7d53fbad4818ac31a42d6e623b8afa9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Sep 2013 14:02:24 +0200 Subject: Provide quoted versions of view statement --- common/view/test.hxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/common/view/test.hxx b/common/view/test.hxx index e543466..ae30e25 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -391,14 +391,22 @@ struct view6b // The same using tables. // -#ifndef ODB_DATABASE_ORACLE -# pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") -#else -# pragma db view table("t_view_person" = "p") \ +#if defined(ODB_DATABASE_ORACLE) +#pragma db view table("t_view_person" = "p") \ table("t_view_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ table("t_view_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") +#elif defined(ODB_DATABASE_MSSQL) +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "[ee].[object_id] = e.name") +#elif defined(ODB_DATABASE_MYSQL) +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "`ee`.`object_id` = e.name") +#else +#pragma db view table("t_view_person" = "p") \ + table("t_view_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") #endif struct view6c { -- cgit v1.1 From 86a83893351adef44574514c303aa880cf3b6d54 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Sep 2013 14:03:21 +0200 Subject: Add soft-add/delete auto id test, LOB/long data test --- evolution/soft-add/driver.cxx | 168 ++++++++++++++++++++++++++++++++++++++- evolution/soft-add/model.hxx | 31 +++++++- evolution/soft-delete/driver.cxx | 140 ++++++++++++++++++++++++++++++++ evolution/soft-delete/model.hxx | 20 +++++ 4 files changed, 355 insertions(+), 4 deletions(-) diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 4703a8a..190cc0c 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -96,7 +96,7 @@ main (int argc, char* argv[]) try { - db->query (query::str == "abc"); // No such column. + db->query (query::str.is_null ()); // No such column. assert (false); } catch (const odb::exception&) {} @@ -881,6 +881,81 @@ main (int argc, char* argv[]) } } + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + // None of the database operations should yet include the + // added members. + // + unsigned long id; + { + object o; + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + id = o.id; + t.commit (); + } + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o.id); + t.commit (); + } + } + // Test soft-added container member in a non-versioned object. // { @@ -1055,6 +1130,7 @@ main (int argc, char* argv[]) auto_ptr p (db->load (1)); p->str = "abc"; p->vec.push_back (123); + delete p->ptr; p->ptr = new object1 (1); db->update (*p); t.commit (); @@ -1073,7 +1149,7 @@ main (int argc, char* argv[]) typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::str == "abc" && + result r (db->query (query::str.is_not_null () && query::ptr->id == 1)); result::iterator i (r.begin ()); assert (i != r.end () && @@ -1676,6 +1752,74 @@ main (int argc, char* argv[]) } } + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should now include the added + // members. + // + unsigned long id; + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + i->str = "abc"; + db->update (*i); + id = i->id; + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + // Test soft-added container member in a non-versioned object. // { @@ -1997,6 +2141,26 @@ main (int argc, char* argv[]) } } + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + // All the database operations should still include the added + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + // Test soft-added container member in a non-versioned object. // { diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index 1a7520a..50a7639 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -59,7 +59,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) }; #if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) + // Make it a LOB for Oracle and long data for SQL Server. + // + #pragma db member(object::str) added(3) \ + oracle:type("CLOB") \ + mssql:type("VARCHAR(max)") #pragma db member(object::vec) added(3) #pragma db member(object::ptr) added(3) #else @@ -414,7 +418,30 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) }; #if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) default("abc") + #pragma db member(object::str) added(3) default("abc") \ + mysql:type("VARCHAR(255)") +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added member in an object with auto id. + // + #pragma db namespace table("t14_") + namespace test14 + { + #pragma db object + struct object + { + std::string str; + unsigned long num; + + #pragma db id auto + unsigned long id; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) #else #pragma db member(object::str) transient #endif diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 7acf6e1..a5e9927 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -249,6 +249,22 @@ main (int argc, char* argv[]) } } + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + object o; + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -864,6 +880,64 @@ main (int argc, char* argv[]) } } + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + // All the database operations should still include the deleted + // members. + // + unsigned long id; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + id = i->id; + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. @@ -1720,6 +1794,72 @@ main (int argc, char* argv[]) } } + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + // Now none of the database operations should include the + // deleted members. + // + unsigned long id; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + id = i->id; + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o.id); + t.commit (); + } + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 5df2cee..ef5bc68 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -413,6 +413,26 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test soft-deleted member in an object with auto id. + // + #pragma db namespace table("t14_") + namespace test14 + { + #pragma db object + struct object + { + std::string str; + unsigned long num; + + #pragma db id auto + unsigned long id; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + #endif // DATABASE_SQLITE // Test soft-deleted container member in a non-versioned object. -- cgit v1.1 From 8803508751837d96fd0beff60c952fb2044d073f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 15 Sep 2013 12:46:09 +0200 Subject: Cleanup polymorphic base tables when dropping derived one --- common/changelog/add-table-mssql-diff.xml | 2 +- common/changelog/add-table-mssql-patch.xml | 2 +- common/changelog/add-table-mysql-diff.xml | 2 +- common/changelog/add-table-mysql-patch.xml | 2 +- common/changelog/add-table-oracle-diff.xml | 2 +- common/changelog/add-table-oracle-patch.xml | 2 +- common/changelog/add-table-pgsql-diff.xml | 2 +- common/changelog/add-table-pgsql-patch.xml | 2 +- common/changelog/add-table-sqlite-diff.xml | 2 +- common/changelog/add-table-sqlite-patch.xml | 2 +- common/changelog/drop-table-mssql-diff.xml | 2 +- common/changelog/drop-table-mysql-diff.xml | 2 +- common/changelog/drop-table-oracle-diff.xml | 2 +- common/changelog/drop-table-pgsql-diff.xml | 2 +- common/changelog/drop-table-sqlite-diff.xml | 2 +- common/changelog/model-mssql.xml | 2 +- common/changelog/model-mysql.xml | 2 +- common/changelog/model-oracle.xml | 2 +- common/changelog/model-pgsql.xml | 2 +- common/changelog/model-sqlite.xml | 2 +- evolution/drop-table/driver.cxx | 58 +++++++++++++++++++++++------ evolution/drop-table/model.hxx | 51 +++++++++++++++++++++++-- 22 files changed, 113 insertions(+), 36 deletions(-) diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml index 1173f1e..5468cc9 100644 --- a/common/changelog/add-table-mssql-diff.xml +++ b/common/changelog/add-table-mssql-diff.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml index 55ac287..1b62efc 100644 --- a/common/changelog/add-table-mssql-patch.xml +++ b/common/changelog/add-table-mssql-patch.xml @@ -21,7 +21,7 @@ - +
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml index f899cb2..bbe5a1f 100644 --- a/common/changelog/add-table-mysql-diff.xml +++ b/common/changelog/add-table-mysql-diff.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index 4d0af47..199cf19 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -21,7 +21,7 @@
- +
diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml index dd394a9..e7fd0fd 100644 --- a/common/changelog/add-table-oracle-diff.xml +++ b/common/changelog/add-table-oracle-diff.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index 78f555a..5c6c766 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -21,7 +21,7 @@
- +
diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml index 1c498f8..5c96338 100644 --- a/common/changelog/add-table-pgsql-diff.xml +++ b/common/changelog/add-table-pgsql-diff.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml index cb26141..8c8d7d3 100644 --- a/common/changelog/add-table-pgsql-patch.xml +++ b/common/changelog/add-table-pgsql-patch.xml @@ -21,7 +21,7 @@
- +
diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml index d2abe2f..44ca569 100644 --- a/common/changelog/add-table-sqlite-diff.xml +++ b/common/changelog/add-table-sqlite-diff.xml @@ -14,7 +14,7 @@ - + diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml index 868fbab..9eb4a3b 100644 --- a/common/changelog/add-table-sqlite-patch.xml +++ b/common/changelog/add-table-sqlite-patch.xml @@ -21,7 +21,7 @@
- +
diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml index d905b2f..535c3a2 100644 --- a/common/changelog/drop-table-mssql-diff.xml +++ b/common/changelog/drop-table-mssql-diff.xml @@ -19,7 +19,7 @@
- +
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml index 5fd5a97..c94eee3 100644 --- a/common/changelog/drop-table-mysql-diff.xml +++ b/common/changelog/drop-table-mysql-diff.xml @@ -19,7 +19,7 @@
- +
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml index 39ed9be..4aa67e2 100644 --- a/common/changelog/drop-table-oracle-diff.xml +++ b/common/changelog/drop-table-oracle-diff.xml @@ -19,7 +19,7 @@
- +
diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml index 5cb9551..8facd2d 100644 --- a/common/changelog/drop-table-pgsql-diff.xml +++ b/common/changelog/drop-table-pgsql-diff.xml @@ -19,7 +19,7 @@
- +
diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml index a91d643..85bf64a 100644 --- a/common/changelog/drop-table-sqlite-diff.xml +++ b/common/changelog/drop-table-sqlite-diff.xml @@ -19,7 +19,7 @@
- +
diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml index 8a32d25..9bd1e4a 100644 --- a/common/changelog/model-mssql.xml +++ b/common/changelog/model-mssql.xml @@ -26,7 +26,7 @@
- +
diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml index 9398955..b4b2e14 100644 --- a/common/changelog/model-mysql.xml +++ b/common/changelog/model-mysql.xml @@ -26,7 +26,7 @@
- +
diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml index bbe2660..1b4db54 100644 --- a/common/changelog/model-oracle.xml +++ b/common/changelog/model-oracle.xml @@ -26,7 +26,7 @@
- +
diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml index dd6b2d6..050a7c5 100644 --- a/common/changelog/model-pgsql.xml +++ b/common/changelog/model-pgsql.xml @@ -26,7 +26,7 @@
- +
diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml index 4b1b473..e2cf7cf 100644 --- a/common/changelog/model-sqlite.xml +++ b/common/changelog/model-sqlite.xml @@ -26,7 +26,7 @@
- +
diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 0a005b5..9f60214 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -41,8 +41,6 @@ main (int argc, char* argv[]) { case 1: { - using namespace v2; - if (embedded) { transaction t (db->begin ()); @@ -53,19 +51,45 @@ main (int argc, char* argv[]) t.commit (); } - object1 o1; - o1.o = new object (1); - o1.o->str = "abc"; - o1.nums.push_back (1); - o1.nums.push_back (2); - o1.nums.push_back (3); + { + using namespace v2; + + object1 o1; + o1.o = new object (1); + o1.o->str = "abc"; + o1.nums.push_back (1); + o1.nums.push_back (2); + o1.nums.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o1.o); + db->persist (o1); + t.commit (); + } + } + // Polymorphism test. + // { - transaction t (db->begin ()); - db->persist (o1.o); - db->persist (o1); - t.commit (); + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3; + + base b (123, "abc"); + derived d1 (234, "bcd"); + derived d2 (345, "cde"); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d1); + db->persist (d2); + t.commit (); + } } + break; } case 2: @@ -104,6 +128,7 @@ main (int argc, char* argv[]) schema_catalog::migrate_schema_post (*db, 3); t.commit (); } + break; } case 3: @@ -119,6 +144,15 @@ main (int argc, char* argv[]) t.commit (); } + // Polymorphism test. + // + { + transaction t (db->begin ()); + assert (size (db->query ()) == 1); + assert (size (db->query ()) == 1); + t.commit (); + } + break; } default: diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index 64022bb..55035e6 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -29,11 +29,7 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::string str; }; -#if MODEL_VERSION > 1 #pragma db object -#if MODEL_VERSION == 3 - #pragma db deleted(3) -#endif struct object1 { object1 (): o (0) {} @@ -45,6 +41,53 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) object* o; std::vector nums; }; + +#if MODEL_VERSION == 3 + #pragma db object(object1) deleted(3) +#endif + + // Make sure we also clean up base tables when dropping a + // table corresponding to the polymorphic derived object. + // + #pragma db value + struct value + { + value (unsigned long n = 0, const std::string& s = ""): num (n), str (s) {} + + unsigned long num; + std::string str; + }; + + #pragma db object polymorphic + struct root + { + root (unsigned long n = 0, const std::string& s = ""): id (n, s) {} + virtual ~root () {} + + #pragma db id + value id; + }; + + #pragma db object + struct base: root + { + base (unsigned long n = 0, const std::string& s = "") + : root (n, s), num (n) {} + + unsigned long num; + }; + + #pragma db object + struct derived: base + { + derived (unsigned long n = 0, const std::string& s = "") + : base (n, s), str (s) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db object(derived) deleted(3) #endif } -- cgit v1.1 From ea176df42469417c37ad050616db23a01277b4e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 15 Sep 2013 13:43:39 +0200 Subject: Diagnose change of polymorphic base, table kind --- common/changelog/add-column-mssql-diff.xml | 2 +- common/changelog/add-column-mssql-patch.xml | 2 +- common/changelog/add-column-mysql-diff.xml | 2 +- common/changelog/add-column-mysql-patch.xml | 2 +- common/changelog/add-column-oracle-diff.xml | 2 +- common/changelog/add-column-oracle-patch.xml | 2 +- common/changelog/add-column-pgsql-diff.xml | 2 +- common/changelog/add-column-pgsql-patch.xml | 2 +- common/changelog/add-column-sqlite-diff.xml | 2 +- common/changelog/add-column-sqlite-patch.xml | 2 +- common/changelog/add-foreign-key-diff.xml | 4 ++-- common/changelog/add-foreign-key-mssql-diff.xml | 4 ++-- common/changelog/add-foreign-key-mssql-patch.xml | 4 ++-- common/changelog/add-foreign-key-mysql-diff.xml | 4 ++-- common/changelog/add-foreign-key-mysql-patch.xml | 4 ++-- common/changelog/add-foreign-key-oracle-diff.xml | 4 ++-- common/changelog/add-foreign-key-oracle-patch.xml | 4 ++-- common/changelog/add-foreign-key-pgsql-diff.xml | 4 ++-- common/changelog/add-foreign-key-pgsql-patch.xml | 4 ++-- common/changelog/add-foreign-key-sqlite-diff.xml | 4 ++-- common/changelog/add-foreign-key-sqlite-patch.xml | 4 ++-- common/changelog/add-index-mssql-diff.xml | 2 +- common/changelog/add-index-mssql-patch.xml | 2 +- common/changelog/add-index-mysql-diff.xml | 2 +- common/changelog/add-index-mysql-patch.xml | 2 +- common/changelog/add-index-oracle-diff.xml | 2 +- common/changelog/add-index-oracle-patch.xml | 2 +- common/changelog/add-index-pgsql-diff.xml | 2 +- common/changelog/add-index-pgsql-patch.xml | 2 +- common/changelog/add-index-sqlite-diff.xml | 2 +- common/changelog/add-index-sqlite-patch.xml | 2 +- common/changelog/add-table-mssql-diff.xml | 4 ++-- common/changelog/add-table-mssql-patch.xml | 4 ++-- common/changelog/add-table-mysql-diff.xml | 4 ++-- common/changelog/add-table-mysql-patch.xml | 4 ++-- common/changelog/add-table-oracle-diff.xml | 4 ++-- common/changelog/add-table-oracle-patch.xml | 4 ++-- common/changelog/add-table-pgsql-diff.xml | 4 ++-- common/changelog/add-table-pgsql-patch.xml | 4 ++-- common/changelog/add-table-sqlite-diff.xml | 4 ++-- common/changelog/add-table-sqlite-patch.xml | 4 ++-- common/changelog/alter-column-mssql-diff.xml | 2 +- common/changelog/alter-column-mssql-patch.xml | 2 +- common/changelog/alter-column-mysql-diff.xml | 2 +- common/changelog/alter-column-mysql-patch.xml | 2 +- common/changelog/alter-column-oracle-diff.xml | 2 +- common/changelog/alter-column-oracle-patch.xml | 2 +- common/changelog/alter-column-pgsql-diff.xml | 2 +- common/changelog/alter-column-pgsql-patch.xml | 2 +- common/changelog/alter-column-sqlite-diff.xml | 2 +- common/changelog/alter-column-sqlite-patch.xml | 2 +- common/changelog/drop-column-mssql-diff.xml | 2 +- common/changelog/drop-column-mssql-patch.xml | 2 +- common/changelog/drop-column-mysql-diff.xml | 2 +- common/changelog/drop-column-mysql-patch.xml | 2 +- common/changelog/drop-column-oracle-diff.xml | 2 +- common/changelog/drop-column-oracle-patch.xml | 2 +- common/changelog/drop-column-pgsql-diff.xml | 2 +- common/changelog/drop-column-pgsql-patch.xml | 2 +- common/changelog/drop-column-sqlite-diff.xml | 2 +- common/changelog/drop-column-sqlite-patch.xml | 2 +- common/changelog/drop-foreign-key-mssql-diff.xml | 4 ++-- common/changelog/drop-foreign-key-mssql-patch.xml | 4 ++-- common/changelog/drop-foreign-key-mysql-diff.xml | 4 ++-- common/changelog/drop-foreign-key-mysql-patch.xml | 4 ++-- common/changelog/drop-foreign-key-oracle-diff.xml | 4 ++-- common/changelog/drop-foreign-key-oracle-patch.xml | 4 ++-- common/changelog/drop-foreign-key-pgsql-diff.xml | 4 ++-- common/changelog/drop-foreign-key-pgsql-patch.xml | 4 ++-- common/changelog/drop-foreign-key-sqlite-diff.xml | 4 ++-- common/changelog/drop-foreign-key-sqlite-patch.xml | 4 ++-- common/changelog/drop-index-mssql-diff.xml | 2 +- common/changelog/drop-index-mssql-patch.xml | 2 +- common/changelog/drop-index-mysql-diff.xml | 2 +- common/changelog/drop-index-mysql-patch.xml | 2 +- common/changelog/drop-index-oracle-diff.xml | 2 +- common/changelog/drop-index-oracle-patch.xml | 2 +- common/changelog/drop-index-pgsql-diff.xml | 2 +- common/changelog/drop-index-pgsql-patch.xml | 2 +- common/changelog/drop-index-sqlite-diff.xml | 2 +- common/changelog/drop-index-sqlite-patch.xml | 2 +- common/changelog/drop-table-mssql-diff.xml | 4 ++-- common/changelog/drop-table-mssql-patch.xml | 2 +- common/changelog/drop-table-mysql-diff.xml | 4 ++-- common/changelog/drop-table-mysql-patch.xml | 2 +- common/changelog/drop-table-oracle-diff.xml | 4 ++-- common/changelog/drop-table-oracle-patch.xml | 2 +- common/changelog/drop-table-pgsql-diff.xml | 4 ++-- common/changelog/drop-table-pgsql-patch.xml | 2 +- common/changelog/drop-table-sqlite-diff.xml | 4 ++-- common/changelog/drop-table-sqlite-patch.xml | 2 +- common/changelog/model-mssql.xml | 4 ++-- common/changelog/model-mysql.xml | 4 ++-- common/changelog/model-oracle.xml | 4 ++-- common/changelog/model-pgsql.xml | 4 ++-- common/changelog/model-sqlite.xml | 4 ++-- 96 files changed, 137 insertions(+), 137 deletions(-) diff --git a/common/changelog/add-column-mssql-diff.xml b/common/changelog/add-column-mssql-diff.xml index 7294eb8..4f9ba09 100644 --- a/common/changelog/add-column-mssql-diff.xml +++ b/common/changelog/add-column-mssql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml index cea9815..7054935 100644 --- a/common/changelog/add-column-mssql-patch.xml +++ b/common/changelog/add-column-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml index 15ff759..992306d 100644 --- a/common/changelog/add-column-mysql-diff.xml +++ b/common/changelog/add-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml index 445ad0d..e2143eb 100644 --- a/common/changelog/add-column-mysql-patch.xml +++ b/common/changelog/add-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml index 3ebaa7b..fa1dac6 100644 --- a/common/changelog/add-column-oracle-diff.xml +++ b/common/changelog/add-column-oracle-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml index b934c83..96da076 100644 --- a/common/changelog/add-column-oracle-patch.xml +++ b/common/changelog/add-column-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-column-pgsql-diff.xml b/common/changelog/add-column-pgsql-diff.xml index b72aced..9524d9d 100644 --- a/common/changelog/add-column-pgsql-diff.xml +++ b/common/changelog/add-column-pgsql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml index a6ce808..1e73c14 100644 --- a/common/changelog/add-column-pgsql-patch.xml +++ b/common/changelog/add-column-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-column-sqlite-diff.xml b/common/changelog/add-column-sqlite-diff.xml index 2f32915..b59cc72 100644 --- a/common/changelog/add-column-sqlite-diff.xml +++ b/common/changelog/add-column-sqlite-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml index 8f80bfc..a0e37a4 100644 --- a/common/changelog/add-column-sqlite-patch.xml +++ b/common/changelog/add-column-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-foreign-key-diff.xml b/common/changelog/add-foreign-key-diff.xml index 06079b8..d4f29ad 100644 --- a/common/changelog/add-foreign-key-diff.xml +++ b/common/changelog/add-foreign-key-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-mssql-diff.xml b/common/changelog/add-foreign-key-mssql-diff.xml index ce050d6..76ebce3 100644 --- a/common/changelog/add-foreign-key-mssql-diff.xml +++ b/common/changelog/add-foreign-key-mssql-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml index 833687c..1f1f30f 100644 --- a/common/changelog/add-foreign-key-mssql-patch.xml +++ b/common/changelog/add-foreign-key-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml index 44aa42e..acdfd5b 100644 --- a/common/changelog/add-foreign-key-mysql-diff.xml +++ b/common/changelog/add-foreign-key-mysql-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml index fa21c84..635d3c3 100644 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml index 75bcbe2..6bd8bc3 100644 --- a/common/changelog/add-foreign-key-oracle-diff.xml +++ b/common/changelog/add-foreign-key-oracle-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml index fcadec0..631c8b5 100644 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-foreign-key-pgsql-diff.xml b/common/changelog/add-foreign-key-pgsql-diff.xml index e14cf32..793b009 100644 --- a/common/changelog/add-foreign-key-pgsql-diff.xml +++ b/common/changelog/add-foreign-key-pgsql-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml index e70d737..04617fd 100644 --- a/common/changelog/add-foreign-key-pgsql-patch.xml +++ b/common/changelog/add-foreign-key-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-foreign-key-sqlite-diff.xml b/common/changelog/add-foreign-key-sqlite-diff.xml index dece240..1510470 100644 --- a/common/changelog/add-foreign-key-sqlite-diff.xml +++ b/common/changelog/add-foreign-key-sqlite-diff.xml @@ -12,13 +12,13 @@ -
+
- +
diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml index 5bc48d5..5a32496 100644 --- a/common/changelog/add-foreign-key-sqlite-patch.xml +++ b/common/changelog/add-foreign-key-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
@@ -13,7 +13,7 @@
- +
diff --git a/common/changelog/add-index-mssql-diff.xml b/common/changelog/add-index-mssql-diff.xml index 47ca82d..58c623f 100644 --- a/common/changelog/add-index-mssql-diff.xml +++ b/common/changelog/add-index-mssql-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-mssql-patch.xml b/common/changelog/add-index-mssql-patch.xml index 5f41f15..6085d04 100644 --- a/common/changelog/add-index-mssql-patch.xml +++ b/common/changelog/add-index-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-index-mysql-diff.xml b/common/changelog/add-index-mysql-diff.xml index 5abe640..a54a7e3 100644 --- a/common/changelog/add-index-mysql-diff.xml +++ b/common/changelog/add-index-mysql-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml index dec530a..b7e2409 100644 --- a/common/changelog/add-index-mysql-patch.xml +++ b/common/changelog/add-index-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-index-oracle-diff.xml b/common/changelog/add-index-oracle-diff.xml index 4f1afbe..80f8ecc 100644 --- a/common/changelog/add-index-oracle-diff.xml +++ b/common/changelog/add-index-oracle-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml index 9ceb77a..3727521 100644 --- a/common/changelog/add-index-oracle-patch.xml +++ b/common/changelog/add-index-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-index-pgsql-diff.xml b/common/changelog/add-index-pgsql-diff.xml index 8030b25..3988643 100644 --- a/common/changelog/add-index-pgsql-diff.xml +++ b/common/changelog/add-index-pgsql-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-pgsql-patch.xml b/common/changelog/add-index-pgsql-patch.xml index f42d591..59ec932 100644 --- a/common/changelog/add-index-pgsql-patch.xml +++ b/common/changelog/add-index-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-index-sqlite-diff.xml b/common/changelog/add-index-sqlite-diff.xml index fc8fb44..c1f7fdc 100644 --- a/common/changelog/add-index-sqlite-diff.xml +++ b/common/changelog/add-index-sqlite-diff.xml @@ -10,7 +10,7 @@ -
+
diff --git a/common/changelog/add-index-sqlite-patch.xml b/common/changelog/add-index-sqlite-patch.xml index effbe72..798fa73 100644 --- a/common/changelog/add-index-sqlite-patch.xml +++ b/common/changelog/add-index-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml index 5468cc9..8bf0e30 100644 --- a/common/changelog/add-table-mssql-diff.xml +++ b/common/changelog/add-table-mssql-diff.xml @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml index 1b62efc..0f09e2b 100644 --- a/common/changelog/add-table-mssql-patch.xml +++ b/common/changelog/add-table-mssql-patch.xml @@ -1,13 +1,13 @@ -
+
- +
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml index bbe5a1f..57f741b 100644 --- a/common/changelog/add-table-mysql-diff.xml +++ b/common/changelog/add-table-mysql-diff.xml @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index 199cf19..f2a02cf 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -1,13 +1,13 @@ -
+
- +
diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml index e7fd0fd..70ec7c6 100644 --- a/common/changelog/add-table-oracle-diff.xml +++ b/common/changelog/add-table-oracle-diff.xml @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index 5c6c766..67ffc15 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -1,13 +1,13 @@ -
+
- +
diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml index 5c96338..9b48062 100644 --- a/common/changelog/add-table-pgsql-diff.xml +++ b/common/changelog/add-table-pgsql-diff.xml @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml index 8c8d7d3..4a9bc8b 100644 --- a/common/changelog/add-table-pgsql-patch.xml +++ b/common/changelog/add-table-pgsql-patch.xml @@ -1,13 +1,13 @@ -
+
- +
diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml index 44ca569..573bc69 100644 --- a/common/changelog/add-table-sqlite-diff.xml +++ b/common/changelog/add-table-sqlite-diff.xml @@ -1,6 +1,6 @@ - + @@ -34,7 +34,7 @@ -
+
diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml index 9eb4a3b..a62c530 100644 --- a/common/changelog/add-table-sqlite-patch.xml +++ b/common/changelog/add-table-sqlite-patch.xml @@ -1,13 +1,13 @@ -
+
- +
diff --git a/common/changelog/alter-column-mssql-diff.xml b/common/changelog/alter-column-mssql-diff.xml index 05515d5..6c1fb6a 100644 --- a/common/changelog/alter-column-mssql-diff.xml +++ b/common/changelog/alter-column-mssql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml index 04bee32..f988693 100644 --- a/common/changelog/alter-column-mssql-patch.xml +++ b/common/changelog/alter-column-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml index 5f964fd..39ad6ef 100644 --- a/common/changelog/alter-column-mysql-diff.xml +++ b/common/changelog/alter-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml index 3987abf..53bf586 100644 --- a/common/changelog/alter-column-mysql-patch.xml +++ b/common/changelog/alter-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml index d49ea52..d41d333 100644 --- a/common/changelog/alter-column-oracle-diff.xml +++ b/common/changelog/alter-column-oracle-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml index 0f48155..342436b 100644 --- a/common/changelog/alter-column-oracle-patch.xml +++ b/common/changelog/alter-column-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/alter-column-pgsql-diff.xml b/common/changelog/alter-column-pgsql-diff.xml index 6b0c284..fd97fa0 100644 --- a/common/changelog/alter-column-pgsql-diff.xml +++ b/common/changelog/alter-column-pgsql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml index a615303..efbd7c5 100644 --- a/common/changelog/alter-column-pgsql-patch.xml +++ b/common/changelog/alter-column-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/alter-column-sqlite-diff.xml b/common/changelog/alter-column-sqlite-diff.xml index 26c7cb6..7ecea06 100644 --- a/common/changelog/alter-column-sqlite-diff.xml +++ b/common/changelog/alter-column-sqlite-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml index ac6ccf1..294e591 100644 --- a/common/changelog/alter-column-sqlite-patch.xml +++ b/common/changelog/alter-column-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-mssql-diff.xml b/common/changelog/drop-column-mssql-diff.xml index 1b2c433..f2bab96 100644 --- a/common/changelog/drop-column-mssql-diff.xml +++ b/common/changelog/drop-column-mssql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml index 13b4d50..3dea777 100644 --- a/common/changelog/drop-column-mssql-patch.xml +++ b/common/changelog/drop-column-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml index 7b6d172..2bb321d 100644 --- a/common/changelog/drop-column-mysql-diff.xml +++ b/common/changelog/drop-column-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml index f69268d..43255a3 100644 --- a/common/changelog/drop-column-mysql-patch.xml +++ b/common/changelog/drop-column-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml index 5109339..e920a12 100644 --- a/common/changelog/drop-column-oracle-diff.xml +++ b/common/changelog/drop-column-oracle-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml index 18e5dee..bded324 100644 --- a/common/changelog/drop-column-oracle-patch.xml +++ b/common/changelog/drop-column-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-pgsql-diff.xml b/common/changelog/drop-column-pgsql-diff.xml index 45bd5ff..d2e91ba 100644 --- a/common/changelog/drop-column-pgsql-diff.xml +++ b/common/changelog/drop-column-pgsql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml index 2c89e9c..1bc92ce 100644 --- a/common/changelog/drop-column-pgsql-patch.xml +++ b/common/changelog/drop-column-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-column-sqlite-diff.xml b/common/changelog/drop-column-sqlite-diff.xml index 9ed1245..1c9d138 100644 --- a/common/changelog/drop-column-sqlite-diff.xml +++ b/common/changelog/drop-column-sqlite-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml index cc3f86c..9878a76 100644 --- a/common/changelog/drop-column-sqlite-patch.xml +++ b/common/changelog/drop-column-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-foreign-key-mssql-diff.xml b/common/changelog/drop-foreign-key-mssql-diff.xml index d110266..da3ce73 100644 --- a/common/changelog/drop-foreign-key-mssql-diff.xml +++ b/common/changelog/drop-foreign-key-mssql-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-mssql-patch.xml b/common/changelog/drop-foreign-key-mssql-patch.xml index 84af5fe..809a01f 100644 --- a/common/changelog/drop-foreign-key-mssql-patch.xml +++ b/common/changelog/drop-foreign-key-mssql-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml index 137f05f..aa179f2 100644 --- a/common/changelog/drop-foreign-key-mysql-diff.xml +++ b/common/changelog/drop-foreign-key-mysql-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml index d690c42..d55adeb 100644 --- a/common/changelog/drop-foreign-key-mysql-patch.xml +++ b/common/changelog/drop-foreign-key-mysql-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml index 5203218..aa407d3 100644 --- a/common/changelog/drop-foreign-key-oracle-diff.xml +++ b/common/changelog/drop-foreign-key-oracle-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml index e44645b..68bb19f 100644 --- a/common/changelog/drop-foreign-key-oracle-patch.xml +++ b/common/changelog/drop-foreign-key-oracle-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-foreign-key-pgsql-diff.xml b/common/changelog/drop-foreign-key-pgsql-diff.xml index 9d0c7c1..9a6259a 100644 --- a/common/changelog/drop-foreign-key-pgsql-diff.xml +++ b/common/changelog/drop-foreign-key-pgsql-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-pgsql-patch.xml b/common/changelog/drop-foreign-key-pgsql-patch.xml index 14844d3..2fb6f17 100644 --- a/common/changelog/drop-foreign-key-pgsql-patch.xml +++ b/common/changelog/drop-foreign-key-pgsql-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-foreign-key-sqlite-diff.xml b/common/changelog/drop-foreign-key-sqlite-diff.xml index af0f7bc..6f9f994 100644 --- a/common/changelog/drop-foreign-key-sqlite-diff.xml +++ b/common/changelog/drop-foreign-key-sqlite-diff.xml @@ -7,7 +7,7 @@ -
+
@@ -20,7 +20,7 @@
- +
diff --git a/common/changelog/drop-foreign-key-sqlite-patch.xml b/common/changelog/drop-foreign-key-sqlite-patch.xml index e856d5d..95ee50e 100644 --- a/common/changelog/drop-foreign-key-sqlite-patch.xml +++ b/common/changelog/drop-foreign-key-sqlite-patch.xml @@ -1,12 +1,12 @@ -
+
- +
diff --git a/common/changelog/drop-index-mssql-diff.xml b/common/changelog/drop-index-mssql-diff.xml index cf68fd7..ac95db5 100644 --- a/common/changelog/drop-index-mssql-diff.xml +++ b/common/changelog/drop-index-mssql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-mssql-patch.xml b/common/changelog/drop-index-mssql-patch.xml index cea9815..7054935 100644 --- a/common/changelog/drop-index-mssql-patch.xml +++ b/common/changelog/drop-index-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-index-mysql-diff.xml b/common/changelog/drop-index-mysql-diff.xml index c944e40..f8c95ef 100644 --- a/common/changelog/drop-index-mysql-diff.xml +++ b/common/changelog/drop-index-mysql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml index 445ad0d..e2143eb 100644 --- a/common/changelog/drop-index-mysql-patch.xml +++ b/common/changelog/drop-index-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-index-oracle-diff.xml b/common/changelog/drop-index-oracle-diff.xml index 2ed5e65..d174802 100644 --- a/common/changelog/drop-index-oracle-diff.xml +++ b/common/changelog/drop-index-oracle-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml index b934c83..96da076 100644 --- a/common/changelog/drop-index-oracle-patch.xml +++ b/common/changelog/drop-index-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-index-pgsql-diff.xml b/common/changelog/drop-index-pgsql-diff.xml index 6e1661f..375a3d8 100644 --- a/common/changelog/drop-index-pgsql-diff.xml +++ b/common/changelog/drop-index-pgsql-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-pgsql-patch.xml b/common/changelog/drop-index-pgsql-patch.xml index a6ce808..1e73c14 100644 --- a/common/changelog/drop-index-pgsql-patch.xml +++ b/common/changelog/drop-index-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-index-sqlite-diff.xml b/common/changelog/drop-index-sqlite-diff.xml index bbc1ae4..bf54f9d 100644 --- a/common/changelog/drop-index-sqlite-diff.xml +++ b/common/changelog/drop-index-sqlite-diff.xml @@ -6,7 +6,7 @@ -
+
diff --git a/common/changelog/drop-index-sqlite-patch.xml b/common/changelog/drop-index-sqlite-patch.xml index 8f80bfc..a0e37a4 100644 --- a/common/changelog/drop-index-sqlite-patch.xml +++ b/common/changelog/drop-index-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml index 535c3a2..399d8bc 100644 --- a/common/changelog/drop-table-mssql-diff.xml +++ b/common/changelog/drop-table-mssql-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-mssql-patch.xml b/common/changelog/drop-table-mssql-patch.xml index 225550a..a02274e 100644 --- a/common/changelog/drop-table-mssql-patch.xml +++ b/common/changelog/drop-table-mssql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml index c94eee3..3ccd553 100644 --- a/common/changelog/drop-table-mysql-diff.xml +++ b/common/changelog/drop-table-mysql-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml index a6778df..ff23cb7 100644 --- a/common/changelog/drop-table-mysql-patch.xml +++ b/common/changelog/drop-table-mysql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml index 4aa67e2..589d64b 100644 --- a/common/changelog/drop-table-oracle-diff.xml +++ b/common/changelog/drop-table-oracle-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-oracle-patch.xml b/common/changelog/drop-table-oracle-patch.xml index 7983066..bac18eb 100644 --- a/common/changelog/drop-table-oracle-patch.xml +++ b/common/changelog/drop-table-oracle-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml index 8facd2d..168ec46 100644 --- a/common/changelog/drop-table-pgsql-diff.xml +++ b/common/changelog/drop-table-pgsql-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-pgsql-patch.xml b/common/changelog/drop-table-pgsql-patch.xml index 8574207..329145c 100644 --- a/common/changelog/drop-table-pgsql-patch.xml +++ b/common/changelog/drop-table-pgsql-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml index 85bf64a..6a258c4 100644 --- a/common/changelog/drop-table-sqlite-diff.xml +++ b/common/changelog/drop-table-sqlite-diff.xml @@ -5,7 +5,7 @@ -
+
@@ -36,7 +36,7 @@
- +
diff --git a/common/changelog/drop-table-sqlite-patch.xml b/common/changelog/drop-table-sqlite-patch.xml index b4bcaca..8b5609c 100644 --- a/common/changelog/drop-table-sqlite-patch.xml +++ b/common/changelog/drop-table-sqlite-patch.xml @@ -1,6 +1,6 @@ -
+
diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml index 9bd1e4a..509a210 100644 --- a/common/changelog/model-mssql.xml +++ b/common/changelog/model-mssql.xml @@ -1,6 +1,6 @@ -
+
@@ -43,7 +43,7 @@
- +
diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml index b4b2e14..ffbcf8d 100644 --- a/common/changelog/model-mysql.xml +++ b/common/changelog/model-mysql.xml @@ -1,6 +1,6 @@ -
+
@@ -43,7 +43,7 @@
- +
diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml index 1b4db54..1824690 100644 --- a/common/changelog/model-oracle.xml +++ b/common/changelog/model-oracle.xml @@ -1,6 +1,6 @@ -
+
@@ -43,7 +43,7 @@
- +
diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml index 050a7c5..13aee6b 100644 --- a/common/changelog/model-pgsql.xml +++ b/common/changelog/model-pgsql.xml @@ -1,6 +1,6 @@ -
+
@@ -43,7 +43,7 @@
- +
diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml index e2cf7cf..d0199ed 100644 --- a/common/changelog/model-sqlite.xml +++ b/common/changelog/model-sqlite.xml @@ -1,6 +1,6 @@ -
+
@@ -43,7 +43,7 @@
- +
-- cgit v1.1 From b6ebd340651eaf347c86d3ba0dbed82c6cc8fb8d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Sep 2013 07:07:33 +0200 Subject: Implement logical column drop for SQLite --- evolution/add-foreign-key/model.hxx | 2 + evolution/combined/driver.cxx | 2 +- evolution/combined/makefile | 2 +- evolution/combined/model.hxx | 4 +- evolution/drop-column/driver.cxx | 11 ++--- evolution/drop-column/makefile | 2 +- evolution/drop-column/model.hxx | 42 +++++++++------- evolution/soft-delete/driver.cxx | 99 ++++++++++++++++++++++++++----------- evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 8 --- 10 files changed, 106 insertions(+), 68 deletions(-) diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index 6b116e9..19dee89 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -10,6 +10,8 @@ #include +#include // DATABASE_XXX + #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index 8eb3eb2..4152133 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -57,13 +57,13 @@ main (int argc, char* argv[]) o.dui = 1; o.anui = 1; o.dnui = 1; + o.dc = 1; o.dt.push_back (1); o.aui = 1; #ifndef DATABASE_SQLITE o.dfk = new object1 (1); o.acn = 1; - o.dc = 1; o.acnn.reset (); o.afk = 1; #endif diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 8aecc83..5c0bbbb 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -37,7 +37,7 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_comb_ +--generate-schema --at-once --sqlite-override-null --table-prefix evo_comb_ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 2cdc9d7..53faddf 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -122,13 +122,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) std::vector dt; #endif - // Drop column. Not supported by SQLite. + // Drop column. Logical drop (set NULL) in SQLite. // -#ifndef DATABASE_SQLITE #if MODEL_VERSION == 2 unsigned long dc; #endif -#endif // Alter column NOT NULL. Not supported by SQLite. // diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 4078c58..6e72f7d 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -29,10 +29,6 @@ main (int argc, char* argv[]) try { auto_ptr db (create_database (argc, argv, false)); - - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE bool embedded (schema_catalog::exists (*db)); // 1 - base version @@ -60,9 +56,11 @@ main (int argc, char* argv[]) object o (1); o.str = "abc"; o.num = 123; + o.ptr = new object1 (1, 2); { transaction t (db->begin ()); + db->persist (*o.ptr); db->persist (o); t.commit (); } @@ -87,6 +85,7 @@ main (int argc, char* argv[]) assert (p->str == "abc"); assert (p->num == 123); + assert (p->ptr->id.x == 1 && p->ptr->id.y == 2); t.commit (); } @@ -108,7 +107,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); auto_ptr p (db->load (1)); - assert (p->str == ""); + assert (p->str == "" && p->ptr == 0); + db->erase (value (1, 2)); // SQLite logical delete test. t.commit (); } break; @@ -119,7 +119,6 @@ main (int argc, char* argv[]) return 1; } } -#endif // DATABASE_SQLITE } catch (const odb::exception& e) { diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 135c3fc..f22097e 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -37,7 +37,7 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_drop_c_ +--generate-schema --at-once --sqlite-override-null --table-prefix evo_drop_c_ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index feff041..b69cd0d 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -11,8 +11,6 @@ #include #include -#include // DATABASE_XXX - #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -20,32 +18,42 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) { + #pragma db value + struct value + { + value (int x_ = 0, int y_ = 0): x (x_), y (y_) {} + int x; + int y; + }; + + #pragma db object + struct object1 + { + object1 (int x = 0, int y = 0): id (x, y) {} + + #pragma db id + value id; + }; + #pragma db object struct object { - object (unsigned long id = 0): id_ (id) {} + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} #pragma db id unsigned long id_; - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION >= 2 - -#if MODEL_VERSION == 3 - #pragma db deleted(3) -#endif std::string str; - -#if MODEL_VERSION == 3 - #pragma db deleted(3) -#endif unsigned long num; + object1* ptr; + }; +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(object::num) deleted(3) + #pragma db member(object::ptr) deleted(3) #endif -#endif - }; } #undef MODEL_NAMESPACE diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index a5e9927..7c53f28 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -14,6 +14,7 @@ #include #include +#include // DATABASE_XXX #include "test2.hxx" #include "test3.hxx" @@ -68,10 +69,6 @@ main (int argc, char* argv[]) } } - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE - // Test basic soft-deleted member logic. // { @@ -265,8 +262,6 @@ main (int argc, char* argv[]) } } -#endif // DATABASE_SQLITE - // Test soft-deleted container member in a non-versioned object. // { @@ -325,10 +320,6 @@ main (int argc, char* argv[]) } } - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE - // Test basic soft-deleted member logic. // { @@ -938,8 +929,6 @@ main (int argc, char* argv[]) } } -#endif // DATABASE_SQLITE - // Test soft-deleted container member in a non-versioned object. // { @@ -1083,10 +1072,6 @@ main (int argc, char* argv[]) catch (const odb::exception&) {} } - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE - // Test basic soft-deleted member logic. // { @@ -1114,13 +1099,18 @@ main (int argc, char* argv[]) i->str == "" && i->num == 123 && i->vec.empty () && i->ptr == 0); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } @@ -1275,13 +1265,18 @@ main (int argc, char* argv[]) result::iterator i (r.begin ()); assert (i != r.end () && i->str == "" && i->num == 123); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } } @@ -1298,13 +1293,16 @@ main (int argc, char* argv[]) transaction t (db->begin ()); auto_ptr p (db->load (1)); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->load (*p, p->s); // No such column. assert (false); } catch (const odb::exception&) {} - +#endif t.commit (); } @@ -1364,13 +1362,18 @@ main (int argc, char* argv[]) db->load (*i, i->s); assert (i->str == "" && i->num == 123 && i->vec.empty ()); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } @@ -1445,13 +1448,18 @@ main (int argc, char* argv[]) object& o (static_cast (*i)); assert (o.bstr == "" && o.dstr == "" && o.num == 123); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::bstr == "ab"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::bstr.is_null ())) == 1); +#endif t.commit (); } @@ -1465,13 +1473,18 @@ main (int argc, char* argv[]) assert (i != r.end () && i->bstr == "" && i->dstr == "" && i->num); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::dstr == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::dstr.is_null ())) == 1); +#endif t.commit (); } @@ -1519,13 +1532,16 @@ main (int argc, char* argv[]) transaction t (db->begin ()); auto_ptr p (db->load (1)); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->load (*p, p->s); // No such column. assert (false); } catch (const odb::exception&) {} - +#endif t.commit (); } @@ -1587,13 +1603,18 @@ main (int argc, char* argv[]) object& o (static_cast (*i)); assert (o.bstr == "" && o.dstr == "" && o.num == 123); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::bstr == "ab"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::bstr.is_null ())) == 1); +#endif t.commit (); } @@ -1608,13 +1629,18 @@ main (int argc, char* argv[]) assert (i != r.end () && i->bstr == "" && i->dstr == "" && i->num); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::dstr == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::dstr.is_null ())) == 1); +#endif t.commit (); } @@ -1703,13 +1729,18 @@ main (int argc, char* argv[]) result::iterator i (r.begin ()); assert (i != r.end () && i->str == "" && i->num == 123); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } @@ -1762,13 +1793,18 @@ main (int argc, char* argv[]) result::iterator i (r.begin ()); assert (i != r.end () && i->str == "" && i->num == 123); + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } @@ -1813,13 +1849,18 @@ main (int argc, char* argv[]) assert (i != r.end () && i->str == "" && i->num == 123); id = i->id; + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE try { db->query (query::str == "abc"); // No such column. assert (false); } catch (const odb::exception&) {} - +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif t.commit (); } @@ -1860,8 +1901,6 @@ main (int argc, char* argv[]) } } -#endif // DATABASE_SQLITE - // Test soft-deleted container member in a non-versioned object. // { diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 12d02a3..f4c5091 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -37,7 +37,7 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ ---generate-schema --at-once --table-prefix evo_soft_d_ +--generate-schema --at-once --sqlite-override-null --table-prefix evo_soft_d_ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index ef5bc68..0a81116 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -13,8 +13,6 @@ #include #include -#include // DATABASE_XXX - #pragma db model version(1, MODEL_VERSION) #define MODEL_NAMESPACE_IMPL(V) v##V @@ -43,10 +41,6 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } - // SQLite doesn't support dropping of columns. - // -#ifndef DATABASE_SQLITE - // Test basic soft-deleted member logic. // #pragma db namespace table("t2_") @@ -433,8 +427,6 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } -#endif // DATABASE_SQLITE - // Test soft-deleted container member in a non-versioned object. // #pragma db namespace table("t21_") -- cgit v1.1 From 24ea8fc0e06479e2c14b9ce78a95c138939c5204 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Sep 2013 10:17:08 +0200 Subject: Implement summary soft-deletion for composite value types --- evolution/soft-delete/driver.cxx | 149 +++++++++++++++++++++++++++++++++++++++ evolution/soft-delete/model.hxx | 31 ++++++++ 2 files changed, 180 insertions(+) diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 7c53f28..7fc7b49 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -262,6 +262,24 @@ main (int argc, char* argv[]) } } + // Test summarily deleted composite values. + // + { + using namespace test15; + + object o (1); + o.v.reset (new value); + o.v->str = "abc"; + o.v->vec.push_back (123); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + // Test soft-deleted container member in a non-versioned object. // { @@ -929,6 +947,70 @@ main (int argc, char* argv[]) } } + // Test summarily deleted composite values. + // + { + using namespace test15; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->v->str == "abc" && p->num == 123 && + p->v->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::v.str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->v->str == "abc" && i->num == 123 && + i->v->vec[0] == 123); + t.commit (); + } + + object o (2); + o.v.reset (new value); + o.v->str = "bcd"; + o.num = 234; + o.v->vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->v->str == "bcd" && p->num == 234 && + p->v->vec[0] == 234); + t.commit (); + } + + o.v->str += 'e'; + o.num++; + o.v->vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->v->str == "bcde" && p->num == 235 && + p->v->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + // Test soft-deleted container member in a non-versioned object. // { @@ -1901,6 +1983,73 @@ main (int argc, char* argv[]) } } + // Test summarily deleted composite values. + // + { + using namespace test15; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->v.get () == 0 && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->v.get () == 0 && i->num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::v.str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::v.str.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->v.get () == 0 && p->num == 234); + t.commit (); + } + + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->v.get () == 0 && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + // Test soft-deleted container member in a non-versioned object. // { diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 0a81116..9c99abe 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -7,6 +7,7 @@ #endif #include +#include // std::auto_ptr #include #include @@ -427,6 +428,36 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #endif } + // Test summarily deleted composite values. + // + #pragma db namespace table("t15_") + namespace test15 + { + #pragma db value + struct value + { + std::string str; + odb::vector vec; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::auto_ptr v; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) deleted(3) + #pragma db member(value::vec) deleted(3) +#endif + } + // Test soft-deleted container member in a non-versioned object. // #pragma db namespace table("t21_") -- cgit v1.1 From 4c893bdef4b57193438e57b09627560e53f3e6d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 11:11:43 +0200 Subject: Add support for defining composite values inside persistent classes, etc --- common/composite-id/driver.cxx | 26 +++++++++++++++++++++++ common/composite-id/test.hxx | 47 +++++++++++++++++++++++++++++++++++++++++ common/composite/driver.cxx | 28 ++++++++++++++++++++++++ common/composite/test.hxx | 48 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+) diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx index 86d13b0..f8773d5 100644 --- a/common/composite-id/driver.cxx +++ b/common/composite-id/driver.cxx @@ -695,6 +695,32 @@ main (int argc, char* argv[]) assert (p3->o1[1] == 0); } } + + // Test 9. + { + using namespace test9; + + object o (123, "abc"); + o.v.push_back (123); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end () && o == *i && ++i == r.end ()); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index a2773d0..adf9495 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -470,4 +470,51 @@ namespace test8 }; } +// Test composite id definition inside object. +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object + struct object + { + object (unsigned long n = 0, const std::string& s = "") + { + id_.num = n; + id_.str = s; + } + + unsigned long num () const {return id_.num;} + const std::string& str () const {return id_.str;} + + std::vector v; + + private: + friend class odb::access; + + #pragma db value + struct comp + { + unsigned long num; + std::string str; + + bool + operator< (const comp& x) const + { + return num < x.num || (num == x.num && str < x.str); + } + }; + + #pragma db id + comp id_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.num () == y.num () && x.str () == y.str () && x.v == y.v; + } +} + + #endif // TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 0d61a3c..45ca09d 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -191,6 +191,34 @@ main (int argc, char* argv[]) assert (o == *o1); } } + + // Test composite definition inside object. + { + using namespace test4; + + object o (1); + o.str ("abc"); + o.x (123); + o.y (234); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } } catch (const odb::exception& e) { diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 040d39c..8bf4b97 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -170,5 +170,53 @@ namespace test3 } } +// Test composite definition inside object. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + unsigned long id () const {return id_;} + + void str (const std::string& s) {c_.str = s;} + const std::string& str () const {return c_.str;} + + void x (int i) {p_.first = i;} + int x () const {return p_.first;} + + void y (int i) {p_.second = i;} + int y () const {return p_.second;} + + private: + friend class odb::access; + + #pragma db id + unsigned long id_; + + #pragma db value + struct comp + { + std::string str; + }; + + comp c_; + + typedef std::pair int_pair; + #pragma db value(int_pair) + + int_pair p_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id () == y.id () && x.str () == y.str () && + x.x () == y.x () && x.y () == y.y (); + } +} #endif // TEST_HXX -- cgit v1.1 From 649c1abcceab97c8ece976cc30bab0e3aaa3be54 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 12:01:47 +0200 Subject: Add schema name to changelog --- evolution/add-column/driver.cxx | 1 - evolution/add-column/makefile | 2 +- evolution/add-foreign-key/driver.cxx | 1 - evolution/add-foreign-key/makefile | 2 +- evolution/add-index/driver.cxx | 1 - evolution/add-index/makefile | 2 +- evolution/add-table/driver.cxx | 1 - evolution/add-table/makefile | 2 +- evolution/alter-column/driver.cxx | 1 - evolution/alter-column/makefile | 2 +- evolution/combined/driver.cxx | 1 - evolution/combined/makefile | 2 +- evolution/data/driver.cxx | 1 - evolution/data/makefile | 2 +- evolution/drop-column/driver.cxx | 1 - evolution/drop-column/makefile | 2 +- evolution/drop-foreign-key/driver.cxx | 1 - evolution/drop-foreign-key/makefile | 2 +- evolution/drop-index/driver.cxx | 1 - evolution/drop-index/makefile | 2 +- evolution/drop-table/driver.cxx | 1 - evolution/drop-table/makefile | 2 +- evolution/embedded/driver.cxx | 1 - evolution/embedded/makefile | 2 +- evolution/soft-add/driver.cxx | 1 - evolution/soft-add/makefile | 2 +- evolution/soft-delete/driver.cxx | 1 - evolution/soft-delete/makefile | 2 +- evolution/template/driver.cxx | 1 - evolution/template/makefile | 2 +- evolution/version/driver.cxx | 1 - evolution/version/makefile | 2 +- 32 files changed, 16 insertions(+), 32 deletions(-) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index a619895..68970d3 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 52b5371..0914c44 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index a05804a..0192357 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -48,7 +48,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index a385184..63ac218 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -42,7 +42,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index bb369e5..8d388ba 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 0b889aa..61b0899 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index 163fe30..bd62068 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 337263a..b28f057 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index a51d09a..1a46100 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -51,7 +51,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 095620c..8884fe9 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index 4152133..c48b9fd 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 5c0bbbb..6bf3512 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index 0a700c7..7daa5c9 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -91,7 +91,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/data/makefile b/evolution/data/makefile index 98e852a..08c0772 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -39,7 +39,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 6e72f7d..60eba06 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index f22097e..8f8d56d 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index bd42f5d..7d97af9 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -51,7 +51,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 39e1633..cfd573d 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -42,7 +42,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 7a04322..39eedcf 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index eec3cf7..b329e16 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 9f60214..55e2528 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -45,7 +45,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index ed46f61..d0d97ec 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index ef274ee..60c8c18 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -46,7 +46,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); t.commit (); } diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 3e351ad..b88f7b6 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -39,7 +39,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 190cc0c..5ea54d5 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 87a8aa9..11a37ef 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 7fc7b49..fa5c810 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -48,7 +48,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index f4c5091..657191b 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index b2ff10e..c5101c6 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -47,7 +47,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); diff --git a/evolution/template/makefile b/evolution/template/makefile index 1911ea8..92b2ba7 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index 81ce4cf..b171969 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -48,7 +48,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); schema_catalog::drop_schema (*db); - schema_catalog::drop_schema (*db, "2"); assert (db->schema_version () == 0); diff --git a/evolution/version/makefile b/evolution/version/makefile index 4a2721f..1b20f52 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -41,7 +41,7 @@ $(gen) $(dist): odb_common_options = --generate-query \ $(gen): odb_common_options += --database $(db_id) $(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog $(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---schema-name 2 --suppress-migration +--suppress-migration $(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create $(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml $(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -- cgit v1.1 From c9c15481748f7e1092a37ea391b0b001471b37a0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 12:13:12 +0200 Subject: Bump version to 2.3.0.b1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index ccbccc3..44c7280 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.0 +2.3.0.b1 -- cgit v1.1 From 8c047fedd1c3386f14a8b84a1490d07831e3a429 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 17 Sep 2013 14:02:09 +0200 Subject: Fix invalid file directory --- evolution/template/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 0746050..6e05a5d 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -10,7 +10,7 @@ LDADD = $(top_builddir)/libcommon/common/libcommon.la AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' -TESTS=$(top_srcdir)/evolution/tester +TESTS=$(top_builddir)/evolution/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; ODB = @ODB@ -- cgit v1.1 From fb95c049bcd5c639225759d71e7f85d3435ad018 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 28 Sep 2013 10:12:07 +0200 Subject: Don't ignore empty changesets This can be useful, for example, in data-only migrations. --- common/changelog/add-column-mssql-patch.xml | 2 ++ common/changelog/add-column-mysql-patch.xml | 2 ++ common/changelog/add-column-oracle-patch.xml | 2 ++ common/changelog/add-column-pgsql-patch.xml | 2 ++ common/changelog/add-column-sqlite-patch.xml | 2 ++ common/changelog/add-foreign-key-mssql-patch.xml | 2 ++ common/changelog/add-foreign-key-mysql-patch.xml | 2 ++ common/changelog/add-foreign-key-oracle-patch.xml | 2 ++ common/changelog/add-foreign-key-pgsql-patch.xml | 2 ++ common/changelog/add-foreign-key-sqlite-patch.xml | 2 ++ common/changelog/add-index-mssql-patch.xml | 2 ++ common/changelog/add-index-mysql-patch.xml | 2 ++ common/changelog/add-index-oracle-patch.xml | 2 ++ common/changelog/add-index-pgsql-patch.xml | 2 ++ common/changelog/add-index-sqlite-patch.xml | 2 ++ common/changelog/add-table-mssql-patch.xml | 2 ++ common/changelog/add-table-mysql-patch.xml | 2 ++ common/changelog/add-table-oracle-patch.xml | 2 ++ common/changelog/add-table-pgsql-patch.xml | 2 ++ common/changelog/add-table-sqlite-patch.xml | 2 ++ common/changelog/alter-column-mssql-patch.xml | 2 ++ common/changelog/alter-column-mysql-patch.xml | 2 ++ common/changelog/alter-column-oracle-patch.xml | 2 ++ common/changelog/alter-column-pgsql-patch.xml | 2 ++ common/changelog/alter-column-sqlite-patch.xml | 2 ++ common/changelog/drop-column-mssql-patch.xml | 2 ++ common/changelog/drop-column-mysql-patch.xml | 2 ++ common/changelog/drop-column-oracle-patch.xml | 2 ++ common/changelog/drop-column-pgsql-patch.xml | 2 ++ common/changelog/drop-column-sqlite-patch.xml | 2 ++ common/changelog/drop-foreign-key-mssql-patch.xml | 2 ++ common/changelog/drop-foreign-key-mysql-patch.xml | 2 ++ common/changelog/drop-foreign-key-oracle-patch.xml | 2 ++ common/changelog/drop-foreign-key-pgsql-patch.xml | 2 ++ common/changelog/drop-foreign-key-sqlite-patch.xml | 2 ++ common/changelog/drop-index-mssql-patch.xml | 2 ++ common/changelog/drop-index-mysql-patch.xml | 2 ++ common/changelog/drop-index-oracle-patch.xml | 2 ++ common/changelog/drop-index-pgsql-patch.xml | 2 ++ common/changelog/drop-index-sqlite-patch.xml | 2 ++ common/changelog/drop-table-mssql-patch.xml | 2 ++ common/changelog/drop-table-mysql-patch.xml | 2 ++ common/changelog/drop-table-oracle-patch.xml | 2 ++ common/changelog/drop-table-pgsql-patch.xml | 2 ++ common/changelog/drop-table-sqlite-patch.xml | 2 ++ 45 files changed, 90 insertions(+) diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml index 7054935..4f396d9 100644 --- a/common/changelog/add-column-mssql-patch.xml +++ b/common/changelog/add-column-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml index e2143eb..14f3f01 100644 --- a/common/changelog/add-column-mysql-patch.xml +++ b/common/changelog/add-column-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml index 96da076..38fb8d6 100644 --- a/common/changelog/add-column-oracle-patch.xml +++ b/common/changelog/add-column-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml index 1e73c14..7f7d9a0 100644 --- a/common/changelog/add-column-pgsql-patch.xml +++ b/common/changelog/add-column-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml index a0e37a4..fbe4428 100644 --- a/common/changelog/add-column-sqlite-patch.xml +++ b/common/changelog/add-column-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml index 1f1f30f..6d75709 100644 --- a/common/changelog/add-foreign-key-mssql-patch.xml +++ b/common/changelog/add-foreign-key-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml index 635d3c3..adc9081 100644 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ b/common/changelog/add-foreign-key-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml index 631c8b5..7aa01ea 100644 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ b/common/changelog/add-foreign-key-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml index 04617fd..a256831 100644 --- a/common/changelog/add-foreign-key-pgsql-patch.xml +++ b/common/changelog/add-foreign-key-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml index 5a32496..1c2d0ea 100644 --- a/common/changelog/add-foreign-key-sqlite-patch.xml +++ b/common/changelog/add-foreign-key-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-index-mssql-patch.xml b/common/changelog/add-index-mssql-patch.xml index 6085d04..2b10e65 100644 --- a/common/changelog/add-index-mssql-patch.xml +++ b/common/changelog/add-index-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml index b7e2409..a2454b8 100644 --- a/common/changelog/add-index-mysql-patch.xml +++ b/common/changelog/add-index-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml index 3727521..a9bafea 100644 --- a/common/changelog/add-index-oracle-patch.xml +++ b/common/changelog/add-index-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-index-pgsql-patch.xml b/common/changelog/add-index-pgsql-patch.xml index 59ec932..e9c564c 100644 --- a/common/changelog/add-index-pgsql-patch.xml +++ b/common/changelog/add-index-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-index-sqlite-patch.xml b/common/changelog/add-index-sqlite-patch.xml index 798fa73..b9512e0 100644 --- a/common/changelog/add-index-sqlite-patch.xml +++ b/common/changelog/add-index-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml index 0f09e2b..9dd41f3 100644 --- a/common/changelog/add-table-mssql-patch.xml +++ b/common/changelog/add-table-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml index f2a02cf..0db1e9f 100644 --- a/common/changelog/add-table-mysql-patch.xml +++ b/common/changelog/add-table-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml index 67ffc15..969c2e0 100644 --- a/common/changelog/add-table-oracle-patch.xml +++ b/common/changelog/add-table-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml index 4a9bc8b..b04a933 100644 --- a/common/changelog/add-table-pgsql-patch.xml +++ b/common/changelog/add-table-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml index a62c530..3506410 100644 --- a/common/changelog/add-table-sqlite-patch.xml +++ b/common/changelog/add-table-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml index f988693..15db347 100644 --- a/common/changelog/alter-column-mssql-patch.xml +++ b/common/changelog/alter-column-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml index 53bf586..0131466 100644 --- a/common/changelog/alter-column-mysql-patch.xml +++ b/common/changelog/alter-column-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml index 342436b..0e0794d 100644 --- a/common/changelog/alter-column-oracle-patch.xml +++ b/common/changelog/alter-column-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml index efbd7c5..dade1a3 100644 --- a/common/changelog/alter-column-pgsql-patch.xml +++ b/common/changelog/alter-column-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml index 294e591..de2762e 100644 --- a/common/changelog/alter-column-sqlite-patch.xml +++ b/common/changelog/alter-column-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml index 3dea777..32402a3 100644 --- a/common/changelog/drop-column-mssql-patch.xml +++ b/common/changelog/drop-column-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml index 43255a3..6572ebe 100644 --- a/common/changelog/drop-column-mysql-patch.xml +++ b/common/changelog/drop-column-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml index bded324..b113664 100644 --- a/common/changelog/drop-column-oracle-patch.xml +++ b/common/changelog/drop-column-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml index 1bc92ce..06cc73d 100644 --- a/common/changelog/drop-column-pgsql-patch.xml +++ b/common/changelog/drop-column-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml index 9878a76..6887530 100644 --- a/common/changelog/drop-column-sqlite-patch.xml +++ b/common/changelog/drop-column-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-foreign-key-mssql-patch.xml b/common/changelog/drop-foreign-key-mssql-patch.xml index 809a01f..cd1a372 100644 --- a/common/changelog/drop-foreign-key-mssql-patch.xml +++ b/common/changelog/drop-foreign-key-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml index d55adeb..67f026e 100644 --- a/common/changelog/drop-foreign-key-mysql-patch.xml +++ b/common/changelog/drop-foreign-key-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml index 68bb19f..56253f0 100644 --- a/common/changelog/drop-foreign-key-oracle-patch.xml +++ b/common/changelog/drop-foreign-key-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-foreign-key-pgsql-patch.xml b/common/changelog/drop-foreign-key-pgsql-patch.xml index 2fb6f17..df024b4 100644 --- a/common/changelog/drop-foreign-key-pgsql-patch.xml +++ b/common/changelog/drop-foreign-key-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-foreign-key-sqlite-patch.xml b/common/changelog/drop-foreign-key-sqlite-patch.xml index 95ee50e..6e63218 100644 --- a/common/changelog/drop-foreign-key-sqlite-patch.xml +++ b/common/changelog/drop-foreign-key-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-index-mssql-patch.xml b/common/changelog/drop-index-mssql-patch.xml index 7054935..4f396d9 100644 --- a/common/changelog/drop-index-mssql-patch.xml +++ b/common/changelog/drop-index-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml index e2143eb..14f3f01 100644 --- a/common/changelog/drop-index-mysql-patch.xml +++ b/common/changelog/drop-index-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml index 96da076..38fb8d6 100644 --- a/common/changelog/drop-index-oracle-patch.xml +++ b/common/changelog/drop-index-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-index-pgsql-patch.xml b/common/changelog/drop-index-pgsql-patch.xml index 1e73c14..7f7d9a0 100644 --- a/common/changelog/drop-index-pgsql-patch.xml +++ b/common/changelog/drop-index-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-index-sqlite-patch.xml b/common/changelog/drop-index-sqlite-patch.xml index a0e37a4..fbe4428 100644 --- a/common/changelog/drop-index-sqlite-patch.xml +++ b/common/changelog/drop-index-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-table-mssql-patch.xml b/common/changelog/drop-table-mssql-patch.xml index a02274e..c5dda75 100644 --- a/common/changelog/drop-table-mssql-patch.xml +++ b/common/changelog/drop-table-mssql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml index ff23cb7..250bd20 100644 --- a/common/changelog/drop-table-mysql-patch.xml +++ b/common/changelog/drop-table-mysql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-table-oracle-patch.xml b/common/changelog/drop-table-oracle-patch.xml index bac18eb..5f222dc 100644 --- a/common/changelog/drop-table-oracle-patch.xml +++ b/common/changelog/drop-table-oracle-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-table-pgsql-patch.xml b/common/changelog/drop-table-pgsql-patch.xml index 329145c..ebb7000 100644 --- a/common/changelog/drop-table-pgsql-patch.xml +++ b/common/changelog/drop-table-pgsql-patch.xml @@ -1,4 +1,6 @@ + +
diff --git a/common/changelog/drop-table-sqlite-patch.xml b/common/changelog/drop-table-sqlite-patch.xml index 8b5609c..45c6f00 100644 --- a/common/changelog/drop-table-sqlite-patch.xml +++ b/common/changelog/drop-table-sqlite-patch.xml @@ -1,4 +1,6 @@ + +
-- cgit v1.1 From 54e342c763145174d3109bb055fca08a98f37065 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 28 Sep 2013 14:30:05 +0200 Subject: Rework migration API in schema_catalog Specifically: - Rename latest_version() to current_version(). - Change next_version() to return one past current instead of 0 if passed current. - migrate() will now do schema creation if current database version is 0 (no schema). --- evolution/embedded/driver.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 60c8c18..a1ac0e4 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -79,6 +79,14 @@ main (int argc, char* argv[]) using namespace v2; using namespace v3; + // Check version information correctness. + // + assert (schema_catalog::current_version (*db) == 3); + assert (schema_catalog::next_version (*db, 0) == 3); + assert (schema_catalog::next_version (*db, 1) == 2); + assert (schema_catalog::next_version (*db) == 3); + assert (schema_catalog::next_version (*db, 3) == 4); + { assert (db->schema_version () == 2 && !db->schema_migration ()); -- cgit v1.1 From fe22317bdf0f8e9a22fe812730abdb4cbff4ae03 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Oct 2013 08:11:17 +0200 Subject: Add support for compile-time detection of unnecessary data migration functions --- evolution/data/driver.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index 7daa5c9..a31a9ec 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -48,16 +48,15 @@ migrate2 (database& db) db.persist (o2); } -static const data_migration_entry migrate2_entry (3, &migrate2); +static const data_migration_entry<3, 1> migrate2_entry (&migrate2); int main (int argc, char* argv[]) { - schema_catalog::data_migration_function (3, &migrate1); + schema_catalog::data_migration_function<3, 1> (&migrate1); #ifdef HAVE_CXX11 - schema_catalog::data_migration_function ( - 3, + schema_catalog::data_migration_function<3, 1> ( [] (database& db) { using namespace v2; -- cgit v1.1 From 78a479e23773177f2e8baaf5462112cde36a20b9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 5 Oct 2013 11:21:32 +0200 Subject: Add schema_catalog::base_version() for completeness --- evolution/embedded/driver.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index a1ac0e4..90d7a7b 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -81,6 +81,7 @@ main (int argc, char* argv[]) // Check version information correctness. // + assert (schema_catalog::base_version (*db) == 1); assert (schema_catalog::current_version (*db) == 3); assert (schema_catalog::next_version (*db, 0) == 3); assert (schema_catalog::next_version (*db, 1) == 2); -- cgit v1.1 From e90e03ef9627d2feb5886f6bb8966ab4a6652ca9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Oct 2013 06:06:31 +0200 Subject: Bump version to 2.3.0.b2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 44c7280..5ec8dc2 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.3.0.b1 +2.3.0.b2 -- cgit v1.1 From ccb45f5515e31f394f5164d8675b43f6b3f8b66c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Oct 2013 06:27:35 +0200 Subject: Fix broken makefiles --- pgsql/index/makefile | 4 +++- pgsql/template/makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 7ac33a9..a4e89e8 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -6,7 +6,9 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 53e817c..5a86b91 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -6,7 +6,9 @@ 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)) +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) common.l := $(out_root)/libcommon/common/common.l -- cgit v1.1 From 4cb3716317207e3a6813b0d9ff779edc7fec91de Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Oct 2013 07:01:17 +0200 Subject: Automatically map C++11 enum classes (strong enums) --- common/enum/driver.cxx | 19 +++++++++++++++++++ common/enum/test.hxx | 29 ++++++++++++++++++++++++++--- libcommon/common/config-vc.h | 6 ++++++ libcommon/common/config.hxx | 7 +++++++ 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 6cc41af..2e1e678 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -33,6 +33,13 @@ main (int argc, char* argv[]) object o; o.color_ = green; o.taste_ = object::sweet; + o.position_ = object::left; + +#ifdef HAVE_CXX11_ENUM + o.gender_ = object::gender::female; + o.scale_ = object::scale::ten; + o.yesno_ = object::yesno::yes; +#endif { transaction t (db->begin ()); @@ -53,9 +60,21 @@ main (int argc, char* argv[]) result r1 (db->query (query::color == blue)); result r2 (db->query (query::taste == object::sweet)); + result r3 (db->query (query::position == object::left)); assert (r1.empty ()); assert (!r2.empty ()); + assert (!r3.empty ()); + +#ifdef HAVE_CXX11_ENUM + result r4 (db->query (query::gender == object::gender::female)); + result r5 (db->query (query::scale == object::scale::ten)); + result r6 (db->query (query::yesno == object::yesno::yes)); + + assert (!r4.empty ()); + assert (!r5.empty ()); + assert (!r6.empty ()); +#endif t.commit (); } diff --git a/common/enum/test.hxx b/common/enum/test.hxx index c1609fd..98ff0e9 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -6,6 +6,7 @@ #define TEST_HXX #include +#include // HAVE_CXX11_ENUM enum color {red, green, blue}; @@ -18,15 +19,37 @@ struct object color color_; enum taste {bitter, sweet, sour}; taste taste_; + + enum position {left = -1, center = 0, right = 1}; + position position_; + + +#ifdef HAVE_CXX11_ENUM + enum class gender {male, female}; + enum class scale: unsigned char {one = 1, ten = 10, hundred = 100}; + enum class yesno: bool {no, yes}; + + gender gender_; + scale scale_; + yesno yesno_; +#endif + }; inline bool operator == (const object& x, const object& y) { return - x.id_ == y.id_ && - x.color_ == y.color_ && - x.taste_ == y.taste_; + x.id_ == y.id_ + && x.color_ == y.color_ + && x.taste_ == y.taste_ + && x.position_ == y.position_ +#ifdef HAVE_CXX11_ENUM + && x.gender_ == y.gender_ + && x.scale_ == y.scale_ + && x.yesno_ == y.yesno_; +#endif + ; } #endif // TEST_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 17d1bd0..fe14255 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -15,6 +15,12 @@ #if (defined(_MSC_VER) && _MSC_VER >= 1600) || \ (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1600) # define HAVE_CXX11 +// Strongly typed enums are supported starting from VC++11. +// +# if (defined(_MSC_VER) && _MSC_VER >= 1700) || \ + (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1700) +# define HAVE_CXX11_ENUM +# endif #endif #endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index da45841..08cf0e5 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -9,6 +9,13 @@ # include #else # include + +// GCC supports strongly typed enums from 4.4 (forward -- 4.6), +// Clang -- 2.9 (3.1). +// +# ifdef HAVE_CXX11 +# define HAVE_CXX11_ENUM +# endif #endif #endif // LIBCOMMON_COMMON_CONFIG_HXX -- cgit v1.1 From df075357b5463e0c8f7d00e61bdb7b56388483d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Oct 2013 07:11:42 +0200 Subject: Remove unused typedef --- common/session/custom/session.txx | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index 803a27b..2fdd20e 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -10,8 +10,6 @@ _cache_insert (odb::database&, const typename odb::object_traits::id_type& id, const typename odb::object_traits::pointer_type& obj) { - typedef odb::object_traits object_traits; - if (current == 0) return cache_position (); // No session, return empty position. -- cgit v1.1 From 6905b767aefcb7c3d444f6fa33169eb882bd1dd2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 19 Oct 2013 08:16:29 +0200 Subject: Bump version to 2.3.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 5ec8dc2..276cbf9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.3.0.b2 +2.3.0 -- cgit v1.1 From e121dc6a5d73c53a3c1aebc9fa4ed187dd87aae5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Oct 2013 08:52:25 +0200 Subject: Disable test for VC++ --- mysql/custom/driver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index d9453ec..5170e76 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -32,8 +32,8 @@ main (int argc, char* argv[]) o.p = point (1.1111, 2222222222.2); o.pv.push_back (point (1.1234, 2.2345)); o.pv.push_back (point (3.3456, 4.4567)); - // VC8 just cannot roundtrip this. -#if !defined(_MSC_VER) || _MSC_VER >= 1500 + // VC just cannot roundtrip this. +#ifndef _MSC_VER o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. #endif -- cgit v1.1 From ec63060967e1c764e80655e8fd3bf40bd3872efd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Oct 2013 08:52:58 +0200 Subject: Don't use auto id for BLOB test This causes problems with SQL Server 2005. --- common/section/basics/driver.cxx | 2 +- common/section/basics/test.hxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index 67e09ef..f34ed90 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1125,7 +1125,7 @@ main (int argc, char* argv[]) { using namespace test14; - object o (123, "\x01\x02\x03\x04\x05"); + object o (1, 123, "\x01\x02\x03\x04\x05"); { transaction t (db->begin ()); diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index c129f3e..0ceb298 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -458,10 +458,10 @@ namespace test14 #pragma db object struct object { - object (int n_ = 999, const std::string& s_ = "xxx") - : sb (s_.begin (), s_.end ()), sn (n_), n (n_) {} + object (unsigned long id_ = 0, int n_ = 999, const std::string& s_ = "xxx") + : id (id_), sb (s_.begin (), s_.end ()), sn (n_), n (n_) {} - #pragma db id auto + #pragma db id unsigned long id; #pragma db load(lazy) -- cgit v1.1 From 33a8e17efb8c622413a861047c5c4589a9828f62 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Oct 2013 08:53:55 +0200 Subject: Disable SQLite foreign key checking while updating schema --- evolution/add-table/driver.cxx | 10 ++++++++++ evolution/soft-add/driver.cxx | 10 ++++++++++ evolution/soft-delete/driver.cxx | 11 ++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index bd62068..da4677e 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include // DATABASE_XXX #include #include "test2.hxx" @@ -45,11 +46,20 @@ main (int argc, char* argv[]) if (embedded) { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif transaction t (db->begin ()); schema_catalog::drop_schema (*db); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif } object o (1); diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 5ea54d5..699a21a 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -13,6 +13,7 @@ #include #include +#include // DATABASE_XXX #include #include "test2.hxx" @@ -45,11 +46,20 @@ main (int argc, char* argv[]) if (embedded) { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif transaction t (db->begin ()); schema_catalog::drop_schema (*db); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif } // Test basic soft-added member logic. diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index fa5c810..95b62b5 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -13,8 +13,8 @@ #include #include -#include #include // DATABASE_XXX +#include #include "test2.hxx" #include "test3.hxx" @@ -46,11 +46,20 @@ main (int argc, char* argv[]) if (embedded) { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif transaction t (db->begin ()); schema_catalog::drop_schema (*db); schema_catalog::create_schema (*db, "", false); schema_catalog::migrate_schema (*db, 2); t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif } // Test soft-deleted objects. -- cgit v1.1 From 4f22837bda784e29f17750c8f1d623b40c1093d4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Dec 2013 11:30:33 +0200 Subject: Implement on_delete pragma for object pointers Translates to the ON DELETE SQL clause. --- common/makefile | 5 +- common/relationship-query/driver.cxx | 173 ------------------ common/relationship-query/makefile | 115 ------------ common/relationship-query/test.hxx | 151 ---------------- common/relationship-query/test.std | 0 common/relationship/basics/driver.cxx | 159 +++++++++++++++++ common/relationship/basics/makefile | 115 ++++++++++++ common/relationship/basics/test.hxx | 291 +++++++++++++++++++++++++++++++ common/relationship/basics/test.std | 0 common/relationship/driver.cxx | 159 ----------------- common/relationship/makefile | 115 ------------ common/relationship/on-delete/driver.cxx | 81 +++++++++ common/relationship/on-delete/makefile | 117 +++++++++++++ common/relationship/on-delete/test.hxx | 59 +++++++ common/relationship/on-delete/test.std | 0 common/relationship/query/driver.cxx | 173 ++++++++++++++++++ common/relationship/query/makefile | 115 ++++++++++++ common/relationship/query/test.hxx | 151 ++++++++++++++++ common/relationship/query/test.std | 0 common/relationship/test.hxx | 291 ------------------------------- common/relationship/test.std | 0 21 files changed, 1264 insertions(+), 1006 deletions(-) delete mode 100644 common/relationship-query/driver.cxx delete mode 100644 common/relationship-query/makefile delete mode 100644 common/relationship-query/test.hxx delete mode 100644 common/relationship-query/test.std create mode 100644 common/relationship/basics/driver.cxx create mode 100644 common/relationship/basics/makefile create mode 100644 common/relationship/basics/test.hxx create mode 100644 common/relationship/basics/test.std delete mode 100644 common/relationship/driver.cxx delete mode 100644 common/relationship/makefile create mode 100644 common/relationship/on-delete/driver.cxx create mode 100644 common/relationship/on-delete/makefile create mode 100644 common/relationship/on-delete/test.hxx create mode 100644 common/relationship/on-delete/test.std create mode 100644 common/relationship/query/driver.cxx create mode 100644 common/relationship/query/makefile create mode 100644 common/relationship/query/test.hxx create mode 100644 common/relationship/query/test.std delete mode 100644 common/relationship/test.hxx delete mode 100644 common/relationship/test.std diff --git a/common/makefile b/common/makefile index 1ad2389..8aa48c1 100644 --- a/common/makefile +++ b/common/makefile @@ -38,8 +38,9 @@ prepared \ query/basics \ query/array \ readonly \ -relationship \ -relationship-query \ +relationship/basics \ +relationship/on-delete \ +relationship/query \ schema/namespace \ schema/embedded/basics \ schema/embedded/order \ diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx deleted file mode 100644 index 785aa94..0000000 --- a/common/relationship-query/driver.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// file : common/relationship-query/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test relationship queries. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // HAVE_CXX11, HAVE_TR1_MEMORY -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - - // - // - { - shared_ptr ca (new country ("CA", "Canada")); - shared_ptr za (new country ("ZA", "South Africa")); - shared_ptr us (new country ("US", "United States")); - shared_ptr se (new country ("SE", "Sweden")); - - shared_ptr st (new employer ("Simple Tech, Inc", ca)); - shared_ptr ct (new employer ("Complex Tech, Inc", us)); - - // person - // - shared_ptr p1 ( - new person (1, "John", "Doe", 30, ca, true, za)); - - shared_ptr p2 ( - new person (2, "Jane", "Doe", 29, za, false, us)); - p2->husband = p1; - - shared_ptr p3 ( - new person (3, "Joe", "Dirt", 31, us, true, us)); - - shared_ptr p4 ( - new person (4, "Johan", "Johansen", 32, se, false, ca)); - - // employee - // - shared_ptr e1 ( - new employee (1, "John", "Doe", 30, ca, true, za, st)); - - shared_ptr e2 ( - new employee (2, "Jane", "Doe", 29, za, false, us, ct)); - e2->husband = p1; - - shared_ptr e3 ( - new employee (3, "Joe", "Dirt", 31, us, true, us, st)); - - shared_ptr e4 ( - new employee (4, "Johan", "Johansen", 32, se, false, ca, ct)); - - transaction t (db->begin ()); - db->persist (ca); - db->persist (za); - db->persist (us); - db->persist (se); - - db->persist (st); - db->persist (ct); - - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - - db->persist (e1); - db->persist (e2); - db->persist (e3); - db->persist (e4); - t.commit (); - } - - typedef odb::query p_query; - typedef odb::result p_result; - - typedef odb::query e_query; - typedef odb::result e_result; - - // Make sure we have an independent JOIN for each relationship. - // - { - session s; - transaction t (db->begin ()); - - p_result pr (db->query ( - p_query::residence.location->code == "ZA")); - assert (size (pr) == 1); - - e_result er (db->query ( - e_query::residence.location->code == "ZA")); - assert (size (er) == 1); - - t.commit (); - } - - // Test Self-JOIN. - // - { - session s; - transaction t (db->begin ()); - - p_result pr (db->query (p_query::husband->last_name == "Doe")); - assert (size (pr) == 1); - - e_result er (db->query (e_query::husband->last_name == "Doe")); - assert (size (er) == 1); - - t.commit (); - } - - // Test query conditions from both base and derived. - // - { - session s; - transaction t (db->begin ()); - - e_result r ( - db->query ( - e_query::employed_by->name == "Simple Tech, Inc" && - e_query::nationality->code == "US")); - - assert (size (r) == 1); - - t.commit (); - } - - // Test second-level pointers. - // - { - session s; - transaction t (db->begin ()); - - p_result r ( - db->query ( - p_query::husband->residence.location == "CA")); - - assert (size (r) == 1); - - t.commit (); - } - -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY - - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile deleted file mode 100644 index 14d5e5c..0000000 --- a/common/relationship-query/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/relationship-query/makefile -# copyright : Copyright (c) 2009-2013 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix relationship_query_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx deleted file mode 100644 index b2f9568..0000000 --- a/common/relationship-query/test.hxx +++ /dev/null @@ -1,151 +0,0 @@ -// file : common/relationship-query/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - -#include - -#include - -#ifdef HAVE_CXX11 -# include -using std::shared_ptr; -#else -# include -using std::tr1::shared_ptr; -#endif - -struct country; - -#pragma db value -struct residence_info -{ - residence_info (bool p, shared_ptr l) - : permanent (p), location (l) - { - } - - residence_info () - { - } - - bool permanent; - - #pragma db not_null - shared_ptr location; -}; - -#pragma db object pointer(shared_ptr) -struct person -{ - person (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - shared_ptr r, - bool p, - shared_ptr n) - : id (i), - first_name (fn), - last_name (ln), - age (a), - residence (p, r), - nationality (n) - { - } - - person () - { - } - - #pragma db id - unsigned long id; - - #pragma db column ("first") - std::string first_name; - - #pragma db column ("last") - std::string last_name; - - unsigned short age; - - residence_info residence; - - #pragma db not_null - shared_ptr nationality; - - shared_ptr husband; // Self-join. -}; - -struct employer; - -#pragma db object pointer(shared_ptr) -struct employee: person -{ - employee (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - shared_ptr r, - bool p, - shared_ptr n, - shared_ptr e) - : person (i, fn, ln, a, r, p, n), - employed_by (e) - { - } - - employee () - { - } - - shared_ptr employed_by; -}; - -#pragma db object pointer(shared_ptr) -struct employer -{ - employer (const std::string& n, shared_ptr nat) - : name (n), nationality (nat) - { - } - - employer () - { - } - - #pragma db id - std::string name; - - // The same member name and type as in person (test JOIN alias). - // - #pragma db not_null - shared_ptr nationality; -}; - -#pragma db object pointer(shared_ptr) -struct country -{ - country (const std::string& c, std::string const& n) - : code (c), name (n) - { - } - - country () - { - } - - #pragma db id - std::string code; // ISO 2-letter country code. - - std::string name; -}; - -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY -#endif // TEST_HXX diff --git a/common/relationship-query/test.std b/common/relationship-query/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx new file mode 100644 index 0000000..8ad866f --- /dev/null +++ b/common/relationship/basics/driver.cxx @@ -0,0 +1,159 @@ +// file : common/relationship/basics/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object relationships. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + aggr a ("aggr"); + a.o1 = new obj1 ("o1", "obj1"); + a.o2.reset (new obj2 ("obj2")); + +#ifdef HAVE_CXX11 + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); + a.v2.push_back (0); + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); +#endif + +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + a.o3.reset (new obj3 ("obj3")); + + a.c.num = 123; + a.c.o3.reset (new obj3 ("c")); + + a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); + a.cv.push_back (comp (235, obj3_ptr ())); + a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); +#endif + + a.v1.push_back (new obj1 ("v1 0", "v1 0")); + a.v1.push_back (0); + a.v1.push_back (new obj1 ("v1 2", "v1 2")); + + // Set cannot contain NULL pointers. + // + a.s1.insert (new obj1 ("s1 0", "s1 0")); + a.s1.insert (new obj1 ("s1 2", "s1 2")); + + a.m1[0] = new obj1 ("m1 0", "m1 0"); + a.m1[1] = 0; + a.m1[2] = new obj1 ("m1 2", "m1 2"); + + // persist + // + { + transaction t (db->begin ()); + db->persist (a.o1); + db->persist (a.o2); + +#ifdef HAVE_CXX11 + for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) + if (*i) + db->persist (*i); +#endif + +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + db->persist (a.o3); + + db->persist (a.c.o3); + + for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) + if (i->o3) + db->persist (i->o3); +#endif + + for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) + if (*i) + db->persist (*i); + + for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) + if (*i) + db->persist (*i); + + for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) + if (i->second) + db->persist (i->second); + + db->persist (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + + // query + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o1->str == "obj1")); + assert (!r.empty ()); + assert (r.begin ()->o1->id == a.o1->id); + assert (size (r) == 1); + + t.commit (); + } + + // Test NULL pointer. + // + delete a.o1; + a.o1 = 0; + a.o2.reset (); +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + a.o3.reset (); +#endif + + { + transaction t (db->begin ()); + db->update (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + auto_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile new file mode 100644 index 0000000..068f60a --- /dev/null +++ b/common/relationship/basics/makefile @@ -0,0 +1,115 @@ +# file : common/relationship/basics/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_rel_basics_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx new file mode 100644 index 0000000..a320c00 --- /dev/null +++ b/common/relationship/basics/test.hxx @@ -0,0 +1,291 @@ +// file : common/relationship/basics/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#include +#include +#include +#include +#include + +#include + +#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) +# include +#endif + +// Raw pointer. +// +#pragma db object pointer(obj1*) +struct obj1 +{ + obj1 () {} + obj1 (const std::string& i, const std::string& s): id (i), str (s) {} + + #pragma db id + std::string id; + std::string str; +}; + +inline bool +operator== (const obj1& x, const obj1& y) +{ + return x.id == y.id && x.str == y.str; +} + +// vector +// +typedef std::vector obj1_vec; + +inline bool +operator== (const obj1_vec& x, const obj1_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} + +// set +// +struct obj1_cmp +{ + bool + operator() (obj1* x, obj1* y) const + { + return (!x || !y) ? x < y : x->id < y->id; + } +}; + +typedef std::set obj1_set; + +inline bool +operator== (const obj1_set& x, const obj1_set& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_set::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_set::const_iterator j (y.find (*i)); + + if (j == y.end ()) + return false; + + obj1* x (*i); + obj1* y (*j); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// map +// +typedef std::map obj1_map; + +inline bool +operator== (const obj1_map& x, const obj1_map& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_map::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_map::const_iterator j (y.find (i->first)); + + if (j == y.end ()) + return false; + + obj1* x (i->second); + obj1* y (j->second); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// auto_ptr/unique_ptr +// +struct obj2; + +#ifdef HAVE_CXX11 +typedef std::unique_ptr obj2_ptr; +#else +typedef std::auto_ptr obj2_ptr; +#endif + +#pragma db object pointer(obj2_ptr) +struct obj2 +{ + obj2 () {} + obj2 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj2& x, const obj2& y) +{ + return x.id == y.id && x.str == y.str; +} + +#ifdef HAVE_CXX11 +typedef std::vector obj2_vec; + +inline bool +operator== (const obj2_vec& x, const obj2_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj2_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} +#endif + +// shared_ptr +// +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) +struct obj3; + +#ifdef HAVE_CXX11 +typedef std::shared_ptr obj3_ptr; +#else +typedef std::tr1::shared_ptr obj3_ptr; +#endif + +#pragma db object pointer(obj3_ptr) +struct obj3 +{ + obj3 () {} + obj3 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj3& x, const obj3& y) +{ + return x.id == y.id && x.str == y.str; +} + +// composite +// +#pragma db value +struct comp +{ + comp () {} + comp (int n, obj3_ptr o): num (n), o3 (o) {} + + int num; + obj3_ptr o3; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && + (x.o3 ? (y.o3 && *x.o3 == *y.o3) : !y.o3); +} + +typedef std::vector comp_vec; +#endif + +// +// +#pragma db object +struct aggr +{ + aggr (): o1 (0) {} + aggr (const std::string& s): o1 (0), str (s) {} + + ~aggr () + { + delete o1; + + for (obj1_vec::iterator i (v1.begin ()); i != v1.end (); ++i) + delete *i; + + for (obj1_set::iterator i (s1.begin ()); i != s1.end (); ++i) + delete *i; + + for (obj1_map::iterator i (m1.begin ()); i != m1.end (); ++i) + delete i->second; + } + + #pragma db id auto + unsigned long id; + + obj1* o1; + + obj2_ptr o2; // std::auto_ptr or std::unique_ptr +#ifdef HAVE_CXX11 + obj2_vec v2; +#else + // Dummy containers to get the equivalent DROP TABLE statements. + // + std::vector v2; +#endif + +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + obj3_ptr o3; + comp c; + comp_vec cv; +#endif + + obj1_vec v1; + obj1_set s1; + obj1_map m1; + + std::string str; + +private: + aggr (const aggr&); + aggr& operator= (const aggr&); +}; + +inline bool +operator== (const aggr& x, const aggr& y) +{ + return + x.id == y.id && + (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && + (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && +#ifdef HAVE_CXX11 + x.v2 == y.v2 && +#endif +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && + x.c == y.c && + x.cv == y.cv && +#endif + x.v1 == y.v1 && + x.s1 == y.s1 && + x.m1 == y.m1 && + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/common/relationship/basics/test.std b/common/relationship/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx deleted file mode 100644 index 127a894..0000000 --- a/common/relationship/driver.cxx +++ /dev/null @@ -1,159 +0,0 @@ -// file : common/relationship/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object relationships. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - aggr a ("aggr"); - a.o1 = new obj1 ("o1", "obj1"); - a.o2.reset (new obj2 ("obj2")); - -#ifdef HAVE_CXX11 - a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); - a.v2.push_back (0); - a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); -#endif - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - a.o3.reset (new obj3 ("obj3")); - - a.c.num = 123; - a.c.o3.reset (new obj3 ("c")); - - a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); - a.cv.push_back (comp (235, obj3_ptr ())); - a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); -#endif - - a.v1.push_back (new obj1 ("v1 0", "v1 0")); - a.v1.push_back (0); - a.v1.push_back (new obj1 ("v1 2", "v1 2")); - - // Set cannot contain NULL pointers. - // - a.s1.insert (new obj1 ("s1 0", "s1 0")); - a.s1.insert (new obj1 ("s1 2", "s1 2")); - - a.m1[0] = new obj1 ("m1 0", "m1 0"); - a.m1[1] = 0; - a.m1[2] = new obj1 ("m1 2", "m1 2"); - - // persist - // - { - transaction t (db->begin ()); - db->persist (a.o1); - db->persist (a.o2); - -#ifdef HAVE_CXX11 - for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) - if (*i) - db->persist (*i); -#endif - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - db->persist (a.o3); - - db->persist (a.c.o3); - - for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) - if (i->o3) - db->persist (i->o3); -#endif - - for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) - if (*i) - db->persist (*i); - - for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) - if (*i) - db->persist (*i); - - for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) - if (i->second) - db->persist (i->second); - - db->persist (a); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - auto_ptr a1 (db->load (a.id)); - t.commit (); - - assert (*a1 == a); - } - - // query - // - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query (query::o1->str == "obj1")); - assert (!r.empty ()); - assert (r.begin ()->o1->id == a.o1->id); - assert (size (r) == 1); - - t.commit (); - } - - // Test NULL pointer. - // - delete a.o1; - a.o1 = 0; - a.o2.reset (); -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - a.o3.reset (); -#endif - - { - transaction t (db->begin ()); - db->update (a); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - auto_ptr a1 (db->load (a.id)); - t.commit (); - - assert (*a1 == a); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/relationship/makefile b/common/relationship/makefile deleted file mode 100644 index 5857ca0..0000000 --- a/common/relationship/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/relationship/makefile -# copyright : Copyright (c) 2009-2013 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_relationship_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx new file mode 100644 index 0000000..25b534b --- /dev/null +++ b/common/relationship/on-delete/driver.cxx @@ -0,0 +1,81 @@ +// file : common/relationship/on-delete/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test ON DELETE functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + cascade c; + c.p = &o; + + cascade_cont cc; + cc.p.push_back (&o); + + set_null n; + n.p = &o; + + set_null_cont nc; + nc.p.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (c); + db->persist (cc); + db->persist (n); + db->persist (nc); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->find (c.id) == 0); + + auto_ptr pcc (db->load (cc.id)); + assert (pcc->p.empty ()); + + auto_ptr pn (db->load (n.id)); + assert (pn->p == 0); + + auto_ptr pnc (db->load (nc.id)); + assert (pnc->p.size () == 1 && pnc->p[0] == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile new file mode 100644 index 0000000..bdda5be --- /dev/null +++ b/common/relationship/on-delete/makefile @@ -0,0 +1,117 @@ +# file : common/relationship/on-delete/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema \ +--fkeys-deferrable-mode mysql:not_deferrable \ +--fkeys-deferrable-mode mssql:not_deferrable \ +--table-prefix t_rel_on_d_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx new file mode 100644 index 0000000..dba04c3 --- /dev/null +++ b/common/relationship/on-delete/test.hxx @@ -0,0 +1,59 @@ +// file : common/relationship/on-delete/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; +}; + +#pragma db object +struct cascade +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + object* p; +}; + +#pragma db object +struct cascade_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + std::vector p; +}; + +#pragma db object +struct set_null +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + object* p; +}; + +#pragma db object +struct set_null_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + std::vector p; +}; + +#endif // TEST_HXX diff --git a/common/relationship/on-delete/test.std b/common/relationship/on-delete/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx new file mode 100644 index 0000000..2ca05f4 --- /dev/null +++ b/common/relationship/query/driver.cxx @@ -0,0 +1,173 @@ +// file : common/relationship-query/query/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test relationship queries. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // HAVE_CXX11, HAVE_TR1_MEMORY +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + + // + // + { + shared_ptr ca (new country ("CA", "Canada")); + shared_ptr za (new country ("ZA", "South Africa")); + shared_ptr us (new country ("US", "United States")); + shared_ptr se (new country ("SE", "Sweden")); + + shared_ptr st (new employer ("Simple Tech, Inc", ca)); + shared_ptr ct (new employer ("Complex Tech, Inc", us)); + + // person + // + shared_ptr p1 ( + new person (1, "John", "Doe", 30, ca, true, za)); + + shared_ptr p2 ( + new person (2, "Jane", "Doe", 29, za, false, us)); + p2->husband = p1; + + shared_ptr p3 ( + new person (3, "Joe", "Dirt", 31, us, true, us)); + + shared_ptr p4 ( + new person (4, "Johan", "Johansen", 32, se, false, ca)); + + // employee + // + shared_ptr e1 ( + new employee (1, "John", "Doe", 30, ca, true, za, st)); + + shared_ptr e2 ( + new employee (2, "Jane", "Doe", 29, za, false, us, ct)); + e2->husband = p1; + + shared_ptr e3 ( + new employee (3, "Joe", "Dirt", 31, us, true, us, st)); + + shared_ptr e4 ( + new employee (4, "Johan", "Johansen", 32, se, false, ca, ct)); + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (st); + db->persist (ct); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + + db->persist (e1); + db->persist (e2); + db->persist (e3); + db->persist (e4); + t.commit (); + } + + typedef odb::query p_query; + typedef odb::result p_result; + + typedef odb::query e_query; + typedef odb::result e_result; + + // Make sure we have an independent JOIN for each relationship. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query ( + p_query::residence.location->code == "ZA")); + assert (size (pr) == 1); + + e_result er (db->query ( + e_query::residence.location->code == "ZA")); + assert (size (er) == 1); + + t.commit (); + } + + // Test Self-JOIN. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query (p_query::husband->last_name == "Doe")); + assert (size (pr) == 1); + + e_result er (db->query (e_query::husband->last_name == "Doe")); + assert (size (er) == 1); + + t.commit (); + } + + // Test query conditions from both base and derived. + // + { + session s; + transaction t (db->begin ()); + + e_result r ( + db->query ( + e_query::employed_by->name == "Simple Tech, Inc" && + e_query::nationality->code == "US")); + + assert (size (r) == 1); + + t.commit (); + } + + // Test second-level pointers. + // + { + session s; + transaction t (db->begin ()); + + p_result r ( + db->query ( + p_query::husband->residence.location == "CA")); + + assert (size (r) == 1); + + t.commit (); + } + +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile new file mode 100644 index 0000000..3a43749 --- /dev/null +++ b/common/relationship/query/makefile @@ -0,0 +1,115 @@ +# file : common/relationship-query/query/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix t_rel_query_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx new file mode 100644 index 0000000..3876b27 --- /dev/null +++ b/common/relationship/query/test.hxx @@ -0,0 +1,151 @@ +// file : common/relationship-query/query/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11, HAVE_TR1_MEMORY + +#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + +#include + +#include + +#ifdef HAVE_CXX11 +# include +using std::shared_ptr; +#else +# include +using std::tr1::shared_ptr; +#endif + +struct country; + +#pragma db value +struct residence_info +{ + residence_info (bool p, shared_ptr l) + : permanent (p), location (l) + { + } + + residence_info () + { + } + + bool permanent; + + #pragma db not_null + shared_ptr location; +}; + +#pragma db object pointer(shared_ptr) +struct person +{ + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + shared_ptr r, + bool p, + shared_ptr n) + : id (i), + first_name (fn), + last_name (ln), + age (a), + residence (p, r), + nationality (n) + { + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column ("first") + std::string first_name; + + #pragma db column ("last") + std::string last_name; + + unsigned short age; + + residence_info residence; + + #pragma db not_null + shared_ptr nationality; + + shared_ptr husband; // Self-join. +}; + +struct employer; + +#pragma db object pointer(shared_ptr) +struct employee: person +{ + employee (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + shared_ptr r, + bool p, + shared_ptr n, + shared_ptr e) + : person (i, fn, ln, a, r, p, n), + employed_by (e) + { + } + + employee () + { + } + + shared_ptr employed_by; +}; + +#pragma db object pointer(shared_ptr) +struct employer +{ + employer (const std::string& n, shared_ptr nat) + : name (n), nationality (nat) + { + } + + employer () + { + } + + #pragma db id + std::string name; + + // The same member name and type as in person (test JOIN alias). + // + #pragma db not_null + shared_ptr nationality; +}; + +#pragma db object pointer(shared_ptr) +struct country +{ + country (const std::string& c, std::string const& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +#endif // HAVE_CXX11 || HAVE_TR1_MEMORY +#endif // TEST_HXX diff --git a/common/relationship/query/test.std b/common/relationship/query/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx deleted file mode 100644 index ecfd6a3..0000000 --- a/common/relationship/test.hxx +++ /dev/null @@ -1,291 +0,0 @@ -// file : common/relationship/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#include -#include -#include -#include -#include - -#include - -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - -// Raw pointer. -// -#pragma db object pointer(obj1*) -struct obj1 -{ - obj1 () {} - obj1 (const std::string& i, const std::string& s): id (i), str (s) {} - - #pragma db id - std::string id; - std::string str; -}; - -inline bool -operator== (const obj1& x, const obj1& y) -{ - return x.id == y.id && x.str == y.str; -} - -// vector -// -typedef std::vector obj1_vec; - -inline bool -operator== (const obj1_vec& x, const obj1_vec& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_vec::size_type i (0); i < x.size (); ++i) - if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) - return false; - - return true; -} - -// set -// -struct obj1_cmp -{ - bool - operator() (obj1* x, obj1* y) const - { - return (!x || !y) ? x < y : x->id < y->id; - } -}; - -typedef std::set obj1_set; - -inline bool -operator== (const obj1_set& x, const obj1_set& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_set::const_iterator i (x.begin ()); i != x.end (); ++i) - { - obj1_set::const_iterator j (y.find (*i)); - - if (j == y.end ()) - return false; - - obj1* x (*i); - obj1* y (*j); - - if (!(x ? (y && *x == *y) : !y)) - return false; - } - - return true; -} - -// map -// -typedef std::map obj1_map; - -inline bool -operator== (const obj1_map& x, const obj1_map& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_map::const_iterator i (x.begin ()); i != x.end (); ++i) - { - obj1_map::const_iterator j (y.find (i->first)); - - if (j == y.end ()) - return false; - - obj1* x (i->second); - obj1* y (j->second); - - if (!(x ? (y && *x == *y) : !y)) - return false; - } - - return true; -} - -// auto_ptr/unique_ptr -// -struct obj2; - -#ifdef HAVE_CXX11 -typedef std::unique_ptr obj2_ptr; -#else -typedef std::auto_ptr obj2_ptr; -#endif - -#pragma db object pointer(obj2_ptr) -struct obj2 -{ - obj2 () {} - obj2 (const std::string& s): str (s) {} - - #pragma db id auto - unsigned long id; - - std::string str; -}; - -inline bool -operator== (const obj2& x, const obj2& y) -{ - return x.id == y.id && x.str == y.str; -} - -#ifdef HAVE_CXX11 -typedef std::vector obj2_vec; - -inline bool -operator== (const obj2_vec& x, const obj2_vec& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj2_vec::size_type i (0); i < x.size (); ++i) - if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) - return false; - - return true; -} -#endif - -// shared_ptr -// -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) -struct obj3; - -#ifdef HAVE_CXX11 -typedef std::shared_ptr obj3_ptr; -#else -typedef std::tr1::shared_ptr obj3_ptr; -#endif - -#pragma db object pointer(obj3_ptr) -struct obj3 -{ - obj3 () {} - obj3 (const std::string& s): str (s) {} - - #pragma db id auto - unsigned long id; - - std::string str; -}; - -inline bool -operator== (const obj3& x, const obj3& y) -{ - return x.id == y.id && x.str == y.str; -} - -// composite -// -#pragma db value -struct comp -{ - comp () {} - comp (int n, obj3_ptr o): num (n), o3 (o) {} - - int num; - obj3_ptr o3; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && - (x.o3 ? (y.o3 && *x.o3 == *y.o3) : !y.o3); -} - -typedef std::vector comp_vec; -#endif - -// -// -#pragma db object -struct aggr -{ - aggr (): o1 (0) {} - aggr (const std::string& s): o1 (0), str (s) {} - - ~aggr () - { - delete o1; - - for (obj1_vec::iterator i (v1.begin ()); i != v1.end (); ++i) - delete *i; - - for (obj1_set::iterator i (s1.begin ()); i != s1.end (); ++i) - delete *i; - - for (obj1_map::iterator i (m1.begin ()); i != m1.end (); ++i) - delete i->second; - } - - #pragma db id auto - unsigned long id; - - obj1* o1; - - obj2_ptr o2; // std::auto_ptr or std::unique_ptr -#ifdef HAVE_CXX11 - obj2_vec v2; -#else - // Dummy containers to get the equivalent DROP TABLE statements. - // - std::vector v2; -#endif - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - obj3_ptr o3; - comp c; - comp_vec cv; -#endif - - obj1_vec v1; - obj1_set s1; - obj1_map m1; - - std::string str; - -private: - aggr (const aggr&); - aggr& operator= (const aggr&); -}; - -inline bool -operator== (const aggr& x, const aggr& y) -{ - return - x.id == y.id && - (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && - (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && -#ifdef HAVE_CXX11 - x.v2 == y.v2 && -#endif -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && - x.c == y.c && - x.cv == y.cv && -#endif - x.v1 == y.v1 && - x.s1 == y.s1 && - x.m1 == y.m1 && - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/common/relationship/test.std b/common/relationship/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1 From 3e7505ef33790552f2147b1f7a87d927aeac6b56 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Dec 2013 10:21:28 +0200 Subject: Fix invalid paths in makefiles --- common/relationship/basics/makefile | 10 +++++----- common/relationship/on-delete/makefile | 10 +++++----- common/relationship/query/makefile | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index 068f60a..a1fcf27 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -57,11 +57,11 @@ $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ $(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index bdda5be..e20ef2c 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -59,11 +59,11 @@ $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ $(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index 3a43749..b1a8ff8 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -57,11 +57,11 @@ $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ $(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) # Test. # -- cgit v1.1 From e5264909fabf552ca11ea80d2512768752d5cef8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Dec 2013 10:23:26 +0200 Subject: Bump version to 2.4.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 276cbf9..af8e8ad 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.3.0 +2.4.0.a1 -- cgit v1.1 From 8cc8d56dbaeb4360a436aaa101cc95f6d0564143 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 1 Mar 2014 08:47:33 +0200 Subject: Bump version to 2.4.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index af8e8ad..dd4b617 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a1 +2.4.0.a2 -- cgit v1.1 From 8253d9fdd049a87cd34c65b6d1a643bb091479a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 May 2014 07:35:40 -0700 Subject: Delete output file in case of failure --- tester.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tester.in b/tester.in index e2d5297..f9beb02 100755 --- a/tester.in +++ b/tester.in @@ -30,6 +30,7 @@ if test -f "$srcdir/test.std"; then ./driver --options-file "$db_options" >test.out if test $? -ne 0; then + rm -f test.out exit 1 fi -- cgit v1.1 From 419d6b8fd02a149dd9f05b3ffbf4a7676e6e8b34 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Jun 2014 18:28:36 +0200 Subject: Support for VC12 (2013), initial work --- boost/build.bat | 1 + boost/common/boost-common-vc12.sln | 17 ++ boost/common/makefile | 5 +- boost/common/multi-index/makefile | 5 +- boost/common/optional/makefile | 5 +- boost/common/smart-ptr/makefile | 5 +- boost/common/template/makefile | 5 +- boost/common/template/template-vc12.vcxproj | 185 +++++++++++++++++++ .../common/template/template-vc12.vcxproj.filters | 24 +++ boost/common/unordered/makefile | 5 +- boost/common/uuid/makefile | 5 +- boost/mssql/boost-mssql-vc12.sln | 17 ++ boost/mssql/date-time/makefile | 5 +- boost/mssql/makefile | 4 +- boost/mssql/template/makefile | 5 +- boost/mssql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ boost/mssql/template/template-vc12.vcxproj.filters | 25 +++ boost/mysql/boost-mysql-vc12.sln | 17 ++ boost/mysql/date-time/makefile | 5 +- boost/mysql/makefile | 4 +- boost/mysql/template/makefile | 5 +- boost/mysql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ boost/mysql/template/template-vc12.vcxproj.filters | 25 +++ boost/oracle/boost-oracle-vc12.sln | 17 ++ boost/oracle/date-time/makefile | 5 +- boost/oracle/makefile | 4 +- boost/oracle/template/makefile | 5 +- boost/oracle/template/template-vc12.vcxproj | 188 +++++++++++++++++++ .../oracle/template/template-vc12.vcxproj.filters | 25 +++ boost/pgsql/boost-pgsql-vc12.sln | 17 ++ boost/pgsql/date-time/makefile | 5 +- boost/pgsql/makefile | 4 +- boost/pgsql/template/makefile | 5 +- boost/pgsql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ boost/pgsql/template/template-vc12.vcxproj.filters | 25 +++ boost/sqlite/boost-sqlite-vc12.sln | 17 ++ boost/sqlite/date-time/makefile | 5 +- boost/sqlite/makefile | 4 +- boost/sqlite/template/makefile | 5 +- boost/sqlite/template/template-vc12.vcxproj | 188 +++++++++++++++++++ .../sqlite/template/template-vc12.vcxproj.filters | 25 +++ build.bat | 1 + common/access/makefile | 5 +- common/auto/makefile | 5 +- common/blob/makefile | 5 +- common/callback/makefile | 5 +- common/circular/multiple/makefile | 5 +- common/circular/single/makefile | 5 +- common/common-vc12.sln | 17 ++ common/composite-id/makefile | 5 +- common/composite/makefile | 5 +- common/const-member/makefile | 5 +- common/const-object/makefile | 5 +- common/container/basics/makefile | 5 +- common/container/change-tracking/makefile | 5 +- common/ctor/makefile | 5 +- common/default/makefile | 5 +- common/definition/makefile | 5 +- common/enum/makefile | 5 +- common/erase-query/makefile | 5 +- common/index/makefile | 5 +- common/inheritance/polymorphism/makefile | 5 +- common/inheritance/reuse/makefile | 5 +- common/inheritance/transient/makefile | 5 +- common/inverse/makefile | 5 +- common/lazy-ptr/makefile | 5 +- common/lifecycle/makefile | 5 +- common/makefile | 5 +- common/no-id/makefile | 5 +- common/optimistic/makefile | 5 +- common/pragma/makefile | 5 +- common/prepared/makefile | 5 +- common/query/array/makefile | 5 +- common/query/basics/makefile | 5 +- common/readonly/makefile | 5 +- common/relationship/basics/makefile | 5 +- common/relationship/on-delete/makefile | 5 +- common/relationship/query/makefile | 5 +- common/schema/embedded/basics/makefile | 5 +- common/schema/embedded/order/makefile | 5 +- common/schema/namespace/makefile | 5 +- common/section/basics/makefile | 5 +- common/section/polymorphism/makefile | 5 +- common/session/cache/makefile | 5 +- common/session/custom/makefile | 5 +- common/statement/processing/makefile | 5 +- common/template/makefile | 5 +- common/template/template-vc12.vcxproj | 193 +++++++++++++++++++ common/template/template-vc12.vcxproj.filters | 28 +++ common/threads/makefile | 5 +- common/transaction/basics/makefile | 5 +- common/transaction/callback/makefile | 5 +- common/types/makefile | 5 +- common/view/makefile | 5 +- common/virtual/makefile | 5 +- common/wrapper/makefile | 5 +- evolution/add-column/makefile | 5 +- evolution/add-foreign-key/makefile | 5 +- evolution/add-index/makefile | 5 +- evolution/add-table/makefile | 5 +- evolution/alter-column/makefile | 5 +- evolution/combined/makefile | 5 +- evolution/data/makefile | 5 +- evolution/drop-column/makefile | 5 +- evolution/drop-foreign-key/makefile | 5 +- evolution/drop-index/makefile | 5 +- evolution/drop-table/makefile | 5 +- evolution/embedded/makefile | 5 +- evolution/evolution-vc12.sln | 17 ++ evolution/makefile | 4 +- evolution/soft-add/makefile | 5 +- evolution/soft-delete/makefile | 5 +- evolution/template/makefile | 5 +- evolution/template/template-vc12.vcxproj | 204 +++++++++++++++++++++ evolution/template/template-vc12.vcxproj.filters | 32 ++++ evolution/version/makefile | 5 +- libcommon/common/libcommon-vc12.vcxproj | 182 ++++++++++++++++++ libcommon/common/libcommon-vc12.vcxproj.filters | 19 ++ libcommon/common/makefile | 4 +- libcommon/libcommon-vc12.sln | 28 +++ libcommon/makefile | 2 + mssql/custom/makefile | 5 +- mssql/database/makefile | 5 +- mssql/makefile | 4 +- mssql/mssql-vc12.sln | 17 ++ mssql/native/makefile | 5 +- mssql/query/makefile | 5 +- mssql/template/makefile | 5 +- mssql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ mssql/template/template-vc12.vcxproj.filters | 25 +++ mssql/types/makefile | 5 +- mysql/custom/makefile | 5 +- mysql/database/makefile | 5 +- mysql/index/makefile | 5 +- mysql/makefile | 4 +- mysql/mysql-vc12.sln | 17 ++ mysql/native/makefile | 5 +- mysql/template/makefile | 5 +- mysql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ mysql/template/template-vc12.vcxproj.filters | 25 +++ mysql/truncation/makefile | 5 +- mysql/types/makefile | 5 +- oracle/custom/makefile | 5 +- oracle/database/makefile | 5 +- oracle/makefile | 4 +- oracle/native/makefile | 5 +- oracle/oracle-vc12.sln | 17 ++ oracle/template/makefile | 5 +- oracle/template/template-vc12.vcxproj | 188 +++++++++++++++++++ oracle/template/template-vc12.vcxproj.filters | 25 +++ oracle/types/makefile | 5 +- pgsql/custom/makefile | 5 +- pgsql/database/makefile | 5 +- pgsql/index/makefile | 5 +- pgsql/makefile | 4 +- pgsql/native/makefile | 5 +- pgsql/pgsql-vc12.sln | 17 ++ pgsql/template/makefile | 5 +- pgsql/template/template-vc12.vcxproj | 188 +++++++++++++++++++ pgsql/template/template-vc12.vcxproj.filters | 25 +++ pgsql/truncation/makefile | 5 +- pgsql/types/makefile | 5 +- qt/build.bat | 1 + qt/common/basic/makefile | 6 +- qt/common/containers/basics/makefile | 6 +- qt/common/containers/change-tracking/makefile | 6 +- qt/common/makefile | 6 +- qt/common/qt-common-qt4-vc12.sln | 17 ++ qt/common/qt-common-qt5-vc12.sln | 17 ++ qt/common/smart-ptr/makefile | 6 +- qt/common/template/makefile | 6 +- qt/common/template/template-qt4-vc12.vcxproj | 185 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 24 +++ qt/common/template/template-qt5-vc12.vcxproj | 185 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 24 +++ qt/mssql/basic/makefile | 7 +- qt/mssql/date-time/makefile | 7 +- qt/mssql/makefile | 6 +- qt/mssql/qt-mssql-qt4-vc12.sln | 17 ++ qt/mssql/qt-mssql-qt5-vc12.sln | 17 ++ qt/mssql/template/makefile | 7 +- qt/mssql/template/template-qt4-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 25 +++ qt/mssql/template/template-qt5-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 25 +++ qt/mysql/basic/makefile | 7 +- qt/mysql/date-time/makefile | 7 +- qt/mysql/makefile | 6 +- qt/mysql/qt-mysql-qt4-vc12.sln | 17 ++ qt/mysql/qt-mysql-qt5-vc12.sln | 17 ++ qt/mysql/template/makefile | 7 +- qt/mysql/template/template-qt4-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 25 +++ qt/mysql/template/template-qt5-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 25 +++ qt/oracle/basic/makefile | 7 +- qt/oracle/date-time/makefile | 7 +- qt/oracle/makefile | 6 +- qt/oracle/qt-oracle-qt4-vc12.sln | 17 ++ qt/oracle/qt-oracle-qt5-vc12.sln | 17 ++ qt/oracle/template/makefile | 7 +- qt/oracle/template/template-qt4-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 25 +++ qt/oracle/template/template-qt5-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 25 +++ qt/pgsql/basic/makefile | 7 +- qt/pgsql/date-time/makefile | 7 +- qt/pgsql/makefile | 6 +- qt/pgsql/qt-pgsql-qt4-vc12.sln | 17 ++ qt/pgsql/qt-pgsql-qt5-vc12.sln | 17 ++ qt/pgsql/template/makefile | 7 +- qt/pgsql/template/template-qt4-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 25 +++ qt/pgsql/template/template-qt5-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 25 +++ qt/sqlite/basic/makefile | 7 +- qt/sqlite/date-time/makefile | 7 +- qt/sqlite/makefile | 6 +- qt/sqlite/qt-sqlite-qt4-vc12.sln | 17 ++ qt/sqlite/qt-sqlite-qt5-vc12.sln | 17 ++ qt/sqlite/template/makefile | 7 +- qt/sqlite/template/template-qt4-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt4-vc12.vcxproj.filters | 25 +++ qt/sqlite/template/template-qt5-vc12.vcxproj | 188 +++++++++++++++++++ .../template/template-qt5-vc12.vcxproj.filters | 25 +++ sqlite/custom/makefile | 5 +- sqlite/database/makefile | 5 +- sqlite/makefile | 4 +- sqlite/native/makefile | 5 +- sqlite/sqlite-vc12.sln | 17 ++ sqlite/template/makefile | 5 +- sqlite/template/template-vc12.vcxproj | 188 +++++++++++++++++++ sqlite/template/template-vc12.vcxproj.filters | 25 +++ sqlite/transaction/makefile | 5 +- sqlite/truncation/makefile | 5 +- sqlite/types/makefile | 5 +- 236 files changed, 6648 insertions(+), 154 deletions(-) create mode 100644 boost/common/boost-common-vc12.sln create mode 100644 boost/common/template/template-vc12.vcxproj create mode 100644 boost/common/template/template-vc12.vcxproj.filters create mode 100644 boost/mssql/boost-mssql-vc12.sln create mode 100644 boost/mssql/template/template-vc12.vcxproj create mode 100644 boost/mssql/template/template-vc12.vcxproj.filters create mode 100644 boost/mysql/boost-mysql-vc12.sln create mode 100644 boost/mysql/template/template-vc12.vcxproj create mode 100644 boost/mysql/template/template-vc12.vcxproj.filters create mode 100644 boost/oracle/boost-oracle-vc12.sln create mode 100644 boost/oracle/template/template-vc12.vcxproj create mode 100644 boost/oracle/template/template-vc12.vcxproj.filters create mode 100644 boost/pgsql/boost-pgsql-vc12.sln create mode 100644 boost/pgsql/template/template-vc12.vcxproj create mode 100644 boost/pgsql/template/template-vc12.vcxproj.filters create mode 100644 boost/sqlite/boost-sqlite-vc12.sln create mode 100644 boost/sqlite/template/template-vc12.vcxproj create mode 100644 boost/sqlite/template/template-vc12.vcxproj.filters create mode 100644 common/common-vc12.sln create mode 100644 common/template/template-vc12.vcxproj create mode 100644 common/template/template-vc12.vcxproj.filters create mode 100644 evolution/evolution-vc12.sln create mode 100644 evolution/template/template-vc12.vcxproj create mode 100644 evolution/template/template-vc12.vcxproj.filters create mode 100644 libcommon/common/libcommon-vc12.vcxproj create mode 100644 libcommon/common/libcommon-vc12.vcxproj.filters create mode 100644 libcommon/libcommon-vc12.sln create mode 100644 mssql/mssql-vc12.sln create mode 100644 mssql/template/template-vc12.vcxproj create mode 100644 mssql/template/template-vc12.vcxproj.filters create mode 100644 mysql/mysql-vc12.sln create mode 100644 mysql/template/template-vc12.vcxproj create mode 100644 mysql/template/template-vc12.vcxproj.filters create mode 100644 oracle/oracle-vc12.sln create mode 100644 oracle/template/template-vc12.vcxproj create mode 100644 oracle/template/template-vc12.vcxproj.filters create mode 100644 pgsql/pgsql-vc12.sln create mode 100644 pgsql/template/template-vc12.vcxproj create mode 100644 pgsql/template/template-vc12.vcxproj.filters create mode 100644 qt/common/qt-common-qt4-vc12.sln create mode 100644 qt/common/qt-common-qt5-vc12.sln create mode 100644 qt/common/template/template-qt4-vc12.vcxproj create mode 100644 qt/common/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/common/template/template-qt5-vc12.vcxproj create mode 100644 qt/common/template/template-qt5-vc12.vcxproj.filters create mode 100644 qt/mssql/qt-mssql-qt4-vc12.sln create mode 100644 qt/mssql/qt-mssql-qt5-vc12.sln create mode 100644 qt/mssql/template/template-qt4-vc12.vcxproj create mode 100644 qt/mssql/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/mssql/template/template-qt5-vc12.vcxproj create mode 100644 qt/mssql/template/template-qt5-vc12.vcxproj.filters create mode 100644 qt/mysql/qt-mysql-qt4-vc12.sln create mode 100644 qt/mysql/qt-mysql-qt5-vc12.sln create mode 100644 qt/mysql/template/template-qt4-vc12.vcxproj create mode 100644 qt/mysql/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/mysql/template/template-qt5-vc12.vcxproj create mode 100644 qt/mysql/template/template-qt5-vc12.vcxproj.filters create mode 100644 qt/oracle/qt-oracle-qt4-vc12.sln create mode 100644 qt/oracle/qt-oracle-qt5-vc12.sln create mode 100644 qt/oracle/template/template-qt4-vc12.vcxproj create mode 100644 qt/oracle/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/oracle/template/template-qt5-vc12.vcxproj create mode 100644 qt/oracle/template/template-qt5-vc12.vcxproj.filters create mode 100644 qt/pgsql/qt-pgsql-qt4-vc12.sln create mode 100644 qt/pgsql/qt-pgsql-qt5-vc12.sln create mode 100644 qt/pgsql/template/template-qt4-vc12.vcxproj create mode 100644 qt/pgsql/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/pgsql/template/template-qt5-vc12.vcxproj create mode 100644 qt/pgsql/template/template-qt5-vc12.vcxproj.filters create mode 100644 qt/sqlite/qt-sqlite-qt4-vc12.sln create mode 100644 qt/sqlite/qt-sqlite-qt5-vc12.sln create mode 100644 qt/sqlite/template/template-qt4-vc12.vcxproj create mode 100644 qt/sqlite/template/template-qt4-vc12.vcxproj.filters create mode 100644 qt/sqlite/template/template-qt5-vc12.vcxproj create mode 100644 qt/sqlite/template/template-qt5-vc12.vcxproj.filters create mode 100644 sqlite/sqlite-vc12.sln create mode 100644 sqlite/template/template-vc12.vcxproj create mode 100644 sqlite/template/template-vc12.vcxproj.filters diff --git a/boost/build.bat b/boost/build.bat index 93bb9db..06f854d 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -40,6 +40,7 @@ if "_%2_" == "_8_" set "vcver=8" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" if "_%2_" == "_11_" set "vcver=11" +if "_%2_" == "_12_" set "vcver=12" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 diff --git a/boost/common/boost-common-vc12.sln b/boost/common/boost-common-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/common/boost-common-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/common/makefile b/boost/common/makefile index 17ea5f8..c5fad03 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -21,13 +21,15 @@ name := boost-common $(dist): name := $(name) $(dist): export dirs := $(tests) $(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ -$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) \ +$(call vc12slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc8slns,$(name)) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) + $(call meta-vc12slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -42,6 +44,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 12b8cc8..b9788e9 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index b088799..17f739e 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 6f1dc97..d357e89 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/template/makefile b/boost/common/template/makefile index fdb817a..0d2f039 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/template/template-vc12.vcxproj b/boost/common/template/template-vc12.vcxproj new file mode 100644 index 0000000..3b6b9eb --- /dev/null +++ b/boost/common/template/template-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/boost/common/template/template-vc12.vcxproj.filters b/boost/common/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/boost/common/template/template-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index b50de0c..21c325b 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 6ac7e74..b388cca 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -64,7 +64,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +73,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -108,6 +110,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/boost-mssql-vc12.sln b/boost/mssql/boost-mssql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/mssql/boost-mssql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 24a60a2..5188679 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -63,7 +63,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -71,6 +72,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -103,6 +105,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/makefile b/boost/mssql/makefile index b124952..414d205 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -13,13 +13,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mssql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 55544fb..668b684 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -58,7 +58,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mssql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +67,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mssql/template/template-vc12.vcxproj b/boost/mssql/template/template-vc12.vcxproj new file mode 100644 index 0000000..79e369f --- /dev/null +++ b/boost/mssql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/mssql/template/template-vc12.vcxproj.filters b/boost/mssql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/mssql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/mysql/boost-mysql-vc12.sln b/boost/mysql/boost-mysql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/mysql/boost-mysql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 7bfe910..b3f25b8 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -62,7 +62,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -70,6 +71,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -102,6 +104,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mysql/makefile b/boost/mysql/makefile index e469c81..57f65f5 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -13,13 +13,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-mysql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 18d7f7a..5c2669a 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -58,7 +58,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/mysql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +67,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/mysql/template/template-vc12.vcxproj b/boost/mysql/template/template-vc12.vcxproj new file mode 100644 index 0000000..d1c9c5a --- /dev/null +++ b/boost/mysql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/mysql/template/template-vc12.vcxproj.filters b/boost/mysql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/mysql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/oracle/boost-oracle-vc12.sln b/boost/oracle/boost-oracle-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/oracle/boost-oracle-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 277fb46..4d6afba 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -63,7 +63,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_bas $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -71,6 +72,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -103,6 +105,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/oracle/makefile b/boost/oracle/makefile index df30557..1af0fca 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -13,13 +13,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-oracle $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 692ad41..f253175 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -58,7 +58,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/oracle/,,$(src_bas $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +67,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/oracle/template/template-vc12.vcxproj b/boost/oracle/template/template-vc12.vcxproj new file mode 100644 index 0000000..554b44a --- /dev/null +++ b/boost/oracle/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/oracle/template/template-vc12.vcxproj.filters b/boost/oracle/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/oracle/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/pgsql/boost-pgsql-vc12.sln b/boost/pgsql/boost-pgsql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/pgsql/boost-pgsql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 1111fda..47b9a50 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -62,7 +62,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -70,6 +71,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -102,6 +104,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 9b2a71a..05f638a 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -13,13 +13,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-pgsql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 1b941f6..d14a152 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -62,7 +62,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/pgsql/,,$(src_base $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -70,6 +71,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -102,6 +104,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/pgsql/template/template-vc12.vcxproj b/boost/pgsql/template/template-vc12.vcxproj new file mode 100644 index 0000000..0808d77 --- /dev/null +++ b/boost/pgsql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/pgsql/template/template-vc12.vcxproj.filters b/boost/pgsql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/pgsql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/boost/sqlite/boost-sqlite-vc12.sln b/boost/sqlite/boost-sqlite-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/boost/sqlite/boost-sqlite-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 40a79ac..065ac18 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -62,7 +62,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_bas $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -70,6 +71,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -102,6 +104,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 0fcfa38..709119a 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -13,13 +13,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := boost-sqlite $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -29,6 +30,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index b4066e4..8f5c1c7 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -62,7 +62,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/boost/sqlite/,,$(src_bas $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -70,6 +71,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -102,6 +104,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/boost/sqlite/template/template-vc12.vcxproj b/boost/sqlite/template/template-vc12.vcxproj new file mode 100644 index 0000000..119a1c0 --- /dev/null +++ b/boost/sqlite/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/boost/sqlite/template/template-vc12.vcxproj.filters b/boost/sqlite/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/boost/sqlite/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/build.bat b/build.bat index b57a88b..e43372f 100644 --- a/build.bat +++ b/build.bat @@ -40,6 +40,7 @@ if "_%2_" == "_8_" set "vcver=8" if "_%2_" == "_9_" set "vcver=9" if "_%2_" == "_10_" set "vcver=10" if "_%2_" == "_11_" set "vcver=11" +if "_%2_" == "_12_" set "vcver=12" if "_%vcver%_" == "__" ( echo unknown VC++ version %2 diff --git a/common/access/makefile b/common/access/makefile index 00c1262..deac973 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -55,7 +55,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -63,6 +64,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -99,6 +101,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/auto/makefile b/common/auto/makefile index 525ea5a..ed1b40f 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/blob/makefile b/common/blob/makefile index 08120fa..bb028d6 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/callback/makefile b/common/callback/makefile index 53c746b..942fa48 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index feef2f4..664a6a9 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -59,7 +59,8 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -67,6 +68,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -103,6 +105,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/circular/single/makefile b/common/circular/single/makefile index f65ca66..2d5716a 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/common-vc12.sln b/common/common-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/common/common-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 12411b4..18b6fbe 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/composite/makefile b/common/composite/makefile index 6c9e66b..c7ed7f3 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/const-member/makefile b/common/const-member/makefile index bb73bd4..f37de33 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/const-object/makefile b/common/const-object/makefile index 41857f6..a78d488 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/container/basics/makefile b/common/container/basics/makefile index eaf948d..fb34367 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index f817436..209859c 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/ctor/makefile b/common/ctor/makefile index 760d85b..414a084 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/default/makefile b/common/default/makefile index 89f00b5..cfb85ee 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/definition/makefile b/common/definition/makefile index 72883ae..ec24015 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -59,7 +59,8 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -67,6 +68,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -103,6 +105,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/enum/makefile b/common/enum/makefile index 8c3e746..ceb0928 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 9d6c8c2..b8e634a 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/index/makefile b/common/index/makefile index 7cc004d..bfc06d4 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index c0d16eb..bfe66ab 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -57,7 +57,8 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -65,6 +66,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -101,6 +103,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index e326533..61aa391 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 1e53bde..b3ab9e5 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/inverse/makefile b/common/inverse/makefile index 012340e..366c4ff 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 615cf31..ddfca26 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 04b14c8..6a85d57 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/makefile b/common/makefile index 8aa48c1..6ee2436 100644 --- a/common/makefile +++ b/common/makefile @@ -85,13 +85,15 @@ $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export thread_dirs := $(thread_tests) $(dist): export cxx11_dirs := $(cxx11_tests) $(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ -$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) +$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) \ +$(call vc12slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc8slns,$(name)) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) + $(call meta-vc12slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -106,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/common/no-id/makefile b/common/no-id/makefile index ff66a4c..8e5d256 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 05fb22c..7569f04 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/pragma/makefile b/common/pragma/makefile index c420313..ec2fca9 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/prepared/makefile b/common/prepared/makefile index 44f8562..2a98a7e 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/query/array/makefile b/common/query/array/makefile index b12aeae..b20d124 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/query/basics/makefile b/common/query/basics/makefile index d4813cd..06b5095 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/readonly/makefile b/common/readonly/makefile index f4d6d36..36ab74c 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index a1fcf27..fd1f4b9 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index e20ef2c..71078f5 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -56,7 +56,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -64,6 +65,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -100,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index b1a8ff8..6a150aa 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index d9e764e..68118f8 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../../template/template,$(name)) $(call meta-vc10projs,../../../template/template,$(name)) $(call meta-vc11projs,../../../template/template,$(name)) + $(call meta-vc12projs,../../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 7c92a68..210f955 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -59,7 +59,8 @@ $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../../template/Makefile.am) @@ -67,6 +68,7 @@ $(dist): $(call meta-vc9projs,../../../template/template,$(name)) $(call meta-vc10projs,../../../template/template,$(name)) $(call meta-vc11projs,../../../template/template,$(name)) + $(call meta-vc12projs,../../../template/template,$(name)) # Test. # @@ -103,6 +105,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 6877980..b0febb0 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/section/basics/makefile b/common/section/basics/makefile index f0484e8..8c40bb9 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index deb13dc..5de55b9 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 11db37b..63c5638 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/session/custom/makefile b/common/session/custom/makefile index da19443..87016e1 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -57,12 +57,14 @@ $(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -$(call vc11projs,$(name)) +$(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ endif $(call include,$(bld_root)/dist.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 48ecf1d..5d76ec2 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -31,7 +31,8 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -74,6 +76,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/common/template/makefile b/common/template/makefile index b4df945..6e775c7 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/template/template-vc12.vcxproj b/common/template/template-vc12.vcxproj new file mode 100644 index 0000000..b738145 --- /dev/null +++ b/common/template/template-vc12.vcxproj @@ -0,0 +1,193 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + + __foreach_w__(__f,__path__(odb_header_stem), + __custom_build_entry__( +__f.hxx, +odb __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) __f.hxx, +__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) +) + ) + +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_entry__(__f-odb.hxx) +__header_entry__(__f-odb.ixx) +))__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_entry__(__f-odb.cxx) +))__source_entries__(extra_sources) + + + + + diff --git a/common/template/template-vc12.vcxproj.filters b/common/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..3460ffd --- /dev/null +++ b/common/template/template-vc12.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__header_filter_entry__(__f.hxx) +__header_filter_entry__(__f-odb.hxx) +__header_filter_entry__(__f-odb.ixx) +))__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,, + __foreach_w__(__f,__path__(odb_header_stem), +__source_filter_entry__(__f-odb.cxx) +))__source_filter_entries__(extra_sources) + + diff --git a/common/threads/makefile b/common/threads/makefile index 59c5c71..694d7fa 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 3b028b6..fe68e99 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -31,7 +31,8 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -74,6 +76,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 091ac21..337c12e 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -31,7 +31,8 @@ $(dist): sources := $(cxx_tun) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9projs,../../template/template,$(name)) $(call meta-vc10projs,../../template/template,$(name)) $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) # Test. # @@ -74,6 +76,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/common/types/makefile b/common/types/makefile index 9c274fe..a72b553 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/view/makefile b/common/view/makefile index 992bb15..f7010ed 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/virtual/makefile b/common/virtual/makefile index 79901fd..7a6f716 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -54,7 +54,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -62,6 +63,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -98,6 +100,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 3c0a2d5..1a42923 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -53,7 +53,8 @@ $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -61,6 +62,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -97,6 +99,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 0914c44..ad580b8 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 63ac218..6f72614 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -72,7 +72,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -80,6 +81,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -127,6 +129,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 61b0899..8ddb2e4 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index b28f057..9178b3c 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 8884fe9..076de38 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 6bf3512..54ce175 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/data/makefile b/evolution/data/makefile index 08c0772..63462f7 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -69,7 +69,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -77,6 +78,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -123,6 +125,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 8f8d56d..0a81973 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index cfd573d..ea3d415 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -72,7 +72,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -80,6 +81,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -127,6 +129,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index b329e16..229090f 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index d0d97ec..202a82f 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index b88f7b6..ded0848 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -69,7 +69,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -77,6 +78,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -115,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/evolution-vc12.sln b/evolution/evolution-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/evolution/evolution-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/evolution/makefile b/evolution/makefile index bbe0650..1272091 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -34,7 +34,7 @@ $(dist): exec_dist := tester.in $(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) $(dist): export extra_dist := $(data_dist) $(exec_dist) test.bat \ $(call vc8slns,$(name)) $(call vc9slns,$(name)) $(call vc10slns,$(name)) \ -$(call vc11slns,$(name)) +$(call vc11slns,$(name)) $(call vc12slns,$(name)) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call dist-data,$(data_dist)) $(call dist-exec,$(exec_dist)) @@ -43,6 +43,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vc9slns,$(name)) $(call meta-vc10slns,$(name)) $(call meta-vc11slns,$(name)) + $(call meta-vc12slns,$(name)) $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) @@ -53,6 +54,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 11a37ef..7accdc0 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 657191b..5245f12 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/template/makefile b/evolution/template/makefile index 92b2ba7..125201a 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/evolution/template/template-vc12.vcxproj b/evolution/template/template-vc12.vcxproj new file mode 100644 index 0000000..9562323 --- /dev/null +++ b/evolution/template/template-vc12.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/evolution/template/template-vc12.vcxproj.filters b/evolution/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..d6ac66e --- /dev/null +++ b/evolution/template/template-vc12.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/evolution/version/makefile b/evolution/version/makefile index 1b20f52..ffeebdf 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -71,7 +71,8 @@ $(dist): headers := $(odb_hdr) $(dist): export extra_headers := model.hxx $(dist): export name := $(name) $(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers)) $(call meta-automake,../template/Makefile.am) @@ -79,6 +80,7 @@ $(dist): $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) # Test. # @@ -126,6 +128,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/libcommon/common/libcommon-vc12.vcxproj b/libcommon/common/libcommon-vc12.vcxproj new file mode 100644 index 0000000..e577c79 --- /dev/null +++ b/libcommon/common/libcommon-vc12.vcxproj @@ -0,0 +1,182 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {019C2E51-BF41-4490-AB96-4156741B8CC9} + Win32Proj + libcommon + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\bin\ + common-d + + + true + ..\bin64\ + common-d + + + false + ..\bin\ + common + + + false + ..\bin64\ + common + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + true + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib\common-d.lib + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + true + + + odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Windows + true + $(TargetPath) + ..\lib64\common-d.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + true + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib\common.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + true + + + odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Windows + true + true + true + $(TargetPath) + ..\lib64\common.lib + + + +__header_entries__(headers) + + +__source_entries__(sources) + + + + + diff --git a/libcommon/common/libcommon-vc12.vcxproj.filters b/libcommon/common/libcommon-vc12.vcxproj.filters new file mode 100644 index 0000000..ecc3613 --- /dev/null +++ b/libcommon/common/libcommon-vc12.vcxproj.filters @@ -0,0 +1,19 @@ + + + + + {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} + cxx + + + {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} + h;hxx;ixx;txx + + + +__header_filter_entries__(headers) + + +__source_filter_entries__(sources) + + diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 5647ba2..f375c6d 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -122,7 +122,7 @@ $(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ $(dist): data_dist := config.h.in config-vc.h $(dist): export extra_dist := $(data_dist) $(call vc8projs,libcommon) \ $(call vc9projs,libcommon) $(call vc10projs,libcommon) \ -$(call vc11projs,libcommon) +$(call vc11projs,libcommon) $(call vc12projs,libcommon) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) @@ -131,6 +131,7 @@ $(dist): $(call meta-vc9projs,libcommon) $(call meta-vc10projs,libcommon) $(call meta-vc11projs,libcommon) + $(call meta-vc12projs,libcommon) # Clean. # @@ -158,6 +159,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/libcommon/libcommon-vc12.sln b/libcommon/libcommon-vc12.sln new file mode 100644 index 0000000..172c6a4 --- /dev/null +++ b/libcommon/libcommon-vc12.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc11.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 + {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libcommon/makefile b/libcommon/makefile index e1fc2db..f6217c2 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -17,6 +17,7 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) $(call meta-vc9slns,libcommon) $(call meta-vc10slns,libcommon) $(call meta-vc11slns,libcommon) + $(call meta-vc12slns,libcommon) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) @@ -24,6 +25,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/automake.make) $(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/mssql/custom/makefile b/mssql/custom/makefile index da1def2..8966239 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -52,7 +52,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -60,6 +61,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -92,6 +94,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/database/makefile b/mssql/database/makefile index c01f888..8d26113 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mssql/makefile b/mssql/makefile index 1b831a6..158edfb 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -17,13 +17,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mssql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -33,6 +34,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/mssql/mssql-vc12.sln b/mssql/mssql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/mssql/mssql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mssql/native/makefile b/mssql/native/makefile index 1104857..03d9a3a 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mssql/query/makefile b/mssql/query/makefile index b23b9d8..b1382ff 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -49,7 +49,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -57,6 +58,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -89,6 +91,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/template/makefile b/mssql/template/makefile index 1b2b97b..b4cc8c0 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mssql/template/template-vc12.vcxproj b/mssql/template/template-vc12.vcxproj new file mode 100644 index 0000000..35ffb0f --- /dev/null +++ b/mssql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/mssql/template/template-vc12.vcxproj.filters b/mssql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/mssql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/mssql/types/makefile b/mssql/types/makefile index ab57f1f..50625ee 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -50,7 +50,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -58,6 +59,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -90,6 +92,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 428a869..ca8c67d 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -51,7 +51,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -59,6 +60,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -91,6 +93,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/database/makefile b/mysql/database/makefile index 7ffed22..7bb623d 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mysql/index/makefile b/mysql/index/makefile index 67991af..4104bd2 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/makefile b/mysql/makefile index ed2da6a..190d535 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -18,13 +18,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := mysql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -34,6 +35,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/mysql/mysql-vc12.sln b/mysql/mysql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/mysql/mysql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql/native/makefile b/mysql/native/makefile index c813fda..bbe993e 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/mysql/template/makefile b/mysql/template/makefile index cef4a16..21226eb 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/template/template-vc12.vcxproj b/mysql/template/template-vc12.vcxproj new file mode 100644 index 0000000..32e2930 --- /dev/null +++ b/mysql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/mysql/template/template-vc12.vcxproj.filters b/mysql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/mysql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 8cb89e6..885a68b 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/mysql/types/makefile b/mysql/types/makefile index cd0c948..613f83c 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -50,7 +50,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -58,6 +59,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -90,6 +92,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/custom/makefile b/oracle/custom/makefile index e746117..8ff04bd 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -51,7 +51,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -59,6 +60,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -91,6 +93,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/database/makefile b/oracle/database/makefile index 7f891af..2514d3e 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/oracle/makefile b/oracle/makefile index 8bd09d4..ef0f8b9 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -16,13 +16,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := oracle $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -32,6 +33,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/oracle/native/makefile b/oracle/native/makefile index 6bb6608..ef5f8ea 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/oracle/oracle-vc12.sln b/oracle/oracle-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/oracle/oracle-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/oracle/template/makefile b/oracle/template/makefile index ec767ca..ece1ea4 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/oracle/template/template-vc12.vcxproj b/oracle/template/template-vc12.vcxproj new file mode 100644 index 0000000..de35c03 --- /dev/null +++ b/oracle/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/oracle/template/template-vc12.vcxproj.filters b/oracle/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/oracle/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/oracle/types/makefile b/oracle/types/makefile index 89a5698..d084705 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -50,7 +50,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -58,6 +59,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -90,6 +92,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 317f90f..496f395 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -51,7 +51,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -59,6 +60,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -91,6 +93,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 3284b2d..e4db090 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/pgsql/index/makefile b/pgsql/index/makefile index a4e89e8..50104c3 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/makefile b/pgsql/makefile index 9508e43..29857e0 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -18,13 +18,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := pgsql $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -34,6 +35,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 8ec2ae9..9034c58 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/pgsql/pgsql-vc12.sln b/pgsql/pgsql-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/pgsql/pgsql-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 5a86b91..5a43c4f 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/template/template-vc12.vcxproj b/pgsql/template/template-vc12.vcxproj new file mode 100644 index 0000000..415dad4 --- /dev/null +++ b/pgsql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/pgsql/template/template-vc12.vcxproj.filters b/pgsql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/pgsql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index e0006ea..13f5c68 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 0895e23..f360ae7 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -50,7 +50,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -58,6 +59,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -90,6 +92,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/build.bat b/qt/build.bat index 69e1bc5..def577d 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -53,6 +53,7 @@ if "_%3_" == "_8_" set "vcver=8" if "_%3_" == "_9_" set "vcver=9" if "_%3_" == "_10_" set "vcver=10" if "_%3_" == "_11_" set "vcver=11" +if "_%3_" == "_12_" set "vcver=12" if "_%vcver%_" == "__" ( echo unknown VC++ version %3 diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index c61d160..655a169 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -67,7 +67,8 @@ $(dist): export extra_dist := $(data_dist) \ $(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ +$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -77,7 +78,9 @@ $(dist): $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) # Test. # @@ -114,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index caad81a..ce1de60 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -67,7 +67,8 @@ $(dist): export extra_dist := $(data_dist) \ $(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ +$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -77,7 +78,9 @@ $(dist): $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc12projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc12projs,../../template/template-qt5,$(name)-qt5) # Test. # @@ -114,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 1e05409..532028a 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -67,7 +67,8 @@ $(dist): export extra_dist := $(data_dist) \ $(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ +$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) @@ -77,7 +78,9 @@ $(dist): $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) + $(call meta-vc12projs,../../template/template-qt4,$(name)-qt4) $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) + $(call meta-vc12projs,../../template/template-qt5,$(name)-qt5) # Test. # @@ -114,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/makefile b/qt/common/makefile index d03d843..a12fdfa 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -23,7 +23,8 @@ $(dist): export extra_dist := test.bat \ $(call vc9slns,$(name)-qt4) \ $(call vc9slns,$(name)-qt4) $(call vc9slns,$(name)-qt5) \ $(call vc10slns,$(name)-qt4) $(call vc10slns,$(name)-qt5) \ -$(call vc11slns,$(name)-qt4) $(call vc11slns,$(name)-qt5) +$(call vc11slns,$(name)-qt4) $(call vc11slns,$(name)-qt5) \ +$(call vc12slns,$(name)-qt4) $(call vc12slns,$(name)-qt5) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-automake) $(call meta-vc8slns,$(name)-qt4,-qt4) @@ -33,6 +34,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) $(call meta-vc10slns,$(name)-qt5,-qt5) $(call meta-vc11slns,$(name)-qt4,-qt4) $(call meta-vc11slns,$(name)-qt5,-qt5) + $(call meta-vc12slns,$(name)-qt4,-qt4) + $(call meta-vc12slns,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-mysql-vc10.sln,test.bat) @@ -48,6 +51,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/common/qt-common-qt4-vc12.sln b/qt/common/qt-common-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/common/qt-common-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/qt-common-qt5-vc12.sln b/qt/common/qt-common-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/common/qt-common-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 67cf8c3..0f2f4c5 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -67,7 +67,8 @@ $(dist): export extra_dist := $(data_dist) \ $(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ +$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -77,7 +78,9 @@ $(dist): $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) # Test. # @@ -114,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/template/makefile b/qt/common/template/makefile index ff5d230..4acd567 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -67,7 +67,8 @@ $(dist): export extra_dist := $(data_dist) \ $(call vc8projs,$(name)-qt4) \ $(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ $(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) +$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ +$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -77,7 +78,9 @@ $(dist): $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) + $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) + $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) # Test. # @@ -114,6 +117,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/common/template/template-qt4-vc12.vcxproj b/qt/common/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..eaa4d12 --- /dev/null +++ b/qt/common/template/template-qt4-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt4-vc12.vcxproj.filters b/qt/common/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc12.vcxproj b/qt/common/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..a64ba40 --- /dev/null +++ b/qt/common/template/template-qt5-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/qt/common/template/template-qt5-vc12.vcxproj.filters b/qt/common/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/qt/common/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 8976d17..94c986a 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index bbc377f..f98ce2d 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 7313e6a..282a581 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -17,7 +17,8 @@ $(dist): export extra_dist := test.bat \ $(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ +$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) @@ -27,6 +28,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) + $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) @@ -37,6 +40,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/mssql/qt-mssql-qt4-vc12.sln b/qt/mssql/qt-mssql-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/mssql/qt-mssql-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/qt-mssql-qt5-vc12.sln b/qt/mssql/qt-mssql-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/mssql/qt-mssql-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index b18aed0..383a448 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -55,7 +55,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +68,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -98,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mssql/template/template-qt4-vc12.vcxproj b/qt/mssql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..0916a38 --- /dev/null +++ b/qt/mssql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt4-vc12.vcxproj.filters b/qt/mssql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc12.vcxproj b/qt/mssql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..40e2fbb --- /dev/null +++ b/qt/mssql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mssql/template/template-qt5-vc12.vcxproj.filters b/qt/mssql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mssql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 5d8d0fc..6d29f24 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 2327f49..6c98488 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/makefile b/qt/mysql/makefile index eeffed7..0f5150f 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -17,7 +17,8 @@ $(dist): export extra_dist := test.bat \ $(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ +$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) @@ -27,6 +28,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) + $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) @@ -37,6 +40,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/mysql/qt-mysql-qt4-vc12.sln b/qt/mysql/qt-mysql-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/mysql/qt-mysql-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/qt-mysql-qt5-vc12.sln b/qt/mysql/qt-mysql-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/mysql/qt-mysql-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index e35f84e..d8902ed 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -55,7 +55,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +68,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -98,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/mysql/template/template-qt4-vc12.vcxproj b/qt/mysql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..6a2812a --- /dev/null +++ b/qt/mysql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt4-vc12.vcxproj.filters b/qt/mysql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc12.vcxproj b/qt/mysql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..f75d5d3 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/mysql/template/template-qt5-vc12.vcxproj.filters b/qt/mysql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/mysql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 4e515fd..04eab30 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 1fb7d00..4b58a51 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/makefile b/qt/oracle/makefile index efa2888..ae09691 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -17,7 +17,8 @@ $(dist): export extra_dist := test.bat \ $(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ +$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) @@ -27,6 +28,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) + $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) @@ -37,6 +40,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/oracle/qt-oracle-qt4-vc12.sln b/qt/oracle/qt-oracle-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/oracle/qt-oracle-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/qt-oracle-qt5-vc12.sln b/qt/oracle/qt-oracle-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/oracle/qt-oracle-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 70fbf1f..a189c5b 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -55,7 +55,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +68,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -98,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/oracle/template/template-qt4-vc12.vcxproj b/qt/oracle/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..88dffa8 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt4-vc12.vcxproj.filters b/qt/oracle/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc12.vcxproj b/qt/oracle/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..2ae82a6 --- /dev/null +++ b/qt/oracle/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/oracle/template/template-qt5-vc12.vcxproj.filters b/qt/oracle/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/oracle/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index d51d796..dbbbc8d 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index e774aae..3e331f4 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 971add2..7fbb23d 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -17,7 +17,8 @@ $(dist): export extra_dist := test.bat \ $(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ +$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) @@ -27,6 +28,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) + $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) @@ -37,6 +40,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/pgsql/qt-pgsql-qt4-vc12.sln b/qt/pgsql/qt-pgsql-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt5-vc12.sln b/qt/pgsql/qt-pgsql-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/pgsql/qt-pgsql-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 70a7183..3e35d12 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -55,7 +55,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +68,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -98,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/pgsql/template/template-qt4-vc12.vcxproj b/qt/pgsql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..f1b9924 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt4-vc12.vcxproj.filters b/qt/pgsql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc12.vcxproj b/qt/pgsql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..5d958c2 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/pgsql/template/template-qt5-vc12.vcxproj.filters b/qt/pgsql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/pgsql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 6c9744e..914b35c 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index d257419..9def8a8 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -61,7 +61,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -72,6 +74,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -104,6 +108,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 22478df..91c01ca 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -17,7 +17,8 @@ $(dist): export extra_dist := test.bat \ $(name)-qt4-vc8.sln \ $(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ $(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln +$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ +$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) @@ -27,6 +28,8 @@ $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) + $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) + $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) @@ -37,6 +40,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/qt/sqlite/qt-sqlite-qt4-vc12.sln b/qt/sqlite/qt-sqlite-qt4-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt4-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt5-vc12.sln b/qt/sqlite/qt-sqlite-qt5-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/qt/sqlite/qt-sqlite-qt5-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 8f92eb2..d54d07f 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -55,7 +55,9 @@ $(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ $(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ $(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ $(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters +$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ +$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ +$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -66,6 +68,8 @@ $(dist): $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) + $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) + $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) # Test. # @@ -98,6 +102,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/qt/sqlite/template/template-qt4-vc12.vcxproj b/qt/sqlite/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..43959de --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt4-vc12.vcxproj.filters b/qt/sqlite/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc12.vcxproj b/qt/sqlite/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..dc303a6 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/qt/sqlite/template/template-qt5-vc12.vcxproj.filters b/qt/sqlite/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/qt/sqlite/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index c5d7046..201ec25 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 78103c1..a69d2dd 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/sqlite/makefile b/sqlite/makefile index ebc9cde..3f9f793 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -18,13 +18,14 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(dist): name := sqlite $(dist): export dirs := $(tests) $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln test.bat +$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) $(call meta-vc8sln,$(name)-vc8.sln) $(call meta-vc9sln,$(name)-vc9.sln) $(call meta-vc10sln,$(name)-vc10.sln) $(call meta-vc11sln,$(name)-vc11.sln) + $(call meta-vc12sln,$(name)-vc12.sln) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) @@ -34,6 +35,7 @@ $(call include,$(bld_root)/meta/vc8sln.make) $(call include,$(bld_root)/meta/vc9sln.make) $(call include,$(bld_root)/meta/vc10sln.make) $(call include,$(bld_root)/meta/vc11sln.make) +$(call include,$(bld_root)/meta/vc12sln.make) $(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) diff --git a/sqlite/native/makefile b/sqlite/native/makefile index b763983..f03ae93 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -31,7 +31,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -39,6 +40,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -70,6 +72,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/cxx-d.make) diff --git a/sqlite/sqlite-vc12.sln b/sqlite/sqlite-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/sqlite/sqlite-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 558aa94..aab623c 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/template/template-vc12.vcxproj b/sqlite/template/template-vc12.vcxproj new file mode 100644 index 0000000..09beff2 --- /dev/null +++ b/sqlite/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/sqlite/template/template-vc12.vcxproj.filters b/sqlite/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/sqlite/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index 21d1c7d..6868e02 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index d307dea..e1a1b1b 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -48,7 +48,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -56,6 +57,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -88,6 +90,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 1559671..5cffe4e 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -50,7 +50,8 @@ $(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) $(dist): export extra_dist := $(data_dist) \ $(name)-vc8.vcproj $(name)-vc9.vcproj \ $(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) @@ -58,6 +59,7 @@ $(dist): $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) # Test. # @@ -90,6 +92,7 @@ $(call include,$(bld_root)/meta/vc8proj.make) $(call include,$(bld_root)/meta/vc9proj.make) $(call include,$(bld_root)/meta/vc10proj.make) $(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) $(call include,$(bld_root)/meta/automake.make) $(call include,$(bld_root)/cxx/standard.make) # cxx_standard -- cgit v1.1 From 770c24812b6823d48bbea2f03942221d1aed964c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 15 Jun 2014 14:13:55 +0200 Subject: Use single template set of templates for .sln files --- boost/common/boost-common-vc10.sln | 15 --------------- boost/common/boost-common-vc11.sln | 15 --------------- boost/common/boost-common-vc12.sln | 17 ----------------- boost/common/boost-common-vc8.sln | 15 --------------- boost/common/boost-common-vc9.sln | 15 --------------- boost/mssql/boost-mssql-vc10.sln | 15 --------------- boost/mssql/boost-mssql-vc11.sln | 15 --------------- boost/mssql/boost-mssql-vc12.sln | 17 ----------------- boost/mssql/boost-mssql-vc8.sln | 15 --------------- boost/mssql/boost-mssql-vc9.sln | 15 --------------- boost/mssql/makefile | 10 +++++----- boost/mysql/boost-mysql-vc10.sln | 15 --------------- boost/mysql/boost-mysql-vc11.sln | 15 --------------- boost/mysql/boost-mysql-vc12.sln | 17 ----------------- boost/mysql/boost-mysql-vc8.sln | 15 --------------- boost/mysql/boost-mysql-vc9.sln | 15 --------------- boost/mysql/makefile | 10 +++++----- boost/oracle/boost-oracle-vc10.sln | 15 --------------- boost/oracle/boost-oracle-vc11.sln | 15 --------------- boost/oracle/boost-oracle-vc12.sln | 17 ----------------- boost/oracle/boost-oracle-vc8.sln | 15 --------------- boost/oracle/boost-oracle-vc9.sln | 15 --------------- boost/oracle/makefile | 10 +++++----- boost/pgsql/boost-pgsql-vc10.sln | 15 --------------- boost/pgsql/boost-pgsql-vc11.sln | 15 --------------- boost/pgsql/boost-pgsql-vc12.sln | 17 ----------------- boost/pgsql/boost-pgsql-vc8.sln | 15 --------------- boost/pgsql/boost-pgsql-vc9.sln | 15 --------------- boost/pgsql/makefile | 10 +++++----- boost/sqlite/boost-sqlite-vc10.sln | 15 --------------- boost/sqlite/boost-sqlite-vc11.sln | 15 --------------- boost/sqlite/boost-sqlite-vc12.sln | 17 ----------------- boost/sqlite/boost-sqlite-vc8.sln | 15 --------------- boost/sqlite/boost-sqlite-vc9.sln | 15 --------------- boost/sqlite/makefile | 10 +++++----- build/bootstrap.make | 37 +++++++++++++++++++++++++++++++++---- common/common-vc10.sln | 15 --------------- common/common-vc11.sln | 15 --------------- common/common-vc12.sln | 17 ----------------- common/common-vc8.sln | 15 --------------- common/common-vc9.sln | 15 --------------- evolution/evolution-vc10.sln | 15 --------------- evolution/evolution-vc11.sln | 15 --------------- evolution/evolution-vc12.sln | 17 ----------------- evolution/evolution-vc8.sln | 15 --------------- evolution/evolution-vc9.sln | 15 --------------- libcommon/libcommon-vc10.sln | 26 -------------------------- libcommon/libcommon-vc11.sln | 26 -------------------------- libcommon/libcommon-vc12.sln | 28 ---------------------------- libcommon/libcommon-vc8.sln | 26 -------------------------- libcommon/libcommon-vc9.sln | 26 -------------------------- mssql/makefile | 10 +++++----- mssql/mssql-vc10.sln | 15 --------------- mssql/mssql-vc11.sln | 15 --------------- mssql/mssql-vc12.sln | 17 ----------------- mssql/mssql-vc8.sln | 15 --------------- mssql/mssql-vc9.sln | 15 --------------- mysql/makefile | 10 +++++----- mysql/mysql-vc10.sln | 15 --------------- mysql/mysql-vc11.sln | 15 --------------- mysql/mysql-vc12.sln | 17 ----------------- mysql/mysql-vc8.sln | 15 --------------- mysql/mysql-vc9.sln | 15 --------------- oracle/makefile | 10 +++++----- oracle/oracle-vc10.sln | 15 --------------- oracle/oracle-vc11.sln | 15 --------------- oracle/oracle-vc12.sln | 17 ----------------- oracle/oracle-vc8.sln | 15 --------------- oracle/oracle-vc9.sln | 15 --------------- pgsql/makefile | 10 +++++----- pgsql/pgsql-vc10.sln | 15 --------------- pgsql/pgsql-vc11.sln | 15 --------------- pgsql/pgsql-vc12.sln | 17 ----------------- pgsql/pgsql-vc8.sln | 15 --------------- pgsql/pgsql-vc9.sln | 15 --------------- qt/common/qt-common-qt4-vc10.sln | 15 --------------- qt/common/qt-common-qt4-vc11.sln | 15 --------------- qt/common/qt-common-qt4-vc12.sln | 17 ----------------- qt/common/qt-common-qt4-vc8.sln | 15 --------------- qt/common/qt-common-qt4-vc9.sln | 15 --------------- qt/common/qt-common-qt5-vc10.sln | 15 --------------- qt/common/qt-common-qt5-vc11.sln | 15 --------------- qt/common/qt-common-qt5-vc12.sln | 17 ----------------- qt/common/qt-common-qt5-vc9.sln | 15 --------------- qt/mssql/makefile | 18 +++++++++--------- qt/mssql/qt-mssql-qt4-vc10.sln | 15 --------------- qt/mssql/qt-mssql-qt4-vc11.sln | 15 --------------- qt/mssql/qt-mssql-qt4-vc12.sln | 17 ----------------- qt/mssql/qt-mssql-qt4-vc8.sln | 15 --------------- qt/mssql/qt-mssql-qt4-vc9.sln | 15 --------------- qt/mssql/qt-mssql-qt5-vc10.sln | 15 --------------- qt/mssql/qt-mssql-qt5-vc11.sln | 15 --------------- qt/mssql/qt-mssql-qt5-vc12.sln | 17 ----------------- qt/mssql/qt-mssql-qt5-vc9.sln | 15 --------------- qt/mysql/makefile | 18 +++++++++--------- qt/mysql/qt-mysql-qt4-vc10.sln | 15 --------------- qt/mysql/qt-mysql-qt4-vc11.sln | 15 --------------- qt/mysql/qt-mysql-qt4-vc12.sln | 17 ----------------- qt/mysql/qt-mysql-qt4-vc8.sln | 15 --------------- qt/mysql/qt-mysql-qt4-vc9.sln | 15 --------------- qt/mysql/qt-mysql-qt5-vc10.sln | 15 --------------- qt/mysql/qt-mysql-qt5-vc11.sln | 15 --------------- qt/mysql/qt-mysql-qt5-vc12.sln | 17 ----------------- qt/mysql/qt-mysql-qt5-vc9.sln | 15 --------------- qt/oracle/makefile | 18 +++++++++--------- qt/oracle/qt-oracle-qt4-vc10.sln | 15 --------------- qt/oracle/qt-oracle-qt4-vc11.sln | 15 --------------- qt/oracle/qt-oracle-qt4-vc12.sln | 17 ----------------- qt/oracle/qt-oracle-qt4-vc8.sln | 15 --------------- qt/oracle/qt-oracle-qt4-vc9.sln | 15 --------------- qt/oracle/qt-oracle-qt5-vc10.sln | 15 --------------- qt/oracle/qt-oracle-qt5-vc11.sln | 15 --------------- qt/oracle/qt-oracle-qt5-vc12.sln | 17 ----------------- qt/oracle/qt-oracle-qt5-vc9.sln | 15 --------------- qt/pgsql/makefile | 18 +++++++++--------- qt/pgsql/qt-pgsql-qt4-vc10.sln | 15 --------------- qt/pgsql/qt-pgsql-qt4-vc11.sln | 15 --------------- qt/pgsql/qt-pgsql-qt4-vc12.sln | 17 ----------------- qt/pgsql/qt-pgsql-qt4-vc8.sln | 15 --------------- qt/pgsql/qt-pgsql-qt4-vc9.sln | 15 --------------- qt/pgsql/qt-pgsql-qt5-vc10.sln | 15 --------------- qt/pgsql/qt-pgsql-qt5-vc11.sln | 15 --------------- qt/pgsql/qt-pgsql-qt5-vc12.sln | 17 ----------------- qt/pgsql/qt-pgsql-qt5-vc9.sln | 15 --------------- qt/sqlite/makefile | 18 +++++++++--------- qt/sqlite/qt-sqlite-qt4-vc10.sln | 15 --------------- qt/sqlite/qt-sqlite-qt4-vc11.sln | 15 --------------- qt/sqlite/qt-sqlite-qt4-vc12.sln | 17 ----------------- qt/sqlite/qt-sqlite-qt4-vc8.sln | 15 --------------- qt/sqlite/qt-sqlite-qt4-vc9.sln | 15 --------------- qt/sqlite/qt-sqlite-qt5-vc10.sln | 15 --------------- qt/sqlite/qt-sqlite-qt5-vc11.sln | 15 --------------- qt/sqlite/qt-sqlite-qt5-vc12.sln | 17 ----------------- qt/sqlite/qt-sqlite-qt5-vc9.sln | 15 --------------- sqlite/makefile | 10 +++++----- sqlite/sqlite-vc10.sln | 15 --------------- sqlite/sqlite-vc11.sln | 15 --------------- sqlite/sqlite-vc12.sln | 17 ----------------- sqlite/sqlite-vc8.sln | 15 --------------- sqlite/sqlite-vc9.sln | 15 --------------- template-vc10.sln | 15 +++++++++++++++ template-vc11.sln | 15 +++++++++++++++ template-vc12.sln | 17 +++++++++++++++++ template-vc8.sln | 15 +++++++++++++++ template-vc9.sln | 15 +++++++++++++++ 145 files changed, 205 insertions(+), 2066 deletions(-) delete mode 100644 boost/common/boost-common-vc10.sln delete mode 100644 boost/common/boost-common-vc11.sln delete mode 100644 boost/common/boost-common-vc12.sln delete mode 100644 boost/common/boost-common-vc8.sln delete mode 100644 boost/common/boost-common-vc9.sln delete mode 100644 boost/mssql/boost-mssql-vc10.sln delete mode 100644 boost/mssql/boost-mssql-vc11.sln delete mode 100644 boost/mssql/boost-mssql-vc12.sln delete mode 100644 boost/mssql/boost-mssql-vc8.sln delete mode 100644 boost/mssql/boost-mssql-vc9.sln delete mode 100644 boost/mysql/boost-mysql-vc10.sln delete mode 100644 boost/mysql/boost-mysql-vc11.sln delete mode 100644 boost/mysql/boost-mysql-vc12.sln delete mode 100644 boost/mysql/boost-mysql-vc8.sln delete mode 100644 boost/mysql/boost-mysql-vc9.sln delete mode 100644 boost/oracle/boost-oracle-vc10.sln delete mode 100644 boost/oracle/boost-oracle-vc11.sln delete mode 100644 boost/oracle/boost-oracle-vc12.sln delete mode 100644 boost/oracle/boost-oracle-vc8.sln delete mode 100644 boost/oracle/boost-oracle-vc9.sln delete mode 100644 boost/pgsql/boost-pgsql-vc10.sln delete mode 100644 boost/pgsql/boost-pgsql-vc11.sln delete mode 100644 boost/pgsql/boost-pgsql-vc12.sln delete mode 100644 boost/pgsql/boost-pgsql-vc8.sln delete mode 100644 boost/pgsql/boost-pgsql-vc9.sln delete mode 100644 boost/sqlite/boost-sqlite-vc10.sln delete mode 100644 boost/sqlite/boost-sqlite-vc11.sln delete mode 100644 boost/sqlite/boost-sqlite-vc12.sln delete mode 100644 boost/sqlite/boost-sqlite-vc8.sln delete mode 100644 boost/sqlite/boost-sqlite-vc9.sln delete mode 100644 common/common-vc10.sln delete mode 100644 common/common-vc11.sln delete mode 100644 common/common-vc12.sln delete mode 100644 common/common-vc8.sln delete mode 100644 common/common-vc9.sln delete mode 100644 evolution/evolution-vc10.sln delete mode 100644 evolution/evolution-vc11.sln delete mode 100644 evolution/evolution-vc12.sln delete mode 100644 evolution/evolution-vc8.sln delete mode 100644 evolution/evolution-vc9.sln delete mode 100644 libcommon/libcommon-vc10.sln delete mode 100644 libcommon/libcommon-vc11.sln delete mode 100644 libcommon/libcommon-vc12.sln delete mode 100644 libcommon/libcommon-vc8.sln delete mode 100644 libcommon/libcommon-vc9.sln delete mode 100644 mssql/mssql-vc10.sln delete mode 100644 mssql/mssql-vc11.sln delete mode 100644 mssql/mssql-vc12.sln delete mode 100644 mssql/mssql-vc8.sln delete mode 100644 mssql/mssql-vc9.sln delete mode 100644 mysql/mysql-vc10.sln delete mode 100644 mysql/mysql-vc11.sln delete mode 100644 mysql/mysql-vc12.sln delete mode 100644 mysql/mysql-vc8.sln delete mode 100644 mysql/mysql-vc9.sln delete mode 100644 oracle/oracle-vc10.sln delete mode 100644 oracle/oracle-vc11.sln delete mode 100644 oracle/oracle-vc12.sln delete mode 100644 oracle/oracle-vc8.sln delete mode 100644 oracle/oracle-vc9.sln delete mode 100644 pgsql/pgsql-vc10.sln delete mode 100644 pgsql/pgsql-vc11.sln delete mode 100644 pgsql/pgsql-vc12.sln delete mode 100644 pgsql/pgsql-vc8.sln delete mode 100644 pgsql/pgsql-vc9.sln delete mode 100644 qt/common/qt-common-qt4-vc10.sln delete mode 100644 qt/common/qt-common-qt4-vc11.sln delete mode 100644 qt/common/qt-common-qt4-vc12.sln delete mode 100644 qt/common/qt-common-qt4-vc8.sln delete mode 100644 qt/common/qt-common-qt4-vc9.sln delete mode 100644 qt/common/qt-common-qt5-vc10.sln delete mode 100644 qt/common/qt-common-qt5-vc11.sln delete mode 100644 qt/common/qt-common-qt5-vc12.sln delete mode 100644 qt/common/qt-common-qt5-vc9.sln delete mode 100644 qt/mssql/qt-mssql-qt4-vc10.sln delete mode 100644 qt/mssql/qt-mssql-qt4-vc11.sln delete mode 100644 qt/mssql/qt-mssql-qt4-vc12.sln delete mode 100644 qt/mssql/qt-mssql-qt4-vc8.sln delete mode 100644 qt/mssql/qt-mssql-qt4-vc9.sln delete mode 100644 qt/mssql/qt-mssql-qt5-vc10.sln delete mode 100644 qt/mssql/qt-mssql-qt5-vc11.sln delete mode 100644 qt/mssql/qt-mssql-qt5-vc12.sln delete mode 100644 qt/mssql/qt-mssql-qt5-vc9.sln delete mode 100644 qt/mysql/qt-mysql-qt4-vc10.sln delete mode 100644 qt/mysql/qt-mysql-qt4-vc11.sln delete mode 100644 qt/mysql/qt-mysql-qt4-vc12.sln delete mode 100644 qt/mysql/qt-mysql-qt4-vc8.sln delete mode 100644 qt/mysql/qt-mysql-qt4-vc9.sln delete mode 100644 qt/mysql/qt-mysql-qt5-vc10.sln delete mode 100644 qt/mysql/qt-mysql-qt5-vc11.sln delete mode 100644 qt/mysql/qt-mysql-qt5-vc12.sln delete mode 100644 qt/mysql/qt-mysql-qt5-vc9.sln delete mode 100644 qt/oracle/qt-oracle-qt4-vc10.sln delete mode 100644 qt/oracle/qt-oracle-qt4-vc11.sln delete mode 100644 qt/oracle/qt-oracle-qt4-vc12.sln delete mode 100644 qt/oracle/qt-oracle-qt4-vc8.sln delete mode 100644 qt/oracle/qt-oracle-qt4-vc9.sln delete mode 100644 qt/oracle/qt-oracle-qt5-vc10.sln delete mode 100644 qt/oracle/qt-oracle-qt5-vc11.sln delete mode 100644 qt/oracle/qt-oracle-qt5-vc12.sln delete mode 100644 qt/oracle/qt-oracle-qt5-vc9.sln delete mode 100644 qt/pgsql/qt-pgsql-qt4-vc10.sln delete mode 100644 qt/pgsql/qt-pgsql-qt4-vc11.sln delete mode 100644 qt/pgsql/qt-pgsql-qt4-vc12.sln delete mode 100644 qt/pgsql/qt-pgsql-qt4-vc8.sln delete mode 100644 qt/pgsql/qt-pgsql-qt4-vc9.sln delete mode 100644 qt/pgsql/qt-pgsql-qt5-vc10.sln delete mode 100644 qt/pgsql/qt-pgsql-qt5-vc11.sln delete mode 100644 qt/pgsql/qt-pgsql-qt5-vc12.sln delete mode 100644 qt/pgsql/qt-pgsql-qt5-vc9.sln delete mode 100644 qt/sqlite/qt-sqlite-qt4-vc10.sln delete mode 100644 qt/sqlite/qt-sqlite-qt4-vc11.sln delete mode 100644 qt/sqlite/qt-sqlite-qt4-vc12.sln delete mode 100644 qt/sqlite/qt-sqlite-qt4-vc8.sln delete mode 100644 qt/sqlite/qt-sqlite-qt4-vc9.sln delete mode 100644 qt/sqlite/qt-sqlite-qt5-vc10.sln delete mode 100644 qt/sqlite/qt-sqlite-qt5-vc11.sln delete mode 100644 qt/sqlite/qt-sqlite-qt5-vc12.sln delete mode 100644 qt/sqlite/qt-sqlite-qt5-vc9.sln delete mode 100644 sqlite/sqlite-vc10.sln delete mode 100644 sqlite/sqlite-vc11.sln delete mode 100644 sqlite/sqlite-vc12.sln delete mode 100644 sqlite/sqlite-vc8.sln delete mode 100644 sqlite/sqlite-vc9.sln create mode 100644 template-vc10.sln create mode 100644 template-vc11.sln create mode 100644 template-vc12.sln create mode 100644 template-vc8.sln create mode 100644 template-vc9.sln diff --git a/boost/common/boost-common-vc10.sln b/boost/common/boost-common-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/common/boost-common-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/boost/common/boost-common-vc11.sln b/boost/common/boost-common-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/common/boost-common-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/common/boost-common-vc12.sln b/boost/common/boost-common-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/common/boost-common-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/common/boost-common-vc8.sln b/boost/common/boost-common-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/common/boost-common-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/common/boost-common-vc9.sln b/boost/common/boost-common-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/common/boost-common-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/boost/mssql/boost-mssql-vc10.sln b/boost/mssql/boost-mssql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/mssql/boost-mssql-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/boost/mssql/boost-mssql-vc11.sln b/boost/mssql/boost-mssql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/mssql/boost-mssql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mssql/boost-mssql-vc12.sln b/boost/mssql/boost-mssql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/mssql/boost-mssql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mssql/boost-mssql-vc8.sln b/boost/mssql/boost-mssql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/mssql/boost-mssql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mssql/boost-mssql-vc9.sln b/boost/mssql/boost-mssql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/mssql/boost-mssql-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/boost/mssql/makefile b/boost/mssql/makefile index 414d205..a758a87 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -16,11 +16,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/boost/mysql/boost-mysql-vc10.sln b/boost/mysql/boost-mysql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/mysql/boost-mysql-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/boost/mysql/boost-mysql-vc11.sln b/boost/mysql/boost-mysql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/mysql/boost-mysql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mysql/boost-mysql-vc12.sln b/boost/mysql/boost-mysql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/mysql/boost-mysql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mysql/boost-mysql-vc8.sln b/boost/mysql/boost-mysql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/mysql/boost-mysql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/mysql/boost-mysql-vc9.sln b/boost/mysql/boost-mysql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/mysql/boost-mysql-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/boost/mysql/makefile b/boost/mysql/makefile index 57f65f5..c8893fe 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -16,11 +16,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/boost/oracle/boost-oracle-vc10.sln b/boost/oracle/boost-oracle-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/oracle/boost-oracle-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/boost/oracle/boost-oracle-vc11.sln b/boost/oracle/boost-oracle-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/oracle/boost-oracle-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/oracle/boost-oracle-vc12.sln b/boost/oracle/boost-oracle-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/oracle/boost-oracle-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/oracle/boost-oracle-vc8.sln b/boost/oracle/boost-oracle-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/oracle/boost-oracle-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/oracle/boost-oracle-vc9.sln b/boost/oracle/boost-oracle-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/oracle/boost-oracle-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/boost/oracle/makefile b/boost/oracle/makefile index 1af0fca..c099b7d 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -16,11 +16,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/boost/pgsql/boost-pgsql-vc10.sln b/boost/pgsql/boost-pgsql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/pgsql/boost-pgsql-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/boost/pgsql/boost-pgsql-vc11.sln b/boost/pgsql/boost-pgsql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/pgsql/boost-pgsql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/pgsql/boost-pgsql-vc12.sln b/boost/pgsql/boost-pgsql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/pgsql/boost-pgsql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/pgsql/boost-pgsql-vc8.sln b/boost/pgsql/boost-pgsql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/pgsql/boost-pgsql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/pgsql/boost-pgsql-vc9.sln b/boost/pgsql/boost-pgsql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/pgsql/boost-pgsql-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/boost/pgsql/makefile b/boost/pgsql/makefile index 05f638a..e7e1da2 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -16,11 +16,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/boost/sqlite/boost-sqlite-vc10.sln b/boost/sqlite/boost-sqlite-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/boost/sqlite/boost-sqlite-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/boost/sqlite/boost-sqlite-vc11.sln b/boost/sqlite/boost-sqlite-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/boost/sqlite/boost-sqlite-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/sqlite/boost-sqlite-vc12.sln b/boost/sqlite/boost-sqlite-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/boost/sqlite/boost-sqlite-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/sqlite/boost-sqlite-vc8.sln b/boost/sqlite/boost-sqlite-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/boost/sqlite/boost-sqlite-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/boost/sqlite/boost-sqlite-vc9.sln b/boost/sqlite/boost-sqlite-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/boost/sqlite/boost-sqlite-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/boost/sqlite/makefile b/boost/sqlite/makefile index 709119a..de0bcb2 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -16,11 +16,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/build/bootstrap.make b/build/bootstrap.make index 4e0b0c2..7b97d74 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -170,6 +170,11 @@ $(foreach d,$(databases),$(call \ meta-vc11proj,$1-vc11.vcxproj,$(if $2,$2,$(notdir \ $1))-$d-vc11.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: +$(dist): meta-vc12projs = \ +$(foreach d,$(databases),$(call \ +meta-vc12proj,$1-vc12.vcxproj,$(if $2,$2,$(notdir \ +$1))-$d-vc12.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: + # $1 project name without the -vcN.vc[x]proj suffix. # vc8projs = $(addprefix $1-,$(addsuffix -vc8.vcproj,$(databases))) @@ -182,33 +187,57 @@ $(addprefix $1-,$(addsuffix -vc10.vcxproj.filters,$(databases))) vc11projs = $(addprefix $1-,$(addsuffix -vc11.vcxproj,$(databases))) \ $(addprefix $1-,$(addsuffix -vc11.vcxproj.filters,$(databases))) +vc12projs = $(addprefix $1-,$(addsuffix -vc12.vcxproj,$(databases))) \ +$(addprefix $1-,$(addsuffix -vc12.vcxproj.filters,$(databases))) + # $1 solution name without the -vcN.sln suffix. # $2 extra project suffix in addition to --vcN.vcproj (optional) # +$(dist): meta-vc8sln1 = \ +$(call meta-vc8sln,$(src_root)/template-vc8.sln,$1-vc8.sln,$2-vc8.vcproj) + $(dist): meta-vc8slns = \ $(foreach d,$(databases),$(call \ -meta-vc8sln,$1-vc8.sln,$1-$d-vc8.sln,$2-$d-vc8.vcproj,database,$d)$(literal_newline)\ +meta-vc8sln,$(src_root)/template-vc8.sln,$1-$d-vc8.sln,$2-$d-vc8.vcproj,database,$d)$(literal_newline)\ $(literal_tab))@: +$(dist): meta-vc9sln1 = \ +$(call meta-vc9sln,$(src_root)/template-vc9.sln,$1-vc9.sln,$2-vc9.vcproj) + $(dist): meta-vc9slns = \ $(foreach d,$(databases),$(call \ -meta-vc9sln,$1-vc9.sln,$1-$d-vc9.sln,$2-$d-vc9.vcproj,database,$d)$(literal_newline)\ +meta-vc9sln,$(src_root)/template-vc9.sln,$1-$d-vc9.sln,$2-$d-vc9.vcproj,database,$d)$(literal_newline)\ $(literal_tab))@: +$(dist): meta-vc10sln1 = \ +$(call meta-vc10sln,$(src_root)/template-vc10.sln,$1-vc10.sln,$2-vc10.vcxproj) + $(dist): meta-vc10slns = \ $(foreach d,$(databases),$(call \ -meta-vc10sln,$1-vc10.sln,$1-$d-vc10.sln,$2-$d-vc10.vcxproj,database,$d)$(literal_newline)\ +meta-vc10sln,$(src_root)/template-vc10.sln,$1-$d-vc10.sln,$2-$d-vc10.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: +$(dist): meta-vc11sln1 = \ +$(call meta-vc11sln,$(src_root)/template-vc11.sln,$1-vc11.sln,$2-vc11.vcxproj) + $(dist): meta-vc11slns = \ $(foreach d,$(databases),$(call \ -meta-vc11sln,$1-vc11.sln,$1-$d-vc11.sln,$2-$d-vc11.vcxproj,database,$d)$(literal_newline)\ +meta-vc11sln,$(src_root)/template-vc11.sln,$1-$d-vc11.sln,$2-$d-vc11.vcxproj,database,$d)$(literal_newline)\ +$(literal_tab))@: + +$(dist): meta-vc12sln1 = \ +$(call meta-vc12sln,$(src_root)/template-vc12.sln,$1-vc12.sln,$2-vc12.vcxproj) + +$(dist): meta-vc12slns = \ +$(foreach d,$(databases),$(call \ +meta-vc12sln,$(src_root)/template-vc12.sln,$1-$d-vc12.sln,$2-$d-vc12.vcxproj,database,$d)$(literal_newline)\ $(literal_tab))@: vc8slns = $(addprefix $1-,$(addsuffix -vc8.sln,$(databases))) vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) vc10slns = $(addprefix $1-,$(addsuffix -vc10.sln,$(databases))) vc11slns = $(addprefix $1-,$(addsuffix -vc11.sln,$(databases))) +vc12slns = $(addprefix $1-,$(addsuffix -vc12.sln,$(databases))) endif diff --git a/common/common-vc10.sln b/common/common-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/common/common-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/common/common-vc11.sln b/common/common-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/common/common-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/common/common-vc12.sln b/common/common-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/common/common-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/common/common-vc8.sln b/common/common-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/common/common-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/common/common-vc9.sln b/common/common-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/common/common-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/evolution/evolution-vc10.sln b/evolution/evolution-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/evolution/evolution-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/evolution/evolution-vc11.sln b/evolution/evolution-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/evolution/evolution-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/evolution/evolution-vc12.sln b/evolution/evolution-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/evolution/evolution-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/evolution/evolution-vc8.sln b/evolution/evolution-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/evolution/evolution-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/evolution/evolution-vc9.sln b/evolution/evolution-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/evolution/evolution-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/libcommon/libcommon-vc10.sln b/libcommon/libcommon-vc10.sln deleted file mode 100644 index 9042eed..0000000 --- a/libcommon/libcommon-vc10.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc10.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libcommon/libcommon-vc11.sln b/libcommon/libcommon-vc11.sln deleted file mode 100644 index 6439a7d..0000000 --- a/libcommon/libcommon-vc11.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc11.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libcommon/libcommon-vc12.sln b/libcommon/libcommon-vc12.sln deleted file mode 100644 index 172c6a4..0000000 --- a/libcommon/libcommon-vc12.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc11.vcxproj", "{019C2E51-BF41-4490-AB96-4156741B8CC9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.ActiveCfg = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|Win32.Build.0 = Debug|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.ActiveCfg = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Debug|x64.Build.0 = Debug|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.ActiveCfg = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|Win32.Build.0 = Release|Win32 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.ActiveCfg = Release|x64 - {019C2E51-BF41-4490-AB96-4156741B8CC9}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libcommon/libcommon-vc8.sln b/libcommon/libcommon-vc8.sln deleted file mode 100644 index 73326f5..0000000 --- a/libcommon/libcommon-vc8.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc8.vcproj", "{8575F058-1BD6-4F97-8901-83D0110C2B6B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.ActiveCfg = Debug|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.Build.0 = Debug|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.ActiveCfg = Debug|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.Build.0 = Debug|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.ActiveCfg = Release|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.Build.0 = Release|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.ActiveCfg = Release|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libcommon/libcommon-vc9.sln b/libcommon/libcommon-vc9.sln deleted file mode 100644 index e12c11d..0000000 --- a/libcommon/libcommon-vc9.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcommon", "common\libcommon-__value__(database)-vc9.vcproj", "{8575F058-1BD6-4F97-8901-83D0110C2B6B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.ActiveCfg = Debug|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|Win32.Build.0 = Debug|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.ActiveCfg = Debug|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Debug|x64.Build.0 = Debug|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.ActiveCfg = Release|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|Win32.Build.0 = Release|Win32 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.ActiveCfg = Release|x64 - {8575F058-1BD6-4F97-8901-83D0110C2B6B}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mssql/makefile b/mssql/makefile index 158edfb..9337a8e 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -20,11 +20,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/mssql/mssql-vc10.sln b/mssql/mssql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/mssql/mssql-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/mssql/mssql-vc11.sln b/mssql/mssql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/mssql/mssql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mssql/mssql-vc12.sln b/mssql/mssql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/mssql/mssql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mssql/mssql-vc8.sln b/mssql/mssql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/mssql/mssql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mssql/mssql-vc9.sln b/mssql/mssql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/mssql/mssql-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/mysql/makefile b/mysql/makefile index 190d535..95ca3eb 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -21,11 +21,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/mysql/mysql-vc10.sln b/mysql/mysql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/mysql/mysql-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/mysql/mysql-vc11.sln b/mysql/mysql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/mysql/mysql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mysql/mysql-vc12.sln b/mysql/mysql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/mysql/mysql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mysql/mysql-vc8.sln b/mysql/mysql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/mysql/mysql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/mysql/mysql-vc9.sln b/mysql/mysql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/mysql/mysql-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/oracle/makefile b/oracle/makefile index ef0f8b9..4069f1a 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -19,11 +19,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/oracle/oracle-vc10.sln b/oracle/oracle-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/oracle/oracle-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/oracle/oracle-vc11.sln b/oracle/oracle-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/oracle/oracle-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/oracle/oracle-vc12.sln b/oracle/oracle-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/oracle/oracle-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/oracle/oracle-vc8.sln b/oracle/oracle-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/oracle/oracle-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/oracle/oracle-vc9.sln b/oracle/oracle-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/oracle/oracle-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/pgsql/makefile b/pgsql/makefile index 29857e0..e783f21 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -21,11 +21,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/pgsql/pgsql-vc10.sln b/pgsql/pgsql-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/pgsql/pgsql-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/pgsql/pgsql-vc11.sln b/pgsql/pgsql-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/pgsql/pgsql-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/pgsql/pgsql-vc12.sln b/pgsql/pgsql-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/pgsql/pgsql-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/pgsql/pgsql-vc8.sln b/pgsql/pgsql-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/pgsql/pgsql-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/pgsql/pgsql-vc9.sln b/pgsql/pgsql-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/pgsql/pgsql-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/qt/common/qt-common-qt4-vc10.sln b/qt/common/qt-common-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/common/qt-common-qt4-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/qt/common/qt-common-qt4-vc11.sln b/qt/common/qt-common-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/common/qt-common-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-qt4-vc12.sln b/qt/common/qt-common-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/common/qt-common-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-qt4-vc8.sln b/qt/common/qt-common-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/common/qt-common-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-qt4-vc9.sln b/qt/common/qt-common-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/common/qt-common-qt4-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/qt/common/qt-common-qt5-vc10.sln b/qt/common/qt-common-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/common/qt-common-qt5-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/qt/common/qt-common-qt5-vc11.sln b/qt/common/qt-common-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/common/qt-common-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-qt5-vc12.sln b/qt/common/qt-common-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/common/qt-common-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/common/qt-common-qt5-vc9.sln b/qt/common/qt-common-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/common/qt-common-qt5-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/qt/mssql/makefile b/qt/mssql/makefile index 282a581..6dd4c3e 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -21,15 +21,15 @@ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ $(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) - $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) - $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) - $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) - $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) - $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) - $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) - $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) - $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) + $(call meta-vc8sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt5,-qt5) + $(call meta-vc10sln1,$(name)-qt4,-qt4) + $(call meta-vc10sln1,$(name)-qt5,-qt5) + $(call meta-vc11sln1,$(name)-qt4,-qt4) + $(call meta-vc11sln1,$(name)-qt5,-qt5) + $(call meta-vc12sln1,$(name)-qt4,-qt4) + $(call meta-vc12sln1,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) diff --git a/qt/mssql/qt-mssql-qt4-vc10.sln b/qt/mssql/qt-mssql-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mssql/qt-mssql-qt4-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/qt/mssql/qt-mssql-qt4-vc11.sln b/qt/mssql/qt-mssql-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mssql/qt-mssql-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-qt4-vc12.sln b/qt/mssql/qt-mssql-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/mssql/qt-mssql-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-qt4-vc8.sln b/qt/mssql/qt-mssql-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/mssql/qt-mssql-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-qt4-vc9.sln b/qt/mssql/qt-mssql-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mssql/qt-mssql-qt4-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/qt/mssql/qt-mssql-qt5-vc10.sln b/qt/mssql/qt-mssql-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mssql/qt-mssql-qt5-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/qt/mssql/qt-mssql-qt5-vc11.sln b/qt/mssql/qt-mssql-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mssql/qt-mssql-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-qt5-vc12.sln b/qt/mssql/qt-mssql-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/mssql/qt-mssql-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mssql/qt-mssql-qt5-vc9.sln b/qt/mssql/qt-mssql-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mssql/qt-mssql-qt5-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/qt/mysql/makefile b/qt/mysql/makefile index 0f5150f..8607012 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -21,15 +21,15 @@ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ $(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) - $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) - $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) - $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) - $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) - $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) - $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) - $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) - $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) + $(call meta-vc8sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt5,-qt5) + $(call meta-vc10sln1,$(name)-qt4,-qt4) + $(call meta-vc10sln1,$(name)-qt5,-qt5) + $(call meta-vc11sln1,$(name)-qt4,-qt4) + $(call meta-vc11sln1,$(name)-qt5,-qt5) + $(call meta-vc12sln1,$(name)-qt4,-qt4) + $(call meta-vc12sln1,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) diff --git a/qt/mysql/qt-mysql-qt4-vc10.sln b/qt/mysql/qt-mysql-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mysql/qt-mysql-qt4-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/qt/mysql/qt-mysql-qt4-vc11.sln b/qt/mysql/qt-mysql-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mysql/qt-mysql-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-qt4-vc12.sln b/qt/mysql/qt-mysql-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/mysql/qt-mysql-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-qt4-vc8.sln b/qt/mysql/qt-mysql-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/mysql/qt-mysql-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-qt4-vc9.sln b/qt/mysql/qt-mysql-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mysql/qt-mysql-qt4-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/qt/mysql/qt-mysql-qt5-vc10.sln b/qt/mysql/qt-mysql-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/mysql/qt-mysql-qt5-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/qt/mysql/qt-mysql-qt5-vc11.sln b/qt/mysql/qt-mysql-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/mysql/qt-mysql-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-qt5-vc12.sln b/qt/mysql/qt-mysql-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/mysql/qt-mysql-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/mysql/qt-mysql-qt5-vc9.sln b/qt/mysql/qt-mysql-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/mysql/qt-mysql-qt5-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/qt/oracle/makefile b/qt/oracle/makefile index ae09691..a47dd24 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -21,15 +21,15 @@ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ $(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) - $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) - $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) - $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) - $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) - $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) - $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) - $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) - $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) + $(call meta-vc8sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt5,-qt5) + $(call meta-vc10sln1,$(name)-qt4,-qt4) + $(call meta-vc10sln1,$(name)-qt5,-qt5) + $(call meta-vc11sln1,$(name)-qt4,-qt4) + $(call meta-vc11sln1,$(name)-qt5,-qt5) + $(call meta-vc12sln1,$(name)-qt4,-qt4) + $(call meta-vc12sln1,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) diff --git a/qt/oracle/qt-oracle-qt4-vc10.sln b/qt/oracle/qt-oracle-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/oracle/qt-oracle-qt4-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/qt/oracle/qt-oracle-qt4-vc11.sln b/qt/oracle/qt-oracle-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/oracle/qt-oracle-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-qt4-vc12.sln b/qt/oracle/qt-oracle-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/oracle/qt-oracle-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-qt4-vc8.sln b/qt/oracle/qt-oracle-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/oracle/qt-oracle-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-qt4-vc9.sln b/qt/oracle/qt-oracle-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/oracle/qt-oracle-qt4-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/qt/oracle/qt-oracle-qt5-vc10.sln b/qt/oracle/qt-oracle-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/oracle/qt-oracle-qt5-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/qt/oracle/qt-oracle-qt5-vc11.sln b/qt/oracle/qt-oracle-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/oracle/qt-oracle-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-qt5-vc12.sln b/qt/oracle/qt-oracle-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/oracle/qt-oracle-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/oracle/qt-oracle-qt5-vc9.sln b/qt/oracle/qt-oracle-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/oracle/qt-oracle-qt5-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/qt/pgsql/makefile b/qt/pgsql/makefile index 7fbb23d..e4402f7 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -21,15 +21,15 @@ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ $(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) - $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) - $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) - $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) - $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) - $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) - $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) - $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) - $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) + $(call meta-vc8sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt5,-qt5) + $(call meta-vc10sln1,$(name)-qt4,-qt4) + $(call meta-vc10sln1,$(name)-qt5,-qt5) + $(call meta-vc11sln1,$(name)-qt4,-qt4) + $(call meta-vc11sln1,$(name)-qt5,-qt5) + $(call meta-vc12sln1,$(name)-qt4,-qt4) + $(call meta-vc12sln1,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) diff --git a/qt/pgsql/qt-pgsql-qt4-vc10.sln b/qt/pgsql/qt-pgsql-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/pgsql/qt-pgsql-qt4-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/qt/pgsql/qt-pgsql-qt4-vc11.sln b/qt/pgsql/qt-pgsql-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/pgsql/qt-pgsql-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt4-vc12.sln b/qt/pgsql/qt-pgsql-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/pgsql/qt-pgsql-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt4-vc8.sln b/qt/pgsql/qt-pgsql-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/pgsql/qt-pgsql-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt4-vc9.sln b/qt/pgsql/qt-pgsql-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/pgsql/qt-pgsql-qt4-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/qt/pgsql/qt-pgsql-qt5-vc10.sln b/qt/pgsql/qt-pgsql-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/pgsql/qt-pgsql-qt5-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/qt/pgsql/qt-pgsql-qt5-vc11.sln b/qt/pgsql/qt-pgsql-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/pgsql/qt-pgsql-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt5-vc12.sln b/qt/pgsql/qt-pgsql-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/pgsql/qt-pgsql-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/pgsql/qt-pgsql-qt5-vc9.sln b/qt/pgsql/qt-pgsql-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/pgsql/qt-pgsql-qt5-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/qt/sqlite/makefile b/qt/sqlite/makefile index 91c01ca..45f8fee 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -21,15 +21,15 @@ $(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ $(name)-qt4-vc12.sln $(name)-qt5-vc12.sln $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-qt4-vc8.sln,,-qt4-vc8.vcproj) - $(call meta-vc9sln,$(name)-qt4-vc9.sln,,-qt4-vc9.vcproj) - $(call meta-vc9sln,$(name)-qt5-vc9.sln,,-qt5-vc9.vcproj) - $(call meta-vc10sln,$(name)-qt4-vc10.sln,,-qt4-vc10.vcxproj) - $(call meta-vc10sln,$(name)-qt5-vc10.sln,,-qt5-vc10.vcxproj) - $(call meta-vc11sln,$(name)-qt4-vc11.sln,,-qt4-vc11.vcxproj) - $(call meta-vc11sln,$(name)-qt5-vc11.sln,,-qt5-vc11.vcxproj) - $(call meta-vc12sln,$(name)-qt4-vc12.sln,,-qt4-vc12.vcxproj) - $(call meta-vc12sln,$(name)-qt5-vc12.sln,,-qt5-vc12.vcxproj) + $(call meta-vc8sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt4,-qt4) + $(call meta-vc9sln1,$(name)-qt5,-qt5) + $(call meta-vc10sln1,$(name)-qt4,-qt4) + $(call meta-vc10sln1,$(name)-qt5,-qt5) + $(call meta-vc11sln1,$(name)-qt4,-qt4) + $(call meta-vc11sln1,$(name)-qt5,-qt5) + $(call meta-vc12sln1,$(name)-qt4,-qt4) + $(call meta-vc12sln1,$(name)-qt5,-qt5) # Can't have Qt-version specific tests. $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) diff --git a/qt/sqlite/qt-sqlite-qt4-vc10.sln b/qt/sqlite/qt-sqlite-qt4-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/sqlite/qt-sqlite-qt4-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/qt/sqlite/qt-sqlite-qt4-vc11.sln b/qt/sqlite/qt-sqlite-qt4-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/sqlite/qt-sqlite-qt4-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt4-vc12.sln b/qt/sqlite/qt-sqlite-qt4-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/sqlite/qt-sqlite-qt4-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt4-vc8.sln b/qt/sqlite/qt-sqlite-qt4-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/qt/sqlite/qt-sqlite-qt4-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt4-vc9.sln b/qt/sqlite/qt-sqlite-qt4-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/sqlite/qt-sqlite-qt4-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/qt/sqlite/qt-sqlite-qt5-vc10.sln b/qt/sqlite/qt-sqlite-qt5-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/qt/sqlite/qt-sqlite-qt5-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/qt/sqlite/qt-sqlite-qt5-vc11.sln b/qt/sqlite/qt-sqlite-qt5-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/qt/sqlite/qt-sqlite-qt5-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt5-vc12.sln b/qt/sqlite/qt-sqlite-qt5-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/qt/sqlite/qt-sqlite-qt5-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/qt/sqlite/qt-sqlite-qt5-vc9.sln b/qt/sqlite/qt-sqlite-qt5-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/qt/sqlite/qt-sqlite-qt5-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/sqlite/makefile b/sqlite/makefile index 3f9f793..c4093ca 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -21,11 +21,11 @@ $(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ $(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) - $(call meta-vc8sln,$(name)-vc8.sln) - $(call meta-vc9sln,$(name)-vc9.sln) - $(call meta-vc10sln,$(name)-vc10.sln) - $(call meta-vc11sln,$(name)-vc11.sln) - $(call meta-vc12sln,$(name)-vc12.sln) + $(call meta-vc8sln1,$(name)) + $(call meta-vc9sln1,$(name)) + $(call meta-vc10sln1,$(name)) + $(call meta-vc11sln1,$(name)) + $(call meta-vc12sln1,$(name)) $(call meta-vctest,$(name)-vc10.sln,test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) diff --git a/sqlite/sqlite-vc10.sln b/sqlite/sqlite-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/sqlite/sqlite-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/sqlite/sqlite-vc11.sln b/sqlite/sqlite-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/sqlite/sqlite-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/sqlite/sqlite-vc12.sln b/sqlite/sqlite-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/sqlite/sqlite-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/sqlite/sqlite-vc8.sln b/sqlite/sqlite-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/sqlite/sqlite-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/sqlite/sqlite-vc9.sln b/sqlite/sqlite-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/sqlite/sqlite-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/template-vc10.sln b/template-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/template-vc10.sln @@ -0,0 +1,15 @@ + +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/template-vc11.sln b/template-vc11.sln new file mode 100644 index 0000000..436eeea --- /dev/null +++ b/template-vc11.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/template-vc12.sln b/template-vc12.sln new file mode 100644 index 0000000..446d701 --- /dev/null +++ b/template-vc12.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/template-vc8.sln b/template-vc8.sln new file mode 100644 index 0000000..f38bad2 --- /dev/null +++ b/template-vc8.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/template-vc9.sln b/template-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/template-vc9.sln @@ -0,0 +1,15 @@ + +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 -- cgit v1.1 From 43e329f4cf9c175960154e395556eca23c170a75 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Jun 2014 11:58:35 +0200 Subject: Fix typo in comment --- common/session/custom/session.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 6de140e..1ebf452 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -51,7 +51,7 @@ private: virtual ~object_map_base () {} - // Return true we flushed anything. + // Return true if we flushed anything. // virtual bool flush (odb::database&) = 0; -- cgit v1.1 From 06c7e4520615c9d9d7882fb13be5632a709ad5ac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 1 Aug 2014 07:15:19 +0200 Subject: Add support for defining persistent objects as class template instantiations --- common/access/driver.cxx | 3 +- common/makefile | 1 + common/object/driver.cxx | 83 ++++++++++++++++++++++++++++++++ common/object/makefile | 120 +++++++++++++++++++++++++++++++++++++++++++++++ common/object/test.hxx | 45 ++++++++++++++++++ common/object/test.std | 0 6 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 common/object/driver.cxx create mode 100644 common/object/makefile create mode 100644 common/object/test.hxx create mode 100644 common/object/test.std diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 4ec8433..05c18be 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -95,7 +95,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->persist (o.p1 ()); + const object1_ptr& ptr (o.p1 ()); + db->persist (ptr); db->persist (o.p2 ()); db->persist (o); t.commit (); diff --git a/common/makefile b/common/makefile index 6ee2436..0fe8ffe 100644 --- a/common/makefile +++ b/common/makefile @@ -32,6 +32,7 @@ inverse \ lazy-ptr \ lifecycle \ no-id \ +object \ optimistic \ pragma \ prepared \ diff --git a/common/object/driver.cxx b/common/object/driver.cxx new file mode 100644 index 0000000..f3bad0e --- /dev/null +++ b/common/object/driver.cxx @@ -0,0 +1,83 @@ +// file : common/object/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test persistent classes. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test persistent class template instantiation. + // + { + using namespace test1; + + pair_object po; + po.second = "abc"; + + derived d; + d.x = "abc"; + d.n = 123; + + // persist + // + { + transaction t (db->begin ()); + db->persist (po); + db->persist (d); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr po1 (db->load (po.first)); + auto_ptr d1 (db->load (d.id)); + t.commit (); + + assert (po == *po1); + + assert (d.x == d1->x); + assert (d.n == d1->n); + } + + // Test the API confusion. + // + { + transaction t (db->begin ()); + db->update (po); + db->reload (po); + db->erase (po); + + db->query (); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/object/makefile b/common/object/makefile new file mode 100644 index 0000000..c270400 --- /dev/null +++ b/common/object/makefile @@ -0,0 +1,120 @@ +# file : common/object/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema \ +--table-prefix object_ --generate-query +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export odb_header_stem := $(basename $(odb_hdr)) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/object/test.hxx b/common/object/test.hxx new file mode 100644 index 0000000..aec17c6 --- /dev/null +++ b/common/object/test.hxx @@ -0,0 +1,45 @@ +// file : common/object/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::pair + +#include + +// Test persistent class template instantiation. +// +#pragma db namespace table("t1_") +namespace test1 +{ + typedef std::pair pair_object; + #pragma db object(pair_object) + #pragma db member(pair_object::first) id auto + + #pragma db object abstract + struct base_data + { + #pragma db id auto + unsigned long id; + }; + + template + struct base: base_data + { + T x; + }; + + typedef base base_derived; + #pragma db object(base_derived) abstract + + #pragma db object + struct derived: base_derived + { + int n; + }; +} + +#endif // TEST_HXX diff --git a/common/object/test.std b/common/object/test.std new file mode 100644 index 0000000..e69de29 -- cgit v1.1 From 61b55ab0a92eee6d80fe0d028b1e8a339e8a3856 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 1 Aug 2014 11:27:07 +0200 Subject: Bump version to 2.4.0.a3 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index dd4b617..26d9ac3 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a2 +2.4.0.a3 -- cgit v1.1 From a3af5aadbe45eccab791eec98859f6ad722c3b58 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Aug 2014 11:59:50 +0200 Subject: Make sure persistent class templates are fully instantiated --- common/object/test.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/object/test.hxx b/common/object/test.hxx index aec17c6..4ff9075 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -40,6 +40,11 @@ namespace test1 { int n; }; + + // Test instantiation in order to "see" id, etc. + // + typedef base int_base; + #pragma db object(int_base) } #endif // TEST_HXX -- cgit v1.1 From b985defe92ab9107fa857d2c32b7d5182b351344 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 29 Aug 2014 12:06:46 +0200 Subject: Pass non-const image to clone_image(), copy_image() This is necessary since some databases need to steal stuff from the original image (e.g., LOB descriptors in Oracle). --- common/inheritance/polymorphism/driver.cxx | 52 ++++++++++++++++++++++++++++++ common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test15.hxx | 45 ++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 common/inheritance/polymorphism/test15.hxx diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 7ab6346..672473c 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -29,6 +29,7 @@ #include "test12.hxx" #include "test13.hxx" #include "test14.hxx" +#include "test15.hxx" #include "test1-odb.hxx" #include "test2-odb.hxx" @@ -44,6 +45,7 @@ #include "test12-odb.hxx" #include "test13-odb.hxx" #include "test14-odb.hxx" +#include "test15-odb.hxx" using namespace std; using namespace odb::core; @@ -2002,6 +2004,56 @@ main (int argc, char* argv[]) t.commit (); } } + + // Test 15: LOB/long data and polymorphism. + // + { + using namespace test15; + + const char data[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B"; + + derived d; + d.blob.assign (data, data + sizeof (data)); + + // Persist. + // + { + transaction t (db->begin ()); + base* b (&d); + db->persist (b); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr pb (db->load (d.id)); + t.commit (); + + derived* pd (dynamic_cast (pb.get ())); + assert (pd != 0 && pd->blob == d.blob); + } + + // Query. + // + { + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e); + + derived* pd (dynamic_cast (&*i)); + assert (pd != 0 && pd->blob == d.blob); + + assert (++i == e); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index bfe66ab..a9cbc4e 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -7,7 +7,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx \ -test14.hxx +test14.hxx test15.hxx genf := $(call odb-gen,$(odb_hdr)) gen := $(addprefix $(out_base)/,$(genf)) cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx new file mode 100644 index 0000000..d64f935 --- /dev/null +++ b/common/inheritance/polymorphism/test15.hxx @@ -0,0 +1,45 @@ +// file : common/inheritance/polymorphism/test15.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST15_HXX +#define TEST15_HXX + +#include + +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + + +// Test LOB/long data and polymorphism. +// +#pragma db namespace table("t15_") +namespace test15 +{ + #pragma db object polymorphic + struct base + { + virtual ~base () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct derived: base + { + #pragma db type(BLOB_TYPE) + std::vector blob; + }; +} + +#endif // TEST15_HXX -- cgit v1.1 From 39e1eab9d379f393ea5e396b79762b4d3d1a84a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 Sep 2014 14:27:33 +0200 Subject: Avoid clashes between nested composites in query columns --- common/composite/test.hxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 8bf4b97..5dad274 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -219,4 +219,33 @@ namespace test4 } } +// Test composite name clashes in query columns (compilation test) +// +#pragma db namespace table("t5_") +namespace test5 +{ + // Class-member conflict. + // + #pragma db value + struct value {int value_;}; + + // Class-class conflict. + // + #pragma db value + struct inner {int value;}; + + #pragma db value + struct outer {inner value;}; + + #pragma db object + struct object + { + #pragma db id + int id; + + outer value; + test5::value v; + }; +} + #endif // TEST_HXX -- cgit v1.1 From ff265813bccf264cae2caf83d319efb9fcf11e30 Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Thu, 16 Oct 2014 16:11:41 +0200 Subject: Add support for Qt5 in build system --- build/import/libqt/configure | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/import/libqt/configure b/build/import/libqt/configure index cd02836..c78af91 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -48,7 +48,13 @@ else core_cppflags=`pkg-config --cflags QtCore` core_libs=`pkg-config --libs QtCore` + elif pkg-config --exists Qt5Core; then + + core_cppflags=`pkg-config --cflags Qt5Core` + core_libs=`pkg-config --libs Qt5Core` + else + $echo $echo "Unable to discover installed 'Qt libraries' using pkg-config." $echo "Assuming the C++ compiler will find them automatically." -- cgit v1.1 From 53d936af40ca044289695404d577e99f6cca2304 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 23 Oct 2014 12:13:16 +0200 Subject: Get rid of command for target that has nothing to build This makes a difference in make output. Without the command we get "Nothing to be done..." (which is what we want) while with the command we get no diagnostics. --- common/changelog/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changelog/makefile b/common/changelog/makefile index bd0f243..2f900c1 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -52,7 +52,7 @@ endif $(default): $(gen) else -$(default): ;@: +$(default): endif # Dist: not supported. -- cgit v1.1 From dee5f10d1d75eee43596ad1dfb47ecec9e0b1307 Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Wed, 22 Oct 2014 16:42:05 +0200 Subject: Allow lambdas & std::functions as query factories with C++-98 builds of libodb --- common/prepared/driver.cxx | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 5c622c0..dfbdf13 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -249,7 +249,7 @@ main (int argc, char* argv[]) } db->query_factory ("person-params-query", - database::query_factory_type ()); + database::query_factory_ptr ()); } // Cached query with wildcard factory. @@ -273,7 +273,7 @@ main (int argc, char* argv[]) t.commit (); } - db->query_factory ("", database::query_factory_type ()); + db->query_factory ("", database::query_factory_ptr ()); } // Cached query with lambda factory. @@ -312,7 +312,47 @@ main (int argc, char* argv[]) } db->query_factory ("person-params-query-2", - database::query_factory_type ()); + database::query_factory_ptr ()); + } + + // Cached query with lambda factory using closure. Forces nonoptimized + // representation of std::function. + // + { + const std::string person_name ("John First"); + + db->query_factory ( + "person-params-query-3", + [person_name] (const char* name, connection& c) + { + typedef odb::query query; + + prepared_query pq ( + c.prepare_query ( + name, + query::age > 50 && query::name != person_name)); + c.cache_query (pq); + }); + + { + transaction t (db->begin ()); + + prep_query pq (db->lookup_query ("person-params-query-3")); + assert (pq); + + result r (pq.execute ()); + assert (size (r) == 4); + + t.commit (); + } + + db->query_factory ("person-params-query-3", +#ifdef HAVE_CXX11_NULLPTR + nullptr +#else + database::query_factory_ptr () +#endif + ); } #endif -- cgit v1.1 From 64b27b86025d160e49bf617143d80671ccb1e0e4 Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Wed, 5 Nov 2014 14:23:54 +1100 Subject: Implement {query,execute}_{one,value}() shortcut functions Useful in situations where the query is know to return at most one element (*_one) or exactly one element (*_value). --- common/makefile | 1 + common/prepared/driver.cxx | 40 +++++++++ common/prepared/test.hxx | 4 +- common/query/one/driver.cxx | 204 ++++++++++++++++++++++++++++++++++++++++++++ common/query/one/makefile | 118 +++++++++++++++++++++++++ common/query/one/test.hxx | 27 ++++++ common/query/one/test.std | 0 common/view/driver.cxx | 19 +++++ 8 files changed, 411 insertions(+), 2 deletions(-) create mode 100644 common/query/one/driver.cxx create mode 100644 common/query/one/makefile create mode 100644 common/query/one/test.hxx create mode 100644 common/query/one/test.std diff --git a/common/makefile b/common/makefile index 0fe8ffe..aa195ba 100644 --- a/common/makefile +++ b/common/makefile @@ -38,6 +38,7 @@ pragma \ prepared \ query/basics \ query/array \ +query/one \ readonly \ relationship/basics \ relationship/on-delete \ diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index dfbdf13..ee690a1 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -411,6 +411,46 @@ main (int argc, char* argv[]) t.commit (); } + + // Test execute_one() and execute_value(). + // + { + transaction t (db->begin ()); + + person p ("John Doe", 23); + db->persist (p); + + prep_query pq1 ( + db->prepare_query ("query-1", query::id == p.id_)); + prep_query pq0 ( + db->prepare_query ("query-0", query::id == p.id_ + 1)); + + { + auto_ptr p (pq1.execute_one ()); + assert (p.get () != 0 && p->name_ == "John Doe"); + } + + { + auto_ptr p (pq0.execute_one ()); + assert (p.get () == 0); + } + + { + person p; + assert (pq1.execute_one (p) && p.name_ == "John Doe"); + } + + { + person p ("", 0); + assert (!pq0.execute_one (p) && + p.id_ == 0 && p.name_.empty () && p.age_ == 0); + } + + { + person p (pq1.execute_value ()); + assert (p.name_ == "John Doe"); + } + } } catch (const odb::exception& e) { diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index c6e2c1e..571f4b6 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -12,9 +12,9 @@ #pragma db object struct person { - person () {} + person (): id_ (0) {} person (const std::string& name, unsigned short age) - : name_ (name), age_ (age) {} + : id_ (0), name_ (name), age_ (age) {} #pragma db id auto unsigned long id_; diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx new file mode 100644 index 0000000..e6b2b67 --- /dev/null +++ b/common/query/one/driver.cxx @@ -0,0 +1,204 @@ +// file : common/query/one/driver.cxx +// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query one support. +// +// We assume that other tests in common/query/ exercise a variety of +// different kinds of queries. Here we are concerned with what is +// specific to query_one() and query_value(). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + odb::database_id db_id (db->id ()); + + transaction t (db->begin ()); + + // query_one() + // + { + auto_ptr o (db->query_one ()); + assert (o.get () == 0); + } + + { + object o (4); + assert (!db->query_one (o) && o.id_ == 4 && o.str_.empty ()); + } + + /* + { + object o (db->query_value ()); + assert (false); + } + */ + + object o (1); + o.str_ = "value 1"; + db->persist (o); + + { + auto_ptr o (db->query_one ()); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + object o; + assert (db->query_one (o) && o.str_ == "value 1"); + } + + { + object o (db->query_value ()); + assert (o.str_ == "value 1"); + } + + // query_one(const char*) + // + const char* q1_c (db_id == odb::id_oracle ? "\"id\" = 1" : "id = 1"); + const char* q0_c (db_id == odb::id_oracle ? "\"id\" = 2" : "id = 2"); + + { + auto_ptr o (db->query_one (q1_c)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + auto_ptr o (db->query_one (q0_c)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1_c, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0_c, o) && + o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1_c)); + assert (o.str_ == "value 1"); + } + + // query_one(std::string) + // + string q1_s (q1_c); + string q0_s (q0_c); + + { + auto_ptr o (db->query_one (q1_s)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + auto_ptr o (db->query_one (q0_s)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1_s, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0_s, o) && + o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1_s)); + assert (o.str_ == "value 1"); + } + + // query_one(odb::query) + // + typedef odb::query query; + + query q1 (query::id == 1); + query q0 (query::id == 2); + + { + auto_ptr o (db->query_one (q1)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + auto_ptr o (db->query_one (q0)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0, o) && o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1)); + assert (o.str_ == "value 1"); + } + + // Assertion on more than one element. + // + { + object o (2); + o.str_ = "value 2"; + db->persist (o); + } + + /* + { + auto_ptr o (db->query_one ()); + assert (false); + } + */ + + /* + { + object o; + db->query_one (o); + assert (false); + } + */ + + /* + { + object o (db->query_value ()); + assert (false); + } + */ + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/query/one/makefile b/common/query/one/makefile new file mode 100644 index 0000000..2fd441b --- /dev/null +++ b/common/query/one/makefile @@ -0,0 +1,118 @@ +# file : common/query/one/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix t_query_one_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx new file mode 100644 index 0000000..1a9c35e --- /dev/null +++ b/common/query/one/test.hxx @@ -0,0 +1,27 @@ +// file : common/query/one/test.hxx +// copyright : Copyright (c) 2009-2014 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_; + std::string str_; +}; + +#endif // TEST_HXX diff --git a/common/query/one/test.std b/common/query/one/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/view/driver.cxx b/common/view/driver.cxx index 7ef8272..28c3ba0 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -76,6 +76,25 @@ view2_test (const auto_ptr& db) assert (i->count == 2); } + { + auto_ptr v (db->query_one ()); + assert (v->count == 4); + } + + { + auto_ptr v; + if (db->id () != odb::id_oracle) + v.reset (db->query_one ("age < 31")); + else + v.reset (db->query_one ("\"age\" < 31")); + assert (v->count == 2); + } + + { + auto_ptr v (db->query_one (query::age < 31)); + assert (v->count == 2); + } + t.commit (); } -- cgit v1.1 From 092cb7d916b8ebc83cacab849010acd04f56d38d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 18 Nov 2014 14:54:23 +0200 Subject: Add SQL Server stored procedure test --- mssql/makefile | 1 + mssql/stored-proc/driver.cxx | 181 +++++++++++++++++++++++++++++++++++++++++++ mssql/stored-proc/makefile | 108 ++++++++++++++++++++++++++ mssql/stored-proc/test.hxx | 58 ++++++++++++++ mssql/stored-proc/test.std | 11 +++ 5 files changed, 359 insertions(+) create mode 100644 mssql/stored-proc/driver.cxx create mode 100644 mssql/stored-proc/makefile create mode 100644 mssql/stored-proc/test.hxx create mode 100644 mssql/stored-proc/test.std diff --git a/mssql/makefile b/mssql/makefile index 9337a8e..646e776 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -10,6 +10,7 @@ custom \ database \ native \ query \ +stored-proc \ types $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx new file mode 100644 index 0000000..60c4d27 --- /dev/null +++ b/mssql/stored-proc/driver.cxx @@ -0,0 +1,181 @@ +// file : mssql/stored-proc/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server stored procedure support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +void +create_procedure (database& db, const string& name, const string& body) +{ + transaction t (db.begin ()); + + string s (db.query_value ().name); + + db.execute ( + "IF EXISTS (" + " SELECT * FROM sysobjects" + " WHERE name = '" + name + "' AND user_name(uid) = '" + s +"')" + " DROP PROCEDURE [" + s + "].[" + name + "]"); + + db.execute ("CREATE PROCEDURE [" + s + "].[" + name + "] " + body); + + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + object o1 (1, "a"); + object o2 (2, "b"); + object o3 (3, "c"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + create_procedure ( + *db, "select_all_objects", + "AS" + " SELECT num, str FROM mssql_stored_proc_object ORDER BY id;"); + + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->num << " " << i->str << endl; + cout << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "select_objects", + "(@id INT, @n VARCHAR(512))" + "AS" + " SELECT str FROM mssql_stored_proc_object " + " WHERE [id] = @id OR [num] = @n ORDER BY id;"); + + typedef mssql::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ( + query::_val (o1.id) + "," + query::_val (o2.num))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->str << endl; + cout << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "objects_min_max", + "(@min INT = NULL OUTPUT, @max INT = NULL OUTPUT)" + "AS" + " SELECT @min = MIN(num), @max = MAX(num)" + " FROM mssql_stored_proc_object;"); + + create_procedure ( + *db, "objects_min_max_odb", + "AS" + " DECLARE @min INT, @max INT;" + " EXEC objects_min_max @min OUTPUT, @max OUTPUT;" + " SELECT @min, @max;"); + + transaction t (db->begin ()); + + objects_min_max omm (db->query_value ()); + cout << omm.num_min << " " << omm.num_max << endl + << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "insert_object", + "(@n INT, @s VARCHAR(512), @id INT = NULL OUTPUT)" + "AS" + " INSERT INTO mssql_stored_proc_object([num], [str])" + " VALUES(@n, @s);" + " SET @id = SCOPE_IDENTITY();" + " RETURN 123;"); + + create_procedure ( + *db, "insert_object_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " DECLARE @tbl TABLE(dummy INT);" + " EXEC @ret = insert_object @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); + + // An alternative implementation that produces a different + // result set configuration at the ODBC level. + // + /* + create_procedure ( + *db, "insert_object_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " DECLARE @tbl TABLE(dummy INT);" + " INSERT INTO @tbl EXEC @ret = insert_object @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); + */ + + typedef mssql::query query; + + transaction t (db->begin ()); + + insert_object io ( + db->query_value ( + query::_val (4) + "," + query::_val ("d"))); + + cout << io.ret << " " << io.id << endl + << endl; + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile new file mode 100644 index 0000000..f590150 --- /dev/null +++ b/mssql/stored-proc/makefile @@ -0,0 +1,108 @@ +# file : mssql/stored-proc/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database mssql --default-database \ +common --generate-schema --generate-query --table-prefix mssql_stored_proc_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx new file mode 100644 index 0000000..16f3c52 --- /dev/null +++ b/mssql/stored-proc/test.hxx @@ -0,0 +1,58 @@ +// file : mssql/stored-proc/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db view query("SELECT SCHEMA_NAME()") +struct default_schema +{ + std::string name; +}; + +#pragma db object +struct object +{ + object () {} + object (unsigned int n, std::string s): num (n), str (s) {} + + #pragma db id auto + unsigned long id; + + unsigned int num; + std::string str; +}; + +#pragma db view query("EXEC select_all_objects") +struct select_all_objects +{ + unsigned int num; + std::string str; +}; + +#pragma db view query("EXEC select_objects (?)") +struct select_objects +{ + std::string str; +}; + +#pragma db view query("EXEC objects_min_max_odb (?)") +struct objects_min_max +{ + unsigned int num_min; + unsigned int num_max; +}; + +#pragma db view query("EXEC insert_object_odb (?)") +struct insert_object +{ + unsigned int ret; + unsigned long id; +}; + +#endif // TEST_HXX diff --git a/mssql/stored-proc/test.std b/mssql/stored-proc/test.std new file mode 100644 index 0000000..528007c --- /dev/null +++ b/mssql/stored-proc/test.std @@ -0,0 +1,11 @@ +1 a +2 b +3 c + +a +b + +1 3 + +123 4 + -- cgit v1.1 From 0aa976237df26be9415c5aac335ab43e026db077 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Nov 2014 13:54:39 +0200 Subject: Allow empty runtime and execute views Use them to handle INSERT/UPDATE SQL Server stored procedures. --- mssql/stored-proc/driver.cxx | 116 +++++++++++++++++++++++++++++++------------ mssql/stored-proc/test.hxx | 10 +++- mssql/stored-proc/test.std | 8 ++- 3 files changed, 99 insertions(+), 35 deletions(-) diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index 60c4d27..2878486 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -126,7 +126,46 @@ main (int argc, char* argv[]) { create_procedure ( - *db, "insert_object", + *db, "insert_object_id", + "(@n INT, @s VARCHAR(512))" + "AS" + " INSERT INTO mssql_stored_proc_object([num], [str])" + " VALUES(@n, @s);"); + + { + typedef mssql::query query; + + transaction t (db->begin ()); + + db->query_one ( + query::_val (4) + "," + query::_val ("d")); + + auto_ptr o (db->load (4)); + cout << o->num << " " << o->str << endl + << endl; + + t.commit (); + } + + { + typedef mssql::query query; + + transaction t (db->begin ()); + + db->query_one ( + "EXEC insert_object_id" + query::_val (5) + "," + query::_val ("e")); + + auto_ptr o (db->load (5)); + cout << o->num << " " << o->str << endl + << endl; + + t.commit (); + } + } + + { + create_procedure ( + *db, "insert_object_id", "(@n INT, @s VARCHAR(512), @id INT = NULL OUTPUT)" "AS" " INSERT INTO mssql_stored_proc_object([num], [str])" @@ -134,43 +173,56 @@ main (int argc, char* argv[]) " SET @id = SCOPE_IDENTITY();" " RETURN 123;"); - create_procedure ( - *db, "insert_object_odb", - "(@n INT, @s VARCHAR(512))" - "AS" - " DECLARE @id INT;" - " DECLARE @ret INT;" - " DECLARE @tbl TABLE(dummy INT);" - " EXEC @ret = insert_object @n, @s, @id OUTPUT;" - " SELECT @ret, @id;"); + typedef mssql::query query; - // An alternative implementation that produces a different - // result set configuration at the ODBC level. - // - /* - create_procedure ( - *db, "insert_object_odb", - "(@n INT, @s VARCHAR(512))" - "AS" - " DECLARE @id INT;" - " DECLARE @ret INT;" - " DECLARE @tbl TABLE(dummy INT);" - " INSERT INTO @tbl EXEC @ret = insert_object @n, @s, @id OUTPUT;" - " SELECT @ret, @id;"); - */ + { + create_procedure ( + *db, "insert_object_id_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " DECLARE @tbl TABLE(dummy INT);" + " EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); - typedef mssql::query query; + transaction t (db->begin ()); - transaction t (db->begin ()); + insert_object_id io ( + db->query_value ( + query::_val (6) + "," + query::_val ("f"))); - insert_object io ( - db->query_value ( - query::_val (4) + "," + query::_val ("d"))); + cout << io.ret << " " << io.id << endl + << endl; - cout << io.ret << " " << io.id << endl - << endl; + t.commit (); + } - t.commit (); + // An alternative implementation that produces a different + // result set configuration at the ODBC level. + // + { + create_procedure ( + *db, "insert_object_id_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " DECLARE @tbl TABLE(dummy INT);" + " INSERT INTO @tbl EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); + + transaction t (db->begin ()); + + insert_object_id io ( + db->query_value ( + query::_val (7) + "," + query::_val ("g"))); + + cout << io.ret << " " << io.id << endl + << endl; + + t.commit (); + } } } catch (const odb::exception& e) diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index 16f3c52..d302630 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -28,6 +28,9 @@ struct object std::string str; }; +#pragma db view +struct no_result {}; + #pragma db view query("EXEC select_all_objects") struct select_all_objects { @@ -48,8 +51,11 @@ struct objects_min_max unsigned int num_max; }; -#pragma db view query("EXEC insert_object_odb (?)") -struct insert_object +#pragma db view query("EXEC insert_object (?)") +struct insert_object {}; + +#pragma db view query("EXEC insert_object_id_odb (?)") +struct insert_object_id { unsigned int ret; unsigned long id; diff --git a/mssql/stored-proc/test.std b/mssql/stored-proc/test.std index 528007c..6635bcc 100644 --- a/mssql/stored-proc/test.std +++ b/mssql/stored-proc/test.std @@ -7,5 +7,11 @@ b 1 3 -123 4 +4 d + +5 e + +123 6 + +123 7 -- cgit v1.1 From 0a4df2bc0c7962acbddc55b4b5668e09fb54ef7f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Nov 2014 14:48:06 +0200 Subject: Bump version to 2.4.0.a4 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 26d9ac3..42645da 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a3 +2.4.0.a4 -- cgit v1.1 From d7752cdb86957f7dc0caffe6033e872443ad8153 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 14 Nov 2014 16:24:50 +0200 Subject: Implement bulk database operation support for Oracle and SQL Server --- common/auto/test.hxx | 4 +- common/bulk/driver.cxx | 1025 ++++++++++++++++++++++++++++++++++++++ common/bulk/makefile | 118 +++++ common/bulk/test.hxx | 192 +++++++ common/bulk/test.std | 218 ++++++++ common/makefile | 3 +- common/section/basics/driver.cxx | 14 + mssql/types/driver.cxx | 51 +- mssql/types/test.hxx | 27 +- 9 files changed, 1640 insertions(+), 12 deletions(-) create mode 100644 common/bulk/driver.cxx create mode 100644 common/bulk/makefile create mode 100644 common/bulk/test.hxx create mode 100644 common/bulk/test.std diff --git a/common/auto/test.hxx b/common/auto/test.hxx index 61fbcc6..cee27c5 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -34,8 +34,8 @@ private: #pragma db object struct auto_only { - #pragma db auto id - unsigned long id_; + #pragma db auto id pgsql:type("BIGINT") + unsigned short id_; }; #endif // TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx new file mode 100644 index 0000000..2903ae4 --- /dev/null +++ b/common/bulk/driver.cxx @@ -0,0 +1,1025 @@ +// file : common/bulk/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test bulk database operations. +// + +#include // std::auto_ptr +#include +#include +#include +#include + +#include +#include + +#include + +#include // HAVE_CXX11, DATABASE_* +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +// Sun CC with non-standard STL does not have iterator_traits in which +// case we assume iterator is just a pointer. +// +template ::value_type +#else + typename T = typename details::meta::remove_pointer::result +#endif + > +struct element_traits; + +template +struct element_traits +{ + typedef T type; + typedef std::auto_ptr auto_ptr; + + static T& ref (T& x) {return x;} + static T* ptr (T* p) {return p;} +}; + +template +struct element_traits +{ + typedef T type; + typedef std::auto_ptr auto_ptr; + + static T& ref (T* p) {return *p;} + static T* ptr (T* p) {return p;} +}; + +template +struct element_traits > +{ + typedef T type; + typedef std::auto_ptr auto_ptr; + + static T& ref (const auto_ptr& p) {return *p;} + static T* ptr (const auto_ptr& p) {return p.get ();} +}; + +#ifdef HAVE_CXX11 +template +struct element_traits> +{ + typedef T type; + typedef std::unique_ptr auto_ptr; + + static T& ref (const unique_ptr& p) {return *p;} + static T* ptr (const unique_ptr& p) {return p.get ();} +}; +#endif + +template +void +persist (const auto_ptr& db, I b, I e, bool cont = true) +{ + typedef element_traits traits; + typedef typename traits::type type; + typedef typename traits::auto_ptr auto_ptr; + + { + transaction t (db->begin ()); + db->persist (b, e, cont); + t.commit (); + } + + // Verify we can load the objects via their ids. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + auto_ptr p (db->load (x.id)); + assert (p->n == x.n && p->s == x.s); + } + + t.commit (); + } +} + +template +void +try_persist (const auto_ptr& db, I b, I e, bool cont = true) +{ + try + { + persist (db, b, e, cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + +template +void +update (const auto_ptr& db, I b, I e, + bool modify = true, bool cont = true) +{ + typedef element_traits traits; + typedef typename traits::type type; + typedef typename traits::auto_ptr auto_ptr; + + if (modify) + { + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + x.n++; + x.s[0]++; + } + } + + { + transaction t (db->begin ()); + db->update (b, e, cont); + t.commit (); + } + + // Verify changes. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + auto_ptr p (db->load (x.id)); + assert (p->n == x.n && p->s == x.s); + } + + t.commit (); + } +} + +template +void +try_update (const auto_ptr& db, I b, I e, bool cont = true) +{ + try + { + update (db, b, e, false, cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + +template +void +erase (const auto_ptr& db, I b, I e) +{ + typedef element_traits traits; + typedef typename traits::type type; + + { + transaction t (db->begin ()); + db->erase (b, e); + t.commit (); + } + + // Verify the objects are gone. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + assert (traits::ptr (db->find (x.id)) == 0); + } + + t.commit (); + } +} + +template +void +erase_id (const auto_ptr& db, I b, I e, bool cont = true) +{ + typedef element_traits traits; + typedef T type; + + { + transaction t (db->begin ()); + db->erase (b, e, cont); + t.commit (); + } + + // Verify the objects are gone. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + assert (traits::ptr (db->find (*i)) == 0); + + t.commit (); + } +} + +template +void +try_erase (const auto_ptr& db, const A& a, bool cont = true) +{ + try + { + erase_id (db, a, a + sizeof (a) / sizeof (a[0]), cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + + +template +void +test (const auto_ptr& db, I b, I e) +{ + persist (db, b, e); + update (db, b, e); + erase (db, b, e); +} + +template +vector +fill (std::size_t count) +{ + vector r; + + unsigned int n (1); + std::string s ("a"); + + for (size_t i (0); i != count; ++i) + { + r.push_back (T (n, s)); + n++; + s[0] = (s[0] == 'z' ? 'a' : s[0] + 1); + } + + return r; +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + +#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) + + // Test database class API with various forms of containers + // and elements (test #6 is a copy). + // + { + using namespace test1; + + { + object a[2]; + a[0] = object (1, "a"); + a[1] = object (2, "b"); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + test (db, v.begin (), v.end ()); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + object* a[2] = {&o1, &o2}; + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + vector v; + v.push_back (&o1); + v.push_back (&o2); + test (db, v.begin (), v.end ()); + } + + { + auto_ptr a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + +#ifdef HAVE_CXX11 + { + vector> v; + v.push_back (unique_ptr (new unique_object (1, "a"))); + v.push_back (unique_ptr (new unique_object (2, "b"))); + test (db, v.begin (), v.end ()); + } +#endif + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + unsigned long id[2] = {v[0].id, v[1].id}; + erase_id (db, id, id + sizeof (id) / sizeof (id[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + vector id; + id.push_back (v[0].id); + id.push_back (v[1].id); + erase_id (db, id.begin (), id.end ()); + } + } + + // Test various batch sizes. + // + { + using namespace test1; + + { + vector v; // 0 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (1)); // 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (2)); // batch - 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (3)); // batch + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (4)); // batch + 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (5)); // 2 * batch - 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (6)); // 2 * batch + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (100)); // 100 + test (db, v.begin (), v.end ()); + } + } + + // Test object with manually assigned id. + // + { + using namespace test2; + + { + vector v; + v.push_back (object ("1", 1, "a")); + v.push_back (object ("2", 2, "b")); + test (db, v.begin (), v.end ()); + } + +#ifdef HAVE_CXX11 + { + typedef unique_ptr unique_ptr; + + vector v; + v.push_back (unique_ptr (new unique_object ("1", 1, "a"))); + v.push_back (unique_ptr (new unique_object ("2", 2, "b"))); + test (db, v.begin (), v.end ()); + } +#endif + + // Test const objects. + // + + { + const object a[1]; + const object* e (a + sizeof (a) / sizeof (a[0])); + + transaction t (db->begin ()); + db->persist (a, e); + db->erase (a, e); + t.commit (); + } + + { + object o1 ("1", 1, "a"); + object o2 ("2", 2, "b"); + + vector v; + v.push_back (&o1); + v.push_back (&o2); + + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } + + // Test failure. + // + { + using namespace test3; + + vector v; + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + v.push_back (object (11, 11)); + + persist (db, v.begin (), v.end ()); + + // persist + // + { + { + vector v; // 1 + v.push_back (object (6, 6)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + 1 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch - 1 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + v.push_back (object (11, 11)); + try_persist (db, v.begin (), v.end ()); + } + + // Mixture of success and failure. + // + + { + vector v; // 1 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 1 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + v.push_back (object (8, 8)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (1, 1)); + v.push_back (object (7, 7)); + v.push_back (object (2, 2)); + v.push_back (object (8, 8)); + v.push_back (object (3, 3)); + try_persist (db, v.begin (), v.end ()); + } + + // Test stopping after failure. + // + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + try_persist (db, v.begin (), v.end (), false); + } + } + + // update + // + { + { + vector v; // 1 + v.push_back (object (0, 0)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + 1 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch - 1 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (4, 4)); + v.push_back (object (5, 5)); + try_update (db, v.begin (), v.end ()); + } + + // Mixture of success and failure. + // + + { + vector v; // 1 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 1 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + v.push_back (object (7, 7)); + v.push_back (object (3, 3)); + v.push_back (object (8, 8)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + // Test stopping after failure. + // + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + try_update (db, v.begin (), v.end (), false); + } + + // Test a database exception (unique constraint violation) + // + try + { + v[0].n++; + v[2].n++; + + update (db, v.begin (), v.begin () + 3, false); + assert (false); + } + catch (const multiple_exceptions& e) + { + assert (e.attempted () == 3 && e.failed () == 2); + assert (e[0] != 0 && e[1] == 0 && e[2] != 0); + } + } + + // erase + // + { + { + unsigned long a[] = {0}; // 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3, 4}; // 2 x batch - 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3, 4, 5}; // 2 x batch + try_erase (db, a); + } + + // Mixture of success and failure. + // + + { + unsigned long a[] = {6, 0}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 1}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6, 1}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 6}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 1, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6, 1, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 6, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 6}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 7, 1, 8, 2, 9, 3}; // mixture + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 6, 7, 8, 3, 4, 5, 9}; // mixture + try_erase (db, a); + } + + // Test stopping after failure. + // + { + unsigned long a[] = {6, 7, 0, 8, 9}; + try_erase (db, a, false); + } + } + + erase (db, v.begin (), v.end ()); + } + + // Test a large batch. + // + { + using namespace test4; + + vector v (fill (5000)); + test (db, v.begin (), v.end ()); + } + + // Test object without id. + // + { + using namespace test5; + + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::n)); + result::iterator i (r.begin ()); + + assert (i != r.end () && i->n == 1 && i->s == "a"); + assert (++i != r.end () && i->n == 2 && i->s == "b"); + assert (++i == r.end ()); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (); + t.commit (); + } + } + + // Test API with persistent class template instantiations (copy of + // test #1). + { + using namespace test6; + + // Make sure we can still call the non-bulk API. + // + { + object o (0, "z"); + transaction t (db->begin ()); + db->persist (o); + db->update (o); + db->reload (o); + db->erase (o); + t.commit (); + } + + + // The rest is a copy of test #1. + // + { + object a[2]; + a[0] = object (1, "a"); + a[1] = object (2, "b"); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + test (db, v.begin (), v.end ()); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + object* a[2] = {&o1, &o2}; + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + vector v; + v.push_back (&o1); + v.push_back (&o2); + test (db, v.begin (), v.end ()); + } + + { + auto_ptr a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + +#ifdef HAVE_CXX11 + { + vector> v; + v.push_back (unique_ptr (new unique_object (1, "a"))); + v.push_back (unique_ptr (new unique_object (2, "b"))); + test (db, v.begin (), v.end ()); + } +#endif + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + unsigned long id[2] = {v[0].id, v[1].id}; + erase_id (db, id, id + sizeof (id) / sizeof (id[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + vector id; + id.push_back (v[0].id); + id.push_back (v[1].id); + erase_id (db, id.begin (), id.end ()); + } + } + +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/bulk/makefile b/common/bulk/makefile new file mode 100644 index 0000000..2107cd2 --- /dev/null +++ b/common/bulk/makefile @@ -0,0 +1,118 @@ +# file : common/bulk/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix bulk_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx new file mode 100644 index 0000000..526762f --- /dev/null +++ b/common/bulk/test.hxx @@ -0,0 +1,192 @@ +// file : common/driver/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include +#include // std::auto_ptr, std::unique_ptr + +#include + +// Test basic functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object bulk(3) session + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + + #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. + std::string s; + }; + + #pragma db object bulk(3) pointer(std::auto_ptr) + struct auto_object + { + auto_object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + std::string s; + }; + +#ifdef HAVE_CXX11 + #pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object + { + unique_object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + std::string s; + }; +#endif +} + +// Test object with manually assigned id. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object bulk(3) session + struct object + { + // Can't use empty id because of Oracle. + // + object (std::string id_ = "!", unsigned int n_ = 0, std::string s_ = "") + : id (id_), n (n_), s (s_) {} + + #pragma db id + std::string id; + + unsigned int n; + std::string s; + }; + +#ifdef HAVE_CXX11 +#pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object + { + unique_object (std::string id_ = "", + unsigned int n_ = 0, + std::string s_ = "") + : id (id_), n (n_), s (s_) {} + + #pragma db id + std::string id; + + unsigned int n; + std::string s; + }; +#endif +} + +// Test failure. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object bulk(3) + struct object + { + object (unsigned long id_ = 0, unsigned int n_ = 0) + : id (id_), n (n_), s ("abc") {} + + #pragma db id + unsigned long id; + + #pragma db unique + unsigned int n; + std::string s; + }; +} + +// Test a large batch. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object bulk(3000) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + + #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. + std::string s; + }; +} + +// Test object without id. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object no_id bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = ""): n (n_), s (s_) {} + + unsigned int n; + std::string s; + }; +} + +// Test API with persistent class template instantiations. +// +#pragma db namespace table("t6_") +namespace test6 +{ + template + struct object_template + { + object_template (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + unsigned long id; + unsigned int n; + std::string s; + }; + + typedef object_template<1> object; + + #pragma db object(object) bulk(3) + #pragma db member(object::id) id auto + + typedef object_template<2> auto_object; + + #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) + #pragma db member(auto_object::id) id auto + +#ifdef HAVE_CXX11 + typedef object_template<3> unique_object; + + #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) + #pragma db member(unique_object::id) id auto +#endif +} + +#endif // TEST_HXX diff --git a/common/bulk/test.std b/common/bulk/test.std new file mode 100644 index 0000000..6c4bdf9 --- /dev/null +++ b/common/bulk/test.std @@ -0,0 +1,218 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent +[5] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[3] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 7 elements attempted, 3 failed: +[1] object already persistent +[3] object already persistent +[5] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 7 failed: +[0-5] (some) object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 8 failed: +[0-7] (some) object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + diff --git a/common/makefile b/common/makefile index aa195ba..04e3efa 100644 --- a/common/makefile +++ b/common/makefile @@ -8,6 +8,7 @@ tests := \ access \ auto \ blob \ +bulk \ callback \ changelog \ circular/single \ @@ -63,7 +64,7 @@ cxx11_tests := session/custom no_dist_tests := changelog include -no_multi_tests := changelog include +no_multi_tests := bulk changelog include $(default): $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index f34ed90..a2b7006 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1273,6 +1273,13 @@ main (int argc, char* argv[]) db->update (o1, o1.s); assert (o.v != o1.v); + // Double-check object version was updated. + // + { + auto_ptr p1 (db->load (o.id)); + assert (o1.v == p1->v); + } + try { db->load (*p, p->s); @@ -1393,6 +1400,13 @@ main (int argc, char* argv[]) db->update (o1, o1.s); assert (o.v != o1.v); + // Double-check object version was updated. + // + { + auto_ptr p1 (db->load (o.id)); + assert (o1.v == p1->v); + } + try { db->load (*p, p->s); diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 33b606e..55e4c68 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -269,23 +269,64 @@ main (int argc, char* argv[]) // Test optimistic concurrency using ROWVERSION. // { - rowversion o; + rowversion o (123); o.str = "abc"; { transaction t (db->begin ()); db->persist (o); - assert (o.version != 0); + assert (o.ver != 0); t.commit (); } { transaction t (db->begin ()); auto_ptr p (db->load (o.id_)); - assert (p->version == o.version); + assert (p->ver == o.ver); p->str += 'd'; db->update (*p); - assert (p->version > o.version); + assert (p->ver > o.ver); + + // Double-check object version was updated. + // + { + auto_ptr p1 (db->load (o.id_)); + assert (p->ver == p1->ver); + } + + o.str += 'D'; + try + { + db->update (o); + assert (false); + } + catch (const odb::object_changed&) {} + db->reload (o); + assert (o.ver == p->ver); + o.str += 'D'; + db->update (o); + t.commit (); + } + } + + { + rowversion_auto o; + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + assert (o.ver != 0); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + assert (p->ver == o.ver); + p->str += 'd'; + db->update (*p); + assert (p->ver > o.ver); o.str += 'D'; try { @@ -294,7 +335,7 @@ main (int argc, char* argv[]) } catch (const odb::object_changed&) {} db->reload (o); - assert (o.version == p->version); + assert (o.ver == p->ver); o.str += 'D'; db->update (o); t.commit (); diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 82f8147..9d9ab89 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -470,21 +470,40 @@ struct char_array } }; -// Test optimistic concurrency using ROWVERSION. +// Test optimistic concurrency using ROWVERSION, both with auto and +// manually-assigned ids. // #pragma db object optimistic struct rowversion { - rowversion (): version (0) {} + rowversion (unsigned int id = 0): id_ (id), ver (0) {} + + #pragma db id + unsigned int id_; + + #pragma db version type("ROWVERSION") +#ifdef _WIN32 + unsigned __int64 ver; +#else + unsigned long long ver; +#endif + + std::string str; +}; + +#pragma db object optimistic +struct rowversion_auto +{ + rowversion_auto (): ver (0) {} #pragma db id auto unsigned int id_; #pragma db version type("ROWVERSION") #ifdef _WIN32 - unsigned __int64 version; + unsigned __int64 ver; #else - unsigned long long version; + unsigned long long ver; #endif std::string str; -- cgit v1.1 From 3d022058bc8b61c14c2d16e760ea1393d775c0d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Nov 2014 10:58:50 +0200 Subject: Reimplement image copying for Oracle Now we no longer "steal" descriptors (destructive copy). Instead, for LOBs, we clone the locator using OCILobAssign(). For date-time types we extract the data during copying. As a result of this change we no longer need to track image changes and rebind the statements. --- oracle/types/driver.cxx | 71 +++++++++++++++++++++++++++++++++++++++++-------- oracle/types/test.hxx | 28 ++++++++++++------- 2 files changed, 78 insertions(+), 21 deletions(-) diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index ab7ae24..4b40bd1 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -180,8 +180,23 @@ main (int argc, char* argv[]) // Test large BLOBs. // - blob b1 (1, 50000); - blob b2 (2, 500000); + descriptor b1 (1); + b1.blob.assign (50000, 'b'); + b1.timestamp = date_time (1996, 3, 9, 18, 2, 54, 123000); + b1.interval_ds = time_interval (0, 0, 13, 15, 23, 19, 123000); + b1.interval_ym = time_interval (12, 3, 0, 0, 0, 0, 0); + + descriptor b2 (2); + b2.blob.assign (500000, 'b'); + b2.timestamp = date_time (1997, 4, 10, 19, 3, 55, 234000); + b2.interval_ds = time_interval (0, 0, 14, 16, 24, 20, 234000); + b2.interval_ym = time_interval (13, 4, 0, 0, 0, 0, 0); + + descriptor b3 (3); + b3.blob.assign (5000, 'b'); + b3.timestamp = date_time (1995, 2, 8, 17, 1, 53, 120000); + b3.interval_ds = time_interval (0, 0, 12, 14, 22, 18, 120000); + b3.interval_ym = time_interval (11, 2, 0, 0, 0, 0, 0); // Persist. // @@ -196,40 +211,74 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); t.commit (); assert (b1 == *p1); assert (b2 == *p2); } - // Test image copying with LOB data. + // Test image copying with descriptor-based type (LOB, date-time) data. // { - typedef oracle::query query; - typedef odb::result result; + typedef oracle::query query; + typedef odb::result result; transaction t (db->begin ()); - result r (db->query (query::id < 3)); + // Pre-bind the image for other operations. + // + { + db->persist (b3); + db->update (b3); + db->reload (b3); + db->erase (b3); + } + + + result r (db->query (query::id < 3)); result::iterator i (r.begin ()); assert (i != r.end ()); + + { + result r (db->query (query::id > 1)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (*i == b2); + assert (++i == r.end ()); + } + + assert (*i == b1); // Load from copy (copy c-tor). + ++i; assert (i != r.end ()); { - result r (db->query (query::id < 2)); + result r (db->query (query::id < 2)); result::iterator i (r.begin ()); assert (i != r.end ()); - assert (i->value_.size () == 50000); + assert (*i == b1); assert (++i == r.end ()); } - assert (i->value_.size () == 500000); // Load from copy. + assert (*i == b2); // Load from copy (copy assign). assert (++i == r.end ()); + // Make sure all other operations are still working. + // + { + db->persist (b3); + auto_ptr p (db->load (3)); + assert (b3 == *p); + b3.blob.push_back (123); + db->update (b3); + db->reload (p); + assert (b3 == *p); + db->erase (b3); + } + t.commit (); } diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index a3dac3f..ac903b8 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -275,25 +275,33 @@ struct big_int }; #pragma db object -struct blob +struct descriptor { - blob (): id_ (0) {} - - blob (unsigned int id, std::size_t n) - : id_ (id), value_ (n, 'b') - { - } + descriptor (unsigned int id = 0): id_ (id) {} #pragma db id unsigned int id_; #pragma db type ("BLOB") - std::vector value_; + std::vector blob; + + #pragma db type ("TIMESTAMP(6)") + date_time timestamp; + + #pragma db type ("INTERVAL DAY TO SECOND") + time_interval interval_ds; + + #pragma db type ("INTERVAL YEAR TO MONTH") + time_interval interval_ym; bool - operator== (const blob& y) const + operator== (const descriptor& y) const { - return id_ == y.id_ && value_ == y.value_; + return id_ == y.id_ && + blob == y.blob && + timestamp == y.timestamp && + interval_ds == y.interval_ds && + interval_ym == y.interval_ym; } }; -- cgit v1.1 From 59e3ebcafb1dc4d54484143fc926ef8377bdb154 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Nov 2014 15:04:56 +0200 Subject: Implement optimistic concurrency support in bulk operations Bulk update and SQL Server ROWVERSION not yet supported. --- common/bulk/driver.cxx | 190 +++++++++++++++++++++++++++++++++++++++++++++++++ common/bulk/test.hxx | 48 ++++++++++++- common/bulk/test.std | 8 +++ 3 files changed, 245 insertions(+), 1 deletion(-) diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 2903ae4..7d0b726 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1015,6 +1015,196 @@ main (int argc, char* argv[]) } } + // Test optimistic concurrency. + // + { + using namespace test7; + + std::vector v (fill (4)); + + // persist + // + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v != 0 && + v[1].v != 0 && + v[2].v != 0 && + v[3].v != 0); + } + + // update + // + { + std::vector c (v); + + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v > c[0].v && + v[1].v > c[1].v && + v[2].v > c[2].v && + v[3].v > c[3].v); + } + + { + object o2 (v[1]); + object o4 (v[3]); + + o2.n++; + o4.n++; + + transaction t (db->begin ()); + db->update (o2); + db->update (o4); + t.commit (); + } + + try + { + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + + // erase + // + try + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + + { + transaction t (db->begin ()); + db->reload (v[1]); + db->reload (v[3]); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } + + // Test SQL Server optimistic concurrency with ROWVERSION. + // +#ifdef DATABASE_MSSQL + { + using namespace test8; + + std::vector v (fill (4)); + + v[0].id = 1; + v[2].id = 2; + v[3].id = 3; + v[4].id = 4; + + + // persist + // + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v != 0 && + v[1].v != 0 && + v[2].v != 0 && + v[3].v != 0); + + //cerr << v[0].v << endl + // << v[0].v << endl + // << v[0].v << endl + // << v[0].v << endl; + } + + // update + // + + /* + { + std::vector c (v); + + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v > c[0].v && + v[1].v > c[1].v && + v[2].v > c[2].v && + v[3].v > c[3].v); + } + */ + + { + object o2 (v[1]); + object o4 (v[3]); + + o2.n++; + o4.n++; + + transaction t (db->begin ()); + db->update (o2); + db->update (o4); + t.commit (); + } + + /* + try + { + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + */ + + // erase + // + try + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + assert (e.attempted () == 4 && e.failed () == 4); + } + + { + transaction t (db->begin ()); + db->reload (v[1]); + db->reload (v[3]); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } +#endif + #endif } catch (const odb::exception& e) diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 526762f..c0955f1 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 +#include // HAVE_CXX11, DATABASE_* #include #include // std::auto_ptr, std::unique_ptr @@ -189,4 +189,50 @@ namespace test6 #endif } +// Test optimistic concurrency. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object optimistic bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), v (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long long id; + + #pragma db version + unsigned long long v; + + unsigned int n; + std::string s; + }; +} + +// Test SQL Server optimistic concurrency with ROWVERSION. +// +#ifdef DATABASE_MSSQL +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object optimistic bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), v (0), n (n_), s (s_) {} + + #pragma db id + unsigned long long id; + + #pragma db version type("ROWVERSION") + unsigned long long v; + + unsigned int n; + std::string s; + }; +} +#endif + #endif // TEST_HXX diff --git a/common/bulk/test.std b/common/bulk/test.std index 6c4bdf9..e72869d 100644 --- a/common/bulk/test.std +++ b/common/bulk/test.std @@ -216,3 +216,11 @@ multiple exceptions, 10 elements attempted, 6 failed: multiple exceptions, 3 elements attempted, 3 failed: [0-2] (some) object not persistent +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + -- cgit v1.1 From 32f09571e564c42c04acdba2cf139a507aa4b0da Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Dec 2014 13:52:26 +0200 Subject: Fix bug in id-based custom view join of polymorphic objects See email from Mikhail.Tomilov@infotecs.ru/12-Dec-2014. --- common/inheritance/polymorphism/driver.cxx | 16 ++++++++++++++++ common/inheritance/polymorphism/test4.hxx | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 672473c..d4509a4 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -968,6 +968,22 @@ main (int argc, char* argv[]) t.commit (); } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr (db->query ()); + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->str == "abc"); + assert (++i == e); + } + + t.commit (); + } } // Test 5: polymorphism and optimistic concurrency. diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index 0bd53bd..5c4ae2f 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -71,6 +71,15 @@ namespace test4 #pragma db column("min(" + base2::num + ")") unsigned long min_num; }; + + // Test custom join condition that uses object id. It cannot come + // from the base since the base table hasn't been join'ed yet. + // + #pragma db view object(base1) object(base2: base2::id == base1::id) + struct view3 + { + std::string str; + }; } #endif // TEST4_HXX -- cgit v1.1 From 475a01f652eccea04fb8992f0c2ccb027970539d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Dec 2014 15:24:31 +0200 Subject: Add support for database-specific output in tests Use that for the bulk test. --- build/bootstrap.make | 10 +- common/bulk/makefile | 4 +- common/bulk/test-mssql.std | 226 ++++++++++++++++++++++++++++++++++++++++++++ common/bulk/test-mysql.std | 0 common/bulk/test-oracle.std | 226 ++++++++++++++++++++++++++++++++++++++++++++ common/bulk/test-pgsql.std | 0 common/bulk/test-sqlite.std | 0 common/bulk/test.std | 226 -------------------------------------------- common/makefile | 2 +- tester.bat | 24 +++-- tester.in | 13 ++- 11 files changed, 490 insertions(+), 241 deletions(-) create mode 100644 common/bulk/test-mssql.std create mode 100644 common/bulk/test-mysql.std create mode 100644 common/bulk/test-oracle.std create mode 100644 common/bulk/test-pgsql.std create mode 100644 common/bulk/test-sqlite.std delete mode 100644 common/bulk/test.std diff --git a/build/bootstrap.make b/build/bootstrap.make index 7b97d74..9f749e3 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -114,25 +114,27 @@ endif # # $1 database name in the multi-database mode and empty otherwise +# $2 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) # define test-schemaless-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$2.std $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ $$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test.std $$(out_base)/test.out) + $$(call message,,diff -u $$(src_base)/test$2.std $$(out_base)/test.out) $$(call message,,rm -f $$(out_base)/test.out) endef # $1 database name in the multi-database mode and empty otherwise # $2 optional list of schema files, by default test.sql +# $3 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) # define test-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test.std +$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$3.std $$(call schema$(if $1,-$1),$2) $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ $$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test.std $$(out_base)/test.out) + $$(call message,,diff -u $$(src_base)/test$3.std $$(out_base)/test.out) $$(call message,,rm -f $$(out_base)/test.out) endef diff --git a/common/bulk/makefile b/common/bulk/makefile index 2107cd2..481fef3 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -68,9 +68,9 @@ $(dist): # Test. # ifneq ($(db_id),common) -$(eval $(call test-rule)) +$(eval $(call test-rule,,,-$(db_id))) else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) +$(foreach d,$(databases),$(eval $(call test-rule,$d,,-sqlite))) endif # Clean. diff --git a/common/bulk/test-mssql.std b/common/bulk/test-mssql.std new file mode 100644 index 0000000..e72869d --- /dev/null +++ b/common/bulk/test-mssql.std @@ -0,0 +1,226 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent +[5] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[3] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 7 elements attempted, 3 failed: +[1] object already persistent +[3] object already persistent +[5] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 7 failed: +[0-5] (some) object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 8 failed: +[0-7] (some) object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + diff --git a/common/bulk/test-mysql.std b/common/bulk/test-mysql.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test-oracle.std b/common/bulk/test-oracle.std new file mode 100644 index 0000000..e72869d --- /dev/null +++ b/common/bulk/test-oracle.std @@ -0,0 +1,226 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent +[3] object already persistent +[4] object already persistent +[5] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[2] object already persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object already persistent +[1] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[3] object already persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object already persistent +[1] object already persistent +[2] object already persistent + +multiple exceptions, 7 elements attempted, 3 failed: +[1] object already persistent +[3] object already persistent +[5] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 7 failed: +[0-5] (some) object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0-1] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 8 failed: +[0-7] (some) object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0-2] (some) object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 4 failed: +[0-2] (some) object changed concurrently +[3] object changed concurrently + diff --git a/common/bulk/test-pgsql.std b/common/bulk/test-pgsql.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test-sqlite.std b/common/bulk/test-sqlite.std new file mode 100644 index 0000000..e69de29 diff --git a/common/bulk/test.std b/common/bulk/test.std deleted file mode 100644 index e72869d..0000000 --- a/common/bulk/test.std +++ /dev/null @@ -1,226 +0,0 @@ -multiple exceptions, 1 element attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent -[5] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[3] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 7 elements attempted, 3 failed: -[1] object already persistent -[3] object already persistent -[5] object already persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object already persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 7 elements attempted, 7 failed: -[0-5] (some) object not persistent -[6] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 8 elements attempted, 8 failed: -[0-7] (some) object not persistent - -multiple exceptions, 10 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent -[7] object not persistent -[8] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - diff --git a/common/makefile b/common/makefile index 04e3efa..7f99cf4 100644 --- a/common/makefile +++ b/common/makefile @@ -64,7 +64,7 @@ cxx11_tests := session/custom no_dist_tests := changelog include -no_multi_tests := bulk changelog include +no_multi_tests := changelog include $(default): $(call include,$(bld_root)/cxx/standard.make) # cxx_standard diff --git a/tester.bat b/tester.bat index 95513fd..396070a 100644 --- a/tester.bat +++ b/tester.bat @@ -33,10 +33,26 @@ if exist test*.sql ( ) ) -if exist test.std ( +if exist test-%1.std ( + set "std=test-%1.std" +) else ( + if exist test.std ( + set "std=test.std" + ) else ( + set "std=" + ) +) + +if "_%std%" == "__" ( + + %dir%\driver.exe --options-file %topdir%\%1.options + if errorlevel 1 goto error + +) else ( + %dir%\driver.exe --options-file %topdir%\%1.options >test.out if errorlevel 1 goto error - %DIFF% test.std test.out + %DIFF% %std% test.out if errorlevel 1 ( del /f test.out @@ -46,10 +62,6 @@ if exist test.std ( del /f test.out goto end -) else ( - - %dir%\driver.exe --options-file %topdir%\%1.options - if errorlevel 1 goto error ) goto end diff --git a/tester.in b/tester.in index f9beb02..b653019 100755 --- a/tester.in +++ b/tester.in @@ -26,7 +26,16 @@ done echo ./driver --options-file "$db_options" -if test -f "$srcdir/test.std"; then +std= +if test -f "$srcdir/test-@database@.std"; then + std="$srcdir/test-@database@.std" +elif test -f "$srcdir/test.std"; then + std="$srcdir/test.std" +else + std= +fi + +if test -n "$std"; then ./driver --options-file "$db_options" >test.out if test $? -ne 0; then @@ -34,7 +43,7 @@ if test -f "$srcdir/test.std"; then exit 1 fi - @DIFF@ @DIFFFLAGS@ "$srcdir/test.std" test.out + @DIFF@ @DIFFFLAGS@ "$std" test.out r=$? rm -f test.out exit $r -- cgit v1.1 From 016c89d3418ae0d9d9509966f74d2eadd7af0797 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Dec 2014 15:26:22 +0200 Subject: Bump version to 2.4.0.a5 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 42645da..2a4e75c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a4 +2.4.0.a5 -- cgit v1.1 From db4e95841ed7d6d9eb008116bc74d25383fe001d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 Dec 2014 15:56:00 +0200 Subject: Fix list of .std files in dist target --- common/bulk/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bulk/makefile b/common/bulk/makefile index 481fef3..2ade5db 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -51,7 +51,7 @@ name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std +$(dist): data_dist := $(foreach d,$(databases),test-$d.std) $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ $(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -- cgit v1.1 From c19669147e4d54f17fcc2c9cf6066b59956fa188 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Jan 2015 14:29:16 +0200 Subject: Remove unnecessary variable, parameter list --- mssql/stored-proc/driver.cxx | 1 - mssql/stored-proc/test.hxx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index 2878486..afb5fe5 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -182,7 +182,6 @@ main (int argc, char* argv[]) "AS" " DECLARE @id INT;" " DECLARE @ret INT;" - " DECLARE @tbl TABLE(dummy INT);" " EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" " SELECT @ret, @id;"); diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index d302630..cb02920 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -44,7 +44,7 @@ struct select_objects std::string str; }; -#pragma db view query("EXEC objects_min_max_odb (?)") +#pragma db view query("EXEC objects_min_max_odb") struct objects_min_max { unsigned int num_min; -- cgit v1.1 From cbad49a571dfff9a046997b18776fd3cee6d7b51 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Jan 2015 09:58:42 +0200 Subject: Bump version to 2.4.0.a6 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 2a4e75c..770201d 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a5 +2.4.0.a6 -- cgit v1.1 From 504fa38f3f71c345f41dfbb7e59b1d2f88308987 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Feb 2015 17:23:54 +0200 Subject: Implement object loading views See section 10.2 in the manual for details. --- common/makefile | 4 +- common/session/custom/makefile | 3 +- common/view/basics/driver.cxx | 662 +++++++++++++++++++++++++++++++++++++++ common/view/basics/makefile | 118 +++++++ common/view/basics/test.hxx | 495 +++++++++++++++++++++++++++++ common/view/basics/test.std | 0 common/view/driver.cxx | 662 --------------------------------------- common/view/makefile | 118 ------- common/view/olv/driver.cxx | 615 ++++++++++++++++++++++++++++++++++++ common/view/olv/makefile | 113 +++++++ common/view/olv/test.hxx | 687 +++++++++++++++++++++++++++++++++++++++++ common/view/olv/test.std | 0 common/view/test.hxx | 495 ----------------------------- common/view/test.std | 0 14 files changed, 2693 insertions(+), 1279 deletions(-) create mode 100644 common/view/basics/driver.cxx create mode 100644 common/view/basics/makefile create mode 100644 common/view/basics/test.hxx create mode 100644 common/view/basics/test.std delete mode 100644 common/view/driver.cxx delete mode 100644 common/view/makefile create mode 100644 common/view/olv/driver.cxx create mode 100644 common/view/olv/makefile create mode 100644 common/view/olv/test.hxx create mode 100644 common/view/olv/test.std delete mode 100644 common/view/test.hxx delete mode 100644 common/view/test.std diff --git a/common/makefile b/common/makefile index 7f99cf4..f933484 100644 --- a/common/makefile +++ b/common/makefile @@ -55,12 +55,12 @@ template \ transaction/basics \ transaction/callback \ types \ -view \ +view/basics \ virtual \ wrapper thread_tests := threads -cxx11_tests := session/custom +cxx11_tests := session/custom view/olv no_dist_tests := changelog include diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 87016e1..ad92aa8 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -57,8 +57,7 @@ $(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -$(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) +$(call vc11projs,$(name)) $(call vc12projs,$(name)) $(dist): $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) $(call meta-automake,../../template/Makefile.am) diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx new file mode 100644 index 0000000..e1a72f7 --- /dev/null +++ b/common/view/basics/driver.cxx @@ -0,0 +1,662 @@ +// file : common/view/basics/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test view basics. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include // DATABASE_XXX + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +template +void +view1_check (odb::result& r) +{ + typedef odb::result result; + + typename result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); + + assert (++i != r.end ()); + V v; + i.load (v); + assert (v.first == "John" && v.last == "Doe" && v.age == 30); + + assert (++i == r.end ()); +} + +template +void +view2_test (const auto_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query ()); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31"); + else + r = db->query ("\"age\" < 31"); + + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + { + result r (db->query (query::age < 31)); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + { + auto_ptr v (db->query_one ()); + assert (v->count == 4); + } + + { + auto_ptr v; + if (db->id () != odb::id_oracle) + v.reset (db->query_one ("age < 31")); + else + v.reset (db->query_one ("\"age\" < 31")); + assert (v->count == 2); + } + + { + auto_ptr v (db->query_one (query::age < 31)); + assert (v->count == 2); + } + + t.commit (); +} + +template +void +view4_test (const auto_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ((query::person::age > 30) + "ORDER BY age"); + else + r = db->query ((query::person::age > 30) + "ORDER BY \"age\""); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query ( + (query::person::age > 30) + + "ORDER BY " + query::person::age)); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query (query::residence::code == "US")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i == r.end ()); + } + + t.commit (); +} + +template +void +view6_test (const auto_ptr& db, const odb::query& q) +{ + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query (q)); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->employer == "Simple Tech, Inc"); + + assert (++i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->employer == "Simple Tech, Inc"); + + assert (++i == r.end ()); + } + + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // + // + { + country ca ("CA", "Canada"); + country za ("ZA", "South Africa"); + country us ("US", "United States"); + country se ("SE", "Sweden"); + + person p1 (1, "John", "Doe", 30, male, measures (60, 160), &ca, &ca); + person p2 (2, "Jane", "Doe", 29, female, measures (70, 170), &za, &us); + person p3 (3, "Joe", "Dirt", 31, male, measures (80, 180), &us, &za); + person p4 (4, "Johan", "Johansen", 32, male, measures (90, 190), &se, + &se); + + p2.husband = &p1; + + employer st ("Simple Tech, Inc"); + employer ct ("Complex Tech, Inc"); + + p2.previous_employer = st.name; + p3.previous_employer = ct.name; + + st.employees.push_back (&p1); + st.employees.push_back (&p3); + st.head_count = 2; + + ct.employees.push_back (&p2); + ct.employees.push_back (&p4); + ct.head_count = 2; + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + + db->persist (st); + db->persist (ct); + t.commit (); + } + + // view1 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + assert (size (r) == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("ORDER BY age"); + else + r = db->query ("ORDER BY \"age\""); + + assert (size (r) == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + + view1_check (r); + } + + t.commit (); + } + } + + // view1a + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query ()); + view1_check (r); + + t.commit (); + } + } + + // view1b + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query ()); + view1_check (r); + + t.commit (); + } + + // No native parameter support in dynamic multi-database mode. + // +#ifndef DATABASE_COMMON + { + typedef odb::query query; + + transaction t (db->begin ()); + +#ifndef DATABASE_ORACLE + result r (db->query ("first = " + query::_val ("Jane"))); +#else + result r (db->query ("\"first\" = " + query::_val ("Jane"))); +#endif + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe"); + assert (++i == r.end ()); + + t.commit (); + } +#endif + } + + // view1c + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r; + if (db->id () != odb::id_oracle) + r = db->query ("SELECT first, last, age " + "FROM t_view_b_person " + "WHERE age < 31 ORDER BY age"); + else + r = db->query ("SELECT \"first\", \"last\", \"age\" " + "FROM \"t_view_b_person\" " + "WHERE \"age\" < 31 ORDER BY \"age\""); + view1_check (r); + + t.commit (); + } + } + + // view1d + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + + view1_check (r); + } + + t.commit (); + } + } + + // view2 + // + view2_test (db); + view2_test (db); + view2_test (db); + view2_test (db); + + // view3 + // + { + typedef odb::result result; // Test const result. + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + size_t count (0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->last_name == "Doe") + assert (i->count == 2); + else if (i->last_name == "Dirt" || + i->last_name == "Johansen") + assert (i->count == 1); + else + assert (false); + + count++; + } + + assert (count == 3); + } + + t.commit (); + } + } + + // view3a + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Doe")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->count == 2); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view4 + // + view4_test (db); + view4_test (db); + + // view5 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r ( + db->query ( + query::residence::name == query::nationality::name)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->rname == "Canada" && i->rname == "Canada"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->rname == "Sweden" && i->rname == "Sweden"); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view6 + // + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + // No native parameter support in dynamic multi-database mode. + // +#ifndef DATABASE_COMMON + view6_test ( +#ifndef DATABASE_ORACLE + db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); +#else + db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); +#endif +#endif + + // view7 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::person::last_name == "Doe")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + !i->head_count.null () && *i->head_count == 2); + + assert (++i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->head_count.null ()); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view8 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->wife_name == "Jane" && i->husb_name == "John"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view9 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + // Test case-insensitive clause prefix detection. + // + result r (db->query ("where" + (query::gender == female))); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + i->gender == female); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view10 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + query::measures.weight > 60 && + query::measures.hight < 190)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && + i->measures.weight == 70 && i->measures.hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && + i->measures.weight == 80 && i->measures.hight == 180); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view11 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && i->hight == 180); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view12 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->residence == "US"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/view/basics/makefile b/common/view/basics/makefile new file mode 100644 index 0000000..7598bb7 --- /dev/null +++ b/common/view/basics/makefile @@ -0,0 +1,118 @@ +# file : common/view/basics/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-prepared --table-prefix t_view_b_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx new file mode 100644 index 0000000..18fae4b --- /dev/null +++ b/common/view/basics/test.hxx @@ -0,0 +1,495 @@ +// file : common/view/basics/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::size_t + +#include +#include + +struct employer; + +#pragma db object +struct country +{ + country (const std::string& c, std::string const& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +enum gender_type {male, female}; + +#pragma db value +struct measures +{ + measures (unsigned short w, unsigned short h) : weight (w), hight (h) {} + measures () {} + + unsigned short weight; + unsigned short hight; +}; + +#pragma db object +struct person +{ + typedef ::measures measures_type; + + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + gender_type g, + const measures_type m, + country* r, + country* n) + : id (i), + first_name_ (fn), + last_name_ (ln), + age (a), + gender (g), + measures (m), + residence (r), + nationality (n), + husband (0) + { + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column("first") + std::string first_name_; + + #pragma db column("last") + std::string last_name_; + + unsigned short age; + + // #pragma db type("INT") - in MySQL test type pragma copying + gender_type gender; + + measures_type measures; + + #pragma db not_null + country* residence; + + #pragma db not_null + country* nationality; + + #pragma db inverse(employees) + employer* employed_by; + + // A non-pointer relationship. + // + odb::nullable previous_employer; + + person* husband; // Self-reference. +}; + +#pragma db object +struct employer +{ + employer (const std::string& n) + : name (n) + { + } + + employer () + { + } + + #pragma db id + std::string name; + unsigned int head_count; + std::vector employees; +}; + +// +// General view with no associated objects. +// + +// Complete suffix query template. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age FROM t_view_b_person") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\"") +#endif +struct view1 +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Complete query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_b_person " \ + "WHERE age < 31 ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\" " \ + "WHERE \"age\" < 31 ORDER BY \"age\"") +#endif +struct view1a +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Complete placeholder query template. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_b_person " \ + "WHERE age < 31 AND (?) ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\" " \ + "WHERE \"age\" < 31 AND (?) ORDER BY \"age\"") +#endif +struct view1b +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Runtime query. +// +#pragma db view //query() +struct view1c +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Assembled SELECT and FROM-lists. +// +#pragma db view table("t_view_b_person") +struct view1d +{ + #pragma db column("first") + std::string first; + + #pragma db column("last") + std::string last; + + #pragma db column("age") + unsigned short age; +}; + +// +// Count view plus associated object. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person) \ + query("SELECT count(id) FROM t_view_b_person") +#else +# pragma db view object(person) \ + query("SELECT count(\"id\") FROM \"t_view_b_person\"") +#endif +struct view2 +{ + std::size_t count; +}; + +// Generated query, literal column. +// +#pragma db view object(person) +struct view2a +{ +#ifndef ODB_DATABASE_ORACLE + #pragma db column("count(id)") +#else + #pragma db column("count(\"id\")") +#endif + std::size_t count; +}; + +// Generated query, qualified literal column. +// +#pragma db view object(person) +struct view2b +{ +#ifndef ODB_DATABASE_ORACLE + #pragma db column("count(t_view_b_person.id)") +#else + #pragma db column("count(\"t_view_b_person\".\"id\")") +#endif + std::size_t count; +}; + +// Generated query, expression column. +// +#pragma db view object(person) +struct view2c +{ + #pragma db column("count(" + person::id + ")") + std::size_t count; +}; + +// +// Aggregate view plus associated object with a custom alias. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person = test) \ + query("SELECT last, count(last) " \ + "FROM t_view_b_person " \ + "GROUP BY last") +#else +# pragma db view object(person = test) \ + query("SELECT \"last\", count(\"last\") " \ + "FROM \"t_view_b_person\" " \ + "GROUP BY \"last\"") +#endif +struct view3 +{ + std::string last_name; + std::size_t count; +}; + +// Generated query with integrated query condition and placeholder. +// +#pragma db view object(person = test) \ + query((?) + "GROUP BY" + test::last_name_) +struct view3a +{ + // Automatically resolved to test::last_name_. + // + std::string last_name; + + #pragma db column("count(" + test::last_name_ + ")") + std::size_t count; +}; + +// +// JOIN view plus associated objects, some with custom aliases. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person) object(country = residence) \ + query("SELECT first, last, residence.name " \ + "FROM t_view_b_person " \ + "LEFT JOIN t_view_b_country AS residence " \ + "ON t_view_b_person.residence = residence.code") +#else +# pragma db view object(person) object(country = residence) \ + query("SELECT \"first\", \"last\", \"residence\".\"name\" " \ + "FROM \"t_view_b_person\" " \ + "LEFT JOIN \"t_view_b_country\" \"residence\" " \ + "ON \"t_view_b_person\".\"residence\" = \"residence\".\"code\"") +#endif +struct view4 +{ + std::string first_name; + std::string last_name; + std::string name; +}; + +// Generated query. +// +#pragma db view object(person) \ + object(country = residence: person::residence) +struct view4a +{ + std::string first_name; + std::string last_name; + std::string name; +}; + +// +// JOIN the same object twice. +// +#pragma db view object(person) \ + object(country = residence: person::residence) \ + object(country = nationality: person::nationality) \ + query((?) + "ORDER BY" + person::age) +struct view5 +{ + std::string first_name; + std::string last_name; + + #pragma db column(residence::name) + std::string rname; + + #pragma db column(nationality::name) + std::string nname; +}; + +// +// JOIN via one(i)-to-many relationship. +// + +// Automatic relationship discovery. +// +#pragma db view object(person) object(employer) +struct view6 +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, left side. +// +#pragma db view object(person) object(employer: person::employed_by) +struct view6a +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, right side. +// +#pragma db view object(person) object(employer: employer::employees) +struct view6b +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// The same using tables. +// +#if defined(ODB_DATABASE_ORACLE) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ + table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") +#elif defined(ODB_DATABASE_MSSQL) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "[ee].[object_id] = e.name") +#elif defined(ODB_DATABASE_MYSQL) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "`ee`.`object_id` = e.name") +#else +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = e.name") +#endif +struct view6c +{ + #pragma db column("p.first") + std::string first_name; + + #pragma db column("p.last") + std::string last_name; + + #pragma db column("e"."name") + std::string employer; +}; + +// +// JOIN via a custom condition. +// +#pragma db view object(person) \ + object(employer: person::previous_employer == employer::name)\ + query((?) + "ORDER BY" + person::age) +struct view7 +{ + std::string first_name; + std::string last_name; + + odb::nullable head_count; +}; + +// +// Self-JOIN. +// +#pragma db view object(person = wife) object(person = husb) \ + query (wife::husband.is_not_null ()) +struct view8 +{ + #pragma db column(wife::first_name_) + std::string wife_name; + + #pragma db column(husb::first_name_) + std::string husb_name; +}; + +// +// Enum mapping. +// +#pragma db view object(person) +struct view9 +{ + std::string first_name; + std::string last_name; + gender_type gender; +}; + +// +// Composite in view. +// +#pragma db view object(person) query((?) + "ORDER BY" + person::age) +struct view10 +{ + std::string last_name; + ::measures measures; +}; + +// +// Composite in object. +// +#pragma db view object(person) \ + query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ + + "ORDER BY" + person::age) +struct view11 +{ + std::string last_name; + + #pragma db column(person::measures.hight) + unsigned short hight; +}; + +// +// Extract object pointer as object id. +// +#pragma db view object(person) +struct view12 +{ + std::string residence; +}; + +#endif // TEST_HXX diff --git a/common/view/basics/test.std b/common/view/basics/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/view/driver.cxx b/common/view/driver.cxx deleted file mode 100644 index 28c3ba0..0000000 --- a/common/view/driver.cxx +++ /dev/null @@ -1,662 +0,0 @@ -// file : common/view/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test views. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include // DATABASE_XXX - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -template -void -view1_check (odb::result& r) -{ - typedef odb::result result; - - typename result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); - - assert (++i != r.end ()); - V v; - i.load (v); - assert (v.first == "John" && v.last == "Doe" && v.age == 30); - - assert (++i == r.end ()); -} - -template -void -view2_test (const auto_ptr& db) -{ - typedef odb::query query; - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r (db->query ()); - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31"); - else - r = db->query ("\"age\" < 31"); - - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 2); - } - - { - result r (db->query (query::age < 31)); - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 2); - } - - { - auto_ptr v (db->query_one ()); - assert (v->count == 4); - } - - { - auto_ptr v; - if (db->id () != odb::id_oracle) - v.reset (db->query_one ("age < 31")); - else - v.reset (db->query_one ("\"age\" < 31")); - assert (v->count == 2); - } - - { - auto_ptr v (db->query_one (query::age < 31)); - assert (v->count == 2); - } - - t.commit (); -} - -template -void -view4_test (const auto_ptr& db) -{ - typedef odb::query query; - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ((query::person::age > 30) + "ORDER BY age"); - else - r = db->query ((query::person::age > 30) + "ORDER BY \"age\""); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->name == "Sweden"); - - assert (++i == r.end ()); - } - - { - result r (db->query ( - (query::person::age > 30) + - "ORDER BY " + query::person::age)); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->name == "Sweden"); - - assert (++i == r.end ()); - } - - { - result r (db->query (query::residence::code == "US")); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i == r.end ()); - } - - t.commit (); -} - -template -void -view6_test (const auto_ptr& db, const odb::query& q) -{ - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r (db->query (q)); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->employer == "Simple Tech, Inc"); - - assert (++i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->employer == "Simple Tech, Inc"); - - assert (++i == r.end ()); - } - - t.commit (); -} - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // - // - { - country ca ("CA", "Canada"); - country za ("ZA", "South Africa"); - country us ("US", "United States"); - country se ("SE", "Sweden"); - - person p1 (1, "John", "Doe", 30, male, measures (60, 160), &ca, &ca); - person p2 (2, "Jane", "Doe", 29, female, measures (70, 170), &za, &us); - person p3 (3, "Joe", "Dirt", 31, male, measures (80, 180), &us, &za); - person p4 (4, "Johan", "Johansen", 32, male, measures (90, 190), &se, - &se); - - p2.husband = &p1; - - employer st ("Simple Tech, Inc"); - employer ct ("Complex Tech, Inc"); - - p2.previous_employer = st.name; - p3.previous_employer = ct.name; - - st.employees.push_back (&p1); - st.employees.push_back (&p3); - st.head_count = 2; - - ct.employees.push_back (&p2); - ct.employees.push_back (&p4); - ct.head_count = 2; - - transaction t (db->begin ()); - db->persist (ca); - db->persist (za); - db->persist (us); - db->persist (se); - - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - - db->persist (st); - db->persist (ct); - t.commit (); - } - - // view1 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - assert (size (r) == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("ORDER BY age"); - else - r = db->query ("ORDER BY \"age\""); - - assert (size (r) == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31 ORDER BY age"); - else - r = db->query ("\"age\" < 31 ORDER BY \"age\""); - - view1_check (r); - } - - t.commit (); - } - } - - // view1a - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query ()); - view1_check (r); - - t.commit (); - } - } - - // view1b - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query ()); - view1_check (r); - - t.commit (); - } - - // No native parameter support in dynamic multi-database mode. - // -#ifndef DATABASE_COMMON - { - typedef odb::query query; - - transaction t (db->begin ()); - -#ifndef DATABASE_ORACLE - result r (db->query ("first = " + query::_val ("Jane"))); -#else - result r (db->query ("\"first\" = " + query::_val ("Jane"))); -#endif - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe"); - assert (++i == r.end ()); - - t.commit (); - } -#endif - } - - // view1c - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r; - if (db->id () != odb::id_oracle) - r = db->query ("SELECT first, last, age " - "FROM t_view_person " - "WHERE age < 31 ORDER BY age"); - else - r = db->query ("SELECT \"first\", \"last\", \"age\" " - "FROM \"t_view_person\" " - "WHERE \"age\" < 31 ORDER BY \"age\""); - view1_check (r); - - t.commit (); - } - } - - // view1d - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31 ORDER BY age"); - else - r = db->query ("\"age\" < 31 ORDER BY \"age\""); - - view1_check (r); - } - - t.commit (); - } - } - - // view2 - // - view2_test (db); - view2_test (db); - view2_test (db); - view2_test (db); - - // view3 - // - { - typedef odb::result result; // Test const result. - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - size_t count (0); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->last_name == "Doe") - assert (i->count == 2); - else if (i->last_name == "Dirt" || - i->last_name == "Johansen") - assert (i->count == 1); - else - assert (false); - - count++; - } - - assert (count == 3); - } - - t.commit (); - } - } - - // view3a - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::last_name == "Doe")); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && i->count == 2); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view4 - // - view4_test (db); - view4_test (db); - - // view5 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r ( - db->query ( - query::residence::name == query::nationality::name)); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->rname == "Canada" && i->rname == "Canada"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->rname == "Sweden" && i->rname == "Sweden"); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view6 - // - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - // No native parameter support in dynamic multi-database mode. - // -#ifndef DATABASE_COMMON - view6_test ( -#ifndef DATABASE_ORACLE - db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); -#else - db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); -#endif -#endif - - // view7 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::person::last_name == "Doe")); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Jane" && i->last_name == "Doe" && - !i->head_count.null () && *i->head_count == 2); - - assert (++i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->head_count.null ()); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view8 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->wife_name == "Jane" && i->husb_name == "John"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view9 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - // Test case-insensitive clause prefix detection. - // - result r (db->query ("where" + (query::gender == female))); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Jane" && i->last_name == "Doe" && - i->gender == female); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view10 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ( - query::measures.weight > 60 && - query::measures.hight < 190)); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && - i->measures.weight == 70 && i->measures.hight == 170); - - assert (++i != r.end ()); - assert (i->last_name == "Dirt" && - i->measures.weight == 80 && i->measures.hight == 180); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view11 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && i->hight == 170); - - assert (++i != r.end ()); - assert (i->last_name == "Dirt" && i->hight == 180); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view12 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::last_name == "Dirt")); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->residence == "US"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/view/makefile b/common/view/makefile deleted file mode 100644 index f7010ed..0000000 --- a/common/view/makefile +++ /dev/null @@ -1,118 +0,0 @@ -# file : common/view/makefile -# copyright : Copyright (c) 2009-2013 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix t_view_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx new file mode 100644 index 0000000..6ef2467 --- /dev/null +++ b/common/view/olv/driver.cxx @@ -0,0 +1,615 @@ +// file : common/view/olv/driver.cxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object loading views. +// + +#include // std::auto_ptr +#include +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test basic object loading functionality. + // + { + using namespace test1; + + { + object1 o1a (1, 123); + object2 o2 (1, "abc"); + + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o2); + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + view1 v (db->query_value (query::object1::n == 123)); + assert (v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view2 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view3 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && + v.o1->n == 123 && v.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && + v.o1->n == 123 && v.n == 123); + t.commit (); + } + + { + typedef odb::query query; + + object1 o1b (123, 1); + + transaction t (db->begin ()); + db->persist (o1b); + view5 v (db->query_value (query::o1b::n == 1)); + assert (v.o1a->n == 123 && v.o2->s == "abc" && v.o1b->n == 1); + t.commit (); + } + } + + // Test loading of object pointers inside objects. + // + { + using namespace test2; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc", o1)); + + { + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + assert (v.o2->s == "abc" && v.o2->o1->n == 123); + t.commit (); + } + + { + // Check session interaction. + // + transaction t (db->begin ()); + session s; + shared_ptr o2a (db->load (o2->id)); + view1 v (db->query_value ()); + assert (v.o2 == o2a); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view2 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); + t.commit (); + } + + shared_ptr o3 (new object3 (o2)); + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view3 v (db->query_value ()); + assert (v.o1->n == 123 && v.o3->o2->s == "abc" && + v.o3->o2->o1 == v.o1); + t.commit (); + } + + shared_ptr o1b (new object1 (234)); + shared_ptr o2b (new object2 ("bcd", o1b)); + shared_ptr o4 (new object4); + o4->o2.push_back (o2); + o4->o2.push_back (o2b); + + { + transaction t (db->begin ()); + db->persist (o1b); + db->persist (o2b); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object1::id)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + view5 const& v (*i); + + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && + v.o4->o2[0]->o1 == v.o1); + } + assert (++i != r.end ()); + { + view5 const& v (*i); + + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && + v.o4->o2[1]->o1 == v.o1); + } + assert (++i == r.end ()); + t.commit (); + } + + shared_ptr o5 (new object5 (o1b, o2)); + + { + transaction t (db->begin ()); + db->persist (o5); + t.commit (); + } + + { + transaction t (db->begin ()); + view6 v (db->query_value ()); + assert (v.o1a->n == 123 && v.o1b->n == 234); + t.commit (); + } + } + + // Test JOINs for pointed-to objects, existing and automatically added. + // + { + using namespace test3; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc")); + + o1->o2 = o2; + o2->o1 = o1; + + { + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1a v (db->query_value ()); + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + t.commit (); + } + + { + transaction t (db->begin ()); + view1b v (db->query_value ()); + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + t.commit (); + } + + // Container case. + // + + shared_ptr o3 (new object3 (123)); + shared_ptr o4 (new object4 ("abc")); + + o3->o4 = o4; + o4->o3.push_back (o3); + + { + + transaction t (db->begin ()); + db->persist (o3); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + view2a v (db->query_value ()); + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + t.commit (); + } + + { + transaction t (db->begin ()); + view2b v (db->query_value ()); + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + t.commit (); + } + } + + // Test by-value load. + // + { + using namespace test4; + + { + object1 o1 (1, 123); + object2 o2 (1, "abc", &o1); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + assert (v.o1.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view1a v (db->query_value ()); + assert (!v.o1_null && v.o1.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view1b v (db->query_value ()); + assert (/*v.o1_p == &v.o1 && */ v.o1.n == 123); // Copy ctor. + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end ()); + + object1 o1; + view1c v (o1); + i.load (v); + + assert (v.o1_p == &o1 && o1.n == 123); + + assert (++i == r.end ()); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view2 v (db->query_value ()); + assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + t.commit (); + } + + object1 o1b (2, 234); + + { + transaction t (db->begin ()); + db->persist (o1b); + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + session s; + view2a v (db->query_value (query::object1::id == 2)); + assert (v.o1.n == 234 && v.o2_null); + t.commit (); + } + + shared_ptr o3 (new object3 (1, 123)); + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + { + view3 v (db->query_value ()); + assert (v.o3_p == &v.o3 && v.o3.n == 123); // Load into value. + } + session s; // Load into cache. + shared_ptr o3a (db->load (o3->id)); + { + view3 v (db->query_value ()); + assert (v.o3_p == o3a.get ()); // Load from cache. + } + t.commit (); + } + } + + // Test NULL object pointers. + // + { + using namespace test5; + + shared_ptr o1a (new object1 (123)); + shared_ptr o1b (new object1 (234)); + shared_ptr o2 (new object2 ("abc", o1a)); + + { + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o1b); + db->persist (o2); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object1::id)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + view1 const& v (*i); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); + } + assert (++i != r.end ()); + { + view1 const& v (*i); + assert (v.o1->n == 234 && !v.o2); + } + assert (++i == r.end ()); + t.commit (); + } + + shared_ptr o3a (new object3 (make_pair (1, 1), 123)); + shared_ptr o3b (new object3 (make_pair (2, 2), 234)); + shared_ptr o4 (new object4 ("abc", o3a)); + + { + transaction t (db->begin ()); + db->persist (o3a); + db->persist (o3b); + db->persist (o4); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object3::n)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + view2 const& v (*i); + assert (v.o3->n == 123 && v.o4->s == "abc" && v.o4->o3 == v.o3); + } + assert (++i != r.end ()); + { + view2 const& v (*i); + assert (v.o3->n == 234 && !v.o4); + } + assert (++i == r.end ()); + t.commit (); + } + } + + // Test interaction with sections. + // + { + using namespace test6; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc", o1)); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && + !v.o2->r.loaded () && !v.o2->o1); + t.commit (); + } + } + + // Test explicit conversion to smart pointer member. + // + { + using namespace test7; + + object1 o1 (123); + object2 o2 ("abc", &o1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); + t.commit (); + } + } + + // Test loading objects without id. + // + { + using namespace test8; + + object1 o1 (123); + object2 o2 ("abc", &o1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); + t.commit (); + } + } + + // Test loading polymorphic objects. + // + { + using namespace test9; + + root r (1); + base b (2, "a"); + derived d (3, "b", true); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + { + transaction t (db->begin ()); + + // Load via root. + // + { + view1r r (db->query_value (query::n == 1)); + assert (r.n == 1 && r.o->n == 1 && typeid (*r.o) == typeid (root)); + } + + { + view1r r (db->query_value (query::n == 2)); + assert (r.n == 2 && r.o->n == 2 && typeid (*r.o) == typeid (base)); + base& b (dynamic_cast (*r.o)); + assert (b.s == "a"); + } + + { + view1r r (db->query_value (query::n == 3)); + assert (r.n == 3 && r.o->n == 3 && typeid (*r.o) == typeid (derived)); + derived& d (dynamic_cast (*r.o)); + assert (d.s == "b" && d.b); + } + + // Load via base. + // + { + view1b r (db->query_value (query::n == 2)); + assert (r.s == "a" && r.n == 2 && r.o->n == 2 && b.s == "a"); + } + + { + view1b r (db->query_value (query::n == 3)); + assert (r.s == "b" && r.n == 3 && r.o->n == 3 && + typeid (*r.o) == typeid (derived)); + derived& d (dynamic_cast (*r.o)); + assert (d.s == "b" && d.b); + } + + // Load via derived. + // + { + view1d r (db->query_value ()); + assert (r.s == "b" && r.n == 3 && + r.o->n == 3 && r.o->s == "b" && r.o->b); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/view/olv/makefile b/common/view/olv/makefile new file mode 100644 index 0000000..9da28db --- /dev/null +++ b/common/view/olv/makefile @@ -0,0 +1,113 @@ +# file : common/view/olv/makefile +# copyright : Copyright (c) 2009-2013 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_view_olv_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ +$(call vc11projs,$(name)) $(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/olv/test.hxx b/common/view/olv/test.hxx new file mode 100644 index 0000000..8f358d3 --- /dev/null +++ b/common/view/olv/test.hxx @@ -0,0 +1,687 @@ +// file : common/view/olv/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // unique_ptr +#include // pair + +#include +#include +#include + +// Test basic object loading functionality. +// +#pragma db namespace table("t1_") pointer(std::unique_ptr) +namespace test1 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = ""): id (id_), s (s_) {} + + #pragma db id + int id; + + std::string s; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view1 + { + std::unique_ptr o2; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view2 + { + std::unique_ptr o2; + std::unique_ptr o1; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view3 + { + std::unique_ptr o1; + std::unique_ptr o2; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view4 + { + std::string s; + std::unique_ptr o2; + + #pragma db column(o1::id) + int id; + + std::unique_ptr o1; + int n; + }; + + #pragma db view \ + object(object1) \ + object(object2: object1::id == object2::id) \ + object(object1 = o1b: object1::id == o1b::n) + struct view5 + { + std::unique_ptr o1a; + std::unique_ptr o2; + std::unique_ptr o1b; + }; +} + +// Test loading of object pointers inside objects. +// +#pragma db namespace table("t2_") pointer(std::shared_ptr) session +namespace test2 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) + struct view2 + { + shared_ptr o2; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (shared_ptr o2_): o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) object(object3) + struct view3 + { + shared_ptr o3; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object4 + { + #pragma db id auto + int id; + + std::vector> o2; + }; + + #pragma db view object(object4) + struct view4 + { + shared_ptr o4; + }; + + #pragma db view object(object4) object (object2) object(object1) + struct view5 + { + shared_ptr o4; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object5 + { + object5 () {} + object5 (shared_ptr o1_, shared_ptr o2_) + : o1 (o1_), o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o1; + shared_ptr o2; + }; + + #pragma db view object(object5) object (object2) \ + object(object1 = o1a: object2::o1) \ + object(object1 = o1b: object5::o1) + struct view6 + { + shared_ptr o1a; + shared_ptr o1b; + }; +} + +// Test JOINs for pointed-to objects, existing and automatically added. +// +#pragma db namespace table("t3_") pointer(std::shared_ptr) session +namespace test3 +{ + using std::shared_ptr; + + struct object2; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o1) + odb::lazy_weak_ptr o2; + }; + + #pragma db object + struct object2 + { + object2 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1a // Existing JOIN. + { + shared_ptr o1; + }; + + #pragma db view object(object1) + struct view1b // Automatic JOIN. + { + shared_ptr o1; + }; + + // Container case. + // + struct object4; + + #pragma db object + struct object3 + { + object3 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o3) + odb::lazy_weak_ptr o4; + }; + + #pragma db object + struct object4 + { + object4 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + std::vector> o3; + }; + + #pragma db view object(object3) object(object4 = o4) + struct view2a // Existing JOIN. + { + shared_ptr o3; + }; + + #pragma db view object(object3) + struct view2b // Automatic JOIN. + { + shared_ptr o3; + }; +} + +// Test by-value load. +// +#pragma db namespace table("t4_") session +namespace test4 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = "", object1* o1_ = 0) + : id (id_), s (s_), o1 (o1_) {} + + #pragma db id + int id; + + std::string s; + object1* o1; // Shallow copy. + }; + + typedef object1* object1_ptr; + typedef object2* object2_ptr; + + #pragma db view object(object1) + struct view1 + { + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + #pragma db transient + object1 o1; + }; + + #pragma db view object(object1) transient + struct view1a + { + view1a (): o1_null (true) {} + + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) \ + set(this.o1_null = !(?)) + + object1 o1; + bool o1_null; + }; + + #pragma db view object(object1) + struct view1b + { + view1b (): o1_p (0) {} + + #pragma db transient + object1 o1; + + #pragma db get(&this.o1) set(o1_p = (?)) + object1* o1_p; + }; + + #pragma db view object(object1) + struct view1c + { + view1c (object1& o1): o1_p (&o1) {} + + object1* o1_p; + }; + + #pragma db view object(object1) object(object2) transient + struct view2 + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) set() + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + }; + + #pragma db view object(object1) object(object2) transient + struct view2a + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) \ + set(o2_null = !(?)) + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + bool o2_null; + }; + + // Test loading into raw pointer with non-raw object pointer. + // + using std::shared_ptr; + + #pragma db object pointer(shared_ptr) + struct object3 + { + object3 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db view object(object3) + struct view3 + { + // This view implements the following slightly twisted logic: if the + // object is already in the cache, then set o3_p to that. Otherwise, + // load it into the by-value instance. We can also check whether o3_p + // points to o3 to distinguish between the two outcomes. + // + + // Since we may be getting the pointer as both smart and raw, we + // need to create a bit of support code to use in the modifier + // expression. + // + void set_o3 (object3* p) {o3_p = p;} // &o3 or NULL. + void set_o3 (shared_ptr p) {o3_p = p.get ();} // From cache. + + #pragma db get(&this.o3) set(set_o3(?)) + object3* o3_p; + + #pragma db transient + object3 o3; + + // Return-by-value support (query_value()). + // + view3 (): o3_p (0) {} + view3 (const view3& x): o3_p (x.o3_p == &x.o3 ? &o3 : x.o3_p), o3 (x.o3) {} + }; +} + +// Test NULL object pointers. +// +#pragma db namespace table("t5_") pointer(std::shared_ptr) session +namespace test5 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; + + typedef std::pair comp_id; + #pragma db value(comp_id) + + #pragma db object + struct object3 + { + object3 (comp_id id_ = comp_id (), int n_ = 0): id (id_), n (n_) {} + + #pragma db id + comp_id id; + + int n; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (const char* s_, shared_ptr o3_): s (s_), o3 (o3_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o3; + }; + + #pragma db view object(object3) object(object4) + struct view2 + { + shared_ptr o4; + shared_ptr o3; + }; +} + +// Test interaction with sections. +// +#pragma db namespace table("t6_") pointer(std::shared_ptr) +namespace test6 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + + #pragma db load(lazy) + odb::section r; + + #pragma db section(r) + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; +} + +// Test explicit conversion to smart pointer member. +// +#pragma db namespace table("t7_") pointer(*) session +namespace test7 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + unique_ptr o2; + unique_ptr o1; + }; +} + +// Test loading objects without id. +// +#pragma db namespace table("t8_") pointer(*) session +namespace test8 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object no_id + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + unique_ptr o2; + unique_ptr o1; + }; +} + +// Test loading polymorphic objects. +// +#pragma db namespace table("t9_") session +namespace test9 +{ + using std::shared_ptr; + + #pragma db object polymorphic pointer(shared_ptr) + struct root + { + virtual ~root () {} + root (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct base: root + { + base (int n_ = 0, const char* s_ = ""): root (n_), s (s_) {} + + std::string s; + }; + + #pragma db object + struct derived: base + { + derived (int n_ = 0, const char* s_ = "", bool b_ = false) + : base (n_, s_), b (b_) {} + + bool b; + }; + + // Load via root. + // + #pragma db view object(root) + struct view1r + { + shared_ptr o; + int n; + }; + + // Load via base. + // + #pragma db view object(base) + struct view1b + { + std::string s; + shared_ptr o; + int n; + }; + + // Load via derived. + // + #pragma db view object(derived) + struct view1d + { + std::string s; + shared_ptr o; + int n; + }; +} + +#endif // TEST_HXX diff --git a/common/view/olv/test.std b/common/view/olv/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/view/test.hxx b/common/view/test.hxx deleted file mode 100644 index ae30e25..0000000 --- a/common/view/test.hxx +++ /dev/null @@ -1,495 +0,0 @@ -// file : common/view/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::size_t - -#include -#include - -struct employer; - -#pragma db object -struct country -{ - country (const std::string& c, std::string const& n) - : code (c), name (n) - { - } - - country () - { - } - - #pragma db id - std::string code; // ISO 2-letter country code. - - std::string name; -}; - -enum gender_type {male, female}; - -#pragma db value -struct measures -{ - measures (unsigned short w, unsigned short h) : weight (w), hight (h) {} - measures () {} - - unsigned short weight; - unsigned short hight; -}; - -#pragma db object -struct person -{ - typedef ::measures measures_type; - - person (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - gender_type g, - const measures_type m, - country* r, - country* n) - : id (i), - first_name_ (fn), - last_name_ (ln), - age (a), - gender (g), - measures (m), - residence (r), - nationality (n), - husband (0) - { - } - - person () - { - } - - #pragma db id - unsigned long id; - - #pragma db column("first") - std::string first_name_; - - #pragma db column("last") - std::string last_name_; - - unsigned short age; - - // #pragma db type("INT") - in MySQL test type pragma copying - gender_type gender; - - measures_type measures; - - #pragma db not_null - country* residence; - - #pragma db not_null - country* nationality; - - #pragma db inverse(employees) - employer* employed_by; - - // A non-pointer relationship. - // - odb::nullable previous_employer; - - person* husband; // Self-reference. -}; - -#pragma db object -struct employer -{ - employer (const std::string& n) - : name (n) - { - } - - employer () - { - } - - #pragma db id - std::string name; - unsigned int head_count; - std::vector employees; -}; - -// -// General view with no associated objects. -// - -// Complete suffix query template. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age FROM t_view_person") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_person\"") -#endif -struct view1 -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Complete query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age " \ - "FROM t_view_person " \ - "WHERE age < 31 ORDER BY age") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_person\" " \ - "WHERE \"age\" < 31 ORDER BY \"age\"") -#endif -struct view1a -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Complete placeholder query template. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age " \ - "FROM t_view_person " \ - "WHERE age < 31 AND (?) ORDER BY age") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_person\" " \ - "WHERE \"age\" < 31 AND (?) ORDER BY \"age\"") -#endif -struct view1b -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Runtime query. -// -#pragma db view //query() -struct view1c -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Assembled SELECT and FROM-lists. -// -#pragma db view table("t_view_person") -struct view1d -{ - #pragma db column("first") - std::string first; - - #pragma db column("last") - std::string last; - - #pragma db column("age") - unsigned short age; -}; - -// -// Count view plus associated object. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person) \ - query("SELECT count(id) FROM t_view_person") -#else -# pragma db view object(person) \ - query("SELECT count(\"id\") FROM \"t_view_person\"") -#endif -struct view2 -{ - std::size_t count; -}; - -// Generated query, literal column. -// -#pragma db view object(person) -struct view2a -{ -#ifndef ODB_DATABASE_ORACLE - #pragma db column("count(id)") -#else - #pragma db column("count(\"id\")") -#endif - std::size_t count; -}; - -// Generated query, qualified literal column. -// -#pragma db view object(person) -struct view2b -{ -#ifndef ODB_DATABASE_ORACLE - #pragma db column("count(t_view_person.id)") -#else - #pragma db column("count(\"t_view_person\".\"id\")") -#endif - std::size_t count; -}; - -// Generated query, expression column. -// -#pragma db view object(person) -struct view2c -{ - #pragma db column("count(" + person::id + ")") - std::size_t count; -}; - -// -// Aggregate view plus associated object with a custom alias. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person = test) \ - query("SELECT last, count(last) " \ - "FROM t_view_person " \ - "GROUP BY last") -#else -# pragma db view object(person = test) \ - query("SELECT \"last\", count(\"last\") " \ - "FROM \"t_view_person\" " \ - "GROUP BY \"last\"") -#endif -struct view3 -{ - std::string last_name; - std::size_t count; -}; - -// Generated query with integrated query condition and placeholder. -// -#pragma db view object(person = test) \ - query((?) + "GROUP BY" + test::last_name_) -struct view3a -{ - // Automatically resolved to test::last_name_. - // - std::string last_name; - - #pragma db column("count(" + test::last_name_ + ")") - std::size_t count; -}; - -// -// JOIN view plus associated objects, some with custom aliases. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person) object(country = residence) \ - query("SELECT first, last, residence.name " \ - "FROM t_view_person " \ - "LEFT JOIN t_view_country AS residence " \ - "ON t_view_person.residence = residence.code") -#else -# pragma db view object(person) object(country = residence) \ - query("SELECT \"first\", \"last\", \"residence\".\"name\" " \ - "FROM \"t_view_person\" " \ - "LEFT JOIN \"t_view_country\" \"residence\" " \ - "ON \"t_view_person\".\"residence\" = \"residence\".\"code\"") -#endif -struct view4 -{ - std::string first_name; - std::string last_name; - std::string name; -}; - -// Generated query. -// -#pragma db view object(person) \ - object(country = residence: person::residence) -struct view4a -{ - std::string first_name; - std::string last_name; - std::string name; -}; - -// -// JOIN the same object twice. -// -#pragma db view object(person) \ - object(country = residence: person::residence) \ - object(country = nationality: person::nationality) \ - query((?) + "ORDER BY" + person::age) -struct view5 -{ - std::string first_name; - std::string last_name; - - #pragma db column(residence::name) - std::string rname; - - #pragma db column(nationality::name) - std::string nname; -}; - -// -// JOIN via one(i)-to-many relationship. -// - -// Automatic relationship discovery. -// -#pragma db view object(person) object(employer) -struct view6 -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// Manual relationship specification, left side. -// -#pragma db view object(person) object(employer: person::employed_by) -struct view6a -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// Manual relationship specification, right side. -// -#pragma db view object(person) object(employer: employer::employees) -struct view6b -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// The same using tables. -// -#if defined(ODB_DATABASE_ORACLE) -#pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ - table("t_view_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") -#elif defined(ODB_DATABASE_MSSQL) -#pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "[ee].[object_id] = e.name") -#elif defined(ODB_DATABASE_MYSQL) -#pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "`ee`.`object_id` = e.name") -#else -#pragma db view table("t_view_person" = "p") \ - table("t_view_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_employer" = "e": "\"ee\".\"object_id\" = e.name") -#endif -struct view6c -{ - #pragma db column("p.first") - std::string first_name; - - #pragma db column("p.last") - std::string last_name; - - #pragma db column("e"."name") - std::string employer; -}; - -// -// JOIN via a custom condition. -// -#pragma db view object(person) \ - object(employer: person::previous_employer == employer::name)\ - query((?) + "ORDER BY" + person::age) -struct view7 -{ - std::string first_name; - std::string last_name; - - odb::nullable head_count; -}; - -// -// Self-JOIN. -// -#pragma db view object(person = wife) object(person = husb) \ - query (wife::husband.is_not_null ()) -struct view8 -{ - #pragma db column(wife::first_name_) - std::string wife_name; - - #pragma db column(husb::first_name_) - std::string husb_name; -}; - -// -// Enum mapping. -// -#pragma db view object(person) -struct view9 -{ - std::string first_name; - std::string last_name; - gender_type gender; -}; - -// -// Composite in view. -// -#pragma db view object(person) query((?) + "ORDER BY" + person::age) -struct view10 -{ - std::string last_name; - ::measures measures; -}; - -// -// Composite in object. -// -#pragma db view object(person) \ - query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ - + "ORDER BY" + person::age) -struct view11 -{ - std::string last_name; - - #pragma db column(person::measures.hight) - unsigned short hight; -}; - -// -// Extract object pointer as object id. -// -#pragma db view object(person) -struct view12 -{ - std::string residence; -}; - -#endif // TEST_HXX diff --git a/common/view/test.std b/common/view/test.std deleted file mode 100644 index e69de29..0000000 -- cgit v1.1 From 55a308d14dc12594c365767d738f71893248f159 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 5 Feb 2015 14:17:07 +0200 Subject: Implement result modifiers in view query condition --- common/view/basics/driver.cxx | 29 +++++++++++++++++++++++++++++ common/view/basics/test.hxx | 18 ++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index e1a72f7..01ae0ab 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -653,6 +653,35 @@ main (int argc, char* argv[]) t.commit (); } } + + // view13 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + (query::person::age < 32) + + "ORDER BY" + query::employer::name)); + + assert (size (r) == 2); + } + + t.commit (); + } + } + + // view14 + // + { + transaction t (db->begin ()); + assert (size (db->query ()) == 2); + t.commit (); + } } catch (const odb::exception& e) { diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 18fae4b..e9d61a5 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -492,4 +492,22 @@ struct view12 std::string residence; }; +// +// Test 'distinct' result modifier. +// +#pragma db view object(employer) object(person) query(distinct) +struct view13 +{ + std::string name; +}; + +// +// Test 'for_update' result modifier. +// +#pragma db view object(employer) query((?), for_update) +struct view14 +{ + std::string name; +}; + #endif // TEST_HXX -- cgit v1.1 From a44bbf24decdaee9bd8c716dc6843b4b4c6c7ec5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Feb 2015 08:57:30 +0200 Subject: Implement join types support in views --- common/view/basics/driver.cxx | 144 ++++++++++++++++++++++++++++++++++++++++++ common/view/basics/test.hxx | 104 ++++++++++++++++++++++++++++++ 2 files changed, 248 insertions(+) diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index 01ae0ab..557efda 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -682,6 +682,150 @@ main (int argc, char* argv[]) assert (size (db->query ()) == 2); t.commit (); } + + // Test join types. + // + { + using namespace test2; + + { + obj1 o11 (1, 1); + obj1 o12 (2, 2); + + obj2 o21 (1, 1); + obj2 o22 (2, 1); + obj2 o23 (3, 3); + + transaction t (db->begin ()); + db->persist (o11); + db->persist (o12); + db->persist (o21); + db->persist (o22); + db->persist (o23); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); + assert (++i == r.end ()); + t.commit (); + } + +#if !defined(DATABASE_SQLITE) + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); + assert (++i == r.end ()); + t.commit (); + } +#endif + +#if !defined(DATABASE_MYSQL) && !defined(DATABASE_SQLITE) + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + + // SQL Server orders NULL values first. Got to be different. + // +#ifdef DATABASE_MSSQL + assert ( i != r.end () && i->id1.null () && *i->id2 == 3); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); +#else + assert ( i != r.end () && *i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); + assert (++i != r.end () && i->id1.null () && *i->id2 == 3); +#endif + assert (++i == r.end ()); + t.commit (); + } +#endif + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 3); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 3); + assert (++i == r.end ()); + t.commit (); + } + + // Inner JOIN via relationship/container. + // + { + obj3 o31 (1, 1); + obj3 o32 (2, 2); + + obj4 o41 (1, 1); + obj4 o42 (2, 2); + o42.o3.push_back (&o32); + + transaction t (db->begin ()); + db->persist (o31); + db->persist (o32); + db->persist (o41); + db->persist (o42); + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id4 == 2); + assert (++i == r.end ()); + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index e9d61a5..0a2243d 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // DATABASE_* + #include #include #include // std::size_t @@ -510,4 +512,106 @@ struct view14 std::string name; }; +// Test join types. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct obj1 + { + obj1 (int id = 0, int n_ = 0): id1 (id), n (n_) {} + + #pragma db id + int id1; + + int n; + }; + + #pragma db object no_id + struct obj2 + { + obj2 (int id = 0, int n_ = 0): id2 (id), n (n_) {} + + #pragma db id + int id2; + + int n; + }; + + #pragma db view object(obj1 = o1) object(obj2 = o2 left: o1::n == o2::n) + struct vleft + { + int id1; + odb::nullable id2; + }; + +#if !defined(DATABASE_SQLITE) + + #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) + struct vright + { + int id1; + odb::nullable id2; + }; + +#endif + +#if !defined(DATABASE_MYSQL) && !defined(DATABASE_SQLITE) + + #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) + struct vfull + { + odb::nullable id1; + odb::nullable id2; + }; + +#endif + + #pragma db view object(obj1 = o1) object(obj2 = o2 inner: o1::n == o2::n) + struct vinner + { + int id1; + int id2; + }; + + #pragma db view object(obj1 = o1) object(obj2 = o2 cross) + struct vcross + { + int id1; + int id2; + }; + + // Inner JOIN via relationship/container. + // + #pragma db object + struct obj3 + { + obj3 (int id = 0, int n_ = 0): id3 (id), n (n_) {} + + #pragma db id + int id3; + + int n; + }; + + #pragma db object no_id + struct obj4 + { + obj4 (int id = 0, int n_ = 0): id4 (id), n (n_) {} + + #pragma db id + int id4; + + int n; + std::vector o3; + }; + + #pragma db view object(obj4) object(obj3 inner) + struct vrel + { + int id4; + }; +} + #endif // TEST_HXX -- cgit v1.1 From d7318daf46ac3539f6f7651f99cc75921ffa4a37 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Feb 2015 09:14:47 +0200 Subject: Add support for persisting std::deque --- common/container/basics/driver.cxx | 18 ++++++++++++++++++ common/container/basics/test.hxx | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index b880b56..cb3ae92 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -81,6 +81,11 @@ main (int argc, char* argv[]) med.sl.push_back ("aaa"); med.sl.push_back ("bbbb"); + // deque + // + med.nd.push_back (123); + med.nd.push_back (234); + // set // med.ns.insert (123); @@ -189,6 +194,12 @@ main (int argc, char* argv[]) full.sl.push_back ("bbbbb"); full.sl.push_back ("cccccc"); + // deque + // + full.nd.push_back (1234); + full.nd.push_back (2345); + full.nd.push_back (3456); + // set // full.ns.insert (1234); @@ -319,6 +330,7 @@ main (int argc, char* argv[]) empty.cv.push_back (comp (12, "aa")); empty.uv.push_back (12); empty.sl.push_back ("aa"); + empty.nd.push_back (12); empty.ns.insert (12); empty.ss.insert ("aa"); @@ -358,6 +370,8 @@ main (int argc, char* argv[]) med.sl.clear (); + med.nd.clear (); + med.ns.clear (); med.ss.clear (); med.cs.clear (); @@ -409,6 +423,10 @@ main (int argc, char* argv[]) full.sl.back () += "c"; full.sl.push_back ("ddddddd"); + // deque + // + full.nd.push_front (456); + // set // full.ns.insert (4567); diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 517da0a..ca167ab 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #ifdef HAVE_CXX11 @@ -52,6 +53,7 @@ operator< (const comp& x, const comp& y) } typedef std::list str_list; +typedef std::deque num_deque; typedef std::vector num_vector; typedef std::vector str_vector; @@ -144,6 +146,10 @@ struct object #pragma db transient str_list& sl; + // deque + // + num_deque nd; + // set // num_set ns; @@ -234,6 +240,8 @@ operator== (const object& x, const object& y) x.sl == y.sl && + x.nd == y.nd && + x.ns == y.ns && x.ss == y.ss && x.cs == y.cs && -- cgit v1.1 From 9c304207722ff9e2794ba25bb496858f089e4a2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Feb 2015 09:31:17 +0200 Subject: Update copyright --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/multi-index/driver.cxx | 2 +- boost/common/multi-index/makefile | 2 +- boost/common/multi-index/test.hxx | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/common/uuid/driver.cxx | 2 +- boost/common/uuid/makefile | 2 +- boost/common/uuid/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/access/driver.cxx | 2 +- common/access/makefile | 2 +- common/access/test.hxx | 2 +- common/auto/driver.cxx | 2 +- common/auto/makefile | 2 +- common/auto/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/bulk/driver.cxx | 2 +- common/bulk/makefile | 2 +- common/bulk/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/changelog/add-column.hxx | 2 +- common/changelog/add-foreign-key.hxx | 2 +- common/changelog/add-index.hxx | 2 +- common/changelog/add-table.hxx | 2 +- common/changelog/alter-column.hxx | 2 +- common/changelog/drop-column.hxx | 2 +- common/changelog/drop-foreign-key.hxx | 2 +- common/changelog/drop-index.hxx | 2 +- common/changelog/drop-table.hxx | 2 +- common/changelog/makefile | 2 +- common/changelog/model.hxx | 2 +- common/circular/multiple/driver.cxx | 2 +- common/circular/multiple/makefile | 2 +- common/circular/multiple/test1.hxx | 2 +- common/circular/multiple/test2.hxx | 2 +- common/circular/single/driver.cxx | 2 +- common/circular/single/makefile | 2 +- common/circular/single/test.hxx | 2 +- common/composite-id/driver.cxx | 2 +- common/composite-id/makefile | 2 +- common/composite-id/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/basics/driver.cxx | 2 +- common/container/basics/makefile | 2 +- common/container/basics/test.hxx | 2 +- common/container/change-tracking/driver.cxx | 2 +- common/container/change-tracking/makefile | 2 +- common/container/change-tracking/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/definition/driver.cxx | 2 +- common/definition/makefile | 2 +- common/definition/test.hxx | 2 +- common/definition/time-mapping.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/index/driver.cxx | 2 +- common/index/makefile | 2 +- common/index/test.hxx | 2 +- common/inheritance/polymorphism/driver.cxx | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test1.hxx | 2 +- common/inheritance/polymorphism/test10.hxx | 2 +- common/inheritance/polymorphism/test11.hxx | 2 +- common/inheritance/polymorphism/test12.hxx | 2 +- common/inheritance/polymorphism/test13.hxx | 2 +- common/inheritance/polymorphism/test14.hxx | 2 +- common/inheritance/polymorphism/test15.hxx | 2 +- common/inheritance/polymorphism/test2.hxx | 2 +- common/inheritance/polymorphism/test3.hxx | 2 +- common/inheritance/polymorphism/test4.hxx | 2 +- common/inheritance/polymorphism/test5.hxx | 2 +- common/inheritance/polymorphism/test6.hxx | 2 +- common/inheritance/polymorphism/test7.hxx | 2 +- common/inheritance/polymorphism/test8.hxx | 2 +- common/inheritance/polymorphism/test9.hxx | 2 +- common/inheritance/reuse/driver.cxx | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/transient/driver.cxx | 2 +- common/inheritance/transient/makefile | 2 +- common/inheritance/transient/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/object/driver.cxx | 2 +- common/object/makefile | 2 +- common/object/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/prepared/driver.cxx | 2 +- common/prepared/makefile | 2 +- common/prepared/test.hxx | 2 +- common/query/array/driver.cxx | 2 +- common/query/array/makefile | 2 +- common/query/array/test.hxx | 2 +- common/query/basics/driver.cxx | 2 +- common/query/basics/makefile | 2 +- common/query/basics/test.hxx | 2 +- common/query/one/makefile | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship/basics/driver.cxx | 2 +- common/relationship/basics/makefile | 2 +- common/relationship/basics/test.hxx | 2 +- common/relationship/on-delete/driver.cxx | 2 +- common/relationship/on-delete/makefile | 2 +- common/relationship/on-delete/test.hxx | 2 +- common/relationship/query/driver.cxx | 2 +- common/relationship/query/makefile | 2 +- common/relationship/query/test.hxx | 2 +- common/schema/embedded/basics/driver.cxx | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/basics/test.hxx | 2 +- common/schema/embedded/order/driver.cxx | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/embedded/order/test1.hxx | 2 +- common/schema/embedded/order/test2.hxx | 2 +- common/schema/namespace/driver.cxx | 2 +- common/schema/namespace/makefile | 2 +- common/schema/namespace/test.hxx | 2 +- common/section/basics/driver.cxx | 2 +- common/section/basics/makefile | 2 +- common/section/basics/test.hxx | 2 +- common/section/polymorphism/driver.cxx | 2 +- common/section/polymorphism/makefile | 2 +- common/section/polymorphism/test.hxx | 2 +- common/session/cache/driver.cxx | 2 +- common/session/cache/makefile | 2 +- common/session/cache/test.hxx | 2 +- common/session/custom/driver.cxx | 2 +- common/session/custom/makefile | 2 +- common/session/custom/session.cxx | 2 +- common/session/custom/session.hxx | 2 +- common/session/custom/session.txx | 2 +- common/session/custom/test.hxx | 2 +- common/statement/processing/driver.cxx | 2 +- common/statement/processing/makefile | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/basics/driver.cxx | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/driver.cxx | 2 +- common/transaction/callback/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/basics/driver.cxx | 2 +- common/view/basics/makefile | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 2 +- common/view/olv/makefile | 2 +- common/view/olv/test.hxx | 2 +- common/virtual/driver.cxx | 2 +- common/virtual/makefile | 2 +- common/virtual/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- evolution/Makefile.am | 2 +- evolution/add-column/driver.cxx | 2 +- evolution/add-column/makefile | 2 +- evolution/add-column/model.hxx | 2 +- evolution/add-column/test1.hxx | 2 +- evolution/add-column/test2.hxx | 2 +- evolution/add-column/test3.hxx | 2 +- evolution/add-foreign-key/driver.cxx | 2 +- evolution/add-foreign-key/makefile | 2 +- evolution/add-foreign-key/model.hxx | 2 +- evolution/add-foreign-key/test1.hxx | 2 +- evolution/add-foreign-key/test2.hxx | 2 +- evolution/add-foreign-key/test3.hxx | 2 +- evolution/add-index/driver.cxx | 2 +- evolution/add-index/makefile | 2 +- evolution/add-index/model.hxx | 2 +- evolution/add-index/test1.hxx | 2 +- evolution/add-index/test2.hxx | 2 +- evolution/add-index/test3.hxx | 2 +- evolution/add-table/driver.cxx | 2 +- evolution/add-table/makefile | 2 +- evolution/add-table/model.hxx | 2 +- evolution/add-table/test1.hxx | 2 +- evolution/add-table/test2.hxx | 2 +- evolution/add-table/test3.hxx | 2 +- evolution/alter-column/driver.cxx | 2 +- evolution/alter-column/makefile | 2 +- evolution/alter-column/model.hxx | 2 +- evolution/alter-column/test1.hxx | 2 +- evolution/alter-column/test2.hxx | 2 +- evolution/alter-column/test3.hxx | 2 +- evolution/combined/driver.cxx | 2 +- evolution/combined/makefile | 2 +- evolution/combined/model.hxx | 2 +- evolution/combined/test1.hxx | 2 +- evolution/combined/test2.hxx | 2 +- evolution/combined/test3.hxx | 2 +- evolution/data/driver.cxx | 2 +- evolution/data/makefile | 2 +- evolution/data/model.hxx | 2 +- evolution/data/test1.hxx | 2 +- evolution/data/test2.hxx | 2 +- evolution/data/test3.hxx | 2 +- evolution/drop-column/driver.cxx | 2 +- evolution/drop-column/makefile | 2 +- evolution/drop-column/model.hxx | 2 +- evolution/drop-column/test1.hxx | 2 +- evolution/drop-column/test2.hxx | 2 +- evolution/drop-column/test3.hxx | 2 +- evolution/drop-foreign-key/driver.cxx | 2 +- evolution/drop-foreign-key/makefile | 2 +- evolution/drop-foreign-key/model.hxx | 2 +- evolution/drop-foreign-key/test1.hxx | 2 +- evolution/drop-foreign-key/test2.hxx | 2 +- evolution/drop-foreign-key/test3.hxx | 2 +- evolution/drop-index/driver.cxx | 2 +- evolution/drop-index/makefile | 2 +- evolution/drop-index/model.hxx | 2 +- evolution/drop-index/test1.hxx | 2 +- evolution/drop-index/test2.hxx | 2 +- evolution/drop-index/test3.hxx | 2 +- evolution/drop-table/driver.cxx | 2 +- evolution/drop-table/makefile | 2 +- evolution/drop-table/model.hxx | 2 +- evolution/drop-table/test1.hxx | 2 +- evolution/drop-table/test2.hxx | 2 +- evolution/drop-table/test3.hxx | 2 +- evolution/embedded/driver.cxx | 2 +- evolution/embedded/makefile | 2 +- evolution/embedded/model.hxx | 2 +- evolution/embedded/test1.hxx | 2 +- evolution/embedded/test2.hxx | 2 +- evolution/embedded/test3.hxx | 2 +- evolution/makefile | 2 +- evolution/soft-add/driver.cxx | 2 +- evolution/soft-add/makefile | 2 +- evolution/soft-add/model.hxx | 2 +- evolution/soft-add/test1.hxx | 2 +- evolution/soft-add/test2.hxx | 2 +- evolution/soft-add/test3.hxx | 2 +- evolution/soft-delete/driver.cxx | 2 +- evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 2 +- evolution/soft-delete/test1.hxx | 2 +- evolution/soft-delete/test2.hxx | 2 +- evolution/soft-delete/test3.hxx | 2 +- evolution/template/Makefile.am | 2 +- evolution/template/driver.cxx | 2 +- evolution/template/makefile | 2 +- evolution/template/model.hxx | 2 +- evolution/template/test1.hxx | 2 +- evolution/template/test2.hxx | 2 +- evolution/template/test3.hxx | 2 +- evolution/test.bat | 2 +- evolution/tester.bat | 2 +- evolution/tester.in | 2 +- evolution/version/driver.cxx | 2 +- evolution/version/makefile | 2 +- evolution/version/model.hxx | 2 +- evolution/version/test1.hxx | 2 +- evolution/version/test2.hxx | 2 +- evolution/version/test3.hxx | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/c++11.m4 | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/custom/driver.cxx | 2 +- mssql/custom/makefile | 2 +- mssql/custom/query.hxx | 2 +- mssql/custom/test.hxx | 2 +- mssql/custom/traits.cxx | 2 +- mssql/custom/traits.hxx | 2 +- mssql/database/driver.cxx | 2 +- mssql/database/makefile | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/stored-proc/driver.cxx | 2 +- mssql/stored-proc/makefile | 2 +- mssql/stored-proc/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/custom/driver.cxx | 2 +- mysql/custom/makefile | 2 +- mysql/custom/query.hxx | 2 +- mysql/custom/test.hxx | 2 +- mysql/custom/traits.hxx | 2 +- mysql/database/driver.cxx | 2 +- mysql/database/makefile | 2 +- mysql/index/driver.cxx | 2 +- mysql/index/makefile | 2 +- mysql/index/test.hxx | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/custom/driver.cxx | 2 +- oracle/custom/makefile | 2 +- oracle/custom/test.hxx | 2 +- oracle/custom/traits.hxx | 2 +- oracle/database/driver.cxx | 2 +- oracle/database/makefile | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/custom/driver.cxx | 2 +- pgsql/custom/makefile | 2 +- pgsql/custom/query.hxx | 2 +- pgsql/custom/test.hxx | 2 +- pgsql/custom/traits.hxx | 2 +- pgsql/database/driver.cxx | 2 +- pgsql/database/makefile | 2 +- pgsql/index/driver.cxx | 2 +- pgsql/index/makefile | 2 +- pgsql/index/test.hxx | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/basic/driver.cxx | 2 +- qt/common/basic/makefile | 2 +- qt/common/basic/test.hxx | 2 +- qt/common/containers/basics/driver.cxx | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/basics/test.hxx | 2 +- qt/common/containers/change-tracking/driver.cxx | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/containers/change-tracking/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/custom/driver.cxx | 2 +- sqlite/custom/makefile | 2 +- sqlite/custom/test.hxx | 2 +- sqlite/database/driver.cxx | 2 +- sqlite/database/makefile | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/transaction/driver.cxx | 2 +- sqlite/transaction/makefile | 2 +- sqlite/transaction/test.hxx | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 690 files changed, 690 insertions(+), 690 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1c7c524..07021b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common evolution diff --git a/boost/Makefile.am b/boost/Makefile.am index f218a4e..9ac5b09 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index 06f854d..8a7d2e2 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index a52dc66..ebacbda 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index c5fad03..a6b53be 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index f0b47a8..91d9e00 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index b9788e9..ee97fcb 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,5 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index 4ca3191..dc61a69 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index d14921e..1ffc596 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 17f739e..01cb8aa 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 7baf380..4f190a7 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index bd51298..1c974af 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index d357e89..bab7914 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 049ec31..524b564 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index fcaa178..8348a37 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 147da34..15ad4da 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 0d2f039..8cf2009 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index f6ee513..bdc10eb 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index 16cdcb6..a75d59d 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 538772a..12daf94 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 21c325b..9881191 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 41517ca..ec4da23 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index e72dc93..d803ed1 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index b388cca..8da76b5 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,5 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index 684513c..d9521db 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index ff5f003..1debcf7 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index c958291..998b5ba 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index 3f8999f..fe96cfc 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 5188679..d9f771c 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index 34f2ca3..e24a200 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index a758a87..b7c8559 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 3488804..7d6481b 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 14ad0f1..648bf1d 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 668b684..38eaa21 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index 3746583..cba942f 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index 1f5b2e7..0b7f98b 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index 12bd942..8ae9d19 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 6ffe051..b043750 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index b3f25b8..b082bf8 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index 253ebb1..b61aabc 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index c8893fe..31614d9 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 6ba944c..47f92f8 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index 0f9236a..d077287 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 5c2669a..ca9f295 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index ce207a9..c2bfe43 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 1e349d1..5cab596 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index ce4e1e6..6b4723f 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index 7247220..da6b899 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 4d6afba..70b4065 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 0912dc6..306141e 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index c099b7d..5650dbd 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 91444dd..4d0c194 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index 6ecde1b..7aeb4a5 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index f253175..60f3717 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 924b4bb..159d8cc 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index 2d13c75..16b794e 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index 09e068d..d6cf3cd 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 7e65791..af619f2 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 47b9a50..6afad79 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 3541a10..ad1937f 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index e7e1da2..70e15a8 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 6fab9cc..335dd04 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index de6b3c8..5dc428a 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index d14a152..097f6f3 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 22d26a1..ef95589 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 0453bc3..4bcdda7 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index b167423..7ba7c4b 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index 8aab2d6..2d31c9b 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 065ac18..428256a 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index 660a401..58ab5e2 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index de0bcb2..a446ff8 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 0a7f915..47466f0 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index d0594b7..de470c6 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 8f5c1c7..3040821 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index cea28f0..f500c6d 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index ee57c6f..2984c0a 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index b1b4f3d..8953df9 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index e43372f..ec10aec 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 9f749e3..e14bb5d 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index fb9f51f..7d6cb2f 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index f843b05..7dbc25e 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 1184b5b..7e8ad57 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 61ad49f..576a0e7 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index ef39001..4321f2a 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index f6ae20d..002963b 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index c3508c1..9e9f466 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index f88fc34..e43ecb7 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index bd90cf6..5a40f61 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 97094b8..0f5c0e8 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index 0cb9466..7b55255 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 4cac27e..2c94691 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 701b58a..a6101b1 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index 1952f07..ade0186 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 419c86d..21df46d 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index 6e0de0c..e953cc0 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index 06d5da4..13082ef 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index b610119..0e8b679 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index d2beb6b..d77fde0 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 1339fbc..64f5e97 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 7a62a09..fe2c09c 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index a041f8c..105ed75 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 25c6eb0..bf3000e 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index ab13e37..17971ee 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index 034a8db..ce27507 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 8eed8ac..4dd2931 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index 1a34cdf..a434c01 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 5981921..05f8a3f 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index 41b07f4..2ea2618 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 956d037..42d0eef 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index b25ddbb..3fa72f5 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index cbf9f7d..7fc3aa1 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 90eb372..a5d7bc2 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 63efaf8..e4406df 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index c78af91..7d0987e 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index c54e996..05de257 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index d71790a..f45a596 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 525d633..d92a450 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index f7933cc..0762307 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 683827e..ca61f56 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index e71fd4f..6f69c91 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 9603c10..bc74ea3 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index 4520816..f42512d 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index 704a96f..b6ca148 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index d5c7d6f..e42ca76 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index 0366b76..bdb4b00 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index b6d99de..9de3164 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index d129b54..62135f2 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 6cdb952..eca2a50 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index a454df9..c6b7f3d 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index ddbd35d..618ea48 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 05c18be..1e8ed91 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,5 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index deac973..160a6e6 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,5 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index 6c4516e..a91d1bd 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,5 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 3482e45..2a27668 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/auto/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/auto/makefile b/common/auto/makefile index ed1b40f..a8562c2 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -1,5 +1,5 @@ # file : common/auto/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/auto/test.hxx b/common/auto/test.hxx index cee27c5..0052bee 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/auto/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index b56bc64..7392786 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index bb028d6..758868e 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 0bfd29c..84448cc 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 7d0b726..f9f75cc 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1,5 +1,5 @@ // file : common/bulk/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bulk database operations. diff --git a/common/bulk/makefile b/common/bulk/makefile index 2ade5db..0a96755 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -1,5 +1,5 @@ # file : common/bulk/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index c0955f1..1e7ce52 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,5 +1,5 @@ // file : common/driver/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index d8e91db..b85729c 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index 942fa48..2de856f 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index b913cbd..386544f 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index 07a6c53..b21ff2f 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-column.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index 4ce5551..0bfe706 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-foreign-key.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index 9163cff..143864a 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-index.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_INDEX_HXX diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index b012148..35fe2e8 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-table.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_TABLE_HXX diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index 5eed54a..e58f750 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/alter-column.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index f88d931..4df2f97 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-column.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index 97628f1..2b1f467 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-foreign-key.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index 3358832..250021d 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-index.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_INDEX_HXX diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index 8de6376..504e75d 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-table.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 2f900c1..461e2eb 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -1,5 +1,5 @@ # file : common/changelog/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index 1b8a6da..68e854a 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -1,5 +1,5 @@ // file : common/changelog/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index 09a34e7..e278a13 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 664a6a9..e450fdd 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,5 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index 967b0a4..1e2f4f4 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index e5215c3..0dcf376 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index dec9041..799bb0a 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 2d5716a..c2e090c 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,5 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 3f0d0dc..822b590 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,5 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx index f8773d5..3137fe1 100644 --- a/common/composite-id/driver.cxx +++ b/common/composite-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite-id/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/composite-id/makefile b/common/composite-id/makefile index 18b6fbe..4c8a655 100644 --- a/common/composite-id/makefile +++ b/common/composite-id/makefile @@ -1,5 +1,5 @@ # file : common/composite-id/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index adf9495..be5d45a 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -1,5 +1,5 @@ // file : common/composite-id/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 45ca09d..f88a1d8 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index c7ed7f3..38f04af 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 5dad274..3de51b3 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index d2a8094..c076560 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index f37de33..27678f9 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index d5529d3..1928572 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 82aced4..03b9c20 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index a78d488..5ffc55b 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 22a3b26..93977f0 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index cb3ae92..78bf66b 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index fb34367..76bfa02 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,5 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index ca167ab..8ac8290 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index 9baf6a2..c5a43a4 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index 209859c..982ef9c 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,5 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index edbff0a..bcb6880 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 3054e97..8a710a6 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index 414a084..2d7c430 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 3c5107d..2addc20 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 56f9a3d..4bb0309 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index cfb85ee..0c7b178 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index 5980003..bcf0601 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index debd86f..b83ad3c 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,5 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index ec24015..1f2825d 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,5 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index 2d3e792..adc4268 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,5 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index 409dba1..4b2e44a 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,5 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 2e1e678..9e0d95e 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index ceb0928..5ea1791 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index 98ff0e9..f7941fe 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 302e506..0c29d60 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index b8e634a..b47a469 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index e4ba0f8..91d3ec1 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index a368620..8a2c7f4 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index 9428c59..9f8ab7c 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index c7c8e4d..83b3645 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index 11d8433..d6dc326 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index 1c7b7e6..125402a 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index 7165276..c7c3511 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index ed0c07f..f7c7396 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 950f5e8..2e6814b 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index 595d133..0951a5e 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index 2687b2a..ac9de5c 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 8800252..6073056 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 13dfc94..2628516 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index c35e1f4..7b7e54a 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index c5c91c1..0e81a20 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,5 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index bfc06d4..5f8b8f0 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,5 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index d6cfe65..8acf1e0 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,5 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index d4509a4..3eec9b6 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index a9cbc4e..af4a115 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index 1e784e2..ae3dfa0 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index 146545c..b8b9d7f 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index 74d1578..c9c2002 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index f822ed2..6b94f1e 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx index 8f80cdb..d86089f 100644 --- a/common/inheritance/polymorphism/test13.hxx +++ b/common/inheritance/polymorphism/test13.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test13.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx index 95baf61..d5f3e4f 100644 --- a/common/inheritance/polymorphism/test14.hxx +++ b/common/inheritance/polymorphism/test14.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test14.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx index d64f935..0fbe326 100644 --- a/common/inheritance/polymorphism/test15.hxx +++ b/common/inheritance/polymorphism/test15.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test15.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index e2905b0..a6fd621 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index 9de72a5..a6c27fa 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index 5c4ae2f..f3b7f45 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index 54b8fd1..e253f6a 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index 1b2709a..1682b3f 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index 9e99149..6ae8e93 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index b07248a..0535468 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index 51719ac..253bccd 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index a684896..20d89ec 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 61aa391..554d090 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index b0130c4..47deb67 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index c0c5ca7..94b3800 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index b3ab9e5..c403ced 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index 851168d..02967ab 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 974cab2..a4a0fc8 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index 366c4ff..ba0f295 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 3e9d384..a245084 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index cc7835c..b0513a8 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index ddfca26..4025447 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 434b7d6..a298807 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 3806e86..8bc455b 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 6a85d57..a9ad0c6 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 5800090..79085c6 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index f933484..d7d134e 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index b9f98ca..c9cc666 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 8e5d256..8daf755 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 5602e6a..9f7d5e4 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/object/driver.cxx b/common/object/driver.cxx index f3bad0e..ea2a47e 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -1,5 +1,5 @@ // file : common/object/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes. diff --git a/common/object/makefile b/common/object/makefile index c270400..1be559d 100644 --- a/common/object/makefile +++ b/common/object/makefile @@ -1,5 +1,5 @@ # file : common/object/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/object/test.hxx b/common/object/test.hxx index 4ff9075..100464c 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -1,5 +1,5 @@ // file : common/object/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 84e72f9..ae7294f 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 7569f04..4a04259 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index df753c4..81d41e4 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 0217fcb..041e96c 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index ec2fca9..72f21f2 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index aee3f8b..958a6ec 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index ee690a1..0d30821 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,5 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index 2a98a7e..c2cdd25 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,5 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 571f4b6..5f361c2 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,5 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 5b0d378..b47fc93 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index b20d124..e85feb2 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,5 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index e9cbd15..1bebf19 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,5 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index be45237..a982901 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index 06b5095..6aa18e6 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,5 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 1fd86dc..94f4a6e 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/one/makefile b/common/query/one/makefile index 2fd441b..51e281d 100644 --- a/common/query/one/makefile +++ b/common/query/one/makefile @@ -1,5 +1,5 @@ # file : common/query/one/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 2bb7ce9..4ea03bd 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index 36ab74c..2ed7967 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 2b3d8ef..689b571 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index 8ad866f..e0fd3b2 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index fd1f4b9..48aeb6a 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -1,5 +1,5 @@ # file : common/relationship/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index a320c00..dd99273 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index 25b534b..51fe65a 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test ON DELETE functionality. diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index 71078f5..75f2bc3 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -1,5 +1,5 @@ # file : common/relationship/on-delete/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx index dba04c3..4e44b52 100644 --- a/common/relationship/on-delete/test.hxx +++ b/common/relationship/on-delete/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index 2ca05f4..97f4e0f 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index 6a150aa..444c0ce 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/query/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 3876b27..7375e2d 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index a67529c..f243ba7 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 68118f8..a2db582 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index b5e08ff..cabf942 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index 0545442..d501433 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 210f955..f1868a3 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index 1e01ebf..2e343d6 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index 0d9f005..468db64 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index 45ebaa9..88e057f 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index b0febb0..1074448 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,5 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index dfaaf19..83be599 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index a2b7006..bdd5e64 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object section basics. diff --git a/common/section/basics/makefile b/common/section/basics/makefile index 8c40bb9..18b3552 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -1,5 +1,5 @@ # file : common/section/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index 0ceb298..60b69da 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/section/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index 8c38035..c9cfee3 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test sections in polymorphic objects. diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index 5de55b9..b398be7 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/section/polymorphism/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index f2081c2..1c8e8fb 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 114d0ac..92eef3b 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 63c5638..9665dd2 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,5 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index a801db2..8e578e4 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,5 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index ab111b2..f37db94 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index ad92aa8..a72203c 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,5 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index 64fea10..6daa8b0 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 1ebf452..29fb4a2 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index 2fdd20e..f54ebb7 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,5 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index ffcd518..ba1a24f 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 2064315..e6e37f3 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -1,5 +1,5 @@ // file : common/statement/processing/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test internal statement processing machinery. diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 5d76ec2..154f3c6 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -1,5 +1,5 @@ # file : common/statement/processing/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 50ad1bc..e958ea3 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 2379d46..43de3eb 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 6e775c7..ae86efb 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index 3d2f481..63bc9e3 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 6fd6ffb..5873597 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 3114072..f1a83d5 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index 694d7fa..12e72e8 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index 8619f2e..e6640aa 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index a2faaea..8ccd06c 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index fe68e99..0020abf 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,5 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index c65b695..a7ee853 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 337c12e..7bca092 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,5 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 136bfca..99cc87b 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index a72b553..5e02f8c 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index 97c4776..db4cdeb 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index 557efda..652da58 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test view basics. diff --git a/common/view/basics/makefile b/common/view/basics/makefile index 7598bb7..e763841 100644 --- a/common/view/basics/makefile +++ b/common/view/basics/makefile @@ -1,5 +1,5 @@ # file : common/view/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 0a2243d..f568d6c 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/view/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index 6ef2467..e1eaed0 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/olv/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object loading views. diff --git a/common/view/olv/makefile b/common/view/olv/makefile index 9da28db..9050601 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -1,5 +1,5 @@ # file : common/view/olv/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/olv/test.hxx b/common/view/olv/test.hxx index 8f358d3..ebc3eda 100644 --- a/common/view/olv/test.hxx +++ b/common/view/olv/test.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index 5bac449..ac3236a 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,5 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index 7a6f716..d6e7c42 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,5 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index 8d66cde..69eaa7e 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,5 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 6aa0f05..779adff 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 1a42923..331a6b8 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index fc08bf9..9e3dc2b 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 4a3af31..6d7aa33 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/evolution/Makefile.am b/evolution/Makefile.am index 1c12027..9cf9d19 100644 --- a/evolution/Makefile.am +++ b/evolution/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 68970d3..f41cb3c 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-column/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new column. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index ad580b8..a6fc763 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -1,5 +1,5 @@ # file : evolution/add-column/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx index e1e805a..90d95c8 100644 --- a/evolution/add-column/model.hxx +++ b/evolution/add-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index 23470b9..cb57f9d 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index 0f286b7..08008e9 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx index 88051d3..e1eaa87 100644 --- a/evolution/add-column/test3.hxx +++ b/evolution/add-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index 0192357..b81c4f9 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a foreign key. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 6f72614..16b660c 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/add-foreign-key/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index 19dee89..da02603 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index 0c82e25..35492f8 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index a1ba8df..52da23a 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx index c24a09c..9d412c4 100644 --- a/evolution/add-foreign-key/test3.hxx +++ b/evolution/add-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index 8d388ba..eda0f58 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new index. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 8ddb2e4..65a4746 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -1,5 +1,5 @@ # file : evolution/add-index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx index f268bc4..6928faa 100644 --- a/evolution/add-index/model.hxx +++ b/evolution/add-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index 213ce2f..1bc5549 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index db1e85c..16f5c97 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx index 34f074a..3b435d4 100644 --- a/evolution/add-index/test3.hxx +++ b/evolution/add-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index da4677e..5bb80cb 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-table/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new table (object, container). diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 9178b3c..de45936 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -1,5 +1,5 @@ # file : evolution/add-table/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx index 808e647..2f0449a 100644 --- a/evolution/add-table/model.hxx +++ b/evolution/add-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index c91193e..2b2da59 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index 96983e5..9ec98f2 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx index e709f25..47d99c2 100644 --- a/evolution/add-table/test3.hxx +++ b/evolution/add-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index 1a46100..b9b2248 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test altering a column. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 076de38..987de8f 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -1,5 +1,5 @@ # file : evolution/alter-column/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index a9a3aeb..ff38df0 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index 43297b9..2d9190b 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index 3c01eeb..ef2c984 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx index f17b630..0253339 100644 --- a/evolution/alter-column/test3.hxx +++ b/evolution/alter-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index c48b9fd..3c2d443 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/combined/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Combined schema evolution test. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 54ce175..d59702d 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -1,5 +1,5 @@ # file : evolution/combined/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 53faddf..4fff13b 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index af73407..9e1ea1a 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 753b673..8ed384b 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx index 26626a3..7e53b49 100644 --- a/evolution/combined/test3.hxx +++ b/evolution/combined/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index a31a9ec..67481e9 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/data/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test data migration support. diff --git a/evolution/data/makefile b/evolution/data/makefile index 63462f7..04c2fc0 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -1,5 +1,5 @@ # file : evolution/data/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx index db49a44..8751896 100644 --- a/evolution/data/model.hxx +++ b/evolution/data/model.hxx @@ -1,5 +1,5 @@ // file : evolution/data/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx index 52b1873..cb48cbb 100644 --- a/evolution/data/test1.hxx +++ b/evolution/data/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx index 8aa60fe..4f42aa5 100644 --- a/evolution/data/test2.hxx +++ b/evolution/data/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx index 7decfc5..30965e8 100644 --- a/evolution/data/test3.hxx +++ b/evolution/data/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 60eba06..e8b6ada 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a column. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 0a81973..b4e2293 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-column/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index b69cd0d..a6e9b7e 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index 91df52e..cc77ac0 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index 7adb321..ea619b9 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx index 55be2a2..f27d874 100644 --- a/evolution/drop-column/test3.hxx +++ b/evolution/drop-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index 7d97af9..dbcb747 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a foreign key. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index ea3d415..2f56423 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-foreign-key/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index b58aa92..7d79889 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index 0748126..d5880e1 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index c620179..221de4c 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx index f9f1947..c42982b 100644 --- a/evolution/drop-foreign-key/test3.hxx +++ b/evolution/drop-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 39eedcf..7f78f30 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping an index. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 229090f..4161ee2 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx index f3e5e2e..52c9d0e 100644 --- a/evolution/drop-index/model.hxx +++ b/evolution/drop-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index 6fb8583..dc30994 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index d4722d2..5c8f641 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx index e672f15..c6c56d8 100644 --- a/evolution/drop-index/test3.hxx +++ b/evolution/drop-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 55e2528..4cbb6e0 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a table (object, container). diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 202a82f..bb56294 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-table/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index 55035e6..dd622c1 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index 4e2413c..dcaac05 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index d842d5b..a736ccd 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx index 9fde448..a701ca0 100644 --- a/evolution/drop-table/test3.hxx +++ b/evolution/drop-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 90d7a7b..7329e1d 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/embedded/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test embedded schema migration. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index ded0848..25a8cf1 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -1,5 +1,5 @@ # file : evolution/embedded/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx index f5e6beb..fce944f 100644 --- a/evolution/embedded/model.hxx +++ b/evolution/embedded/model.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx index 6e7748d..1f8dbc9 100644 --- a/evolution/embedded/test1.hxx +++ b/evolution/embedded/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx index 78578e4..4a76d39 100644 --- a/evolution/embedded/test2.hxx +++ b/evolution/embedded/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx index ce613b6..671523f 100644 --- a/evolution/embedded/test3.hxx +++ b/evolution/embedded/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 1272091..8f9ab2a 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -1,5 +1,5 @@ # file : evolution/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 699a21a..2fa034e 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-add functionality. diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 7accdc0..28accda 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-add/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index 50a7639..dbffbae 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx index 2619325..f0cb231 100644 --- a/evolution/soft-add/test1.hxx +++ b/evolution/soft-add/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx index 7b65fdb..417cf29 100644 --- a/evolution/soft-add/test2.hxx +++ b/evolution/soft-add/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx index a3a34ab..5305001 100644 --- a/evolution/soft-add/test3.hxx +++ b/evolution/soft-add/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 95b62b5..480f8d6 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-delete functionality. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 5245f12..0d66f70 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-delete/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 9c99abe..825f969 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx index 5bd4729..b144337 100644 --- a/evolution/soft-delete/test1.hxx +++ b/evolution/soft-delete/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx index b1886cb..53e2ec9 100644 --- a/evolution/soft-delete/test2.hxx +++ b/evolution/soft-delete/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx index 00ac7ca..a808b34 100644 --- a/evolution/soft-delete/test3.hxx +++ b/evolution/soft-delete/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 6e05a5d..d902560 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index c5101c6..4f0137c 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/evolution/template/makefile b/evolution/template/makefile index 125201a..3209cb3 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -1,5 +1,5 @@ # file : evolution/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx index ef6c9d0..c29e31f 100644 --- a/evolution/template/model.hxx +++ b/evolution/template/model.hxx @@ -1,5 +1,5 @@ // file : evolution/template/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index d6d4ac7..1ac513d 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index a349f54..903dfd7 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx index 68366f4..55ae1f1 100644 --- a/evolution/template/test3.hxx +++ b/evolution/template/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/test.bat b/evolution/test.bat index b86171c..adec5d2 100644 --- a/evolution/test.bat +++ b/evolution/test.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/evolution/tester.bat b/evolution/tester.bat index e815522..065b5ab 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/tester.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/evolution/tester.in b/evolution/tester.in index 805b360..9b390f1 100755 --- a/evolution/tester.in +++ b/evolution/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : evolution/tester.in -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index b171969..4d9d289 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/version/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test schema version access via the database instance. diff --git a/evolution/version/makefile b/evolution/version/makefile index ffeebdf..077d0ac 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -1,5 +1,5 @@ # file : evolution/version/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx index b30a194..ad2c186 100644 --- a/evolution/version/model.hxx +++ b/evolution/version/model.hxx @@ -1,5 +1,5 @@ // file : evolution/version/model.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx index 138fd09..b1b75aa 100644 --- a/evolution/version/test1.hxx +++ b/evolution/version/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test1.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx index 60af1c0..64e8d10 100644 --- a/evolution/version/test2.hxx +++ b/evolution/version/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test2.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx index 1e4deb3..dc43c87 100644 --- a/evolution/version/test3.hxx +++ b/evolution/version/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test3.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index f610ac0..9e533d7 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 8b59116..0e7ebfa 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 44d58c3..6c12fa6 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index ba7118a..9abe47e 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index f9bbd4d..696ce05 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index fafd9bc..e70efd7 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 5c28b63..4aa95ad 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index fe14255..6724ea1 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 1bf49fb..cf2314d 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 08cf0e5..0fac560 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 94a6666..d6f6e5f 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index f375c6d..9f53b06 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index f6217c2..fadec00 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 889f510..b20e445 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,5 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index b454d9b..cae6481 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 7f9ba5a..6af384b 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index b43f9f0..bb0c617 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index fb0f840..c9e6eed 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index 64ec0f4..c54c3d5 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index 88a441e..b492fa4 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 2a410db..f9153ab 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index 0fec6bd..fe01711 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index b80cbcc..b68497c 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index 59c1702..dffb802 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 9ce2580..2dd2634 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 9ffa609..1ee0d7b 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index c4972db..6b04b63 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index 38f2cee..ffb2071 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index fd41025..3fdd2a6 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index 7574ca7..1ed6116 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index ba8b7d6..5da75ca 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index bb3c26e..aaa9ea1 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 247382e..2a74da2 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 99c4a82..1f49f8f 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index 1609a04..f02850f 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 561293f..679e128 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 63a3982..6f52866 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index 562e6b1..8ba98f1 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 2563560..84344d1 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index ebaa790..13282dc 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 8966239..9d0220c 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,5 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index d2e29e6..6d65f86 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 7e6e81c..751669c 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx index 80fe42f..266dec3 100644 --- a/mssql/custom/traits.cxx +++ b/mssql/custom/traits.cxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include "traits.hxx" diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index a35fa49..30ca356 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 2dd4fec..aabd65e 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index 8d26113..7cd791d 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,5 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index 646e776..da1bd48 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 588b3fd..c36cf3f 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index 03d9a3a..128e9ca 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index bb0b740..897ccb9 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index b1382ff..651709b 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 7f1c1f6..5818830 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index afb5fe5..a834847 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server stored procedure support. diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile index f590150..2933a05 100644 --- a/mssql/stored-proc/makefile +++ b/mssql/stored-proc/makefile @@ -1,5 +1,5 @@ # file : mssql/stored-proc/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index cb02920..8537096 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 379b77a..48d0a84 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 9e6b481..aec5c21 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index b4cc8c0..c2f8f41 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index 7eca09b..61de2e1 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index 2fbfb34..8150a39 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 55e4c68..09e13c5 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index 50625ee..a8c4b25 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 9d9ab89..0b4653e 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index 725e449..d59ec00 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index 0dbb6dc..b3120f8 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index a51fee2..06058df 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index 5170e76..a7e0c4b 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index ca8c67d..909196a 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,5 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index ad607b1..97c29d9 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index 510082b..0520d64 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 45eee48..4725480 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index bdafff1..371ea5e 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index 7bb623d..4bab781 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,5 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index ac8b6e6..69fb3bf 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index 4104bd2..7886b58 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,5 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index ea12559..ad3be65 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index 95ca3eb..db67a37 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 2912a91..65abf30 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index bbe993e..3627642 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 1e7e7a7..00477d5 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 7d9ff71..a1b45cb 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 21226eb..1effb38 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index ce6436e..bf7f8da 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index 81f3864..db32bb2 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index df69b5e..5222ce3 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 885a68b..3b455a1 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 03bb120..b602e89 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 12610d8..46ad54e 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 613f83c..5b27a29 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index c46175d..5e6c7b4 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 53a130c..b25e0da 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index 0727ae5..95de227 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index 69b8ec0..80a9689 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index 827ba74..ebab793 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 8ff04bd..8f79329 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,5 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index cc1482b..a569a17 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,5 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index 1797e05..c378a8e 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index dd3c96f..93dabb7 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 2514d3e..081e85f 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,5 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index 4069f1a..debf00d 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 8eb673c..d15e40c 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index ef5f8ea..7ab13cc 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 3ad710e..7c44003 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 68206dc..f0e9771 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index ece1ea4..30ea64a 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index bcfb71e..d393c27 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 093fe27..810e680 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 4b40bd1..8911635 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index d084705..c3f015c 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index ac903b8..804f0aa 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index edd790a..57bb257 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 8d131b0..1ae474e 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index 5a7e21b..e5b6f0d 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index 30a4c83..22d9115 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 496f395..b1e42d4 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,5 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index fa8c7da..2cfaa28 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index ab6de49..ef30e39 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index bcc5a16..6d62143 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index b6c0af5..83efdba 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index e4db090..bbd0c4e 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,5 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 185cfde..3d3f23b 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 50104c3..a7cf64d 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,5 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index be55f82..76754be 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index e783f21..926079d 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 551e266..a55e5a5 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 9034c58..ca6413b 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 91fb3c3..0d399ce 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 54acbbc..33e2289 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 5a43c4f..07d33f9 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 5361b4a..5219b12 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index 3950954..09cf589 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 8133dcd..df2be89 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 13f5c68..034f84d 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 338b198..5d36683 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 9fb4e20..35b7278 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index f360ae7..4b3758a 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index d6fdcf0..f3a7d26 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 487ba11..d213a54 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index f038f76..478da22 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index def577d..6f2ec46 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 6ea7818..8ebd8f9 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index 2aa5a90..228d19e 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 655a169..59f3678 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,5 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index 637130d..cdf3aa3 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index f422084..a98e5ae 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index ce1de60..ef27c52 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index 7160d88..e7c22cb 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index c77947f..644d100 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 532028a..dd48588 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index f66ac6b..c792b19 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index a12fdfa..9746e7e 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index a8a41bb..873efe2 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 0f2f4c5..5241d7c 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 2fe8d7c..56b4d1b 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index c65ad21..8542729 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 32dfd8d..9432f59 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 4acd567..1049e46 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index d0e49f2..574ae25 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index bddd22d..3afe5b4 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index ea1e772..f98a78f 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 872333c..f35e19c 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 43da7d6..2aad642 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 94c986a..83ab031 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index 246ef51..a4adc33 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 4557993..1bc428e 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index f98ce2d..ed69313 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 2fa3c42..4d75745 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 6dd4c3e..1e8a413 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index e83b262..5f104cd 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index bf0f0da..52d580f 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 383a448..58e6955 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index 4eb2d95..efa38b6 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index f513008..2a8ab22 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index 3350019..e6297f1 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index 22cdece..a522705 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 6d29f24..2604821 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index 5b6eba8..d31bc3e 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index f26879c..04a8528 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 6c98488..6c630aa 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 2570285..584ba31 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 8607012..b2dc6e5 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index e56f493..708d76e 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index fbdc152..2cf6c4a 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index d8902ed..a58012b 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index cc82492..fe1d7f7 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index a5de2e3..8c689cb 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index a3117bd..5bd4d90 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index a3c919a..f9adfe1 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 04eab30..6ee4adb 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index a594c68..596f7e1 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 1a567c0..e994350 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 4b58a51..fd0484c 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index ea9c446..933444d 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index a47dd24..f6016d3 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index e1d2f20..5e68cd9 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index a266696..a3bb67e 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index a189c5b..9cb6d5b 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index b88591c..aed3bc4 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index 145f71c..7d7f5b1 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index 3a9a9ca..54a2dca 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 1dabff3..2ba3937 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index dbbbc8d..64ef85f 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index cf8c2c3..fcdf3ff 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index 8203678..a4cdefd 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 3e331f4..698cec3 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index fe7b712..8fe4be9 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index e4402f7..dcc52f9 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 91ca8a4..3995cd4 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index ede32b0..1b55683 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 3e35d12..d50d696 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index b92540e..072c959 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index 233fe49..adb0793 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 72468fc..8acd52b 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index ea53627..7c3ba84 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 914b35c..8214f6b 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index be2d9ec..24b77d2 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 1c46a64..83b42ab 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 9def8a8..556b515 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index d9b0b43..caf6613 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 45f8fee..81cb23c 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index 4690850..352e383 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 3f34418..03f45ed 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index d54d07f..d97ac69 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index 42878d5..b656f9d 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index fe06460..40f7354 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 08d5e72..7012eb5 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 080146d..6e9afcb 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 201ec25..8695915 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,5 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index af0ee93..f3752c1 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index c5a09f4..7ae1fe2 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index a69d2dd..ed2cfbb 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,5 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index c4093ca..99cc6d2 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index defecea..8b0a4af 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index f03ae93..2bb205d 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index bd2d007..44a4fc3 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index b2035d4..7a8438c 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index aab623c..83832b2 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index f001379..df83439 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index 89b55a9..a57e5cf 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index a70e1fd..0089b70 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test esoteric SQLite transaction semantics aspects. diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index 6868e02..8c2e96f 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -1,5 +1,5 @@ # file : sqlite/transaction/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx index ae47107..deb79dd 100644 --- a/sqlite/transaction/test.hxx +++ b/sqlite/transaction/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 136b503..f9e3d25 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index e1a1b1b..c7f55b0 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index b921288..7593518 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index fa0002f..bdd643a 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 5cffe4e..7ec5d76 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 3407218..5797089 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 4d74869..4ffa483 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index 8e40afd..2590d56 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index 396070a..82e4859 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index b653019..8355400 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From 2a6f06ae44a80a5ebdc1b6188b11634fbb0e8741 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Feb 2015 13:51:23 +0200 Subject: Fix to use traditional const style --- common/callback/driver.cxx | 4 ++-- common/composite-id/test.hxx | 32 ++++++++++++++++---------------- common/container/basics/test.hxx | 2 +- common/optimistic/test.hxx | 2 +- common/relationship/query/test.hxx | 2 +- common/threads/driver.cxx | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 12 ++++++------ common/virtual/test.hxx | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index b85729c..8cc918d 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -115,7 +115,7 @@ main (int argc, char* argv[]) o1->data++; o2->data++; db->update (o1.get ()); - db->update (static_cast (*o2)); + db->update (static_cast (*o2)); t.commit (); } cout << "***" << endl; @@ -127,7 +127,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); auto_ptr o1 (db->load (1)); auto_ptr o2 (db->load (2)); - db->erase (static_cast (o1.get ())); + db->erase (static_cast (o1.get ())); db->erase (*o2); t.commit (); } diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index be5d45a..427a162 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -14,7 +14,7 @@ struct scomp { scomp () {} - scomp (std::string const& s1, std::string const& s2, std::string const& s3) + scomp (const std::string& s1, const std::string& s2, const std::string& s3) : str1 (s1), str2 (s2), str3 (s3) { } @@ -75,7 +75,7 @@ namespace test1 struct object { object () {} - object (scomp const& i, unsigned long n): id (i), num (n) {} + object (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; @@ -101,7 +101,7 @@ namespace test2 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -111,7 +111,7 @@ namespace test2 struct object2 { object2 (): o1 (0) {} - object2 (ncomp const& i): id (i), o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} ~object2 () {delete o1;} #pragma db id @@ -124,7 +124,7 @@ namespace test2 struct object3 { object3 () {} - object3 (ncomp const& i): id (i) {} + object3 (const ncomp& i): id (i) {} ~object3 () { @@ -155,7 +155,7 @@ namespace test2 struct object4 { object4 () {} - object4 (ncomp const& i): id (i) {} + object4 (const ncomp& i): id (i) {} #pragma db id ncomp id; @@ -208,7 +208,7 @@ namespace test3 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -221,7 +221,7 @@ namespace test3 struct object2 { object2 (): o1 (0) {} - object2 (ncomp const& i): id (i), o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} ~object2 () {delete o1;} #pragma db id @@ -252,7 +252,7 @@ namespace test4 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -265,7 +265,7 @@ namespace test4 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -302,7 +302,7 @@ namespace test5 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -314,7 +314,7 @@ namespace test5 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -352,7 +352,7 @@ namespace test6 struct object1 { object1 () {} - object1 (scomp const& i): id (i) {} + object1 (const scomp& i): id (i) {} #pragma db id scomp id; @@ -364,7 +364,7 @@ namespace test6 struct object2 { object2 () {} - object2 (ncomp const& i): id (i) {} + object2 (const ncomp& i): id (i) {} ~object2 () { @@ -400,7 +400,7 @@ namespace test7 struct object { object () {} - object (scomp const& i, unsigned long n): id (i), num (n) {} + object (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; @@ -427,7 +427,7 @@ namespace test8 struct object1 { object1 () {} - object1 (scomp const& i, unsigned long n): id (i), num (n) {} + object1 (const scomp& i, unsigned long n): id (i), num (n) {} #pragma db id scomp id; diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 8ac8290..b2dd4b4 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -71,7 +71,7 @@ typedef std::map comp_str_map; struct comp_hash { std::size_t - operator() (comp const& x) const {return nh (x.num) + sh (x.str);} + operator() (const comp& x) const {return nh (x.num) + sh (x.str);} std::hash nh; std::hash sh; diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 81d41e4..b9c04cc 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -38,7 +38,7 @@ struct object_version struct container { container (): ver (123) {} - container (std::string const& id): id_ (id), ver (123) {} + container (const std::string& id): id_ (id), ver (123) {} #pragma db id std::string id_; diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 7375e2d..1b8bbe8 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -132,7 +132,7 @@ struct employer #pragma db object pointer(shared_ptr) struct country { - country (const std::string& c, std::string const& n) + country (const std::string& c, const std::string& n) : code (c), name (n) { } diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index f1a83d5..bf12707 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -96,7 +96,7 @@ struct task t.commit (); break; } - catch (deadlock const&) {} + catch (const deadlock&) {} } for (unsigned long j (0); j < sub_iteration_count; ++j) diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index f568d6c..7af255c 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -19,7 +19,7 @@ struct employer; #pragma db object struct country { - country (const std::string& c, std::string const& n) + country (const std::string& c, const std::string& n) : code (c), name (n) { } diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index e1eaed0..c91b8ef 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -188,7 +188,7 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view5 const& v (*i); + const view5& v (*i); assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && @@ -196,7 +196,7 @@ main (int argc, char* argv[]) } assert (++i != r.end ()); { - view5 const& v (*i); + const view5& v (*i); assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && @@ -419,12 +419,12 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view1 const& v (*i); + const view1& v (*i); assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); } assert (++i != r.end ()); { - view1 const& v (*i); + const view1& v (*i); assert (v.o1->n == 234 && !v.o2); } assert (++i == r.end ()); @@ -454,12 +454,12 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - view2 const& v (*i); + const view2& v (*i); assert (v.o3->n == 123 && v.o4->s == "abc" && v.o4->o3 == v.o3); } assert (++i != r.end ()); { - view2 const& v (*i); + const view2& v (*i); assert (v.o3->n == 234 && !v.o4); } assert (++i == r.end ()); diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index 69eaa7e..cf4db0f 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -145,7 +145,7 @@ namespace test3 struct name { name () {} - name (std::string const& f, std::string const& l) + name (const std::string& f, const std::string& l) : first (f), last(l) {} std::string first; -- cgit v1.1 From 52a33f8244e7229b23484259370b4d6c11be492d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Feb 2015 14:00:39 +0200 Subject: Bump version to 2.4.0 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 770201d..197c4d5 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0.a6 +2.4.0 -- cgit v1.1 From 098b528e2deddd128a05d91ea6b7a555a74b22b2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Feb 2015 15:44:02 +0200 Subject: Disable parts of test for multi-database case Since not all the databases support them (JOIN types). --- common/view/basics/driver.cxx | 6 ++++-- common/view/basics/test.hxx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index 652da58..c1108d7 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -720,7 +720,7 @@ main (int argc, char* argv[]) t.commit (); } -#if !defined(DATABASE_SQLITE) +#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) { typedef odb::query query; typedef odb::result result; @@ -737,7 +737,9 @@ main (int argc, char* argv[]) } #endif -#if !defined(DATABASE_MYSQL) && !defined(DATABASE_SQLITE) +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_COMMON) { typedef odb::query query; typedef odb::result result; diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 7af255c..87c4d76 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -546,7 +546,7 @@ namespace test2 odb::nullable id2; }; -#if !defined(DATABASE_SQLITE) +#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) struct vright @@ -557,7 +557,9 @@ namespace test2 #endif -#if !defined(DATABASE_MYSQL) && !defined(DATABASE_SQLITE) +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_COMMON) #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) struct vfull -- cgit v1.1 From 957d1708d7fd10ebaf4c26a6711f9579fcb6003d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Feb 2015 17:31:02 +0200 Subject: Make anal clang happy --- common/bulk/driver.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index f9f75cc..f1b624e 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -41,6 +41,7 @@ template struct element_traits { typedef T type; + typedef T* pointer; typedef std::auto_ptr auto_ptr; static T& ref (T& x) {return x;} @@ -51,6 +52,7 @@ template struct element_traits { typedef T type; + typedef T* pointer; typedef std::auto_ptr auto_ptr; static T& ref (T* p) {return *p;} @@ -61,6 +63,7 @@ template struct element_traits > { typedef T type; + typedef std::auto_ptr pointer; typedef std::auto_ptr auto_ptr; static T& ref (const auto_ptr& p) {return *p;} @@ -72,6 +75,7 @@ template struct element_traits> { typedef T type; + typedef std::unique_ptr pointer; typedef std::unique_ptr auto_ptr; static T& ref (const unique_ptr& p) {return *p;} @@ -201,7 +205,8 @@ erase (const auto_ptr& db, I b, I e) for (I i (b); i != e; ++i) { type& x (traits::ref (*i)); - assert (traits::ptr (db->find (x.id)) == 0); + typename traits::pointer p (db->find (x.id)); + assert (traits::ptr (p) == 0); } t.commit (); -- cgit v1.1 From 039beb368bf43572b0400521a7859dd635a8f22f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 10:59:10 +0200 Subject: Add missing VC12 solution to extra_dist --- libcommon/makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcommon/makefile b/libcommon/makefile index fadec00..c397f61 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -10,7 +10,8 @@ $(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) $(dist): export dirs := $(dirs) $(dist): export extra_dist := $(call vc8slns,libcommon) \ -$(call vc9slns,libcommon) $(call vc10slns,libcommon) $(call vc11slns,libcommon) +$(call vc9slns,libcommon) $(call vc10slns,libcommon) \ +$(call vc11slns,libcommon) $(call vc12slns,libcommon) $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) $(call meta-automake) $(call meta-vc8slns,libcommon) -- cgit v1.1 From edb7ba7437aa577d65da942aaf778c16c9a501ed Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 11:48:37 +0200 Subject: Recode strncpy as memcpy VC12 deprecated those hard, as in, it is now an error. --- common/query/array/test.hxx | 9 +++++---- mssql/types/test.hxx | 12 ++++++------ mysql/types/test.hxx | 6 +++--- oracle/types/test.hxx | 6 +++--- pgsql/types/test.hxx | 6 +++--- sqlite/types/test.hxx | 8 ++++---- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index 1bebf19..a881e8c 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -7,7 +7,7 @@ #include // HAVE_CXX11 -#include // std::strncpy +#include // std::memcpy, std::strlen #ifdef HAVE_CXX11 # include @@ -22,10 +22,11 @@ struct object object (unsigned long id, const char* s, const char* b) : id_ (id) { - std::strncpy (s_, s, sizeof (s_)); - std::strncpy (s1_, s, sizeof (s1_)); + std::memcpy (s_, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s1_, s, std::strlen (s) + 1); + #ifdef HAVE_CXX11 - std::strncpy (a_.data (), s, a_.size ()); + std::memcpy (a_.data (), s, std::strlen (s) + 1); #endif c_ = c1_ = *s; std::memcpy (b_, b, sizeof (b_)); diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 0b4653e..15070e3 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -23,8 +23,8 @@ typedef struct _GUID #include #include #include // std::auto_ptr -#include // std::memcmp, std::strncpy, std::str[n]cmp -#include // std::wcsncpy, std::wcs[n]cmp +#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen +#include // std::wcslen, std::wcs[n]cmp #include @@ -379,12 +379,12 @@ struct char_array char_array (unsigned long id, const char* s, const wchar_t* ws) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); - std::strncpy (s2, s, sizeof (s2)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); s3[0] = c1 = *s; - std::wcsncpy (ws1, ws, sizeof (ws1) / sizeof(wchar_t)); - std::wcsncpy (ws2, ws, sizeof (ws2) / sizeof(wchar_t)); + std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + std::memcpy (ws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); ws3[0] = wc1 = *ws; if (std::strlen (s) == sizeof (s2)) diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 5e6c7b4..aaf6df7 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -9,7 +9,7 @@ #include #include #include // std::auto_ptr -#include // std::strncpy, std::str[n]cmp +#include // std::memcpy, std::str[n]cmp, std::strlen #include @@ -282,8 +282,8 @@ struct char_array char_array (unsigned long id, const char* s) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); - std::strncpy (s2, s, sizeof (s2)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); s3[0] = c1 = *s; } diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 804f0aa..687f05e 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -8,7 +8,7 @@ #include #include #include // std::auto_ptr -#include // std::strncpy, std::str[n]cmp +#include // std::memcpy, std::str[n]cmp, std::strlen #include @@ -314,8 +314,8 @@ struct char_array char_array (unsigned long id, const char* s) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); - std::strncpy (s2, s, sizeof (s2)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); s3[0] = c1 = *s; } diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index f3a7d26..773742e 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -9,7 +9,7 @@ #include #include #include // std::auto_ptr -#include // std::memcmp, std::strncpy, std::str[n]cmp +#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen #include // std::size_t #include @@ -191,8 +191,8 @@ struct char_array char_array (unsigned long id, const char* s) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); - std::strncpy (s2, s, sizeof (s2)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); s3[0] = c1 = *s; } diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 5797089..5a0bb41 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -9,10 +9,10 @@ #include #include #include // std::auto_ptr -#include // std::strncpy, std::str[n]cmp +#include // std::memcpy, std::str[n]cmp, std::strlen #ifdef _WIN32 -# include // std::wcsncpy, std::wcs[n]cmp +# include // std::wcslen, std::wcs[n]cmp #endif #include @@ -85,11 +85,11 @@ struct char_array ) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. s2[0] = c1 = *s; #ifdef _WIN32 - std::wcsncpy (ws1, ws, sizeof (ws1) / 2); + std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); ws2[0] = wc1 = *ws; #endif } -- cgit v1.1 From 10be61ad26034a574a013c979549aaedf9aa8382 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 12:08:55 +0200 Subject: Split view/olv test into multiple headers files VC++ complains that the object file is too large. --- common/view/olv/driver.cxx | 21 +- common/view/olv/makefile | 8 +- common/view/olv/test.hxx | 687 --------------------------------------------- common/view/olv/test1.hxx | 85 ++++++ common/view/olv/test2.hxx | 123 ++++++++ common/view/olv/test3.hxx | 107 +++++++ common/view/olv/test4.hxx | 152 ++++++++++ common/view/olv/test5.hxx | 87 ++++++ common/view/olv/test6.hxx | 58 ++++ common/view/olv/test7.hxx | 52 ++++ common/view/olv/test8.hxx | 49 ++++ common/view/olv/test9.hxx | 79 ++++++ 12 files changed, 816 insertions(+), 692 deletions(-) delete mode 100644 common/view/olv/test.hxx create mode 100644 common/view/olv/test1.hxx create mode 100644 common/view/olv/test2.hxx create mode 100644 common/view/olv/test3.hxx create mode 100644 common/view/olv/test4.hxx create mode 100644 common/view/olv/test5.hxx create mode 100644 common/view/olv/test6.hxx create mode 100644 common/view/olv/test7.hxx create mode 100644 common/view/olv/test8.hxx create mode 100644 common/view/olv/test9.hxx diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index c91b8ef..b6483eb 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -16,8 +16,25 @@ #include -#include "test.hxx" -#include "test-odb.hxx" +#include "test1.hxx" +#include "test2.hxx" +#include "test3.hxx" +#include "test4.hxx" +#include "test5.hxx" +#include "test6.hxx" +#include "test7.hxx" +#include "test8.hxx" +#include "test9.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" +#include "test4-odb.hxx" +#include "test5-odb.hxx" +#include "test6-odb.hxx" +#include "test7-odb.hxx" +#include "test8-odb.hxx" +#include "test9-odb.hxx" using namespace std; using namespace odb::core; diff --git a/common/view/olv/makefile b/common/view/olv/makefile index 9050601..c12d130 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -5,7 +5,8 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make cxx_tun := driver.cxx -odb_hdr := test.hxx +odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ +test7.hxx test8.hxx test9.hxx genf := $(call odb-gen,$(odb_hdr)) gen := $(addprefix $(out_base)/,$(genf)) cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) @@ -53,6 +54,7 @@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std $(dist): export name := $(name) +$(dist): export odb_header_stem := $(basename $(odb_hdr)) $(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ $(call vc11projs,$(name)) $(call vc12projs,$(name)) $(dist): @@ -65,9 +67,9 @@ $(dist): # Test. # ifneq ($(db_id),common) -$(eval $(call test-rule)) +$(eval $(call test-rule,,$(filter %.sql,$(gen)))) else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) +$(foreach d,$(databases),$(eval $(call test-rule,$d,$(filter %.sql,$(gen))))) endif # Clean. diff --git a/common/view/olv/test.hxx b/common/view/olv/test.hxx deleted file mode 100644 index ebc3eda..0000000 --- a/common/view/olv/test.hxx +++ /dev/null @@ -1,687 +0,0 @@ -// file : common/view/olv/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // unique_ptr -#include // pair - -#include -#include -#include - -// Test basic object loading functionality. -// -#pragma db namespace table("t1_") pointer(std::unique_ptr) -namespace test1 -{ - #pragma db object - struct object1 - { - object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 (int id_ = 0, const char* s_ = ""): id (id_), s (s_) {} - - #pragma db id - int id; - - std::string s; - }; - - #pragma db view object(object1) object(object2: object1::id == object2::id) - struct view1 - { - std::unique_ptr o2; - }; - - #pragma db view object(object1) object(object2: object1::id == object2::id) - struct view2 - { - std::unique_ptr o2; - std::unique_ptr o1; - }; - - #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) - struct view3 - { - std::unique_ptr o1; - std::unique_ptr o2; - }; - - #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) - struct view4 - { - std::string s; - std::unique_ptr o2; - - #pragma db column(o1::id) - int id; - - std::unique_ptr o1; - int n; - }; - - #pragma db view \ - object(object1) \ - object(object2: object1::id == object2::id) \ - object(object1 = o1b: object1::id == o1b::n) - struct view5 - { - std::unique_ptr o1a; - std::unique_ptr o2; - std::unique_ptr o1b; - }; -} - -// Test loading of object pointers inside objects. -// -#pragma db namespace table("t2_") pointer(std::shared_ptr) session -namespace test2 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o2; - }; - - #pragma db view object(object1) object(object2) - struct view2 - { - shared_ptr o2; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object3 - { - object3 () {} - object3 (shared_ptr o2_): o2 (o2_) {} - - #pragma db id auto - int id; - - shared_ptr o2; - }; - - #pragma db view object(object1) object(object2) object(object3) - struct view3 - { - shared_ptr o3; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object4 - { - #pragma db id auto - int id; - - std::vector> o2; - }; - - #pragma db view object(object4) - struct view4 - { - shared_ptr o4; - }; - - #pragma db view object(object4) object (object2) object(object1) - struct view5 - { - shared_ptr o4; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object5 - { - object5 () {} - object5 (shared_ptr o1_, shared_ptr o2_) - : o1 (o1_), o2 (o2_) {} - - #pragma db id auto - int id; - - shared_ptr o1; - shared_ptr o2; - }; - - #pragma db view object(object5) object (object2) \ - object(object1 = o1a: object2::o1) \ - object(object1 = o1b: object5::o1) - struct view6 - { - shared_ptr o1a; - shared_ptr o1b; - }; -} - -// Test JOINs for pointed-to objects, existing and automatically added. -// -#pragma db namespace table("t3_") pointer(std::shared_ptr) session -namespace test3 -{ - using std::shared_ptr; - - struct object2; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - - #pragma db inverse(o1) - odb::lazy_weak_ptr o2; - }; - - #pragma db object - struct object2 - { - object2 (const char* s_ = ""): s (s_) {} - - #pragma db id auto - int id; - - std::string s; - - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1a // Existing JOIN. - { - shared_ptr o1; - }; - - #pragma db view object(object1) - struct view1b // Automatic JOIN. - { - shared_ptr o1; - }; - - // Container case. - // - struct object4; - - #pragma db object - struct object3 - { - object3 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - - #pragma db inverse(o3) - odb::lazy_weak_ptr o4; - }; - - #pragma db object - struct object4 - { - object4 (const char* s_ = ""): s (s_) {} - - #pragma db id auto - int id; - - std::string s; - - std::vector> o3; - }; - - #pragma db view object(object3) object(object4 = o4) - struct view2a // Existing JOIN. - { - shared_ptr o3; - }; - - #pragma db view object(object3) - struct view2b // Automatic JOIN. - { - shared_ptr o3; - }; -} - -// Test by-value load. -// -#pragma db namespace table("t4_") session -namespace test4 -{ - #pragma db object - struct object1 - { - object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 (int id_ = 0, const char* s_ = "", object1* o1_ = 0) - : id (id_), s (s_), o1 (o1_) {} - - #pragma db id - int id; - - std::string s; - object1* o1; // Shallow copy. - }; - - typedef object1* object1_ptr; - typedef object2* object2_ptr; - - #pragma db view object(object1) - struct view1 - { - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - #pragma db transient - object1 o1; - }; - - #pragma db view object(object1) transient - struct view1a - { - view1a (): o1_null (true) {} - - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) \ - set(this.o1_null = !(?)) - - object1 o1; - bool o1_null; - }; - - #pragma db view object(object1) - struct view1b - { - view1b (): o1_p (0) {} - - #pragma db transient - object1 o1; - - #pragma db get(&this.o1) set(o1_p = (?)) - object1* o1_p; - }; - - #pragma db view object(object1) - struct view1c - { - view1c (object1& o1): o1_p (&o1) {} - - object1* o1_p; - }; - - #pragma db view object(object1) object(object2) transient - struct view2 - { - #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) set() - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - object1 o1; - object2 o2; - }; - - #pragma db view object(object1) object(object2) transient - struct view2a - { - #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) \ - set(o2_null = !(?)) - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - object1 o1; - object2 o2; - bool o2_null; - }; - - // Test loading into raw pointer with non-raw object pointer. - // - using std::shared_ptr; - - #pragma db object pointer(shared_ptr) - struct object3 - { - object3 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db view object(object3) - struct view3 - { - // This view implements the following slightly twisted logic: if the - // object is already in the cache, then set o3_p to that. Otherwise, - // load it into the by-value instance. We can also check whether o3_p - // points to o3 to distinguish between the two outcomes. - // - - // Since we may be getting the pointer as both smart and raw, we - // need to create a bit of support code to use in the modifier - // expression. - // - void set_o3 (object3* p) {o3_p = p;} // &o3 or NULL. - void set_o3 (shared_ptr p) {o3_p = p.get ();} // From cache. - - #pragma db get(&this.o3) set(set_o3(?)) - object3* o3_p; - - #pragma db transient - object3 o3; - - // Return-by-value support (query_value()). - // - view3 (): o3_p (0) {} - view3 (const view3& x): o3_p (x.o3_p == &x.o3 ? &o3 : x.o3_p), o3 (x.o3) {} - }; -} - -// Test NULL object pointers. -// -#pragma db namespace table("t5_") pointer(std::shared_ptr) session -namespace test5 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o1; - shared_ptr o2; - }; - - typedef std::pair comp_id; - #pragma db value(comp_id) - - #pragma db object - struct object3 - { - object3 (comp_id id_ = comp_id (), int n_ = 0): id (id_), n (n_) {} - - #pragma db id - comp_id id; - - int n; - }; - - #pragma db object - struct object4 - { - object4 () {} - object4 (const char* s_, shared_ptr o3_): s (s_), o3 (o3_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o3; - }; - - #pragma db view object(object3) object(object4) - struct view2 - { - shared_ptr o4; - shared_ptr o3; - }; -} - -// Test interaction with sections. -// -#pragma db namespace table("t6_") pointer(std::shared_ptr) -namespace test6 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - - #pragma db load(lazy) - odb::section r; - - #pragma db section(r) - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o1; - shared_ptr o2; - }; -} - -// Test explicit conversion to smart pointer member. -// -#pragma db namespace table("t7_") pointer(*) session -namespace test7 -{ - using std::unique_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - object1* o1; // Shallow. - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - unique_ptr o2; - unique_ptr o1; - }; -} - -// Test loading objects without id. -// -#pragma db namespace table("t8_") pointer(*) session -namespace test8 -{ - using std::unique_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object no_id - struct object2 - { - object2 () {} - object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} - - std::string s; - object1* o1; // Shallow. - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - unique_ptr o2; - unique_ptr o1; - }; -} - -// Test loading polymorphic objects. -// -#pragma db namespace table("t9_") session -namespace test9 -{ - using std::shared_ptr; - - #pragma db object polymorphic pointer(shared_ptr) - struct root - { - virtual ~root () {} - root (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct base: root - { - base (int n_ = 0, const char* s_ = ""): root (n_), s (s_) {} - - std::string s; - }; - - #pragma db object - struct derived: base - { - derived (int n_ = 0, const char* s_ = "", bool b_ = false) - : base (n_, s_), b (b_) {} - - bool b; - }; - - // Load via root. - // - #pragma db view object(root) - struct view1r - { - shared_ptr o; - int n; - }; - - // Load via base. - // - #pragma db view object(base) - struct view1b - { - std::string s; - shared_ptr o; - int n; - }; - - // Load via derived. - // - #pragma db view object(derived) - struct view1d - { - std::string s; - shared_ptr o; - int n; - }; -} - -#endif // TEST_HXX diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx new file mode 100644 index 0000000..eaec7e1 --- /dev/null +++ b/common/view/olv/test1.hxx @@ -0,0 +1,85 @@ +// file : common/view/olv/test1.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include +#include // unique_ptr + +#include + +// Test basic object loading functionality. +// +#pragma db namespace table("t1_") pointer(std::unique_ptr) +namespace test1 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = ""): id (id_), s (s_) {} + + #pragma db id + int id; + + std::string s; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view1 + { + std::unique_ptr o2; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view2 + { + std::unique_ptr o2; + std::unique_ptr o1; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view3 + { + std::unique_ptr o1; + std::unique_ptr o2; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view4 + { + std::string s; + std::unique_ptr o2; + + #pragma db column(o1::id) + int id; + + std::unique_ptr o1; + int n; + }; + + #pragma db view \ + object(object1) \ + object(object2: object1::id == object2::id) \ + object(object1 = o1b: object1::id == o1b::n) + struct view5 + { + std::unique_ptr o1a; + std::unique_ptr o2; + std::unique_ptr o1b; + }; +} + +#endif // TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx new file mode 100644 index 0000000..8d95470 --- /dev/null +++ b/common/view/olv/test2.hxx @@ -0,0 +1,123 @@ +// file : common/view/olv/test2.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include +#include +#include // shared_ptr + +#include + +// Test loading of object pointers inside objects. +// +#pragma db namespace table("t2_") pointer(std::shared_ptr) session +namespace test2 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) + struct view2 + { + shared_ptr o2; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (shared_ptr o2_): o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) object(object3) + struct view3 + { + shared_ptr o3; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object4 + { + #pragma db id auto + int id; + + std::vector> o2; + }; + + #pragma db view object(object4) + struct view4 + { + shared_ptr o4; + }; + + #pragma db view object(object4) object (object2) object(object1) + struct view5 + { + shared_ptr o4; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object5 + { + object5 () {} + object5 (shared_ptr o1_, shared_ptr o2_) + : o1 (o1_), o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o1; + shared_ptr o2; + }; + + #pragma db view object(object5) object (object2) \ + object(object1 = o1a: object2::o1) \ + object(object1 = o1b: object5::o1) + struct view6 + { + shared_ptr o1a; + shared_ptr o1b; + }; +} + +#endif // TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx new file mode 100644 index 0000000..15bd71b --- /dev/null +++ b/common/view/olv/test3.hxx @@ -0,0 +1,107 @@ +// file : common/view/olv/test3.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#include +#include +#include // shared_ptr + +#include +#include + +// Test JOINs for pointed-to objects, existing and automatically added. +// +#pragma db namespace table("t3_") pointer(std::shared_ptr) session +namespace test3 +{ + using std::shared_ptr; + + struct object2; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o1) + odb::lazy_weak_ptr o2; + }; + + #pragma db object + struct object2 + { + object2 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1a // Existing JOIN. + { + shared_ptr o1; + }; + + #pragma db view object(object1) + struct view1b // Automatic JOIN. + { + shared_ptr o1; + }; + + // Container case. + // + struct object4; + + #pragma db object + struct object3 + { + object3 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o3) + odb::lazy_weak_ptr o4; + }; + + #pragma db object + struct object4 + { + object4 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + std::vector> o3; + }; + + #pragma db view object(object3) object(object4 = o4) + struct view2a // Existing JOIN. + { + shared_ptr o3; + }; + + #pragma db view object(object3) + struct view2b // Automatic JOIN. + { + shared_ptr o3; + }; +} + +#endif // TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx new file mode 100644 index 0000000..cf2afb0 --- /dev/null +++ b/common/view/olv/test4.hxx @@ -0,0 +1,152 @@ +// file : common/view/olv/test4.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST4_HXX +#define TEST4_HXX + +#include +#include // shared_ptr + +#include + +// Test by-value load. +// +#pragma db namespace table("t4_") session +namespace test4 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = "", object1* o1_ = 0) + : id (id_), s (s_), o1 (o1_) {} + + #pragma db id + int id; + + std::string s; + object1* o1; // Shallow copy. + }; + + typedef object1* object1_ptr; + typedef object2* object2_ptr; + + #pragma db view object(object1) + struct view1 + { + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + #pragma db transient + object1 o1; + }; + + #pragma db view object(object1) transient + struct view1a + { + view1a (): o1_null (true) {} + + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) \ + set(this.o1_null = !(?)) + + object1 o1; + bool o1_null; + }; + + #pragma db view object(object1) + struct view1b + { + view1b (): o1_p (0) {} + + #pragma db transient + object1 o1; + + #pragma db get(&this.o1) set(o1_p = (?)) + object1* o1_p; + }; + + #pragma db view object(object1) + struct view1c + { + view1c (object1& o1): o1_p (&o1) {} + + object1* o1_p; + }; + + #pragma db view object(object1) object(object2) transient + struct view2 + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) set() + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + }; + + #pragma db view object(object1) object(object2) transient + struct view2a + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) \ + set(o2_null = !(?)) + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + bool o2_null; + }; + + // Test loading into raw pointer with non-raw object pointer. + // + using std::shared_ptr; + + #pragma db object pointer(shared_ptr) + struct object3 + { + object3 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db view object(object3) + struct view3 + { + // This view implements the following slightly twisted logic: if the + // object is already in the cache, then set o3_p to that. Otherwise, + // load it into the by-value instance. We can also check whether o3_p + // points to o3 to distinguish between the two outcomes. + // + + // Since we may be getting the pointer as both smart and raw, we + // need to create a bit of support code to use in the modifier + // expression. + // + void set_o3 (object3* p) {o3_p = p;} // &o3 or NULL. + void set_o3 (shared_ptr p) {o3_p = p.get ();} // From cache. + + #pragma db get(&this.o3) set(set_o3(?)) + object3* o3_p; + + #pragma db transient + object3 o3; + + // Return-by-value support (query_value()). + // + view3 (): o3_p (0) {} + view3 (const view3& x): o3_p (x.o3_p == &x.o3 ? &o3 : x.o3_p), o3 (x.o3) {} + }; +} + +#endif // TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx new file mode 100644 index 0000000..4d291a5 --- /dev/null +++ b/common/view/olv/test5.hxx @@ -0,0 +1,87 @@ +// file : common/view/olv/test5.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST5_HXX +#define TEST5_HXX + +#include +#include // shared_ptr +#include // pair + +#include + +// Test NULL object pointers. +// +#pragma db namespace table("t5_") pointer(std::shared_ptr) session +namespace test5 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; + + typedef std::pair comp_id; + #pragma db value(comp_id) + + #pragma db object + struct object3 + { + object3 (comp_id id_ = comp_id (), int n_ = 0): id (id_), n (n_) {} + + #pragma db id + comp_id id; + + int n; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (const char* s_, shared_ptr o3_): s (s_), o3 (o3_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o3; + }; + + #pragma db view object(object3) object(object4) + struct view2 + { + shared_ptr o4; + shared_ptr o3; + }; +} + +#endif // TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx new file mode 100644 index 0000000..4ef14a4 --- /dev/null +++ b/common/view/olv/test6.hxx @@ -0,0 +1,58 @@ +// file : common/view/olv/test6.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST6_HXX +#define TEST6_HXX + +#include +#include // shared_ptr + +#include +#include + +// Test interaction with sections. +// +#pragma db namespace table("t6_") pointer(std::shared_ptr) +namespace test6 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + + #pragma db load(lazy) + odb::section r; + + #pragma db section(r) + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; +} + +#endif // TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx new file mode 100644 index 0000000..83bd5e7 --- /dev/null +++ b/common/view/olv/test7.hxx @@ -0,0 +1,52 @@ +// file : common/view/olv/test7.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include +#include // unique_ptr + +#include + +// Test explicit conversion to smart pointer member. +// +#pragma db namespace table("t7_") pointer(*) session +namespace test7 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + unique_ptr o2; + unique_ptr o1; + }; +} + +#endif // TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx new file mode 100644 index 0000000..d130b79 --- /dev/null +++ b/common/view/olv/test8.hxx @@ -0,0 +1,49 @@ +// file : common/view/olv/test8.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST8_HXX +#define TEST8_HXX + +#include +#include // unique_ptr + +#include + +// Test loading objects without id. +// +#pragma db namespace table("t8_") pointer(*) session +namespace test8 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object no_id + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + unique_ptr o2; + unique_ptr o1; + }; +} + +#endif // TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx new file mode 100644 index 0000000..18c6c32 --- /dev/null +++ b/common/view/olv/test9.hxx @@ -0,0 +1,79 @@ +// file : common/view/olv/test9.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST9_HXX +#define TEST9_HXX + +#include +#include // shared_ptr + +#include + +// Test loading polymorphic objects. +// +#pragma db namespace table("t9_") session +namespace test9 +{ + using std::shared_ptr; + + #pragma db object polymorphic pointer(shared_ptr) + struct root + { + virtual ~root () {} + root (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct base: root + { + base (int n_ = 0, const char* s_ = ""): root (n_), s (s_) {} + + std::string s; + }; + + #pragma db object + struct derived: base + { + derived (int n_ = 0, const char* s_ = "", bool b_ = false) + : base (n_, s_), b (b_) {} + + bool b; + }; + + // Load via root. + // + #pragma db view object(root) + struct view1r + { + shared_ptr o; + int n; + }; + + // Load via base. + // + #pragma db view object(base) + struct view1b + { + std::string s; + shared_ptr o; + int n; + }; + + // Load via derived. + // + #pragma db view object(derived) + struct view1d + { + std::string s; + shared_ptr o; + int n; + }; +} + +#endif // TEST9_HXX -- cgit v1.1 From a2dee4c3155a5892ea8e09f4d1712e0b60985dea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 13:16:19 +0200 Subject: Add move constructors that VC12 doesn't provide implicitly --- common/view/olv/test1.hxx | 32 ++++++++++++++++++++++++++++++++ common/view/olv/test7.hxx | 6 ++++++ common/view/olv/test8.hxx | 6 ++++++ 3 files changed, 44 insertions(+) diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index eaec7e1..d07ada4 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -40,12 +41,22 @@ namespace test1 #pragma db view object(object1) object(object2: object1::id == object2::id) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)) {} + std::unique_ptr o2; }; #pragma db view object(object1) object(object2: object1::id == object2::id) struct view2 { + // VC12 workaround (no default move constructor generation). + // + view2 () {} + view2 (view2&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + std::unique_ptr o2; std::unique_ptr o1; }; @@ -53,6 +64,11 @@ namespace test1 #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) struct view3 { + // VC12 workaround (no default move constructor generation). + // + view3 () {} + view3 (view3&& x): o1 (std::move (x.o1)), o2 (std::move (x.o2)) {} + std::unique_ptr o1; std::unique_ptr o2; }; @@ -60,6 +76,15 @@ namespace test1 #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) struct view4 { + // VC12 workaround (no default move constructor generation). + // + view4 () {} + view4 (view4&& x): s (std::move (x.s)), + o2 (std::move (x.o2)), + id (x.id), + o1 (std::move (x.o1)), + n (x.n) {} + std::string s; std::unique_ptr o2; @@ -76,6 +101,13 @@ namespace test1 object(object1 = o1b: object1::id == o1b::n) struct view5 { + // VC12 workaround (no default move constructor generation). + // + view5 () {} + view5 (view5&& x): o1a (std::move (x.o1a)), + o2 (std::move (x.o2)), + o1b (std::move (x.o1b)) {} + std::unique_ptr o1a; std::unique_ptr o2; std::unique_ptr o1b; diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index 83bd5e7..dcfac32 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -44,6 +45,11 @@ namespace test7 #pragma db view object(object1) object(object2) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + unique_ptr o2; unique_ptr o1; }; diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index d130b79..23cd82e 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -41,6 +42,11 @@ namespace test8 #pragma db view object(object1) object(object2) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + unique_ptr o2; unique_ptr o1; }; -- cgit v1.1 From d88f15a3c9272dddc53b5fcba6ee04697ec5c82b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 13:17:28 +0200 Subject: Recode strcpy as memcpy VC12 deprecated those hard, as in, it is now an error. --- common/query/array/driver.cxx | 3 ++- mssql/types/test.hxx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index b47fc93..dcbe095 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -7,6 +7,7 @@ #include #include // std::auto_ptr +#include // std::memcpy #include #include @@ -146,7 +147,7 @@ main (int argc, char* argv[]) // #ifdef ODB_CXX11 array a; - strcpy (a.data (), "abc"); + memcpy (a.data (), "abc", 4); // VC++ strcpy deprecation. #ifndef DATABASE_COMMON assert (size (db->query (query::a == a)) == 1); diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 15070e3..aea64cb 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -402,11 +402,11 @@ struct char_array } else { - std::strcpy (ls1, s); - std::strcpy (ls2, s); + std::memcpy (ls1, s, std::strlen (s) + 1); // VC++ strcpy deprecation. + std::memcpy (ls2, s, std::strlen (s) + 1); - std::wcscpy (lws1, ws); - std::wcscpy (lws2, ws); + std::memcpy (lws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + std::memcpy (lws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); } } -- cgit v1.1 From ab8d0180ba3dcaa1e143a3cbad7be0ce6a846493 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 13:19:08 +0200 Subject: Fix incorrect id type --- common/auto/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx index 2a27668..9033a01 100644 --- a/common/auto/driver.cxx +++ b/common/auto/driver.cxx @@ -67,7 +67,7 @@ main (int argc, char* argv[]) // auto_only // { - unsigned long id; + unsigned short id; { auto_only o; -- cgit v1.1 From 903869c797d4365678c928111f818a783fe2bd78 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 14:35:28 +0200 Subject: Use ODB_DATABASE_* macros in headers compiled by ODB On Windows DATABASE_* macros are defined by the project, not via a header. --- common/bulk/test.hxx | 4 ++-- common/view/basics/test.hxx | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 1e7ce52..e390e52 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -5,7 +5,7 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, DATABASE_* +#include // HAVE_CXX11 #include #include // std::auto_ptr, std::unique_ptr @@ -213,7 +213,7 @@ namespace test7 // Test SQL Server optimistic concurrency with ROWVERSION. // -#ifdef DATABASE_MSSQL +#ifdef ODB_DATABASE_MSSQL #pragma db namespace table("t8_") namespace test8 { diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 87c4d76..fbe90ee 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -5,8 +5,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // DATABASE_* - #include #include #include // std::size_t @@ -546,7 +544,7 @@ namespace test2 odb::nullable id2; }; -#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) +#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) struct vright @@ -557,9 +555,9 @@ namespace test2 #endif -#if !defined(DATABASE_MYSQL) && \ - !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_COMMON) +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_COMMON) #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) struct vfull -- cgit v1.1 From 6b140db71e9c400d2f7fc5edda55c1636ca0f6b5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 14:36:53 +0200 Subject: Add _SCL_SECURE_NO_WARNINGS to VC12 projects for Boost tests There doesn't seem to be any other way since this is now an error, not a warning. --- boost/common/template/template-vc12.vcxproj | 8 ++++---- boost/mssql/template/template-vc12.vcxproj | 8 ++++---- boost/mysql/template/template-vc12.vcxproj | 8 ++++---- boost/oracle/template/template-vc12.vcxproj | 8 ++++---- boost/pgsql/template/template-vc12.vcxproj | 8 ++++---- boost/sqlite/template/template-vc12.vcxproj | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/boost/common/template/template-vc12.vcxproj b/boost/common/template/template-vc12.vcxproj index 3b6b9eb..fd147f7 100644 --- a/boost/common/template/template-vc12.vcxproj +++ b/boost/common/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true diff --git a/boost/mssql/template/template-vc12.vcxproj b/boost/mssql/template/template-vc12.vcxproj index 79e369f..e0cb56f 100644 --- a/boost/mssql/template/template-vc12.vcxproj +++ b/boost/mssql/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true diff --git a/boost/mysql/template/template-vc12.vcxproj b/boost/mysql/template/template-vc12.vcxproj index d1c9c5a..e7d70bc 100644 --- a/boost/mysql/template/template-vc12.vcxproj +++ b/boost/mysql/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true diff --git a/boost/oracle/template/template-vc12.vcxproj b/boost/oracle/template/template-vc12.vcxproj index 554b44a..0b942bc 100644 --- a/boost/oracle/template/template-vc12.vcxproj +++ b/boost/oracle/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true diff --git a/boost/pgsql/template/template-vc12.vcxproj b/boost/pgsql/template/template-vc12.vcxproj index 0808d77..acbfc37 100644 --- a/boost/pgsql/template/template-vc12.vcxproj +++ b/boost/pgsql/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true diff --git a/boost/sqlite/template/template-vc12.vcxproj b/boost/sqlite/template/template-vc12.vcxproj index 119a1c0..034b16c 100644 --- a/boost/sqlite/template/template-vc12.vcxproj +++ b/boost/sqlite/template/template-vc12.vcxproj @@ -92,7 +92,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -109,7 +109,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -128,7 +128,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true @@ -149,7 +149,7 @@ MaxSpeed true true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) $(SolutionDir)\..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) true -- cgit v1.1 From 769d02def3524a0f0e21869e7f2c57d9bb046332 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 15:02:32 +0200 Subject: Clean test templates of old cruft Most tests don't print anything --- boost/common/template/driver.cxx | 3 --- boost/common/template/test.std | 1 - boost/mssql/template/driver.cxx | 3 --- boost/mssql/template/test.std | 1 - boost/mysql/template/driver.cxx | 3 --- boost/mysql/template/test.std | 1 - boost/oracle/template/driver.cxx | 3 --- boost/oracle/template/test.std | 1 - boost/pgsql/template/driver.cxx | 3 --- boost/pgsql/template/test.std | 1 - boost/sqlite/template/driver.cxx | 3 --- boost/sqlite/template/test.std | 1 - common/template/driver.cxx | 3 --- common/template/test.std | 1 - mssql/template/driver.cxx | 3 --- mssql/template/test.std | 1 - mysql/template/driver.cxx | 3 --- mysql/template/test.std | 1 - oracle/template/driver.cxx | 3 --- oracle/template/test.std | 1 - pgsql/template/driver.cxx | 3 --- pgsql/template/test.std | 1 - qt/common/template/driver.cxx | 3 --- qt/common/template/test.std | 1 - qt/mssql/template/driver.cxx | 3 --- qt/mssql/template/test.std | 1 - qt/mysql/template/driver.cxx | 3 --- qt/mysql/template/test.std | 1 - qt/oracle/template/driver.cxx | 3 --- qt/oracle/template/test.std | 1 - qt/pgsql/template/driver.cxx | 3 --- qt/pgsql/template/test.std | 1 - qt/sqlite/template/driver.cxx | 3 --- qt/sqlite/template/test.std | 1 - sqlite/template/driver.cxx | 3 --- sqlite/template/test.std | 1 - 36 files changed, 72 deletions(-) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 15ad4da..c84c7ae 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/common/template/test.std b/boost/common/template/test.std index af8d8e7..e69de29 100644 --- a/boost/common/template/test.std +++ b/boost/common/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 648bf1d..920161e 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/mssql/template/test.std b/boost/mssql/template/test.std index af8d8e7..e69de29 100644 --- a/boost/mssql/template/test.std +++ b/boost/mssql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index d077287..c37c624 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/mysql/template/test.std b/boost/mysql/template/test.std index af8d8e7..e69de29 100644 --- a/boost/mysql/template/test.std +++ b/boost/mysql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index 7aeb4a5..1884b49 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/oracle/template/test.std b/boost/oracle/template/test.std index af8d8e7..e69de29 100644 --- a/boost/oracle/template/test.std +++ b/boost/oracle/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 5dc428a..927ac04 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/pgsql/template/test.std b/boost/pgsql/template/test.std index af8d8e7..e69de29 100644 --- a/boost/pgsql/template/test.std +++ b/boost/pgsql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index de470c6..285f6d8 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/boost/sqlite/template/test.std b/boost/sqlite/template/test.std index af8d8e7..e69de29 100644 --- a/boost/sqlite/template/test.std +++ b/boost/sqlite/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 43de3eb..4cb1e7a 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -27,9 +27,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/common/template/test.std b/common/template/test.std index af8d8e7..e69de29 100644 --- a/common/template/test.std +++ b/common/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index aec5c21..8a9bec7 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -28,9 +28,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/mssql/template/test.std b/mssql/template/test.std index af8d8e7..e69de29 100644 --- a/mssql/template/test.std +++ b/mssql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index a1b45cb..c8358b1 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -28,9 +28,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/mysql/template/test.std b/mysql/template/test.std index af8d8e7..e69de29 100644 --- a/mysql/template/test.std +++ b/mysql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index f0e9771..6051439 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -28,9 +28,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/oracle/template/test.std b/oracle/template/test.std index af8d8e7..e69de29 100644 --- a/oracle/template/test.std +++ b/oracle/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 33e2289..e57f14a 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -28,9 +28,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/pgsql/template/test.std b/pgsql/template/test.std index af8d8e7..e69de29 100644 --- a/pgsql/template/test.std +++ b/pgsql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 9432f59..7d3c067 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/common/template/test.std b/qt/common/template/test.std index af8d8e7..e69de29 100644 --- a/qt/common/template/test.std +++ b/qt/common/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 52d580f..9bc1804 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/mssql/template/test.std b/qt/mssql/template/test.std index af8d8e7..e69de29 100644 --- a/qt/mssql/template/test.std +++ b/qt/mssql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index 2cf6c4a..9d5cf37 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/mysql/template/test.std b/qt/mysql/template/test.std index af8d8e7..e69de29 100644 --- a/qt/mysql/template/test.std +++ b/qt/mysql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index a3bb67e..1c37926 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/oracle/template/test.std b/qt/oracle/template/test.std index af8d8e7..e69de29 100644 --- a/qt/oracle/template/test.std +++ b/qt/oracle/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 1b55683..0b99fba 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/pgsql/template/test.std b/qt/pgsql/template/test.std index af8d8e7..e69de29 100644 --- a/qt/pgsql/template/test.std +++ b/qt/pgsql/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 03f45ed..1d90748 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -31,9 +31,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/qt/sqlite/template/test.std b/qt/sqlite/template/test.std index af8d8e7..e69de29 100644 --- a/qt/sqlite/template/test.std +++ b/qt/sqlite/template/test.std @@ -1 +0,0 @@ -test 001 diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index 7a8438c..c7b9390 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -28,9 +28,6 @@ main (int argc, char* argv[]) { auto_ptr db (create_specific_database (argc, argv)); - // - // - cout << "test 001" << endl; { transaction t (db->begin ()); t.commit (); diff --git a/sqlite/template/test.std b/sqlite/template/test.std index af8d8e7..e69de29 100644 --- a/sqlite/template/test.std +++ b/sqlite/template/test.std @@ -1 +0,0 @@ -test 001 -- cgit v1.1 From f040f28940c3d9d29f1ba3ff6280a98433012351 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 15:24:47 +0200 Subject: More ODB_DATABASE_*/DATABASE_* macro fixes --- common/bulk/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index e390e52..85cb5c3 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -213,7 +213,7 @@ namespace test7 // Test SQL Server optimistic concurrency with ROWVERSION. // -#ifdef ODB_DATABASE_MSSQL +#if defined(ODB_DATABASE_MSSQL) || defined(DATABASE_MSSQL) #pragma db namespace table("t8_") namespace test8 { -- cgit v1.1 From f0f3a9c838acbef3131633bd2fd3f1e0571a9f3e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 15:47:02 +0200 Subject: Fix incorrect vector indexes --- common/bulk/driver.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index f1b624e..a6ae973 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1115,9 +1115,9 @@ main (int argc, char* argv[]) std::vector v (fill (4)); v[0].id = 1; - v[2].id = 2; - v[3].id = 3; - v[4].id = 4; + v[1].id = 2; + v[2].id = 3; + v[3].id = 4; // persist @@ -1133,9 +1133,9 @@ main (int argc, char* argv[]) v[3].v != 0); //cerr << v[0].v << endl - // << v[0].v << endl - // << v[0].v << endl - // << v[0].v << endl; + // << v[1].v << endl + // << v[2].v << endl + // << v[3].v << endl; } // update -- cgit v1.1 From 928376e3396addc09576276c3c7e97614665e9ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Feb 2015 16:16:03 +0200 Subject: Fix name qualification --- common/bulk/driver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index a6ae973..06bd06c 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -32,7 +32,7 @@ template ::value_type #else - typename T = typename details::meta::remove_pointer::result + typename T = typename odb::details::meta::remove_pointer::result #endif > struct element_traits; -- cgit v1.1 From f62e8a5c930eb975d209359c9da93ca7de179f1e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Feb 2015 16:16:34 +0200 Subject: Correct stored procedure name --- mssql/stored-proc/test.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index 8537096..56616c1 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -51,7 +51,7 @@ struct objects_min_max unsigned int num_max; }; -#pragma db view query("EXEC insert_object (?)") +#pragma db view query("EXEC insert_object_id (?)") struct insert_object {}; #pragma db view query("EXEC insert_object_id_odb (?)") -- cgit v1.1 From 647b604fb0d68d9921e1457ebaaf70a244e22d81 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Feb 2015 16:17:00 +0200 Subject: Add explicit template argument to lazy_ptr::object_id() call VC++11 does not support default function template arguments. --- common/view/olv/driver.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index b6483eb..f378f84 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -261,14 +261,16 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); view1a v (db->query_value ()); - assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + // VC11 + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); t.commit (); } { transaction t (db->begin ()); view1b v (db->query_value ()); - assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + // VC11 + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); t.commit (); } @@ -292,14 +294,16 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); view2a v (db->query_value ()); - assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + // VC11 + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); t.commit (); } { transaction t (db->begin ()); view2b v (db->query_value ()); - assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + // VC11 + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); t.commit (); } } -- cgit v1.1 From ae6efed243e2ba2a611014707368de6a86d74940 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Jun 2015 13:22:36 +0200 Subject: Support for inverse on points_to --- common/inverse/driver.cxx | 79 +++++++++++++++++++++++++++++++++++++++++++++++ common/inverse/test.hxx | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index a4a0fc8..ed02509 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -325,6 +325,85 @@ main (int argc, char* argv[]) } } #endif + + // Test inverse based on points_to. + // + { + using namespace test3; + + { + obj1 o1 (1, 2); + o1.o2 = new obj2; + + { + transaction t (db->begin ()); + + o1.o2->o1 = db->persist (o1); + db->persist (o1.o2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + auto_ptr p (db->load (o1.id)); + assert (p->o2->id == o1.o2->id); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + auto_ptr p (db->query_one (query::o2->o1.i == o1.id.i && + query::o2->o1.j == o1.id.j)); + assert (p->o2->id == o1.o2->id); + + t.commit (); + } + } + + { + obj3 o3; + o3.o4.push_back (new obj4); + o3.o4.push_back (new obj4); + + { + transaction t (db->begin ()); + + o3.o4[0]->o3 = o3.o4[1]->o3 = db->persist (o3); + db->persist (o3.o4[0]); + db->persist (o3.o4[1]); + + t.commit (); + } + + { + transaction t (db->begin ()); + + auto_ptr p (db->load (o3.id)); + assert (p->o4[0]->id == o3.o4[0]->id); + assert (p->o4[1]->id == o3.o4[1]->id); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + auto_ptr p (db->query_one (query::id == o3.id)); + assert (p->o4[0]->id == o3.o4[0]->id); + assert (p->o4[1]->id == o3.o4[1]->id); + + t.commit (); + } + } + } } catch (const odb::exception& e) { diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index a245084..52a525d 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -232,4 +232,83 @@ namespace test2 } #endif +// Test inverse based on points_to. +// +#pragma db namespace table("t3_") +namespace test3 +{ + // Inverse pointer. + // + #pragma db value + struct comp + { + int i; + int j; + }; + + inline bool + operator< (comp x, comp y) {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + struct obj2; + + #pragma db object + struct obj1 + { + #pragma db id + comp id; + + #pragma db inverse(o1) + obj2* o2; + + obj1 (int i = 0, int j = 0): o2 (0) {id.i = i; id.j = j;} + ~obj1 (); + }; + + #pragma db object + struct obj2 + { + #pragma db id auto + int id; + + #pragma db points_to(obj1) on_delete(cascade) + comp o1; + }; + + inline obj1:: + ~obj1 () {delete o2;} + + // Inverse container of pointers. + // + struct obj4; + + #pragma db object + struct obj3 + { + #pragma db id auto + int id; + + #pragma db inverse(o3) + std::vector o4; + + ~obj3 (); + }; + + #pragma db object + struct obj4 + { + #pragma db id auto + int id; + + #pragma db points_to(obj3) + int o3; + }; + + inline obj3:: + ~obj3 () + { + for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) + delete *i; + } +}; + #endif // TEST_HXX -- cgit v1.1 From b92d2fd35052373476fd392238695fe145ef49c2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Jun 2015 08:19:25 +0200 Subject: Implement support for nested members in inverse pragma --- common/inverse/driver.cxx | 90 +++++++++++++++++++++++++++++++++++++++++++++++ common/inverse/test.hxx | 88 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+) diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index ed02509..08fd78c 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -404,6 +404,96 @@ main (int argc, char* argv[]) } } } + + // Test inverse with nested data members. + // + { + using namespace test4; + + { + obj1 o1; + o1.o2 = new obj2; + + { + transaction t (db->begin ()); + + o1.o2->id.i = db->persist (o1); + o1.o2->id.j = 123; + db->persist (o1.o2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + auto_ptr p (db->load (o1.id)); + assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + auto_ptr p (db->query_one ( + query::o2->id.i == o1.o2->id.i && + query::o2->id.j == o1.o2->id.j)); + assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); + + t.commit (); + } + } + + { + obj3 o3; + o3.o4.push_back (new obj4); + o3.o4.push_back (new obj4); + + { + transaction t (db->begin ()); + + o3.o4[0]->id.i = o3.o4[1]->id.i = db->persist (o3); + o3.o4[0]->id.j = 123; + o3.o4[1]->id.j = 234; + db->persist (o3.o4[0]); + db->persist (o3.o4[1]); + + t.commit (); + } + + { + transaction t (db->begin ()); + + auto_ptr p (db->load (o3.id)); + assert (p->o4[0]->id.i == o3.o4[0]->id.i && + p->o4[0]->id.j == o3.o4[0]->id.j); + + assert (p->o4[1]->id.i == o3.o4[1]->id.i && + p->o4[1]->id.j == o3.o4[1]->id.j); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + auto_ptr p (db->query_one (query::id == o3.id)); + + assert (p->o4[0]->id.i == o3.o4[0]->id.i && + p->o4[0]->id.j == o3.o4[0]->id.j); + + assert (p->o4[1]->id.i == o3.o4[1]->id.i && + p->o4[1]->id.j == o3.o4[1]->id.j); + + t.commit (); + } + } + } } catch (const odb::exception& e) { diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 52a525d..6dfedda 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -311,4 +311,92 @@ namespace test3 } }; +// Test inverse with nested data members. +// +#pragma db namespace table("t4_") +namespace test4 +{ + // Inverse pointer. + // + struct obj1; + struct obj2; + + #pragma db value + struct obj2_id + { + #pragma db points_to(obj1) + int i; + int j; + }; + + inline bool + operator< (obj2_id x, obj2_id y) + {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + #pragma db object + struct obj1 + { + #pragma db id auto + int id; + + #pragma db inverse(id.i) + obj2* o2; + + obj1 (): o2 (0) {} + ~obj1 (); + }; + + #pragma db object + struct obj2 + { + #pragma db id + obj2_id id; + }; + + inline obj1:: + ~obj1 () {delete o2;} + + // Inverse container of pointers. + // + struct obj3; + struct obj4; + + #pragma db value + struct obj4_id + { + #pragma db points_to(obj3) + int i; + int j; + }; + + inline bool + operator< (obj4_id x, obj4_id y) + {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + #pragma db object + struct obj3 + { + #pragma db id auto + int id; + + #pragma db inverse(id.i) + std::vector o4; + + ~obj3 (); + }; + + #pragma db object + struct obj4 + { + #pragma db id + obj4_id id; + }; + + inline obj3:: + ~obj3 () + { + for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) + delete *i; + } +}; #endif // TEST_HXX -- cgit v1.1 From 510038e4743e7e5983fe1e552f066582449293d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 1 Jul 2015 19:20:25 +0200 Subject: C++ type mapping support for data members --- common/as/driver.cxx | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++ common/as/makefile | 118 ++++++++++++++++++++++++++++++ common/as/test.hxx | 159 +++++++++++++++++++++++++++++++++++++++++ common/as/test.std | 0 common/makefile | 1 + 5 files changed, 476 insertions(+) create mode 100644 common/as/driver.cxx create mode 100644 common/as/makefile create mode 100644 common/as/test.hxx create mode 100644 common/as/test.std diff --git a/common/as/driver.cxx b/common/as/driver.cxx new file mode 100644 index 0000000..ff65344 --- /dev/null +++ b/common/as/driver.cxx @@ -0,0 +1,198 @@ +// file : common/as/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test C++ type mapping (#pragma map type as ...). +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test basic type mapping functionality. + // + { + using namespace test1; + + object o1 (true, 123, 234); + o1.m[false] = 123; + o1.v.push_back (o1.ip); + + object o2 (false, 234, 456); + o2.m[true] = 234; + o2.v.push_back (o2.ip); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.b = false; + o1.ip.first++; + o1.ip.second--; + o1.m[false]++; + o1.m[true] = 234; + o1.v.back () = o1.ip; + + o2.b = true; + o2.ip.first--; + o2.ip.second++; + o2.m[true]--; + o2.m[false] = 345; + o2.v.push_back (o2.ip); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test wrapped simple type mapping. + // + { + using namespace test2; + + object o1; + object o2; + o2.b = true; + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->b == o1.b); + assert (p2->b == o2.b); + } + + o1.b = false; + o2.b.reset (); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->b == o1.b); + assert (p2->b == o2.b); + } + } + + // Test wrapped composite type mapping. + // + { + using namespace test3; + + object o1; + o1.ip = intp (0, 0); // NULL + + object o2; + o2.np = intp (123, 234); + o1.ip = intp (234, 123); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->np == o1.np && p1->ip == o1.ip); + assert (p2->np == o2.np && p2->ip == o2.ip); + } + + o1.np = intp (234, 456); + o1.ip = intp (456, 234); + + o2.np.reset (); + o2.ip = intp (0, 0); // NULL + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->np == o1.np && p1->ip == o1.ip); + assert (p2->np == o2.np && p2->ip == o2.ip); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/as/makefile b/common/as/makefile new file mode 100644 index 0000000..6a1b135 --- /dev/null +++ b/common/as/makefile @@ -0,0 +1,118 @@ +# file : common/as/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix as_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8projs,../template/template,$(name)) + $(call meta-vc9projs,../template/template,$(name)) + $(call meta-vc10projs,../template/template,$(name)) + $(call meta-vc11projs,../template/template,$(name)) + $(call meta-vc12projs,../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/as/test.hxx b/common/as/test.hxx new file mode 100644 index 0000000..4839f18 --- /dev/null +++ b/common/as/test.hxx @@ -0,0 +1,159 @@ +// file : common/as/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // pair + +#include +#include + +// Test basic type mapping functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + typedef std::pair intp; + + #pragma db value + struct comp + { + comp () {} + comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} + + int n1; + int n2; + }; + + #pragma db map type(intp) as(comp) \ + to(test1::comp ((?).first, (?).second)) \ + from(test1::intp ((?).n1, (?).n2)) + + #pragma db object + struct object + { + // Class-scope mapping. + // + #pragma db map type(bool) as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") + + #pragma db id auto + unsigned long id; + + bool b; + intp ip; + + #pragma db transient + std::map m; + + #pragma db transient + std::vector v; + + object () {} + object (bool b_, int n1, int n2): b (b_), ip (n1, n2) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return x.b == y.b && x.ip == y.ip /*&& x.m == y.m && x.v == y.v*/; + } +} + +// Test wrapped simple type mapping. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db map type(bool) as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") + + typedef odb::nullable null_bool; + typedef odb::nullable null_string; + + /* + #pragma db map type(null_bool) as(null_string) \ + to((?) \ + ? test2::null_string (*(?) ? "true" : "false") \ + : test2::null_string ()) \ + from((?) \ + ? test2::null_bool (*(?) == "true") \ + : test2::null_bool ()) + */ + + #pragma db map type(null_bool) as(std::string) \ + to((?) ? (*(?) ? "true" : "false") : "null") \ + from((?) != "null" \ + ? test2::null_bool ((?) == "true") \ + : test2::null_bool ()) + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + odb::nullable b; + }; +} + +// Test wrapped simple type mapping. +// +#pragma db namespace table("t3_") +namespace test3 +{ + typedef std::pair intp; + + #pragma db value + struct comp + { + comp () {} + comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} + + int n1; + int n2; + }; + + typedef odb::nullable null_intp; + typedef odb::nullable null_comp; + + #pragma db map type(null_intp) as(null_comp) \ + to((?) \ + ? test3::null_comp (test3::comp ((?)->first, (?)->second)) \ + : test3::null_comp ()) \ + from((?) \ + ? test3::null_intp (test3::intp ((?)->n1, (?)->n2)) \ + : test3::null_intp ()) + + // Map int pair with both members equal 0 to NULL comp. + // + #pragma db map type(intp) as(null_comp) \ + to((?).first != 0 || (?).second != 0 \ + ? test3::null_comp (test3::comp ((?).first, (?).second)) \ + : test3::null_comp ()) \ + from((?) \ + ? test3::intp (test3::intp ((?)->n1, (?)->n2)) \ + : test3::intp (0, 0)) + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + odb::nullable np; + intp ip; + }; +} + +//@@ Test wrapped id and version. +//@@ Containers. + +#endif // TEST_HXX diff --git a/common/as/test.std b/common/as/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index d7d134e..1e57ed4 100644 --- a/common/makefile +++ b/common/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ access \ +as \ auto \ blob \ bulk \ -- cgit v1.1 From cae4da2e3e061ec9cb3e244908db36816085e2fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2015 11:44:57 +0200 Subject: C++ type mapping support for container elements --- common/as/driver.cxx | 49 ++++++++++++++++++++++++++++++++------------ common/as/test.hxx | 57 +++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 84 insertions(+), 22 deletions(-) diff --git a/common/as/driver.cxx b/common/as/driver.cxx index ff65344..6305922 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -33,13 +33,17 @@ main (int argc, char* argv[]) { using namespace test1; - object o1 (true, 123, 234); + object o1 (true, green, 123, 234); o1.m[false] = 123; o1.v.push_back (o1.ip); + o1.cv.push_back (red); + o1.cv.push_back (green); - object o2 (false, 234, 456); + object o2 (false, blue, 234, 456); o2.m[true] = 234; o2.v.push_back (o2.ip); + o2.cv.push_back (green); + o2.cv.push_back (blue); { transaction t (db->begin ()); @@ -59,18 +63,23 @@ main (int argc, char* argv[]) } o1.b = false; + o1.c = blue; o1.ip.first++; o1.ip.second--; o1.m[false]++; o1.m[true] = 234; o1.v.back () = o1.ip; + o1.cv.modify_front () = green; + o1.cv.push_back (red); o2.b = true; + o2.c = red; o2.ip.first--; o2.ip.second++; o2.m[true]--; o2.m[false] = 345; o2.v.push_back (o2.ip); + o2.cv.pop_back (); { transaction t (db->begin ()); @@ -96,8 +105,13 @@ main (int argc, char* argv[]) using namespace test2; object o1; + o1.v.push_back (null_bool ()); + o1.v.push_back (false); + object o2; o2.b = true; + o2.v.push_back (true); + o2.v.push_back (null_bool ()); { transaction t (db->begin ()); @@ -112,12 +126,16 @@ main (int argc, char* argv[]) auto_ptr p2 (db->load (o2.id)); t.commit (); - assert (p1->b == o1.b); - assert (p2->b == o2.b); + assert (*p1 == o1); + assert (*p2 == o2); } o1.b = false; + o1.v[0] = true; + o1.v[1].reset (); + o2.b.reset (); + o2.v.push_back (false); { transaction t (db->begin ()); @@ -132,8 +150,8 @@ main (int argc, char* argv[]) auto_ptr p2 (db->load (o2.id)); t.commit (); - assert (p1->b == o1.b); - assert (p2->b == o2.b); + assert (*p1 == o1); + assert (*p2 == o2); } } @@ -144,10 +162,14 @@ main (int argc, char* argv[]) object o1; o1.ip = intp (0, 0); // NULL + o1.npv.push_back (o1.np); + o1.ipv.push_back (o1.ip); object o2; o2.np = intp (123, 234); o1.ip = intp (234, 123); + o2.npv.push_back (o2.np); + o2.ipv.push_back (o2.ip); { transaction t (db->begin ()); @@ -162,15 +184,16 @@ main (int argc, char* argv[]) auto_ptr p2 (db->load (o2.id)); t.commit (); - assert (p1->np == o1.np && p1->ip == o1.ip); - assert (p2->np == o2.np && p2->ip == o2.ip); + assert (*p1 == o1); + assert (*p2 == o2); } - o1.np = intp (234, 456); - o1.ip = intp (456, 234); + o1.np = o1.npv[0] = intp (234, 456); + o1.ip = o1.ipv.modify_at (0) = intp (456, 234); o2.np.reset (); - o2.ip = intp (0, 0); // NULL + o2.npv[0].reset (); + o2.ip = o2.ipv.modify_at (0) = intp (0, 0); // NULL { transaction t (db->begin ()); @@ -185,8 +208,8 @@ main (int argc, char* argv[]) auto_ptr p2 (db->load (o2.id)); t.commit (); - assert (p1->np == o1.np && p1->ip == o1.ip); - assert (p2->np == o2.np && p2->ip == o2.ip); + assert (*p1 == o1); + assert (*p2 == o2); } } } diff --git a/common/as/test.hxx b/common/as/test.hxx index 4839f18..676f599 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -11,6 +11,7 @@ #include // pair #include +#include #include // Test basic type mapping functionality. @@ -18,6 +19,24 @@ #pragma db namespace table("t1_") namespace test1 { + enum color {red, green, blue}; + + inline const char* + color_to_string (color c) + { + return c == red ? "RED" : (c == green ? "GREEN" : "BLUE"); + } + + inline color + string_to_color (const std::string& s) + { + return s == "RED" ? red : (s == "GREEN" ? green : blue); + } + + #pragma db map type(color) as(std::string) \ + to(test1::color_to_string (?)) \ + from(test1::string_to_color (?)) + typedef std::pair intp; #pragma db value @@ -40,29 +59,34 @@ namespace test1 // Class-scope mapping. // #pragma db map type(bool) as(std::string) \ - to((?) ? "true" : "false") \ - from((?) == "true") + to((?) ? "true" : "false") \ + from((?) == "true") #pragma db id auto unsigned long id; bool b; + color c; intp ip; - #pragma db transient std::map m; - - #pragma db transient std::vector v; + odb::vector cv; object () {} - object (bool b_, int n1, int n2): b (b_), ip (n1, n2) {} + object (bool b_, color c_, int n1, int n2): b (b_), c (c_), ip (n1, n2) {} }; inline bool operator== (const object& x, const object y) { - return x.b == y.b && x.ip == y.ip /*&& x.m == y.m && x.v == y.v*/; + return + x.b == y.b && + x.c == y.c && + x.ip == y.ip && + x.m == y.m && + x.v == y.v && + x.cv == y.cv; } } @@ -101,7 +125,14 @@ namespace test2 unsigned long id; odb::nullable b; + std::vector > v; }; + + inline bool + operator== (const object& x, const object y) + { + return x.b == y.b && x.v == y.v; + } } // Test wrapped simple type mapping. @@ -150,10 +181,18 @@ namespace test3 odb::nullable np; intp ip; + + std::vector > npv; + odb::vector ipv; }; + + inline bool + operator== (const object& x, const object y) + { + return x.np == y.np && x.ip == y.ip && x.npv == y.npv && x.ipv == y.ipv; + } } -//@@ Test wrapped id and version. -//@@ Containers. +//@@ Test wrapped id and version. With container, obj-ptr. #endif // TEST_HXX -- cgit v1.1 From d13c76c39ddbedb4122f02e2c2bc168f1cb1cf20 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2015 15:00:48 +0200 Subject: Test custom C++ type mapping for id, version members --- common/as/driver.cxx | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++ common/as/test.hxx | 75 +++++++++++++++++++++++++++++- 2 files changed, 200 insertions(+), 1 deletion(-) diff --git a/common/as/driver.cxx b/common/as/driver.cxx index 6305922..72ddb10 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -212,6 +212,132 @@ main (int argc, char* argv[]) assert (*p2 == o2); } } + + // Test id type mapping. + // + { + using namespace test4; + + object o1 (123); + o1.v.push_back (1); + o1.v.push_back (2); + o1.v.push_back (3); + + object o2 (234); + o2.v.push_back (3); + o2.v.push_back (2); + o2.v.push_back (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.i++; + o1.v.pop_back (); + o1.v.modify_front ()++; + + o2.i--; + o2.v.clear (); + o2.v.push_back (4); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test version type mapping. + // + { + using namespace test5; + + object o1 (100, 123); + object o2 (200, 234); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + + assert (*p1 == o1); + assert (*p2 == o2); + + p1->i--; + p2->i++; + + db->update (*p1); + db->update (*p2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + for (;;) + { + o1.i++; + o2.i--; + + try + { + + db->update (o1); + db->update (o2); + break; + } + catch (const odb::object_changed&) + { + db->reload (o1); + db->reload (o2); + } + } + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } } catch (const odb::exception& e) { diff --git a/common/as/test.hxx b/common/as/test.hxx index 676f599..12822bb 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -193,6 +193,79 @@ namespace test3 } } -//@@ Test wrapped id and version. With container, obj-ptr. +// Test id type mapping. +// +struct id_type +{ + typedef unsigned long value_type; + value_type value; + + id_type (value_type v = 0): value (v) {} + operator value_type () const {return value;} +}; + +#pragma db map type(id_type) as(id_type::value_type) + +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + #pragma db id auto + id_type id; + + int i; + odb::vector v; + + object () {} + object (int i_): i (i_) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return x.id == y.id && x.i == y.i && x.v == y.v; + } +} + +// Test version type mapping. +// +#pragma db namespace table("t5_") +namespace test5 +{ + struct version_type + { + typedef unsigned short value_type; + value_type value; + + version_type (value_type v = 0): value (v) {} + operator value_type () const {return value;} + version_type& operator++ () {value++; return *this;} + }; + + #pragma db map type(version_type) as(id_type::value_type) + + #pragma db object optimistic + struct object + { + #pragma db id + id_type id; + + #pragma db version + version_type v; + + int i; + + object () {} + object (id_type id_, int i_): id (id_), i (i_) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return x.id == y.id && x.v == y.v && x.i == y.i; + } +} #endif // TEST_HXX -- cgit v1.1 From 547db267d28b0cde50166c67c74d5d99ef32acd4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Jul 2015 16:04:43 +0200 Subject: Disable on_delete test for MySQL --- common/inverse/test.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 6dfedda..d5f1da8 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -270,8 +270,12 @@ namespace test3 #pragma db id auto int id; - #pragma db points_to(obj1) on_delete(cascade) + #pragma db points_to(obj1) comp o1; + +#ifndef ODB_DATABASE_MYSQL + #pragma db member(o1) on_delete(cascade) +#endif }; inline obj1:: -- cgit v1.1 From db1bec04ae8b70281c61ffc468126445a612ae28 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Jul 2015 16:05:14 +0200 Subject: Test custom id column name propagation to polymorphic-ref's --- common/inheritance/polymorphism/test1.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index ae3dfa0..1110ee3 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -23,7 +23,7 @@ namespace test1 root () {} root (unsigned long i, unsigned long n): id (i), num (n) {} - #pragma db id + #pragma db id column("object_id") unsigned long id; unsigned long num; -- cgit v1.1 From 0d65234bc5c6742721c00360a0e3117d51d89c5f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 3 Jul 2015 18:23:51 +0200 Subject: Implement nested id support Now the 'id' specifier can optionally include the data member path to the id inside the composite value. For example: #pragma db id(first) std::pair p; Note that one somewhat counter-intuitive aspect of this new feature is that the whole member marked with id ('p' in the above example) and not just the actual id member ('p.first' in the above example) is treated as readonly. Such nested id also cannot be automatically assigned (auto specifier). --- common/auto/driver.cxx | 95 ------ common/auto/makefile | 117 ------- common/auto/test.hxx | 41 --- common/auto/test.std | 0 common/composite-id/driver.cxx | 730 ----------------------------------------- common/composite-id/makefile | 118 ------- common/composite-id/test.hxx | 520 ----------------------------- common/composite-id/test.std | 0 common/id/auto/driver.cxx | 95 ++++++ common/id/auto/makefile | 118 +++++++ common/id/auto/test.hxx | 41 +++ common/id/auto/test.std | 0 common/id/composite/driver.cxx | 730 +++++++++++++++++++++++++++++++++++++++++ common/id/composite/makefile | 118 +++++++ common/id/composite/test.hxx | 520 +++++++++++++++++++++++++++++ common/id/composite/test.std | 0 common/id/nested/driver.cxx | 265 +++++++++++++++ common/id/nested/makefile | 118 +++++++ common/id/nested/test.hxx | 218 ++++++++++++ common/id/nested/test.std | 0 common/makefile | 5 +- 21 files changed, 2226 insertions(+), 1623 deletions(-) delete mode 100644 common/auto/driver.cxx delete mode 100644 common/auto/makefile delete mode 100644 common/auto/test.hxx delete mode 100644 common/auto/test.std delete mode 100644 common/composite-id/driver.cxx delete mode 100644 common/composite-id/makefile delete mode 100644 common/composite-id/test.hxx delete mode 100644 common/composite-id/test.std create mode 100644 common/id/auto/driver.cxx create mode 100644 common/id/auto/makefile create mode 100644 common/id/auto/test.hxx create mode 100644 common/id/auto/test.std create mode 100644 common/id/composite/driver.cxx create mode 100644 common/id/composite/makefile create mode 100644 common/id/composite/test.hxx create mode 100644 common/id/composite/test.std create mode 100644 common/id/nested/driver.cxx create mode 100644 common/id/nested/makefile create mode 100644 common/id/nested/test.hxx create mode 100644 common/id/nested/test.std diff --git a/common/auto/driver.cxx b/common/auto/driver.cxx deleted file mode 100644 index 9033a01..0000000 --- a/common/auto/driver.cxx +++ /dev/null @@ -1,95 +0,0 @@ -// file : common/auto/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test automatic id assignment. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // object - // - { - unsigned long id1, id2, id3; - { - object o1 ("one"); - object o2 ("two"); - object o3 ("three"); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - - id1 = o1.id_; - id2 = o2.id_; - id3 = o3.id_; - - assert (id1 != id2); - assert (id1 != id3); - assert (id2 != id3); - } - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); - auto_ptr o3 (db->load (id3)); - t.commit (); - - assert (o1->id_ == id1 && o1->str_ == "one"); - assert (o2->id_ == id2 && o2->str_ == "two"); - assert (o3->id_ == id3 && o3->str_ == "three"); - } - } - - // auto_only - // - { - unsigned short id; - { - auto_only o; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - id = o.id_; - } - - { - transaction t (db->begin ()); - auto_ptr o (db->load (id)); - t.commit (); - - assert (o->id_ == id); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/auto/makefile b/common/auto/makefile deleted file mode 100644 index a8562c2..0000000 --- a/common/auto/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/auto/makefile -# copyright : Copyright (c) 2009-2015 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --table-prefix auto_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/auto/test.hxx b/common/auto/test.hxx deleted file mode 100644 index 0052bee..0000000 --- a/common/auto/test.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/auto/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - object (const std::string& str) - : id_ (1), str_ (str) - { - } - - #pragma db auto id - unsigned long id_; - std::string str_; - -private: - object () - { - } - - friend class odb::access; -}; - -// Test the case where the object has just the auto id. -// -#pragma db object -struct auto_only -{ - #pragma db auto id pgsql:type("BIGINT") - unsigned short id_; -}; - -#endif // TEST_HXX diff --git a/common/auto/test.std b/common/auto/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx deleted file mode 100644 index 3137fe1..0000000 --- a/common/composite-id/driver.cxx +++ /dev/null @@ -1,730 +0,0 @@ -// file : common/composite-id/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -// Test composite object ids. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - // Test 1. - // - { - using namespace test1; - - object o1 (scomp ("aaa", "bbb", "ccc"), 123); - o1.vec.push_back (scomp ("xxx", "xxx", "xxx")); - o1.vec.push_back (scomp ("yyy", "yyy", "yyy")); - - object o2 (scomp ("aaa", "bbb", "ccd"), 234); - o2.vec.push_back (scomp ("zzz", "", "zzz")); - - object o3 (scomp ("baa", "bbb", "ccc"), 345); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p3 == o3); - } - - // Update. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); - p->num++; - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); - t.commit (); - - assert (p->num == o1.num + 1); - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (o1.id); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->find (o1.id)); - assert (p.get () == 0); - t.commit (); - } - } - - // Test 2. - // - { - using namespace test2; - - object2 o2 (ncomp (2, 0, 1)); - o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); - - object3 o3 (ncomp (3, 0, 1)); - o3.o1.push_back (new object1 (scomp ("o1", "o3", "aaa"))); - o3.o1.push_back (new object1 (scomp ("o1", "o3", "bbb"))); - - object4 o4 (ncomp (4, 0, 1)); - o4.c.o2 = new object2 (ncomp (2, 4, 1)); - o4.c.o2->o1 = new object1 (scomp ("o1", "o2", "ccc")); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1); - db->persist (o2); - db->persist (o3.o1[0]); - db->persist (o3.o1[1]); - db->persist (o3); - db->persist (o4.c.o2->o1); - db->persist (o4.c.o2); - db->persist (o4); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); - auto_ptr p4 (db->load (o4.id)); - t.commit (); - - assert (p2->o1->id == o2.o1->id); - assert (p3->o1.size () == o3.o1.size ()); - assert (p3->o1[0]->id == o3.o1[0]->id); - assert (p3->o1[1]->id == o3.o1[1]->id); - assert (p4->c.o2->id == o4.c.o2->id); - assert (p4->c.o2->o1->id == o4.c.o2->o1->id); - } - - // Update. - // - { - scomp id2, id3; - - { - transaction t (db->begin ()); - - auto_ptr p2 (db->load (o2.id)); - delete p2->o1; - p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); - id2 = db->persist (p2->o1); - db->update (*p2); - - auto_ptr p3 (db->load (o3.id)); - delete p3->o1.back (); - p3->o1.pop_back (); - p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); - id3 = db->persist (p3->o1.back ()); - db->update (*p3); - - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2->o1->id == id2); - assert (p3->o1.back ()->id == id3); - } - } - - // Query. - // - { - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result r (db->query (query::o1->id.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.id); - assert (++i == r.end ()); - } - - { - // As id (dual interface). - // - result r (db->query (query::o1.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.id); - assert (++i == r.end ()); - } - - t.commit (); - } - - // Second level composite object pointer. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::c.o2->o1.str3 == "ccc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o4.id); - assert (++i == r.end ()); - - t.commit (); - } - } - - // View. - // - { - transaction t (db->begin ()); - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query (query::object2::id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - } - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query ((query::object3::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "ccc"); - assert (++i == r.end ()); - } - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query (query::object4::id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num4 == 1 && i->num2 == 1 && i->str == "ccc"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // Test 3. - // - { - using namespace test3; - - object2 o2 (ncomp (2, 0, 1)); - o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); - o2.o1->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1->o2->id == o2.id); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - session s; - - result r (db->query (query::o2->id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.o1->id); - - i->o2->o1 = 0; - delete i->o2; - - assert (++i == r.end ()); - } - - t.commit (); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object1::id.str2 == "o2")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 4. - // - { - using namespace test4; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2 = &o2; - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - assert (p2->o1[0]->o2->id == o2.id); - assert (p2->o1[1]->o2->id == o2.id); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - session s; - - result r (db->query (query::o2->id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.o1[0]->id); - i->o2->o1.clear (); - - assert (++i != r.end ()); - assert (i->id == o2.o1[1]->id); - - i->o2->o1.clear (); - delete i->o2; - - assert (++i == r.end ()); - } - - t.commit (); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object1::id.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 5. - // - { - using namespace test5; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2 = &o2; - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - - assert (p2->o1[0]->id == o2.o1[0]->id); - assert (p2->o1[0]->o2->id == o2.id); - - assert (p2->o1[1]->id == o2.o1[1]->id); - assert (p2->o1[1]->o2->id == o2.id); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ((query::object2::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 6. - // - { - using namespace test6; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2.push_back (&o2); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2.push_back (&o2); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - - assert (p2->o1[0]->id == o2.o1[0]->id); - assert (p2->o1[0]->o2[0]->id == o2.id); - - assert (p2->o1[1]->id == o2.o1[1]->id); - assert (p2->o1[1]->o2[0]->id == o2.id); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ((query::object2::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 7. - // - { - using namespace test7; - - object o (scomp ("aaa", "bbb", "ccc"), 123); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); - t.commit (); - - assert (*p == o); - } - - // Update. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); - p->num++; - db->update (*p); - - try - { - db->update (o); - assert (false); - } - catch (const object_changed&) - { - } - - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); - t.commit (); - - assert (p->num == o.num + 1); - } - - // Erase. - // - { - transaction t (db->begin ()); - - try - { - db->update (o); - assert (false); - } - catch (const object_changed&) - { - } - - t.commit (); - } - } - - // Test 8. - // - { - using namespace test8; - - object2 o2a, o2b; - object3 o3; - - o2b.o1 = new object1 (scomp ("222", "aaa", "bbb"), 123); - o3.o1.push_back (0); - o3.o1.push_back (new object1 (scomp ("333", "aaa", "bbb"), 234)); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2a); - db->persist (o2b); - db->persist (o2b.o1); - db->persist (o3); - db->persist (o3.o1[1]); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p2a (db->load (o2a.id)); - auto_ptr p2b (db->load (o2b.id)); - auto_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2a->o1 == 0); - assert (p2b->o1 != 0 && *p2b->o1 == *o2b.o1); - assert (p3->o1[0] == 0); - assert (p3->o1[1] != 0 && *p3->o1[1] == *o3.o1[1]); - } - - // Update. - // - { - object1* o1 (o3.o1[1]); - - o3.o1.clear (); - o3.o1.push_back (o2b.o1); - o3.o1.push_back (0); - - o2a.o1 = o1; - o2b.o1 = 0; - - transaction t (db->begin ()); - db->update (o2a); - db->update (o2b); - db->update (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p2a (db->load (o2a.id)); - auto_ptr p2b (db->load (o2b.id)); - auto_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); - assert (p2b->o1 == 0); - assert (p3->o1[0] != 0 && *p3->o1[0] == *o3.o1[0]); - assert (p3->o1[1] == 0); - } - } - - // Test 9. - { - using namespace test9; - - object o (123, "abc"); - o.v.push_back (123); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - result r (db->query ()); - result::iterator i (r.begin ()); - assert (i != r.end () && o == *i && ++i == r.end ()); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/composite-id/makefile b/common/composite-id/makefile deleted file mode 100644 index 4c8a655..0000000 --- a/common/composite-id/makefile +++ /dev/null @@ -1,118 +0,0 @@ -# file : common/composite-id/makefile -# copyright : Copyright (c) 2009-2015 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix t_comp_id_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx deleted file mode 100644 index 427a162..0000000 --- a/common/composite-id/test.hxx +++ /dev/null @@ -1,520 +0,0 @@ -// file : common/composite-id/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db value -struct scomp -{ - scomp () {} - scomp (const std::string& s1, const std::string& s2, const std::string& s3) - : str1 (s1), str2 (s2), str3 (s3) - { - } - - std::string str1; - std::string str2; - std::string str3; -}; - -inline bool -operator== (const scomp& x, const scomp& y) -{ - return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; -} - -inline bool -operator< (const scomp& x, const scomp& y) -{ - return x.str1 < y.str1 || - (x.str1 == y.str1 && x.str2 < y.str2) || - (x.str1 == y.str1 && x.str2 == y.str2 && x.str3 < y.str3); -} - -#pragma db value -struct ncomp -{ - ncomp () {} - ncomp (unsigned short n1, unsigned short n2, unsigned short n3) - : num1 (n1), num2 (n2), num3 (n3) - { - } - - unsigned short num1; - unsigned short num2; - unsigned short num3; -}; - -inline bool -operator== (const ncomp& x, const ncomp& y) -{ - return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; -} - -inline bool -operator< (const ncomp& x, const ncomp& y) -{ - return x.num1 < y.num1 || - (x.num1 == y.num1 && x.num2 < y.num2) || - (x.num1 == y.num1 && x.num2 == y.num2 && x.num3 < y.num3); -} - -// Test object with composite id, container. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object - struct object - { - object () {} - object (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - unsigned long num; - std::vector vec; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id == y.id && x.num == y.num && x.vec == y.vec; - } -} - -// Test to-one and to-many relationships with composite id as well as -// queries and views. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - }; - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - object2 (const ncomp& i): id (i), o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id - ncomp id; - - object1* o1; - }; - - #pragma db object - struct object3 - { - object3 () {} - object3 (const ncomp& i): id (i) {} - - ~object3 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - std::vector o1; - }; - - // Test second-level query pointer test as well as pointers in - // composite types. - // - #pragma db value - struct comp - { - comp (): o2 (0) {} - ~comp () {delete o2;} - - object2* o2; - }; - - #pragma db object - struct object4 - { - object4 () {} - object4 (const ncomp& i): id (i) {} - - #pragma db id - ncomp id; - - comp c; - }; - - #pragma db view object(object2) object(object1) - struct view2 - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; - - #pragma db view object(object3) object(object1) - struct view3 - { - #pragma db column (object3::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; - - #pragma db view object(object4) object(object2) object(object1) - struct view4 - { - #pragma db column (object4::id.num3) - unsigned short num4; - - #pragma db column (object2::id.num3) - unsigned short num2; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test one-to-one(i) relationship with composite id. -// -#pragma db namespace table("t3_") -namespace test3 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - #pragma db inverse(o1) - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - object2 (const ncomp& i): id (i), o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id - ncomp id; - - object1* o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test many-to-one(i) relationship with composite id. -// -#pragma db namespace table("t4_") -namespace test4 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - #pragma db inverse(o1) - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test one-to-many(i) relationship with composite id. -// -#pragma db namespace table("t5_") -namespace test5 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - #pragma db inverse(o2) - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test many-to-many(i) relationship with composite id. -// -#pragma db namespace table("t6_") -namespace test6 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - std::vector o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - #pragma db inverse(o2) - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test object with composite id and version (optimistic concurrency). -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object optimistic - struct object - { - object () {} - object (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - #pragma db version - unsigned long ver; - - unsigned long num; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id == y.id && x.ver == y.ver && x.num == y.num; - } -} - -// Test composite NULL pointers. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - unsigned long num; - }; - - inline bool - operator== (const object1& x, const object1& y) - { - return x.id == y.id && x.num == y.num; - } - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id auto - unsigned long id; - - object1* o1; - }; - - #pragma db object - struct object3 - { - ~object3 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id auto - unsigned long id; - - std::vector o1; - }; -} - -// Test composite id definition inside object. -// -#pragma db namespace table("t9_") -namespace test9 -{ - #pragma db object - struct object - { - object (unsigned long n = 0, const std::string& s = "") - { - id_.num = n; - id_.str = s; - } - - unsigned long num () const {return id_.num;} - const std::string& str () const {return id_.str;} - - std::vector v; - - private: - friend class odb::access; - - #pragma db value - struct comp - { - unsigned long num; - std::string str; - - bool - operator< (const comp& x) const - { - return num < x.num || (num == x.num && str < x.str); - } - }; - - #pragma db id - comp id_; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.num () == y.num () && x.str () == y.str () && x.v == y.v; - } -} - - -#endif // TEST_HXX diff --git a/common/composite-id/test.std b/common/composite-id/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx new file mode 100644 index 0000000..76ed756 --- /dev/null +++ b/common/id/auto/driver.cxx @@ -0,0 +1,95 @@ +// file : common/id/auto/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test automatic id assignment. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // object + // + { + unsigned long id1, id2, id3; + { + object o1 ("one"); + object o2 ("two"); + object o3 ("three"); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = o1.id_; + id2 = o2.id_; + id3 = o3.id_; + + assert (id1 != id2); + assert (id1 != id3); + assert (id2 != id3); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (id1)); + auto_ptr o2 (db->load (id2)); + auto_ptr o3 (db->load (id3)); + t.commit (); + + assert (o1->id_ == id1 && o1->str_ == "one"); + assert (o2->id_ == id2 && o2->str_ == "two"); + assert (o3->id_ == id3 && o3->str_ == "three"); + } + } + + // auto_only + // + { + unsigned short id; + { + auto_only o; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + id = o.id_; + } + + { + transaction t (db->begin ()); + auto_ptr o (db->load (id)); + t.commit (); + + assert (o->id_ == id); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/id/auto/makefile b/common/id/auto/makefile new file mode 100644 index 0000000..760719a --- /dev/null +++ b/common/id/auto/makefile @@ -0,0 +1,118 @@ +# file : common/id/auto/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema \ +--table-prefix t_id_auto_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx new file mode 100644 index 0000000..1605cfe --- /dev/null +++ b/common/id/auto/test.hxx @@ -0,0 +1,41 @@ +// file : common/id/auto/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object (const std::string& str) + : id_ (1), str_ (str) + { + } + + #pragma db auto id + unsigned long id_; + std::string str_; + +private: + object () + { + } + + friend class odb::access; +}; + +// Test the case where the object has just the auto id. +// +#pragma db object +struct auto_only +{ + #pragma db auto id pgsql:type("BIGINT") + unsigned short id_; +}; + +#endif // TEST_HXX diff --git a/common/id/auto/test.std b/common/id/auto/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx new file mode 100644 index 0000000..0df4c98 --- /dev/null +++ b/common/id/composite/driver.cxx @@ -0,0 +1,730 @@ +// file : common/id/composite/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test composite object ids. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + // Test 1. + // + { + using namespace test1; + + object o1 (scomp ("aaa", "bbb", "ccc"), 123); + o1.vec.push_back (scomp ("xxx", "xxx", "xxx")); + o1.vec.push_back (scomp ("yyy", "yyy", "yyy")); + + object o2 (scomp ("aaa", "bbb", "ccd"), 234); + o2.vec.push_back (scomp ("zzz", "", "zzz")); + + object o3 (scomp ("baa", "bbb", "ccc"), 345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id)); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p3 == o3); + } + + // Update. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o1.id)); + p->num++; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o1.id)); + t.commit (); + + assert (p->num == o1.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (o1.id); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->find (o1.id)); + assert (p.get () == 0); + t.commit (); + } + } + + // Test 2. + // + { + using namespace test2; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + + object3 o3 (ncomp (3, 0, 1)); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "aaa"))); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "bbb"))); + + object4 o4 (ncomp (4, 0, 1)); + o4.c.o2 = new object2 (ncomp (2, 4, 1)); + o4.c.o2->o1 = new object1 (scomp ("o1", "o2", "ccc")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + db->persist (o3.o1[0]); + db->persist (o3.o1[1]); + db->persist (o3); + db->persist (o4.c.o2->o1); + db->persist (o4.c.o2); + db->persist (o4); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + auto_ptr p4 (db->load (o4.id)); + t.commit (); + + assert (p2->o1->id == o2.o1->id); + assert (p3->o1.size () == o3.o1.size ()); + assert (p3->o1[0]->id == o3.o1[0]->id); + assert (p3->o1[1]->id == o3.o1[1]->id); + assert (p4->c.o2->id == o4.c.o2->id); + assert (p4->c.o2->o1->id == o4.c.o2->o1->id); + } + + // Update. + // + { + scomp id2, id3; + + { + transaction t (db->begin ()); + + auto_ptr p2 (db->load (o2.id)); + delete p2->o1; + p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); + id2 = db->persist (p2->o1); + db->update (*p2); + + auto_ptr p3 (db->load (o3.id)); + delete p3->o1.back (); + p3->o1.pop_back (); + p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); + id3 = db->persist (p3->o1.back ()); + db->update (*p3); + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2->o1->id == id2); + assert (p3->o1.back ()->id == id3); + } + } + + // Query. + // + { + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::o1->id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + { + // As id (dual interface). + // + result r (db->query (query::o1.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + t.commit (); + } + + // Second level composite object pointer. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::c.o2->o1.str3 == "ccc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o4.id); + assert (++i == r.end ()); + + t.commit (); + } + } + + // View. + // + { + transaction t (db->begin ()); + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object2::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query ((query::object3::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object4::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num4 == 1 && i->num2 == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // Test 3. + // + { + using namespace test3; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + o2.o1->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1->id); + + i->o2->o1 = 0; + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str2 == "o2")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 4. + // + { + using namespace test4; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + assert (p2->o1[0]->o2->id == o2.id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1[0]->id); + i->o2->o1.clear (); + + assert (++i != r.end ()); + assert (i->id == o2.o1[1]->id); + + i->o2->o1.clear (); + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 5. + // + { + using namespace test5; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 6. + // + { + using namespace test6; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2.push_back (&o2); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2.push_back (&o2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + auto_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2[0]->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2[0]->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 7. + // + { + using namespace test7; + + object o (scomp ("aaa", "bbb", "ccc"), 123); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p == o); + } + + // Update. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + p->num++; + db->update (*p); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (p->num == o.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + } + + // Test 8. + // + { + using namespace test8; + + object2 o2a, o2b; + object3 o3; + + o2b.o1 = new object1 (scomp ("222", "aaa", "bbb"), 123); + o3.o1.push_back (0); + o3.o1.push_back (new object1 (scomp ("333", "aaa", "bbb"), 234)); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2a); + db->persist (o2b); + db->persist (o2b.o1); + db->persist (o3); + db->persist (o3.o1[1]); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p2a (db->load (o2a.id)); + auto_ptr p2b (db->load (o2b.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 == 0); + assert (p2b->o1 != 0 && *p2b->o1 == *o2b.o1); + assert (p3->o1[0] == 0); + assert (p3->o1[1] != 0 && *p3->o1[1] == *o3.o1[1]); + } + + // Update. + // + { + object1* o1 (o3.o1[1]); + + o3.o1.clear (); + o3.o1.push_back (o2b.o1); + o3.o1.push_back (0); + + o2a.o1 = o1; + o2b.o1 = 0; + + transaction t (db->begin ()); + db->update (o2a); + db->update (o2b); + db->update (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p2a (db->load (o2a.id)); + auto_ptr p2b (db->load (o2b.id)); + auto_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); + assert (p2b->o1 == 0); + assert (p3->o1[0] != 0 && *p3->o1[0] == *o3.o1[0]); + assert (p3->o1[1] == 0); + } + } + + // Test 9. + { + using namespace test9; + + object o (123, "abc"); + o.v.push_back (123); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end () && o == *i && ++i == r.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/id/composite/makefile b/common/id/composite/makefile new file mode 100644 index 0000000..4f0f44e --- /dev/null +++ b/common/id/composite/makefile @@ -0,0 +1,118 @@ +# file : common/id/composite/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--generate-session --table-prefix t_id_comp_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx new file mode 100644 index 0000000..e7a0424 --- /dev/null +++ b/common/id/composite/test.hxx @@ -0,0 +1,520 @@ +// file : common/id/composite/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db value +struct scomp +{ + scomp () {} + scomp (const std::string& s1, const std::string& s2, const std::string& s3) + : str1 (s1), str2 (s2), str3 (s3) + { + } + + std::string str1; + std::string str2; + std::string str3; +}; + +inline bool +operator== (const scomp& x, const scomp& y) +{ + return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; +} + +inline bool +operator< (const scomp& x, const scomp& y) +{ + return x.str1 < y.str1 || + (x.str1 == y.str1 && x.str2 < y.str2) || + (x.str1 == y.str1 && x.str2 == y.str2 && x.str3 < y.str3); +} + +#pragma db value +struct ncomp +{ + ncomp () {} + ncomp (unsigned short n1, unsigned short n2, unsigned short n3) + : num1 (n1), num2 (n2), num3 (n3) + { + } + + unsigned short num1; + unsigned short num2; + unsigned short num3; +}; + +inline bool +operator== (const ncomp& x, const ncomp& y) +{ + return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; +} + +inline bool +operator< (const ncomp& x, const ncomp& y) +{ + return x.num1 < y.num1 || + (x.num1 == y.num1 && x.num2 < y.num2) || + (x.num1 == y.num1 && x.num2 == y.num2 && x.num3 < y.num3); +} + +// Test object with composite id, container. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object () {} + object (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + std::vector vec; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.num == y.num && x.vec == y.vec; + } +} + +// Test to-one and to-many relationships with composite id as well as +// queries and views. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + }; + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (const ncomp& i): id (i) {} + + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + // Test second-level query pointer test as well as pointers in + // composite types. + // + #pragma db value + struct comp + { + comp (): o2 (0) {} + ~comp () {delete o2;} + + object2* o2; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (const ncomp& i): id (i) {} + + #pragma db id + ncomp id; + + comp c; + }; + + #pragma db view object(object2) object(object1) + struct view2 + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object3) object(object1) + struct view3 + { + #pragma db column (object3::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object4) object(object2) object(object1) + struct view4 + { + #pragma db column (object4::id.num3) + unsigned short num4; + + #pragma db column (object2::id.num3) + unsigned short num2; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-one(i) relationship with composite id. +// +#pragma db namespace table("t3_") +namespace test3 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-one(i) relationship with composite id. +// +#pragma db namespace table("t4_") +namespace test4 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-many(i) relationship with composite id. +// +#pragma db namespace table("t5_") +namespace test5 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-many(i) relationship with composite id. +// +#pragma db namespace table("t6_") +namespace test6 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + std::vector o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test object with composite id and version (optimistic concurrency). +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object optimistic + struct object + { + object () {} + object (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + #pragma db version + unsigned long ver; + + unsigned long num; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.ver == y.ver && x.num == y.num; + } +} + +// Test composite NULL pointers. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + }; + + inline bool + operator== (const object1& x, const object1& y) + { + return x.id == y.id && x.num == y.num; + } + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id auto + unsigned long id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id auto + unsigned long id; + + std::vector o1; + }; +} + +// Test composite id definition inside object. +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object + struct object + { + object (unsigned long n = 0, const std::string& s = "") + { + id_.num = n; + id_.str = s; + } + + unsigned long num () const {return id_.num;} + const std::string& str () const {return id_.str;} + + std::vector v; + + private: + friend class odb::access; + + #pragma db value + struct comp + { + unsigned long num; + std::string str; + + bool + operator< (const comp& x) const + { + return num < x.num || (num == x.num && str < x.str); + } + }; + + #pragma db id + comp id_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.num () == y.num () && x.str () == y.str () && x.v == y.v; + } +} + + +#endif // TEST_HXX diff --git a/common/id/composite/test.std b/common/id/composite/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx new file mode 100644 index 0000000..28dac6a --- /dev/null +++ b/common/id/nested/driver.cxx @@ -0,0 +1,265 @@ +// file : common/id/nested/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test nested ids. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + + // Simple nested id. + // + { + using namespace test1; + + object o1 (1, "a", 3); + o1.v.push_back (123); + + object o2 (4, "b", 6); + o2.v.push_back (234); + + object1 o (new object (10, "abc", 11)); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o.p); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + + o1.z++; + o1.v.pop_back (); + o1.v.push_back (234); + + o2.z--; + o2.v.back ()++; + o2.v.push_back (123); + + delete o.p; + o.p = new object (20, "xyz", 11); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->persist (o.p); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + } + + // Composite nested id. + // + { + using namespace test2; + + object o1 (1, 2, "a", 123); + o1.v.push_back (123); + + object o2 (1, 3, "b", 234); + o2.v.push_back (234); + + object1 o (new object (2, 2, "abc", 123)); + o.p->v.push_back (345); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o.p); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.c)); + auto_ptr p2 (db->load (o2.id.c)); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + + o1.z++; + o1.v.pop_back (); + o1.v.push_back (234); + + o2.z--; + o2.v.modify_back ()++; + o2.v.push_back (123); + + delete o.p; + o.p = new object (2, 3, "xyz", 234); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->persist (o.p); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.c)); + auto_ptr p2 (db->load (o2.id.c)); + auto_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + } + + // Custom/by-value access. + // + { + using namespace test3; + + object o1 (1, "a", 3); + object o2 (4, "b", 6); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.z++; + o2.z--; + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Polymorphic. + // + { + using namespace test4; + + base o1 (1, "a"); + object o2 (2, "b", 1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o2.z--; + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (o1.id.y)); + auto_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/common/id/nested/makefile b/common/id/nested/makefile new file mode 100644 index 0000000..c2e5b0e --- /dev/null +++ b/common/id/nested/makefile @@ -0,0 +1,118 @@ +# file : common/id/nested/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --generate-schema --generate-query \ +--table-prefix t_id_nested_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +ifneq ($(db_id),common) +$(gen): odb_options += --database $(db_id) +else +$(gen): odb_options += --multi-database dynamic +endif + +$(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): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(name) +$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ +$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ +$(call vc12projs,$(name)) +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../../template/Makefile.am) + $(call meta-vc8projs,../../template/template,$(name)) + $(call meta-vc9projs,../../template/template,$(name)) + $(call meta-vc10projs,../../template/template,$(name)) + $(call meta-vc11projs,../../template/template,$(name)) + $(call meta-vc12projs,../../template/template,$(name)) + +# Test. +# +ifneq ($(db_id),common) +$(eval $(call test-rule)) +else +$(foreach d,$(databases),$(eval $(call test-rule,$d))) +endif + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx new file mode 100644 index 0000000..6449fd4 --- /dev/null +++ b/common/id/nested/test.hxx @@ -0,0 +1,218 @@ +// file : common/id/nested/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include + +// Simple nested id. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db value + struct comp + { + int x; + std::string y; + }; + + #pragma db object + struct object + { + #pragma db id(y) + comp id; + + int z; + std::vector v; + + object () {} + object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z && a.v == b.v; + } + + #pragma db object + struct object1 + { + #pragma db id auto + int id; + + object* p; + + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + }; + + inline bool + operator== (const object1& a, const object1& b) + { + return a.id == b.id && *a.p == *b.p; + } +} + +// Composite nested id. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct comp1 + { + int x; + int y; + }; + + #pragma db value + struct comp2 + { + comp1 c; + std::string s; + }; + + #pragma db object + struct object + { + #pragma db id(c) + comp2 id; + + int z; + odb::vector v; + + object () {} + object (int x, int y, std::string s, int z_) + : z (z_) {id.c.x = x; id.c.y = y; id.s = s;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.c.x == b.id.c.x && a.id.c.y == b.id.c.y && + a.id.s == b.id.s && a.z == b.z && a.v == b.v; + } + + #pragma db object + struct object1 + { + #pragma db id auto + int id; + + object* p; + + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + }; + + inline bool + operator== (const object1& a, const object1& b) + { + return a.id == b.id && *a.p == *b.p; + } + + // Multiple levels of nesting, just a compile test. + // + #pragma db object + struct object2 + { + #pragma db id(c.x) + comp2 id; + + int z; + }; +} + +// Custom/by-value access. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct comp + { + int x; + + std::string get_y () const {return y;} + void set_y (std::string v) {y = v;} + + #pragma db get(get_y) set(set_y) + std::string y; + }; + + #pragma db object + struct object + { + comp get_id () const {return id;} + void set_id (comp v) {id = v;} + + #pragma db id(y) get(get_id) set(set_id) + comp id; + + int z; + + object () {} + object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; + } +} + +// Polymorphic. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db value + struct comp + { + int x; + std::string y; + }; + + #pragma db object polymorphic + struct base + { + #pragma db id(y) + comp id; + + virtual ~base () {} + base () {} + base (int x, std::string y) {id.x = x; id.y = y;} + }; + + inline bool + operator== (const base& a, const base& b) + { + return a.id.x == b.id.x && a.id.y == b.id.y; + } + + #pragma db object + struct object: base + { + int z; + + object () {} + object (int x, std::string y, int z_): base (x, y), z (z_) {} + }; + + inline bool + operator== (const object& a, const object& b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; + } +} + +#endif // TEST_HXX diff --git a/common/id/nested/test.std b/common/id/nested/test.std new file mode 100644 index 0000000..e69de29 diff --git a/common/makefile b/common/makefile index 1e57ed4..b3b2bac 100644 --- a/common/makefile +++ b/common/makefile @@ -7,7 +7,6 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ access \ as \ -auto \ blob \ bulk \ callback \ @@ -15,7 +14,6 @@ changelog \ circular/single \ circular/multiple \ composite \ -composite-id \ const-object \ const-member \ container/basics \ @@ -25,6 +23,9 @@ default \ definition \ enum \ erase-query \ +id/auto \ +id/composite \ +id/nested \ include \ index \ inheritance/polymorphism \ -- cgit v1.1 From 0a2b28b4034a6b44f7bb7a126935d9e58cc0c1f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Jul 2015 18:43:03 +0200 Subject: Implement SQLite incremental BLOB/TEXT I/O --- common/statement/processing/driver.cxx | 6 +- sqlite/makefile | 1 + sqlite/stream/driver.cxx | 280 +++++++++++++++++++++++++++++++++ sqlite/stream/makefile | 108 +++++++++++++ sqlite/stream/test.hxx | 38 +++++ sqlite/stream/test.std | 0 sqlite/template/makefile | 1 + 7 files changed, 431 insertions(+), 3 deletions(-) create mode 100644 sqlite/stream/driver.cxx create mode 100644 sqlite/stream/makefile create mode 100644 sqlite/stream/test.hxx create mode 100644 sqlite/stream/test.std diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index e6e37f3..414897f 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -21,7 +21,7 @@ insert (const char* stmt, { string r; odb::statement::process_insert ( - stmt, bind, bind_size, sizeof (void*), '$', r); + r, stmt, bind, bind_size, sizeof (void*), '$'); return r == expected; } @@ -33,7 +33,7 @@ update (const char* stmt, { string r; odb::statement::process_update ( - stmt, bind, bind_size, sizeof (void*), '$', r); + r, stmt, bind, bind_size, sizeof (void*), '$'); return r == expected; } @@ -45,7 +45,7 @@ select (const char* stmt, { string r; odb::statement::process_select ( - stmt, bind, bind_size, sizeof (void*), '[', ']', true, r); + r, stmt, bind, bind_size, sizeof (void*), '[', ']', true); return r == expected; } diff --git a/sqlite/makefile b/sqlite/makefile index 99cc6d2..0515772 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -9,6 +9,7 @@ template \ custom \ database \ native \ +stream \ transaction \ truncation \ types diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx new file mode 100644 index 0000000..5f708ba --- /dev/null +++ b/sqlite/stream/driver.cxx @@ -0,0 +1,280 @@ +// file : sqlite/stream/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQLite BLOB/TEXT incremental I/O. +// + +#include +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +template +void +print (const S&) +{ + /* + cerr << s.db () << '.' + << s.table () << '.' + << s.column () << '#' + << s.rowid () << endl; + */ +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + string txt (1024 * 1024, 't'); + vector blb (1024 * 1024, 'b'); + + object o; + + { + transaction tx (db->begin ()); + + o.t.size (txt.size ()); + o.b.size (blb.size ()); + o.bv.push_back (blob (blb.size ())); + o.bv.push_back (blob (blb.size ())); + + db->persist (o); + + print (o.t); + print (o.b); + print (o.bv[0]); + print (o.bv[1]); + + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + + for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) + { + blob_stream bs (*i, true); + bs.write (blb.data (), blb.size ()); + } + + tx.commit (); + } + + { + transaction tx (db->begin ()); + auto_ptr p (db->load (o.id)); + + print (p->t); + print (p->b); + print (p->bv[0]); + print (p->bv[1]); + + text_stream ts (p->t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + + blob_stream bs (p->b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) + { + blob_stream bs (*i, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + assert (p->nb.null ()); + + tx.commit (); + } + + txt.resize (txt.size () + 1, 't'); + txt[0] = 'A'; + txt[txt.size () - 1] = 'Z'; + + blb.resize (blb.size () - 1); + blb.front () = 'A'; + blb.back () = 'Z'; + + { + transaction tx (db->begin ()); + + o.t.clear (); + o.t.size (txt.size ()); + + o.b.clear (); + o.b.size (blb.size ()); + + o.bv[0].clear (); + o.bv[0].size (blb.size ()); + + o.bv[1].clear (); + o.bv[1].size (blb.size ()); + + o.nb = blob (blb.size ()); + + db->update (o); + + print (o.t); + print (o.b); + print (o.bv[0]); + print (o.bv[1]); + print (*o.nb); + + { + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + } + + { + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + } + + for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) + { + blob_stream bs (*i, true); + bs.write (blb.data (), blb.size ()); + } + + { + blob_stream bs (*o.nb, true); + bs.write (blb.data (), blb.size ()); + } + + tx.commit (); + } + + { + transaction tx (db->begin ()); + auto_ptr p (db->load (o.id)); + + print (p->t); + print (p->b); + print (p->bv[0]); + print (p->bv[1]); + print (*p->nb); + + text_stream ts (p->t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + + blob_stream bs (p->b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) + { + blob_stream bs (*i, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + { + blob_stream bs (*p->nb, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + tx.commit (); + } + + // Test query. + // + + txt.resize (32); + blb.resize (64); + + { + transaction tx (db->begin ()); + + o.t.size (txt.size ()); + o.b.size (blb.size ()); + o.bv.clear (); + o.nb.reset (); + + db->update (o); + + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + + tx.commit (); + } + + { + typedef sqlite::query query; + transaction tx (db->begin ()); + + { + object o1 (db->query_value (query::t == txt)); + + blob_stream bs (o1.b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + { + object o1 (db->query_value (query::b == blb)); + + text_stream ts (o1.t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + } + + tx.commit (); + } + + // Test view. + // + { + typedef sqlite::query query; + transaction tx (db->begin ()); + + view v (db->query_value (query::t == txt)); + + blob_stream bs (v.b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + tx.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile new file mode 100644 index 0000000..5f63159 --- /dev/null +++ b/sqlite/stream/makefile @@ -0,0 +1,108 @@ +# file : sqlite/stream/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-query --generate-schema --table-prefix sqlitex_stream_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-schemaless-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx new file mode 100644 index 0000000..32c29e3 --- /dev/null +++ b/sqlite/stream/test.hxx @@ -0,0 +1,38 @@ +// file : sqlite/stream/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; + + odb::sqlite::text t; + + #pragma db column("_123foo_bar") + odb::sqlite::blob b; + + std::vector bv; + + odb::nullable nb; +}; + +#pragma db view object(object) +struct view +{ + odb::sqlite::blob b; +}; + +#endif // TEST_HXX diff --git a/sqlite/stream/test.std b/sqlite/stream/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 83832b2..4e39a1c 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -30,6 +30,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database sqlite --default-database \ common --generate-schema --table-prefix sqlitex_template_ #@@ CHANGE THIS +# Note: 'x' here is not a typo. $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) -- cgit v1.1 From b1d1e45ef838dff676ed9a519a9d87aa9aedffc7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Jul 2015 14:16:53 +0200 Subject: Handle empty query::in_range() case --- common/query/basics/driver.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index a982901..a9a394d 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -408,6 +408,12 @@ main (int argc, char* argv[]) r = db->query (query::first_name.in_range (names, names_end)); print (r); + // Empty range. + // + r = db->query (query::last_name == "Doe" && + query::first_name.in_range (names, names)); + assert (r.empty ()); + t.commit (); } -- cgit v1.1 From f88348f72d5267f76fb338e3e96a111225cc2ec0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jul 2015 17:20:35 +0200 Subject: Make threads test more deadlock resilient --- common/threads/driver.cxx | 94 ++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index bf12707..2bc1897 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -31,9 +31,9 @@ using namespace std; using namespace odb::core; namespace details = odb::details; -const unsigned long thread_count = 32; -const unsigned long iteration_count = 50; -const unsigned long sub_iteration_count = 20; +const unsigned long thread_count = 24; +const unsigned long iteration_count = 30; +const unsigned long sub_iteration_count = 40; struct task { @@ -51,21 +51,26 @@ struct task { unsigned long id ((n_ * iteration_count + i) * 3); + object o1 (id, "first object"); + object o2 (id + 1, "second object"); + object o3 (id + 2, "third object"); + + // The following transactions may lead to deadlocks. + // + while (true) { - object o1 (id, "first object"); - object o2 (id + 1, "second object"); - object o3 (id + 2, "third object"); - - transaction t (db_.begin ()); - db_.persist (o1); - db_.persist (o2); - db_.persist (o3); - t.commit (); + try + { + transaction t (db_.begin ()); + db_.persist (o1); + db_.persist (o2); + db_.persist (o3); + t.commit (); + break; + } + catch (const deadlock&) {} } - // The following transaction may lead to a deadlock in some database - // implementations (read to write lock upgrade). - // while (true) { try @@ -105,37 +110,50 @@ struct task typedef odb::prepared_query prep_query; typedef odb::result result; - transaction t (db_.begin ()); - - prep_query pq (db_.lookup_query ("object-query")); - - if (!pq) + while (true) { - pq = db_.prepare_query ( - "object-query", query::str == "another value"); - db_.cache_query (pq); - } - - result r (pq.execute (false)); - - bool found (false); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->id_ == id) + try { - found = true; + transaction t (db_.begin ()); + + prep_query pq (db_.lookup_query ("object-query")); + + if (!pq) + { + pq = db_.prepare_query ( + "object-query", query::str == "another value"); + db_.cache_query (pq); + } + + result r (pq.execute (false)); + + bool found (false); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->id_ == id) + { + found = true; + break; + } + } + assert (found); + t.commit (); break; } + catch (const deadlock&) {} } - assert (found); - - t.commit (); } + while (true) { - transaction t (db_.begin ()); - db_.erase (id); - t.commit (); + try + { + transaction t (db_.begin ()); + db_.erase (id); + t.commit (); + break; + } + catch (const deadlock&) {} } } } -- cgit v1.1 From 4672ac30870fb3d8d0a5cdf3faa82291eaa322cb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jul 2015 17:37:10 +0200 Subject: Fix member name conflicts in query support --- common/query/basics/test.hxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 94f4a6e..3e61c57 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -81,4 +81,38 @@ operator<< (std::ostream& os, const person& p) return os; } +// Test member name conflicts (compilation-only test). +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object + { + #pragma db id + int id; + }; + + #pragma db value + struct value + { + object* m_object; + }; + + #pragma db value + struct bar + { + value m_value; + }; + + #pragma db object + struct foo + { + #pragma db id + int id; + + bar m_value; + }; +} + #endif // TEST_HXX -- cgit v1.1 From e3587e1967f6b0a3888ca1d4e075b642ac8f5bb4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 27 Jul 2015 17:43:39 +0200 Subject: Bump version to 2.5.0.a1 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 197c4d5..3a437d9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.4.0 +2.5.0.a1 -- cgit v1.1 From f7980c3b005a6b9680d8f83b852b2e33d6ccf4ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 29 Oct 2015 19:06:16 +0200 Subject: Fix UUID char[16] query_type alias Instead of pre-decaying it to const char*, let the normal decay do it for us. This fixes a compilation issue when used with dynamic multi- database support. --- mssql/types/driver.cxx | 36 ++++++++++++++++++++++++++++++++++-- pgsql/types/driver.cxx | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 09e13c5..90f9708 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -130,11 +130,43 @@ main (int argc, char* argv[]) assert (o == *o1); } - // Test short/long data in queries. - // typedef mssql::query query; typedef odb::result result; + // Test UUID in queries. + // + { + char uuid[16]; + memcpy (uuid, o.uuid_, 16); + + transaction t (db->begin ()); + + { + result r (db->query (query::uuid == uuid)); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_val (uuid))); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_ref (uuid))); + assert (size (r) == 1); + } + + { + const char* d (uuid); + result r (db->query (query::uuid == d)); + assert (size (r) == 1); + } + + t.commit (); + } + + // Test short/long data in queries. + // { transaction t (db->begin ()); diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 35b7278..79e624e 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -86,6 +86,41 @@ main (int argc, char* argv[]) assert (o == *o1); } + typedef pgsql::query query; + typedef odb::result result; + + // Test UUID in queries. + // + { + char uuid[16]; + memcpy (uuid, o.uuid_, 16); + + transaction t (db->begin ()); + + { + result r (db->query (query::uuid == uuid)); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_val (uuid))); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_ref (uuid))); + assert (size (r) == 1); + } + + { + const char* d (uuid); + result r (db->query (query::uuid == d)); + assert (size (r) == 1); + } + + t.commit (); + } + // Test char array. // { -- cgit v1.1 From 6dc09d499ba36f8cdb602e12f71bb4bd8cfbd736 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Nov 2015 18:18:49 +0200 Subject: Bump version to 2.5.0.a2 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 3a437d9..b7f6fd3 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a1 +2.5.0.a2 -- cgit v1.1 From ef5c94107ab8eda8f00308870415e9ebbb6735be Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jan 2016 18:59:12 +0200 Subject: Bump version to 2.5.0.a4 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index b7f6fd3..608404c 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a2 +2.5.0.a4 -- cgit v1.1 From e1a26938a55d7e0bdbfd5a1aa29e4712edb74b23 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 12 Feb 2016 12:11:16 +0200 Subject: Bump version to 2.5.0.a5 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 608404c..9518eae 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a4 +2.5.0.a5 -- cgit v1.1 From 59c2891c0f3dcbc3721539e9bef068954cddd433 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Apr 2016 16:42:20 +0200 Subject: Add _has_cache() custom session interface, use in OLV implementation --- common/session/custom/session.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 29fb4a2..3cb7c24 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -95,6 +95,9 @@ private: // Object cache interface. // public: + static bool + _has_cache () {return current != 0;} + template struct cache_position { -- cgit v1.1 From 841a7704f11b0c670e16e2f7278f9b3bdc6143c5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Apr 2016 14:32:22 +0200 Subject: Bump version to 2.5.0.a6 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 9518eae..5ae477a 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a5 +2.5.0.a6 -- cgit v1.1 From 01ba76036b5d9dbf57a0909869c4811f12ea8bee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 May 2016 21:01:22 +0200 Subject: Ignore section logic when dealing with container elements The container member itself can be in a section. --- common/section/basics/driver.cxx | 31 +++++++++++++++++++++++++++++++ common/section/basics/test.hxx | 29 +++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index bdd5e64..b9fa667 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1694,6 +1694,37 @@ main (int argc, char* argv[]) t.commit (); } } + + // Regression: BLOB in a value type used as a map value that is in a + // section. + // + { + using namespace test19; + + object o; + o.m[1].b.assign (560, 'x'); // Size greater than the default image. + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + // Hold "old" connection to force a new set of statements/image + // buffers. + // + connection_ptr c (db->connection ()); + + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->load (*p, p->s); + assert (p->m[1].b == o.m[1].b); + + t.commit (); + } + } } catch (const odb::exception& e) { diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index 60b69da..9dcb48a 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -597,4 +597,33 @@ namespace test18 }; } +// Regression: BLOB in a value type used as a map value that is in a section. +// +#include +#include + +#pragma db namespace table("t19_") +namespace test19 +{ + #pragma db value + struct value + { + #pragma db type(BLOB_TYPE) + std::vector b; + }; + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(always) + odb::section s; + + #pragma db section(s) + std::map m; + }; +} + #endif // TEST_HXX -- cgit v1.1 From 766b7533addb5c981b135640321c291be270d907 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 May 2016 21:38:08 +0200 Subject: Bump version to 2.5.0.a7 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 5ae477a..c3af3cc 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a6 +2.5.0.a7 -- cgit v1.1 From 72f9ee644d3a048e68ba9570a096b6dd12c5ee1a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Jun 2016 18:50:51 +0200 Subject: Get rid of C++11 deprecation warnings for auto_ptr, exception specs In particular, std::auto_ptr is no longer mapped in C++11. --- common/bulk/driver.cxx | 28 +++--- common/bulk/test.hxx | 26 +++--- common/const-member/test.hxx | 8 ++ common/const-object/driver.cxx | 20 +++++ common/const-object/test.hxx | 11 +++ common/container/change-tracking/driver.cxx | 15 +++- common/container/change-tracking/test.hxx | 4 + common/inheritance/polymorphism/driver.cxx | 110 ++++++++++++++++++++++++ common/inheritance/polymorphism/test5.hxx | 6 ++ common/inheritance/polymorphism/test6.hxx | 10 +++ common/prepared/driver.cxx | 12 ++- common/query/basics/test.hxx | 6 ++ common/readonly/test.hxx | 9 ++ common/wrapper/test.hxx | 4 + evolution/soft-delete/model.hxx | 8 +- mssql/types/test.hxx | 6 ++ oracle/types/driver.cxx | 4 + oracle/types/test.hxx | 7 ++ qt/common/containers/change-tracking/driver.cxx | 12 ++- qt/common/containers/change-tracking/test.hxx | 4 + 20 files changed, 278 insertions(+), 32 deletions(-) diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 06bd06c..d6a294a 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -327,13 +327,6 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } - { - auto_ptr a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - #ifdef HAVE_CXX11 { vector> v; @@ -341,6 +334,13 @@ main (int argc, char* argv[]) v.push_back (unique_ptr (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } +#else + { + auto_ptr a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } #endif { @@ -981,13 +981,6 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } - { - auto_ptr a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - #ifdef HAVE_CXX11 { vector> v; @@ -995,6 +988,13 @@ main (int argc, char* argv[]) v.push_back (unique_ptr (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } +#else + { + auto_ptr a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } #endif { diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 85cb5c3..ce55158 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -32,10 +32,11 @@ namespace test1 std::string s; }; - #pragma db object bulk(3) pointer(std::auto_ptr) - struct auto_object +#ifdef HAVE_CXX11 + #pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object { - auto_object (unsigned int n_ = 0, std::string s_ = "") + unique_object (unsigned int n_ = 0, std::string s_ = "") : id (0), n (n_), s (s_) {} #pragma db id auto @@ -44,12 +45,11 @@ namespace test1 unsigned int n; std::string s; }; - -#ifdef HAVE_CXX11 - #pragma db object bulk(3) pointer(std::unique_ptr) - struct unique_object +#else + #pragma db object bulk(3) pointer(std::auto_ptr) + struct auto_object { - unique_object (unsigned int n_ = 0, std::string s_ = "") + auto_object (unsigned int n_ = 0, std::string s_ = "") : id (0), n (n_), s (s_) {} #pragma db id auto @@ -176,16 +176,16 @@ namespace test6 #pragma db object(object) bulk(3) #pragma db member(object::id) id auto - typedef object_template<2> auto_object; - - #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) - #pragma db member(auto_object::id) id auto - #ifdef HAVE_CXX11 typedef object_template<3> unique_object; #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) #pragma db member(unique_object::id) id auto +#else + typedef object_template<2> auto_object; + + #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) + #pragma db member(auto_object::id) id auto #endif } diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index 1928572..c858bbb 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include #include // std::auto_ptr @@ -102,9 +104,15 @@ struct wrapper #pragma db id unsigned long id; +#ifdef HAVE_CXX11 + const std::unique_ptr str; + const std::unique_ptr com; + const std::unique_ptr> vec; +#else const std::auto_ptr str; const std::auto_ptr com; const std::auto_ptr< const std::vector > vec; +#endif }; #endif // TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 03b9c20..cbe5b72 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -37,10 +37,18 @@ main (int argc, char* argv[]) const obj1* co1 (co1_); a.o1 = co1; +#ifdef HAVE_CXX11 + unique_ptr o2 (new obj2 (1)); +#else auto_ptr o2 (new obj2 (1)); +#endif obj2* co2_ (new obj2 (2)); a.o2.reset (co2_); +#ifdef HAVE_CXX11 + unique_ptr& co2 (a.o2); +#else auto_ptr& co2 (a.o2); +#endif // persist via references // @@ -75,8 +83,15 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr a (db->load (1)); + unique_ptr ca (db->load (2)); +#else auto_ptr a (db->load (1)); auto_ptr ca (db->load (2)); +#endif + t.commit (); assert (a->o1->id == 2); @@ -146,8 +161,13 @@ main (int argc, char* argv[]) { // i->f (); // error i->cf (); +#ifdef HAVE_CXX11 + //unique_ptr p (i.load ()); // error + unique_ptr p (i.load ()); +#else // auto_ptr p (i.load ()); // error auto_ptr p (i.load ()); +#endif obj2 o (0); i.load (o); assert (p->id == o.id); diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 93977f0..2e73d96 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include @@ -21,7 +23,11 @@ struct obj1 void cf () const {} }; +#ifdef HAVE_CXX11 +#pragma db object pointer (std::unique_ptr) +#else #pragma db object pointer (std::auto_ptr) +#endif struct obj2 { obj2 () {} @@ -45,7 +51,12 @@ struct aggr int id; const obj1* o1; + +#ifdef HAVE_CXX11 + std::unique_ptr o2; +#else std::auto_ptr o2; +#endif }; #endif // TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index c5a43a4..3db728c 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -137,7 +137,11 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); +#ifdef HAVE_CXX11 + unique_ptr p (db->load ("1")); +#else auto_ptr p (db->load ("1")); +#endif assert (p->s._tracking ()); t.commit (); } @@ -551,7 +555,11 @@ main (int argc, char* argv[]) // Armed copy. // { +#ifdef HAVE_CXX11 + unique_ptr c; +#else auto_ptr c; +#endif { o.s.pop_back (); @@ -616,7 +624,7 @@ main (int argc, char* argv[]) // #ifdef HAVE_CXX11 { - auto_ptr c; + unique_ptr c; { o.s.pop_back (); @@ -692,8 +700,13 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); +#ifdef HAVE_CXX11 + unique_ptr p1 (db->load (o1.id_)); + unique_ptr p2 (db->load (o2.id_)); +#else auto_ptr p1 (db->load (o1.id_)); auto_ptr p2 (db->load (o2.id_)); +#endif assert (p2->o1[0] == p1.get ()); assert (!p2->o1._tracking ()); t.commit (); diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index bcb6880..0117316 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -18,7 +18,11 @@ #include #include +#ifdef HAVE_CXX11 +#pragma db object pointer(std::unique_ptr) +#else #pragma db object pointer(std::auto_ptr) +#endif struct object { object () {} diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 3eec9b6..acf94d5 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1029,7 +1029,11 @@ main (int argc, char* argv[]) // Root. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (r.id)); +#else auto_ptr p (db->load (r.id)); +#endif r.num++; r.strs.push_back ("aaaa"); @@ -1053,7 +1057,11 @@ main (int argc, char* argv[]) // Base. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (b.id)); +#else auto_ptr p (db->load (b.id)); +#endif b.num++; b.str += "b"; @@ -1081,7 +1089,11 @@ main (int argc, char* argv[]) // Derived. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (d.id)); // Via root. +#else auto_ptr p (db->load (d.id)); // Via root. +#endif d.num++; d.str += "d"; @@ -1145,7 +1157,11 @@ main (int argc, char* argv[]) // Root. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (r.id)); +#else auto_ptr p (db->load (r.id)); +#endif r.num++; r.strs.push_back ("aaaaa"); @@ -1165,7 +1181,11 @@ main (int argc, char* argv[]) // Base. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (b.id)); +#else auto_ptr p (db->load (b.id)); +#endif b.num++; b.str += "b"; @@ -1187,7 +1207,11 @@ main (int argc, char* argv[]) // Derived. // { +#ifdef HAVE_CXX11 + unique_ptr p (db->load (d.id)); // Via root. +#else auto_ptr p (db->load (d.id)); // Via root. +#endif d.num++; d.str += "d"; @@ -1240,7 +1264,12 @@ main (int argc, char* argv[]) using namespace test6; base b (1, 1, "bbb"); + +#ifdef HAVE_CXX11 + unique_ptr d (new derived (2, 2, "ddd")); +#else auto_ptr d (new derived (2, 2, "ddd")); +#endif // Persist. // @@ -1256,8 +1285,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d->id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd (db->load (d->id)); +#endif db->load (b.id, *pb); db->load (d->id, *pd); @@ -1319,7 +1353,12 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr p (db->load (d.id)); +#else auto_ptr p (db->load (d.id)); +#endif t.commit (); } } @@ -1479,9 +1518,15 @@ main (int argc, char* argv[]) // load (id) // +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d1.id)); + unique_ptr pd2 (db->load (d2.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd1 (db->load (d1.id)); auto_ptr pd2 (db->load (d2.id)); +#endif assert (*pb == b); assert (*pd1 == d1); @@ -1563,9 +1608,17 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d1.id)); + unique_ptr pd2 (db->load (d2.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd1 (db->load (d1.id)); auto_ptr pd2 (db->load (d2.id)); +#endif + t.commit (); assert (*pb == b); @@ -1690,6 +1743,16 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr p_ro_r (db->load (ro_r.id)); + unique_ptr p_rw_b (db->load (rw_b.id)); + unique_ptr p_ro_d (db->load (ro_d.id)); + + unique_ptr p_rw_r (db->load (rw_r.id)); + unique_ptr p_ro_b (db->load (ro_b.id)); + unique_ptr p_rw_d (db->load (rw_d.id)); +#else auto_ptr p_ro_r (db->load (ro_r.id)); auto_ptr p_rw_b (db->load (rw_b.id)); auto_ptr p_ro_d (db->load (ro_d.id)); @@ -1697,6 +1760,8 @@ main (int argc, char* argv[]) auto_ptr p_rw_r (db->load (rw_r.id)); auto_ptr p_ro_b (db->load (ro_b.id)); auto_ptr p_rw_d (db->load (rw_d.id)); +#endif + t.commit (); assert (*p_ro_r == ro_r); @@ -1730,8 +1795,14 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd (db->load (d.id)); +#endif t.commit (); assert (*pb == b); @@ -1754,8 +1825,14 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd (db->load (d.id)); +#endif t.commit (); assert (*pb == b); @@ -1790,8 +1867,14 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd (db->load (d.id)); +#endif t.commit (); assert (*pb == b); @@ -1823,8 +1906,15 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); +#else auto_ptr pb (db->load (b.id)); auto_ptr pd (db->load (d.id)); +#endif + t.commit (); assert (*pb == b); @@ -1885,8 +1975,15 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (id1)); + unique_ptr pd (db->load (id2)); +#else auto_ptr pb (db->load (id1)); auto_ptr pd (db->load (id2)); +#endif + t.commit (); assert (*pb == b); @@ -1922,10 +2019,18 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pbr (db->load (b.id)); + unique_ptr pdr (db->load (d.id)); + unique_ptr pdb (db->load (d.id)); + unique_ptr pb1r (db->load (b1.id)); +#else auto_ptr pbr (db->load (b.id)); auto_ptr pdr (db->load (d.id)); auto_ptr pdb (db->load (d.id)); auto_ptr pb1r (db->load (b1.id)); +#endif t.commit (); base& rb (static_cast (*pbr)); @@ -2044,7 +2149,12 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); + +#ifdef HAVE_CXX11 + unique_ptr pb (db->load (d.id)); +#else auto_ptr pb (db->load (d.id)); +#endif t.commit (); derived* pd (dynamic_cast (pb.get ())); diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index e253f6a..78f909f 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -5,6 +5,8 @@ #ifndef TEST5_HXX #define TEST5_HXX +#include // HAVE_CXX11 + #include #include #include @@ -17,7 +19,11 @@ #pragma db namespace table("t5_") namespace test5 { +#ifdef HAVE_CXX11 + #pragma db object polymorphic optimistic pointer(std::unique_ptr) +#else #pragma db object polymorphic optimistic pointer(std::auto_ptr) +#endif struct root { virtual ~root () {} diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index 1682b3f..c12b5f4 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -5,6 +5,8 @@ #ifndef TEST6_HXX #define TEST6_HXX +#include // HAVE_CXX11 + #include #include @@ -16,7 +18,11 @@ #pragma db namespace table("t6_") namespace test6 { +#ifdef HAVE_CXX11 + #pragma db object polymorphic pointer(std::unique_ptr) +#else #pragma db object polymorphic pointer(std::auto_ptr) +#endif struct root { virtual ~root () {} @@ -55,7 +61,11 @@ namespace test6 unsigned long dnum; std::string dstr; +#ifdef HAVE_CXX11 + std::unique_ptr ptr; +#else std::auto_ptr ptr; +#endif void db_callback (odb::callback_event, odb::database&) const; diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 0d30821..0467f70 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -33,13 +33,21 @@ query_factory (const char* name, connection& c) { typedef odb::query query; +#ifdef HAVE_CXX11 + unique_ptr p (new params); +#else auto_ptr p (new params); +#endif prepared_query pq ( c.prepare_query ( name, query::age > query::_ref (p->age) && query::name != query::_ref (p->name))); +#ifdef HAVE_CXX11 + c.cache_query (pq, move (p)); +#else c.cache_query (pq, p); +#endif } int @@ -286,13 +294,13 @@ main (int argc, char* argv[]) { typedef odb::query query; - auto_ptr p (new params); + unique_ptr p (new params); prepared_query pq ( c.prepare_query ( name, query::age > query::_ref (p->age) && query::name != query::_ref (p->name))); - c.cache_query (pq, p); + c.cache_query (pq, move (p)); }); for (unsigned int i (1); i < 6; ++i) diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 3e61c57..74b5ff5 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include #include @@ -55,7 +57,11 @@ struct person std::string first_name_; #pragma db column ("middle") null +#ifdef HAVE_CXX11 + std::unique_ptr middle_name_; +#else std::auto_ptr middle_name_; +#endif #pragma db column ("last") std::string last_name_; diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 689b571..926b596 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include // std::auto_ptr @@ -203,10 +205,17 @@ struct wrapper #pragma db id unsigned long id; +#ifdef HAVE_CXX11 + std::unique_ptr pl; + const std::unique_ptr cpl; + std::unique_ptr pcl; + const std::unique_ptr cpcl; +#else std::auto_ptr pl; const std::auto_ptr cpl; std::auto_ptr pcl; const std::auto_ptr cpcl; +#endif }; // Readonly object with auto id. diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 9e3dc2b..36aec87 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -231,7 +231,11 @@ namespace test5 unsigned long id; #pragma db null +#ifdef HAVE_CXX11 + std::unique_ptr p; +#else std::auto_ptr p; +#endif odb::nullable n; diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 825f969..99bc664 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -6,8 +6,10 @@ # error model.hxx included directly #endif +#include // HAVE_CXX11 + #include -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -448,7 +450,11 @@ namespace MODEL_NAMESPACE(MODEL_VERSION) #pragma db id unsigned long id_; +#ifdef HAVE_CXX11 + std::unique_ptr v; +#else std::auto_ptr v; +#endif unsigned long num; }; diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index aea64cb..0519567 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -20,6 +20,8 @@ typedef struct _GUID } GUID; #endif +#include // HAVE_CXX11 + #include #include #include // std::auto_ptr @@ -321,7 +323,11 @@ struct long_null unsigned int id_; #pragma db type ("VARCHAR(max)") null +#ifdef HAVE_CXX11 + std::unique_ptr str_; +#else std::auto_ptr str_; +#endif bool operator== (const long_null& y) const diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 8911635..6e13fcd 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -270,7 +270,11 @@ main (int argc, char* argv[]) // { db->persist (b3); +#ifdef HAVE_CXX11 + unique_ptr p (db->load (3)); +#else auto_ptr p (db->load (3)); +#endif assert (b3 == *p); b3.blob.push_back (123); db->update (b3); diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 687f05e..2eaa6e5 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -5,6 +5,8 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include #include // std::auto_ptr @@ -96,7 +98,12 @@ struct time_interval int nanosecond; }; +#ifdef HAVE_CXX11 +typedef std::unique_ptr string_ptr; +#else typedef std::auto_ptr string_ptr; +#endif + typedef std::vector strings; #pragma db object diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 644d100..c807c70 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -141,7 +141,11 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); +#ifdef HAVE_CXX11 + unique_ptr p (db->load ("1")); +#else auto_ptr p (db->load ("1")); +#endif assert (p->s._tracking ()); t.commit (); } @@ -528,7 +532,13 @@ main (int argc, char* argv[]) // Armed copy. // { + +#ifdef HAVE_CXX11 + unique_ptr c; +#else auto_ptr c; +#endif + { o.s.pop_back (); @@ -595,7 +605,7 @@ main (int argc, char* argv[]) // #ifdef HAVE_CXX11 { - auto_ptr c; + unique_ptr c; { o.s.pop_back (); diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index c792b19..dcebf2e 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -18,7 +18,11 @@ #include #include +#ifdef HAVE_CXX11 +#pragma db object pointer(std::unique_ptr) +#else #pragma db object pointer(std::auto_ptr) +#endif struct object { object () {} -- cgit v1.1 From eaa9c2508c06890fd30e52d135f0dc6016b5f2fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Jun 2016 18:56:49 +0200 Subject: Bump version to 2.5.0.a8 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c3af3cc..bdfefee 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a7 +2.5.0.a8 -- cgit v1.1 From 010997c50d011f7923ce0b820afa4f2d333d69a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 14 Aug 2016 12:34:01 +0200 Subject: Bump version to 2.5.0-a9 Note that we now use the -[ab]N schema rather than .[ab]N. --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index bdfefee..d9711fc 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0.a8 +2.5.0-a9 -- cgit v1.1 From b336e7a1671fdd504759f87bc5ed23fbc7bcf717 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Aug 2016 18:27:56 +0200 Subject: Lock object statements when loading sections Since we use the id image and loading of object pointers can overwrite it. --- common/section/polymorphism/driver.cxx | 45 +++++++++++++++++++++++++++++ common/section/polymorphism/test.hxx | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index c9cfee3..d58e850 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1754,6 +1754,51 @@ main (int argc, char* argv[]) t.commit (); } } + +#ifdef HAVE_CXX11 + // Test reuse/polymorphic inheritance and optimistic mix. + // + { + using namespace test9; + using std::shared_ptr; + + unsigned long long id; + + { + container c (123); + + c.e1.push_back (shared_ptr (new element (11))); + c.e1.push_back (shared_ptr (new element (12))); + + c.e2.push_back (shared_ptr (new element (21))); + c.e2.push_back (shared_ptr (new element (22))); + + transaction t (db->begin ()); + + db->persist (c.e1[0]); + db->persist (c.e1[1]); + db->persist (c.e2[0]); + db->persist (c.e2[1]); + + id = db->persist (c); + + t.commit (); + } + + { + transaction t (db->begin ()); + + shared_ptr c (db->load (id)); + + assert (c->n == 123); + db->load (*c, c->s); + assert (c->e1.size () == 2 && c->e1[0]->n == 11 && c->e1[1]->n == 12); + assert (c->e2.size () == 2 && c->e2[0]->n == 21 && c->e2[1]->n == 22); + + t.commit (); + } + } +#endif } catch (const odb::exception& e) { diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index 1c8e8fb..fe4ca96 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -5,8 +5,11 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_CXX11 + #include #include +#include #include #include @@ -492,4 +495,53 @@ namespace test8 }; } +// Test id overwrite regression. +// +// The key here is the setup: the object that contains the containers in a +// section and the pointers to objects stored in those containers. And these +// objects derive polymorphically from the same base (and thus shared the id +// bindind). +// +#ifdef HAVE_CXX11 +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object polymorphic pointer(std::shared_ptr) + struct base + { + virtual ~base () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct element: base + { + element (int n_ = 0): n (n_) {} + + int n; + }; + + typedef std::vector> elements; + + #pragma db object + struct container: base + { + container (int n_ = 0): n (n_) {} + + int n; + + #pragma db load(lazy) update(always) + odb::section s; + + #pragma db section(s) + elements e1; + + #pragma db section(s) + elements e2; + }; +} +#endif + #endif // TEST_HXX -- cgit v1.1 From bd536de7b694c0a631a9024d0f54bf25f374d253 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Aug 2016 17:46:03 +0200 Subject: Detect container of containers via composite value --- diagnostics/containers-of-containers.hxx | 69 ++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 diagnostics/containers-of-containers.hxx diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx new file mode 100644 index 0000000..0b40d3b --- /dev/null +++ b/diagnostics/containers-of-containers.hxx @@ -0,0 +1,69 @@ +// file : common/id/auto/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +#pragma db value +struct value_cont +{ + int n; + std::vector v; +}; + +#pragma db value +struct value_blob +{ + int n; + #pragma db type(BLOB_TYPE) + std::vector v; +}; + +#pragma db object +struct object +{ + #pragma db id + int id; + + //std::vector > vv; + + std::vector vc; + std::map mc; + + std::vector vb; + std::map mb; +}; + +/* + +#include +#include + +using float3 = std::array; + +#pragma db value(float3) transient +#pragma db member(float3::e1) virtual(float) get(this[0]) set(this[0]) +#pragma db member(float3::e2) virtual(float) get(this[1]) set(this[1]) +#pragma db member(float3::e3) virtual(float) get(this[2]) set(this[2]) + +#pragma db object +struct object +{ + #pragma db id + int id; + + std::vector vf3; +}; + +*/ -- cgit v1.1 From 57a8e43d8a766d8a20c4a80f24fe9cab4352eafc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2016 12:59:41 +0200 Subject: Bump version to 2.5.0-a10 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index d9711fc..eefbad9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-a9 +2.5.0-a10 -- cgit v1.1 From 6368220dda22d34f9ed50896622e6112668d0aba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Sep 2016 16:24:43 +0200 Subject: Bump version to 2.5.0-a11 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index eefbad9..b6012ca 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-a10 +2.5.0-a11 -- cgit v1.1 From c11a0e411d62db6f2ad4153579af254081a0e6f0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Oct 2016 16:41:51 +0200 Subject: Implement support for mixed auto/manual id assignment in SQLite Now one can do: #pragma db id auto odb::nullable id; And then set the id to NULL to get auto-assignment or to the actual value to use a manual id. --- sqlite/auto/driver.cxx | 75 ++++++++++++++++++++++++++++++++++ sqlite/auto/makefile | 109 +++++++++++++++++++++++++++++++++++++++++++++++++ sqlite/auto/test.hxx | 33 +++++++++++++++ sqlite/auto/test.std | 0 sqlite/makefile | 1 + 5 files changed, 218 insertions(+) create mode 100644 sqlite/auto/driver.cxx create mode 100644 sqlite/auto/makefile create mode 100644 sqlite/auto/test.hxx create mode 100644 sqlite/auto/test.std diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx new file mode 100644 index 0000000..4841e03 --- /dev/null +++ b/sqlite/auto/driver.cxx @@ -0,0 +1,75 @@ +// file : sqlite/auto/driver.cxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +// Test manual/automatic id assignment. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + // object + // + { + unsigned long id1, id2, id3; + { + object o1 (1, "one"); + object o2 ("two"); + object o3 (3, "three"); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = *o1.id_; + id2 = *o2.id_; + id3 = *o3.id_; + + assert (id1 == 1); + assert (id3 == 3); + + assert (id2 != id1); + assert (id2 != id3); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (id1)); + auto_ptr o2 (db->load (id2)); + auto_ptr o3 (db->load (id3)); + t.commit (); + + assert (*o1->id_ == id1 && o1->str_ == "one"); + assert (*o2->id_ == id2 && o2->str_ == "two"); + assert (*o3->id_ == id3 && o3->str_ == "three"); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile new file mode 100644 index 0000000..502743e --- /dev/null +++ b/sqlite/auto/makefile @@ -0,0 +1,109 @@ +# file : sqlite/auto/makefile +# copyright : Copyright (c) 2009-2015 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 +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-query --generate-schema --table-prefix sqlitex_auto_ \ +--sqlite-lax-auto-id +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-schemaless-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx new file mode 100644 index 0000000..1ee8dbe --- /dev/null +++ b/sqlite/auto/test.hxx @@ -0,0 +1,33 @@ +// file : sqlite/auto/test.hxx +// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#include + +#pragma db object +struct object +{ + explicit + object (const std::string& str): str_ (str) {} + object (unsigned long id, const std::string& str): id_ (id), str_ (str) {} + + #pragma db auto id + odb::nullable id_; + + std::string str_; + +private: + object () {} + + friend class odb::access; +}; + +#endif // TEST_HXX diff --git a/sqlite/auto/test.std b/sqlite/auto/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/makefile b/sqlite/makefile index 0515772..1cd7f14 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -6,6 +6,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +auto \ custom \ database \ native \ -- cgit v1.1 From a3e75f46dc4ba74bd9c4b55a776a1c051e00b4ec Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 27 Nov 2016 17:04:03 +0200 Subject: Update Qt import stub --- build/import/libqt/configure | 38 +++++++++++++++++++++++++++++--------- build/import/libqt/core/stub.make | 1 + 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 7d0987e..d9dd544 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -19,6 +19,14 @@ $echo "Configuring external dependency on 'Qt libraries' for '$project_name'." $echo $echo +$echo "Which version of Qt would you like to use?" +$echo +$echo "(1) Qt5" +$echo "(2) Qt4" +$echo +version=`read_option "5 4" "5"` + +$echo $echo "Would you like to configure dependency on the installed version" $echo "of 'Qt libraries' as opposed to the development build?" $echo @@ -43,17 +51,24 @@ if [ "$installed" = "n" ]; then type=`read_option "archive shared" "shared"` else - if pkg-config --exists QtCore; then + core_libs= + if [ "$version" = "5" ]; then - core_cppflags=`pkg-config --cflags QtCore` - core_libs=`pkg-config --libs QtCore` + if pkg-config --exists Qt5Core; then + core_cppflags=`pkg-config --cflags Qt5Core` + core_libs=`pkg-config --libs Qt5Core` + fi - elif pkg-config --exists Qt5Core; then + else - core_cppflags=`pkg-config --cflags Qt5Core` - core_libs=`pkg-config --libs Qt5Core` + if pkg-config --exists QtCore; then + core_cppflags=`pkg-config --cflags QtCore` + core_libs=`pkg-config --libs QtCore` + fi - else + fi + + if [ "$core_libs" = "" ]; then $echo $echo "Unable to discover installed 'Qt libraries' using pkg-config." @@ -61,13 +76,18 @@ else $echo core_cppflags= - core_libs=-lQtCore + if [ "$version" = "5" ]; then + core_libs=-lQt5Core + else + core_libs=-lQtCore + fi fi fi -echo libqt_installed := $installed >$1 +echo libqt_version := $version >$1 +echo libqt_installed := $installed >>$1 if [ "$installed" = "n" ]; then echo libqt_root := $root >>$1 diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index f45a596..06d4a9c 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -4,6 +4,7 @@ $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) +libqt_version := libqt_installed := $(call -include,$(dcf_root)/import/libqt/configuration-dynamic.make) -- cgit v1.1 From b66317f7c2d2a46ec0886a2a42bc90687d0fb871 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Dec 2016 12:34:28 +0200 Subject: Extend object loading view and section interaction test --- common/view/olv/driver.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index f378f84..222518a 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -506,8 +506,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && !v.o2->r.loaded () && !v.o2->o1); + + db->load (*v.o2, v.o2->r); + assert (v.o2->r.loaded () && v.o2->o1 && v.o2->o1->n == 123); + t.commit (); } } -- cgit v1.1 From 0a8568dda1ddbbd6b3207f95b62c5f8029bbceef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Jan 2017 14:23:50 +0200 Subject: Update copyright year --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/multi-index/driver.cxx | 2 +- boost/common/multi-index/makefile | 2 +- boost/common/multi-index/test.hxx | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/common/uuid/driver.cxx | 2 +- boost/common/uuid/makefile | 2 +- boost/common/uuid/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/access/driver.cxx | 2 +- common/access/makefile | 2 +- common/access/test.hxx | 2 +- common/as/driver.cxx | 2 +- common/as/makefile | 2 +- common/as/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/bulk/driver.cxx | 2 +- common/bulk/makefile | 2 +- common/bulk/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/changelog/add-column.hxx | 2 +- common/changelog/add-foreign-key.hxx | 2 +- common/changelog/add-index.hxx | 2 +- common/changelog/add-table.hxx | 2 +- common/changelog/alter-column.hxx | 2 +- common/changelog/drop-column.hxx | 2 +- common/changelog/drop-foreign-key.hxx | 2 +- common/changelog/drop-index.hxx | 2 +- common/changelog/drop-table.hxx | 2 +- common/changelog/makefile | 2 +- common/changelog/model.hxx | 2 +- common/circular/multiple/driver.cxx | 2 +- common/circular/multiple/makefile | 2 +- common/circular/multiple/test1.hxx | 2 +- common/circular/multiple/test2.hxx | 2 +- common/circular/single/driver.cxx | 2 +- common/circular/single/makefile | 2 +- common/circular/single/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/basics/driver.cxx | 2 +- common/container/basics/makefile | 2 +- common/container/basics/test.hxx | 2 +- common/container/change-tracking/driver.cxx | 2 +- common/container/change-tracking/makefile | 2 +- common/container/change-tracking/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/definition/driver.cxx | 2 +- common/definition/makefile | 2 +- common/definition/test.hxx | 2 +- common/definition/time-mapping.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/id/auto/driver.cxx | 2 +- common/id/auto/makefile | 2 +- common/id/auto/test.hxx | 2 +- common/id/composite/driver.cxx | 2 +- common/id/composite/makefile | 2 +- common/id/composite/test.hxx | 2 +- common/id/nested/driver.cxx | 2 +- common/id/nested/makefile | 2 +- common/id/nested/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/index/driver.cxx | 2 +- common/index/makefile | 2 +- common/index/test.hxx | 2 +- common/inheritance/polymorphism/driver.cxx | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test1.hxx | 2 +- common/inheritance/polymorphism/test10.hxx | 2 +- common/inheritance/polymorphism/test11.hxx | 2 +- common/inheritance/polymorphism/test12.hxx | 2 +- common/inheritance/polymorphism/test13.hxx | 2 +- common/inheritance/polymorphism/test14.hxx | 2 +- common/inheritance/polymorphism/test15.hxx | 2 +- common/inheritance/polymorphism/test2.hxx | 2 +- common/inheritance/polymorphism/test3.hxx | 2 +- common/inheritance/polymorphism/test4.hxx | 2 +- common/inheritance/polymorphism/test5.hxx | 2 +- common/inheritance/polymorphism/test6.hxx | 2 +- common/inheritance/polymorphism/test7.hxx | 2 +- common/inheritance/polymorphism/test8.hxx | 2 +- common/inheritance/polymorphism/test9.hxx | 2 +- common/inheritance/reuse/driver.cxx | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/transient/driver.cxx | 2 +- common/inheritance/transient/makefile | 2 +- common/inheritance/transient/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/object/driver.cxx | 2 +- common/object/makefile | 2 +- common/object/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/prepared/driver.cxx | 2 +- common/prepared/makefile | 2 +- common/prepared/test.hxx | 2 +- common/query/array/driver.cxx | 2 +- common/query/array/makefile | 2 +- common/query/array/test.hxx | 2 +- common/query/basics/driver.cxx | 2 +- common/query/basics/makefile | 2 +- common/query/basics/test.hxx | 2 +- common/query/one/driver.cxx | 2 +- common/query/one/makefile | 2 +- common/query/one/test.hxx | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship/basics/driver.cxx | 2 +- common/relationship/basics/makefile | 2 +- common/relationship/basics/test.hxx | 2 +- common/relationship/on-delete/driver.cxx | 2 +- common/relationship/on-delete/makefile | 2 +- common/relationship/on-delete/test.hxx | 2 +- common/relationship/query/driver.cxx | 2 +- common/relationship/query/makefile | 2 +- common/relationship/query/test.hxx | 2 +- common/schema/embedded/basics/driver.cxx | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/basics/test.hxx | 2 +- common/schema/embedded/order/driver.cxx | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/embedded/order/test1.hxx | 2 +- common/schema/embedded/order/test2.hxx | 2 +- common/schema/namespace/driver.cxx | 2 +- common/schema/namespace/makefile | 2 +- common/schema/namespace/test.hxx | 2 +- common/section/basics/driver.cxx | 2 +- common/section/basics/makefile | 2 +- common/section/basics/test.hxx | 2 +- common/section/polymorphism/driver.cxx | 2 +- common/section/polymorphism/makefile | 2 +- common/section/polymorphism/test.hxx | 2 +- common/session/cache/driver.cxx | 2 +- common/session/cache/makefile | 2 +- common/session/cache/test.hxx | 2 +- common/session/custom/driver.cxx | 2 +- common/session/custom/makefile | 2 +- common/session/custom/session.cxx | 2 +- common/session/custom/session.hxx | 2 +- common/session/custom/session.txx | 2 +- common/session/custom/test.hxx | 2 +- common/statement/processing/driver.cxx | 2 +- common/statement/processing/makefile | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/basics/driver.cxx | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/driver.cxx | 2 +- common/transaction/callback/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/basics/driver.cxx | 2 +- common/view/basics/makefile | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 2 +- common/view/olv/makefile | 2 +- common/view/olv/test1.hxx | 2 +- common/view/olv/test2.hxx | 2 +- common/view/olv/test3.hxx | 2 +- common/view/olv/test4.hxx | 2 +- common/view/olv/test5.hxx | 2 +- common/view/olv/test6.hxx | 2 +- common/view/olv/test7.hxx | 2 +- common/view/olv/test8.hxx | 2 +- common/view/olv/test9.hxx | 2 +- common/virtual/driver.cxx | 2 +- common/virtual/makefile | 2 +- common/virtual/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- diagnostics/containers-of-containers.hxx | 2 +- evolution/Makefile.am | 2 +- evolution/add-column/driver.cxx | 2 +- evolution/add-column/makefile | 2 +- evolution/add-column/model.hxx | 2 +- evolution/add-column/test1.hxx | 2 +- evolution/add-column/test2.hxx | 2 +- evolution/add-column/test3.hxx | 2 +- evolution/add-foreign-key/driver.cxx | 2 +- evolution/add-foreign-key/makefile | 2 +- evolution/add-foreign-key/model.hxx | 2 +- evolution/add-foreign-key/test1.hxx | 2 +- evolution/add-foreign-key/test2.hxx | 2 +- evolution/add-foreign-key/test3.hxx | 2 +- evolution/add-index/driver.cxx | 2 +- evolution/add-index/makefile | 2 +- evolution/add-index/model.hxx | 2 +- evolution/add-index/test1.hxx | 2 +- evolution/add-index/test2.hxx | 2 +- evolution/add-index/test3.hxx | 2 +- evolution/add-table/driver.cxx | 2 +- evolution/add-table/makefile | 2 +- evolution/add-table/model.hxx | 2 +- evolution/add-table/test1.hxx | 2 +- evolution/add-table/test2.hxx | 2 +- evolution/add-table/test3.hxx | 2 +- evolution/alter-column/driver.cxx | 2 +- evolution/alter-column/makefile | 2 +- evolution/alter-column/model.hxx | 2 +- evolution/alter-column/test1.hxx | 2 +- evolution/alter-column/test2.hxx | 2 +- evolution/alter-column/test3.hxx | 2 +- evolution/combined/driver.cxx | 2 +- evolution/combined/makefile | 2 +- evolution/combined/model.hxx | 2 +- evolution/combined/test1.hxx | 2 +- evolution/combined/test2.hxx | 2 +- evolution/combined/test3.hxx | 2 +- evolution/data/driver.cxx | 2 +- evolution/data/makefile | 2 +- evolution/data/model.hxx | 2 +- evolution/data/test1.hxx | 2 +- evolution/data/test2.hxx | 2 +- evolution/data/test3.hxx | 2 +- evolution/drop-column/driver.cxx | 2 +- evolution/drop-column/makefile | 2 +- evolution/drop-column/model.hxx | 2 +- evolution/drop-column/test1.hxx | 2 +- evolution/drop-column/test2.hxx | 2 +- evolution/drop-column/test3.hxx | 2 +- evolution/drop-foreign-key/driver.cxx | 2 +- evolution/drop-foreign-key/makefile | 2 +- evolution/drop-foreign-key/model.hxx | 2 +- evolution/drop-foreign-key/test1.hxx | 2 +- evolution/drop-foreign-key/test2.hxx | 2 +- evolution/drop-foreign-key/test3.hxx | 2 +- evolution/drop-index/driver.cxx | 2 +- evolution/drop-index/makefile | 2 +- evolution/drop-index/model.hxx | 2 +- evolution/drop-index/test1.hxx | 2 +- evolution/drop-index/test2.hxx | 2 +- evolution/drop-index/test3.hxx | 2 +- evolution/drop-table/driver.cxx | 2 +- evolution/drop-table/makefile | 2 +- evolution/drop-table/model.hxx | 2 +- evolution/drop-table/test1.hxx | 2 +- evolution/drop-table/test2.hxx | 2 +- evolution/drop-table/test3.hxx | 2 +- evolution/embedded/driver.cxx | 2 +- evolution/embedded/makefile | 2 +- evolution/embedded/model.hxx | 2 +- evolution/embedded/test1.hxx | 2 +- evolution/embedded/test2.hxx | 2 +- evolution/embedded/test3.hxx | 2 +- evolution/makefile | 2 +- evolution/soft-add/driver.cxx | 2 +- evolution/soft-add/makefile | 2 +- evolution/soft-add/model.hxx | 2 +- evolution/soft-add/test1.hxx | 2 +- evolution/soft-add/test2.hxx | 2 +- evolution/soft-add/test3.hxx | 2 +- evolution/soft-delete/driver.cxx | 2 +- evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 2 +- evolution/soft-delete/test1.hxx | 2 +- evolution/soft-delete/test2.hxx | 2 +- evolution/soft-delete/test3.hxx | 2 +- evolution/template/Makefile.am | 2 +- evolution/template/driver.cxx | 2 +- evolution/template/makefile | 2 +- evolution/template/model.hxx | 2 +- evolution/template/test1.hxx | 2 +- evolution/template/test2.hxx | 2 +- evolution/template/test3.hxx | 2 +- evolution/test.bat | 2 +- evolution/tester.bat | 2 +- evolution/tester.in | 2 +- evolution/version/driver.cxx | 2 +- evolution/version/makefile | 2 +- evolution/version/model.hxx | 2 +- evolution/version/test1.hxx | 2 +- evolution/version/test2.hxx | 2 +- evolution/version/test3.hxx | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/c++11.m4 | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/custom/driver.cxx | 2 +- mssql/custom/makefile | 2 +- mssql/custom/query.hxx | 2 +- mssql/custom/test.hxx | 2 +- mssql/custom/traits.cxx | 2 +- mssql/custom/traits.hxx | 2 +- mssql/database/driver.cxx | 2 +- mssql/database/makefile | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/stored-proc/driver.cxx | 2 +- mssql/stored-proc/makefile | 2 +- mssql/stored-proc/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/custom/driver.cxx | 2 +- mysql/custom/makefile | 2 +- mysql/custom/query.hxx | 2 +- mysql/custom/test.hxx | 2 +- mysql/custom/traits.hxx | 2 +- mysql/database/driver.cxx | 2 +- mysql/database/makefile | 2 +- mysql/index/driver.cxx | 2 +- mysql/index/makefile | 2 +- mysql/index/test.hxx | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/custom/driver.cxx | 2 +- oracle/custom/makefile | 2 +- oracle/custom/test.hxx | 2 +- oracle/custom/traits.hxx | 2 +- oracle/database/driver.cxx | 2 +- oracle/database/makefile | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/custom/driver.cxx | 2 +- pgsql/custom/makefile | 2 +- pgsql/custom/query.hxx | 2 +- pgsql/custom/test.hxx | 2 +- pgsql/custom/traits.hxx | 2 +- pgsql/database/driver.cxx | 2 +- pgsql/database/makefile | 2 +- pgsql/index/driver.cxx | 2 +- pgsql/index/makefile | 2 +- pgsql/index/test.hxx | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/basic/driver.cxx | 2 +- qt/common/basic/makefile | 2 +- qt/common/basic/test.hxx | 2 +- qt/common/containers/basics/driver.cxx | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/basics/test.hxx | 2 +- qt/common/containers/change-tracking/driver.cxx | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/containers/change-tracking/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/auto/driver.cxx | 2 +- sqlite/auto/makefile | 2 +- sqlite/auto/test.hxx | 2 +- sqlite/custom/driver.cxx | 2 +- sqlite/custom/makefile | 2 +- sqlite/custom/test.hxx | 2 +- sqlite/database/driver.cxx | 2 +- sqlite/database/makefile | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/stream/driver.cxx | 2 +- sqlite/stream/makefile | 2 +- sqlite/stream/test.hxx | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/transaction/driver.cxx | 2 +- sqlite/transaction/makefile | 2 +- sqlite/transaction/test.hxx | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 713 files changed, 713 insertions(+), 713 deletions(-) diff --git a/Makefile.am b/Makefile.am index 07021b5..bea8f5b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common evolution diff --git a/boost/Makefile.am b/boost/Makefile.am index 9ac5b09..5854add 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index 8a7d2e2..9ce0ef8 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index ebacbda..9512ba2 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index a6b53be..def866f 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index 91d9e00..ea5d016 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index ee97fcb..0a79a72 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,5 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index dc61a69..704e82e 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index 1ffc596..e170b0a 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 01cb8aa..55c9571 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 4f190a7..bc6fe39 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index 1c974af..bdb9fe0 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index bab7914..b5e9b34 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 524b564..4b76513 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 8348a37..21915f7 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index c84c7ae..6141dbb 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 8cf2009..598cf6d 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index bdc10eb..48c5796 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index a75d59d..4f515a8 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 12daf94..82942ec 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 9881191..a259d4c 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index ec4da23..e3f9781 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index d803ed1..e494ea2 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 8da76b5..84f906e 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,5 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index d9521db..382ddaf 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index 1debcf7..4cdd9cf 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index 998b5ba..7c9267c 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index fe96cfc..d8611ac 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index d9f771c..4cecde9 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index e24a200..58f81f9 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index b7c8559..a5366a8 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 7d6481b..9e4a201 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 920161e..cd2aa17 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 38eaa21..bf69eea 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index cba942f..e87b59a 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index 0b7f98b..a7f4f78 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index 8ae9d19..2eb9fcc 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index b043750..4e2a745 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index b082bf8..cf7da2e 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index b61aabc..affcf17 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 31614d9..dd7d4de 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 47f92f8..1e362f7 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index c37c624..d6c8968 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index ca9f295..31d4e00 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index c2bfe43..5f5d099 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 5cab596..5b8c025 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 6b4723f..2344a25 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index da6b899..abe7871 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 70b4065..c27db2a 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 306141e..739ed59 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 5650dbd..8b38cf5 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 4d0c194..ad298ea 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index 1884b49..5db64a7 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 60f3717..eb1fc04 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 159d8cc..6a8bd50 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index 16b794e..fc1c987 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index d6cf3cd..f17dac5 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index af619f2..91fd5b8 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 6afad79..eab3471 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index ad1937f..26d6792 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 70e15a8..a6289b8 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 335dd04..930d0c3 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 927ac04..7eb134b 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 097f6f3..885ba72 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index ef95589..7d4fe29 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 4bcdda7..6c345ba 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index 7ba7c4b..686fca7 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index 2d31c9b..549d654 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index 428256a..bf0258f 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index 58ab5e2..625169c 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index a446ff8..7796b9a 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 47466f0..4529219 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index 285f6d8..a685b31 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 3040821..6e66fc4 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index f500c6d..329cdaf 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index 2984c0a..d1e8314 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index 8953df9..46dcfd0 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index ec10aec..4b495b8 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index e14bb5d..7f0aef8 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 7d6cb2f..d02f000 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index 7dbc25e..f054af8 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 7e8ad57..8e89194 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 576a0e7..578dd99 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 4321f2a..54696d1 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index 002963b..b949e4f 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index 9e9f466..bc87b03 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index e43ecb7..d88936e 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 5a40f61..3d66ba8 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 0f5c0e8..59a4048 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index 7b55255..c2e82d5 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 2c94691..93b16cb 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index a6101b1..29c0e64 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index ade0186..5ab1642 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 21df46d..9d5e284 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index e953cc0..730af6e 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index 13082ef..1baed75 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index 0e8b679..cf05321 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index d77fde0..b37cfd3 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 64f5e97..0746431 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index fe2c09c..13395df 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index 105ed75..010eecb 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index bf3000e..07c7864 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index 17971ee..9d5fc40 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index ce27507..1d103b4 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 4dd2931..1ea1f7e 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index a434c01..b065022 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 05f8a3f..960a8a2 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index 2ea2618..6677789 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 42d0eef..e34bbd1 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 3fa72f5..7e8c620 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 7fc3aa1..db7a7ab 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index a5d7bc2..cb5ce6f 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index e4406df..ec5e348 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index d9dd544..5ff2b26 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index 05de257..70387bd 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 06d4a9c..d7ad611 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index d92a450..53efef1 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index 0762307..6dc3128 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index ca61f56..c7cf580 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 6f69c91..8228ab0 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index bc74ea3..487c426 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index f42512d..863aa1a 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index b6ca148..726c9f7 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index e42ca76..47832ea 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index bdb4b00..826956c 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index 9de3164..5d9f11b 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index 62135f2..cc18c11 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index eca2a50..d8a7bfc 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index c6b7f3d..98dba96 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index 618ea48..d1a21df 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 1e8ed91..245ec36 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,5 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index 160a6e6..830645a 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,5 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index a91d1bd..902d06d 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,5 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/as/driver.cxx b/common/as/driver.cxx index 72ddb10..0533834 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -1,5 +1,5 @@ // file : common/as/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type mapping (#pragma map type as ...). diff --git a/common/as/makefile b/common/as/makefile index 6a1b135..dac0fc2 100644 --- a/common/as/makefile +++ b/common/as/makefile @@ -1,5 +1,5 @@ # file : common/as/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/as/test.hxx b/common/as/test.hxx index 12822bb..90426bf 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -1,5 +1,5 @@ // file : common/as/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 7392786..8e0c424 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index 758868e..49defda 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 84448cc..a87cbe3 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index d6a294a..32771d4 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1,5 +1,5 @@ // file : common/bulk/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bulk database operations. diff --git a/common/bulk/makefile b/common/bulk/makefile index 0a96755..4fe94d3 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -1,5 +1,5 @@ # file : common/bulk/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index ce55158..34759ed 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,5 +1,5 @@ // file : common/driver/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 8cc918d..86d71f2 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index 2de856f..937b304 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index 386544f..ae5fe0a 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index b21ff2f..36f02e8 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-column.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index 0bfe706..7d00baf 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-foreign-key.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index 143864a..f9f029e 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-index.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_INDEX_HXX diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index 35fe2e8..56fcbd9 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-table.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_TABLE_HXX diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index e58f750..d33d040 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/alter-column.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index 4df2f97..aa4c8fd 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-column.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index 2b1f467..0332378 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-foreign-key.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index 250021d..a3c2d78 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-index.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_INDEX_HXX diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index 504e75d..cf95dfe 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-table.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 461e2eb..19ff80d 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -1,5 +1,5 @@ # file : common/changelog/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index 68e854a..f2334bd 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -1,5 +1,5 @@ // file : common/changelog/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index e278a13..a4e9765 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index e450fdd..b7825c8 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,5 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index 1e2f4f4..e989e07 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index 0dcf376..78ca657 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index 799bb0a..95961da 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index c2e090c..8d5a0cf 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,5 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 822b590..1bea94c 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,5 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index f88a1d8..575fdb2 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 38f04af..8c892a0 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 3de51b3..dea7829 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index c076560..d2285f9 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index 27678f9..a12286f 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index c858bbb..004c197 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index cbe5b72..fa8c29b 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index 5ffc55b..ba143a5 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 2e73d96..3a2eae2 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index 78bf66b..e086bac 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 76bfa02..37afee1 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,5 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index b2dd4b4..6a077bd 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index 3db728c..db22c1f 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index 982ef9c..b819bce 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,5 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 0117316..6ffa370 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 8a710a6..7030c8d 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index 2d7c430..0dc36f6 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 2addc20..76fb123 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 4bb0309..728800b 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index 0c7b178..4654019 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index bcf0601..76d105f 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index b83ad3c..56a82f5 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,5 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index 1f2825d..5fa391e 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,5 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index adc4268..80a69fb 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,5 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index 4b2e44a..3445d60 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,5 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 9e0d95e..33e9350 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index 5ea1791..7180cd7 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index f7941fe..e6eade3 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 0c29d60..b851636 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index b47a469..af3a605 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 91d3ec1..61c0be6 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx index 76ed756..3cd1e84 100644 --- a/common/id/auto/driver.cxx +++ b/common/id/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/auto/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/id/auto/makefile b/common/id/auto/makefile index 760719a..95569d6 100644 --- a/common/id/auto/makefile +++ b/common/id/auto/makefile @@ -1,5 +1,5 @@ # file : common/id/auto/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx index 1605cfe..5dd13f4 100644 --- a/common/id/auto/test.hxx +++ b/common/id/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx index 0df4c98..640855b 100644 --- a/common/id/composite/driver.cxx +++ b/common/id/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/composite/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/id/composite/makefile b/common/id/composite/makefile index 4f0f44e..a8d5fb5 100644 --- a/common/id/composite/makefile +++ b/common/id/composite/makefile @@ -1,5 +1,5 @@ # file : common/id/composite/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx index e7a0424..4409a8a 100644 --- a/common/id/composite/test.hxx +++ b/common/id/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/id/composite/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx index 28dac6a..fc4502e 100644 --- a/common/id/nested/driver.cxx +++ b/common/id/nested/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/nested/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test nested ids. diff --git a/common/id/nested/makefile b/common/id/nested/makefile index c2e5b0e..af2f6a3 100644 --- a/common/id/nested/makefile +++ b/common/id/nested/makefile @@ -1,5 +1,5 @@ # file : common/id/nested/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx index 6449fd4..3a521e3 100644 --- a/common/id/nested/test.hxx +++ b/common/id/nested/test.hxx @@ -1,5 +1,5 @@ // file : common/id/nested/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index 8a2c7f4..c92d10e 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index 9f8ab7c..2b2175a 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index 83b3645..c556908 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index d6dc326..d947d08 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index 125402a..ee0a909 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index c7c3511..c616514 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index f7c7396..7713690 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 2e6814b..28d64a7 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index 0951a5e..be34844 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index ac9de5c..a1a465d 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 6073056..27ea49b 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 2628516..7326164 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 7b7e54a..4c9fc9e 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index 0e81a20..f78e540 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,5 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index 5f8b8f0..ade2b99 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,5 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index 8acf1e0..1f465c6 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,5 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index acf94d5..4ed1427 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index af4a115..b464d97 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index 1110ee3..e298641 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index b8b9d7f..e1e26f3 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index c9c2002..7869bcf 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index 6b94f1e..6368bbd 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx index d86089f..4a88946 100644 --- a/common/inheritance/polymorphism/test13.hxx +++ b/common/inheritance/polymorphism/test13.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test13.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx index d5f3e4f..058cf1b 100644 --- a/common/inheritance/polymorphism/test14.hxx +++ b/common/inheritance/polymorphism/test14.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test14.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx index 0fbe326..f3d3a7f 100644 --- a/common/inheritance/polymorphism/test15.hxx +++ b/common/inheritance/polymorphism/test15.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test15.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index a6fd621..74782c7 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index a6c27fa..2c14080 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index f3b7f45..ea1e4f8 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index 78f909f..dfabddf 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index c12b5f4..25d70cc 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index 6ae8e93..b7b8afe 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index 0535468..d1f9a61 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index 253bccd..637093c 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 20d89ec..763f023 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 554d090..3f7583f 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 47deb67..86b4cb2 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index 94b3800..3c73b83 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index c403ced..d70aa2f 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index 02967ab..5b1aaa6 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 08fd78c..689d84d 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index ba0f295..88be6d0 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index d5f1da8..dde3f92 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index b0513a8..8cd2b0a 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 4025447..94fe58c 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index a298807..b5ac1ff 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 8bc455b..2cd21e4 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index a9ad0c6..e2bfe56 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 79085c6..111d299 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index b3b2bac..c0eea03 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index c9cc666..862e456 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 8daf755..8ff6085 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 9f7d5e4..2d71afc 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/object/driver.cxx b/common/object/driver.cxx index ea2a47e..6f07cd6 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -1,5 +1,5 @@ // file : common/object/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes. diff --git a/common/object/makefile b/common/object/makefile index 1be559d..b380acb 100644 --- a/common/object/makefile +++ b/common/object/makefile @@ -1,5 +1,5 @@ # file : common/object/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/object/test.hxx b/common/object/test.hxx index 100464c..e23e876 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -1,5 +1,5 @@ // file : common/object/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index ae7294f..5af1c8c 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 4a04259..a4e9abe 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index b9c04cc..2799560 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 041e96c..36a7307 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index 72f21f2..3b42884 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index 958a6ec..8d70404 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 0467f70..e61eacb 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,5 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index c2cdd25..c93da15 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,5 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 5f361c2..87337bd 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,5 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index dcbe095..9d70c95 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index e85feb2..cc6d085 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,5 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index a881e8c..059e3f9 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,5 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index a9a394d..a5fe21f 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index 6aa18e6..b2e46ff 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,5 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 74b5ff5..0f75c63 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx index e6b2b67..234e0cc 100644 --- a/common/query/one/driver.cxx +++ b/common/query/one/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/one/driver.cxx -// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query one support. diff --git a/common/query/one/makefile b/common/query/one/makefile index 51e281d..f48d9d8 100644 --- a/common/query/one/makefile +++ b/common/query/one/makefile @@ -1,5 +1,5 @@ # file : common/query/one/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx index 1a9c35e..7634dc2 100644 --- a/common/query/one/test.hxx +++ b/common/query/one/test.hxx @@ -1,5 +1,5 @@ // file : common/query/one/test.hxx -// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 4ea03bd..e31891c 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index 2ed7967..1f5d2bf 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 926b596..c8576c9 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index e0fd3b2..6cb8d00 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index 48aeb6a..67c7a80 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -1,5 +1,5 @@ # file : common/relationship/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index dd99273..ab3cd79 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index 51fe65a..7e86982 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test ON DELETE functionality. diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index 75f2bc3..93878a8 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -1,5 +1,5 @@ # file : common/relationship/on-delete/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx index 4e44b52..7917bef 100644 --- a/common/relationship/on-delete/test.hxx +++ b/common/relationship/on-delete/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index 97f4e0f..b3a7ffa 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index 444c0ce..c373059 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/query/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 1b8bbe8..199e94c 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index f243ba7..7eaf782 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index a2db582..aba0704 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index cabf942..aa2e43f 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index d501433..b8b22b2 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index f1868a3..53d19f6 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index 2e343d6..91f9ebb 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index 468db64..cfe1d95 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index 88e057f..775323f 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 1074448..5d2b36e 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,5 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index 83be599..b4471d5 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index b9fa667..dd302e8 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object section basics. diff --git a/common/section/basics/makefile b/common/section/basics/makefile index 18b3552..8b24c68 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -1,5 +1,5 @@ # file : common/section/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index 9dcb48a..c3c42e0 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/section/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index d58e850..9eb5b56 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test sections in polymorphic objects. diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index b398be7..7554f79 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/section/polymorphism/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index fe4ca96..a7101da 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 92eef3b..c26f2a1 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 9665dd2..ef78545 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,5 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index 8e578e4..1c6fccc 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,5 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index f37db94..3e7e1d0 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index a72203c..d9a2e33 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,5 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index 6daa8b0..b59b9cd 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 3cb7c24..f93bc7c 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index f54ebb7..e51073e 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,5 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index ba1a24f..aaeaf9a 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 414897f..3ee0e28 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -1,5 +1,5 @@ // file : common/statement/processing/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test internal statement processing machinery. diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 154f3c6..6ecdb6d 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -1,5 +1,5 @@ # file : common/statement/processing/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/template/Makefile.am b/common/template/Makefile.am index e958ea3..52c92e0 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 4cb1e7a..05660e7 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index ae86efb..4d4525b 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index 63bc9e3..fe6fb30 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 5873597..6308362 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 2bc1897..64211ad 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index 12e72e8..e32731c 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index e6640aa..401729b 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index 8ccd06c..a8f68b3 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 0020abf..292db00 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,5 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index a7ee853..cb8c814 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 7bca092..9e501f9 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,5 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 99cc87b..4f1b69d 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index 5e02f8c..cdbbd02 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index db4cdeb..fe7c118 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index c1108d7..7e4d88a 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test view basics. diff --git a/common/view/basics/makefile b/common/view/basics/makefile index e763841..4611a23 100644 --- a/common/view/basics/makefile +++ b/common/view/basics/makefile @@ -1,5 +1,5 @@ # file : common/view/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index fbe90ee..28cd17e 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/view/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index 222518a..c2d89a2 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/olv/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object loading views. diff --git a/common/view/olv/makefile b/common/view/olv/makefile index c12d130..4c7d955 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -1,5 +1,5 @@ # file : common/view/olv/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index d07ada4..097634e 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx index 8d95470..c1d253d 100644 --- a/common/view/olv/test2.hxx +++ b/common/view/olv/test2.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx index 15bd71b..480e568 100644 --- a/common/view/olv/test3.hxx +++ b/common/view/olv/test3.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx index cf2afb0..bbacdff 100644 --- a/common/view/olv/test4.hxx +++ b/common/view/olv/test4.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test4.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx index 4d291a5..a799668 100644 --- a/common/view/olv/test5.hxx +++ b/common/view/olv/test5.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test5.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx index 4ef14a4..d61d847 100644 --- a/common/view/olv/test6.hxx +++ b/common/view/olv/test6.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test6.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index dcfac32..4a85e19 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test7.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index 23cd82e..e539af0 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test8.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx index 18c6c32..9d3231e 100644 --- a/common/view/olv/test9.hxx +++ b/common/view/olv/test9.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test9.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index ac3236a..f9b0b33 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,5 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index d6e7c42..028c7cb 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,5 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index cf4db0f..e1aab06 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,5 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 779adff..77048a0 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 331a6b8..6b9efb6 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 36aec87..75f987b 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 6d7aa33..3144b38 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx index 0b40d3b..0260825 100644 --- a/diagnostics/containers-of-containers.hxx +++ b/diagnostics/containers-of-containers.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/evolution/Makefile.am b/evolution/Makefile.am index 9cf9d19..877bd4a 100644 --- a/evolution/Makefile.am +++ b/evolution/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index f41cb3c..2f20a85 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-column/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new column. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index a6fc763..b3b5fa8 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -1,5 +1,5 @@ # file : evolution/add-column/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx index 90d95c8..33e21bf 100644 --- a/evolution/add-column/model.hxx +++ b/evolution/add-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index cb57f9d..47086a8 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index 08008e9..e938862 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx index e1eaa87..9fe3a71 100644 --- a/evolution/add-column/test3.hxx +++ b/evolution/add-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index b81c4f9..4d74854 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a foreign key. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 16b660c..fb1e516 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/add-foreign-key/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index da02603..59971e0 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index 35492f8..8da0d96 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index 52da23a..7403f59 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx index 9d412c4..85e7dff 100644 --- a/evolution/add-foreign-key/test3.hxx +++ b/evolution/add-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index eda0f58..634e4ff 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new index. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 65a4746..22e5865 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -1,5 +1,5 @@ # file : evolution/add-index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx index 6928faa..6f644f8 100644 --- a/evolution/add-index/model.hxx +++ b/evolution/add-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index 1bc5549..8b7065a 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index 16f5c97..24080c3 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx index 3b435d4..9157235 100644 --- a/evolution/add-index/test3.hxx +++ b/evolution/add-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index 5bb80cb..9cb3382 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-table/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new table (object, container). diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index de45936..007cd01 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -1,5 +1,5 @@ # file : evolution/add-table/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx index 2f0449a..a20c419 100644 --- a/evolution/add-table/model.hxx +++ b/evolution/add-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index 2b2da59..97a9dfb 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index 9ec98f2..c1d8f4c 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx index 47d99c2..32786e6 100644 --- a/evolution/add-table/test3.hxx +++ b/evolution/add-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index b9b2248..fee1a39 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test altering a column. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 987de8f..62fc6c8 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -1,5 +1,5 @@ # file : evolution/alter-column/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index ff38df0..ebbb6b2 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index 2d9190b..c6dc2d5 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index ef2c984..5b3ecbb 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx index 0253339..26ef52a 100644 --- a/evolution/alter-column/test3.hxx +++ b/evolution/alter-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index 3c2d443..7bfcfe6 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/combined/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Combined schema evolution test. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index d59702d..2116edc 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -1,5 +1,5 @@ # file : evolution/combined/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 4fff13b..1f59379 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index 9e1ea1a..c61d4ac 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 8ed384b..5378a7b 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx index 7e53b49..303e0bb 100644 --- a/evolution/combined/test3.hxx +++ b/evolution/combined/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index 67481e9..a8f399e 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/data/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test data migration support. diff --git a/evolution/data/makefile b/evolution/data/makefile index 04c2fc0..f519fc7 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -1,5 +1,5 @@ # file : evolution/data/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx index 8751896..94393a3 100644 --- a/evolution/data/model.hxx +++ b/evolution/data/model.hxx @@ -1,5 +1,5 @@ // file : evolution/data/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx index cb48cbb..60da887 100644 --- a/evolution/data/test1.hxx +++ b/evolution/data/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx index 4f42aa5..91bad40 100644 --- a/evolution/data/test2.hxx +++ b/evolution/data/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx index 30965e8..1abe715 100644 --- a/evolution/data/test3.hxx +++ b/evolution/data/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index e8b6ada..c50f5c4 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a column. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index b4e2293..251a07b 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-column/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index a6e9b7e..0cc56b8 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index cc77ac0..efea344 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index ea619b9..4916f82 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx index f27d874..4d414c9 100644 --- a/evolution/drop-column/test3.hxx +++ b/evolution/drop-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index dbcb747..579cc44 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a foreign key. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 2f56423..a4cb120 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-foreign-key/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index 7d79889..84f4873 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index d5880e1..26273dc 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index 221de4c..812b075 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx index c42982b..dbfea70 100644 --- a/evolution/drop-foreign-key/test3.hxx +++ b/evolution/drop-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 7f78f30..990a779 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping an index. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 4161ee2..8304515 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx index 52c9d0e..4d09328 100644 --- a/evolution/drop-index/model.hxx +++ b/evolution/drop-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index dc30994..4cdba13 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index 5c8f641..6bbef44 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx index c6c56d8..7a7af41 100644 --- a/evolution/drop-index/test3.hxx +++ b/evolution/drop-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 4cbb6e0..924118b 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a table (object, container). diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index bb56294..24b8957 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-table/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index dd622c1..de3f3ba 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index dcaac05..3d76ff6 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index a736ccd..deb83a2 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx index a701ca0..43ccc49 100644 --- a/evolution/drop-table/test3.hxx +++ b/evolution/drop-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 7329e1d..8966c5b 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/embedded/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test embedded schema migration. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 25a8cf1..92eacf7 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -1,5 +1,5 @@ # file : evolution/embedded/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx index fce944f..b53a013 100644 --- a/evolution/embedded/model.hxx +++ b/evolution/embedded/model.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx index 1f8dbc9..0dceaf4 100644 --- a/evolution/embedded/test1.hxx +++ b/evolution/embedded/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx index 4a76d39..ccc2225 100644 --- a/evolution/embedded/test2.hxx +++ b/evolution/embedded/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx index 671523f..4498943 100644 --- a/evolution/embedded/test3.hxx +++ b/evolution/embedded/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 8f9ab2a..16ff5d7 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -1,5 +1,5 @@ # file : evolution/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 2fa034e..8fd2255 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-add functionality. diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 28accda..3ce57c7 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-add/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index dbffbae..e262e6c 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx index f0cb231..4f3cda8 100644 --- a/evolution/soft-add/test1.hxx +++ b/evolution/soft-add/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx index 417cf29..732e00e 100644 --- a/evolution/soft-add/test2.hxx +++ b/evolution/soft-add/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx index 5305001..367fae6 100644 --- a/evolution/soft-add/test3.hxx +++ b/evolution/soft-add/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 480f8d6..46b24a5 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-delete functionality. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 0d66f70..b52bf49 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-delete/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 99bc664..9f3a256 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx index b144337..423c921 100644 --- a/evolution/soft-delete/test1.hxx +++ b/evolution/soft-delete/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx index 53e2ec9..eaaaa8d 100644 --- a/evolution/soft-delete/test2.hxx +++ b/evolution/soft-delete/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx index a808b34..07909a8 100644 --- a/evolution/soft-delete/test3.hxx +++ b/evolution/soft-delete/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index d902560..5a9527b 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 4f0137c..57e0b65 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/evolution/template/makefile b/evolution/template/makefile index 3209cb3..b3747bc 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -1,5 +1,5 @@ # file : evolution/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx index c29e31f..f8913d0 100644 --- a/evolution/template/model.hxx +++ b/evolution/template/model.hxx @@ -1,5 +1,5 @@ // file : evolution/template/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index 1ac513d..ed847c6 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index 903dfd7..73793f7 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx index 55ae1f1..8aec67e 100644 --- a/evolution/template/test3.hxx +++ b/evolution/template/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/test.bat b/evolution/test.bat index adec5d2..5892a33 100644 --- a/evolution/test.bat +++ b/evolution/test.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/evolution/tester.bat b/evolution/tester.bat index 065b5ab..5f7f3cc 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/tester.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/evolution/tester.in b/evolution/tester.in index 9b390f1..fc7fd9c 100755 --- a/evolution/tester.in +++ b/evolution/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : evolution/tester.in -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index 4d9d289..e80c367 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/version/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test schema version access via the database instance. diff --git a/evolution/version/makefile b/evolution/version/makefile index 077d0ac..96a6c99 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -1,5 +1,5 @@ # file : evolution/version/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx index ad2c186..da9dcb7 100644 --- a/evolution/version/model.hxx +++ b/evolution/version/model.hxx @@ -1,5 +1,5 @@ // file : evolution/version/model.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx index b1b75aa..816e4c1 100644 --- a/evolution/version/test1.hxx +++ b/evolution/version/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test1.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx index 64e8d10..dae00c4 100644 --- a/evolution/version/test2.hxx +++ b/evolution/version/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test2.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx index dc43c87..8fba5cb 100644 --- a/evolution/version/test3.hxx +++ b/evolution/version/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test3.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index 9e533d7..071259e 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 0e7ebfa..a09f794 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 6c12fa6..c888099 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 9abe47e..a2a38d4 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 696ce05..0294d46 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index e70efd7..c242c63 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 4aa95ad..84bf4f0 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 6724ea1..9517f72 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index cf2314d..85d4e92 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 0fac560..5032b68 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index d6f6e5f..5edd65a 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 9f53b06..24e9fa0 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index c397f61..4c41e9e 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index b20e445..464b555 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,5 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index cae6481..2512caf 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 6af384b..5e69966 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index bb0c617..7ebd045 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index c9e6eed..82eb0ec 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index c54c3d5..baf04e4 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index b492fa4..a7addcf 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index f9153ab..3f1b71f 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index fe01711..b4868b9 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index b68497c..7ca7942 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index dffb802..68e4bd8 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 2dd2634..ad1d316 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 1ee0d7b..c4e7118 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 6b04b63..acafbb0 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index ffb2071..c816042 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 3fdd2a6..644759e 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index 1ed6116..f644ed2 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index 5da75ca..b1ceacb 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index aaa9ea1..d2f7281 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 2a74da2..375a489 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 1f49f8f..fb07f49 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index f02850f..e07a37d 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 679e128..b98e72f 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 6f52866..3576178 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index 8ba98f1..a2c7641 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 84344d1..8283699 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 13282dc..338013d 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 9d0220c..91fd40f 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,5 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index 6d65f86..58a6edb 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 751669c..763cbfe 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx index 266dec3..3f7430d 100644 --- a/mssql/custom/traits.cxx +++ b/mssql/custom/traits.cxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include "traits.hxx" diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index 30ca356..ec6ef25 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index aabd65e..0a4ee4b 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index 7cd791d..21782b9 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,5 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index da1bd48..0dcc23c 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index c36cf3f..03df585 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index 128e9ca..b6b76d1 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index 897ccb9..f932b6f 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index 651709b..6c8bf4c 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 5818830..d9c14df 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index a834847..f8199c3 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server stored procedure support. diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile index 2933a05..e5ef70b 100644 --- a/mssql/stored-proc/makefile +++ b/mssql/stored-proc/makefile @@ -1,5 +1,5 @@ # file : mssql/stored-proc/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index 56616c1..e57c1ec 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 48d0a84..6c54eaa 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 8a9bec7..978e4fa 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index c2f8f41..3ff90ba 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index 61de2e1..c3c661b 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index 8150a39..caf5dc0 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 90f9708..49c586a 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index a8c4b25..fb16fb5 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 0519567..8f0c521 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index d59ec00..1352529 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index b3120f8..de60a3c 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 06058df..6e08d73 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index a7e0c4b..f59a0b2 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 909196a..7cf0d03 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,5 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index 97c29d9..72c8516 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index 0520d64..ed7c801 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 4725480..0a43bf6 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index 371ea5e..46f0523 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index 4bab781..0621716 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,5 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index 69fb3bf..0d3c7a9 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index 7886b58..bb739fa 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,5 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index ad3be65..d3dc130 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index db67a37..4a29217 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 65abf30..fe340e3 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index 3627642..a675733 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 00477d5..23c8b68 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index c8358b1..795c574 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 1effb38..9ad0707 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index bf7f8da..c5bdc46 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index db32bb2..0ec343b 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 5222ce3..9e6aac2 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 3b455a1..3bd68ce 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index b602e89..2321aea 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 46ad54e..cb67b7a 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 5b27a29..465a51a 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index aaf6df7..63e5531 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index b25e0da..8ea15de 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index 95de227..d8fda7d 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index 80a9689..263bb22 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index ebab793..fbb4f81 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 8f79329..33af69f 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,5 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index a569a17..f44625c 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,5 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index c378a8e..b63e3a0 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index 93dabb7..62e3504 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 081e85f..70392e7 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,5 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index debf00d..c7dd558 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index d15e40c..c724949 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index 7ab13cc..c938851 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 7c44003..0a97e05 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 6051439..252b286 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index 30ea64a..85583a2 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index d393c27..bce71bd 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 810e680..5ae40cd 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 6e13fcd..5554b26 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index c3f015c..cd462ee 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 2eaa6e5..70c1fc3 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 57bb257..2cf8f45 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 1ae474e..8e39cc8 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index e5b6f0d..3c684da 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index 22d9115..59be4ac 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index b1e42d4..1623bf1 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,5 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index 2cfaa28..962bf92 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index ef30e39..e9e3fa3 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index 6d62143..a141454 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 83efdba..b64aec8 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index bbd0c4e..28eba96 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,5 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 3d3f23b..24513c0 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index a7cf64d..1c5b934 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,5 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index 76754be..8d1ba3b 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index 926079d..beac705 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index a55e5a5..1a984a6 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index ca6413b..a204a68 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 0d399ce..453f9e0 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index e57f14a..fdc68ce 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 07d33f9..6854e51 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 5219b12..2e4b16c 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index 09cf589..88e900c 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index df2be89..24d61c9 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 034f84d..8b08786 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 5d36683..58226fc 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 79e624e..1a58ef5 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index 4b3758a..e59018a 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 773742e..3565139 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index d213a54..e3f97e7 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index 478da22..2ed6eab 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index 6f2ec46..5d0125e 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 8ebd8f9..46b6adc 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index 228d19e..fb70c99 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index 59f3678..ef39ca3 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,5 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index cdf3aa3..0f11dfd 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index a98e5ae..5bb51fe 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index ef27c52..785398d 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index e7c22cb..ad7442c 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index c807c70..8983d49 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index dd48588..20b8d9c 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index dcebf2e..f4ed192 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index 9746e7e..e48da46 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 873efe2..c1fe7ed 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 5241d7c..567b46b 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 56b4d1b..f8ba307 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index 8542729..524e781 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index 7d3c067..d6c38ce 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 1049e46..987953e 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index 574ae25..d7856fb 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index 3afe5b4..6457620 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index f98a78f..2569f57 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index f35e19c..9cf7dd8 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 2aad642..9f7c1df 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 83ab031..3df9624 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index a4adc33..ec60d0b 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 1bc428e..081be19 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index ed69313..5b55757 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 4d75745..db19fc9 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 1e8a413..dcc0cce 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 5f104cd..e8819cb 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 9bc1804..e6e9774 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 58e6955..21b05f1 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index efa38b6..e1eb5a2 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index 2a8ab22..969dc44 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index e6297f1..72fe502 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index a522705..2c12704 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 2604821..bf0afc7 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index d31bc3e..4cc00d1 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 04a8528..ef0b0f2 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 6c630aa..8859c4c 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 584ba31..a25bf98 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index b2dc6e5..166f591 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 708d76e..28f56a4 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index 9d5cf37..dbac8d5 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index a58012b..1f579ea 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index fe1d7f7..c9d94aa 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index 8c689cb..461f07e 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index 5bd4d90..7853ab7 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index f9adfe1..21f7fff 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 6ee4adb..9e4775f 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 596f7e1..0c3eec5 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index e994350..da4ff52 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index fd0484c..2b26acd 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 933444d..0ff5c29 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index f6016d3..0d21b73 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 5e68cd9..87d244c 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index 1c37926..1d02e63 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 9cb6d5b..059e002 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index aed3bc4..d922531 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index 7d7f5b1..d48aa83 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index 54a2dca..a92fce8 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 2ba3937..8440a92 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 64ef85f..a032533 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index fcdf3ff..b897949 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index a4cdefd..d37dcdd 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 698cec3..f1e0a4c 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index 8fe4be9..a07cbb8 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index dcc52f9..6db1b28 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 3995cd4..e0b75be 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 0b99fba..1911fbb 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index d50d696..5525a3d 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index 072c959..bee91fe 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index adb0793..d2d185e 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 8acd52b..9920d88 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 7c3ba84..b411c98 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 8214f6b..07b6626 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 24b77d2..84c4766 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 83b42ab..316d087 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 556b515..1d88614 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index caf6613..678baa9 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 81cb23c..10a0202 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index 352e383..bbbb172 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 1d90748..6db45c3 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index d97ac69..6b94a8d 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index b656f9d..98526ca 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index 40f7354..b542cc0 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 7012eb5..76be78d 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index 4841e03..bb6d547 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/auto/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test manual/automatic id assignment. diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile index 502743e..dfafa22 100644 --- a/sqlite/auto/makefile +++ b/sqlite/auto/makefile @@ -1,5 +1,5 @@ # file : sqlite/auto/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx index 1ee8dbe..3d3afe7 100644 --- a/sqlite/auto/test.hxx +++ b/sqlite/auto/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/auto/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 6e9afcb..2087621 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 8695915..6b947b5 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,5 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index f3752c1..4448f5d 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index 7ae1fe2..e978269 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index ed2cfbb..8b9ef2e 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,5 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index 1cd7f14..00b9b48 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 8b0a4af..5174afe 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 2bb205d..3b78ae8 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 5f708ba..98211e5 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/stream/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite BLOB/TEXT incremental I/O. diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile index 5f63159..1b8d326 100644 --- a/sqlite/stream/makefile +++ b/sqlite/stream/makefile @@ -1,5 +1,5 @@ # file : sqlite/stream/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx index 32c29e3..db2eeea 100644 --- a/sqlite/stream/test.hxx +++ b/sqlite/stream/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/stream/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 44a4fc3..ec503c5 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index c7b9390..f66d396 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 4e39a1c..7665813 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index df83439..dabcc78 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index a57e5cf..737868d 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index 0089b70..de171c6 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test esoteric SQLite transaction semantics aspects. diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index 8c2e96f..446d2ae 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -1,5 +1,5 @@ # file : sqlite/transaction/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx index deb79dd..f6b2fe2 100644 --- a/sqlite/transaction/test.hxx +++ b/sqlite/transaction/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index f9e3d25..20b71ba 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index c7f55b0..c55dbeb 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 7593518..3fde8cc 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index bdd643a..0dc3a22 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 7ec5d76..a1a752e 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 5a0bb41..2880c1b 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 4ffa483..a1ad680 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index 2590d56..d1052a7 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index 82e4859..19318cc 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index 8355400..92c970a 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From 4f59b0e76e5898f151ab021d1a8ecd57077518fd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 28 Apr 2017 16:17:22 +0200 Subject: Bump version to 2.5.0.b.1.z, switch to build2 version module --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index b6012ca..07ad3e3 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-a11 +2.5.0-b.1 -- cgit v1.1 From 495af7644357a60c55b75021124f94bedc63a9e0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 May 2017 12:50:10 +0200 Subject: Bump version to 2.5.0-b.2.z, master is open for business --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 07ad3e3..00e2348 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.1 +2.5.0-b.2 -- cgit v1.1 From 80e4721b085f0662cbbee1ebcc0875fde21f9aad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 23 May 2017 15:17:51 +0200 Subject: Bump version to 2.5.0-b.3 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 00e2348..7aa40f6 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.2 +2.5.0-b.3 -- cgit v1.1 From 20ddbaea6cce35f5bdbe4e3793378ddffa9f2dc6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 May 2017 13:47:37 +0200 Subject: Bump version to 2.5.0-b.4.z, master is open for business --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 7aa40f6..9cce3ff 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.3 +2.5.0-b.4 -- cgit v1.1 From eabfd96a3f08ffffeb49a6d3f73a2056828a1aec Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Aug 2017 12:56:02 +0200 Subject: Bump version to 2.5.0-b.5 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 9cce3ff..22c5d3e 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.4 +2.5.0-b.5 -- cgit v1.1 From 791a918ba26cfc59c0009e94de43b88cb697f4fb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 Aug 2017 14:08:25 +0200 Subject: Bump version to 2.5.0-b.6.z, master is open for business --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 22c5d3e..62aaa61 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.5 +2.5.0-b.6 -- cgit v1.1 From 4d61ee5a20babf92e0860a3d34bb0c0f0920dd67 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Nov 2017 17:47:20 +0200 Subject: Work around PostgreSQL transaction poisoning in schema version query Note that this only works in 9.4+. For older versions the workaround is to "pre-call" database::schema_version() outside of any transaction. --- evolution/embedded/driver.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 8966c5b..1cae9de 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -16,6 +16,10 @@ #include // DATABASE_XXX #include +#ifdef DATABASE_PGSQL +# include +#endif + #include "test2.hxx" #include "test3.hxx" #include "test2-odb.hxx" @@ -49,12 +53,22 @@ main (int argc, char* argv[]) t.commit (); } - // PostgreSQL cannot continue a transaction after a query failed. + // PostgreSQL cannot continue a transaction after a query failed. We + // have a workaround but only for 9.4+. // - assert (db->schema_version () == 0); +#ifdef DATABASE_PGSQL + { + odb::connection_ptr c (db->connection ()); + int v (static_cast (*c).server_version ()); + if (v < 90400) + assert (db->schema_version () == 0); + } +#endif { transaction t (db->begin ()); + assert (db->schema_version () == 0); + schema_catalog::create_schema (*db, "", false); assert (db->schema_version () == 1 && !db->schema_migration ()); -- cgit v1.1 From 68a31ac90d11b2f0294e82eb887bd03fde85fbb1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 24 May 2018 21:55:43 +0300 Subject: Update copyright year --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/multi-index/driver.cxx | 2 +- boost/common/multi-index/makefile | 2 +- boost/common/multi-index/test.hxx | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/common/uuid/driver.cxx | 2 +- boost/common/uuid/makefile | 2 +- boost/common/uuid/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/access/driver.cxx | 2 +- common/access/makefile | 2 +- common/access/test.hxx | 2 +- common/as/driver.cxx | 2 +- common/as/makefile | 2 +- common/as/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/bulk/driver.cxx | 2 +- common/bulk/makefile | 2 +- common/bulk/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/changelog/add-column.hxx | 2 +- common/changelog/add-foreign-key.hxx | 2 +- common/changelog/add-index.hxx | 2 +- common/changelog/add-table.hxx | 2 +- common/changelog/alter-column.hxx | 2 +- common/changelog/drop-column.hxx | 2 +- common/changelog/drop-foreign-key.hxx | 2 +- common/changelog/drop-index.hxx | 2 +- common/changelog/drop-table.hxx | 2 +- common/changelog/makefile | 2 +- common/changelog/model.hxx | 2 +- common/circular/multiple/driver.cxx | 2 +- common/circular/multiple/makefile | 2 +- common/circular/multiple/test1.hxx | 2 +- common/circular/multiple/test2.hxx | 2 +- common/circular/single/driver.cxx | 2 +- common/circular/single/makefile | 2 +- common/circular/single/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/basics/driver.cxx | 2 +- common/container/basics/makefile | 2 +- common/container/basics/test.hxx | 2 +- common/container/change-tracking/driver.cxx | 2 +- common/container/change-tracking/makefile | 2 +- common/container/change-tracking/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/definition/driver.cxx | 2 +- common/definition/makefile | 2 +- common/definition/test.hxx | 2 +- common/definition/time-mapping.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/id/auto/driver.cxx | 2 +- common/id/auto/makefile | 2 +- common/id/auto/test.hxx | 2 +- common/id/composite/driver.cxx | 2 +- common/id/composite/makefile | 2 +- common/id/composite/test.hxx | 2 +- common/id/nested/driver.cxx | 2 +- common/id/nested/makefile | 2 +- common/id/nested/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/index/driver.cxx | 2 +- common/index/makefile | 2 +- common/index/test.hxx | 2 +- common/inheritance/polymorphism/driver.cxx | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test1.hxx | 2 +- common/inheritance/polymorphism/test10.hxx | 2 +- common/inheritance/polymorphism/test11.hxx | 2 +- common/inheritance/polymorphism/test12.hxx | 2 +- common/inheritance/polymorphism/test13.hxx | 2 +- common/inheritance/polymorphism/test14.hxx | 2 +- common/inheritance/polymorphism/test15.hxx | 2 +- common/inheritance/polymorphism/test2.hxx | 2 +- common/inheritance/polymorphism/test3.hxx | 2 +- common/inheritance/polymorphism/test4.hxx | 2 +- common/inheritance/polymorphism/test5.hxx | 2 +- common/inheritance/polymorphism/test6.hxx | 2 +- common/inheritance/polymorphism/test7.hxx | 2 +- common/inheritance/polymorphism/test8.hxx | 2 +- common/inheritance/polymorphism/test9.hxx | 2 +- common/inheritance/reuse/driver.cxx | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/transient/driver.cxx | 2 +- common/inheritance/transient/makefile | 2 +- common/inheritance/transient/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/object/driver.cxx | 2 +- common/object/makefile | 2 +- common/object/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/prepared/driver.cxx | 2 +- common/prepared/makefile | 2 +- common/prepared/test.hxx | 2 +- common/query/array/driver.cxx | 2 +- common/query/array/makefile | 2 +- common/query/array/test.hxx | 2 +- common/query/basics/driver.cxx | 2 +- common/query/basics/makefile | 2 +- common/query/basics/test.hxx | 2 +- common/query/one/driver.cxx | 2 +- common/query/one/makefile | 2 +- common/query/one/test.hxx | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship/basics/driver.cxx | 2 +- common/relationship/basics/makefile | 2 +- common/relationship/basics/test.hxx | 2 +- common/relationship/on-delete/driver.cxx | 2 +- common/relationship/on-delete/makefile | 2 +- common/relationship/on-delete/test.hxx | 2 +- common/relationship/query/driver.cxx | 2 +- common/relationship/query/makefile | 2 +- common/relationship/query/test.hxx | 2 +- common/schema/embedded/basics/driver.cxx | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/basics/test.hxx | 2 +- common/schema/embedded/order/driver.cxx | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/embedded/order/test1.hxx | 2 +- common/schema/embedded/order/test2.hxx | 2 +- common/schema/namespace/driver.cxx | 2 +- common/schema/namespace/makefile | 2 +- common/schema/namespace/test.hxx | 2 +- common/section/basics/driver.cxx | 2 +- common/section/basics/makefile | 2 +- common/section/basics/test.hxx | 2 +- common/section/polymorphism/driver.cxx | 2 +- common/section/polymorphism/makefile | 2 +- common/section/polymorphism/test.hxx | 2 +- common/session/cache/driver.cxx | 2 +- common/session/cache/makefile | 2 +- common/session/cache/test.hxx | 2 +- common/session/custom/driver.cxx | 2 +- common/session/custom/makefile | 2 +- common/session/custom/session.cxx | 2 +- common/session/custom/session.hxx | 2 +- common/session/custom/session.txx | 2 +- common/session/custom/test.hxx | 2 +- common/statement/processing/driver.cxx | 2 +- common/statement/processing/makefile | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/basics/driver.cxx | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/driver.cxx | 2 +- common/transaction/callback/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/basics/driver.cxx | 2 +- common/view/basics/makefile | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 2 +- common/view/olv/makefile | 2 +- common/view/olv/test1.hxx | 2 +- common/view/olv/test2.hxx | 2 +- common/view/olv/test3.hxx | 2 +- common/view/olv/test4.hxx | 2 +- common/view/olv/test5.hxx | 2 +- common/view/olv/test6.hxx | 2 +- common/view/olv/test7.hxx | 2 +- common/view/olv/test8.hxx | 2 +- common/view/olv/test9.hxx | 2 +- common/virtual/driver.cxx | 2 +- common/virtual/makefile | 2 +- common/virtual/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- diagnostics/containers-of-containers.hxx | 2 +- evolution/Makefile.am | 2 +- evolution/add-column/driver.cxx | 2 +- evolution/add-column/makefile | 2 +- evolution/add-column/model.hxx | 2 +- evolution/add-column/test1.hxx | 2 +- evolution/add-column/test2.hxx | 2 +- evolution/add-column/test3.hxx | 2 +- evolution/add-foreign-key/driver.cxx | 2 +- evolution/add-foreign-key/makefile | 2 +- evolution/add-foreign-key/model.hxx | 2 +- evolution/add-foreign-key/test1.hxx | 2 +- evolution/add-foreign-key/test2.hxx | 2 +- evolution/add-foreign-key/test3.hxx | 2 +- evolution/add-index/driver.cxx | 2 +- evolution/add-index/makefile | 2 +- evolution/add-index/model.hxx | 2 +- evolution/add-index/test1.hxx | 2 +- evolution/add-index/test2.hxx | 2 +- evolution/add-index/test3.hxx | 2 +- evolution/add-table/driver.cxx | 2 +- evolution/add-table/makefile | 2 +- evolution/add-table/model.hxx | 2 +- evolution/add-table/test1.hxx | 2 +- evolution/add-table/test2.hxx | 2 +- evolution/add-table/test3.hxx | 2 +- evolution/alter-column/driver.cxx | 2 +- evolution/alter-column/makefile | 2 +- evolution/alter-column/model.hxx | 2 +- evolution/alter-column/test1.hxx | 2 +- evolution/alter-column/test2.hxx | 2 +- evolution/alter-column/test3.hxx | 2 +- evolution/combined/driver.cxx | 2 +- evolution/combined/makefile | 2 +- evolution/combined/model.hxx | 2 +- evolution/combined/test1.hxx | 2 +- evolution/combined/test2.hxx | 2 +- evolution/combined/test3.hxx | 2 +- evolution/data/driver.cxx | 2 +- evolution/data/makefile | 2 +- evolution/data/model.hxx | 2 +- evolution/data/test1.hxx | 2 +- evolution/data/test2.hxx | 2 +- evolution/data/test3.hxx | 2 +- evolution/drop-column/driver.cxx | 2 +- evolution/drop-column/makefile | 2 +- evolution/drop-column/model.hxx | 2 +- evolution/drop-column/test1.hxx | 2 +- evolution/drop-column/test2.hxx | 2 +- evolution/drop-column/test3.hxx | 2 +- evolution/drop-foreign-key/driver.cxx | 2 +- evolution/drop-foreign-key/makefile | 2 +- evolution/drop-foreign-key/model.hxx | 2 +- evolution/drop-foreign-key/test1.hxx | 2 +- evolution/drop-foreign-key/test2.hxx | 2 +- evolution/drop-foreign-key/test3.hxx | 2 +- evolution/drop-index/driver.cxx | 2 +- evolution/drop-index/makefile | 2 +- evolution/drop-index/model.hxx | 2 +- evolution/drop-index/test1.hxx | 2 +- evolution/drop-index/test2.hxx | 2 +- evolution/drop-index/test3.hxx | 2 +- evolution/drop-table/driver.cxx | 2 +- evolution/drop-table/makefile | 2 +- evolution/drop-table/model.hxx | 2 +- evolution/drop-table/test1.hxx | 2 +- evolution/drop-table/test2.hxx | 2 +- evolution/drop-table/test3.hxx | 2 +- evolution/embedded/driver.cxx | 2 +- evolution/embedded/makefile | 2 +- evolution/embedded/model.hxx | 2 +- evolution/embedded/test1.hxx | 2 +- evolution/embedded/test2.hxx | 2 +- evolution/embedded/test3.hxx | 2 +- evolution/makefile | 2 +- evolution/soft-add/driver.cxx | 2 +- evolution/soft-add/makefile | 2 +- evolution/soft-add/model.hxx | 2 +- evolution/soft-add/test1.hxx | 2 +- evolution/soft-add/test2.hxx | 2 +- evolution/soft-add/test3.hxx | 2 +- evolution/soft-delete/driver.cxx | 2 +- evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 2 +- evolution/soft-delete/test1.hxx | 2 +- evolution/soft-delete/test2.hxx | 2 +- evolution/soft-delete/test3.hxx | 2 +- evolution/template/Makefile.am | 2 +- evolution/template/driver.cxx | 2 +- evolution/template/makefile | 2 +- evolution/template/model.hxx | 2 +- evolution/template/test1.hxx | 2 +- evolution/template/test2.hxx | 2 +- evolution/template/test3.hxx | 2 +- evolution/test.bat | 2 +- evolution/tester.bat | 2 +- evolution/tester.in | 2 +- evolution/version/driver.cxx | 2 +- evolution/version/makefile | 2 +- evolution/version/model.hxx | 2 +- evolution/version/test1.hxx | 2 +- evolution/version/test2.hxx | 2 +- evolution/version/test3.hxx | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/c++11.m4 | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/custom/driver.cxx | 2 +- mssql/custom/makefile | 2 +- mssql/custom/query.hxx | 2 +- mssql/custom/test.hxx | 2 +- mssql/custom/traits.cxx | 2 +- mssql/custom/traits.hxx | 2 +- mssql/database/driver.cxx | 2 +- mssql/database/makefile | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/stored-proc/driver.cxx | 2 +- mssql/stored-proc/makefile | 2 +- mssql/stored-proc/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/custom/driver.cxx | 2 +- mysql/custom/makefile | 2 +- mysql/custom/query.hxx | 2 +- mysql/custom/test.hxx | 2 +- mysql/custom/traits.hxx | 2 +- mysql/database/driver.cxx | 2 +- mysql/database/makefile | 2 +- mysql/index/driver.cxx | 2 +- mysql/index/makefile | 2 +- mysql/index/test.hxx | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/custom/driver.cxx | 2 +- oracle/custom/makefile | 2 +- oracle/custom/test.hxx | 2 +- oracle/custom/traits.hxx | 2 +- oracle/database/driver.cxx | 2 +- oracle/database/makefile | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/custom/driver.cxx | 2 +- pgsql/custom/makefile | 2 +- pgsql/custom/query.hxx | 2 +- pgsql/custom/test.hxx | 2 +- pgsql/custom/traits.hxx | 2 +- pgsql/database/driver.cxx | 2 +- pgsql/database/makefile | 2 +- pgsql/index/driver.cxx | 2 +- pgsql/index/makefile | 2 +- pgsql/index/test.hxx | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/basic/driver.cxx | 2 +- qt/common/basic/makefile | 2 +- qt/common/basic/test.hxx | 2 +- qt/common/containers/basics/driver.cxx | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/basics/test.hxx | 2 +- qt/common/containers/change-tracking/driver.cxx | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/containers/change-tracking/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/auto/driver.cxx | 2 +- sqlite/auto/makefile | 2 +- sqlite/auto/test.hxx | 2 +- sqlite/custom/driver.cxx | 2 +- sqlite/custom/makefile | 2 +- sqlite/custom/test.hxx | 2 +- sqlite/database/driver.cxx | 2 +- sqlite/database/makefile | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/stream/driver.cxx | 2 +- sqlite/stream/makefile | 2 +- sqlite/stream/test.hxx | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/transaction/driver.cxx | 2 +- sqlite/transaction/makefile | 2 +- sqlite/transaction/test.hxx | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 713 files changed, 713 insertions(+), 713 deletions(-) diff --git a/Makefile.am b/Makefile.am index bea8f5b..910be38 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common evolution diff --git a/boost/Makefile.am b/boost/Makefile.am index 5854add..ab85c0f 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index 9ce0ef8..79ced9b 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index 9512ba2..abac934 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index def866f..37213ed 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index ea5d016..4ee508d 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 0a79a72..108f4c5 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,5 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index 704e82e..606bc1e 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index e170b0a..51591fa 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 55c9571..4709cf3 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index bc6fe39..7d4b5b8 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index bdb9fe0..c71a6ba 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index b5e9b34..d4f565e 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 4b76513..605b122 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 21915f7..606e7d0 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 6141dbb..a889557 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 598cf6d..e56dc37 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index 48c5796..d3b732e 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index 4f515a8..92c4b07 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 82942ec..2885807 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index a259d4c..bb2f2a1 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index e3f9781..97e2996 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index e494ea2..5cffa6a 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 84f906e..5188740 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,5 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index 382ddaf..c4195aa 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index 4cdd9cf..b16369d 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index 7c9267c..2a31e35 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index d8611ac..81b6f6e 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index 4cecde9..a315271 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index 58f81f9..d9b058f 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index a5366a8..57028d9 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 9e4a201..a28fbf8 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index cd2aa17..25ac8e4 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index bf69eea..2ba7faa 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index e87b59a..dd6d31a 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index a7f4f78..0298168 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index 2eb9fcc..edeb3e5 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 4e2a745..29be785 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index cf7da2e..07af054 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index affcf17..4ae594f 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index dd7d4de..6caa916 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 1e362f7..b0c803d 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index d6c8968..83e5cef 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index 31d4e00..c9a59c4 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index 5f5d099..d3eb4f1 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 5b8c025..0873568 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 2344a25..af7cd31 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index abe7871..eca54b5 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index c27db2a..b8b682e 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 739ed59..158ec70 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index 8b38cf5..ef030ce 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index ad298ea..2dab7ea 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index 5db64a7..74f65ef 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index eb1fc04..a5d08b7 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 6a8bd50..2a8f3dc 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index fc1c987..81ae3a9 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index f17dac5..a762774 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 91fd5b8..2f1f9d4 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index eab3471..7c9dd0a 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 26d6792..34ac130 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index a6289b8..e0c913c 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 930d0c3..97b0581 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 7eb134b..5a82834 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 885ba72..a6a5d78 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 7d4fe29..619746b 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 6c345ba..48d22d2 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index 686fca7..7b387d9 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index 549d654..b8716c9 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index bf0258f..e3c4924 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index 625169c..eb85e1d 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 7796b9a..584681c 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 4529219..7512a05 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index a685b31..2338270 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 6e66fc4..f7271b0 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index 329cdaf..e89318e 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index d1e8314..fcdc793 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index 46dcfd0..f489800 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index 4b495b8..791befc 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 7f0aef8..37feaa1 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index d02f000..5668385 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index f054af8..08d7c6d 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 8e89194..65a66c6 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 578dd99..de1e5f0 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 54696d1..bfe4329 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index b949e4f..a389949 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index bc87b03..d341116 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index d88936e..66b2cf2 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 3d66ba8..0cd5ff4 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 59a4048..17ad66f 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index c2e82d5..937098f 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 93b16cb..fa6f335 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 29c0e64..2aa3fe9 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index 5ab1642..5236b95 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 9d5e284..346f53f 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index 730af6e..d320e14 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index 1baed75..b64dae0 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index cf05321..a8bbe23 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index b37cfd3..0318900 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 0746431..670c071 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 13395df..0eae4a1 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index 010eecb..dfe7fde 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 07c7864..0dc245b 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index 9d5fc40..c2a9b03 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index 1d103b4..db28ab6 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 1ea1f7e..397c45d 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index b065022..af9c9d6 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 960a8a2..10b7e4b 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index 6677789..0ef60bb 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index e34bbd1..0f87364 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 7e8c620..2fbb636 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index db7a7ab..b2df157 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index cb5ce6f..a96dc45 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index ec5e348..217249c 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 5ff2b26..2a44ce9 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index 70387bd..c87b5d6 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index d7ad611..a0f34c3 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 53efef1..57e42d2 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index 6dc3128..bbcc51a 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index c7cf580..7d0b01b 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 8228ab0..5d3a782 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 487c426..817c88e 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index 863aa1a..009246e 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index 726c9f7..54de3d3 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index 47832ea..0f9c1e5 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index 826956c..9f1d4bb 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index 5d9f11b..6781f19 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index cc18c11..72af719 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index d8a7bfc..6d025ce 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index 98dba96..5f9d2db 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index d1a21df..b5d31de 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 245ec36..9516f46 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,5 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index 830645a..138d552 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,5 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index 902d06d..cc74260 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,5 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/as/driver.cxx b/common/as/driver.cxx index 0533834..93218ac 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -1,5 +1,5 @@ // file : common/as/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type mapping (#pragma map type as ...). diff --git a/common/as/makefile b/common/as/makefile index dac0fc2..2f469fd 100644 --- a/common/as/makefile +++ b/common/as/makefile @@ -1,5 +1,5 @@ # file : common/as/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/as/test.hxx b/common/as/test.hxx index 90426bf..6c11ea5 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -1,5 +1,5 @@ // file : common/as/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 8e0c424..1df3be9 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index 49defda..c28a023 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index a87cbe3..eba1271 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 32771d4..0775c21 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1,5 +1,5 @@ // file : common/bulk/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bulk database operations. diff --git a/common/bulk/makefile b/common/bulk/makefile index 4fe94d3..3b7e5c3 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -1,5 +1,5 @@ # file : common/bulk/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 34759ed..21f105f 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,5 +1,5 @@ // file : common/driver/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index 86d71f2..b6b2dbd 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index 937b304..df1d556 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index ae5fe0a..f7da826 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index 36f02e8..eaf54f2 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-column.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index 7d00baf..58bf5e0 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-foreign-key.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index f9f029e..a47d517 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-index.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_INDEX_HXX diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index 56fcbd9..69e9ba7 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-table.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_TABLE_HXX diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index d33d040..f894b1c 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/alter-column.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index aa4c8fd..1302322 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-column.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index 0332378..a3320e0 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-foreign-key.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index a3c2d78..bc7c18b 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-index.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_INDEX_HXX diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index cf95dfe..1867624 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-table.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 19ff80d..7851665 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -1,5 +1,5 @@ # file : common/changelog/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index f2334bd..8ff2daf 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -1,5 +1,5 @@ // file : common/changelog/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index a4e9765..08ec881 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index b7825c8..13e1279 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,5 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index e989e07..292e6e5 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index 78ca657..6afaf40 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index 95961da..59b5bec 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index 8d5a0cf..cc4187b 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,5 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 1bea94c..60b3fb5 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,5 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 575fdb2..01916cf 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 8c892a0..16d4818 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index dea7829..38544f7 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index d2285f9..8f7edc9 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index a12286f..42b44fe 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index 004c197..a98046c 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index fa8c29b..074ca2f 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index ba143a5..125f7b4 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 3a2eae2..84ca7ec 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index e086bac..423f86c 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 37afee1..2bf87b0 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,5 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 6a077bd..671ce79 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index db22c1f..fd669d6 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index b819bce..c0d8f1a 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,5 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 6ffa370..70d16e8 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 7030c8d..d15ebf4 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index 0dc36f6..d8cf733 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 76fb123..c588012 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 728800b..f88e703 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index 4654019..e1c638b 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index 76d105f..d6e938d 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index 56a82f5..46a1cd7 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,5 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index 5fa391e..b620b66 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,5 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index 80a69fb..2657322 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,5 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index 3445d60..b8f1c71 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,5 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 33e9350..47a96bf 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index 7180cd7..beeca95 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index e6eade3..b810b65 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index b851636..934b29e 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index af3a605..ff5dd3c 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 61c0be6..573250f 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx index 3cd1e84..0430a6c 100644 --- a/common/id/auto/driver.cxx +++ b/common/id/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/auto/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/id/auto/makefile b/common/id/auto/makefile index 95569d6..eb841ad 100644 --- a/common/id/auto/makefile +++ b/common/id/auto/makefile @@ -1,5 +1,5 @@ # file : common/id/auto/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx index 5dd13f4..72d48ba 100644 --- a/common/id/auto/test.hxx +++ b/common/id/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx index 640855b..4f628eb 100644 --- a/common/id/composite/driver.cxx +++ b/common/id/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/composite/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/id/composite/makefile b/common/id/composite/makefile index a8d5fb5..ced82cc 100644 --- a/common/id/composite/makefile +++ b/common/id/composite/makefile @@ -1,5 +1,5 @@ # file : common/id/composite/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx index 4409a8a..c953106 100644 --- a/common/id/composite/test.hxx +++ b/common/id/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/id/composite/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx index fc4502e..00471d1 100644 --- a/common/id/nested/driver.cxx +++ b/common/id/nested/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/nested/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test nested ids. diff --git a/common/id/nested/makefile b/common/id/nested/makefile index af2f6a3..2714b95 100644 --- a/common/id/nested/makefile +++ b/common/id/nested/makefile @@ -1,5 +1,5 @@ # file : common/id/nested/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx index 3a521e3..97a6586 100644 --- a/common/id/nested/test.hxx +++ b/common/id/nested/test.hxx @@ -1,5 +1,5 @@ // file : common/id/nested/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index c92d10e..cb79063 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index 2b2175a..15aee8d 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index c556908..630890e 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index d947d08..1730208 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index ee0a909..91c6c8c 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index c616514..b44ad10 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index 7713690..2c60188 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 28d64a7..cce061e 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index be34844..40daabb 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index a1a465d..5a2eeff 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 27ea49b..9fe9489 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 7326164..8e3b83a 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 4c9fc9e..86272e5 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index f78e540..b33913f 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,5 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index ade2b99..143b95c 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,5 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index 1f465c6..51658a5 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,5 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 4ed1427..d243768 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index b464d97..992d9bb 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index e298641..204f131 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index e1e26f3..e1baf97 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index 7869bcf..f2918ce 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index 6368bbd..410b5c7 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx index 4a88946..f5637f5 100644 --- a/common/inheritance/polymorphism/test13.hxx +++ b/common/inheritance/polymorphism/test13.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test13.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx index 058cf1b..98c1c99 100644 --- a/common/inheritance/polymorphism/test14.hxx +++ b/common/inheritance/polymorphism/test14.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test14.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx index f3d3a7f..218a121 100644 --- a/common/inheritance/polymorphism/test15.hxx +++ b/common/inheritance/polymorphism/test15.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test15.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index 74782c7..b8880a3 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index 2c14080..6953afc 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index ea1e4f8..c12ce25 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index dfabddf..082b574 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index 25d70cc..4138163 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index b7b8afe..137a6a6 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index d1f9a61..08459fc 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index 637093c..dee4786 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 763f023..91571c8 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 3f7583f..16f9c08 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 86b4cb2..9e0650f 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index 3c73b83..b56173d 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index d70aa2f..4500a7a 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index 5b1aaa6..5f7fbf8 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 689d84d..8df1114 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index 88be6d0..fb19718 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index dde3f92..2c96e29 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 8cd2b0a..7813134 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 94fe58c..89f1e65 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index b5ac1ff..175e830 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 2cd21e4..8532a5c 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index e2bfe56..b256a1c 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 111d299..a0d7423 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index c0eea03..51f17ba 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index 862e456..ae1a216 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 8ff6085..e03c653 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 2d71afc..41129ac 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/object/driver.cxx b/common/object/driver.cxx index 6f07cd6..1e0fc83 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -1,5 +1,5 @@ // file : common/object/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes. diff --git a/common/object/makefile b/common/object/makefile index b380acb..17074fe 100644 --- a/common/object/makefile +++ b/common/object/makefile @@ -1,5 +1,5 @@ # file : common/object/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/object/test.hxx b/common/object/test.hxx index e23e876..e7a5032 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -1,5 +1,5 @@ // file : common/object/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 5af1c8c..38b19e1 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index a4e9abe..a04ccf8 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 2799560..04c4037 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 36a7307..6dffe46 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index 3b42884..9c8fb42 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index 8d70404..1d09d1e 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index e61eacb..5f7ada1 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,5 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index c93da15..3494dcf 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,5 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 87337bd..4db26ae 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,5 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 9d70c95..21437c1 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index cc6d085..fe8e994 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,5 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index 059e3f9..e923e11 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,5 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index a5fe21f..d226863 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index b2e46ff..ce8a31b 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,5 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 0f75c63..ce34757 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx index 234e0cc..a903846 100644 --- a/common/query/one/driver.cxx +++ b/common/query/one/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/one/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query one support. diff --git a/common/query/one/makefile b/common/query/one/makefile index f48d9d8..5b36aa4 100644 --- a/common/query/one/makefile +++ b/common/query/one/makefile @@ -1,5 +1,5 @@ # file : common/query/one/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx index 7634dc2..7dbc8e8 100644 --- a/common/query/one/test.hxx +++ b/common/query/one/test.hxx @@ -1,5 +1,5 @@ // file : common/query/one/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index e31891c..9cb6f33 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index 1f5d2bf..b84d0a2 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index c8576c9..e5ff341 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index 6cb8d00..e0e1c0f 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index 67c7a80..fe085fb 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -1,5 +1,5 @@ # file : common/relationship/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index ab3cd79..1883393 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index 7e86982..f8cb21a 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test ON DELETE functionality. diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index 93878a8..2b5a7ba 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -1,5 +1,5 @@ # file : common/relationship/on-delete/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx index 7917bef..a647162 100644 --- a/common/relationship/on-delete/test.hxx +++ b/common/relationship/on-delete/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index b3a7ffa..7e6e1e2 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index c373059..3b0e089 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/query/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 199e94c..d7e7b87 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 7eaf782..7edd819 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index aba0704..a402083 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index aa2e43f..c4d12fa 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index b8b22b2..f6d96f1 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 53d19f6..38f0610 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index 91f9ebb..01fa538 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index cfe1d95..5a1e0fe 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index 775323f..77fa74b 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 5d2b36e..1643225 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,5 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index b4471d5..c61114a 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index dd302e8..046fc61 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object section basics. diff --git a/common/section/basics/makefile b/common/section/basics/makefile index 8b24c68..ddf6a9d 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -1,5 +1,5 @@ # file : common/section/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index c3c42e0..3e37829 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/section/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index 9eb5b56..b0a7231 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test sections in polymorphic objects. diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index 7554f79..c91aa2b 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/section/polymorphism/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index a7101da..8e10307 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index c26f2a1..831430b 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index ef78545..debeeea 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,5 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index 1c6fccc..af56b2a 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,5 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 3e7e1d0..f0cfc62 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index d9a2e33..18c0705 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,5 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index b59b9cd..1267d7f 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index f93bc7c..95ce596 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index e51073e..d3ae4e1 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,5 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index aaeaf9a..f5ce295 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 3ee0e28..b2cbdf6 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -1,5 +1,5 @@ // file : common/statement/processing/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test internal statement processing machinery. diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 6ecdb6d..21ff739 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -1,5 +1,5 @@ # file : common/statement/processing/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 52c92e0..cc9af8b 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 05660e7..3adfa9d 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 4d4525b..50d1e77 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index fe6fb30..02e5834 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 6308362..7d9f5ed 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 64211ad..35688d0 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index e32731c..d676f5b 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index 401729b..47122c0 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index a8f68b3..4fec133 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 292db00..c43cfa0 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,5 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index cb8c814..e987599 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 9e501f9..6988c22 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,5 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 4f1b69d..752c2c9 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index cdbbd02..9100220 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index fe7c118..e88b4cb 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index 7e4d88a..c5d80d4 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test view basics. diff --git a/common/view/basics/makefile b/common/view/basics/makefile index 4611a23..57f37fa 100644 --- a/common/view/basics/makefile +++ b/common/view/basics/makefile @@ -1,5 +1,5 @@ # file : common/view/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 28cd17e..162ce7d 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/view/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index c2d89a2..510b209 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/olv/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object loading views. diff --git a/common/view/olv/makefile b/common/view/olv/makefile index 4c7d955..db7775f 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -1,5 +1,5 @@ # file : common/view/olv/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index 097634e..7e4a0d8 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx index c1d253d..ad5fbdc 100644 --- a/common/view/olv/test2.hxx +++ b/common/view/olv/test2.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx index 480e568..730b36a 100644 --- a/common/view/olv/test3.hxx +++ b/common/view/olv/test3.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx index bbacdff..cc53fdb 100644 --- a/common/view/olv/test4.hxx +++ b/common/view/olv/test4.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test4.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx index a799668..2a50f1b 100644 --- a/common/view/olv/test5.hxx +++ b/common/view/olv/test5.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test5.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx index d61d847..957c4d4 100644 --- a/common/view/olv/test6.hxx +++ b/common/view/olv/test6.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test6.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index 4a85e19..7c3d527 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test7.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index e539af0..244d915 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test8.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx index 9d3231e..7cf49bb 100644 --- a/common/view/olv/test9.hxx +++ b/common/view/olv/test9.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test9.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index f9b0b33..ff105c3 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,5 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index 028c7cb..4daf9ba 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,5 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index e1aab06..01c7edc 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,5 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 77048a0..8005e21 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 6b9efb6..8ba49da 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 75f987b..91259a4 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 3144b38..1b9a62d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx index 0260825..f2663fc 100644 --- a/diagnostics/containers-of-containers.hxx +++ b/diagnostics/containers-of-containers.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/evolution/Makefile.am b/evolution/Makefile.am index 877bd4a..dd60c57 100644 --- a/evolution/Makefile.am +++ b/evolution/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 2f20a85..095f1e4 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-column/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new column. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index b3b5fa8..bd42f31 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -1,5 +1,5 @@ # file : evolution/add-column/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx index 33e21bf..0e596c7 100644 --- a/evolution/add-column/model.hxx +++ b/evolution/add-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index 47086a8..bc3194b 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index e938862..5bdc379 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx index 9fe3a71..0dfd8b3 100644 --- a/evolution/add-column/test3.hxx +++ b/evolution/add-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index 4d74854..cbcbdea 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a foreign key. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index fb1e516..f76a63a 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/add-foreign-key/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index 59971e0..f63ecf1 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index 8da0d96..4772364 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index 7403f59..4a5fb64 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx index 85e7dff..d95619a 100644 --- a/evolution/add-foreign-key/test3.hxx +++ b/evolution/add-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index 634e4ff..3a4c58d 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new index. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 22e5865..f405e58 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -1,5 +1,5 @@ # file : evolution/add-index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx index 6f644f8..514e6f5 100644 --- a/evolution/add-index/model.hxx +++ b/evolution/add-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index 8b7065a..c1300e4 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index 24080c3..f1dfd6f 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx index 9157235..bf68cef 100644 --- a/evolution/add-index/test3.hxx +++ b/evolution/add-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index 9cb3382..06dd8e5 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-table/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new table (object, container). diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index 007cd01..a1f0f91 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -1,5 +1,5 @@ # file : evolution/add-table/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx index a20c419..fc82365 100644 --- a/evolution/add-table/model.hxx +++ b/evolution/add-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index 97a9dfb..6b0c105 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index c1d8f4c..a9640ce 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx index 32786e6..96266c0 100644 --- a/evolution/add-table/test3.hxx +++ b/evolution/add-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index fee1a39..c6aa6fc 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test altering a column. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 62fc6c8..8d3926e 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -1,5 +1,5 @@ # file : evolution/alter-column/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index ebbb6b2..ca85585 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index c6dc2d5..80f9c38 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index 5b3ecbb..77a653b 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx index 26ef52a..21943e9 100644 --- a/evolution/alter-column/test3.hxx +++ b/evolution/alter-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index 7bfcfe6..fff98d0 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/combined/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Combined schema evolution test. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 2116edc..7a44b52 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -1,5 +1,5 @@ # file : evolution/combined/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 1f59379..9cc405d 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index c61d4ac..c24c729 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 5378a7b..070ef82 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx index 303e0bb..f99a6f5 100644 --- a/evolution/combined/test3.hxx +++ b/evolution/combined/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index a8f399e..d564fb3 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/data/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test data migration support. diff --git a/evolution/data/makefile b/evolution/data/makefile index f519fc7..24a90bc 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -1,5 +1,5 @@ # file : evolution/data/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx index 94393a3..ac3d086 100644 --- a/evolution/data/model.hxx +++ b/evolution/data/model.hxx @@ -1,5 +1,5 @@ // file : evolution/data/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx index 60da887..20f4b6e 100644 --- a/evolution/data/test1.hxx +++ b/evolution/data/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx index 91bad40..a6bdf6f 100644 --- a/evolution/data/test2.hxx +++ b/evolution/data/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx index 1abe715..55487e4 100644 --- a/evolution/data/test3.hxx +++ b/evolution/data/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index c50f5c4..19dbcee 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a column. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 251a07b..c464240 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-column/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index 0cc56b8..8c998f3 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index efea344..cf66332 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index 4916f82..433625e 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx index 4d414c9..4e597e8 100644 --- a/evolution/drop-column/test3.hxx +++ b/evolution/drop-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index 579cc44..edb4dc5 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a foreign key. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index a4cb120..5f2f38c 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-foreign-key/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index 84f4873..97c3e30 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index 26273dc..d5b774f 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index 812b075..72fbd1d 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx index dbfea70..fd5672b 100644 --- a/evolution/drop-foreign-key/test3.hxx +++ b/evolution/drop-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 990a779..137f001 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping an index. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 8304515..b5a4169 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx index 4d09328..68356e4 100644 --- a/evolution/drop-index/model.hxx +++ b/evolution/drop-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index 4cdba13..f38b85f 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index 6bbef44..d1d06f3 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx index 7a7af41..dd0b974 100644 --- a/evolution/drop-index/test3.hxx +++ b/evolution/drop-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 924118b..7909d89 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a table (object, container). diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 24b8957..28f930f 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-table/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index de3f3ba..09e9f73 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index 3d76ff6..1672473 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index deb83a2..3e0899c 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx index 43ccc49..a8e974f 100644 --- a/evolution/drop-table/test3.hxx +++ b/evolution/drop-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 1cae9de..72b91d8 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/embedded/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test embedded schema migration. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 92eacf7..3510745 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -1,5 +1,5 @@ # file : evolution/embedded/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx index b53a013..da16a12 100644 --- a/evolution/embedded/model.hxx +++ b/evolution/embedded/model.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx index 0dceaf4..4ab79e7 100644 --- a/evolution/embedded/test1.hxx +++ b/evolution/embedded/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx index ccc2225..da007ad 100644 --- a/evolution/embedded/test2.hxx +++ b/evolution/embedded/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx index 4498943..8b36b61 100644 --- a/evolution/embedded/test3.hxx +++ b/evolution/embedded/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 16ff5d7..378fba7 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -1,5 +1,5 @@ # file : evolution/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 8fd2255..8986aa0 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-add functionality. diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 3ce57c7..9c6a132 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-add/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index e262e6c..8913e02 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx index 4f3cda8..0799897 100644 --- a/evolution/soft-add/test1.hxx +++ b/evolution/soft-add/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx index 732e00e..ca14b5f 100644 --- a/evolution/soft-add/test2.hxx +++ b/evolution/soft-add/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx index 367fae6..0a7f341 100644 --- a/evolution/soft-add/test3.hxx +++ b/evolution/soft-add/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 46b24a5..af3de6f 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-delete functionality. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index b52bf49..1bc5e40 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-delete/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index 9f3a256..c8f31db 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx index 423c921..6f6a991 100644 --- a/evolution/soft-delete/test1.hxx +++ b/evolution/soft-delete/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx index eaaaa8d..9edb8fe 100644 --- a/evolution/soft-delete/test2.hxx +++ b/evolution/soft-delete/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx index 07909a8..d005bce 100644 --- a/evolution/soft-delete/test3.hxx +++ b/evolution/soft-delete/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 5a9527b..6242f1c 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 57e0b65..6666cf0 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/evolution/template/makefile b/evolution/template/makefile index b3747bc..e3934fe 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -1,5 +1,5 @@ # file : evolution/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx index f8913d0..79437f9 100644 --- a/evolution/template/model.hxx +++ b/evolution/template/model.hxx @@ -1,5 +1,5 @@ // file : evolution/template/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index ed847c6..6d37e7e 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index 73793f7..5588f27 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx index 8aec67e..4a53a0c 100644 --- a/evolution/template/test3.hxx +++ b/evolution/template/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/test.bat b/evolution/test.bat index 5892a33..2a78253 100644 --- a/evolution/test.bat +++ b/evolution/test.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/evolution/tester.bat b/evolution/tester.bat index 5f7f3cc..1a6da1a 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/tester.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/evolution/tester.in b/evolution/tester.in index fc7fd9c..6ad23a6 100755 --- a/evolution/tester.in +++ b/evolution/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : evolution/tester.in -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index e80c367..89ab88e 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/version/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test schema version access via the database instance. diff --git a/evolution/version/makefile b/evolution/version/makefile index 96a6c99..bb5603d 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -1,5 +1,5 @@ # file : evolution/version/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx index da9dcb7..dc218ef 100644 --- a/evolution/version/model.hxx +++ b/evolution/version/model.hxx @@ -1,5 +1,5 @@ // file : evolution/version/model.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx index 816e4c1..3870220 100644 --- a/evolution/version/test1.hxx +++ b/evolution/version/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test1.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx index dae00c4..1da2e5a 100644 --- a/evolution/version/test2.hxx +++ b/evolution/version/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test2.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx index 8fba5cb..bd91ca1 100644 --- a/evolution/version/test3.hxx +++ b/evolution/version/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test3.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index 071259e..96be71f 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index a09f794..1eba32c 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index c888099..a7ee2d8 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a2a38d4..ca1240b 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 0294d46..6238389 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index c242c63..d2a6be5 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 84bf4f0..1d94321 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 9517f72..43d019f 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 85d4e92..f5e060f 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 5032b68..a2db12f 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 5edd65a..114d9f9 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 24e9fa0..c406fd3 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index 4c41e9e..0012b83 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 464b555..1508103 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,5 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index 2512caf..1afe08b 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 5e69966..46d2d10 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index 7ebd045..9f1e22f 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 82eb0ec..48a064e 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index baf04e4..52218ac 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index a7addcf..ddc8c8e 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 3f1b71f..2f3aeec 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index b4868b9..ee7f8b2 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index 7ca7942..214eee9 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index 68e4bd8..d7fed36 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index ad1d316..7cffd60 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index c4e7118..4ed10e0 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index acafbb0..772b821 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index c816042..216164d 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 644759e..b1d36e7 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index f644ed2..2c404bb 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index b1ceacb..a1ceeaf 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index d2f7281..a6f7537 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index 375a489..a235e2d 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index fb07f49..96e3706 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index e07a37d..b095d18 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index b98e72f..3a95900 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index 3576178..ccc68a8 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index a2c7641..5e8ec51 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 8283699..fcc42d0 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 338013d..28f3a38 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 91fd40f..2772d91 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,5 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index 58a6edb..8d29386 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 763cbfe..a787c6f 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx index 3f7430d..4583fef 100644 --- a/mssql/custom/traits.cxx +++ b/mssql/custom/traits.cxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include "traits.hxx" diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index ec6ef25..c4673df 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index 0a4ee4b..c781c11 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index 21782b9..c01d9a0 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,5 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index 0dcc23c..c834388 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 03df585..2210f50 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index b6b76d1..7b70116 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index f932b6f..e921ffb 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index 6c8bf4c..d67db93 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index d9c14df..9553307 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index f8199c3..2d14cd5 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server stored procedure support. diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile index e5ef70b..b74ed6a 100644 --- a/mssql/stored-proc/makefile +++ b/mssql/stored-proc/makefile @@ -1,5 +1,5 @@ # file : mssql/stored-proc/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index e57c1ec..5dc775c 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 6c54eaa..0231baa 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 978e4fa..cb7cece 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index 3ff90ba..fafc2dd 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index c3c661b..3319eda 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index caf5dc0..d00f1db 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 49c586a..30b775c 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index fb16fb5..026cc31 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 8f0c521..34dab5b 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index 1352529..fd80118 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index de60a3c..74cfa07 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 6e08d73..8e33c41 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index f59a0b2..78bb467 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 7cf0d03..e907a10 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,5 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index 72c8516..56bac36 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index ed7c801..3dbb5fe 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 0a43bf6..27d33b4 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index 46f0523..28950e0 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index 0621716..012db1e 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,5 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index 0d3c7a9..b33dcfd 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index bb739fa..705b0b0 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,5 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index d3dc130..27eeaf5 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index 4a29217..781390b 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index fe340e3..d6fcd7a 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index a675733..f60421c 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 23c8b68..690cb38 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 795c574..fd146ef 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 9ad0707..adf4704 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index c5bdc46..f500e5e 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index 0ec343b..b17e727 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 9e6aac2..c12a4cd 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 3bd68ce..449f033 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 2321aea..d668cd2 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index cb67b7a..86fb69f 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 465a51a..59eb088 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 63e5531..7aa23b5 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 8ea15de..3125e44 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index d8fda7d..58e8f8d 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index 263bb22..e1e17c9 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index fbb4f81..8cc41b9 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index 33af69f..ec17c7f 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,5 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index f44625c..430bb19 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,5 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index b63e3a0..6dedc8d 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index 62e3504..163382a 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 70392e7..6a4c601 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,5 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index c7dd558..a715c48 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index c724949..39974a5 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index c938851..8a33abc 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index 0a97e05..b44f8dc 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 252b286..d41f066 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index 85583a2..af39750 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index bce71bd..6e1bec6 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 5ae40cd..5779658 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 5554b26..6ab69c8 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index cd462ee..591503d 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 70c1fc3..eab2e29 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 2cf8f45..4bbe98d 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 8e39cc8..743fd7b 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index 3c684da..e2b3aed 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index 59be4ac..7797632 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 1623bf1..9c1a107 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,5 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index 962bf92..fc912f3 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index e9e3fa3..122b7cd 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index a141454..cdd9cf0 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index b64aec8..3eba943 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 28eba96..5a03e5e 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,5 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 24513c0..6a5d5eb 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 1c5b934..9c7e7ef 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,5 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index 8d1ba3b..8f99019 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index beac705..35ed117 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 1a984a6..f1c028e 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index a204a68..00056e2 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index 453f9e0..fb65fef 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index fdc68ce..b96fbfe 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 6854e51..529bb73 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 2e4b16c..98b3850 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index 88e900c..5971f7a 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 24d61c9..935b061 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 8b08786..74000ad 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 58226fc..c06aa7e 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 1a58ef5..f20fb94 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index e59018a..ccc4d70 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 3565139..b96ea3c 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index e3f97e7..69a3435 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index 2ed6eab..e0a3200 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index 5d0125e..0363805 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 46b6adc..510cdb4 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index fb70c99..7818604 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index ef39ca3..e44c141 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,5 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index 0f11dfd..456899b 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index 5bb51fe..4d4afca 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 785398d..e4e34cd 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index ad7442c..dae4178 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 8983d49..425807c 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 20b8d9c..46d8cae 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index f4ed192..4f04860 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index e48da46..7caf253 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index c1fe7ed..7f3b1a2 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 567b46b..194c533 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index f8ba307..c27b6e0 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index 524e781..fbc95da 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index d6c38ce..be68d02 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 987953e..59ced7f 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index d7856fb..8503ec2 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index 6457620..2e23e6c 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index 2569f57..bff2351 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 9cf7dd8..1f8699c 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 9f7c1df..de6adf8 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 3df9624..88a1e97 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index ec60d0b..809c69b 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 081be19..360fedb 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 5b55757..e88c796 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index db19fc9..918c547 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index dcc0cce..e35be4b 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index e8819cb..3ef31c5 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index e6e9774..7f25b39 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index 21b05f1..d7dbff5 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index e1eb5a2..706168b 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index 969dc44..f7304c1 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index 72fe502..e3fb38e 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index 2c12704..176205d 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index bf0afc7..0f05f8d 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index 4cc00d1..965f68a 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index ef0b0f2..43719df 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 8859c4c..309f039 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index a25bf98..8886996 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 166f591..48e864e 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 28f56a4..5398874 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index dbac8d5..6ccf907 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 1f579ea..be117a2 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index c9d94aa..47fd9ac 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index 461f07e..a08f0e1 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index 7853ab7..d60bf46 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 21f7fff..668363a 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 9e4775f..df56969 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 0c3eec5..9a1b66b 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index da4ff52..805a0fc 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 2b26acd..a180667 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 0ff5c29..718dbc4 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 0d21b73..87993a5 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 87d244c..eaa8157 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index 1d02e63..dc38d24 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 059e002..05fa075 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index d922531..f7d0db1 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index d48aa83..57eba94 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index a92fce8..76f40a1 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 8440a92..9583daa 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index a032533..5129f8a 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index b897949..eb35f99 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index d37dcdd..cbd8b63 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index f1e0a4c..9f12345 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index a07cbb8..d6b4fce 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 6db1b28..b434976 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index e0b75be..1e84066 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 1911fbb..6513fca 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 5525a3d..7ade072 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index bee91fe..9449384 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index d2d185e..eacc994 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 9920d88..082b739 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index b411c98..3d7b198 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 07b6626..6b61b24 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 84c4766..773dd96 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 316d087..2176305 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 1d88614..00133b9 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 678baa9..477deb5 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 10a0202..c3c10ed 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index bbbb172..7a2c271 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 6db45c3..14193b1 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 6b94a8d..abedf1a 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index 98526ca..d3c7daa 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index b542cc0..b9eaf97 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 76be78d..7cfd03c 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index bb6d547..f4da9e8 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/auto/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test manual/automatic id assignment. diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile index dfafa22..501da48 100644 --- a/sqlite/auto/makefile +++ b/sqlite/auto/makefile @@ -1,5 +1,5 @@ # file : sqlite/auto/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx index 3d3afe7..90d92e8 100644 --- a/sqlite/auto/test.hxx +++ b/sqlite/auto/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/auto/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 2087621..b2ed2d9 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 6b947b5..450f68e 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,5 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index 4448f5d..7e6bfaf 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index e978269..e9e3221 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 8b9ef2e..74f5679 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,5 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index 00b9b48..72bc6cc 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 5174afe..c075b0b 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 3b78ae8..114296d 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 98211e5..226650f 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/stream/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite BLOB/TEXT incremental I/O. diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile index 1b8d326..cbfae24 100644 --- a/sqlite/stream/makefile +++ b/sqlite/stream/makefile @@ -1,5 +1,5 @@ # file : sqlite/stream/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx index db2eeea..edbac11 100644 --- a/sqlite/stream/test.hxx +++ b/sqlite/stream/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/stream/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index ec503c5..a2a37e9 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index f66d396..044475b 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 7665813..8a5e99f 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index dabcc78..57c5bc7 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index 737868d..68cb805 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index de171c6..c33f6e7 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test esoteric SQLite transaction semantics aspects. diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index 446d2ae..c60ebfc 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -1,5 +1,5 @@ # file : sqlite/transaction/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx index f6b2fe2..8ab70b7 100644 --- a/sqlite/transaction/test.hxx +++ b/sqlite/transaction/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 20b71ba..c22ef26 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index c55dbeb..d2c2fbe 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 3fde8cc..0a0490f 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 0dc3a22..266808e 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index a1a752e..9177641 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 2880c1b..c98b94a 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index a1ad680..db5e264 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index d1052a7..91ea3b8 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index 19318cc..16145c5 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index 92c970a..af8003c 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From 2f424a3b59ec60bff241917acff86c8d0028c453 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 May 2018 14:46:09 +0200 Subject: Bump version to 2.5.0-b.7 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 62aaa61..9042314 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.6 +2.5.0-b.7 -- cgit v1.1 From a0a1e8b8bf413b1a6d65e72fe144b5ad1d730e93 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 31 May 2018 09:19:39 +0200 Subject: Bump version to 2.5.0-b.8.z, master is open for business --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 9042314..1f23e23 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.7 +2.5.0-b.8 -- cgit v1.1 From 2724903e1e9a5ca9b9b456907ba4b9058038224c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 11 Sep 2018 10:27:53 +0200 Subject: Release version 2.5.0-b.9 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 1f23e23..fcff677 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.8 +2.5.0-b.9 -- cgit v1.1 From e93146629aa6abf64ee86994c52b0efc35f7275a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 Sep 2018 14:26:01 +0200 Subject: Bump version to 2.5.0-b.10.z, master is open for business --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index fcff677..c8f4946 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.9 +2.5.0-b.10 -- cgit v1.1 From 3e887885ec753f2cb0a9bba6fb4e856e51194a5c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 17 Jan 2019 11:24:18 +0300 Subject: Update copyright year --- Makefile.am | 2 +- boost/Makefile.am | 2 +- boost/build.bat | 2 +- boost/common/Makefile.am | 2 +- boost/common/makefile | 2 +- boost/common/multi-index/driver.cxx | 2 +- boost/common/multi-index/makefile | 2 +- boost/common/multi-index/test.hxx | 2 +- boost/common/optional/driver.cxx | 2 +- boost/common/optional/makefile | 2 +- boost/common/optional/test.hxx | 2 +- boost/common/smart-ptr/driver.cxx | 2 +- boost/common/smart-ptr/makefile | 2 +- boost/common/smart-ptr/test.hxx | 2 +- boost/common/template/Makefile.am | 2 +- boost/common/template/driver.cxx | 2 +- boost/common/template/makefile | 2 +- boost/common/template/test.hxx | 2 +- boost/common/test.bat | 2 +- boost/common/unordered/driver.cxx | 2 +- boost/common/unordered/makefile | 2 +- boost/common/unordered/test.hxx | 2 +- boost/common/uuid/driver.cxx | 2 +- boost/common/uuid/makefile | 2 +- boost/common/uuid/test.hxx | 2 +- boost/makefile | 2 +- boost/mssql/Makefile.am | 2 +- boost/mssql/date-time/driver.cxx | 2 +- boost/mssql/date-time/makefile | 2 +- boost/mssql/date-time/test.hxx | 2 +- boost/mssql/makefile | 2 +- boost/mssql/template/Makefile.am | 2 +- boost/mssql/template/driver.cxx | 2 +- boost/mssql/template/makefile | 2 +- boost/mssql/template/test.hxx | 2 +- boost/mssql/test.bat | 2 +- boost/mysql/Makefile.am | 2 +- boost/mysql/date-time/driver.cxx | 2 +- boost/mysql/date-time/makefile | 2 +- boost/mysql/date-time/test.hxx | 2 +- boost/mysql/makefile | 2 +- boost/mysql/template/Makefile.am | 2 +- boost/mysql/template/driver.cxx | 2 +- boost/mysql/template/makefile | 2 +- boost/mysql/template/test.hxx | 2 +- boost/mysql/test.bat | 2 +- boost/oracle/Makefile.am | 2 +- boost/oracle/date-time/driver.cxx | 2 +- boost/oracle/date-time/makefile | 2 +- boost/oracle/date-time/test.hxx | 2 +- boost/oracle/makefile | 2 +- boost/oracle/template/Makefile.am | 2 +- boost/oracle/template/driver.cxx | 2 +- boost/oracle/template/makefile | 2 +- boost/oracle/template/test.hxx | 2 +- boost/oracle/test.bat | 2 +- boost/pgsql/Makefile.am | 2 +- boost/pgsql/date-time/driver.cxx | 2 +- boost/pgsql/date-time/makefile | 2 +- boost/pgsql/date-time/test.hxx | 2 +- boost/pgsql/makefile | 2 +- boost/pgsql/template/Makefile.am | 2 +- boost/pgsql/template/driver.cxx | 2 +- boost/pgsql/template/makefile | 2 +- boost/pgsql/template/test.hxx | 2 +- boost/pgsql/test.bat | 2 +- boost/sqlite/Makefile.am | 2 +- boost/sqlite/date-time/driver.cxx | 2 +- boost/sqlite/date-time/makefile | 2 +- boost/sqlite/date-time/test.hxx | 2 +- boost/sqlite/makefile | 2 +- boost/sqlite/template/Makefile.am | 2 +- boost/sqlite/template/driver.cxx | 2 +- boost/sqlite/template/makefile | 2 +- boost/sqlite/template/test.hxx | 2 +- boost/sqlite/test.bat | 2 +- bootstrap | 2 +- build.bat | 2 +- build/bootstrap.make | 2 +- build/configuration-rules.make | 2 +- build/configuration.make | 2 +- build/configure | 2 +- build/import/libboost/configuration-rules.make | 2 +- build/import/libboost/configure | 2 +- build/import/libboost/date-time/rules.make | 2 +- build/import/libboost/date-time/stub.make | 2 +- build/import/libboost/header-only/rules.make | 2 +- build/import/libboost/header-only/stub.make | 2 +- build/import/libodb-boost/configuration-rules.make | 2 +- build/import/libodb-boost/configure | 2 +- build/import/libodb-boost/stub.make | 2 +- build/import/libodb-mssql/configuration-rules.make | 2 +- build/import/libodb-mssql/configure | 2 +- build/import/libodb-mssql/stub.make | 2 +- build/import/libodb-mysql/configuration-rules.make | 2 +- build/import/libodb-mysql/configure | 2 +- build/import/libodb-mysql/stub.make | 2 +- build/import/libodb-oracle/configuration-rules.make | 2 +- build/import/libodb-oracle/configure | 2 +- build/import/libodb-oracle/stub.make | 2 +- build/import/libodb-pgsql/configuration-rules.make | 2 +- build/import/libodb-pgsql/configure | 2 +- build/import/libodb-pgsql/stub.make | 2 +- build/import/libodb-qt/configuration-rules.make | 2 +- build/import/libodb-qt/configure | 2 +- build/import/libodb-qt/stub.make | 2 +- build/import/libodb-sqlite/configuration-rules.make | 2 +- build/import/libodb-sqlite/configure | 2 +- build/import/libodb-sqlite/stub.make | 2 +- build/import/libodb/configuration-rules.make | 2 +- build/import/libodb/configure | 2 +- build/import/libodb/stub.make | 2 +- build/import/libqt/configuration-rules.make | 2 +- build/import/libqt/configure | 2 +- build/import/libqt/core/rules.make | 2 +- build/import/libqt/core/stub.make | 2 +- build/import/odb/configuration-rules.make | 2 +- build/import/odb/configure | 2 +- build/import/odb/hxx-cxx.make | 2 +- build/import/odb/stub.make | 2 +- build/mssql/configure | 2 +- build/mssql/mssql | 2 +- build/mysql/configure | 2 +- build/mysql/mysql | 2 +- build/oracle/configure | 2 +- build/oracle/oracle | 2 +- build/pgsql/configure | 2 +- build/pgsql/pgsql | 2 +- build/sqlite/configure | 2 +- common/Makefile.am | 2 +- common/access/driver.cxx | 2 +- common/access/makefile | 2 +- common/access/test.hxx | 2 +- common/as/driver.cxx | 2 +- common/as/makefile | 2 +- common/as/test.hxx | 2 +- common/blob/driver.cxx | 2 +- common/blob/makefile | 2 +- common/blob/test.hxx | 2 +- common/bulk/driver.cxx | 2 +- common/bulk/makefile | 2 +- common/bulk/test.hxx | 2 +- common/callback/driver.cxx | 2 +- common/callback/makefile | 2 +- common/callback/test.hxx | 2 +- common/changelog/add-column.hxx | 2 +- common/changelog/add-foreign-key.hxx | 2 +- common/changelog/add-index.hxx | 2 +- common/changelog/add-table.hxx | 2 +- common/changelog/alter-column.hxx | 2 +- common/changelog/drop-column.hxx | 2 +- common/changelog/drop-foreign-key.hxx | 2 +- common/changelog/drop-index.hxx | 2 +- common/changelog/drop-table.hxx | 2 +- common/changelog/makefile | 2 +- common/changelog/model.hxx | 2 +- common/circular/multiple/driver.cxx | 2 +- common/circular/multiple/makefile | 2 +- common/circular/multiple/test1.hxx | 2 +- common/circular/multiple/test2.hxx | 2 +- common/circular/single/driver.cxx | 2 +- common/circular/single/makefile | 2 +- common/circular/single/test.hxx | 2 +- common/composite/driver.cxx | 2 +- common/composite/makefile | 2 +- common/composite/test.hxx | 2 +- common/const-member/driver.cxx | 2 +- common/const-member/makefile | 2 +- common/const-member/test.hxx | 2 +- common/const-object/driver.cxx | 2 +- common/const-object/makefile | 2 +- common/const-object/test.hxx | 2 +- common/container/basics/driver.cxx | 2 +- common/container/basics/makefile | 2 +- common/container/basics/test.hxx | 2 +- common/container/change-tracking/driver.cxx | 2 +- common/container/change-tracking/makefile | 2 +- common/container/change-tracking/test.hxx | 2 +- common/ctor/driver.cxx | 2 +- common/ctor/makefile | 2 +- common/ctor/test.hxx | 2 +- common/default/driver.cxx | 2 +- common/default/makefile | 2 +- common/default/test.hxx | 2 +- common/definition/driver.cxx | 2 +- common/definition/makefile | 2 +- common/definition/test.hxx | 2 +- common/definition/time-mapping.hxx | 2 +- common/enum/driver.cxx | 2 +- common/enum/makefile | 2 +- common/enum/test.hxx | 2 +- common/erase-query/driver.cxx | 2 +- common/erase-query/makefile | 2 +- common/erase-query/test.hxx | 2 +- common/id/auto/driver.cxx | 2 +- common/id/auto/makefile | 2 +- common/id/auto/test.hxx | 2 +- common/id/composite/driver.cxx | 2 +- common/id/composite/makefile | 2 +- common/id/composite/test.hxx | 2 +- common/id/nested/driver.cxx | 2 +- common/id/nested/makefile | 2 +- common/id/nested/test.hxx | 2 +- common/include/driver.cxx | 2 +- common/include/makefile | 2 +- common/include/obj1.hxx | 2 +- common/include/obj2.hxx | 2 +- common/include/obj3.hxx | 2 +- common/include/objs1.hxx | 2 +- common/include/objs2.hxx | 2 +- common/include/objs3.hxx | 2 +- common/include/objs4.hxx | 2 +- common/include/test1.hxx | 2 +- common/include/test2.hxx | 2 +- common/include/test3.hxx | 2 +- common/include/test4.hxx | 2 +- common/index/driver.cxx | 2 +- common/index/makefile | 2 +- common/index/test.hxx | 2 +- common/inheritance/polymorphism/driver.cxx | 2 +- common/inheritance/polymorphism/makefile | 2 +- common/inheritance/polymorphism/test1.hxx | 2 +- common/inheritance/polymorphism/test10.hxx | 2 +- common/inheritance/polymorphism/test11.hxx | 2 +- common/inheritance/polymorphism/test12.hxx | 2 +- common/inheritance/polymorphism/test13.hxx | 2 +- common/inheritance/polymorphism/test14.hxx | 2 +- common/inheritance/polymorphism/test15.hxx | 2 +- common/inheritance/polymorphism/test2.hxx | 2 +- common/inheritance/polymorphism/test3.hxx | 2 +- common/inheritance/polymorphism/test4.hxx | 2 +- common/inheritance/polymorphism/test5.hxx | 2 +- common/inheritance/polymorphism/test6.hxx | 2 +- common/inheritance/polymorphism/test7.hxx | 2 +- common/inheritance/polymorphism/test8.hxx | 2 +- common/inheritance/polymorphism/test9.hxx | 2 +- common/inheritance/reuse/driver.cxx | 2 +- common/inheritance/reuse/makefile | 2 +- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/transient/driver.cxx | 2 +- common/inheritance/transient/makefile | 2 +- common/inheritance/transient/test.hxx | 2 +- common/inverse/driver.cxx | 2 +- common/inverse/makefile | 2 +- common/inverse/test.hxx | 2 +- common/lazy-ptr/driver.cxx | 2 +- common/lazy-ptr/makefile | 2 +- common/lazy-ptr/test.hxx | 2 +- common/lifecycle/driver.cxx | 2 +- common/lifecycle/makefile | 2 +- common/lifecycle/test.hxx | 2 +- common/makefile | 2 +- common/no-id/driver.cxx | 2 +- common/no-id/makefile | 2 +- common/no-id/test.hxx | 2 +- common/object/driver.cxx | 2 +- common/object/makefile | 2 +- common/object/test.hxx | 2 +- common/optimistic/driver.cxx | 2 +- common/optimistic/makefile | 2 +- common/optimistic/test.hxx | 2 +- common/pragma/driver.cxx | 2 +- common/pragma/makefile | 2 +- common/pragma/test.hxx | 2 +- common/prepared/driver.cxx | 2 +- common/prepared/makefile | 2 +- common/prepared/test.hxx | 2 +- common/query/array/driver.cxx | 2 +- common/query/array/makefile | 2 +- common/query/array/test.hxx | 2 +- common/query/basics/driver.cxx | 2 +- common/query/basics/makefile | 2 +- common/query/basics/test.hxx | 2 +- common/query/one/driver.cxx | 2 +- common/query/one/makefile | 2 +- common/query/one/test.hxx | 2 +- common/readonly/driver.cxx | 2 +- common/readonly/makefile | 2 +- common/readonly/test.hxx | 2 +- common/relationship/basics/driver.cxx | 2 +- common/relationship/basics/makefile | 2 +- common/relationship/basics/test.hxx | 2 +- common/relationship/on-delete/driver.cxx | 2 +- common/relationship/on-delete/makefile | 2 +- common/relationship/on-delete/test.hxx | 2 +- common/relationship/query/driver.cxx | 2 +- common/relationship/query/makefile | 2 +- common/relationship/query/test.hxx | 2 +- common/schema/embedded/basics/driver.cxx | 2 +- common/schema/embedded/basics/makefile | 2 +- common/schema/embedded/basics/test.hxx | 2 +- common/schema/embedded/order/driver.cxx | 2 +- common/schema/embedded/order/makefile | 2 +- common/schema/embedded/order/test1.hxx | 2 +- common/schema/embedded/order/test2.hxx | 2 +- common/schema/namespace/driver.cxx | 2 +- common/schema/namespace/makefile | 2 +- common/schema/namespace/test.hxx | 2 +- common/section/basics/driver.cxx | 2 +- common/section/basics/makefile | 2 +- common/section/basics/test.hxx | 2 +- common/section/polymorphism/driver.cxx | 2 +- common/section/polymorphism/makefile | 2 +- common/section/polymorphism/test.hxx | 2 +- common/session/cache/driver.cxx | 2 +- common/session/cache/makefile | 2 +- common/session/cache/test.hxx | 2 +- common/session/custom/driver.cxx | 2 +- common/session/custom/makefile | 2 +- common/session/custom/session.cxx | 2 +- common/session/custom/session.hxx | 2 +- common/session/custom/session.txx | 2 +- common/session/custom/test.hxx | 2 +- common/statement/processing/driver.cxx | 2 +- common/statement/processing/makefile | 2 +- common/template/Makefile.am | 2 +- common/template/driver.cxx | 2 +- common/template/makefile | 2 +- common/template/test.hxx | 2 +- common/test.bat | 2 +- common/threads/driver.cxx | 2 +- common/threads/makefile | 2 +- common/threads/test.hxx | 2 +- common/transaction/basics/driver.cxx | 2 +- common/transaction/basics/makefile | 2 +- common/transaction/callback/driver.cxx | 2 +- common/transaction/callback/makefile | 2 +- common/types/driver.cxx | 2 +- common/types/makefile | 2 +- common/types/test.hxx | 2 +- common/view/basics/driver.cxx | 2 +- common/view/basics/makefile | 2 +- common/view/basics/test.hxx | 2 +- common/view/olv/driver.cxx | 2 +- common/view/olv/makefile | 2 +- common/view/olv/test1.hxx | 2 +- common/view/olv/test2.hxx | 2 +- common/view/olv/test3.hxx | 2 +- common/view/olv/test4.hxx | 2 +- common/view/olv/test5.hxx | 2 +- common/view/olv/test6.hxx | 2 +- common/view/olv/test7.hxx | 2 +- common/view/olv/test8.hxx | 2 +- common/view/olv/test9.hxx | 2 +- common/virtual/driver.cxx | 2 +- common/virtual/makefile | 2 +- common/virtual/test.hxx | 2 +- common/wrapper/driver.cxx | 2 +- common/wrapper/makefile | 2 +- common/wrapper/test.hxx | 2 +- configure.ac | 2 +- diagnostics/containers-of-containers.hxx | 2 +- evolution/Makefile.am | 2 +- evolution/add-column/driver.cxx | 2 +- evolution/add-column/makefile | 2 +- evolution/add-column/model.hxx | 2 +- evolution/add-column/test1.hxx | 2 +- evolution/add-column/test2.hxx | 2 +- evolution/add-column/test3.hxx | 2 +- evolution/add-foreign-key/driver.cxx | 2 +- evolution/add-foreign-key/makefile | 2 +- evolution/add-foreign-key/model.hxx | 2 +- evolution/add-foreign-key/test1.hxx | 2 +- evolution/add-foreign-key/test2.hxx | 2 +- evolution/add-foreign-key/test3.hxx | 2 +- evolution/add-index/driver.cxx | 2 +- evolution/add-index/makefile | 2 +- evolution/add-index/model.hxx | 2 +- evolution/add-index/test1.hxx | 2 +- evolution/add-index/test2.hxx | 2 +- evolution/add-index/test3.hxx | 2 +- evolution/add-table/driver.cxx | 2 +- evolution/add-table/makefile | 2 +- evolution/add-table/model.hxx | 2 +- evolution/add-table/test1.hxx | 2 +- evolution/add-table/test2.hxx | 2 +- evolution/add-table/test3.hxx | 2 +- evolution/alter-column/driver.cxx | 2 +- evolution/alter-column/makefile | 2 +- evolution/alter-column/model.hxx | 2 +- evolution/alter-column/test1.hxx | 2 +- evolution/alter-column/test2.hxx | 2 +- evolution/alter-column/test3.hxx | 2 +- evolution/combined/driver.cxx | 2 +- evolution/combined/makefile | 2 +- evolution/combined/model.hxx | 2 +- evolution/combined/test1.hxx | 2 +- evolution/combined/test2.hxx | 2 +- evolution/combined/test3.hxx | 2 +- evolution/data/driver.cxx | 2 +- evolution/data/makefile | 2 +- evolution/data/model.hxx | 2 +- evolution/data/test1.hxx | 2 +- evolution/data/test2.hxx | 2 +- evolution/data/test3.hxx | 2 +- evolution/drop-column/driver.cxx | 2 +- evolution/drop-column/makefile | 2 +- evolution/drop-column/model.hxx | 2 +- evolution/drop-column/test1.hxx | 2 +- evolution/drop-column/test2.hxx | 2 +- evolution/drop-column/test3.hxx | 2 +- evolution/drop-foreign-key/driver.cxx | 2 +- evolution/drop-foreign-key/makefile | 2 +- evolution/drop-foreign-key/model.hxx | 2 +- evolution/drop-foreign-key/test1.hxx | 2 +- evolution/drop-foreign-key/test2.hxx | 2 +- evolution/drop-foreign-key/test3.hxx | 2 +- evolution/drop-index/driver.cxx | 2 +- evolution/drop-index/makefile | 2 +- evolution/drop-index/model.hxx | 2 +- evolution/drop-index/test1.hxx | 2 +- evolution/drop-index/test2.hxx | 2 +- evolution/drop-index/test3.hxx | 2 +- evolution/drop-table/driver.cxx | 2 +- evolution/drop-table/makefile | 2 +- evolution/drop-table/model.hxx | 2 +- evolution/drop-table/test1.hxx | 2 +- evolution/drop-table/test2.hxx | 2 +- evolution/drop-table/test3.hxx | 2 +- evolution/embedded/driver.cxx | 2 +- evolution/embedded/makefile | 2 +- evolution/embedded/model.hxx | 2 +- evolution/embedded/test1.hxx | 2 +- evolution/embedded/test2.hxx | 2 +- evolution/embedded/test3.hxx | 2 +- evolution/makefile | 2 +- evolution/soft-add/driver.cxx | 2 +- evolution/soft-add/makefile | 2 +- evolution/soft-add/model.hxx | 2 +- evolution/soft-add/test1.hxx | 2 +- evolution/soft-add/test2.hxx | 2 +- evolution/soft-add/test3.hxx | 2 +- evolution/soft-delete/driver.cxx | 2 +- evolution/soft-delete/makefile | 2 +- evolution/soft-delete/model.hxx | 2 +- evolution/soft-delete/test1.hxx | 2 +- evolution/soft-delete/test2.hxx | 2 +- evolution/soft-delete/test3.hxx | 2 +- evolution/template/Makefile.am | 2 +- evolution/template/driver.cxx | 2 +- evolution/template/makefile | 2 +- evolution/template/model.hxx | 2 +- evolution/template/test1.hxx | 2 +- evolution/template/test2.hxx | 2 +- evolution/template/test3.hxx | 2 +- evolution/test.bat | 2 +- evolution/tester.bat | 2 +- evolution/tester.in | 2 +- evolution/version/driver.cxx | 2 +- evolution/version/makefile | 2 +- evolution/version/model.hxx | 2 +- evolution/version/test1.hxx | 2 +- evolution/version/test2.hxx | 2 +- evolution/version/test3.hxx | 2 +- libcommon/Makefile.am | 2 +- libcommon/common/Makefile.am | 2 +- libcommon/common/buffer.hxx | 2 +- libcommon/common/common.cxx | 2 +- libcommon/common/common.hxx | 2 +- libcommon/common/common.txx | 2 +- libcommon/common/concrete.hxx | 2 +- libcommon/common/config-vc.h | 2 +- libcommon/common/config.h.in | 2 +- libcommon/common/config.hxx | 2 +- libcommon/common/export.hxx | 2 +- libcommon/common/makefile | 2 +- libcommon/makefile | 2 +- m4/c++11.m4 | 2 +- m4/database.m4 | 2 +- m4/diff.m4 | 2 +- m4/libboost.m4 | 2 +- m4/libodb-boost.m4 | 2 +- m4/libodb-mssql.m4 | 2 +- m4/libodb-mysql.m4 | 2 +- m4/libodb-oracle.m4 | 2 +- m4/libodb-pgsql.m4 | 2 +- m4/libodb-qt.m4 | 2 +- m4/libodb-sqlite.m4 | 2 +- m4/libodb.m4 | 2 +- m4/libqt.m4 | 2 +- m4/libtool-link.m4 | 2 +- m4/mssql.m4 | 2 +- m4/mysql.m4 | 2 +- m4/odb.m4 | 2 +- m4/oracle.m4 | 2 +- m4/pgsql.m4 | 2 +- m4/sqlite.m4 | 2 +- m4/static-lib.m4 | 2 +- m4/threads.m4 | 2 +- m4/tr1-memory.m4 | 2 +- makefile | 2 +- mssql-driver.bat | 2 +- mssql/Makefile.am | 2 +- mssql/custom/driver.cxx | 2 +- mssql/custom/makefile | 2 +- mssql/custom/query.hxx | 2 +- mssql/custom/test.hxx | 2 +- mssql/custom/traits.cxx | 2 +- mssql/custom/traits.hxx | 2 +- mssql/database/driver.cxx | 2 +- mssql/database/makefile | 2 +- mssql/makefile | 2 +- mssql/native/driver.cxx | 2 +- mssql/native/makefile | 2 +- mssql/query/driver.cxx | 2 +- mssql/query/makefile | 2 +- mssql/query/test.hxx | 2 +- mssql/stored-proc/driver.cxx | 2 +- mssql/stored-proc/makefile | 2 +- mssql/stored-proc/test.hxx | 2 +- mssql/template/Makefile.am | 2 +- mssql/template/driver.cxx | 2 +- mssql/template/makefile | 2 +- mssql/template/test.hxx | 2 +- mssql/test.bat | 2 +- mssql/types/driver.cxx | 2 +- mssql/types/makefile | 2 +- mssql/types/test.hxx | 2 +- mssql/types/traits.hxx | 2 +- mysql-driver.bat | 2 +- mysql/Makefile.am | 2 +- mysql/custom/driver.cxx | 2 +- mysql/custom/makefile | 2 +- mysql/custom/query.hxx | 2 +- mysql/custom/test.hxx | 2 +- mysql/custom/traits.hxx | 2 +- mysql/database/driver.cxx | 2 +- mysql/database/makefile | 2 +- mysql/index/driver.cxx | 2 +- mysql/index/makefile | 2 +- mysql/index/test.hxx | 2 +- mysql/makefile | 2 +- mysql/native/driver.cxx | 2 +- mysql/native/makefile | 2 +- mysql/template/Makefile.am | 2 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 2 +- mysql/template/test.hxx | 2 +- mysql/test.bat | 2 +- mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 2 +- mysql/truncation/test.hxx | 2 +- mysql/types/driver.cxx | 2 +- mysql/types/makefile | 2 +- mysql/types/test.hxx | 2 +- mysql/types/traits.hxx | 2 +- oracle-driver.bat | 2 +- oracle/Makefile.am | 2 +- oracle/custom/driver.cxx | 2 +- oracle/custom/makefile | 2 +- oracle/custom/test.hxx | 2 +- oracle/custom/traits.hxx | 2 +- oracle/database/driver.cxx | 2 +- oracle/database/makefile | 2 +- oracle/makefile | 2 +- oracle/native/driver.cxx | 2 +- oracle/native/makefile | 2 +- oracle/template/Makefile.am | 2 +- oracle/template/driver.cxx | 2 +- oracle/template/makefile | 2 +- oracle/template/test.hxx | 2 +- oracle/test.bat | 2 +- oracle/types/driver.cxx | 2 +- oracle/types/makefile | 2 +- oracle/types/test.hxx | 2 +- oracle/types/traits.hxx | 2 +- pgsql-driver.bat | 2 +- pgsql/Makefile.am | 2 +- pgsql/custom/driver.cxx | 2 +- pgsql/custom/makefile | 2 +- pgsql/custom/query.hxx | 2 +- pgsql/custom/test.hxx | 2 +- pgsql/custom/traits.hxx | 2 +- pgsql/database/driver.cxx | 2 +- pgsql/database/makefile | 2 +- pgsql/index/driver.cxx | 2 +- pgsql/index/makefile | 2 +- pgsql/index/test.hxx | 2 +- pgsql/makefile | 2 +- pgsql/native/driver.cxx | 2 +- pgsql/native/makefile | 2 +- pgsql/template/Makefile.am | 2 +- pgsql/template/driver.cxx | 2 +- pgsql/template/makefile | 2 +- pgsql/template/test.hxx | 2 +- pgsql/test.bat | 2 +- pgsql/truncation/driver.cxx | 2 +- pgsql/truncation/makefile | 2 +- pgsql/truncation/test.hxx | 2 +- pgsql/types/driver.cxx | 2 +- pgsql/types/makefile | 2 +- pgsql/types/test.hxx | 2 +- pgsql/types/traits.hxx | 2 +- qt/Makefile.am | 2 +- qt/build.bat | 2 +- qt/common/Makefile.am | 2 +- qt/common/basic/driver.cxx | 2 +- qt/common/basic/makefile | 2 +- qt/common/basic/test.hxx | 2 +- qt/common/containers/basics/driver.cxx | 2 +- qt/common/containers/basics/makefile | 2 +- qt/common/containers/basics/test.hxx | 2 +- qt/common/containers/change-tracking/driver.cxx | 2 +- qt/common/containers/change-tracking/makefile | 2 +- qt/common/containers/change-tracking/test.hxx | 2 +- qt/common/makefile | 2 +- qt/common/smart-ptr/driver.cxx | 2 +- qt/common/smart-ptr/makefile | 2 +- qt/common/smart-ptr/test.hxx | 2 +- qt/common/template/Makefile.am | 2 +- qt/common/template/driver.cxx | 2 +- qt/common/template/makefile | 2 +- qt/common/template/test.hxx | 2 +- qt/common/test.bat | 2 +- qt/makefile | 2 +- qt/mssql/Makefile.am | 2 +- qt/mssql/basic/driver.cxx | 2 +- qt/mssql/basic/makefile | 2 +- qt/mssql/basic/test.hxx | 2 +- qt/mssql/date-time/driver.cxx | 2 +- qt/mssql/date-time/makefile | 2 +- qt/mssql/date-time/test.hxx | 2 +- qt/mssql/makefile | 2 +- qt/mssql/template/Makefile.am | 2 +- qt/mssql/template/driver.cxx | 2 +- qt/mssql/template/makefile | 2 +- qt/mssql/template/test.hxx | 2 +- qt/mssql/test.bat | 2 +- qt/mysql/Makefile.am | 2 +- qt/mysql/basic/driver.cxx | 2 +- qt/mysql/basic/makefile | 2 +- qt/mysql/basic/test.hxx | 2 +- qt/mysql/date-time/driver.cxx | 2 +- qt/mysql/date-time/makefile | 2 +- qt/mysql/date-time/test.hxx | 2 +- qt/mysql/makefile | 2 +- qt/mysql/template/Makefile.am | 2 +- qt/mysql/template/driver.cxx | 2 +- qt/mysql/template/makefile | 2 +- qt/mysql/template/test.hxx | 2 +- qt/mysql/test.bat | 2 +- qt/oracle/Makefile.am | 2 +- qt/oracle/basic/driver.cxx | 2 +- qt/oracle/basic/makefile | 2 +- qt/oracle/basic/test.hxx | 2 +- qt/oracle/date-time/driver.cxx | 2 +- qt/oracle/date-time/makefile | 2 +- qt/oracle/date-time/test.hxx | 2 +- qt/oracle/makefile | 2 +- qt/oracle/template/Makefile.am | 2 +- qt/oracle/template/driver.cxx | 2 +- qt/oracle/template/makefile | 2 +- qt/oracle/template/test.hxx | 2 +- qt/oracle/test.bat | 2 +- qt/pgsql/Makefile.am | 2 +- qt/pgsql/basic/driver.cxx | 2 +- qt/pgsql/basic/makefile | 2 +- qt/pgsql/basic/test.hxx | 2 +- qt/pgsql/date-time/driver.cxx | 2 +- qt/pgsql/date-time/makefile | 2 +- qt/pgsql/date-time/test.hxx | 2 +- qt/pgsql/makefile | 2 +- qt/pgsql/template/Makefile.am | 2 +- qt/pgsql/template/driver.cxx | 2 +- qt/pgsql/template/makefile | 2 +- qt/pgsql/template/test.hxx | 2 +- qt/pgsql/test.bat | 2 +- qt/sqlite/Makefile.am | 2 +- qt/sqlite/basic/driver.cxx | 2 +- qt/sqlite/basic/makefile | 2 +- qt/sqlite/basic/test.hxx | 2 +- qt/sqlite/date-time/driver.cxx | 2 +- qt/sqlite/date-time/makefile | 2 +- qt/sqlite/date-time/test.hxx | 2 +- qt/sqlite/makefile | 2 +- qt/sqlite/template/Makefile.am | 2 +- qt/sqlite/template/driver.cxx | 2 +- qt/sqlite/template/makefile | 2 +- qt/sqlite/template/test.hxx | 2 +- qt/sqlite/test.bat | 2 +- sqlite/Makefile.am | 2 +- sqlite/auto/driver.cxx | 2 +- sqlite/auto/makefile | 2 +- sqlite/auto/test.hxx | 2 +- sqlite/custom/driver.cxx | 2 +- sqlite/custom/makefile | 2 +- sqlite/custom/test.hxx | 2 +- sqlite/database/driver.cxx | 2 +- sqlite/database/makefile | 2 +- sqlite/makefile | 2 +- sqlite/native/driver.cxx | 2 +- sqlite/native/makefile | 2 +- sqlite/stream/driver.cxx | 2 +- sqlite/stream/makefile | 2 +- sqlite/stream/test.hxx | 2 +- sqlite/template/Makefile.am | 2 +- sqlite/template/driver.cxx | 2 +- sqlite/template/makefile | 2 +- sqlite/template/test.hxx | 2 +- sqlite/test.bat | 2 +- sqlite/transaction/driver.cxx | 2 +- sqlite/transaction/makefile | 2 +- sqlite/transaction/test.hxx | 2 +- sqlite/truncation/driver.cxx | 2 +- sqlite/truncation/makefile | 2 +- sqlite/truncation/test.hxx | 2 +- sqlite/types/driver.cxx | 2 +- sqlite/types/makefile | 2 +- sqlite/types/test.hxx | 2 +- sqlite/types/traits.hxx | 2 +- test.bat | 2 +- tester.bat | 2 +- tester.in | 2 +- 713 files changed, 713 insertions(+), 713 deletions(-) diff --git a/Makefile.am b/Makefile.am index 910be38..367ed0f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common evolution diff --git a/boost/Makefile.am b/boost/Makefile.am index ab85c0f..ec9c303 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,5 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index 79ced9b..d7ecec2 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index abac934..c0db52c 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index 37213ed..82a8d99 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,5 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index 4ee508d..11b27c8 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 108f4c5..7e7a543 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,5 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index 606bc1e..5c98ab7 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index 51591fa..3f3bb54 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 4709cf3..3f33517 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,5 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 7d4b5b8..72b1b11 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index c71a6ba..3533592 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index d4f565e..dba0f87 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index 605b122..bb922e0 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 606e7d0..9e743f1 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index a889557..5edacd0 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index e56dc37..1c5a25c 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,5 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index d3b732e..0b38cf5 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index 92c4b07..f960f62 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 2885807..4bf2603 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index bb2f2a1..931dcb1 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,5 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index 97e2996..f79e207 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index 5cffa6a..2cb7b3d 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 5188740..7b6ad3b 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,5 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index c4195aa..3f8e4e3 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,5 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index b16369d..bad4150 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,5 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index 2a31e35..9f54b4d 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index 81b6f6e..636200a 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index a315271..a286263 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index d9b058f..d07ef0c 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index 57028d9..f5cc2fc 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index a28fbf8..1396aaf 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 25ac8e4..20eb3f8 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index 2ba7faa..f9bd16e 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index dd6d31a..2e22d2e 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index 0298168..fcf5a49 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index edeb3e5..e30378d 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 29be785..92728b9 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index 07af054..b53304a 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index 4ae594f..a16657a 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index 6caa916..c5873a1 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index b0c803d..94809da 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index 83e5cef..d7821e7 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index c9a59c4..e7db2a4 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,5 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index d3eb4f1..a62ebab 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 0873568..7bc65b5 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index af7cd31..14164c9 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index eca54b5..38a9f7a 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index b8b682e..4ca5522 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index 158ec70..d009896 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index ef030ce..b681e12 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 2dab7ea..744bec0 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index 74f65ef..bdf3294 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index a5d08b7..820c229 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,5 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index 2a8f3dc..f4a0f80 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index 81ae3a9..805a46f 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index a762774..d590cd5 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 2f1f9d4..8450527 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 7c9dd0a..8667a87 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 34ac130..4f87ff3 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index e0c913c..9308d56 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 97b0581..255d38e 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 5a82834..818e830 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index a6a5d78..887b21d 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 619746b..68fd30d 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index 48d22d2..bdd3fa0 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index 7b387d9..8092d9b 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index b8716c9..e6afe24 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index e3c4924..fb88563 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index eb85e1d..f9278ab 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 584681c..1eda35e 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 7512a05..44eb513 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index 2338270..020a50b 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index f7271b0..720a81a 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index e89318e..15dc0d5 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index fcdc793..3b17858 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index f489800..0e786df 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index 791befc..5226e18 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 37feaa1..96135ee 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,5 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index 5668385..fc6b151 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index 08d7c6d..4028fe6 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,5 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 65a66c6..518b26f 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index de1e5f0..9d2faba 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index bfe4329..7baa2fb 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index a389949..1b8c6d0 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index d341116..1028728 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index 66b2cf2..49ec4b0 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 0cd5ff4..77c5503 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,5 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 17ad66f..1a40d82 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index 937098f..ca10145 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index fa6f335..5562cd4 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index 2aa3fe9..beb1eec 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index 5236b95..d3db62b 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 346f53f..41913ba 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index d320e14..384ac02 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index b64dae0..399e5e2 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index a8bbe23..5a0efb7 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index 0318900..046dd74 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index 670c071..e611edf 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 0eae4a1..781469c 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index dfe7fde..7ba6f62 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 0dc245b..3918fb9 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index c2a9b03..2e5a38d 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index db28ab6..38c7352 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 397c45d..0a879ea 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index af9c9d6..1bce523 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 10b7e4b..260dcb6 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index 0ef60bb..2d61e29 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index 0f87364..add7c39 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 2fbb636..872cbb3 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index b2df157..0d57a5f 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index a96dc45..6b7088d 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,5 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 217249c..820294b 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 2a44ce9..837b0d3 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index c87b5d6..bbec36e 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index a0f34c3..47f67b2 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,5 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 57e42d2..727793b 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,5 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index bbcc51a..2fb4bd3 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 7d0b01b..7cb6f51 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,5 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 5d3a782..24d2b33 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,5 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 817c88e..44016a7 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index 009246e..f9bf053 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index 54de3d3..569cc6c 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index 0f9c1e5..fef3bb5 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index 9f1d4bb..8af7afe 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index 6781f19..836b910 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index 72af719..ac87741 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 6d025ce..4d4cb25 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index 5f9d2db..1db74c3 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,7 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index b5d31de..75621c5 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,5 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 9516f46..39843b2 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,5 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index 138d552..696f9ee 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,5 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index cc74260..942d257 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,5 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/as/driver.cxx b/common/as/driver.cxx index 93218ac..a9f5f7f 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -1,5 +1,5 @@ // file : common/as/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type mapping (#pragma map type as ...). diff --git a/common/as/makefile b/common/as/makefile index 2f469fd..f980a0a 100644 --- a/common/as/makefile +++ b/common/as/makefile @@ -1,5 +1,5 @@ # file : common/as/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/as/test.hxx b/common/as/test.hxx index 6c11ea5..b0f6133 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -1,5 +1,5 @@ // file : common/as/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 1df3be9..e3f39c0 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,5 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index c28a023..680d42d 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,5 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index eba1271..75ad22b 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,5 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 0775c21..ccd3f05 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1,5 +1,5 @@ // file : common/bulk/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bulk database operations. diff --git a/common/bulk/makefile b/common/bulk/makefile index 3b7e5c3..7c15980 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -1,5 +1,5 @@ # file : common/bulk/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 21f105f..5dc9083 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,5 +1,5 @@ // file : common/driver/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index b6b2dbd..bb6076a 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index df1d556..d850483 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,5 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index f7da826..199eea7 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,5 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index eaf54f2..5523fa7 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-column.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index 58bf5e0..7f6cb10 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-foreign-key.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index a47d517..9c5c67e 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-index.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_INDEX_HXX diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index 69e9ba7..23761d6 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/add-table.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_TABLE_HXX diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index f894b1c..400f4be 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/alter-column.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index 1302322..076ae24 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-column.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index a3320e0..a72e73e 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-foreign-key.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index bc7c18b..77fb969 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-index.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_INDEX_HXX diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index 1867624..5809e53 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -1,5 +1,5 @@ // file : common/changelog/drop-table.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index 7851665..e27de8f 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -1,5 +1,5 @@ # file : common/changelog/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index 8ff2daf..d281c99 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -1,5 +1,5 @@ // file : common/changelog/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index 08ec881..8f40dc0 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index 13e1279..e00ab55 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,5 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index 292e6e5..2bbd09f 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index 6afaf40..4e6d691 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,5 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index 59b5bec..64ddcc1 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,5 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index cc4187b..a2a49e6 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,5 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 60b3fb5..553e668 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,5 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index 01916cf..ec210fa 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index 16d4818..d33167a 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,5 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 38544f7..4bf6e62 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index 8f7edc9..f7ac737 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index 42b44fe..c740d3d 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,5 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index a98046c..72a251d 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,5 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 074ca2f..7477a3d 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,5 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index 125f7b4..1a81abd 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,5 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 84ca7ec..5097de3 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,5 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index 423f86c..443ef35 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 2bf87b0..537bdf9 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,5 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 671ce79..1edb05f 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index fd669d6..b6e811d 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index c0d8f1a..3776e2b 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,5 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 70d16e8..5be19f5 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index d15ebf4..095891f 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,5 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index d8cf733..d39eb4c 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,5 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index c588012..1e32989 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,5 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index f88e703..e33f411 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,5 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index e1c638b..76bd2dc 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,5 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index d6e938d..e2f793e 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,5 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index 46a1cd7..361d486 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,5 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index b620b66..4f42247 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,5 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index 2657322..4162ad2 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,5 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index b8f1c71..0a1b200 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,5 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index 47a96bf..d7f4323 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,5 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index beeca95..308ac49 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,5 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index b810b65..81f9efa 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,5 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 934b29e..cc5f153 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,5 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index ff5dd3c..0688e8b 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,5 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index 573250f..d905f29 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,5 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx index 0430a6c..162ba60 100644 --- a/common/id/auto/driver.cxx +++ b/common/id/auto/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/auto/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/id/auto/makefile b/common/id/auto/makefile index eb841ad..61399be 100644 --- a/common/id/auto/makefile +++ b/common/id/auto/makefile @@ -1,5 +1,5 @@ # file : common/id/auto/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx index 72d48ba..13fe825 100644 --- a/common/id/auto/test.hxx +++ b/common/id/auto/test.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx index 4f628eb..7e5a917 100644 --- a/common/id/composite/driver.cxx +++ b/common/id/composite/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/composite/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/id/composite/makefile b/common/id/composite/makefile index ced82cc..13cdd06 100644 --- a/common/id/composite/makefile +++ b/common/id/composite/makefile @@ -1,5 +1,5 @@ # file : common/id/composite/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx index c953106..8b4c21c 100644 --- a/common/id/composite/test.hxx +++ b/common/id/composite/test.hxx @@ -1,5 +1,5 @@ // file : common/id/composite/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx index 00471d1..b0ba3e6 100644 --- a/common/id/nested/driver.cxx +++ b/common/id/nested/driver.cxx @@ -1,5 +1,5 @@ // file : common/id/nested/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test nested ids. diff --git a/common/id/nested/makefile b/common/id/nested/makefile index 2714b95..08db59e 100644 --- a/common/id/nested/makefile +++ b/common/id/nested/makefile @@ -1,5 +1,5 @@ # file : common/id/nested/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx index 97a6586..953dd78 100644 --- a/common/id/nested/test.hxx +++ b/common/id/nested/test.hxx @@ -1,5 +1,5 @@ // file : common/id/nested/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index cb79063..02c41af 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,5 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index 15aee8d..d22fcb3 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,5 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index 630890e..feaa29a 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,5 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index 1730208..cf4b485 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,5 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index 91c6c8c..81112a1 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,5 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index b44ad10..9fd4d66 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index 2c60188..6738e8c 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,5 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index cce061e..49cf71c 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,5 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index 40daabb..7beed11 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,5 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index 5a2eeff..62b57ab 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,5 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index 9fe9489..a67621d 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,5 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 8e3b83a..5dee72e 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 86272e5..725692c 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,5 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index b33913f..ef38faa 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,5 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index 143b95c..badc598 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,5 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index 51658a5..d4a09b2 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,5 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index d243768..94749a0 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index 992d9bb..ab7cc48 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index 204f131..be8cb86 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index e1baf97..e359774 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index f2918ce..71b0160 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index 410b5c7..9f872ec 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx index f5637f5..5f0894d 100644 --- a/common/inheritance/polymorphism/test13.hxx +++ b/common/inheritance/polymorphism/test13.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test13.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx index 98c1c99..4a4108b 100644 --- a/common/inheritance/polymorphism/test14.hxx +++ b/common/inheritance/polymorphism/test14.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test14.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx index 218a121..8034a53 100644 --- a/common/inheritance/polymorphism/test15.hxx +++ b/common/inheritance/polymorphism/test15.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test15.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index b8880a3..b81bf16 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index 6953afc..0071da3 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index c12ce25..f9a43cc 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index 082b574..9c676c5 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index 4138163..fc31c45 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index 137a6a6..f7a4505 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index 08459fc..8f9f6be 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index dee4786..78fb594 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 91571c8..3e0dfd7 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index 16f9c08..c1ce62e 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 9e0650f..5f957d8 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index b56173d..d2fb705 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 4500a7a..80496dc 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,5 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index 5f7fbf8..7d6038e 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,5 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 8df1114..364e628 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,5 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index fb19718..d879bdd 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,5 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 2c96e29..55df151 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,5 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 7813134..d85fecc 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 89f1e65..0280498 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,5 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 175e830..84c442f 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,5 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 8532a5c..fc3851e 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,5 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index b256a1c..569e03a 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,5 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index a0d7423..fe9adc6 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,5 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index 51f17ba..dc02ba5 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,5 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index ae1a216..4b457a9 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,5 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index e03c653..3b2ba03 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,5 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index 41129ac..f82e4e7 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,5 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/object/driver.cxx b/common/object/driver.cxx index 1e0fc83..f115b92 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -1,5 +1,5 @@ // file : common/object/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes. diff --git a/common/object/makefile b/common/object/makefile index 17074fe..ee3bfdf 100644 --- a/common/object/makefile +++ b/common/object/makefile @@ -1,5 +1,5 @@ # file : common/object/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/object/test.hxx b/common/object/test.hxx index e7a5032..fd7d230 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -1,5 +1,5 @@ // file : common/object/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 38b19e1..ed243c6 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,5 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index a04ccf8..6fa67c8 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,5 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 04c4037..8d918d2 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,5 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 6dffe46..05337ea 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,5 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index 9c8fb42..7c39fc2 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,5 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index 1d09d1e..89dbefa 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 5f7ada1..269aeb5 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,5 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index 3494dcf..d707756 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,5 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 4db26ae..95c4bd7 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,5 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 21437c1..4425c83 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index fe8e994..e1e39c8 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,5 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index e923e11..3141362 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,5 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index d226863..acaa975 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index ce8a31b..2486a36 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,5 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index ce34757..9483f9b 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx index a903846..b9dcf91 100644 --- a/common/query/one/driver.cxx +++ b/common/query/one/driver.cxx @@ -1,5 +1,5 @@ // file : common/query/one/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query one support. diff --git a/common/query/one/makefile b/common/query/one/makefile index 5b36aa4..c28b56c 100644 --- a/common/query/one/makefile +++ b/common/query/one/makefile @@ -1,5 +1,5 @@ # file : common/query/one/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx index 7dbc8e8..36bb2c4 100644 --- a/common/query/one/test.hxx +++ b/common/query/one/test.hxx @@ -1,5 +1,5 @@ // file : common/query/one/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 9cb6f33..140ba3f 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,5 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index b84d0a2..b746a2e 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,5 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index e5ff341..5814b21 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,5 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index e0e1c0f..14e21e5 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index fe085fb..0394571 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -1,5 +1,5 @@ # file : common/relationship/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index 1883393..0b6365e 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index f8cb21a..210d987 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test ON DELETE functionality. diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index 2b5a7ba..dd472de 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -1,5 +1,5 @@ # file : common/relationship/on-delete/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx index a647162..e7774a7 100644 --- a/common/relationship/on-delete/test.hxx +++ b/common/relationship/on-delete/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship/on-delete/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index 7e6e1e2..c6f8d1b 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index 3b0e089..1882947 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -1,5 +1,5 @@ # file : common/relationship-query/query/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index d7e7b87..358f831 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -1,5 +1,5 @@ // file : common/relationship-query/query/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 7edd819..ba9f184 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index a402083..205f360 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index c4d12fa..f8cdbf7 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index f6d96f1..cfab779 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index 38f0610..f02e001 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,5 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index 01fa538..6c3d022 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index 5a1e0fe..94c4d10 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,5 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index 77fa74b..77df32e 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 1643225..58cd323 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,5 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index c61114a..831aece 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,5 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index 046fc61..3c1ef2a 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object section basics. diff --git a/common/section/basics/makefile b/common/section/basics/makefile index ddf6a9d..623b9f2 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -1,5 +1,5 @@ # file : common/section/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index 3e37829..61e8c7e 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/section/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index b0a7231..bd62c78 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test sections in polymorphic objects. diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index c91aa2b..51b2b3e 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -1,5 +1,5 @@ # file : common/section/polymorphism/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index 8e10307..e864fde 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -1,5 +1,5 @@ // file : common/section/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 831430b..59768df 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index debeeea..31e710d 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,5 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index af56b2a..2948d06 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,5 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index f0cfc62..1073a6f 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 18c0705..1b2c23a 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,5 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index 1267d7f..0f6e5a2 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 95ce596..225dcdf 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index d3ae4e1..a908475 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,5 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index f5ce295..9e3bc72 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,5 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index b2cbdf6..d225083 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -1,5 +1,5 @@ // file : common/statement/processing/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test internal statement processing machinery. diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 21ff739..4959e33 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -1,5 +1,5 @@ # file : common/statement/processing/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/template/Makefile.am b/common/template/Makefile.am index cc9af8b..7da1481 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 3adfa9d..5956d6b 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 50d1e77..72dd9e4 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,5 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index 02e5834..de34cd1 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index 7d9f5ed..fd20fc2 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 35688d0..5daa4c9 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,5 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index d676f5b..e2e7c7e 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,5 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index 47122c0..e4b82ce 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,5 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index 4fec133..f34a67a 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index c43cfa0..3d83c4f 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,5 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index e987599..b75c4b3 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,5 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 6988c22..4c3b186 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,5 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 752c2c9..7b128d6 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,5 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index 9100220..30250b0 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,5 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index e88b4cb..e7359de 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,5 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index c5d80d4..3c66d88 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test view basics. diff --git a/common/view/basics/makefile b/common/view/basics/makefile index 57f37fa..a3d714b 100644 --- a/common/view/basics/makefile +++ b/common/view/basics/makefile @@ -1,5 +1,5 @@ # file : common/view/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 162ce7d..569988b 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -1,5 +1,5 @@ // file : common/view/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index 510b209..5c45d94 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -1,5 +1,5 @@ // file : common/view/olv/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object loading views. diff --git a/common/view/olv/makefile b/common/view/olv/makefile index db7775f..8b6a085 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -1,5 +1,5 @@ # file : common/view/olv/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index 7e4a0d8..bc73461 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx index ad5fbdc..a5d4555 100644 --- a/common/view/olv/test2.hxx +++ b/common/view/olv/test2.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx index 730b36a..7ba8809 100644 --- a/common/view/olv/test3.hxx +++ b/common/view/olv/test3.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx index cc53fdb..72a17a6 100644 --- a/common/view/olv/test4.hxx +++ b/common/view/olv/test4.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test4.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx index 2a50f1b..e2c3dbc 100644 --- a/common/view/olv/test5.hxx +++ b/common/view/olv/test5.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test5.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx index 957c4d4..51f6e5b 100644 --- a/common/view/olv/test6.hxx +++ b/common/view/olv/test6.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test6.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index 7c3d527..ef97a64 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test7.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index 244d915..a417186 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test8.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx index 7cf49bb..7bea717 100644 --- a/common/view/olv/test9.hxx +++ b/common/view/olv/test9.hxx @@ -1,5 +1,5 @@ // file : common/view/olv/test9.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index ff105c3..e2b118b 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,5 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index 4daf9ba..3cb3416 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,5 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index 01c7edc..c65928a 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,5 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 8005e21..0f07b5a 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,5 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 8ba49da..746ff30 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,5 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 91259a4..af089db 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,5 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 1b9a62d..1c3d1b8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx index f2663fc..173610e 100644 --- a/diagnostics/containers-of-containers.hxx +++ b/diagnostics/containers-of-containers.hxx @@ -1,5 +1,5 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/evolution/Makefile.am b/evolution/Makefile.am index dd60c57..ab8276a 100644 --- a/evolution/Makefile.am +++ b/evolution/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 095f1e4..55785ec 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-column/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new column. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index bd42f31..934fdd1 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -1,5 +1,5 @@ # file : evolution/add-column/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx index 0e596c7..623c969 100644 --- a/evolution/add-column/model.hxx +++ b/evolution/add-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index bc3194b..d982677 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index 5bdc379..3f8b86d 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx index 0dfd8b3..c2054ad 100644 --- a/evolution/add-column/test3.hxx +++ b/evolution/add-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-column/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index cbcbdea..04f2ab1 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a foreign key. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index f76a63a..33a5964 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/add-foreign-key/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index f63ecf1..1740276 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index 4772364..35dbcc4 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index 4a5fb64..5c6d91d 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx index d95619a..bac2eec 100644 --- a/evolution/add-foreign-key/test3.hxx +++ b/evolution/add-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index 3a4c58d..c8e5a3a 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new index. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index f405e58..0cea925 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -1,5 +1,5 @@ # file : evolution/add-index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx index 514e6f5..5d7467f 100644 --- a/evolution/add-index/model.hxx +++ b/evolution/add-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index c1300e4..587c60a 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index f1dfd6f..4859c11 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx index bf68cef..beb43c2 100644 --- a/evolution/add-index/test3.hxx +++ b/evolution/add-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-index/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index 06dd8e5..f26b2e9 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/add-table/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new table (object, container). diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index a1f0f91..d96cf74 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -1,5 +1,5 @@ # file : evolution/add-table/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx index fc82365..f31063b 100644 --- a/evolution/add-table/model.hxx +++ b/evolution/add-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index 6b0c105..976cec3 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index a9640ce..b03dde4 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx index 96266c0..38dd282 100644 --- a/evolution/add-table/test3.hxx +++ b/evolution/add-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/add-table/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index c6aa6fc..bea1568 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test altering a column. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 8d3926e..4e698ef 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -1,5 +1,5 @@ # file : evolution/alter-column/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index ca85585..88dc060 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index 80f9c38..89205e1 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index 77a653b..cab68d9 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx index 21943e9..49ddc25 100644 --- a/evolution/alter-column/test3.hxx +++ b/evolution/alter-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/alter-column/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index fff98d0..eddcd66 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/combined/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Combined schema evolution test. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 7a44b52..0befefa 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -1,5 +1,5 @@ # file : evolution/combined/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 9cc405d..133e5ad 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index c24c729..6a43b2a 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 070ef82..05d600f 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx index f99a6f5..1a7a154 100644 --- a/evolution/combined/test3.hxx +++ b/evolution/combined/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/combined/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index d564fb3..0fa354c 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/data/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test data migration support. diff --git a/evolution/data/makefile b/evolution/data/makefile index 24a90bc..a3e8366 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -1,5 +1,5 @@ # file : evolution/data/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx index ac3d086..577dd24 100644 --- a/evolution/data/model.hxx +++ b/evolution/data/model.hxx @@ -1,5 +1,5 @@ // file : evolution/data/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx index 20f4b6e..e2f74af 100644 --- a/evolution/data/test1.hxx +++ b/evolution/data/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx index a6bdf6f..9d24dd0 100644 --- a/evolution/data/test2.hxx +++ b/evolution/data/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx index 55487e4..044fd4e 100644 --- a/evolution/data/test3.hxx +++ b/evolution/data/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/data/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 19dbcee..6c6c744 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a column. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index c464240..06939a3 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-column/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index 8c998f3..7d25dad 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index cf66332..d12459e 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index 433625e..cd5339e 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx index 4e597e8..757684c 100644 --- a/evolution/drop-column/test3.hxx +++ b/evolution/drop-column/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-column/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index edb4dc5..f884b52 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a foreign key. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index 5f2f38c..ace9e41 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-foreign-key/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index 97c3e30..16ed479 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index d5b774f..20b1bbd 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index 72fbd1d..72b8b81 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx index fd5672b..4c44a06 100644 --- a/evolution/drop-foreign-key/test3.hxx +++ b/evolution/drop-foreign-key/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index 137f001..de8f31b 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping an index. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index b5a4169..84078bb 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx index 68356e4..f4f3055 100644 --- a/evolution/drop-index/model.hxx +++ b/evolution/drop-index/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index f38b85f..6cafa7a 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index d1d06f3..2da701b 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx index dd0b974..80e0d87 100644 --- a/evolution/drop-index/test3.hxx +++ b/evolution/drop-index/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-index/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index 7909d89..f3f6e52 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a table (object, container). diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 28f930f..8f13b6d 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -1,5 +1,5 @@ # file : evolution/drop-table/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index 09e9f73..5dfbf3b 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index 1672473..41739d5 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index 3e0899c..5cdce74 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx index a8e974f..1ba33bc 100644 --- a/evolution/drop-table/test3.hxx +++ b/evolution/drop-table/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/drop-table/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 72b91d8..7b73017 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/embedded/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test embedded schema migration. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 3510745..57bb656 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -1,5 +1,5 @@ # file : evolution/embedded/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx index da16a12..b7e452f 100644 --- a/evolution/embedded/model.hxx +++ b/evolution/embedded/model.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx index 4ab79e7..af8f1d6 100644 --- a/evolution/embedded/test1.hxx +++ b/evolution/embedded/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx index da007ad..109d11d 100644 --- a/evolution/embedded/test2.hxx +++ b/evolution/embedded/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx index 8b36b61..7143f92 100644 --- a/evolution/embedded/test3.hxx +++ b/evolution/embedded/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/embedded/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index 378fba7..f8877e3 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -1,5 +1,5 @@ # file : evolution/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index 8986aa0..ceb6799 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-add functionality. diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index 9c6a132..b9a97d5 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-add/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index 8913e02..a360388 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx index 0799897..29964f7 100644 --- a/evolution/soft-add/test1.hxx +++ b/evolution/soft-add/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx index ca14b5f..58c6db9 100644 --- a/evolution/soft-add/test2.hxx +++ b/evolution/soft-add/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx index 0a7f341..cb0f68b 100644 --- a/evolution/soft-add/test3.hxx +++ b/evolution/soft-add/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-add/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index af3de6f..977ab61 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-delete functionality. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 1bc5e40..54b82e4 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -1,5 +1,5 @@ # file : evolution/soft-delete/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index c8f31db..bfbb48b 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx index 6f6a991..7ec8166 100644 --- a/evolution/soft-delete/test1.hxx +++ b/evolution/soft-delete/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx index 9edb8fe..847509e 100644 --- a/evolution/soft-delete/test2.hxx +++ b/evolution/soft-delete/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx index d005bce..f6e3ea2 100644 --- a/evolution/soft-delete/test3.hxx +++ b/evolution/soft-delete/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/soft-delete/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 6242f1c..96bb295 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -1,5 +1,5 @@ # file : evolution/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 6666cf0..40f8310 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/evolution/template/makefile b/evolution/template/makefile index e3934fe..f7e85f2 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -1,5 +1,5 @@ # file : evolution/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx index 79437f9..689b3d9 100644 --- a/evolution/template/model.hxx +++ b/evolution/template/model.hxx @@ -1,5 +1,5 @@ // file : evolution/template/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index 6d37e7e..9811f02 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index 5588f27..637cd73 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx index 4a53a0c..851bd4e 100644 --- a/evolution/template/test3.hxx +++ b/evolution/template/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/template/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/test.bat b/evolution/test.bat index 2a78253..658b6f1 100644 --- a/evolution/test.bat +++ b/evolution/test.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/evolution/tester.bat b/evolution/tester.bat index 1a6da1a..2834fa4 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : evolution/tester.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/evolution/tester.in b/evolution/tester.in index 6ad23a6..6e2811c 100755 --- a/evolution/tester.in +++ b/evolution/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : evolution/tester.in -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index 89ab88e..b04d6a6 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -1,5 +1,5 @@ // file : evolution/version/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test schema version access via the database instance. diff --git a/evolution/version/makefile b/evolution/version/makefile index bb5603d..4387db2 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -1,5 +1,5 @@ # file : evolution/version/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx index dc218ef..bdb8b3a 100644 --- a/evolution/version/model.hxx +++ b/evolution/version/model.hxx @@ -1,5 +1,5 @@ // file : evolution/version/model.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx index 3870220..9f73fb7 100644 --- a/evolution/version/test1.hxx +++ b/evolution/version/test1.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test1.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx index 1da2e5a..90e766f 100644 --- a/evolution/version/test2.hxx +++ b/evolution/version/test2.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test2.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx index bd91ca1..ff9a330 100644 --- a/evolution/version/test3.hxx +++ b/evolution/version/test3.hxx @@ -1,5 +1,5 @@ // file : evolution/version/test3.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index 96be71f..56646a8 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index 1eba32c..db00887 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,5 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index a7ee2d8..014bff8 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index ca1240b..237a652 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index 6238389..bbcccbc 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index d2a6be5..0f3f0f3 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,5 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 1d94321..1809887 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 43d019f..0cc99ed 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,5 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index f5e060f..7197081 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,5 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC + * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index a2db12f..0b71caf 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 114d9f9..7754d8c 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,5 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index c406fd3..1a456df 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,5 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index 0012b83..ab918fe 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,5 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 1508103..5d8aaa0 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,5 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index 1afe08b..ac8dbd1 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,5 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 46d2d10..1267ef5 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,5 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index 9f1e22f..5d3d9fc 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index 48a064e..a25bdc5 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index 52218ac..7b1a976 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index ddc8c8e..b7cfebe 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index 2f3aeec..d291b82 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index ee7f8b2..4dca935 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index 214eee9..ce56c0f 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index d7fed36..c901a60 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 7cffd60..5f140bd 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,5 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 4ed10e0..f647b57 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,5 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 772b821..635793f 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,5 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index 216164d..a19e4b8 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index b1d36e7..06aa4fe 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,5 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index 2c404bb..81f09e2 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,5 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index a1ceeaf..d62f8ff 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,5 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index a6f7537..b093362 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,5 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index a235e2d..cd55483 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,5 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 96e3706..79b89cd 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,5 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index b095d18..10bdfdd 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,5 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 3a95900..3f0213e 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,5 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index ccc68a8..bea40e1 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ # file : makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index 5e8ec51..b6976dc 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index fcc42d0..2abec21 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index 28f3a38..f8c5b50 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 2772d91..89d11c9 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,5 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index 8d29386..ad5d2ab 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index a787c6f..26b466b 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx index 4583fef..9fb30dd 100644 --- a/mssql/custom/traits.cxx +++ b/mssql/custom/traits.cxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include "traits.hxx" diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index c4673df..765f4c7 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index c781c11..cb50b5e 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index c01d9a0..3100663 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,5 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index c834388..b5df98c 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,5 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 2210f50..21cd511 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index 7b70116..acc05fa 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,5 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index e921ffb..318d437 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index d67db93..8f3e8d4 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,5 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 9553307..4f6de8a 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,5 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index 2d14cd5..af66316 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server stored procedure support. diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile index b74ed6a..39636cf 100644 --- a/mssql/stored-proc/makefile +++ b/mssql/stored-proc/makefile @@ -1,5 +1,5 @@ # file : mssql/stored-proc/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index 5dc775c..23fe5bd 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -1,5 +1,5 @@ // file : mssql/stored-proc/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index 0231baa..e0aac1a 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index cb7cece..0bc2536 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index fafc2dd..8a6c727 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,5 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index 3319eda..6d99a4b 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index d00f1db..1940399 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 30b775c..6e3981f 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index 026cc31..08ccf5e 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,5 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 34dab5b..1b0d74f 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,5 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index fd80118..d50eecc 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index 74cfa07..9e91e76 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 8e33c41..47e0f53 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index 78bb467..71d5f9e 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index e907a10..9417f38 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,5 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index 56bac36..115bf96 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index 3dbb5fe..701959b 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,5 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 27d33b4..103aa36 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index 28950e0..0b436de 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index 012db1e..bd2b5b2 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,5 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index b33dcfd..600da20 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index 705b0b0..5ee2c47 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,5 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index 27eeaf5..65418fb 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index 781390b..776e137 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,5 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index d6fcd7a..764fede 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index f60421c..8cad758 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,5 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 690cb38..20d6b47 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index fd146ef..3f0cd2f 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index adf4704..5b68362 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,5 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index f500e5e..19afe31 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index b17e727..ddc4782 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index c12a4cd..2b391cf 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 449f033..52c3e10 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,5 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index d668cd2..67a2224 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 86fb69f..d046755 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,5 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 59eb088..1d8eb2a 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,5 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 7aa23b5..a1e9434 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,5 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 3125e44..1f587f5 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,5 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index 58e8f8d..613991f 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index e1e17c9..da7ac11 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index 8cc41b9..0ffd180 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index ec17c7f..eee9ccc 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,5 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index 430bb19..dd9a607 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,5 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index 6dedc8d..e260c4a 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index 163382a..82c926e 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 6a4c601..33e0b01 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,5 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index a715c48..bae778f 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,5 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index 39974a5..f01c4b7 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index 8a33abc..4618620 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,5 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index b44f8dc..d1bf0f3 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index d41f066..171b771 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index af39750..2948160 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,5 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index 6e1bec6..9b6fa5b 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 5779658..2101825 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 6ab69c8..966eab9 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,5 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index 591503d..a37dd9f 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,5 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index eab2e29..0dfb2ac 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,5 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 4bbe98d..379fc77 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,5 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 743fd7b..906a9e3 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index e2b3aed..d3f4c0a 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index 7797632..d844229 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index 9c1a107..d15c8e4 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,5 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index fc912f3..b6f5368 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index 122b7cd..347b083 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index cdd9cf0..3e7ce6c 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 3eba943..6f729f1 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 5a03e5e..5930f45 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,5 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index 6a5d5eb..d07518d 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index 9c7e7ef..d81cf67 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,5 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index 8f99019..dac84ab 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index 35ed117..5d309ba 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,5 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index f1c028e..ee1a74b 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 00056e2..72877de 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,5 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index fb65fef..f224c98 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index b96fbfe..121140f 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index 529bb73..e9434ab 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 98b3850..9550514 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index 5971f7a..6db5f84 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 935b061..654f683 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index 74000ad..b49fcba 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,5 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index c06aa7e..172e0c2 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index f20fb94..479a43b 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,5 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index ccc4d70..b2509bd 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,5 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index b96ea3c..9dcbfba 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 69a3435..604f923 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,5 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index e0a3200..8850028 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,5 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index 0363805..0501b5b 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index 510cdb4..aaca204 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index 7818604..6eb9e70 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index e44c141..cd8b5dd 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,5 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index 456899b..a9f036c 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index 4d4afca..f2d7941 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index e4e34cd..411e1c5 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index dae4178..1b94523 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 425807c..76f1a67 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 46d8cae..8b94998 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,5 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index 4f04860..4c3614c 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index 7caf253..4d90f60 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,5 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 7f3b1a2..096c0ba 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 194c533..8139f36 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,5 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index c27b6e0..5a07b93 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index fbc95da..d132b5f 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index be68d02..e3619d7 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 59ced7f..0e6196b 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,5 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index 8503ec2..bcf9f66 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index 2e23e6c..2c8e672 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index bff2351..4130936 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,5 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 1f8699c..699812b 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index de6adf8..8bfedd1 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 88a1e97..7442395 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index 809c69b..0725dbe 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 360fedb..1bdee52 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index e88c796..3994fc6 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 918c547..5049bbf 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index e35be4b..7906324 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 3ef31c5..9b83561 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 7f25b39..7359e3c 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index d7dbff5..f9be0b0 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index 706168b..e5594ba 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index f7304c1..b0aaef6 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index e3fb38e..b4deee6 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index 176205d..f2e937b 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index 0f05f8d..d0f11a3 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index 965f68a..a973fd0 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 43719df..4be39e4 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index 309f039..d198427 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 8886996..3e891c4 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index 48e864e..baf7ac7 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 5398874..775f04f 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index 6ccf907..b9166d7 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index be117a2..6511c1e 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,5 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index 47fd9ac..e4d2e2f 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index a08f0e1..9bcaffc 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index d60bf46..c5fc6cc 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 668363a..88d41fb 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index df56969..7460a89 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 9a1b66b..274fcda 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 805a0fc..4468031 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index a180667..842e6ac 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index 718dbc4..c0231ef 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 87993a5..0c23da0 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index eaa8157..15bf011 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index dc38d24..e775215 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 05fa075..0ebbd48 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,5 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index f7d0db1..5076743 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index 57eba94..6825f6d 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index 76f40a1..bd612a1 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 9583daa..401a38f 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 5129f8a..3962715 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index eb35f99..4a446d9 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index cbd8b63..4131cd2 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 9f12345..626c034 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index d6b4fce..3ce5ccb 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index b434976..1b89208 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 1e84066..8707bdc 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index 6513fca..e54203c 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 7ade072..1797c1f 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,5 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index 9449384..323c3d2 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index eacc994..fdbc848 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 082b739..4094756 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index 3d7b198..ac71a7c 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index 6b61b24..baa7dd6 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index 773dd96..be141c2 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index 2176305..b7cd23f 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index 00133b9..ce43b02 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 477deb5..10e3dd2 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index c3c10ed..3f5adcd 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index 7a2c271..f4960e4 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index 14193b1..d3f7adb 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index abedf1a..234f236 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index d3c7daa..1bc0974 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index b9eaf97..33c883d 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 7cfd03c..3fd06e0 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index f4da9e8..2b295fe 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/auto/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test manual/automatic id assignment. diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile index 501da48..7c25bd0 100644 --- a/sqlite/auto/makefile +++ b/sqlite/auto/makefile @@ -1,5 +1,5 @@ # file : sqlite/auto/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx index 90d92e8..7430d97 100644 --- a/sqlite/auto/test.hxx +++ b/sqlite/auto/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/auto/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index b2ed2d9..6c2b96b 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index 450f68e..ae57bd3 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,5 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index 7e6bfaf..cf65c89 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index e9e3221..0fae510 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index 74f5679..d03b7b5 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,5 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index 72bc6cc..d653033 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,5 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index c075b0b..2253187 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 114296d..6e00b81 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,5 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 226650f..15e2cc9 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/stream/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite BLOB/TEXT incremental I/O. diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile index cbfae24..fdf8e15 100644 --- a/sqlite/stream/makefile +++ b/sqlite/stream/makefile @@ -1,5 +1,5 @@ # file : sqlite/stream/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx index edbac11..f4760a1 100644 --- a/sqlite/stream/test.hxx +++ b/sqlite/stream/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/stream/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index a2a37e9..049ee1c 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,5 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index 044475b..69f3955 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 8a5e99f..943f54a 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,5 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index 57c5bc7..4b2e29d 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index 68cb805..fdf5596 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,6 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index c33f6e7..b996990 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test esoteric SQLite transaction semantics aspects. diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index c60ebfc..b90561a 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -1,5 +1,5 @@ # file : sqlite/transaction/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx index 8ab70b7..94ef54c 100644 --- a/sqlite/transaction/test.hxx +++ b/sqlite/transaction/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/transaction/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index c22ef26..b7016e9 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index d2c2fbe..6302950 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,5 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 0a0490f..96846df 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 266808e..3ffef1c 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,5 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index 9177641..e7d284c 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,5 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index c98b94a..40b4298 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index db5e264..3f4172c 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,5 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index 91ea3b8..b6965a3 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,6 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index 16145c5..fbc9664 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,6 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index af8003c..298fd66 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,7 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC +# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From b5b496e72341a00faa6eb9211a94a901b064464d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Feb 2019 07:44:57 +0200 Subject: Release version 2.5.0-b.11 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c8f4946..3ba4219 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.10 +2.5.0-b.11 -- cgit v1.1 From 203b1df0bd1303b3c8b032441b87ba3492bb2edc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Feb 2019 16:24:13 +0200 Subject: Change version to 2.5.0-b.12.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 3ba4219..4a125a9 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.11 +2.5.0-b.12 -- cgit v1.1 From 89b994375d34d52dd75e4bad940262df04a773fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Mar 2019 16:01:55 +0200 Subject: Release version 2.5.0-b.13 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 4a125a9..e3350c4 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.12 +2.5.0-b.13 -- cgit v1.1 From 4279e63d9a40c5aa121c512e58e8de8b00961e32 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Mar 2019 17:13:50 +0200 Subject: Change version to 2.5.0-b.14.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index e3350c4..17ef4f0 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.13 +2.5.0-b.14 -- cgit v1.1 From 09f2895df6155c1a99e161de789c344ce5181c1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 8 Jun 2019 10:06:20 +0200 Subject: Release version 2.5.0-b.15 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 17ef4f0..48aee48 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.14 +2.5.0-b.15 -- cgit v1.1 From d1e6fad5b42e19b0864404f48cd688d60ddc912a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 11 Jun 2019 11:59:44 +0200 Subject: Change version to 2.5.0-b.16.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 48aee48..dfe1a80 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.15 +2.5.0-b.16 -- cgit v1.1 From a8827aead15b8236c5199c52c87cdd23bea080e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Nov 2019 07:21:02 +0200 Subject: Release version 2.5.0-b.17 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index dfe1a80..020c790 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.16 +2.5.0-b.17 -- cgit v1.1 From 1972fdc1121867819289e96805914424fe591ade Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Nov 2019 06:30:31 +0200 Subject: Change version to 2.5.0-b.18.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 020c790..a9b5191 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.17 +2.5.0-b.18 -- cgit v1.1 From 92205113eeada07489006a7fa8f97d5e7fc90a38 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Feb 2020 13:24:39 +0300 Subject: Add copyright notice to LICENSE file --- LICENSE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index 612c66c..9917599 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2009-2019 Code Synthesis Tools CC. + 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. -- cgit v1.1 From 0197a126d3dace3a1631e6bc376197a2fcf5f8ea Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Feb 2020 14:07:34 +0300 Subject: Remove build/import/*/LICENSE files --- build/import/libboost/LICENSE | 340 ------------------------------------- build/import/libodb-boost/LICENSE | 12 -- build/import/libodb-mssql/LICENSE | 19 --- build/import/libodb-mysql/LICENSE | 12 -- build/import/libodb-oracle/LICENSE | 13 -- build/import/libodb-pgsql/LICENSE | 12 -- build/import/libodb-qt/LICENSE | 12 -- build/import/libodb-sqlite/LICENSE | 12 -- build/import/libodb/LICENSE | 12 -- build/import/libqt/LICENSE | 340 ------------------------------------- build/import/odb/LICENSE | 12 -- 11 files changed, 796 deletions(-) delete mode 100644 build/import/libboost/LICENSE delete mode 100644 build/import/libodb-boost/LICENSE delete mode 100644 build/import/libodb-mssql/LICENSE delete mode 100644 build/import/libodb-mysql/LICENSE delete mode 100644 build/import/libodb-oracle/LICENSE delete mode 100644 build/import/libodb-pgsql/LICENSE delete mode 100644 build/import/libodb-qt/LICENSE delete mode 100644 build/import/libodb-sqlite/LICENSE delete mode 100644 build/import/libodb/LICENSE delete mode 100644 build/import/libqt/LICENSE delete mode 100644 build/import/odb/LICENSE diff --git a/build/import/libboost/LICENSE b/build/import/libboost/LICENSE deleted file mode 100644 index 3912109..0000000 --- a/build/import/libboost/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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 more 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/build/import/libodb-boost/LICENSE b/build/import/libodb-boost/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-boost/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-mssql/LICENSE b/build/import/libodb-mssql/LICENSE deleted file mode 100644 index e559d65..0000000 --- a/build/import/libodb-mssql/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Permission is granted to use, copy, modify, and distribute this -program under the ODB Non-Commercial Use and Evaluation License -(NCUEL) as published by Code Synthesis Tools CC. - -For more information on ODB licensing as well as for answers to -some of the common licensing questions, visit the ODB License -page: - -http://www.codesynthesis.com/products/odb/license.xhtml - -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 -ODB Non-Commercial Use and Evaluation License for details. - -You should have received a copy of the ODB Non-Commercial Use and -Evaluation License (normally located in the NCUEL file that is -accompanying the distribution); if not, contact Code Synthesis -Tools CC at info@codesynthesis.com. diff --git a/build/import/libodb-mysql/LICENSE b/build/import/libodb-mysql/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-mysql/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-oracle/LICENSE b/build/import/libodb-oracle/LICENSE deleted file mode 100644 index ec74f50..0000000 --- a/build/import/libodb-oracle/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Permission is granted to use, copy, modify, and distribute this -program under the ODB Non-Commercial Use and Evaluation License -(NCUEL) as published by Code Synthesis Tools CC. - -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 -ODB Non-Commercial Use and Evaluation License for details. - -You should have received a copy of the ODB Non-Commercial Use and -Evaluation License (normally located in the NCUEL file that is -accompanying the distribution); if not, contact Code Synthesis -Tools CC at info@codesynthesis.com. diff --git a/build/import/libodb-pgsql/LICENSE b/build/import/libodb-pgsql/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-pgsql/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-qt/LICENSE b/build/import/libodb-qt/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-qt/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-sqlite/LICENSE b/build/import/libodb-sqlite/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb-sqlite/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/LICENSE b/build/import/libodb/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/libodb/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/libqt/LICENSE b/build/import/libqt/LICENSE deleted file mode 100644 index 3912109..0000000 --- a/build/import/libqt/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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 more 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/build/import/odb/LICENSE b/build/import/odb/LICENSE deleted file mode 100644 index ed9c55c..0000000 --- a/build/import/odb/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 -- cgit v1.1 From d0f70a73a427364693ca529f45ce218ef7c036c3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Feb 2020 14:08:00 +0300 Subject: Update last year in LICENSE file --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9917599..d106b92 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2019 Code Synthesis Tools CC. +Copyright (c) 2009-2020 Code Synthesis Tools CC. 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 -- cgit v1.1 From 6da43dcf1dfabb382a4e2c2d7d5e0c66f159738b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Feb 2020 14:10:04 +0300 Subject: Drop copyright notice from source code --- Makefile.am | 1 - boost/Makefile.am | 1 - boost/build.bat | 1 - boost/common/Makefile.am | 1 - boost/common/makefile | 1 - boost/common/multi-index/driver.cxx | 1 - boost/common/multi-index/makefile | 1 - boost/common/multi-index/test.hxx | 1 - boost/common/optional/driver.cxx | 1 - boost/common/optional/makefile | 1 - boost/common/optional/test.hxx | 1 - boost/common/smart-ptr/driver.cxx | 1 - boost/common/smart-ptr/makefile | 1 - boost/common/smart-ptr/test.hxx | 1 - boost/common/template/Makefile.am | 1 - boost/common/template/driver.cxx | 1 - boost/common/template/makefile | 1 - boost/common/template/test.hxx | 1 - boost/common/test.bat | 1 - boost/common/unordered/driver.cxx | 1 - boost/common/unordered/makefile | 1 - boost/common/unordered/test.hxx | 1 - boost/common/uuid/driver.cxx | 1 - boost/common/uuid/makefile | 1 - boost/common/uuid/test.hxx | 1 - boost/makefile | 1 - boost/mssql/Makefile.am | 1 - boost/mssql/date-time/driver.cxx | 1 - boost/mssql/date-time/makefile | 1 - boost/mssql/date-time/test.hxx | 1 - boost/mssql/makefile | 1 - boost/mssql/template/Makefile.am | 1 - boost/mssql/template/driver.cxx | 1 - boost/mssql/template/makefile | 1 - boost/mssql/template/test.hxx | 1 - boost/mssql/test.bat | 1 - boost/mysql/Makefile.am | 1 - boost/mysql/date-time/driver.cxx | 1 - boost/mysql/date-time/makefile | 1 - boost/mysql/date-time/test.hxx | 1 - boost/mysql/makefile | 1 - boost/mysql/template/Makefile.am | 1 - boost/mysql/template/driver.cxx | 1 - boost/mysql/template/makefile | 1 - boost/mysql/template/test.hxx | 1 - boost/mysql/test.bat | 1 - boost/oracle/Makefile.am | 1 - boost/oracle/date-time/driver.cxx | 1 - boost/oracle/date-time/makefile | 1 - boost/oracle/date-time/test.hxx | 1 - boost/oracle/makefile | 1 - boost/oracle/template/Makefile.am | 1 - boost/oracle/template/driver.cxx | 1 - boost/oracle/template/makefile | 1 - boost/oracle/template/test.hxx | 1 - boost/oracle/test.bat | 1 - boost/pgsql/Makefile.am | 1 - boost/pgsql/date-time/driver.cxx | 1 - boost/pgsql/date-time/makefile | 1 - boost/pgsql/date-time/test.hxx | 1 - boost/pgsql/makefile | 1 - boost/pgsql/template/Makefile.am | 1 - boost/pgsql/template/driver.cxx | 1 - boost/pgsql/template/makefile | 1 - boost/pgsql/template/test.hxx | 1 - boost/pgsql/test.bat | 1 - boost/sqlite/Makefile.am | 1 - boost/sqlite/date-time/driver.cxx | 1 - boost/sqlite/date-time/makefile | 1 - boost/sqlite/date-time/test.hxx | 1 - boost/sqlite/makefile | 1 - boost/sqlite/template/Makefile.am | 1 - boost/sqlite/template/driver.cxx | 1 - boost/sqlite/template/makefile | 1 - boost/sqlite/template/test.hxx | 1 - boost/sqlite/test.bat | 1 - bootstrap | 1 - build.bat | 1 - build/bootstrap.make | 1 - build/configuration-rules.make | 1 - build/configuration.make | 1 - build/configure | 1 - build/import/libboost/configuration-rules.make | 1 - build/import/libboost/configure | 1 - build/import/libboost/date-time/rules.make | 1 - build/import/libboost/date-time/stub.make | 1 - build/import/libboost/header-only/rules.make | 1 - build/import/libboost/header-only/stub.make | 1 - build/import/libodb-boost/configuration-rules.make | 1 - build/import/libodb-boost/configure | 1 - build/import/libodb-boost/stub.make | 1 - build/import/libodb-mssql/configuration-rules.make | 1 - build/import/libodb-mssql/configure | 1 - build/import/libodb-mssql/stub.make | 1 - build/import/libodb-mysql/configuration-rules.make | 1 - build/import/libodb-mysql/configure | 1 - build/import/libodb-mysql/stub.make | 1 - build/import/libodb-oracle/configuration-rules.make | 1 - build/import/libodb-oracle/configure | 1 - build/import/libodb-oracle/stub.make | 1 - build/import/libodb-pgsql/configuration-rules.make | 1 - build/import/libodb-pgsql/configure | 1 - build/import/libodb-pgsql/stub.make | 1 - build/import/libodb-qt/configuration-rules.make | 1 - build/import/libodb-qt/configure | 1 - build/import/libodb-qt/stub.make | 1 - build/import/libodb-sqlite/configuration-rules.make | 1 - build/import/libodb-sqlite/configure | 1 - build/import/libodb-sqlite/stub.make | 1 - build/import/libodb/configuration-rules.make | 1 - build/import/libodb/configure | 1 - build/import/libodb/stub.make | 1 - build/import/libqt/configuration-rules.make | 1 - build/import/libqt/configure | 1 - build/import/libqt/core/rules.make | 1 - build/import/libqt/core/stub.make | 1 - build/import/odb/configuration-rules.make | 1 - build/import/odb/configure | 1 - build/import/odb/hxx-cxx.make | 1 - build/import/odb/stub.make | 1 - build/mssql/configure | 1 - build/mssql/mssql | 1 - build/mysql/configure | 1 - build/mysql/mysql | 1 - build/oracle/configure | 1 - build/oracle/oracle | 1 - build/pgsql/configure | 1 - build/pgsql/pgsql | 1 - build/sqlite/configure | 1 - common/Makefile.am | 1 - common/access/driver.cxx | 1 - common/access/makefile | 1 - common/access/test.hxx | 1 - common/as/driver.cxx | 1 - common/as/makefile | 1 - common/as/test.hxx | 1 - common/blob/driver.cxx | 1 - common/blob/makefile | 1 - common/blob/test.hxx | 1 - common/bulk/driver.cxx | 1 - common/bulk/makefile | 1 - common/bulk/test.hxx | 1 - common/callback/driver.cxx | 1 - common/callback/makefile | 1 - common/callback/test.hxx | 1 - common/changelog/add-column.hxx | 1 - common/changelog/add-foreign-key.hxx | 1 - common/changelog/add-index.hxx | 1 - common/changelog/add-table.hxx | 1 - common/changelog/alter-column.hxx | 1 - common/changelog/drop-column.hxx | 1 - common/changelog/drop-foreign-key.hxx | 1 - common/changelog/drop-index.hxx | 1 - common/changelog/drop-table.hxx | 1 - common/changelog/makefile | 1 - common/changelog/model.hxx | 1 - common/circular/multiple/driver.cxx | 1 - common/circular/multiple/makefile | 1 - common/circular/multiple/test1.hxx | 1 - common/circular/multiple/test2.hxx | 1 - common/circular/single/driver.cxx | 1 - common/circular/single/makefile | 1 - common/circular/single/test.hxx | 1 - common/composite/driver.cxx | 1 - common/composite/makefile | 1 - common/composite/test.hxx | 1 - common/const-member/driver.cxx | 1 - common/const-member/makefile | 1 - common/const-member/test.hxx | 1 - common/const-object/driver.cxx | 1 - common/const-object/makefile | 1 - common/const-object/test.hxx | 1 - common/container/basics/driver.cxx | 1 - common/container/basics/makefile | 1 - common/container/basics/test.hxx | 1 - common/container/change-tracking/driver.cxx | 1 - common/container/change-tracking/makefile | 1 - common/container/change-tracking/test.hxx | 1 - common/ctor/driver.cxx | 1 - common/ctor/makefile | 1 - common/ctor/test.hxx | 1 - common/default/driver.cxx | 1 - common/default/makefile | 1 - common/default/test.hxx | 1 - common/definition/driver.cxx | 1 - common/definition/makefile | 1 - common/definition/test.hxx | 1 - common/definition/time-mapping.hxx | 1 - common/enum/driver.cxx | 1 - common/enum/makefile | 1 - common/enum/test.hxx | 1 - common/erase-query/driver.cxx | 1 - common/erase-query/makefile | 1 - common/erase-query/test.hxx | 1 - common/id/auto/driver.cxx | 1 - common/id/auto/makefile | 1 - common/id/auto/test.hxx | 1 - common/id/composite/driver.cxx | 1 - common/id/composite/makefile | 1 - common/id/composite/test.hxx | 1 - common/id/nested/driver.cxx | 1 - common/id/nested/makefile | 1 - common/id/nested/test.hxx | 1 - common/include/driver.cxx | 1 - common/include/makefile | 1 - common/include/obj1.hxx | 1 - common/include/obj2.hxx | 1 - common/include/obj3.hxx | 1 - common/include/objs1.hxx | 1 - common/include/objs2.hxx | 1 - common/include/objs3.hxx | 1 - common/include/objs4.hxx | 1 - common/include/test1.hxx | 1 - common/include/test2.hxx | 1 - common/include/test3.hxx | 1 - common/include/test4.hxx | 1 - common/index/driver.cxx | 1 - common/index/makefile | 1 - common/index/test.hxx | 1 - common/inheritance/polymorphism/driver.cxx | 1 - common/inheritance/polymorphism/makefile | 1 - common/inheritance/polymorphism/test1.hxx | 1 - common/inheritance/polymorphism/test10.hxx | 1 - common/inheritance/polymorphism/test11.hxx | 1 - common/inheritance/polymorphism/test12.hxx | 1 - common/inheritance/polymorphism/test13.hxx | 1 - common/inheritance/polymorphism/test14.hxx | 1 - common/inheritance/polymorphism/test15.hxx | 1 - common/inheritance/polymorphism/test2.hxx | 1 - common/inheritance/polymorphism/test3.hxx | 1 - common/inheritance/polymorphism/test4.hxx | 1 - common/inheritance/polymorphism/test5.hxx | 1 - common/inheritance/polymorphism/test6.hxx | 1 - common/inheritance/polymorphism/test7.hxx | 1 - common/inheritance/polymorphism/test8.hxx | 1 - common/inheritance/polymorphism/test9.hxx | 1 - common/inheritance/reuse/driver.cxx | 1 - common/inheritance/reuse/makefile | 1 - common/inheritance/reuse/test.hxx | 1 - common/inheritance/transient/driver.cxx | 1 - common/inheritance/transient/makefile | 1 - common/inheritance/transient/test.hxx | 1 - common/inverse/driver.cxx | 1 - common/inverse/makefile | 1 - common/inverse/test.hxx | 1 - common/lazy-ptr/driver.cxx | 1 - common/lazy-ptr/makefile | 1 - common/lazy-ptr/test.hxx | 1 - common/lifecycle/driver.cxx | 1 - common/lifecycle/makefile | 1 - common/lifecycle/test.hxx | 1 - common/makefile | 1 - common/no-id/driver.cxx | 1 - common/no-id/makefile | 1 - common/no-id/test.hxx | 1 - common/object/driver.cxx | 1 - common/object/makefile | 1 - common/object/test.hxx | 1 - common/optimistic/driver.cxx | 1 - common/optimistic/makefile | 1 - common/optimistic/test.hxx | 1 - common/pragma/driver.cxx | 1 - common/pragma/makefile | 1 - common/pragma/test.hxx | 1 - common/prepared/driver.cxx | 1 - common/prepared/makefile | 1 - common/prepared/test.hxx | 1 - common/query/array/driver.cxx | 1 - common/query/array/makefile | 1 - common/query/array/test.hxx | 1 - common/query/basics/driver.cxx | 1 - common/query/basics/makefile | 1 - common/query/basics/test.hxx | 1 - common/query/one/driver.cxx | 1 - common/query/one/makefile | 1 - common/query/one/test.hxx | 1 - common/readonly/driver.cxx | 1 - common/readonly/makefile | 1 - common/readonly/test.hxx | 1 - common/relationship/basics/driver.cxx | 1 - common/relationship/basics/makefile | 1 - common/relationship/basics/test.hxx | 1 - common/relationship/on-delete/driver.cxx | 1 - common/relationship/on-delete/makefile | 1 - common/relationship/on-delete/test.hxx | 1 - common/relationship/query/driver.cxx | 1 - common/relationship/query/makefile | 1 - common/relationship/query/test.hxx | 1 - common/schema/embedded/basics/driver.cxx | 1 - common/schema/embedded/basics/makefile | 1 - common/schema/embedded/basics/test.hxx | 1 - common/schema/embedded/order/driver.cxx | 1 - common/schema/embedded/order/makefile | 1 - common/schema/embedded/order/test1.hxx | 1 - common/schema/embedded/order/test2.hxx | 1 - common/schema/namespace/driver.cxx | 1 - common/schema/namespace/makefile | 1 - common/schema/namespace/test.hxx | 1 - common/section/basics/driver.cxx | 1 - common/section/basics/makefile | 1 - common/section/basics/test.hxx | 1 - common/section/polymorphism/driver.cxx | 1 - common/section/polymorphism/makefile | 1 - common/section/polymorphism/test.hxx | 1 - common/session/cache/driver.cxx | 1 - common/session/cache/makefile | 1 - common/session/cache/test.hxx | 1 - common/session/custom/driver.cxx | 1 - common/session/custom/makefile | 1 - common/session/custom/session.cxx | 1 - common/session/custom/session.hxx | 1 - common/session/custom/session.txx | 1 - common/session/custom/test.hxx | 1 - common/statement/processing/driver.cxx | 1 - common/statement/processing/makefile | 1 - common/template/Makefile.am | 1 - common/template/driver.cxx | 1 - common/template/makefile | 1 - common/template/test.hxx | 1 - common/test.bat | 1 - common/threads/driver.cxx | 1 - common/threads/makefile | 1 - common/threads/test.hxx | 1 - common/transaction/basics/driver.cxx | 1 - common/transaction/basics/makefile | 1 - common/transaction/callback/driver.cxx | 1 - common/transaction/callback/makefile | 1 - common/types/driver.cxx | 1 - common/types/makefile | 1 - common/types/test.hxx | 1 - common/view/basics/driver.cxx | 1 - common/view/basics/makefile | 1 - common/view/basics/test.hxx | 1 - common/view/olv/driver.cxx | 1 - common/view/olv/makefile | 1 - common/view/olv/test1.hxx | 1 - common/view/olv/test2.hxx | 1 - common/view/olv/test3.hxx | 1 - common/view/olv/test4.hxx | 1 - common/view/olv/test5.hxx | 1 - common/view/olv/test6.hxx | 1 - common/view/olv/test7.hxx | 1 - common/view/olv/test8.hxx | 1 - common/view/olv/test9.hxx | 1 - common/virtual/driver.cxx | 1 - common/virtual/makefile | 1 - common/virtual/test.hxx | 1 - common/wrapper/driver.cxx | 1 - common/wrapper/makefile | 1 - common/wrapper/test.hxx | 1 - configure.ac | 1 - diagnostics/containers-of-containers.hxx | 1 - evolution/Makefile.am | 1 - evolution/add-column/driver.cxx | 1 - evolution/add-column/makefile | 1 - evolution/add-column/model.hxx | 1 - evolution/add-column/test1.hxx | 1 - evolution/add-column/test2.hxx | 1 - evolution/add-column/test3.hxx | 1 - evolution/add-foreign-key/driver.cxx | 1 - evolution/add-foreign-key/makefile | 1 - evolution/add-foreign-key/model.hxx | 1 - evolution/add-foreign-key/test1.hxx | 1 - evolution/add-foreign-key/test2.hxx | 1 - evolution/add-foreign-key/test3.hxx | 1 - evolution/add-index/driver.cxx | 1 - evolution/add-index/makefile | 1 - evolution/add-index/model.hxx | 1 - evolution/add-index/test1.hxx | 1 - evolution/add-index/test2.hxx | 1 - evolution/add-index/test3.hxx | 1 - evolution/add-table/driver.cxx | 1 - evolution/add-table/makefile | 1 - evolution/add-table/model.hxx | 1 - evolution/add-table/test1.hxx | 1 - evolution/add-table/test2.hxx | 1 - evolution/add-table/test3.hxx | 1 - evolution/alter-column/driver.cxx | 1 - evolution/alter-column/makefile | 1 - evolution/alter-column/model.hxx | 1 - evolution/alter-column/test1.hxx | 1 - evolution/alter-column/test2.hxx | 1 - evolution/alter-column/test3.hxx | 1 - evolution/combined/driver.cxx | 1 - evolution/combined/makefile | 1 - evolution/combined/model.hxx | 1 - evolution/combined/test1.hxx | 1 - evolution/combined/test2.hxx | 1 - evolution/combined/test3.hxx | 1 - evolution/data/driver.cxx | 1 - evolution/data/makefile | 1 - evolution/data/model.hxx | 1 - evolution/data/test1.hxx | 1 - evolution/data/test2.hxx | 1 - evolution/data/test3.hxx | 1 - evolution/drop-column/driver.cxx | 1 - evolution/drop-column/makefile | 1 - evolution/drop-column/model.hxx | 1 - evolution/drop-column/test1.hxx | 1 - evolution/drop-column/test2.hxx | 1 - evolution/drop-column/test3.hxx | 1 - evolution/drop-foreign-key/driver.cxx | 1 - evolution/drop-foreign-key/makefile | 1 - evolution/drop-foreign-key/model.hxx | 1 - evolution/drop-foreign-key/test1.hxx | 1 - evolution/drop-foreign-key/test2.hxx | 1 - evolution/drop-foreign-key/test3.hxx | 1 - evolution/drop-index/driver.cxx | 1 - evolution/drop-index/makefile | 1 - evolution/drop-index/model.hxx | 1 - evolution/drop-index/test1.hxx | 1 - evolution/drop-index/test2.hxx | 1 - evolution/drop-index/test3.hxx | 1 - evolution/drop-table/driver.cxx | 1 - evolution/drop-table/makefile | 1 - evolution/drop-table/model.hxx | 1 - evolution/drop-table/test1.hxx | 1 - evolution/drop-table/test2.hxx | 1 - evolution/drop-table/test3.hxx | 1 - evolution/embedded/driver.cxx | 1 - evolution/embedded/makefile | 1 - evolution/embedded/model.hxx | 1 - evolution/embedded/test1.hxx | 1 - evolution/embedded/test2.hxx | 1 - evolution/embedded/test3.hxx | 1 - evolution/makefile | 1 - evolution/soft-add/driver.cxx | 1 - evolution/soft-add/makefile | 1 - evolution/soft-add/model.hxx | 1 - evolution/soft-add/test1.hxx | 1 - evolution/soft-add/test2.hxx | 1 - evolution/soft-add/test3.hxx | 1 - evolution/soft-delete/driver.cxx | 1 - evolution/soft-delete/makefile | 1 - evolution/soft-delete/model.hxx | 1 - evolution/soft-delete/test1.hxx | 1 - evolution/soft-delete/test2.hxx | 1 - evolution/soft-delete/test3.hxx | 1 - evolution/template/Makefile.am | 1 - evolution/template/driver.cxx | 1 - evolution/template/makefile | 1 - evolution/template/model.hxx | 1 - evolution/template/test1.hxx | 1 - evolution/template/test2.hxx | 1 - evolution/template/test3.hxx | 1 - evolution/test.bat | 1 - evolution/tester.bat | 1 - evolution/tester.in | 1 - evolution/version/driver.cxx | 1 - evolution/version/makefile | 1 - evolution/version/model.hxx | 1 - evolution/version/test1.hxx | 1 - evolution/version/test2.hxx | 1 - evolution/version/test3.hxx | 1 - libcommon/Makefile.am | 1 - libcommon/common/Makefile.am | 1 - libcommon/common/buffer.hxx | 1 - libcommon/common/common.cxx | 1 - libcommon/common/common.hxx | 1 - libcommon/common/common.txx | 1 - libcommon/common/concrete.hxx | 1 - libcommon/common/config-vc.h | 1 - libcommon/common/config.h.in | 1 - libcommon/common/config.hxx | 1 - libcommon/common/export.hxx | 1 - libcommon/common/makefile | 1 - libcommon/makefile | 1 - m4/c++11.m4 | 1 - m4/database.m4 | 1 - m4/diff.m4 | 1 - m4/libboost.m4 | 1 - m4/libodb-boost.m4 | 1 - m4/libodb-mssql.m4 | 1 - m4/libodb-mysql.m4 | 1 - m4/libodb-oracle.m4 | 1 - m4/libodb-pgsql.m4 | 1 - m4/libodb-qt.m4 | 1 - m4/libodb-sqlite.m4 | 1 - m4/libodb.m4 | 1 - m4/libqt.m4 | 1 - m4/libtool-link.m4 | 1 - m4/mssql.m4 | 1 - m4/mysql.m4 | 1 - m4/odb.m4 | 1 - m4/oracle.m4 | 1 - m4/pgsql.m4 | 1 - m4/sqlite.m4 | 1 - m4/static-lib.m4 | 1 - m4/threads.m4 | 1 - m4/tr1-memory.m4 | 1 - makefile | 1 - mssql-driver.bat | 1 - mssql/Makefile.am | 1 - mssql/custom/driver.cxx | 1 - mssql/custom/makefile | 1 - mssql/custom/query.hxx | 1 - mssql/custom/test.hxx | 1 - mssql/custom/traits.cxx | 1 - mssql/custom/traits.hxx | 1 - mssql/database/driver.cxx | 1 - mssql/database/makefile | 1 - mssql/makefile | 1 - mssql/native/driver.cxx | 1 - mssql/native/makefile | 1 - mssql/query/driver.cxx | 1 - mssql/query/makefile | 1 - mssql/query/test.hxx | 1 - mssql/stored-proc/driver.cxx | 1 - mssql/stored-proc/makefile | 1 - mssql/stored-proc/test.hxx | 1 - mssql/template/Makefile.am | 1 - mssql/template/driver.cxx | 1 - mssql/template/makefile | 1 - mssql/template/test.hxx | 1 - mssql/test.bat | 1 - mssql/types/driver.cxx | 1 - mssql/types/makefile | 1 - mssql/types/test.hxx | 1 - mssql/types/traits.hxx | 1 - mysql-driver.bat | 1 - mysql/Makefile.am | 1 - mysql/custom/driver.cxx | 1 - mysql/custom/makefile | 1 - mysql/custom/query.hxx | 1 - mysql/custom/test.hxx | 1 - mysql/custom/traits.hxx | 1 - mysql/database/driver.cxx | 1 - mysql/database/makefile | 1 - mysql/index/driver.cxx | 1 - mysql/index/makefile | 1 - mysql/index/test.hxx | 1 - mysql/makefile | 1 - mysql/native/driver.cxx | 1 - mysql/native/makefile | 1 - mysql/template/Makefile.am | 1 - mysql/template/driver.cxx | 1 - mysql/template/makefile | 1 - mysql/template/test.hxx | 1 - mysql/test.bat | 1 - mysql/truncation/driver.cxx | 1 - mysql/truncation/makefile | 1 - mysql/truncation/test.hxx | 1 - mysql/types/driver.cxx | 1 - mysql/types/makefile | 1 - mysql/types/test.hxx | 1 - mysql/types/traits.hxx | 1 - oracle-driver.bat | 1 - oracle/Makefile.am | 1 - oracle/custom/driver.cxx | 1 - oracle/custom/makefile | 1 - oracle/custom/test.hxx | 1 - oracle/custom/traits.hxx | 1 - oracle/database/driver.cxx | 1 - oracle/database/makefile | 1 - oracle/makefile | 1 - oracle/native/driver.cxx | 1 - oracle/native/makefile | 1 - oracle/template/Makefile.am | 1 - oracle/template/driver.cxx | 1 - oracle/template/makefile | 1 - oracle/template/test.hxx | 1 - oracle/test.bat | 1 - oracle/types/driver.cxx | 1 - oracle/types/makefile | 1 - oracle/types/test.hxx | 1 - oracle/types/traits.hxx | 1 - pgsql-driver.bat | 1 - pgsql/Makefile.am | 1 - pgsql/custom/driver.cxx | 1 - pgsql/custom/makefile | 1 - pgsql/custom/query.hxx | 1 - pgsql/custom/test.hxx | 1 - pgsql/custom/traits.hxx | 1 - pgsql/database/driver.cxx | 1 - pgsql/database/makefile | 1 - pgsql/index/driver.cxx | 1 - pgsql/index/makefile | 1 - pgsql/index/test.hxx | 1 - pgsql/makefile | 1 - pgsql/native/driver.cxx | 1 - pgsql/native/makefile | 1 - pgsql/template/Makefile.am | 1 - pgsql/template/driver.cxx | 1 - pgsql/template/makefile | 1 - pgsql/template/test.hxx | 1 - pgsql/test.bat | 1 - pgsql/truncation/driver.cxx | 1 - pgsql/truncation/makefile | 1 - pgsql/truncation/test.hxx | 1 - pgsql/types/driver.cxx | 1 - pgsql/types/makefile | 1 - pgsql/types/test.hxx | 1 - pgsql/types/traits.hxx | 1 - qt/Makefile.am | 1 - qt/build.bat | 1 - qt/common/Makefile.am | 1 - qt/common/basic/driver.cxx | 1 - qt/common/basic/makefile | 1 - qt/common/basic/test.hxx | 1 - qt/common/containers/basics/driver.cxx | 1 - qt/common/containers/basics/makefile | 1 - qt/common/containers/basics/test.hxx | 1 - qt/common/containers/change-tracking/driver.cxx | 1 - qt/common/containers/change-tracking/makefile | 1 - qt/common/containers/change-tracking/test.hxx | 1 - qt/common/makefile | 1 - qt/common/smart-ptr/driver.cxx | 1 - qt/common/smart-ptr/makefile | 1 - qt/common/smart-ptr/test.hxx | 1 - qt/common/template/Makefile.am | 1 - qt/common/template/driver.cxx | 1 - qt/common/template/makefile | 1 - qt/common/template/test.hxx | 1 - qt/common/test.bat | 1 - qt/makefile | 1 - qt/mssql/Makefile.am | 1 - qt/mssql/basic/driver.cxx | 1 - qt/mssql/basic/makefile | 1 - qt/mssql/basic/test.hxx | 1 - qt/mssql/date-time/driver.cxx | 1 - qt/mssql/date-time/makefile | 1 - qt/mssql/date-time/test.hxx | 1 - qt/mssql/makefile | 1 - qt/mssql/template/Makefile.am | 1 - qt/mssql/template/driver.cxx | 1 - qt/mssql/template/makefile | 1 - qt/mssql/template/test.hxx | 1 - qt/mssql/test.bat | 1 - qt/mysql/Makefile.am | 1 - qt/mysql/basic/driver.cxx | 1 - qt/mysql/basic/makefile | 1 - qt/mysql/basic/test.hxx | 1 - qt/mysql/date-time/driver.cxx | 1 - qt/mysql/date-time/makefile | 1 - qt/mysql/date-time/test.hxx | 1 - qt/mysql/makefile | 1 - qt/mysql/template/Makefile.am | 1 - qt/mysql/template/driver.cxx | 1 - qt/mysql/template/makefile | 1 - qt/mysql/template/test.hxx | 1 - qt/mysql/test.bat | 1 - qt/oracle/Makefile.am | 1 - qt/oracle/basic/driver.cxx | 1 - qt/oracle/basic/makefile | 1 - qt/oracle/basic/test.hxx | 1 - qt/oracle/date-time/driver.cxx | 1 - qt/oracle/date-time/makefile | 1 - qt/oracle/date-time/test.hxx | 1 - qt/oracle/makefile | 1 - qt/oracle/template/Makefile.am | 1 - qt/oracle/template/driver.cxx | 1 - qt/oracle/template/makefile | 1 - qt/oracle/template/test.hxx | 1 - qt/oracle/test.bat | 1 - qt/pgsql/Makefile.am | 1 - qt/pgsql/basic/driver.cxx | 1 - qt/pgsql/basic/makefile | 1 - qt/pgsql/basic/test.hxx | 1 - qt/pgsql/date-time/driver.cxx | 1 - qt/pgsql/date-time/makefile | 1 - qt/pgsql/date-time/test.hxx | 1 - qt/pgsql/makefile | 1 - qt/pgsql/template/Makefile.am | 1 - qt/pgsql/template/driver.cxx | 1 - qt/pgsql/template/makefile | 1 - qt/pgsql/template/test.hxx | 1 - qt/pgsql/test.bat | 1 - qt/sqlite/Makefile.am | 1 - qt/sqlite/basic/driver.cxx | 1 - qt/sqlite/basic/makefile | 1 - qt/sqlite/basic/test.hxx | 1 - qt/sqlite/date-time/driver.cxx | 1 - qt/sqlite/date-time/makefile | 1 - qt/sqlite/date-time/test.hxx | 1 - qt/sqlite/makefile | 1 - qt/sqlite/template/Makefile.am | 1 - qt/sqlite/template/driver.cxx | 1 - qt/sqlite/template/makefile | 1 - qt/sqlite/template/test.hxx | 1 - qt/sqlite/test.bat | 1 - sqlite/Makefile.am | 1 - sqlite/auto/driver.cxx | 1 - sqlite/auto/makefile | 1 - sqlite/auto/test.hxx | 1 - sqlite/custom/driver.cxx | 1 - sqlite/custom/makefile | 1 - sqlite/custom/test.hxx | 1 - sqlite/database/driver.cxx | 1 - sqlite/database/makefile | 1 - sqlite/makefile | 1 - sqlite/native/driver.cxx | 1 - sqlite/native/makefile | 1 - sqlite/stream/driver.cxx | 1 - sqlite/stream/makefile | 1 - sqlite/stream/test.hxx | 1 - sqlite/template/Makefile.am | 1 - sqlite/template/driver.cxx | 1 - sqlite/template/makefile | 1 - sqlite/template/test.hxx | 1 - sqlite/test.bat | 1 - sqlite/transaction/driver.cxx | 1 - sqlite/transaction/makefile | 1 - sqlite/transaction/test.hxx | 1 - sqlite/truncation/driver.cxx | 1 - sqlite/truncation/makefile | 1 - sqlite/truncation/test.hxx | 1 - sqlite/types/driver.cxx | 1 - sqlite/types/makefile | 1 - sqlite/types/test.hxx | 1 - sqlite/types/traits.hxx | 1 - test.bat | 1 - tester.bat | 1 - tester.in | 1 - 713 files changed, 713 deletions(-) diff --git a/Makefile.am b/Makefile.am index 367ed0f..46105dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,4 @@ # file : Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = libcommon common evolution diff --git a/boost/Makefile.am b/boost/Makefile.am index ec9c303..05f9523 100644 --- a/boost/Makefile.am +++ b/boost/Makefile.am @@ -1,5 +1,4 @@ # file : boost/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/boost/build.bat b/boost/build.bat index d7ecec2..7371b1a 100644 --- a/boost/build.bat +++ b/boost/build.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/build.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am index c0db52c..83f99ea 100644 --- a/boost/common/Makefile.am +++ b/boost/common/Makefile.am @@ -1,5 +1,4 @@ # file : boost/common/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/common/makefile b/boost/common/makefile index 82a8d99..5d92e2d 100644 --- a/boost/common/makefile +++ b/boost/common/makefile @@ -1,5 +1,4 @@ # file : boost/common/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx index 11b27c8..a077008 100644 --- a/boost/common/multi-index/driver.cxx +++ b/boost/common/multi-index/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/multi-index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost multi-index container persistence. diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile index 7e7a543..8ac84f1 100644 --- a/boost/common/multi-index/makefile +++ b/boost/common/multi-index/makefile @@ -1,5 +1,4 @@ # file : boost/common/multi-index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx index 5c98ab7..22b9ea4 100644 --- a/boost/common/multi-index/test.hxx +++ b/boost/common/multi-index/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/multi-index/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx index 3f3bb54..c2e3079 100644 --- a/boost/common/optional/driver.cxx +++ b/boost/common/optional/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/optional/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost::optional persistence. diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 3f33517..4928bd3 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -1,5 +1,4 @@ # file : boost/common/optional/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx index 72b1b11..65d951e 100644 --- a/boost/common/optional/test.hxx +++ b/boost/common/optional/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/optional/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx index 3533592..4bc6366 100644 --- a/boost/common/smart-ptr/driver.cxx +++ b/boost/common/smart-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost smart pointers. diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index dba0f87..14172dc 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -1,5 +1,4 @@ # file : boost/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx index bb922e0..26d7109 100644 --- a/boost/common/smart-ptr/test.hxx +++ b/boost/common/smart-ptr/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am index 9e743f1..8f76465 100644 --- a/boost/common/template/Makefile.am +++ b/boost/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/common/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx index 5edacd0..43e28c0 100644 --- a/boost/common/template/driver.cxx +++ b/boost/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/common/template/makefile b/boost/common/template/makefile index 1c5a25c..ca43223 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -1,5 +1,4 @@ # file : boost/common/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx index 0b38cf5..1d2a5f3 100644 --- a/boost/common/template/test.hxx +++ b/boost/common/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/test.bat b/boost/common/test.bat index f960f62..1e61950 100644 --- a/boost/common/test.bat +++ b/boost/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/common/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx index 4bf2603..eda5891 100644 --- a/boost/common/unordered/driver.cxx +++ b/boost/common/unordered/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/unordered/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost unordered containers persistence. diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 931dcb1..57b9dd5 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -1,5 +1,4 @@ # file : boost/common/unordered/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx index f79e207..cd77845 100644 --- a/boost/common/unordered/test.hxx +++ b/boost/common/unordered/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/unordered/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx index 2cb7b3d..aed3390 100644 --- a/boost/common/uuid/driver.cxx +++ b/boost/common/uuid/driver.cxx @@ -1,5 +1,4 @@ // file : boost/common/uuid/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Boost UUID persistence. diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile index 7b6ad3b..ec683a5 100644 --- a/boost/common/uuid/makefile +++ b/boost/common/uuid/makefile @@ -1,5 +1,4 @@ # file : boost/common/uuid/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx index 3f8e4e3..82ed95b 100644 --- a/boost/common/uuid/test.hxx +++ b/boost/common/uuid/test.hxx @@ -1,5 +1,4 @@ // file : boost/common/uuid/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/makefile b/boost/makefile index bad4150..0aa6ef2 100644 --- a/boost/makefile +++ b/boost/makefile @@ -1,5 +1,4 @@ # file : boost/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am index 9f54b4d..65c21d7 100644 --- a/boost/mssql/Makefile.am +++ b/boost/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mssql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx index 636200a..e97a276 100644 --- a/boost/mssql/date-time/driver.cxx +++ b/boost/mssql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQL Server version. diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile index a286263..6857309 100644 --- a/boost/mssql/date-time/makefile +++ b/boost/mssql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx index d07ef0c..ed2276b 100644 --- a/boost/mssql/date-time/test.hxx +++ b/boost/mssql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/makefile b/boost/mssql/makefile index f5cc2fc..6a37a2f 100644 --- a/boost/mssql/makefile +++ b/boost/mssql/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am index 1396aaf..3dc2977 100644 --- a/boost/mssql/template/Makefile.am +++ b/boost/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx index 20eb3f8..37614c4 100644 --- a/boost/mssql/template/driver.cxx +++ b/boost/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile index f9bd16e..d729ffd 100644 --- a/boost/mssql/template/makefile +++ b/boost/mssql/template/makefile @@ -1,5 +1,4 @@ # file : boost/mssql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx index 2e22d2e..753498f 100644 --- a/boost/mssql/template/test.hxx +++ b/boost/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat index fcf5a49..167cf55 100644 --- a/boost/mssql/test.bat +++ b/boost/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/mssql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/mysql/Makefile.am b/boost/mysql/Makefile.am index e30378d..2e51d4d 100644 --- a/boost/mysql/Makefile.am +++ b/boost/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mysql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx index 92728b9..8959f0c 100644 --- a/boost/mysql/date-time/driver.cxx +++ b/boost/mysql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. MySQL version. diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile index b53304a..1e2f9df 100644 --- a/boost/mysql/date-time/makefile +++ b/boost/mysql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx index a16657a..bf73b09 100644 --- a/boost/mysql/date-time/test.hxx +++ b/boost/mysql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/makefile b/boost/mysql/makefile index c5873a1..08fe245 100644 --- a/boost/mysql/makefile +++ b/boost/mysql/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am index 94809da..79d7ec5 100644 --- a/boost/mysql/template/Makefile.am +++ b/boost/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx index d7821e7..1164950 100644 --- a/boost/mysql/template/driver.cxx +++ b/boost/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile index e7db2a4..085221c 100644 --- a/boost/mysql/template/makefile +++ b/boost/mysql/template/makefile @@ -1,5 +1,4 @@ # file : boost/mysql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx index a62ebab..7c97ca2 100644 --- a/boost/mysql/template/test.hxx +++ b/boost/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat index 7bc65b5..610e538 100644 --- a/boost/mysql/test.bat +++ b/boost/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/mysql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/oracle/Makefile.am b/boost/oracle/Makefile.am index 14164c9..e485853 100644 --- a/boost/oracle/Makefile.am +++ b/boost/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : boost/oracle/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx index 38a9f7a..82294c7 100644 --- a/boost/oracle/date-time/driver.cxx +++ b/boost/oracle/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. Oracle version. diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile index 4ca5522..569c347 100644 --- a/boost/oracle/date-time/makefile +++ b/boost/oracle/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx index d009896..5eaab88 100644 --- a/boost/oracle/date-time/test.hxx +++ b/boost/oracle/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/makefile b/boost/oracle/makefile index b681e12..fa4a43d 100644 --- a/boost/oracle/makefile +++ b/boost/oracle/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am index 744bec0..a2a40fb 100644 --- a/boost/oracle/template/Makefile.am +++ b/boost/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx index bdf3294..892b58f 100644 --- a/boost/oracle/template/driver.cxx +++ b/boost/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile index 820c229..cde118e 100644 --- a/boost/oracle/template/makefile +++ b/boost/oracle/template/makefile @@ -1,5 +1,4 @@ # file : boost/oracle/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx index f4a0f80..141b6cd 100644 --- a/boost/oracle/template/test.hxx +++ b/boost/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat index 805a46f..918708f 100644 --- a/boost/oracle/test.bat +++ b/boost/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/oracle/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am index d590cd5..9e4072b 100644 --- a/boost/pgsql/Makefile.am +++ b/boost/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : boost/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx index 8450527..94fcc46 100644 --- a/boost/pgsql/date-time/driver.cxx +++ b/boost/pgsql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. PostgreSQL version. diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile index 8667a87..7ea0d50 100644 --- a/boost/pgsql/date-time/makefile +++ b/boost/pgsql/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx index 4f87ff3..0b08093 100644 --- a/boost/pgsql/date-time/test.hxx +++ b/boost/pgsql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile index 9308d56..264bfaa 100644 --- a/boost/pgsql/makefile +++ b/boost/pgsql/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am index 255d38e..a1015c7 100644 --- a/boost/pgsql/template/Makefile.am +++ b/boost/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx index 818e830..ed2d8a4 100644 --- a/boost/pgsql/template/driver.cxx +++ b/boost/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile index 887b21d..9d14647 100644 --- a/boost/pgsql/template/makefile +++ b/boost/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : boost/pgsql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx index 68fd30d..56eda31 100644 --- a/boost/pgsql/template/test.hxx +++ b/boost/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat index bdd3fa0..7db2c4a 100644 --- a/boost/pgsql/test.bat +++ b/boost/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/pgsql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am index 8092d9b..e86ed43 100644 --- a/boost/sqlite/Makefile.am +++ b/boost/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : boost/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx index e6afe24..97a7a0c 100644 --- a/boost/sqlite/date-time/driver.cxx +++ b/boost/sqlite/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : boost/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test boost date/time type persistence. SQLite version. diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile index fb88563..b780298 100644 --- a/boost/sqlite/date-time/makefile +++ b/boost/sqlite/date-time/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx index f9278ab..924ce27 100644 --- a/boost/sqlite/date-time/test.hxx +++ b/boost/sqlite/date-time/test.hxx @@ -1,5 +1,4 @@ // file : boost/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile index 1eda35e..159a92d 100644 --- a/boost/sqlite/makefile +++ b/boost/sqlite/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am index 44eb513..39b318f 100644 --- a/boost/sqlite/template/Makefile.am +++ b/boost/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : boost/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx index 020a50b..3e51eef 100644 --- a/boost/sqlite/template/driver.cxx +++ b/boost/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : boost/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile index 720a81a..3ebeda1 100644 --- a/boost/sqlite/template/makefile +++ b/boost/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : boost/sqlite/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx index 15dc0d5..b9daed6 100644 --- a/boost/sqlite/template/test.hxx +++ b/boost/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : boost/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat index 3b17858..57a7f5e 100644 --- a/boost/sqlite/test.bat +++ b/boost/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : boost/sqlite/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/bootstrap b/bootstrap index 0e786df..85d1399 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,6 @@ #! /bin/sh # file : bootstrap -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build.bat b/build.bat index 5226e18..1da0b91 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,5 @@ @echo off rem file : build.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/build/bootstrap.make b/build/bootstrap.make index 96135ee..34d2933 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -1,5 +1,4 @@ # file : build/bootstrap.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file project_name := odb-tests diff --git a/build/configuration-rules.make b/build/configuration-rules.make index fc6b151..ee464cd 100644 --- a/build/configuration-rules.make +++ b/build/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. diff --git a/build/configuration.make b/build/configuration.make index 4028fe6..9b6e0b8 100644 --- a/build/configuration.make +++ b/build/configuration.make @@ -1,5 +1,4 @@ # file : build/configuration.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) diff --git a/build/configure b/build/configure index 518b26f..e421ec3 100755 --- a/build/configure +++ b/build/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # $1 out file diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make index 9d2faba..dba014c 100644 --- a/build/import/libboost/configuration-rules.make +++ b/build/import/libboost/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/configuration-rules.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. diff --git a/build/import/libboost/configure b/build/import/libboost/configure index 7baa2fb..84d03b2 100755 --- a/build/import/libboost/configure +++ b/build/import/libboost/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libboost/configure -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make index 1b8c6d0..abc8819 100644 --- a/build/import/libboost/date-time/rules.make +++ b/build/import/libboost/date-time/rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/date-time/rules.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make index 1028728..6f3aad2 100644 --- a/build/import/libboost/date-time/stub.make +++ b/build/import/libboost/date-time/stub.make @@ -1,5 +1,4 @@ # file : build/import/libboost/date-time/stub.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make index 49ec4b0..b5b0726 100644 --- a/build/import/libboost/header-only/rules.make +++ b/build/import/libboost/header-only/rules.make @@ -1,5 +1,4 @@ # file : build/import/libboost/header-only/rules.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libboost/%: root := $(libboost_root) diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make index 77c5503..eebddbf 100644 --- a/build/import/libboost/header-only/stub.make +++ b/build/import/libboost/header-only/stub.make @@ -1,5 +1,4 @@ # file : build/import/libboost/header-only/stub.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make index 1a40d82..a347655 100644 --- a/build/import/libodb-boost/configuration-rules.make +++ b/build/import/libodb-boost/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-boost/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure index ca10145..8330535 100755 --- a/build/import/libodb-boost/configure +++ b/build/import/libodb-boost/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-boost/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-boost/stub.make b/build/import/libodb-boost/stub.make index 5562cd4..73e80e6 100644 --- a/build/import/libodb-boost/stub.make +++ b/build/import/libodb-boost/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-boost/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make index beb1eec..5fd58bc 100644 --- a/build/import/libodb-mssql/configuration-rules.make +++ b/build/import/libodb-mssql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mssql/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure index d3db62b..5e2a28a 100755 --- a/build/import/libodb-mssql/configure +++ b/build/import/libodb-mssql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-mssql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-mssql/stub.make b/build/import/libodb-mssql/stub.make index 41913ba..eebf11a 100644 --- a/build/import/libodb-mssql/stub.make +++ b/build/import/libodb-mssql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mssql/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make index 384ac02..384d3d4 100644 --- a/build/import/libodb-mysql/configuration-rules.make +++ b/build/import/libodb-mysql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mysql/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure index 399e5e2..2a1fa8d 100755 --- a/build/import/libodb-mysql/configure +++ b/build/import/libodb-mysql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-mysql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-mysql/stub.make b/build/import/libodb-mysql/stub.make index 5a0efb7..1b1ecbb 100644 --- a/build/import/libodb-mysql/stub.make +++ b/build/import/libodb-mysql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-mysql/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make index 046dd74..cef4150 100644 --- a/build/import/libodb-oracle/configuration-rules.make +++ b/build/import/libodb-oracle/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-oracle/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure index e611edf..81cd5e4 100755 --- a/build/import/libodb-oracle/configure +++ b/build/import/libodb-oracle/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-oracle/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file diff --git a/build/import/libodb-oracle/stub.make b/build/import/libodb-oracle/stub.make index 781469c..6861dc7 100644 --- a/build/import/libodb-oracle/stub.make +++ b/build/import/libodb-oracle/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-oracle/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : ODB NCUEL; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make index 7ba6f62..326a60c 100644 --- a/build/import/libodb-pgsql/configuration-rules.make +++ b/build/import/libodb-pgsql/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-pgsql/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure index 3918fb9..9d75cad 100755 --- a/build/import/libodb-pgsql/configure +++ b/build/import/libodb-pgsql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-pgsql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-pgsql/stub.make b/build/import/libodb-pgsql/stub.make index 2e5a38d..b770a63 100644 --- a/build/import/libodb-pgsql/stub.make +++ b/build/import/libodb-pgsql/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-pgsql/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make index 38c7352..9765a0c 100644 --- a/build/import/libodb-qt/configuration-rules.make +++ b/build/import/libodb-qt/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-qt/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure index 0a879ea..6213974 100755 --- a/build/import/libodb-qt/configure +++ b/build/import/libodb-qt/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-qt/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-qt/stub.make b/build/import/libodb-qt/stub.make index 1bce523..bd5e2ea 100644 --- a/build/import/libodb-qt/stub.make +++ b/build/import/libodb-qt/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-qt/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make index 260dcb6..bf8dee4 100644 --- a/build/import/libodb-sqlite/configuration-rules.make +++ b/build/import/libodb-sqlite/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb-sqlite/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure index 2d61e29..9f245f5 100755 --- a/build/import/libodb-sqlite/configure +++ b/build/import/libodb-sqlite/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb-sqlite/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb-sqlite/stub.make b/build/import/libodb-sqlite/stub.make index add7c39..417e65a 100644 --- a/build/import/libodb-sqlite/stub.make +++ b/build/import/libodb-sqlite/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb-sqlite/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make index 872cbb3..340c418 100644 --- a/build/import/libodb/configuration-rules.make +++ b/build/import/libodb/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libodb/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. diff --git a/build/import/libodb/configure b/build/import/libodb/configure index 0d57a5f..261a202 100755 --- a/build/import/libodb/configure +++ b/build/import/libodb/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libodb/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make index 6b7088d..04dc786 100644 --- a/build/import/libodb/stub.make +++ b/build/import/libodb/stub.make @@ -1,5 +1,4 @@ # file : build/import/libodb/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make index 820294b..badc561 100644 --- a/build/import/libqt/configuration-rules.make +++ b/build/import/libqt/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/libqt/configuration-rules.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. diff --git a/build/import/libqt/configure b/build/import/libqt/configure index 837b0d3..904d126 100755 --- a/build/import/libqt/configure +++ b/build/import/libqt/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/libqt/configure -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make index bbec36e..1fd6f10 100644 --- a/build/import/libqt/core/rules.make +++ b/build/import/libqt/core/rules.make @@ -1,5 +1,4 @@ # file : build/import/libqt/core/rules.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/libqt/%: root := $(libqt_root) diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make index 47f67b2..1a13bde 100644 --- a/build/import/libqt/core/stub.make +++ b/build/import/libqt/core/stub.make @@ -1,5 +1,4 @@ # file : build/import/libqt/core/stub.make -# copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make index 727793b..eef9b0e 100644 --- a/build/import/odb/configuration-rules.make +++ b/build/import/odb/configuration-rules.make @@ -1,5 +1,4 @@ # file : build/import/odb/configuration-rules.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. diff --git a/build/import/odb/configure b/build/import/odb/configure index 2fb4bd3..ee0cdfa 100755 --- a/build/import/odb/configure +++ b/build/import/odb/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/import/odb/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file diff --git a/build/import/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make index 7cb6f51..987acc0 100644 --- a/build/import/odb/hxx-cxx.make +++ b/build/import/odb/hxx-cxx.make @@ -1,5 +1,4 @@ # file : build/import/odb/hxx-cxx.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v3; see accompanying LICENSE file # Here we are operating in the importing project's space, not in odb's. diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 24d2b33..21ff9f2 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -1,5 +1,4 @@ # file : build/import/odb/stub.make -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file $(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) diff --git a/build/mssql/configure b/build/mssql/configure index 44016a7..52cf34b 100755 --- a/build/mssql/configure +++ b/build/mssql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mssql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mssql/mssql b/build/mssql/mssql index f9bf053..37792f6 100755 --- a/build/mssql/mssql +++ b/build/mssql/mssql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mssql/mssql -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/configure b/build/mysql/configure index 569cc6c..0ea5120 100755 --- a/build/mysql/configure +++ b/build/mysql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mysql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/mysql/mysql b/build/mysql/mysql index fef3bb5..7d224c8 100755 --- a/build/mysql/mysql +++ b/build/mysql/mysql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/mysql/mysql -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/configure b/build/oracle/configure index 8af7afe..4a87e51 100755 --- a/build/oracle/configure +++ b/build/oracle/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/oracle/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/oracle/oracle b/build/oracle/oracle index 836b910..58e94f2 100755 --- a/build/oracle/oracle +++ b/build/oracle/oracle @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/oracle/oracle -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/configure b/build/pgsql/configure index ac87741..9673c15 100755 --- a/build/pgsql/configure +++ b/build/pgsql/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/pgsql/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql index 4d4cb25..d30a102 100755 --- a/build/pgsql/pgsql +++ b/build/pgsql/pgsql @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/pgsql/pgsql -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/build/sqlite/configure b/build/sqlite/configure index 1db74c3..24cc288 100755 --- a/build/sqlite/configure +++ b/build/sqlite/configure @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : build/sqlite/configure -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/common/Makefile.am b/common/Makefile.am index 75621c5..bd6fd0e 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,5 +1,4 @@ # file : common/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 39843b2..483f986 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -1,5 +1,4 @@ // file : common/access/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test accessor/modifier expressions. diff --git a/common/access/makefile b/common/access/makefile index 696f9ee..523531e 100644 --- a/common/access/makefile +++ b/common/access/makefile @@ -1,5 +1,4 @@ # file : common/access/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/access/test.hxx b/common/access/test.hxx index 942d257..ae71103 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -1,5 +1,4 @@ // file : common/access/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/as/driver.cxx b/common/as/driver.cxx index a9f5f7f..28ce88a 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -1,5 +1,4 @@ // file : common/as/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type mapping (#pragma map type as ...). diff --git a/common/as/makefile b/common/as/makefile index f980a0a..0036ee1 100644 --- a/common/as/makefile +++ b/common/as/makefile @@ -1,5 +1,4 @@ # file : common/as/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/as/test.hxx b/common/as/test.hxx index b0f6133..963abeb 100644 --- a/common/as/test.hxx +++ b/common/as/test.hxx @@ -1,5 +1,4 @@ // file : common/as/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index e3f39c0..57a9e3d 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -1,5 +1,4 @@ // file : common/blob/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test BLOB mapping. diff --git a/common/blob/makefile b/common/blob/makefile index 680d42d..2933c8a 100644 --- a/common/blob/makefile +++ b/common/blob/makefile @@ -1,5 +1,4 @@ # file : common/blob/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 75ad22b..13f1815 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -1,5 +1,4 @@ // file : common/blob/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index ccd3f05..04c440f 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -1,5 +1,4 @@ // file : common/bulk/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bulk database operations. diff --git a/common/bulk/makefile b/common/bulk/makefile index 7c15980..7e28921 100644 --- a/common/bulk/makefile +++ b/common/bulk/makefile @@ -1,5 +1,4 @@ # file : common/bulk/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 5dc9083..effc79a 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,5 +1,4 @@ // file : common/driver/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index bb6076a..bcbbe7a 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -1,5 +1,4 @@ // file : common/callback/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operation callbacks. diff --git a/common/callback/makefile b/common/callback/makefile index d850483..2bc54ef 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -1,5 +1,4 @@ # file : common/callback/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/callback/test.hxx b/common/callback/test.hxx index 199eea7..bd30907 100644 --- a/common/callback/test.hxx +++ b/common/callback/test.hxx @@ -1,5 +1,4 @@ // file : common/callback/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx index 5523fa7..54eab42 100644 --- a/common/changelog/add-column.hxx +++ b/common/changelog/add-column.hxx @@ -1,5 +1,4 @@ // file : common/changelog/add-column.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx index 7f6cb10..2a43eea 100644 --- a/common/changelog/add-foreign-key.hxx +++ b/common/changelog/add-foreign-key.hxx @@ -1,5 +1,4 @@ // file : common/changelog/add-foreign-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx index 9c5c67e..645cee2 100644 --- a/common/changelog/add-index.hxx +++ b/common/changelog/add-index.hxx @@ -1,5 +1,4 @@ // file : common/changelog/add-index.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_INDEX_HXX diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx index 23761d6..a22e206 100644 --- a/common/changelog/add-table.hxx +++ b/common/changelog/add-table.hxx @@ -1,5 +1,4 @@ // file : common/changelog/add-table.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ADD_TABLE_HXX diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx index 400f4be..02f091d 100644 --- a/common/changelog/alter-column.hxx +++ b/common/changelog/alter-column.hxx @@ -1,5 +1,4 @@ // file : common/changelog/alter-column.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ALTER_COLUMN_HXX diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx index 076ae24..3de237d 100644 --- a/common/changelog/drop-column.hxx +++ b/common/changelog/drop-column.hxx @@ -1,5 +1,4 @@ // file : common/changelog/drop-column.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx index a72e73e..ba3005f 100644 --- a/common/changelog/drop-foreign-key.hxx +++ b/common/changelog/drop-foreign-key.hxx @@ -1,5 +1,4 @@ // file : common/changelog/drop-foreign-key.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx index 77fb969..08fecba 100644 --- a/common/changelog/drop-index.hxx +++ b/common/changelog/drop-index.hxx @@ -1,5 +1,4 @@ // file : common/changelog/drop-index.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_INDEX_HXX diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx index 5809e53..2919e52 100644 --- a/common/changelog/drop-table.hxx +++ b/common/changelog/drop-table.hxx @@ -1,5 +1,4 @@ // file : common/changelog/drop-table.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef DROP_TABLE_HXX diff --git a/common/changelog/makefile b/common/changelog/makefile index e27de8f..99f6333 100644 --- a/common/changelog/makefile +++ b/common/changelog/makefile @@ -1,5 +1,4 @@ # file : common/changelog/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx index d281c99..aa8891a 100644 --- a/common/changelog/model.hxx +++ b/common/changelog/model.hxx @@ -1,5 +1,4 @@ // file : common/changelog/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_HXX diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index 8f40dc0..d6d49cc 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -1,5 +1,4 @@ // file : common/circular/multiple/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, multiple diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile index e00ab55..4364574 100644 --- a/common/circular/multiple/makefile +++ b/common/circular/multiple/makefile @@ -1,5 +1,4 @@ # file : common/circular/multiple/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx index 2bbd09f..36df963 100644 --- a/common/circular/multiple/test1.hxx +++ b/common/circular/multiple/test1.hxx @@ -1,5 +1,4 @@ // file : common/circular/multiple/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx index 4e6d691..49e9ed2 100644 --- a/common/circular/multiple/test2.hxx +++ b/common/circular/multiple/test2.hxx @@ -1,5 +1,4 @@ // file : common/circular/multiple/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index 64ddcc1..67d79ba 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -1,5 +1,4 @@ // file : common/circular/single/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test cases of circular dependencies between persistent classes, single diff --git a/common/circular/single/makefile b/common/circular/single/makefile index a2a49e6..be08cc5 100644 --- a/common/circular/single/makefile +++ b/common/circular/single/makefile @@ -1,5 +1,4 @@ # file : common/circular/single/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx index 553e668..7f95dea 100644 --- a/common/circular/single/test.hxx +++ b/common/circular/single/test.hxx @@ -1,5 +1,4 @@ // file : common/circular/single/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index ec210fa..cefd72b 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -1,5 +1,4 @@ // file : common/composite/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite value types. diff --git a/common/composite/makefile b/common/composite/makefile index d33167a..41d4d68 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -1,5 +1,4 @@ # file : common/composite/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/composite/test.hxx b/common/composite/test.hxx index 4bf6e62..13b2025 100644 --- a/common/composite/test.hxx +++ b/common/composite/test.hxx @@ -1,5 +1,4 @@ // file : common/composite/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index f7ac737..2b6cfca 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -1,5 +1,4 @@ // file : common/const-member/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test const data members. The readonly test tests that const diff --git a/common/const-member/makefile b/common/const-member/makefile index c740d3d..c5996a2 100644 --- a/common/const-member/makefile +++ b/common/const-member/makefile @@ -1,5 +1,4 @@ # file : common/const-member/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index 72a251d..cf8ba94 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -1,5 +1,4 @@ // file : common/const-member/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 7477a3d..90efb4e 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -1,5 +1,4 @@ // file : common/const-object/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database operations with const objects. diff --git a/common/const-object/makefile b/common/const-object/makefile index 1a81abd..ababb8f 100644 --- a/common/const-object/makefile +++ b/common/const-object/makefile @@ -1,5 +1,4 @@ # file : common/const-object/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 5097de3..919ba08 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -1,5 +1,4 @@ // file : common/const-object/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index 443ef35..cdd22d6 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/container/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic container persistence. diff --git a/common/container/basics/makefile b/common/container/basics/makefile index 537bdf9..3da6b71 100644 --- a/common/container/basics/makefile +++ b/common/container/basics/makefile @@ -1,5 +1,4 @@ # file : common/container/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 1edb05f..b7d50ae 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/container/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index b6e811d..f7407bd 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -1,5 +1,4 @@ // file : common/container/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking containers. diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile index 3776e2b..53fd314 100644 --- a/common/container/change-tracking/makefile +++ b/common/container/change-tracking/makefile @@ -1,5 +1,4 @@ # file : common/container/change-tracking/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index 5be19f5..be78244 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -1,5 +1,4 @@ // file : common/container/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 095891f..03c706b 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -1,5 +1,4 @@ // file : common/ctor/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test support for persistent objects without default constructors. diff --git a/common/ctor/makefile b/common/ctor/makefile index d39eb4c..c35d577 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -1,5 +1,4 @@ # file : common/ctor/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx index 1e32989..2a2becd 100644 --- a/common/ctor/test.hxx +++ b/common/ctor/test.hxx @@ -1,5 +1,4 @@ // file : common/ctor/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/default/driver.cxx b/common/default/driver.cxx index e33f411..276f5f2 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -1,5 +1,4 @@ // file : common/default/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test default values. diff --git a/common/default/makefile b/common/default/makefile index 76bd2dc..c8b3cde 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -1,5 +1,4 @@ # file : common/default/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/default/test.hxx b/common/default/test.hxx index e2f793e..7f35ed4 100644 --- a/common/default/test.hxx +++ b/common/default/test.hxx @@ -1,5 +1,4 @@ // file : common/default/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index 361d486..d909644 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -1,5 +1,4 @@ // file : common/definition/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test overriding composite value definition point. This is primarily diff --git a/common/definition/makefile b/common/definition/makefile index 4f42247..61227c3 100644 --- a/common/definition/makefile +++ b/common/definition/makefile @@ -1,5 +1,4 @@ # file : common/definition/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/definition/test.hxx b/common/definition/test.hxx index 4162ad2..38fc02a 100644 --- a/common/definition/test.hxx +++ b/common/definition/test.hxx @@ -1,5 +1,4 @@ // file : common/definition/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx index 0a1b200..469cfb7 100644 --- a/common/definition/time-mapping.hxx +++ b/common/definition/time-mapping.hxx @@ -1,5 +1,4 @@ // file : common/definition/time-mapping.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TIME_MAPPING_HXX diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index d7f4323..e9b4bfb 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -1,5 +1,4 @@ // file : common/enum/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic C++ enum mapping. diff --git a/common/enum/makefile b/common/enum/makefile index 308ac49..d5957fa 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -1,5 +1,4 @@ # file : common/enum/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/enum/test.hxx b/common/enum/test.hxx index 81f9efa..0391581 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -1,5 +1,4 @@ // file : common/enum/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index cc5f153..f4a4374 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -1,5 +1,4 @@ // file : common/erase-query/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query-based erase. diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 0688e8b..0092fea 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -1,5 +1,4 @@ # file : common/erase-query/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx index d905f29..9e73f12 100644 --- a/common/erase-query/test.hxx +++ b/common/erase-query/test.hxx @@ -1,5 +1,4 @@ // file : common/erase-query/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx index 162ba60..19e0f14 100644 --- a/common/id/auto/driver.cxx +++ b/common/id/auto/driver.cxx @@ -1,5 +1,4 @@ // file : common/id/auto/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test automatic id assignment. diff --git a/common/id/auto/makefile b/common/id/auto/makefile index 61399be..e0477ba 100644 --- a/common/id/auto/makefile +++ b/common/id/auto/makefile @@ -1,5 +1,4 @@ # file : common/id/auto/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx index 13fe825..233c79f 100644 --- a/common/id/auto/test.hxx +++ b/common/id/auto/test.hxx @@ -1,5 +1,4 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx index 7e5a917..f394091 100644 --- a/common/id/composite/driver.cxx +++ b/common/id/composite/driver.cxx @@ -1,5 +1,4 @@ // file : common/id/composite/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test composite object ids. diff --git a/common/id/composite/makefile b/common/id/composite/makefile index 13cdd06..3edac7f 100644 --- a/common/id/composite/makefile +++ b/common/id/composite/makefile @@ -1,5 +1,4 @@ # file : common/id/composite/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx index 8b4c21c..70856a6 100644 --- a/common/id/composite/test.hxx +++ b/common/id/composite/test.hxx @@ -1,5 +1,4 @@ // file : common/id/composite/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx index b0ba3e6..57647fd 100644 --- a/common/id/nested/driver.cxx +++ b/common/id/nested/driver.cxx @@ -1,5 +1,4 @@ // file : common/id/nested/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test nested ids. diff --git a/common/id/nested/makefile b/common/id/nested/makefile index 08db59e..120a8f0 100644 --- a/common/id/nested/makefile +++ b/common/id/nested/makefile @@ -1,5 +1,4 @@ # file : common/id/nested/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx index 953dd78..06ee6b8 100644 --- a/common/id/nested/test.hxx +++ b/common/id/nested/test.hxx @@ -1,5 +1,4 @@ // file : common/id/nested/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/include/driver.cxx b/common/include/driver.cxx index 02c41af..935d285 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -1,5 +1,4 @@ // file : common/include/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test inclusion of -odb files (compilation test). diff --git a/common/include/makefile b/common/include/makefile index d22fcb3..2ee3f38 100644 --- a/common/include/makefile +++ b/common/include/makefile @@ -1,5 +1,4 @@ # file : common/include/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx index feaa29a..33ae0d6 100644 --- a/common/include/obj1.hxx +++ b/common/include/obj1.hxx @@ -1,5 +1,4 @@ // file : common/include/obj1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ1_HXX diff --git a/common/include/obj2.hxx b/common/include/obj2.hxx index cf4b485..2f20f58 100644 --- a/common/include/obj2.hxx +++ b/common/include/obj2.hxx @@ -1,5 +1,4 @@ // file : common/include/obj2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ2_HXX diff --git a/common/include/obj3.hxx b/common/include/obj3.hxx index 81112a1..432145b 100644 --- a/common/include/obj3.hxx +++ b/common/include/obj3.hxx @@ -1,5 +1,4 @@ // file : common/include/obj3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJ3_HXX diff --git a/common/include/objs1.hxx b/common/include/objs1.hxx index 9fd4d66..6e949e2 100644 --- a/common/include/objs1.hxx +++ b/common/include/objs1.hxx @@ -1,5 +1,4 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS1_HXX diff --git a/common/include/objs2.hxx b/common/include/objs2.hxx index 6738e8c..4f8133b 100644 --- a/common/include/objs2.hxx +++ b/common/include/objs2.hxx @@ -1,5 +1,4 @@ // file : common/include/objs2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS2_HXX diff --git a/common/include/objs3.hxx b/common/include/objs3.hxx index 49cf71c..2f7aaff 100644 --- a/common/include/objs3.hxx +++ b/common/include/objs3.hxx @@ -1,5 +1,4 @@ // file : common/include/objs3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS3_HXX diff --git a/common/include/objs4.hxx b/common/include/objs4.hxx index 7beed11..d766fe6 100644 --- a/common/include/objs4.hxx +++ b/common/include/objs4.hxx @@ -1,5 +1,4 @@ // file : common/include/objs1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef OBJS4_HXX diff --git a/common/include/test1.hxx b/common/include/test1.hxx index 62b57ab..1914ddb 100644 --- a/common/include/test1.hxx +++ b/common/include/test1.hxx @@ -1,5 +1,4 @@ // file : common/include/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/include/test2.hxx b/common/include/test2.hxx index a67621d..6017ac4 100644 --- a/common/include/test2.hxx +++ b/common/include/test2.hxx @@ -1,5 +1,4 @@ // file : common/include/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/include/test3.hxx b/common/include/test3.hxx index 5dee72e..e55ecdb 100644 --- a/common/include/test3.hxx +++ b/common/include/test3.hxx @@ -1,5 +1,4 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/include/test4.hxx b/common/include/test4.hxx index 725692c..b58e679 100644 --- a/common/include/test4.hxx +++ b/common/include/test4.hxx @@ -1,5 +1,4 @@ // file : common/include/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/index/driver.cxx b/common/index/driver.cxx index ef38faa..7634349 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -1,5 +1,4 @@ // file : common/index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test index creation with db pragma index. See also database-specific diff --git a/common/index/makefile b/common/index/makefile index badc598..b0d062b 100644 --- a/common/index/makefile +++ b/common/index/makefile @@ -1,5 +1,4 @@ # file : common/index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/index/test.hxx b/common/index/test.hxx index d4a09b2..f27783f 100644 --- a/common/index/test.hxx +++ b/common/index/test.hxx @@ -1,5 +1,4 @@ // file : common/index/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 94749a0..6d4e615 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test polymorphic object inheritance. diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile index ab7cc48..2b969f5 100644 --- a/common/inheritance/polymorphism/makefile +++ b/common/inheritance/polymorphism/makefile @@ -1,5 +1,4 @@ # file : common/inheritance/polymorphism/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx index be8cb86..7f598de 100644 --- a/common/inheritance/polymorphism/test1.hxx +++ b/common/inheritance/polymorphism/test1.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx index e359774..63673a1 100644 --- a/common/inheritance/polymorphism/test10.hxx +++ b/common/inheritance/polymorphism/test10.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test10.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx index 71b0160..2d38a6c 100644 --- a/common/inheritance/polymorphism/test11.hxx +++ b/common/inheritance/polymorphism/test11.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test11.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx index 9f872ec..85000ac 100644 --- a/common/inheritance/polymorphism/test12.hxx +++ b/common/inheritance/polymorphism/test12.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test12.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx index 5f0894d..3240a9a 100644 --- a/common/inheritance/polymorphism/test13.hxx +++ b/common/inheritance/polymorphism/test13.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test13.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx index 4a4108b..1050861 100644 --- a/common/inheritance/polymorphism/test14.hxx +++ b/common/inheritance/polymorphism/test14.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test14.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx index 8034a53..5799ace 100644 --- a/common/inheritance/polymorphism/test15.hxx +++ b/common/inheritance/polymorphism/test15.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test15.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx index b81bf16..9890e02 100644 --- a/common/inheritance/polymorphism/test2.hxx +++ b/common/inheritance/polymorphism/test2.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx index 0071da3..fd68f24 100644 --- a/common/inheritance/polymorphism/test3.hxx +++ b/common/inheritance/polymorphism/test3.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx index f9a43cc..148c53c 100644 --- a/common/inheritance/polymorphism/test4.hxx +++ b/common/inheritance/polymorphism/test4.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index 9c676c5..e6dba8d 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test5.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index fc31c45..1e42400 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test6.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index f7a4505..6edb834 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test7.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx index 8f9f6be..84b6688 100644 --- a/common/inheritance/polymorphism/test8.hxx +++ b/common/inheritance/polymorphism/test8.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test8.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx index 78fb594..cdc97ae 100644 --- a/common/inheritance/polymorphism/test9.hxx +++ b/common/inheritance/polymorphism/test9.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/polymorphism/test9.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 3e0dfd7..616c6a4 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -1,5 +1,4 @@ // file : common/inheritance/reuse/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test reuse object inheritance. diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile index c1ce62e..58222f3 100644 --- a/common/inheritance/reuse/makefile +++ b/common/inheritance/reuse/makefile @@ -1,5 +1,4 @@ # file : common/inheritance/reuse/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 5f957d8..8124417 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/reuse/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index d2fb705..fa6e05d 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -1,5 +1,4 @@ // file : common/inheritance/transient/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transient inheritance of objects, composite value types, and views. diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile index 80496dc..57e7909 100644 --- a/common/inheritance/transient/makefile +++ b/common/inheritance/transient/makefile @@ -1,5 +1,4 @@ # file : common/inheritance/transient/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx index 7d6038e..394ee8f 100644 --- a/common/inheritance/transient/test.hxx +++ b/common/inheritance/transient/test.hxx @@ -1,5 +1,4 @@ // file : common/inheritance/transient/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 364e628..07c584d 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -1,5 +1,4 @@ // file : common/inverse/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test bidirectional relationships with inverse sides. diff --git a/common/inverse/makefile b/common/inverse/makefile index d879bdd..59d86c1 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -1,5 +1,4 @@ # file : common/inverse/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 55df151..35fd813 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -1,5 +1,4 @@ // file : common/inverse/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index d85fecc..9458772 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : common/lazy-ptr/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test lazy object pointers. diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 0280498..62880fa 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -1,5 +1,4 @@ # file : common/lazy-ptr/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 84c442f..da1f2c4 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -1,5 +1,4 @@ // file : common/lazy-ptr/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index fc3851e..460cae1 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -1,5 +1,4 @@ // file : common/lifecycle/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object state transistions. diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 569e03a..da954eb 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -1,5 +1,4 @@ # file : common/lifecycle/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index fe9adc6..8d260d2 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -1,5 +1,4 @@ // file : common/lifecycle/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/makefile b/common/makefile index dc02ba5..555851a 100644 --- a/common/makefile +++ b/common/makefile @@ -1,5 +1,4 @@ # file : common/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index 4b457a9..ce51883 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -1,5 +1,4 @@ // file : common/no-id/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes without id. diff --git a/common/no-id/makefile b/common/no-id/makefile index 3b2ba03..1005447 100644 --- a/common/no-id/makefile +++ b/common/no-id/makefile @@ -1,5 +1,4 @@ # file : common/no-id/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx index f82e4e7..c5b5c65 100644 --- a/common/no-id/test.hxx +++ b/common/no-id/test.hxx @@ -1,5 +1,4 @@ // file : common/no-id/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/object/driver.cxx b/common/object/driver.cxx index f115b92..e8700b4 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -1,5 +1,4 @@ // file : common/object/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test persistent classes. diff --git a/common/object/makefile b/common/object/makefile index ee3bfdf..d8c534e 100644 --- a/common/object/makefile +++ b/common/object/makefile @@ -1,5 +1,4 @@ # file : common/object/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/object/test.hxx b/common/object/test.hxx index fd7d230..87bac91 100644 --- a/common/object/test.hxx +++ b/common/object/test.hxx @@ -1,5 +1,4 @@ // file : common/object/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index ed243c6..3d33eb4 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -1,5 +1,4 @@ // file : common/optimistic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test optimistic concurrency support. diff --git a/common/optimistic/makefile b/common/optimistic/makefile index 6fa67c8..dc179bd 100644 --- a/common/optimistic/makefile +++ b/common/optimistic/makefile @@ -1,5 +1,4 @@ # file : common/optimistic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx index 8d918d2..fcefa3d 100644 --- a/common/optimistic/test.hxx +++ b/common/optimistic/test.hxx @@ -1,5 +1,4 @@ // file : common/optimistic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 05337ea..932ca14 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -1,5 +1,4 @@ // file : common/pragma/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test #pragma db parsing. diff --git a/common/pragma/makefile b/common/pragma/makefile index 7c39fc2..fb7ab20 100644 --- a/common/pragma/makefile +++ b/common/pragma/makefile @@ -1,5 +1,4 @@ # file : common/pragma/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx index 89dbefa..6877e73 100644 --- a/common/pragma/test.hxx +++ b/common/pragma/test.hxx @@ -1,5 +1,4 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index 269aeb5..a7a6a21 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -1,5 +1,4 @@ // file : common/prepared/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test prepared query functionality. diff --git a/common/prepared/makefile b/common/prepared/makefile index d707756..ae18002 100644 --- a/common/prepared/makefile +++ b/common/prepared/makefile @@ -1,5 +1,4 @@ # file : common/prepared/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx index 95c4bd7..db16e67 100644 --- a/common/prepared/test.hxx +++ b/common/prepared/test.hxx @@ -1,5 +1,4 @@ // file : common/prepared/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 4425c83..4559553 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -1,5 +1,4 @@ // file : common/query/array/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query support for C arrays. diff --git a/common/query/array/makefile b/common/query/array/makefile index e1e39c8..e873a34 100644 --- a/common/query/array/makefile +++ b/common/query/array/makefile @@ -1,5 +1,4 @@ # file : common/query/array/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index 3141362..d280f02 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -1,5 +1,4 @@ // file : common/query/array/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index acaa975..86bae4b 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/query/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic query support. diff --git a/common/query/basics/makefile b/common/query/basics/makefile index 2486a36..b1749e7 100644 --- a/common/query/basics/makefile +++ b/common/query/basics/makefile @@ -1,5 +1,4 @@ # file : common/query/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 9483f9b..22a8d32 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/query/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx index b9dcf91..f3ab921 100644 --- a/common/query/one/driver.cxx +++ b/common/query/one/driver.cxx @@ -1,5 +1,4 @@ // file : common/query/one/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test query one support. diff --git a/common/query/one/makefile b/common/query/one/makefile index c28b56c..fa3b557 100644 --- a/common/query/one/makefile +++ b/common/query/one/makefile @@ -1,5 +1,4 @@ # file : common/query/one/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx index 36bb2c4..3008063 100644 --- a/common/query/one/test.hxx +++ b/common/query/one/test.hxx @@ -1,5 +1,4 @@ // file : common/query/one/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 140ba3f..3358799 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -1,5 +1,4 @@ // file : common/readonly/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test readonly members/objects. Also test that const members are diff --git a/common/readonly/makefile b/common/readonly/makefile index b746a2e..49c6779 100644 --- a/common/readonly/makefile +++ b/common/readonly/makefile @@ -1,5 +1,4 @@ # file : common/readonly/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index 5814b21..ad7727b 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -1,5 +1,4 @@ // file : common/readonly/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index 14e21e5..6eec1e2 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/relationship/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object relationships. diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile index 0394571..775d850 100644 --- a/common/relationship/basics/makefile +++ b/common/relationship/basics/makefile @@ -1,5 +1,4 @@ # file : common/relationship/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index 0b6365e..9496581 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/relationship/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index 210d987..b7cc37a 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -1,5 +1,4 @@ // file : common/relationship/on-delete/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test ON DELETE functionality. diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile index dd472de..88fcff0 100644 --- a/common/relationship/on-delete/makefile +++ b/common/relationship/on-delete/makefile @@ -1,5 +1,4 @@ # file : common/relationship/on-delete/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx index e7774a7..841acd9 100644 --- a/common/relationship/on-delete/test.hxx +++ b/common/relationship/on-delete/test.hxx @@ -1,5 +1,4 @@ // file : common/relationship/on-delete/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index c6f8d1b..1cee751 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -1,5 +1,4 @@ // file : common/relationship-query/query/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test relationship queries. diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile index 1882947..1632f1b 100644 --- a/common/relationship/query/makefile +++ b/common/relationship/query/makefile @@ -1,5 +1,4 @@ # file : common/relationship-query/query/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index 358f831..b25e27e 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -1,5 +1,4 @@ // file : common/relationship-query/query/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index ba9f184..131c438 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/schema/embedded/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic embedded schema functionality. diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile index 205f360..8bbbd09 100644 --- a/common/schema/embedded/basics/makefile +++ b/common/schema/embedded/basics/makefile @@ -1,5 +1,4 @@ # file : common/schema/embedded/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx index f8cdbf7..43331f9 100644 --- a/common/schema/embedded/basics/test.hxx +++ b/common/schema/embedded/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/schema/embedded/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index cfab779..b035b69 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -1,5 +1,4 @@ // file : common/schema/embedded/order/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test statement execution order in embedded schemas. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile index f02e001..bcdf185 100644 --- a/common/schema/embedded/order/makefile +++ b/common/schema/embedded/order/makefile @@ -1,5 +1,4 @@ # file : common/schema/embedded/order/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx index 6c3d022..b35074b 100644 --- a/common/schema/embedded/order/test1.hxx +++ b/common/schema/embedded/order/test1.hxx @@ -1,5 +1,4 @@ // file : common/schema/embedded/order/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx index 94c4d10..b4e6d20 100644 --- a/common/schema/embedded/order/test2.hxx +++ b/common/schema/embedded/order/test2.hxx @@ -1,5 +1,4 @@ // file : common/schema/embedded/order/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index 77df32e..b8739d8 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -1,5 +1,4 @@ // file : common/schema/namespace/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test database schemas (aka database namespaces). diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile index 58cd323..e6f4016 100644 --- a/common/schema/namespace/makefile +++ b/common/schema/namespace/makefile @@ -1,5 +1,4 @@ # file : common/schema/namespace/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx index 831aece..0b1844a 100644 --- a/common/schema/namespace/test.hxx +++ b/common/schema/namespace/test.hxx @@ -1,5 +1,4 @@ // file : common/schema/namespace/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index 3c1ef2a..b333c59 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/section/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object section basics. diff --git a/common/section/basics/makefile b/common/section/basics/makefile index 623b9f2..482672f 100644 --- a/common/section/basics/makefile +++ b/common/section/basics/makefile @@ -1,5 +1,4 @@ # file : common/section/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx index 61e8c7e..702ef8b 100644 --- a/common/section/basics/test.hxx +++ b/common/section/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/section/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index bd62c78..321b852 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -1,5 +1,4 @@ // file : common/section/polymorphism/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test sections in polymorphic objects. diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile index 51b2b3e..5b7db2d 100644 --- a/common/section/polymorphism/makefile +++ b/common/section/polymorphism/makefile @@ -1,5 +1,4 @@ # file : common/section/polymorphism/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index e864fde..7db7118 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -1,5 +1,4 @@ // file : common/section/polymorphism/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 59768df..6858d06 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -1,5 +1,4 @@ // file : common/session/cache/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test session object cache. diff --git a/common/session/cache/makefile b/common/session/cache/makefile index 31e710d..8e475a2 100644 --- a/common/session/cache/makefile +++ b/common/session/cache/makefile @@ -1,5 +1,4 @@ # file : common/session/cache/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index 2948d06..3ee2fbf 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -1,5 +1,4 @@ // file : common/session/cache/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 1073a6f..851443e 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -1,5 +1,4 @@ // file : common/session/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom session (C++11 only). diff --git a/common/session/custom/makefile b/common/session/custom/makefile index 1b2c23a..c1fa5bc 100644 --- a/common/session/custom/makefile +++ b/common/session/custom/makefile @@ -1,5 +1,4 @@ # file : common/session/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx index 0f6e5a2..1a08c79 100644 --- a/common/session/custom/session.cxx +++ b/common/session/custom/session.cxx @@ -1,5 +1,4 @@ // file : common/session/custom/session.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 225dcdf..29ac040 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -1,5 +1,4 @@ // file : common/session/custom/session.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx index a908475..65ab933 100644 --- a/common/session/custom/session.txx +++ b/common/session/custom/session.txx @@ -1,5 +1,4 @@ // file : common/session/custom/session.txx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx index 9e3bc72..3f2703f 100644 --- a/common/session/custom/test.hxx +++ b/common/session/custom/test.hxx @@ -1,5 +1,4 @@ // file : common/session/custom/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index d225083..778498b 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -1,5 +1,4 @@ // file : common/statement/processing/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test internal statement processing machinery. diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile index 4959e33..982dbe5 100644 --- a/common/statement/processing/makefile +++ b/common/statement/processing/makefile @@ -1,5 +1,4 @@ # file : common/statement/processing/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 7da1481..f35394b 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : common/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/common/template/driver.cxx b/common/template/driver.cxx index 5956d6b..83f9336 100644 --- a/common/template/driver.cxx +++ b/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : common/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/common/template/makefile b/common/template/makefile index 72dd9e4..2fba29d 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -1,5 +1,4 @@ # file : common/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/template/test.hxx b/common/template/test.hxx index de34cd1..39ea826 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -1,5 +1,4 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/test.bat b/common/test.bat index fd20fc2..8ca4cb6 100644 --- a/common/test.bat +++ b/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : common/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 5daa4c9..3a2d408 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -1,5 +1,4 @@ // file : common/threads/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test operations in a multi-threaded environment. diff --git a/common/threads/makefile b/common/threads/makefile index e2e7c7e..59e6514 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -1,5 +1,4 @@ # file : common/threads/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/threads/test.hxx b/common/threads/test.hxx index e4b82ce..2ed6e67 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -1,5 +1,4 @@ // file : common/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index f34a67a..721561d 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/transaction/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic transaction operations. diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile index 3d83c4f..a45080a 100644 --- a/common/transaction/basics/makefile +++ b/common/transaction/basics/makefile @@ -1,5 +1,4 @@ # file : common/transaction/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index b75c4b3..90564a4 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -1,5 +1,4 @@ // file : common/transaction/callback/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test transaction callbacks. diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile index 4c3b186..1d0be66 100644 --- a/common/transaction/callback/makefile +++ b/common/transaction/callback/makefile @@ -1,5 +1,4 @@ # file : common/transaction/callback/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 7b128d6..92cf9af 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -1,5 +1,4 @@ // file : common/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test C++ type handling (anonymous types, aliasing). diff --git a/common/types/makefile b/common/types/makefile index 30250b0..732ba0a 100644 --- a/common/types/makefile +++ b/common/types/makefile @@ -1,5 +1,4 @@ # file : common/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/types/test.hxx b/common/types/test.hxx index e7359de..a99b499 100644 --- a/common/types/test.hxx +++ b/common/types/test.hxx @@ -1,5 +1,4 @@ // file : common/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index 3c66d88..d55e7c5 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -1,5 +1,4 @@ // file : common/view/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test view basics. diff --git a/common/view/basics/makefile b/common/view/basics/makefile index a3d714b..eafe550 100644 --- a/common/view/basics/makefile +++ b/common/view/basics/makefile @@ -1,5 +1,4 @@ # file : common/view/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 569988b..66bf86c 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -1,5 +1,4 @@ // file : common/view/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index 5c45d94..c417cc3 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -1,5 +1,4 @@ // file : common/view/olv/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test object loading views. diff --git a/common/view/olv/makefile b/common/view/olv/makefile index 8b6a085..c65d7e9 100644 --- a/common/view/olv/makefile +++ b/common/view/olv/makefile @@ -1,5 +1,4 @@ # file : common/view/olv/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index bc73461..0de9483 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx index a5d4555..a769daa 100644 --- a/common/view/olv/test2.hxx +++ b/common/view/olv/test2.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx index 7ba8809..8cf4344 100644 --- a/common/view/olv/test3.hxx +++ b/common/view/olv/test3.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx index 72a17a6..f2af5fd 100644 --- a/common/view/olv/test4.hxx +++ b/common/view/olv/test4.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test4.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx index e2c3dbc..e3a671b 100644 --- a/common/view/olv/test5.hxx +++ b/common/view/olv/test5.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test5.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx index 51f6e5b..5336fa6 100644 --- a/common/view/olv/test6.hxx +++ b/common/view/olv/test6.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test6.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index ef97a64..dbdc663 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test7.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index a417186..607d222 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test8.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx index 7bea717..b109de3 100644 --- a/common/view/olv/test9.hxx +++ b/common/view/olv/test9.hxx @@ -1,5 +1,4 @@ // file : common/view/olv/test9.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST9_HXX diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index e2b118b..35e0923 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -1,5 +1,4 @@ // file : common/virtual/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test virtual data members. diff --git a/common/virtual/makefile b/common/virtual/makefile index 3cb3416..e112d31 100644 --- a/common/virtual/makefile +++ b/common/virtual/makefile @@ -1,5 +1,4 @@ # file : common/virtual/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx index c65928a..2654d09 100644 --- a/common/virtual/test.hxx +++ b/common/virtual/test.hxx @@ -1,5 +1,4 @@ // file : common/virtual/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 0f07b5a..255e138 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -1,5 +1,4 @@ // file : common/wrapper/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test wrapper machinery. diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 746ff30..4393d16 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -1,5 +1,4 @@ # file : common/wrapper/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index af089db..27d020b 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -1,5 +1,4 @@ // file : common/wrapper/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/configure.ac b/configure.ac index 1c3d1b8..0c307c5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,4 @@ # file : configure.ac -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file AC_PREREQ(2.60) diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx index 173610e..95e5161 100644 --- a/diagnostics/containers-of-containers.hxx +++ b/diagnostics/containers-of-containers.hxx @@ -1,5 +1,4 @@ // file : common/id/auto/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include diff --git a/evolution/Makefile.am b/evolution/Makefile.am index ab8276a..2459530 100644 --- a/evolution/Makefile.am +++ b/evolution/Makefile.am @@ -1,5 +1,4 @@ # file : evolution/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx index 55785ec..d4eb396 100644 --- a/evolution/add-column/driver.cxx +++ b/evolution/add-column/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/add-column/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new column. diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile index 934fdd1..b05edab 100644 --- a/evolution/add-column/makefile +++ b/evolution/add-column/makefile @@ -1,5 +1,4 @@ # file : evolution/add-column/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx index 623c969..6ac9160 100644 --- a/evolution/add-column/model.hxx +++ b/evolution/add-column/model.hxx @@ -1,5 +1,4 @@ // file : evolution/add-column/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx index d982677..b0d7fda 100644 --- a/evolution/add-column/test1.hxx +++ b/evolution/add-column/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/add-column/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx index 3f8b86d..b62530a 100644 --- a/evolution/add-column/test2.hxx +++ b/evolution/add-column/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/add-column/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx index c2054ad..b24dba1 100644 --- a/evolution/add-column/test3.hxx +++ b/evolution/add-column/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/add-column/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx index 04f2ab1..177b615 100644 --- a/evolution/add-foreign-key/driver.cxx +++ b/evolution/add-foreign-key/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/add-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a foreign key. diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile index 33a5964..701ba43 100644 --- a/evolution/add-foreign-key/makefile +++ b/evolution/add-foreign-key/makefile @@ -1,5 +1,4 @@ # file : evolution/add-foreign-key/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx index 1740276..f5fe26d 100644 --- a/evolution/add-foreign-key/model.hxx +++ b/evolution/add-foreign-key/model.hxx @@ -1,5 +1,4 @@ // file : evolution/add-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx index 35dbcc4..05c78c3 100644 --- a/evolution/add-foreign-key/test1.hxx +++ b/evolution/add-foreign-key/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/add-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx index 5c6d91d..c57d9a1 100644 --- a/evolution/add-foreign-key/test2.hxx +++ b/evolution/add-foreign-key/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/add-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx index bac2eec..c844469 100644 --- a/evolution/add-foreign-key/test3.hxx +++ b/evolution/add-foreign-key/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/add-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx index c8e5a3a..689504e 100644 --- a/evolution/add-index/driver.cxx +++ b/evolution/add-index/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/add-index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new index. diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile index 0cea925..c0e0289 100644 --- a/evolution/add-index/makefile +++ b/evolution/add-index/makefile @@ -1,5 +1,4 @@ # file : evolution/add-index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx index 5d7467f..fec75cc 100644 --- a/evolution/add-index/model.hxx +++ b/evolution/add-index/model.hxx @@ -1,5 +1,4 @@ // file : evolution/add-index/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx index 587c60a..1be2b5b 100644 --- a/evolution/add-index/test1.hxx +++ b/evolution/add-index/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/add-index/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx index 4859c11..a0faca9 100644 --- a/evolution/add-index/test2.hxx +++ b/evolution/add-index/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/add-index/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx index beb43c2..aab9c86 100644 --- a/evolution/add-index/test3.hxx +++ b/evolution/add-index/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/add-index/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx index f26b2e9..67b0f0e 100644 --- a/evolution/add-table/driver.cxx +++ b/evolution/add-table/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/add-table/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test adding a new table (object, container). diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile index d96cf74..d7d8cc9 100644 --- a/evolution/add-table/makefile +++ b/evolution/add-table/makefile @@ -1,5 +1,4 @@ # file : evolution/add-table/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx index f31063b..208a156 100644 --- a/evolution/add-table/model.hxx +++ b/evolution/add-table/model.hxx @@ -1,5 +1,4 @@ // file : evolution/add-table/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx index 976cec3..adc51a1 100644 --- a/evolution/add-table/test1.hxx +++ b/evolution/add-table/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/add-table/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx index b03dde4..ca03cef 100644 --- a/evolution/add-table/test2.hxx +++ b/evolution/add-table/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/add-table/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx index 38dd282..39406a2 100644 --- a/evolution/add-table/test3.hxx +++ b/evolution/add-table/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/add-table/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx index bea1568..be63f05 100644 --- a/evolution/alter-column/driver.cxx +++ b/evolution/alter-column/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/alter-column/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test altering a column. diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile index 4e698ef..f92842a 100644 --- a/evolution/alter-column/makefile +++ b/evolution/alter-column/makefile @@ -1,5 +1,4 @@ # file : evolution/alter-column/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx index 88dc060..fc6661c 100644 --- a/evolution/alter-column/model.hxx +++ b/evolution/alter-column/model.hxx @@ -1,5 +1,4 @@ // file : evolution/alter-column/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx index 89205e1..9353558 100644 --- a/evolution/alter-column/test1.hxx +++ b/evolution/alter-column/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/alter-column/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx index cab68d9..e2dbed3 100644 --- a/evolution/alter-column/test2.hxx +++ b/evolution/alter-column/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/alter-column/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx index 49ddc25..ac08e2f 100644 --- a/evolution/alter-column/test3.hxx +++ b/evolution/alter-column/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/alter-column/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx index eddcd66..88453c3 100644 --- a/evolution/combined/driver.cxx +++ b/evolution/combined/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/combined/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Combined schema evolution test. diff --git a/evolution/combined/makefile b/evolution/combined/makefile index 0befefa..3e44dd1 100644 --- a/evolution/combined/makefile +++ b/evolution/combined/makefile @@ -1,5 +1,4 @@ # file : evolution/combined/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx index 133e5ad..e924943 100644 --- a/evolution/combined/model.hxx +++ b/evolution/combined/model.hxx @@ -1,5 +1,4 @@ // file : evolution/combined/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx index 6a43b2a..1a18aff 100644 --- a/evolution/combined/test1.hxx +++ b/evolution/combined/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/combined/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx index 05d600f..8eb7ac8 100644 --- a/evolution/combined/test2.hxx +++ b/evolution/combined/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/combined/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx index 1a7a154..05a052f 100644 --- a/evolution/combined/test3.hxx +++ b/evolution/combined/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/combined/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx index 0fa354c..73cc852 100644 --- a/evolution/data/driver.cxx +++ b/evolution/data/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/data/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test data migration support. diff --git a/evolution/data/makefile b/evolution/data/makefile index a3e8366..20e3501 100644 --- a/evolution/data/makefile +++ b/evolution/data/makefile @@ -1,5 +1,4 @@ # file : evolution/data/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx index 577dd24..680bc55 100644 --- a/evolution/data/model.hxx +++ b/evolution/data/model.hxx @@ -1,5 +1,4 @@ // file : evolution/data/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx index e2f74af..976ed04 100644 --- a/evolution/data/test1.hxx +++ b/evolution/data/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/data/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx index 9d24dd0..bd72940 100644 --- a/evolution/data/test2.hxx +++ b/evolution/data/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/data/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx index 044fd4e..0f47099 100644 --- a/evolution/data/test3.hxx +++ b/evolution/data/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/data/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx index 6c6c744..7f0c253 100644 --- a/evolution/drop-column/driver.cxx +++ b/evolution/drop-column/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/drop-column/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a column. diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile index 06939a3..a4bb228 100644 --- a/evolution/drop-column/makefile +++ b/evolution/drop-column/makefile @@ -1,5 +1,4 @@ # file : evolution/drop-column/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx index 7d25dad..09b63b9 100644 --- a/evolution/drop-column/model.hxx +++ b/evolution/drop-column/model.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-column/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx index d12459e..1efb1fa 100644 --- a/evolution/drop-column/test1.hxx +++ b/evolution/drop-column/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-column/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx index cd5339e..2842cd3 100644 --- a/evolution/drop-column/test2.hxx +++ b/evolution/drop-column/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-column/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx index 757684c..d1ce616 100644 --- a/evolution/drop-column/test3.hxx +++ b/evolution/drop-column/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-column/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx index f884b52..f829562 100644 --- a/evolution/drop-foreign-key/driver.cxx +++ b/evolution/drop-foreign-key/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/drop-foreign-key/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a foreign key. diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile index ace9e41..2cad4b8 100644 --- a/evolution/drop-foreign-key/makefile +++ b/evolution/drop-foreign-key/makefile @@ -1,5 +1,4 @@ # file : evolution/drop-foreign-key/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx index 16ed479..eed8c46 100644 --- a/evolution/drop-foreign-key/model.hxx +++ b/evolution/drop-foreign-key/model.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-foreign-key/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx index 20b1bbd..5476796 100644 --- a/evolution/drop-foreign-key/test1.hxx +++ b/evolution/drop-foreign-key/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-foreign-key/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx index 72b8b81..f091a25 100644 --- a/evolution/drop-foreign-key/test2.hxx +++ b/evolution/drop-foreign-key/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-foreign-key/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx index 4c44a06..beb8c42 100644 --- a/evolution/drop-foreign-key/test3.hxx +++ b/evolution/drop-foreign-key/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-foreign-key/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx index de8f31b..5ad1cd4 100644 --- a/evolution/drop-index/driver.cxx +++ b/evolution/drop-index/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/drop-index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping an index. diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile index 84078bb..775834b 100644 --- a/evolution/drop-index/makefile +++ b/evolution/drop-index/makefile @@ -1,5 +1,4 @@ # file : evolution/drop-index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx index f4f3055..5e163ca 100644 --- a/evolution/drop-index/model.hxx +++ b/evolution/drop-index/model.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-index/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx index 6cafa7a..5a279bb 100644 --- a/evolution/drop-index/test1.hxx +++ b/evolution/drop-index/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-index/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx index 2da701b..78b89f2 100644 --- a/evolution/drop-index/test2.hxx +++ b/evolution/drop-index/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-index/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx index 80e0d87..17b670d 100644 --- a/evolution/drop-index/test3.hxx +++ b/evolution/drop-index/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-index/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx index f3f6e52..81cec55 100644 --- a/evolution/drop-table/driver.cxx +++ b/evolution/drop-table/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/drop-table/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test dropping a table (object, container). diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile index 8f13b6d..c6a5f65 100644 --- a/evolution/drop-table/makefile +++ b/evolution/drop-table/makefile @@ -1,5 +1,4 @@ # file : evolution/drop-table/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx index 5dfbf3b..2c02d09 100644 --- a/evolution/drop-table/model.hxx +++ b/evolution/drop-table/model.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-table/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx index 41739d5..a9ec64c 100644 --- a/evolution/drop-table/test1.hxx +++ b/evolution/drop-table/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-table/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx index 5cdce74..c9ec149 100644 --- a/evolution/drop-table/test2.hxx +++ b/evolution/drop-table/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-table/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx index 1ba33bc..8d3f17b 100644 --- a/evolution/drop-table/test3.hxx +++ b/evolution/drop-table/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/drop-table/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx index 7b73017..1816a5c 100644 --- a/evolution/embedded/driver.cxx +++ b/evolution/embedded/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/embedded/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test embedded schema migration. diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile index 57bb656..372cecd 100644 --- a/evolution/embedded/makefile +++ b/evolution/embedded/makefile @@ -1,5 +1,4 @@ # file : evolution/embedded/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx index b7e452f..f3aa7a4 100644 --- a/evolution/embedded/model.hxx +++ b/evolution/embedded/model.hxx @@ -1,5 +1,4 @@ // file : evolution/embedded/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx index af8f1d6..32903a1 100644 --- a/evolution/embedded/test1.hxx +++ b/evolution/embedded/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/embedded/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx index 109d11d..fce8760 100644 --- a/evolution/embedded/test2.hxx +++ b/evolution/embedded/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/embedded/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx index 7143f92..d49ecc5 100644 --- a/evolution/embedded/test3.hxx +++ b/evolution/embedded/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/embedded/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/makefile b/evolution/makefile index f8877e3..3d9cdb1 100644 --- a/evolution/makefile +++ b/evolution/makefile @@ -1,5 +1,4 @@ # file : evolution/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx index ceb6799..c70edcb 100644 --- a/evolution/soft-add/driver.cxx +++ b/evolution/soft-add/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/soft-add/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-add functionality. diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile index b9a97d5..7455c98 100644 --- a/evolution/soft-add/makefile +++ b/evolution/soft-add/makefile @@ -1,5 +1,4 @@ # file : evolution/soft-add/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx index a360388..39d63c4 100644 --- a/evolution/soft-add/model.hxx +++ b/evolution/soft-add/model.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-add/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx index 29964f7..461d663 100644 --- a/evolution/soft-add/test1.hxx +++ b/evolution/soft-add/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-add/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx index 58c6db9..746da4b 100644 --- a/evolution/soft-add/test2.hxx +++ b/evolution/soft-add/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-add/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx index cb0f68b..f2990d0 100644 --- a/evolution/soft-add/test3.hxx +++ b/evolution/soft-add/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-add/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx index 977ab61..e41a70c 100644 --- a/evolution/soft-delete/driver.cxx +++ b/evolution/soft-delete/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/soft-delete/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test soft-delete functionality. diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile index 54b82e4..92815bc 100644 --- a/evolution/soft-delete/makefile +++ b/evolution/soft-delete/makefile @@ -1,5 +1,4 @@ # file : evolution/soft-delete/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx index bfbb48b..65083dd 100644 --- a/evolution/soft-delete/model.hxx +++ b/evolution/soft-delete/model.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-delete/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx index 7ec8166..d4df90f 100644 --- a/evolution/soft-delete/test1.hxx +++ b/evolution/soft-delete/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-delete/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx index 847509e..3b2b5b4 100644 --- a/evolution/soft-delete/test2.hxx +++ b/evolution/soft-delete/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-delete/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx index f6e3ea2..5a90ab2 100644 --- a/evolution/soft-delete/test3.hxx +++ b/evolution/soft-delete/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/soft-delete/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am index 96bb295..dddb6b9 100644 --- a/evolution/template/Makefile.am +++ b/evolution/template/Makefile.am @@ -1,5 +1,4 @@ # file : evolution/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx index 40f8310..b278acd 100644 --- a/evolution/template/driver.cxx +++ b/evolution/template/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/evolution/template/makefile b/evolution/template/makefile index f7e85f2..474145c 100644 --- a/evolution/template/makefile +++ b/evolution/template/makefile @@ -1,5 +1,4 @@ # file : evolution/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx index 689b3d9..182c81f 100644 --- a/evolution/template/model.hxx +++ b/evolution/template/model.hxx @@ -1,5 +1,4 @@ // file : evolution/template/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx index 9811f02..238b686 100644 --- a/evolution/template/test1.hxx +++ b/evolution/template/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/template/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx index 637cd73..ec982f5 100644 --- a/evolution/template/test2.hxx +++ b/evolution/template/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/template/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx index 851bd4e..50f3882 100644 --- a/evolution/template/test3.hxx +++ b/evolution/template/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/template/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/evolution/test.bat b/evolution/test.bat index 658b6f1..953965c 100644 --- a/evolution/test.bat +++ b/evolution/test.bat @@ -1,6 +1,5 @@ @echo off rem file : evolution/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/evolution/tester.bat b/evolution/tester.bat index 2834fa4..3b7401f 100644 --- a/evolution/tester.bat +++ b/evolution/tester.bat @@ -1,6 +1,5 @@ @echo off rem file : evolution/tester.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/evolution/tester.in b/evolution/tester.in index 6e2811c..1fef1c2 100755 --- a/evolution/tester.in +++ b/evolution/tester.in @@ -1,7 +1,6 @@ #! /bin/sh # file : evolution/tester.in -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx index b04d6a6..236c9b4 100644 --- a/evolution/version/driver.cxx +++ b/evolution/version/driver.cxx @@ -1,5 +1,4 @@ // file : evolution/version/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test schema version access via the database instance. diff --git a/evolution/version/makefile b/evolution/version/makefile index 4387db2..eb63ffc 100644 --- a/evolution/version/makefile +++ b/evolution/version/makefile @@ -1,5 +1,4 @@ # file : evolution/version/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx index bdb8b3a..cdda00e 100644 --- a/evolution/version/model.hxx +++ b/evolution/version/model.hxx @@ -1,5 +1,4 @@ // file : evolution/version/model.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef MODEL_VERSION diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx index 9f73fb7..a50e54c 100644 --- a/evolution/version/test1.hxx +++ b/evolution/version/test1.hxx @@ -1,5 +1,4 @@ // file : evolution/version/test1.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx index 90e766f..f7fc1b7 100644 --- a/evolution/version/test2.hxx +++ b/evolution/version/test2.hxx @@ -1,5 +1,4 @@ // file : evolution/version/test2.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx index ff9a330..364ee31 100644 --- a/evolution/version/test3.hxx +++ b/evolution/version/test3.hxx @@ -1,5 +1,4 @@ // file : evolution/version/test3.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST3_HXX diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am index 56646a8..18d287d 100644 --- a/libcommon/Makefile.am +++ b/libcommon/Makefile.am @@ -1,5 +1,4 @@ # file : libcommon/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am index db00887..3ff50d5 100644 --- a/libcommon/common/Makefile.am +++ b/libcommon/common/Makefile.am @@ -1,5 +1,4 @@ # file : libcommon/common/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file noinst_LTLIBRARIES = libcommon.la diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx index 014bff8..3d82915 100644 --- a/libcommon/common/buffer.hxx +++ b/libcommon/common/buffer.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/buffer.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 237a652..4b8afe1 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -1,5 +1,4 @@ // file : libcommon/common/common.cxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include // std::exit diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx index bbcccbc..21672b1 100644 --- a/libcommon/common/common.hxx +++ b/libcommon/common/common.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/common.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx index 0f3f0f3..9dd2a35 100644 --- a/libcommon/common/common.txx +++ b/libcommon/common/common.txx @@ -1,5 +1,4 @@ // file : libcommon/common/common.txx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // We have to use this helper function instead of just checking which diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx index 1809887..2014b24 100644 --- a/libcommon/common/concrete.hxx +++ b/libcommon/common/concrete.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/concrete.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h index 0cc99ed..16d89a0 100644 --- a/libcommon/common/config-vc.h +++ b/libcommon/common/config-vc.h @@ -1,5 +1,4 @@ /* file : libcommon/common/config-vc.h - * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index 7197081..9d3e0fc 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -1,5 +1,4 @@ /* file : libcommon/common/config.h.in - * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC * license : GNU GPL v2; see accompanying LICENSE file */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx index 0b71caf..5c6d938 100644 --- a/libcommon/common/config.hxx +++ b/libcommon/common/config.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/config.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 7754d8c..926d7a5 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -1,5 +1,4 @@ // file : libcommon/common/export.hxx -// copyright : Copyright (c) 2005-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 1a456df..2f6537f 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -1,5 +1,4 @@ # file : libcommon/common/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/libcommon/makefile b/libcommon/makefile index ab918fe..ac0bb3c 100644 --- a/libcommon/makefile +++ b/libcommon/makefile @@ -1,5 +1,4 @@ # file : libcommon/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/m4/c++11.m4 b/m4/c++11.m4 index 5d8aaa0..42d38ad 100644 --- a/m4/c++11.m4 +++ b/m4/c++11.m4 @@ -1,5 +1,4 @@ dnl file : m4/cxx11.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl CXX11(MACRO, DESCRIPTION) diff --git a/m4/database.m4 b/m4/database.m4 index ac8dbd1..e74a826 100644 --- a/m4/database.m4 +++ b/m4/database.m4 @@ -1,5 +1,4 @@ dnl file : m4/database.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DATABASE diff --git a/m4/diff.m4 b/m4/diff.m4 index 1267ef5..44996fb 100644 --- a/m4/diff.m4 +++ b/m4/diff.m4 @@ -1,5 +1,4 @@ dnl file : m4/diff.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl DIFF_TOOL diff --git a/m4/libboost.m4 b/m4/libboost.m4 index 5d3d9fc..2223493 100644 --- a/m4/libboost.m4 +++ b/m4/libboost.m4 @@ -1,5 +1,4 @@ dnl file : m4/libboost.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 index a25bdc5..454bd90 100644 --- a/m4/libodb-boost.m4 +++ b/m4/libodb-boost.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-boost.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 index 7b1a976..7ab52d8 100644 --- a/m4/libodb-mssql.m4 +++ b/m4/libodb-mssql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-mssql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 index b7cfebe..f0f6d1b 100644 --- a/m4/libodb-mysql.m4 +++ b/m4/libodb-mysql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-mysql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 index d291b82..10028ff 100644 --- a/m4/libodb-oracle.m4 +++ b/m4/libodb-oracle.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-oracle.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 index 4dca935..cd6495d 100644 --- a/m4/libodb-pgsql.m4 +++ b/m4/libodb-pgsql.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-pgsql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 index ce56c0f..76ebfb3 100644 --- a/m4/libodb-qt.m4 +++ b/m4/libodb-qt.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-qt.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 index c901a60..46ea966 100644 --- a/m4/libodb-sqlite.m4 +++ b/m4/libodb-sqlite.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb-sqlite.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libodb.m4 b/m4/libodb.m4 index 5f140bd..0dba7c4 100644 --- a/m4/libodb.m4 +++ b/m4/libodb.m4 @@ -1,5 +1,4 @@ dnl file : m4/libodb.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/libqt.m4 b/m4/libqt.m4 index f647b57..c2be2e7 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -1,5 +1,4 @@ dnl file : m4/libqt.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 index 635793f..302639f 100644 --- a/m4/libtool-link.m4 +++ b/m4/libtool-link.m4 @@ -1,5 +1,4 @@ dnl file : m4/libtool-link.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 index a19e4b8..5debeb2 100644 --- a/m4/mssql.m4 +++ b/m4/mssql.m4 @@ -1,5 +1,4 @@ dnl file : m4/mssql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MSSQL diff --git a/m4/mysql.m4 b/m4/mysql.m4 index 06aa4fe..7564726 100644 --- a/m4/mysql.m4 +++ b/m4/mysql.m4 @@ -1,5 +1,4 @@ dnl file : m4/mysql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl MYSQL diff --git a/m4/odb.m4 b/m4/odb.m4 index 81f09e2..3e1b19b 100644 --- a/m4/odb.m4 +++ b/m4/odb.m4 @@ -1,5 +1,4 @@ dnl file : m4/odb.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) diff --git a/m4/oracle.m4 b/m4/oracle.m4 index d62f8ff..c095214 100644 --- a/m4/oracle.m4 +++ b/m4/oracle.m4 @@ -1,5 +1,4 @@ dnl file : m4/oracle.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl ORACLE diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 index b093362..eb29a62 100644 --- a/m4/pgsql.m4 +++ b/m4/pgsql.m4 @@ -1,5 +1,4 @@ dnl file : m4/pgsql.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl PGSQL diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 index cd55483..7c1a53e 100644 --- a/m4/sqlite.m4 +++ b/m4/sqlite.m4 @@ -1,5 +1,4 @@ dnl file : m4/sqlite.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl SQLITE diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 index 79b89cd..5fb1c11 100644 --- a/m4/static-lib.m4 +++ b/m4/static-lib.m4 @@ -1,5 +1,4 @@ dnl file : m4/static-lib.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl STATIC_LIB(MACRO, DESCRIPTION) diff --git a/m4/threads.m4 b/m4/threads.m4 index 10bdfdd..6f2e25f 100644 --- a/m4/threads.m4 +++ b/m4/threads.m4 @@ -1,5 +1,4 @@ dnl file : m4/threads.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl AC_DEFUN([THREADS],[ diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 index 3f0213e..a70f397 100644 --- a/m4/tr1-memory.m4 +++ b/m4/tr1-memory.m4 @@ -1,5 +1,4 @@ dnl file : m4/tr1-memory.m4 -dnl copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC dnl license : GNU GPL v2; see accompanying LICENSE file dnl dnl TR1_MEMORY diff --git a/makefile b/makefile index bea40e1..509e74b 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,4 @@ # file : makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make diff --git a/mssql-driver.bat b/mssql-driver.bat index b6976dc..174cbf0 100644 --- a/mssql-driver.bat +++ b/mssql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : mssql-driver.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mssql/Makefile.am b/mssql/Makefile.am index 2abec21..3df7091 100644 --- a/mssql/Makefile.am +++ b/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : mssql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx index f8c5b50..bde7eb6 100644 --- a/mssql/custom/driver.cxx +++ b/mssql/custom/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQL Server. diff --git a/mssql/custom/makefile b/mssql/custom/makefile index 89d11c9..5d8d5ae 100644 --- a/mssql/custom/makefile +++ b/mssql/custom/makefile @@ -1,5 +1,4 @@ # file : mssql/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx index ad5d2ab..fc63378 100644 --- a/mssql/custom/query.hxx +++ b/mssql/custom/query.hxx @@ -1,5 +1,4 @@ // file : mssql/custom/query.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx index 26b466b..4b8a5d7 100644 --- a/mssql/custom/test.hxx +++ b/mssql/custom/test.hxx @@ -1,5 +1,4 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx index 9fb30dd..3f14ae7 100644 --- a/mssql/custom/traits.cxx +++ b/mssql/custom/traits.cxx @@ -1,5 +1,4 @@ // file : mssql/types/traits.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include "traits.hxx" diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx index 765f4c7..2bd99cb 100644 --- a/mssql/custom/traits.hxx +++ b/mssql/custom/traits.hxx @@ -1,5 +1,4 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx index cb50b5e..08ad34f 100644 --- a/mssql/database/driver.cxx +++ b/mssql/database/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/database/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mssql/database/makefile b/mssql/database/makefile index 3100663..58b9702 100644 --- a/mssql/database/makefile +++ b/mssql/database/makefile @@ -1,5 +1,4 @@ # file : mssql/database/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/makefile b/mssql/makefile index b5df98c..05f25f0 100644 --- a/mssql/makefile +++ b/mssql/makefile @@ -1,5 +1,4 @@ # file : mssql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx index 21cd511..f4b4fd7 100644 --- a/mssql/native/driver.cxx +++ b/mssql/native/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/native/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL; see accompanying LICENSE file // Test native SQL execution. diff --git a/mssql/native/makefile b/mssql/native/makefile index acc05fa..ac27130 100644 --- a/mssql/native/makefile +++ b/mssql/native/makefile @@ -1,5 +1,4 @@ # file : mssql/native/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx index 318d437..5600c81 100644 --- a/mssql/query/driver.cxx +++ b/mssql/query/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/query/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server-specific query support aspects. diff --git a/mssql/query/makefile b/mssql/query/makefile index 8f3e8d4..269a7f7 100644 --- a/mssql/query/makefile +++ b/mssql/query/makefile @@ -1,5 +1,4 @@ # file : mssql/query/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx index 4f6de8a..85c644e 100644 --- a/mssql/query/test.hxx +++ b/mssql/query/test.hxx @@ -1,5 +1,4 @@ // file : mssql/query/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx index af66316..2389798 100644 --- a/mssql/stored-proc/driver.cxx +++ b/mssql/stored-proc/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/stored-proc/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server stored procedure support. diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile index 39636cf..c787dc0 100644 --- a/mssql/stored-proc/makefile +++ b/mssql/stored-proc/makefile @@ -1,5 +1,4 @@ # file : mssql/stored-proc/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx index 23fe5bd..5958ea3 100644 --- a/mssql/stored-proc/test.hxx +++ b/mssql/stored-proc/test.hxx @@ -1,5 +1,4 @@ // file : mssql/stored-proc/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am index e0aac1a..8db5c16 100644 --- a/mssql/template/Makefile.am +++ b/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx index 0bc2536..ded03f1 100644 --- a/mssql/template/driver.cxx +++ b/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mssql/template/makefile b/mssql/template/makefile index 8a6c727..18a665d 100644 --- a/mssql/template/makefile +++ b/mssql/template/makefile @@ -1,5 +1,4 @@ # file : mssql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx index 6d99a4b..0bc1f95 100644 --- a/mssql/template/test.hxx +++ b/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : mssql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/test.bat b/mssql/test.bat index 1940399..4da8fa5 100644 --- a/mssql/test.bat +++ b/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : mssql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 6e3981f..d900a95 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -1,5 +1,4 @@ // file : mssql/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQL Server type conversion. diff --git a/mssql/types/makefile b/mssql/types/makefile index 08ccf5e..5b96d57 100644 --- a/mssql/types/makefile +++ b/mssql/types/makefile @@ -1,5 +1,4 @@ # file : mssql/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx index 1b0d74f..5d651a8 100644 --- a/mssql/types/test.hxx +++ b/mssql/types/test.hxx @@ -1,5 +1,4 @@ // file : mssql/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx index d50eecc..5881f50 100644 --- a/mssql/types/traits.hxx +++ b/mssql/types/traits.hxx @@ -1,5 +1,4 @@ // file : mssql/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql-driver.bat b/mysql-driver.bat index 9e91e76..8dde6f9 100644 --- a/mysql-driver.bat +++ b/mysql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : mysql-driver.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 47e0f53..05ffc60 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : mysql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index 71d5f9e..e9cc7d9 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in MySQL. diff --git a/mysql/custom/makefile b/mysql/custom/makefile index 9417f38..575cfa6 100644 --- a/mysql/custom/makefile +++ b/mysql/custom/makefile @@ -1,5 +1,4 @@ # file : mysql/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index 115bf96..aa0c9ed 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -1,5 +1,4 @@ // file : mysql/custom/query.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index 701959b..b6c2c86 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -1,5 +1,4 @@ // file : mysql/custom/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 103aa36..9c9ec93 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -1,5 +1,4 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index 0b436de..aebb251 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/database/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/mysql/database/makefile b/mysql/database/makefile index bd2b5b2..746fc9e 100644 --- a/mysql/database/makefile +++ b/mysql/database/makefile @@ -1,5 +1,4 @@ # file : mysql/database/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index 600da20..99138d3 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL index creation. See also the common test. diff --git a/mysql/index/makefile b/mysql/index/makefile index 5ee2c47..4bca75c 100644 --- a/mysql/index/makefile +++ b/mysql/index/makefile @@ -1,5 +1,4 @@ # file : mysql/index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx index 65418fb..b4f6ae8 100644 --- a/mysql/index/test.hxx +++ b/mysql/index/test.hxx @@ -1,5 +1,4 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/makefile b/mysql/makefile index 776e137..a4b86a0 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -1,5 +1,4 @@ # file : mysql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 764fede..0a7dffb 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/native/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/mysql/native/makefile b/mysql/native/makefile index 8cad758..f3bf417 100644 --- a/mysql/native/makefile +++ b/mysql/native/makefile @@ -1,5 +1,4 @@ # file : mysql/native/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 20d6b47..2568e1e 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 3f0cd2f..7034a95 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/mysql/template/makefile b/mysql/template/makefile index 5b68362..9ed17ca 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -1,5 +1,4 @@ # file : mysql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx index 19afe31..5f16f63 100644 --- a/mysql/template/test.hxx +++ b/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : mysql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/test.bat b/mysql/test.bat index ddc4782..f9d3af0 100644 --- a/mysql/test.bat +++ b/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : mysql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 2b391cf..9f044e6 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index 52c3e10..358a136 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -1,5 +1,4 @@ # file : mysql/truncation/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx index 67a2224..1883b0e 100644 --- a/mysql/truncation/test.hxx +++ b/mysql/truncation/test.hxx @@ -1,5 +1,4 @@ // file : mysql/truncation/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index d046755..04c8ebf 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -1,5 +1,4 @@ // file : mysql/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test MySQL type conversion. diff --git a/mysql/types/makefile b/mysql/types/makefile index 1d8eb2a..779f9b1 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -1,5 +1,4 @@ # file : mysql/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index a1e9434..12eb4e0 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -1,5 +1,4 @@ // file : mysql/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 1f587f5..d4ce200 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -1,5 +1,4 @@ // file : mysql/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle-driver.bat b/oracle-driver.bat index 613991f..cf08e46 100644 --- a/oracle-driver.bat +++ b/oracle-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : oracle-driver.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/oracle/Makefile.am b/oracle/Makefile.am index da7ac11..e3f50e7 100644 --- a/oracle/Makefile.am +++ b/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : oracle/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx index 0ffd180..45f0a4e 100644 --- a/oracle/custom/driver.cxx +++ b/oracle/custom/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in Oracle. diff --git a/oracle/custom/makefile b/oracle/custom/makefile index eee9ccc..63e3a32 100644 --- a/oracle/custom/makefile +++ b/oracle/custom/makefile @@ -1,5 +1,4 @@ # file : oracle/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx index dd9a607..523d50b 100644 --- a/oracle/custom/test.hxx +++ b/oracle/custom/test.hxx @@ -1,5 +1,4 @@ // file : oracle/custom/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx index e260c4a..8df2f91 100644 --- a/oracle/custom/traits.hxx +++ b/oracle/custom/traits.hxx @@ -1,5 +1,4 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx index 82c926e..499f136 100644 --- a/oracle/database/driver.cxx +++ b/oracle/database/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/database/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/oracle/database/makefile b/oracle/database/makefile index 33e0b01..0554681 100644 --- a/oracle/database/makefile +++ b/oracle/database/makefile @@ -1,5 +1,4 @@ # file : oracle/database/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/makefile b/oracle/makefile index bae778f..cb457a3 100644 --- a/oracle/makefile +++ b/oracle/makefile @@ -1,5 +1,4 @@ # file : oracle/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx index f01c4b7..541d21e 100644 --- a/oracle/native/driver.cxx +++ b/oracle/native/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/native/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/oracle/native/makefile b/oracle/native/makefile index 4618620..195fb62 100644 --- a/oracle/native/makefile +++ b/oracle/native/makefile @@ -1,5 +1,4 @@ # file : oracle/native/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am index d1bf0f3..b3b60e9 100644 --- a/oracle/template/Makefile.am +++ b/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx index 171b771..13317df 100644 --- a/oracle/template/driver.cxx +++ b/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/oracle/template/makefile b/oracle/template/makefile index 2948160..e2a64f7 100644 --- a/oracle/template/makefile +++ b/oracle/template/makefile @@ -1,5 +1,4 @@ # file : oracle/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx index 9b6fa5b..bfa9cc9 100644 --- a/oracle/template/test.hxx +++ b/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : oracle/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/test.bat b/oracle/test.bat index 2101825..5105054 100644 --- a/oracle/test.bat +++ b/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : oracle/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx index 966eab9..2e3e2e7 100644 --- a/oracle/types/driver.cxx +++ b/oracle/types/driver.cxx @@ -1,5 +1,4 @@ // file : oracle/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Oracle type conversion. diff --git a/oracle/types/makefile b/oracle/types/makefile index a37dd9f..5378617 100644 --- a/oracle/types/makefile +++ b/oracle/types/makefile @@ -1,5 +1,4 @@ # file : oracle/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index 0dfb2ac..255bc08 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -1,5 +1,4 @@ // file : oracle/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx index 379fc77..ad747d8 100644 --- a/oracle/types/traits.hxx +++ b/oracle/types/traits.hxx @@ -1,5 +1,4 @@ // file : oracle/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql-driver.bat b/pgsql-driver.bat index 906a9e3..5240bc5 100644 --- a/pgsql-driver.bat +++ b/pgsql-driver.bat @@ -1,6 +1,5 @@ @echo off rem file : pgsql-driver.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am index d3f4c0a..fcf14e8 100644 --- a/pgsql/Makefile.am +++ b/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : pgsql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index d844229..bc52674 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in PostgreSQL. diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile index d15c8e4..18f11e6 100644 --- a/pgsql/custom/makefile +++ b/pgsql/custom/makefile @@ -1,5 +1,4 @@ # file : pgsql/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx index b6f5368..8b89047 100644 --- a/pgsql/custom/query.hxx +++ b/pgsql/custom/query.hxx @@ -1,5 +1,4 @@ // file : pgsql/custom/query.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx index 347b083..ec3d496 100644 --- a/pgsql/custom/test.hxx +++ b/pgsql/custom/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/custom/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx index 3e7ce6c..c45dec0 100644 --- a/pgsql/custom/traits.hxx +++ b/pgsql/custom/traits.hxx @@ -1,5 +1,4 @@ // file : pgsql/custom/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 6f729f1..5673caa 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/database/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous (compilation only). diff --git a/pgsql/database/makefile b/pgsql/database/makefile index 5930f45..2948467 100644 --- a/pgsql/database/makefile +++ b/pgsql/database/makefile @@ -1,5 +1,4 @@ # file : pgsql/database/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index d07518d..eb7de4b 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/index/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL index creation. See also the common test. diff --git a/pgsql/index/makefile b/pgsql/index/makefile index d81cf67..9db50ce 100644 --- a/pgsql/index/makefile +++ b/pgsql/index/makefile @@ -1,5 +1,4 @@ # file : pgsql/index/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx index dac84ab..d728188 100644 --- a/pgsql/index/test.hxx +++ b/pgsql/index/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/index/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/makefile b/pgsql/makefile index 5d309ba..91520b2 100644 --- a/pgsql/makefile +++ b/pgsql/makefile @@ -1,5 +1,4 @@ # file : pgsql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index ee1a74b..2cea8dd 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/native/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL native SQL execution. diff --git a/pgsql/native/makefile b/pgsql/native/makefile index 72877de..f82e0fc 100644 --- a/pgsql/native/makefile +++ b/pgsql/native/makefile @@ -1,5 +1,4 @@ # file : pgsql/native/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am index f224c98..a9c40d3 100644 --- a/pgsql/template/Makefile.am +++ b/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx index 121140f..98ce17a 100644 --- a/pgsql/template/driver.cxx +++ b/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/pgsql/template/makefile b/pgsql/template/makefile index e9434ab..70b23c3 100644 --- a/pgsql/template/makefile +++ b/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : pgsql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx index 9550514..01670b1 100644 --- a/pgsql/template/test.hxx +++ b/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/test.bat b/pgsql/test.bat index 6db5f84..6b4dd61 100644 --- a/pgsql/test.bat +++ b/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : pgsql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 654f683..63135d4 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/truncation/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile index b49fcba..9519291 100644 --- a/pgsql/truncation/makefile +++ b/pgsql/truncation/makefile @@ -1,5 +1,4 @@ # file : pgsql/truncation/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx index 172e0c2..73110c0 100644 --- a/pgsql/truncation/test.hxx +++ b/pgsql/truncation/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/truncation/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 479a43b..c2b54be 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -1,5 +1,4 @@ // file : pgsql/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test PostgreSQL type conversion. diff --git a/pgsql/types/makefile b/pgsql/types/makefile index b2509bd..c3321b7 100644 --- a/pgsql/types/makefile +++ b/pgsql/types/makefile @@ -1,5 +1,4 @@ # file : pgsql/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index 9dcbfba..f44d73e 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -1,5 +1,4 @@ // file : pgsql/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx index 604f923..a1c8fbe 100644 --- a/pgsql/types/traits.hxx +++ b/pgsql/types/traits.hxx @@ -1,5 +1,4 @@ // file : pgsql/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/qt/Makefile.am b/qt/Makefile.am index 8850028..7edbd44 100644 --- a/qt/Makefile.am +++ b/qt/Makefile.am @@ -1,5 +1,4 @@ # file : qt/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = common diff --git a/qt/build.bat b/qt/build.bat index 0501b5b..97b9330 100644 --- a/qt/build.bat +++ b/qt/build.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/build.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am index aaca204..0093f76 100644 --- a/qt/common/Makefile.am +++ b/qt/common/Makefile.am @@ -1,5 +1,4 @@ # file : qt/common/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx index 6eb9e70..342a313 100644 --- a/qt/common/basic/driver.cxx +++ b/qt/common/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence (common part). diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile index cd8b5dd..7b604a4 100644 --- a/qt/common/basic/makefile +++ b/qt/common/basic/makefile @@ -1,5 +1,4 @@ # file : qt/common/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx index a9f036c..e67302e 100644 --- a/qt/common/basic/test.hxx +++ b/qt/common/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx index f2d7941..5e38ee1 100644 --- a/qt/common/containers/basics/driver.cxx +++ b/qt/common/containers/basics/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/containers/basics/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test basic Qt containers persistence. diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile index 411e1c5..efc9da1 100644 --- a/qt/common/containers/basics/makefile +++ b/qt/common/containers/basics/makefile @@ -1,5 +1,4 @@ # file : qt/common/containers/basics/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx index 1b94523..2c61c88 100644 --- a/qt/common/containers/basics/test.hxx +++ b/qt/common/containers/basics/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/containers/basics/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx index 76f1a67..8157d96 100644 --- a/qt/common/containers/change-tracking/driver.cxx +++ b/qt/common/containers/change-tracking/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/containers/change-tracking/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test change-tracking Qt containers. diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile index 8b94998..13864c5 100644 --- a/qt/common/containers/change-tracking/makefile +++ b/qt/common/containers/change-tracking/makefile @@ -1,5 +1,4 @@ # file : qt/common/containers/change-tracking/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx index 4c3614c..6067581 100644 --- a/qt/common/containers/change-tracking/test.hxx +++ b/qt/common/containers/change-tracking/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/containers/change-tracking/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/makefile b/qt/common/makefile index 4d90f60..874b374 100644 --- a/qt/common/makefile +++ b/qt/common/makefile @@ -1,5 +1,4 @@ # file : qt/common/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx index 096c0ba..2c7c38a 100644 --- a/qt/common/smart-ptr/driver.cxx +++ b/qt/common/smart-ptr/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/smart-ptr/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt smart pointers. diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 8139f36..c678001 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -1,5 +1,4 @@ # file : qt/common/smart-ptr/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx index 5a07b93..2c8bf36 100644 --- a/qt/common/smart-ptr/test.hxx +++ b/qt/common/smart-ptr/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/smart-ptr/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am index d132b5f..75652f3 100644 --- a/qt/common/template/Makefile.am +++ b/qt/common/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/common/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx index e3619d7..30f9fc6 100644 --- a/qt/common/template/driver.cxx +++ b/qt/common/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/common/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/common/template/makefile b/qt/common/template/makefile index 0e6196b..afe6b53 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -1,5 +1,4 @@ # file : qt/common/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx index bcf9f66..6f38186 100644 --- a/qt/common/template/test.hxx +++ b/qt/common/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/common/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/common/test.bat b/qt/common/test.bat index 2c8e672..100628f 100644 --- a/qt/common/test.bat +++ b/qt/common/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/common/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/makefile b/qt/makefile index 4130936..4575b34 100644 --- a/qt/makefile +++ b/qt/makefile @@ -1,5 +1,4 @@ # file : qt/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am index 699812b..3ac285b 100644 --- a/qt/mssql/Makefile.am +++ b/qt/mssql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mssql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx index 8bfedd1..fca335d 100644 --- a/qt/mssql/basic/driver.cxx +++ b/qt/mssql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQL Server version. diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile index 7442395..c8f1725 100644 --- a/qt/mssql/basic/makefile +++ b/qt/mssql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx index 0725dbe..bce87b6 100644 --- a/qt/mssql/basic/test.hxx +++ b/qt/mssql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx index 1bdee52..9b4320e 100644 --- a/qt/mssql/date-time/driver.cxx +++ b/qt/mssql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQL Server version. diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile index 3994fc6..ff52b50 100644 --- a/qt/mssql/date-time/makefile +++ b/qt/mssql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx index 5049bbf..71769b9 100644 --- a/qt/mssql/date-time/test.hxx +++ b/qt/mssql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/makefile b/qt/mssql/makefile index 7906324..861cee6 100644 --- a/qt/mssql/makefile +++ b/qt/mssql/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am index 9b83561..df51831 100644 --- a/qt/mssql/template/Makefile.am +++ b/qt/mssql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mssql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx index 7359e3c..97ef6ef 100644 --- a/qt/mssql/template/driver.cxx +++ b/qt/mssql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mssql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile index f9be0b0..f53ed9f 100644 --- a/qt/mssql/template/makefile +++ b/qt/mssql/template/makefile @@ -1,5 +1,4 @@ # file : qt/mssql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx index e5594ba..033703a 100644 --- a/qt/mssql/template/test.hxx +++ b/qt/mssql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/mssql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat index b0aaef6..6e47030 100644 --- a/qt/mssql/test.bat +++ b/qt/mssql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/mssql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/mysql/Makefile.am b/qt/mysql/Makefile.am index b4deee6..674dd40 100644 --- a/qt/mysql/Makefile.am +++ b/qt/mysql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mysql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx index f2e937b..b685d68 100644 --- a/qt/mysql/basic/driver.cxx +++ b/qt/mysql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. MySQL version. diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile index d0f11a3..93696ad 100644 --- a/qt/mysql/basic/makefile +++ b/qt/mysql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx index a973fd0..6dd246e 100644 --- a/qt/mysql/basic/test.hxx +++ b/qt/mysql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx index 4be39e4..94cf653 100644 --- a/qt/mysql/date-time/driver.cxx +++ b/qt/mysql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. MySQL version. diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile index d198427..1fe52fd 100644 --- a/qt/mysql/date-time/makefile +++ b/qt/mysql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx index 3e891c4..ba31da5 100644 --- a/qt/mysql/date-time/test.hxx +++ b/qt/mysql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/makefile b/qt/mysql/makefile index baf7ac7..ea036fa 100644 --- a/qt/mysql/makefile +++ b/qt/mysql/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am index 775f04f..819fe92 100644 --- a/qt/mysql/template/Makefile.am +++ b/qt/mysql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/mysql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx index b9166d7..1e293b4 100644 --- a/qt/mysql/template/driver.cxx +++ b/qt/mysql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/mysql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile index 6511c1e..267908f 100644 --- a/qt/mysql/template/makefile +++ b/qt/mysql/template/makefile @@ -1,5 +1,4 @@ # file : qt/mysql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx index e4d2e2f..94b806d 100644 --- a/qt/mysql/template/test.hxx +++ b/qt/mysql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/mysql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat index 9bcaffc..e927529 100644 --- a/qt/mysql/test.bat +++ b/qt/mysql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/mysql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/oracle/Makefile.am b/qt/oracle/Makefile.am index c5fc6cc..2a46a58 100644 --- a/qt/oracle/Makefile.am +++ b/qt/oracle/Makefile.am @@ -1,5 +1,4 @@ # file : qt/oracle/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx index 88d41fb..43a20e2 100644 --- a/qt/oracle/basic/driver.cxx +++ b/qt/oracle/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. Oracle version. diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile index 7460a89..32df442 100644 --- a/qt/oracle/basic/makefile +++ b/qt/oracle/basic/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx index 274fcda..6781a97 100644 --- a/qt/oracle/basic/test.hxx +++ b/qt/oracle/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx index 4468031..d13fab7 100644 --- a/qt/oracle/date-time/driver.cxx +++ b/qt/oracle/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. Oracle version. diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile index 842e6ac..f985090 100644 --- a/qt/oracle/date-time/makefile +++ b/qt/oracle/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx index c0231ef..93bc5b7 100644 --- a/qt/oracle/date-time/test.hxx +++ b/qt/oracle/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/makefile b/qt/oracle/makefile index 0c23da0..8d99559 100644 --- a/qt/oracle/makefile +++ b/qt/oracle/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am index 15bf011..27f30c7 100644 --- a/qt/oracle/template/Makefile.am +++ b/qt/oracle/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/oracle/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx index e775215..9b092a9 100644 --- a/qt/oracle/template/driver.cxx +++ b/qt/oracle/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/oracle/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile index 0ebbd48..89d2ced 100644 --- a/qt/oracle/template/makefile +++ b/qt/oracle/template/makefile @@ -1,5 +1,4 @@ # file : qt/oracle/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx index 5076743..0ad65cf 100644 --- a/qt/oracle/template/test.hxx +++ b/qt/oracle/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/oracle/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat index 6825f6d..6a1fd48 100644 --- a/qt/oracle/test.bat +++ b/qt/oracle/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/oracle/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am index bd612a1..98b1489 100644 --- a/qt/pgsql/Makefile.am +++ b/qt/pgsql/Makefile.am @@ -1,5 +1,4 @@ # file : qt/pgsql/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx index 401a38f..4c6a78a 100644 --- a/qt/pgsql/basic/driver.cxx +++ b/qt/pgsql/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. PostgreSQL version. diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile index 3962715..df5ac74 100644 --- a/qt/pgsql/basic/makefile +++ b/qt/pgsql/basic/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx index 4a446d9..d4a1ba6 100644 --- a/qt/pgsql/basic/test.hxx +++ b/qt/pgsql/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx index 4131cd2..43a676d 100644 --- a/qt/pgsql/date-time/driver.cxx +++ b/qt/pgsql/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. PostgreSQL version. diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile index 626c034..20b5d10 100644 --- a/qt/pgsql/date-time/makefile +++ b/qt/pgsql/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx index 3ce5ccb..2da5587 100644 --- a/qt/pgsql/date-time/test.hxx +++ b/qt/pgsql/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile index 1b89208..9c9ba58 100644 --- a/qt/pgsql/makefile +++ b/qt/pgsql/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am index 8707bdc..470ecbf 100644 --- a/qt/pgsql/template/Makefile.am +++ b/qt/pgsql/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/pgsql/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx index e54203c..71934a7 100644 --- a/qt/pgsql/template/driver.cxx +++ b/qt/pgsql/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/pgsql/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile index 1797c1f..22379c4 100644 --- a/qt/pgsql/template/makefile +++ b/qt/pgsql/template/makefile @@ -1,5 +1,4 @@ # file : qt/pgsql/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx index 323c3d2..8b866bd 100644 --- a/qt/pgsql/template/test.hxx +++ b/qt/pgsql/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/pgsql/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat index fdbc848..8f144f8 100644 --- a/qt/pgsql/test.bat +++ b/qt/pgsql/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/pgsql/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am index 4094756..0ddfc7d 100644 --- a/qt/sqlite/Makefile.am +++ b/qt/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : qt/sqlite/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx index ac71a7c..3bae10b 100644 --- a/qt/sqlite/basic/driver.cxx +++ b/qt/sqlite/basic/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/basic/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt basic type persistence. SQLite version. diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile index baa7dd6..3719c98 100644 --- a/qt/sqlite/basic/makefile +++ b/qt/sqlite/basic/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/basic/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx index be141c2..b0cdf46 100644 --- a/qt/sqlite/basic/test.hxx +++ b/qt/sqlite/basic/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/basic/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx index b7cd23f..adf7889 100644 --- a/qt/sqlite/date-time/driver.cxx +++ b/qt/sqlite/date-time/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/date-time/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test Qt date/time type persistence. SQLite version. diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile index ce43b02..ec7c0ea 100644 --- a/qt/sqlite/date-time/makefile +++ b/qt/sqlite/date-time/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/date-time/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx index 10e3dd2..9795846 100644 --- a/qt/sqlite/date-time/test.hxx +++ b/qt/sqlite/date-time/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/date-time/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile index 3f5adcd..db8724c 100644 --- a/qt/sqlite/makefile +++ b/qt/sqlite/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am index f4960e4..d28b0d3 100644 --- a/qt/sqlite/template/Makefile.am +++ b/qt/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : qt/sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx index d3f7adb..dc1181c 100644 --- a/qt/sqlite/template/driver.cxx +++ b/qt/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : qt/sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile index 234f236..480429f 100644 --- a/qt/sqlite/template/makefile +++ b/qt/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : qt/sqlite/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx index 1bc0974..1a8d616 100644 --- a/qt/sqlite/template/test.hxx +++ b/qt/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : qt/sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat index 33c883d..80e0f03 100644 --- a/qt/sqlite/test.bat +++ b/qt/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : qt/sqlite/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am index 3fd06e0..998e823 100644 --- a/sqlite/Makefile.am +++ b/sqlite/Makefile.am @@ -1,5 +1,4 @@ # file : sqlite/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index 2b295fe..4ac29b3 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/auto/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test manual/automatic id assignment. diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile index 7c25bd0..6da7071 100644 --- a/sqlite/auto/makefile +++ b/sqlite/auto/makefile @@ -1,5 +1,4 @@ # file : sqlite/auto/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx index 7430d97..9905182 100644 --- a/sqlite/auto/test.hxx +++ b/sqlite/auto/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/auto/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index 6c2b96b..b53c0f6 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/custom/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test custom database type mapping in SQLite. diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile index ae57bd3..39f1c76 100644 --- a/sqlite/custom/makefile +++ b/sqlite/custom/makefile @@ -1,5 +1,4 @@ # file : sqlite/custom/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx index cf65c89..54a2ba3 100644 --- a/sqlite/custom/test.hxx +++ b/sqlite/custom/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/custom/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index 0fae510..d0fe198 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/database/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test that database constructors are unambiguous and some other things. diff --git a/sqlite/database/makefile b/sqlite/database/makefile index d03b7b5..4a2a5ef 100644 --- a/sqlite/database/makefile +++ b/sqlite/database/makefile @@ -1,5 +1,4 @@ # file : sqlite/database/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/makefile b/sqlite/makefile index d653033..a644c33 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -1,5 +1,4 @@ # file : sqlite/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 2253187..10a6b05 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/native/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test native SQL execution. diff --git a/sqlite/native/makefile b/sqlite/native/makefile index 6e00b81..c5434f0 100644 --- a/sqlite/native/makefile +++ b/sqlite/native/makefile @@ -1,5 +1,4 @@ # file : sqlite/native/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 15e2cc9..7049b8b 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/stream/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite BLOB/TEXT incremental I/O. diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile index fdf8e15..1a46b62 100644 --- a/sqlite/stream/makefile +++ b/sqlite/stream/makefile @@ -1,5 +1,4 @@ # file : sqlite/stream/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx index f4760a1..9189a87 100644 --- a/sqlite/stream/test.hxx +++ b/sqlite/stream/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/stream/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am index 049ee1c..b922bf1 100644 --- a/sqlite/template/Makefile.am +++ b/sqlite/template/Makefile.am @@ -1,5 +1,4 @@ # file : sqlite/template/Makefile.am -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx index 69f3955..95fdfb0 100644 --- a/sqlite/template/driver.cxx +++ b/sqlite/template/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/template/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // PLACE TEST DESCRIPTION HERE diff --git a/sqlite/template/makefile b/sqlite/template/makefile index 943f54a..45ba099 100644 --- a/sqlite/template/makefile +++ b/sqlite/template/makefile @@ -1,5 +1,4 @@ # file : sqlite/template/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx index 4b2e29d..63e07d5 100644 --- a/sqlite/template/test.hxx +++ b/sqlite/template/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/template/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/test.bat b/sqlite/test.bat index fdf5596..ab29f82 100644 --- a/sqlite/test.bat +++ b/sqlite/test.bat @@ -1,6 +1,5 @@ @echo off rem file : sqlite/test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file setlocal diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index b996990..8eb8f2c 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/transaction/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test esoteric SQLite transaction semantics aspects. diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile index b90561a..14e4ca0 100644 --- a/sqlite/transaction/makefile +++ b/sqlite/transaction/makefile @@ -1,5 +1,4 @@ # file : sqlite/transaction/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx index 94ef54c..bfb981b 100644 --- a/sqlite/transaction/test.hxx +++ b/sqlite/transaction/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/transaction/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index b7016e9..5ab6c29 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/truncation/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test insufficient buffer/truncation handling. diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile index 6302950..4e7e0e3 100644 --- a/sqlite/truncation/makefile +++ b/sqlite/truncation/makefile @@ -1,5 +1,4 @@ # file : sqlite/truncation/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx index 96846df..8ca44ea 100644 --- a/sqlite/truncation/test.hxx +++ b/sqlite/truncation/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/truncation/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 3ffef1c..8f25330 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -1,5 +1,4 @@ // file : sqlite/types/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file // Test SQLite type conversion. diff --git a/sqlite/types/makefile b/sqlite/types/makefile index e7d284c..f3810b2 100644 --- a/sqlite/types/makefile +++ b/sqlite/types/makefile @@ -1,5 +1,4 @@ # file : sqlite/types/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 40b4298..f642738 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -1,5 +1,4 @@ // file : sqlite/types/test.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx index 3f4172c..9483f58 100644 --- a/sqlite/types/traits.hxx +++ b/sqlite/types/traits.hxx @@ -1,5 +1,4 @@ // file : sqlite/types/traits.hxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef TRAITS_HXX diff --git a/test.bat b/test.bat index b6965a3..3be39d4 100644 --- a/test.bat +++ b/test.bat @@ -1,6 +1,5 @@ @echo off rem file : test.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.bat b/tester.bat index fbc9664..d5d667a 100644 --- a/tester.bat +++ b/tester.bat @@ -1,6 +1,5 @@ @echo off rem file : tester.bat -rem copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC rem license : GNU GPL v2; see accompanying LICENSE file rem diff --git a/tester.in b/tester.in index 298fd66..a83db1b 100755 --- a/tester.in +++ b/tester.in @@ -1,7 +1,6 @@ #! /bin/sh # file : tester.in -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file # -- cgit v1.1 From c3a896eaa7a5d4b3129d4f32e40223f2e35cc7c5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 18 Jul 2020 14:32:25 +0200 Subject: Release version 2.5.0-b.19 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index a9b5191..ea83ada 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.18 +2.5.0-b.19 -- cgit v1.1 From 1357765fd5d2bca38193f9be6f38618aef0b3ab0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Jul 2020 15:13:40 +0200 Subject: Change version to 2.5.0-b.20.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index ea83ada..a60117f 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.19 +2.5.0-b.20 -- cgit v1.1 From d776aad4d4abb8eabd240621eb3d13b59a5b17d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Jun 2021 10:01:20 +0200 Subject: Add test for SQLite ATTACH DATABASE support --- sqlite/attach/driver.cxx | 107 ++++++++++++++++++++++++++++++++++++++++++++++ sqlite/attach/makefile | 108 +++++++++++++++++++++++++++++++++++++++++++++++ sqlite/attach/test.hxx | 32 ++++++++++++++ sqlite/attach/test.std | 0 sqlite/makefile | 1 + 5 files changed, 248 insertions(+) create mode 100644 sqlite/attach/driver.cxx create mode 100644 sqlite/attach/makefile create mode 100644 sqlite/attach/test.hxx create mode 100644 sqlite/attach/test.std diff --git a/sqlite/attach/driver.cxx b/sqlite/attach/driver.cxx new file mode 100644 index 0000000..8d0672f --- /dev/null +++ b/sqlite/attach/driver.cxx @@ -0,0 +1,107 @@ +// file : sqlite/attach/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test attached database support. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr mdb (create_specific_database (argc, argv)); + + { + object o ("one"); + + connection_ptr c (mdb->connection ()); + + database adb (c, ":memory:", "adb"); + + // Create schema similar to create_database(). + // + { + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + odb::schema_catalog::create_schema (adb); + t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); + } + + { + transaction t (c->begin ()); + mdb->persist (o); + adb.persist (o); + t.commit (); + } + + { + transaction t (c->begin ()); + auto_ptr p (adb.load (o.id)); + t.commit (); + + assert (p->str == o.str); + } + + { + o.str = "two"; + + transaction t (c->begin ()); + adb.update (o); + t.commit (); + } + + { + typedef sqlite::query query; + + transaction t (c->begin ()); + auto_ptr p (adb.query_one (query::str == "two")); + t.commit (); + + assert (p->str == o.str); + } + + { + transaction t (c->begin ()); + adb.erase (o); + t.commit (); + } + + { + transaction t (c->begin ()); + auto_ptr p (mdb->load (o.id)); + t.commit (); + + assert (p.get () != 0); + } + + adb.detach (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/sqlite/attach/makefile b/sqlite/attach/makefile new file mode 100644 index 0000000..1ae325d --- /dev/null +++ b/sqlite/attach/makefile @@ -0,0 +1,108 @@ +# file : sqlite/attach/makefile +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +odb_hdr := test.hxx +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database sqlite --default-database \ +common --generate-query --generate-schema --table-prefix sqlitex_attach_ \ +--schema main +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-schemaless-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/attach/test.hxx b/sqlite/attach/test.hxx new file mode 100644 index 0000000..b3b8f63 --- /dev/null +++ b/sqlite/attach/test.hxx @@ -0,0 +1,32 @@ +// file : sqlite/attach/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#include + +#pragma db object +struct object +{ + explicit + object (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + #pragma db unique + std::string str; + +private: + object () {} + + friend class odb::access; +}; + +#endif // TEST_HXX diff --git a/sqlite/attach/test.std b/sqlite/attach/test.std new file mode 100644 index 0000000..e69de29 diff --git a/sqlite/makefile b/sqlite/makefile index a644c33..a80d464 100644 --- a/sqlite/makefile +++ b/sqlite/makefile @@ -5,6 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make tests := \ template \ +attach \ auto \ custom \ database \ -- cgit v1.1 From 3231650c50fc943301b3c76fe7d1f7b806f0cc62 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 Jun 2021 13:20:30 +0200 Subject: Add support for bulk operations in PostgreSQL 14 --- common/bulk/driver.cxx | 18 ++- common/bulk/test-pgsql-enabled.std | 217 +++++++++++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 common/bulk/test-pgsql-enabled.std diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 04c440f..33cbbaa 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -288,7 +288,9 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); -#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) +// @@ TODO: bulk operations in PostgreSQL are only available with libpq >= 14. +// +#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) //|| defined(DATABASE_PGSQL) // Test database class API with various forms of containers // and elements (test #6 is a copy). @@ -776,8 +778,16 @@ main (int argc, char* argv[]) } catch (const multiple_exceptions& e) { +#ifndef DATABASE_PGSQL assert (e.attempted () == 3 && e.failed () == 2); assert (e[0] != 0 && e[1] == 0 && e[2] != 0); +#else + // In PosgreSQL no further statements are attempted after the first + // failure. + // + assert (e.attempted () == 1 && e.failed () == 1); + assert (e[0] != 0); +#endif } } @@ -1069,8 +1079,12 @@ main (int argc, char* argv[]) try { + // Some updates may succeed spoiling the version for erase tests. + // + std::vector c (v); + transaction t (db->begin ()); - db->update (v.begin (), v.end ()); + db->update (c.begin (), c.end ()); assert (false); } catch (const multiple_exceptions& e) diff --git a/common/bulk/test-pgsql-enabled.std b/common/bulk/test-pgsql-enabled.std new file mode 100644 index 0000000..0882bf2 --- /dev/null +++ b/common/bulk/test-pgsql-enabled.std @@ -0,0 +1,217 @@ +multiple exceptions, 1 element attempted, 1 failed: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed, fatal: +[1] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 1 element attempted, 1 failed, fatal: +[0] object already persistent + +multiple exceptions, 2 elements attempted, 1 failed, fatal: +[1] object already persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object already persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object not persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object not persistent +[2] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object not persistent +[2] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[2] object not persistent +[4] object not persistent +[6] object not persistent + +multiple exceptions, 7 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object not persistent + +multiple exceptions, 1 element attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 2 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 3 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 4 elements attempted, 4 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 5 elements attempted, 5 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent + +multiple exceptions, 6 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[3] object not persistent +[4] object not persistent +[5] object not persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[1] object not persistent + +multiple exceptions, 2 elements attempted, 1 failed: +[0] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[1] object not persistent +[2] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object not persistent +[2] object not persistent + +multiple exceptions, 3 elements attempted, 2 failed: +[0] object not persistent +[1] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[1] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[2] object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[3] object not persistent + +multiple exceptions, 4 elements attempted, 3 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent + +multiple exceptions, 8 elements attempted, 4 failed: +[1] object not persistent +[3] object not persistent +[5] object not persistent +[7] object not persistent + +multiple exceptions, 10 elements attempted, 6 failed: +[0] object not persistent +[1] object not persistent +[2] object not persistent +[6] object not persistent +[7] object not persistent +[8] object not persistent + +multiple exceptions, 3 elements attempted, 1 failed: +[2] object not persistent + +multiple exceptions, 4 elements attempted, 2 failed: +[1] object changed concurrently +[3] object changed concurrently + +multiple exceptions, 4 elements attempted, 2 failed: +[1] object changed concurrently +[3] object changed concurrently + -- cgit v1.1 From 4042f2ebfae0318a193a0df62bdc80be93ada762 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 16 Oct 2021 11:12:52 +0200 Subject: Release version 2.5.0-b.21 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index a60117f..412a335 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.20 +2.5.0-b.21 -- cgit v1.1 From cc08639dd0da91a8be97f883cf8b90c757f79071 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Oct 2021 09:01:11 +0200 Subject: Change version to 2.5.0-b.22.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 412a335..6d2beda 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.21 +2.5.0-b.22 -- cgit v1.1 From 59e1be91b58c5d8591fcfa0b103ac6ed167a45fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Jul 2022 08:47:25 +0200 Subject: Release version 2.5.0-b.23 --- build/import/odb/stub.make | 2 +- common/bulk/driver.cxx | 2 +- pgsql/bulk/driver.cxx | 340 +++++++++++++++++++++++++++++++++++++++++++++ pgsql/bulk/makefile | 107 ++++++++++++++ pgsql/bulk/test.hxx | 34 +++++ pgsql/bulk/test.std | 0 pgsql/savepoint/driver.cxx | 58 ++++++++ pgsql/savepoint/makefile | 107 ++++++++++++++ pgsql/savepoint/test.hxx | 27 ++++ pgsql/savepoint/test.std | 0 version | 2 +- 11 files changed, 676 insertions(+), 3 deletions(-) create mode 100644 pgsql/bulk/driver.cxx create mode 100644 pgsql/bulk/makefile create mode 100644 pgsql/bulk/test.hxx create mode 100644 pgsql/bulk/test.std create mode 100644 pgsql/savepoint/driver.cxx create mode 100644 pgsql/savepoint/makefile create mode 100644 pgsql/savepoint/test.hxx create mode 100644 pgsql/savepoint/test.std diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make index 21ff9f2..05356ca 100644 --- a/build/import/odb/stub.make +++ b/build/import/odb/stub.make @@ -11,7 +11,7 @@ ifdef odb_installed ifeq ($(odb_installed),y) -$(call export,odb: odb,odb-rules: $(scf_root)/import/odb/hxx-cxx.make) +$(call export,odb: /usr/local/bin/odb,odb-rules: $(scf_root)/import/odb/hxx-cxx.make) else diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 33cbbaa..2214bfd 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -290,7 +290,7 @@ main (int argc, char* argv[]) // @@ TODO: bulk operations in PostgreSQL are only available with libpq >= 14. // -#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) //|| defined(DATABASE_PGSQL) +#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) || defined(DATABASE_PGSQL) // Test database class API with various forms of containers // and elements (test #6 is a copy). diff --git a/pgsql/bulk/driver.cxx b/pgsql/bulk/driver.cxx new file mode 100644 index 0000000..fd629b8 --- /dev/null +++ b/pgsql/bulk/driver.cxx @@ -0,0 +1,340 @@ +// file : pgsql/savepoint/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transaction savepoints. +// + +#include + +#include +#include +#include +#include +#include +#include + +// Note: hack. +// +#include +#define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) + +static const size_t columns = 3; + +struct data +{ + long long id; + long long idata; + const char* sdata; +}; + +static char* values[columns]; +static int lengths[columns]; +static int formats[columns] = {1, 1, 1}; + +static const unsigned int types[columns] = { + 20, // int8 + 20, // int8 + 25 // text +}; + +static void +init (const struct data* d) +{ + values[0] = (char*)&d->id; + lengths[0] = sizeof (d->id); + + values[1] = (char*)&d->idata; + lengths[1] = sizeof (d->idata); + + values[2] = (char*)d->sdata; + lengths[2] = strlen (d->sdata); +} + +static void +execute (PGconn* conn, const struct data* ds, size_t n) +{ + int sock = PQsocket (conn); + assert (sock != -1); + + if (PQsetnonblocking (conn, 1) == -1 || + PQenterPipelineMode (conn) == 0) + assert (false); + + // True if we've written and read everything, respectively. + // + bool wdone = false; + bool rdone = false; + + size_t wn = 0; + size_t rn = 0; + + while (!rdone) + { + fd_set wds; + if (!wdone) + { + FD_ZERO (&wds); + FD_SET (sock, &wds); + } + + fd_set rds; + FD_ZERO (&rds); + FD_SET (sock, &rds); + + if (select (sock + 1, &rds, wdone ? NULL : &wds, NULL, NULL) == -1) + { + if (errno == EINTR) + continue; + + assert (false); + } + + // Try to minimize the chance of blocking the server by first processing + // the result and then sending more queries. + // + if (FD_ISSET (sock, &rds)) + { + if (PQconsumeInput (conn) == 0) + assert (false); + + while (wn > rn && PQisBusy (conn) == 0) + { + //fprintf (stderr, "PQgetResult %zu\n", rn); + + PGresult* res = PQgetResult (conn); + assert (res != NULL); + ExecStatusType stat = PQresultStatus (res); + + if (stat == PGRES_PIPELINE_SYNC) + { + assert (wdone && rn == n); + PQclear (res); + rdone = true; + break; + } + + if (stat == PGRES_FATAL_ERROR) + { + const char* s = PQresultErrorField (res, PG_DIAG_SQLSTATE); + + if (strcmp (s, "23505") == 0) + fprintf (stderr, "duplicate id at %zu\n", rn); + } + + PQclear (res); + assert (rn != n); + ++rn; + + // We get a NULL result after each query result. + // + { + PGresult* end = PQgetResult (conn); + assert (end == NULL); + } + } + } + + if (!wdone && FD_ISSET (sock, &wds)) + { + // Send queries until we get blocked (write-biased). This feels like + // a better overall strategy to keep the server busy compared to + // sending one query at a time and then re-checking if there is + // anything to read because the results of INSERT/UPDATE/DELETE are + // presumably small and quite a few of them can get buffered before + // the server gets blocked. + // + for (;;) + { + if (wn < n) + { + //fprintf (stderr, "PQsendQueryPrepared %zu\n", wn); + + init (ds + wn); + + if (PQsendQueryPrepared (conn, + "persist_object", + (int)(columns), + values, + lengths, + formats, + 1) == 0) + assert (false); + + if (++wn == n) + { + if (PQpipelineSync (conn) == 0) + assert (false); + + ++wn; + } + } + + // PQflush() result: + // + // 0 -- success (queue is now empty) + // 1 -- blocked + // -1 -- error + // + int r = PQflush (conn); + assert (r != -1); + + if (r == 0) + { + if (wn < n) + { + // If we continue here, then we are write-biased. And if we + // break, then we are read-biased. + // +#if 0 + break; +#else + continue; +#endif + } + + wdone = true; + } + + break; // Blocked or done. + } + } + } + + if (PQexitPipelineMode (conn) == 0 || + PQsetnonblocking (conn, 0) == -1) + assert (false); +} + +static void +test (PGconn* conn) +{ + const size_t batch = 500; + struct data ds[batch]; + + for (size_t i = 0; i != batch; ++i) + { + ds[i].id = htonll (i == batch / 2 ? i - 1 : i); // Cause duplicate PK. + ds[i].idata = htonll (i); + ds[i].sdata = "abc"; + } + + // Prepare the statement. + // + { + PGresult* res = PQprepare ( + conn, + "persist_object", + "INSERT INTO \"pgsql_bulk_object\" " + "(\"id\", " + "\"idata\", " + "\"sdata\") " + "VALUES " + "($1, $2, $3)", + (int)(columns), + types); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } + + // Begin transaction. + // + { + PGresult* res = PQexec (conn, "begin"); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } + + execute (conn, ds, batch); + + // Commit transaction. + // + { + PGresult* res = PQexec (conn, "commit"); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } +} + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + connection_ptr cn (db->connection ()); + + if (false) + { + PGconn* conn (cn->handle ()); + test (conn); + } + + { + const unsigned long n (500); + + vector os; + + for (unsigned long i (0); i != n; ++i) + { + os.push_back (object {i, i, string (i, 'x')}); + + if (i == n / 2) + os.push_back (object {i, i, to_string (i)}); + } + + { + transaction t (cn->begin ()); + db->persist (os.begin (), os.end ()); + t.commit (); + } + + { + transaction t (cn->begin ()); + db->find (2); + t.commit (); + } + + for (unsigned long i (0); i != n; ++i) + { + //assert (os[i].id == i + 1); + os[i].idata++; + } + + { + transaction t (cn->begin ()); + db->update (os.begin (), os.end ()); + t.commit (); + } + + { + transaction t (cn->begin ()); + db->erase (os.begin (), os.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/bulk/makefile b/pgsql/bulk/makefile new file mode 100644 index 0000000..12f8dbb --- /dev/null +++ b/pgsql/bulk/makefile @@ -0,0 +1,107 @@ +# file : pgsql/savepoint/makefile +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +odb_hdr := test.hxx +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ +--generate-query --table-prefix pgsql_bulk_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/bulk/test.hxx b/pgsql/bulk/test.hxx new file mode 100644 index 0000000..25dd138 --- /dev/null +++ b/pgsql/bulk/test.hxx @@ -0,0 +1,34 @@ +// file : pgsql/savepoint/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object bulk(1000) +struct object +{ + /* + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + */ + + #pragma db id //auto + unsigned long id; + + unsigned long idata; + + //#pragma db + std::string sdata; +}; + +#endif // TEST_HXX diff --git a/pgsql/bulk/test.std b/pgsql/bulk/test.std new file mode 100644 index 0000000..e69de29 diff --git a/pgsql/savepoint/driver.cxx b/pgsql/savepoint/driver.cxx new file mode 100644 index 0000000..7ac3df0 --- /dev/null +++ b/pgsql/savepoint/driver.cxx @@ -0,0 +1,58 @@ +// file : pgsql/savepoint/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transaction savepoints. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + { + object o1 (1); + object o2 (2); + + transaction t (db->begin ()); + db->persist (o1); + + /* + try + { + db->persist (o1); + assert (false); + } + catch (const odb::object_already_persistent&) + { + } + */ + + //db->persist (o2); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/pgsql/savepoint/makefile b/pgsql/savepoint/makefile new file mode 100644 index 0000000..f2046f8 --- /dev/null +++ b/pgsql/savepoint/makefile @@ -0,0 +1,107 @@ +# file : pgsql/savepoint/makefile +# license : GNU GPL v2; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make + +cxx_tun := driver.cxx +odb_hdr := test.hxx +genf := $(call odb-gen,$(odb_hdr)) +gen := $(addprefix $(out_base)/,$(genf)) +cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) +cxx_od := $(cxx_obj:.o=.o.d) + +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options + +# Import. +# +$(call import,\ + $(scf_root)/import/odb/stub.make,\ + odb: odb,odb-rules: odb_rules) + +# Build. +# +$(driver): $(cxx_obj) $(common.l) +$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) +$(cxx_obj) $(cxx_od): $(common.l.cpp-options) + +$(gen): $(odb) +$(gen): odb := $(odb) +$(gen) $(dist): export odb_options += --database pgsql --default-database \ +common --generate-schema --generate-query --table-prefix pgsql_savepoint_ +$(gen): cpp_options := -I$(src_base) +$(gen): $(common.l.cpp-options) + +$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) + +# Alias for default target. +# +$(out_base)/: $(driver) + +# Dist +# +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) +$(dist): export extra_dist := $(data_dist) \ +$(name)-vc8.vcproj $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ +$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ +$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters +$(dist): + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) + $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) + $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) + +# Test. +# +$(eval $(call test-rule)) + +# Clean. +# +$(clean): \ + $(driver).o.clean \ + $(addsuffix .cxx.clean,$(cxx_obj)) \ + $(addsuffix .cxx.clean,$(cxx_od)) \ + $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) + $(call message,,rm -f $(out_base)/test.out) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# How to. +# +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/vc8proj.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/vc11proj.make) +$(call include,$(bld_root)/meta/vc12proj.make) +$(call include,$(bld_root)/meta/automake.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): odb_options += --std $(cxx_standard) +$(call include,$(odb_rules)) +endif + +$(call include,$(bld_root)/cxx/cxx-d.make) +$(call include,$(bld_root)/cxx/cxx-o.make) +$(call include,$(bld_root)/cxx/o-e.make) + +# Dependencies. +# +$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/savepoint/test.hxx b/pgsql/savepoint/test.hxx new file mode 100644 index 0000000..7e01992 --- /dev/null +++ b/pgsql/savepoint/test.hxx @@ -0,0 +1,27 @@ +// file : pgsql/savepoint/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object bulk(100) +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/pgsql/savepoint/test.std b/pgsql/savepoint/test.std new file mode 100644 index 0000000..e69de29 diff --git a/version b/version index 6d2beda..0a10d59 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.22 +2.5.0-b.23 -- cgit v1.1 From a5151123e9ae116e6f296598597dd6519446181a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 29 Jul 2022 09:50:27 +0200 Subject: Change version to 2.5.0-b.24.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 0a10d59..cd2d927 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.23 +2.5.0-b.24 -- cgit v1.1 From db4a8d32e9ae50711da5670ee3e1e1b166d758e9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 30 Jun 2023 13:05:40 +0200 Subject: Release version 2.5.0-b.25 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index cd2d927..2636902 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.24 +2.5.0-b.25 -- cgit v1.1 From 3ad368f7fc5f389d55943515a13431b857eecffe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 5 Jul 2023 10:10:48 +0200 Subject: Change version to 2.5.0-b.26.z --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 2636902..6bc2f39 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.5.0-b.25 +2.5.0-b.26 -- cgit v1.1 From 02367faedb16b6186e8852de47e5b749dc48c2df Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 14 Dec 2023 18:48:55 +0300 Subject: Update copyright --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index d106b92..9d92da1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2020 Code Synthesis Tools CC. +Copyright (c) 2009-2024 Code Synthesis Tools CC. 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 -- cgit v1.1 From fc3fb39c90ab7fe5fccbe3f3bc0eb2645157bb96 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Dec 2023 21:57:53 +0300 Subject: Switch to build2 --- .gitignore | 46 +- INSTALL | 215 --------- INSTALL-GIT | 78 ---- Makefile.am | 35 -- README | 18 - README.md | 4 + boost/Makefile.am | 26 -- boost/build.bat | 116 ----- boost/common/Makefile.am | 5 - boost/common/makefile | 54 --- boost/common/multi-index/makefile | 127 ------ boost/common/multi-index/test.std | 0 boost/common/optional/makefile | 127 ------ boost/common/optional/test.std | 0 boost/common/smart-ptr/makefile | 127 ------ boost/common/smart-ptr/test.std | 0 boost/common/template/Makefile.am | 31 -- boost/common/template/makefile | 127 ------ boost/common/template/test.std | 0 boost/common/test.bat | 79 ---- boost/common/unordered/makefile | 127 ------ boost/common/unordered/test.std | 0 boost/common/uuid/makefile | 127 ------ boost/common/uuid/test.std | 0 boost/makefile | 38 -- boost/mssql/Makefile.am | 5 - boost/mssql/date-time/makefile | 122 ----- boost/mssql/date-time/test.std | 0 boost/mssql/makefile | 36 -- boost/mssql/template/Makefile.am | 34 -- boost/mssql/template/makefile | 117 ----- boost/mssql/template/test.std | 0 boost/mssql/test.bat | 68 --- boost/mysql/Makefile.am | 5 - boost/mysql/date-time/makefile | 121 ----- boost/mysql/date-time/test.std | 0 boost/mysql/makefile | 36 -- boost/mysql/template/Makefile.am | 34 -- boost/mysql/template/makefile | 117 ----- boost/mysql/template/test.std | 0 boost/mysql/test.bat | 68 --- boost/oracle/Makefile.am | 5 - boost/oracle/date-time/makefile | 122 ----- boost/oracle/date-time/test.std | 0 boost/oracle/makefile | 36 -- boost/oracle/template/Makefile.am | 34 -- boost/oracle/template/makefile | 117 ----- boost/oracle/template/test.std | 0 boost/oracle/test.bat | 68 --- boost/pgsql/Makefile.am | 5 - boost/pgsql/date-time/makefile | 121 ----- boost/pgsql/date-time/test.std | 0 boost/pgsql/makefile | 36 -- boost/pgsql/template/Makefile.am | 34 -- boost/pgsql/template/makefile | 121 ----- boost/pgsql/template/test.std | 0 boost/pgsql/test.bat | 68 --- boost/sqlite/Makefile.am | 5 - boost/sqlite/date-time/makefile | 121 ----- boost/sqlite/date-time/test.std | 0 boost/sqlite/makefile | 36 -- boost/sqlite/template/Makefile.am | 34 -- boost/sqlite/template/makefile | 121 ----- boost/sqlite/template/test.std | 0 boost/sqlite/test.bat | 68 --- bootstrap | 16 - build.bat | 128 ------ build/.gitignore | 3 + build/bootstrap.build | 9 + build/bootstrap.make | 277 ------------ build/configuration-rules.make | 18 - build/configuration.make | 20 - build/configure | 45 -- build/export.build | 9 + build/import/libboost/configuration-rules.make | 13 - build/import/libboost/configure | 72 --- build/import/libboost/date-time/rules.make | 49 -- build/import/libboost/date-time/stub.make | 34 -- build/import/libboost/header-only/rules.make | 16 - build/import/libboost/header-only/stub.make | 26 -- build/import/libboost/version | 1 - build/import/libodb-boost/configuration-rules.make | 13 - build/import/libodb-boost/configure | 53 --- build/import/libodb-boost/stub.make | 28 -- build/import/libodb-mssql/configuration-rules.make | 13 - build/import/libodb-mssql/configure | 53 --- build/import/libodb-mssql/stub.make | 28 -- build/import/libodb-mysql/configuration-rules.make | 13 - build/import/libodb-mysql/configure | 53 --- build/import/libodb-mysql/stub.make | 28 -- .../import/libodb-oracle/configuration-rules.make | 13 - build/import/libodb-oracle/configure | 53 --- build/import/libodb-oracle/stub.make | 28 -- build/import/libodb-pgsql/configuration-rules.make | 13 - build/import/libodb-pgsql/configure | 53 --- build/import/libodb-pgsql/stub.make | 28 -- build/import/libodb-qt/configuration-rules.make | 13 - build/import/libodb-qt/configure | 53 --- build/import/libodb-qt/stub.make | 28 -- .../import/libodb-sqlite/configuration-rules.make | 13 - build/import/libodb-sqlite/configure | 53 --- build/import/libodb-sqlite/stub.make | 28 -- build/import/libodb/configuration-rules.make | 13 - build/import/libodb/configure | 53 --- build/import/libodb/stub.make | 28 -- build/import/libqt/configuration-rules.make | 13 - build/import/libqt/configure | 97 ---- build/import/libqt/core/rules.make | 26 -- build/import/libqt/core/stub.make | 35 -- build/import/libqt/version | 1 - build/import/odb/configuration-rules.make | 13 - build/import/odb/configure | 53 --- build/import/odb/hxx-cxx.make | 127 ------ build/import/odb/stub.make | 28 -- build/mssql/configure | 52 --- build/mssql/mssql | 51 --- build/mysql/configure | 75 --- build/mysql/mysql | 57 --- build/oracle/configure | 97 ---- build/oracle/oracle | 80 ---- build/pgsql/configure | 63 --- build/pgsql/pgsql | 53 --- build/root.build | 270 +++++++++++ build/sqlite/configure | 20 - buildfile | 10 + common/Makefile.am | 14 - common/access/buildfile | 45 ++ common/access/driver.cxx | 28 +- common/access/makefile | 118 ----- common/access/test.hxx | 18 +- common/access/test.std | 0 common/access/testscript | 33 ++ common/as/buildfile | 49 ++ common/as/driver.cxx | 50 +- common/as/makefile | 117 ----- common/as/test.std | 0 common/as/testscript | 33 ++ common/blob/buildfile | 40 ++ common/blob/driver.cxx | 16 +- common/blob/makefile | 116 ----- common/blob/test.hxx | 11 +- common/blob/test.std | 0 common/blob/testscript | 33 ++ common/buildfile | 6 + common/bulk/buildfile | 49 ++ common/bulk/driver.cxx | 88 ++-- common/bulk/makefile | 117 ----- common/bulk/test-mssql.std | 226 --------- common/bulk/test-mysql.std | 0 common/bulk/test-oracle.std | 226 --------- common/bulk/test-pgsql-enabled.std | 217 --------- common/bulk/test-pgsql.std | 0 common/bulk/test-sqlite.std | 0 common/bulk/test.hxx | 30 +- common/bulk/testscript | 503 +++++++++++++++++++++ common/callback/buildfile | 41 ++ common/callback/driver.cxx | 22 +- common/callback/makefile | 117 ----- common/callback/test.std | 62 --- common/callback/testscript | 100 ++++ common/changelog/.gitignore | 3 + common/changelog/buildfile | 30 ++ common/changelog/makefile | 101 ----- common/changelog/testscript | 66 +++ common/circular/multiple/.gitignore | 6 + common/circular/multiple/buildfile | 49 ++ common/circular/multiple/driver.cxx | 10 +- common/circular/multiple/makefile | 122 ----- common/circular/multiple/test.std | 0 common/circular/multiple/testscript | 31 ++ common/circular/single/buildfile | 41 ++ common/circular/single/driver.cxx | 10 +- common/circular/single/makefile | 117 ----- common/circular/single/test.std | 0 common/circular/single/testscript | 33 ++ common/composite/buildfile | 41 ++ common/composite/driver.cxx | 20 +- common/composite/makefile | 117 ----- common/composite/test.std | 0 common/composite/testscript | 33 ++ common/const-member/buildfile | 40 ++ common/const-member/driver.cxx | 16 +- common/const-member/makefile | 116 ----- common/const-member/test.hxx | 8 - common/const-member/test.std | 0 common/const-member/testscript | 33 ++ common/const-object/buildfile | 41 ++ common/const-object/driver.cxx | 28 +- common/const-object/makefile | 117 ----- common/const-object/test.hxx | 10 - common/const-object/test.std | 0 common/const-object/testscript | 33 ++ common/container/basics/buildfile | 40 ++ common/container/basics/driver.cxx | 34 +- common/container/basics/makefile | 117 ----- common/container/basics/test.hxx | 40 +- common/container/basics/test.std | 0 common/container/basics/testscript | 33 ++ common/container/change-tracking/buildfile | 40 ++ common/container/change-tracking/driver.cxx | 35 +- common/container/change-tracking/makefile | 117 ----- common/container/change-tracking/test.hxx | 15 +- common/container/change-tracking/test.std | 0 common/container/change-tracking/testscript | 33 ++ common/ctor/buildfile | 41 ++ common/ctor/driver.cxx | 10 +- common/ctor/makefile | 117 ----- common/ctor/test.std | 0 common/ctor/testscript | 33 ++ common/default/buildfile | 41 ++ common/default/driver.cxx | 12 +- common/default/makefile | 117 ----- common/default/test.std | 0 common/default/testscript | 33 ++ common/definition/.gitignore | 6 + common/definition/buildfile | 52 +++ common/definition/driver.cxx | 12 +- common/definition/makefile | 122 ----- common/definition/test.std | 0 common/definition/testscript | 33 ++ common/enum/buildfile | 41 ++ common/enum/driver.cxx | 16 +- common/enum/makefile | 117 ----- common/enum/test.hxx | 7 - common/enum/test.std | 0 common/enum/testscript | 33 ++ common/erase-query/buildfile | 41 ++ common/erase-query/driver.cxx | 10 +- common/erase-query/makefile | 117 ----- common/erase-query/test.std | 0 common/erase-query/testscript | 33 ++ common/id/auto/buildfile | 40 ++ common/id/auto/driver.cxx | 18 +- common/id/auto/makefile | 117 ----- common/id/auto/test.std | 0 common/id/auto/testscript | 33 ++ common/id/composite/buildfile | 42 ++ common/id/composite/driver.cxx | 62 +-- common/id/composite/makefile | 117 ----- common/id/composite/test.std | 0 common/id/composite/testscript | 33 ++ common/id/nested/buildfile | 41 ++ common/id/nested/driver.cxx | 50 +- common/id/nested/makefile | 117 ----- common/id/nested/test.std | 0 common/id/nested/testscript | 33 ++ common/include/.gitignore | 17 + common/include/buildfile | 51 +++ common/include/driver.cxx | 6 +- common/include/makefile | 83 ---- common/include/test.std | 0 common/include/testscript | 31 ++ common/index/buildfile | 40 ++ common/index/driver.cxx | 10 +- common/index/makefile | 116 ----- common/index/test.std | 0 common/index/testscript | 33 ++ common/inheritance/polymorphism/.gitignore | 76 ++++ common/inheritance/polymorphism/buildfile | 52 +++ common/inheritance/polymorphism/driver.cxx | 159 ++----- common/inheritance/polymorphism/makefile | 120 ----- common/inheritance/polymorphism/test.std | 36 -- common/inheritance/polymorphism/test5.hxx | 6 - common/inheritance/polymorphism/test6.hxx | 10 - common/inheritance/polymorphism/test7.hxx | 12 - common/inheritance/polymorphism/testscript | 80 ++++ common/inheritance/reuse/buildfile | 41 ++ common/inheritance/reuse/driver.cxx | 24 +- common/inheritance/reuse/makefile | 117 ----- common/inheritance/reuse/test.hxx | 2 +- common/inheritance/reuse/test.std | 0 common/inheritance/reuse/testscript | 33 ++ common/inheritance/transient/buildfile | 41 ++ common/inheritance/transient/driver.cxx | 12 +- common/inheritance/transient/makefile | 117 ----- common/inheritance/transient/test.std | 0 common/inheritance/transient/testscript | 33 ++ common/inverse/buildfile | 42 ++ common/inverse/driver.cxx | 28 +- common/inverse/makefile | 117 ----- common/inverse/test.hxx | 14 - common/inverse/test.std | 0 common/inverse/testscript | 33 ++ common/lazy-ptr/buildfile | 41 ++ common/lazy-ptr/driver.cxx | 52 +-- common/lazy-ptr/makefile | 117 ----- common/lazy-ptr/test.hxx | 27 +- common/lazy-ptr/test.std | 0 common/lazy-ptr/testscript | 33 ++ common/lifecycle/buildfile | 40 ++ common/lifecycle/driver.cxx | 30 +- common/lifecycle/makefile | 117 ----- common/lifecycle/test.std | 0 common/lifecycle/testscript | 33 ++ common/makefile | 123 ----- common/no-id/buildfile | 41 ++ common/no-id/driver.cxx | 10 +- common/no-id/makefile | 117 ----- common/no-id/test.std | 0 common/no-id/testscript | 33 ++ common/object/buildfile | 41 ++ common/object/driver.cxx | 14 +- common/object/makefile | 119 ----- common/object/test.std | 0 common/object/testscript | 33 ++ common/optimistic/buildfile | 41 ++ common/optimistic/driver.cxx | 18 +- common/optimistic/makefile | 117 ----- common/optimistic/test.std | 0 common/optimistic/testscript | 33 ++ common/pragma/buildfile | 39 ++ common/pragma/driver.cxx | 6 +- common/pragma/makefile | 116 ----- common/pragma/test.std | 0 common/pragma/testscript | 31 ++ common/prepared/buildfile | 43 ++ common/prepared/driver.cxx | 41 +- common/prepared/makefile | 117 ----- common/prepared/test.std | 0 common/prepared/testscript | 33 ++ common/query/array/buildfile | 43 ++ common/query/array/driver.cxx | 81 ++-- common/query/array/makefile | 117 ----- common/query/array/test.hxx | 12 +- common/query/array/test.std | 0 common/query/array/testscript | 33 ++ common/query/basics/buildfile | 42 ++ common/query/basics/driver.cxx | 28 +- common/query/basics/makefile | 117 ----- common/query/basics/test.hxx | 6 - common/query/basics/test.std | 112 ----- common/query/basics/testscript | 150 ++++++ common/query/one/buildfile | 42 ++ common/query/one/driver.cxx | 28 +- common/query/one/makefile | 117 ----- common/query/one/test.std | 0 common/query/one/testscript | 33 ++ common/readonly/buildfile | 40 ++ common/readonly/driver.cxx | 22 +- common/readonly/makefile | 117 ----- common/readonly/test.hxx | 11 +- common/readonly/test.std | 0 common/readonly/testscript | 33 ++ common/relationship/basics/buildfile | 41 ++ common/relationship/basics/driver.cxx | 24 +- common/relationship/basics/makefile | 117 ----- common/relationship/basics/test.hxx | 30 -- common/relationship/basics/test.std | 0 common/relationship/basics/testscript | 33 ++ common/relationship/on-delete/buildfile | 43 ++ common/relationship/on-delete/driver.cxx | 16 +- common/relationship/on-delete/makefile | 119 ----- common/relationship/on-delete/test.std | 0 common/relationship/on-delete/testscript | 33 ++ common/relationship/query/buildfile | 42 ++ common/relationship/query/driver.cxx | 16 +- common/relationship/query/makefile | 117 ----- common/relationship/query/test.hxx | 12 +- common/relationship/query/test.std | 0 common/relationship/query/testscript | 33 ++ common/schema/embedded/basics/buildfile | 42 ++ common/schema/embedded/basics/driver.cxx | 10 +- common/schema/embedded/basics/makefile | 117 ----- common/schema/embedded/basics/test.std | 0 common/schema/embedded/basics/testscript | 31 ++ common/schema/embedded/order/.gitignore | 6 + common/schema/embedded/order/buildfile | 48 ++ common/schema/embedded/order/driver.cxx | 10 +- common/schema/embedded/order/makefile | 122 ----- common/schema/embedded/order/test.std | 0 common/schema/embedded/order/testscript | 31 ++ common/schema/namespace/buildfile | 41 ++ common/schema/namespace/driver.cxx | 12 +- common/schema/namespace/makefile | 117 ----- common/schema/namespace/test.std | 0 common/schema/namespace/testscript | 33 ++ common/section/basics/buildfile | 41 ++ common/section/basics/driver.cxx | 126 +++--- common/section/basics/makefile | 117 ----- common/section/basics/test.std | 0 common/section/basics/testscript | 33 ++ common/section/polymorphism/buildfile | 41 ++ common/section/polymorphism/driver.cxx | 96 ++-- common/section/polymorphism/makefile | 117 ----- common/section/polymorphism/test.hxx | 4 - common/section/polymorphism/test.std | 0 common/section/polymorphism/testscript | 33 ++ common/session/cache/buildfile | 41 ++ common/session/cache/driver.cxx | 12 +- common/session/cache/makefile | 117 ----- common/session/cache/test.hxx | 15 - common/session/cache/test.std | 0 common/session/cache/testscript | 33 ++ common/session/custom/buildfile | 43 ++ common/session/custom/driver.cxx | 8 +- common/session/custom/makefile | 115 ----- common/session/custom/session.hxx | 9 + common/session/custom/test.std | 0 common/session/custom/testscript | 33 ++ common/statement/processing/buildfile | 8 + common/statement/processing/driver.cxx | 4 +- common/statement/processing/makefile | 87 ---- common/statement/processing/test.std | 0 common/statement/processing/testscript | 6 + common/template/Makefile.am | 39 -- common/template/driver.cxx | 39 -- common/template/makefile | 117 ----- common/template/template-vc10.vcxproj | 185 -------- common/template/template-vc10.vcxproj.filters | 28 -- common/template/template-vc11.vcxproj | 189 -------- common/template/template-vc11.vcxproj.filters | 28 -- common/template/template-vc12.vcxproj | 193 -------- common/template/template-vc12.vcxproj.filters | 28 -- common/template/template-vc8.vcproj | 357 --------------- common/template/template-vc9.vcproj | 364 --------------- common/template/test.hxx | 25 - common/template/test.std | 0 common/test.bat | 79 ---- common/threads/buildfile | 49 ++ common/threads/driver.cxx | 19 +- common/threads/makefile | 117 ----- common/threads/test.std | 0 common/threads/testscript | 50 ++ common/transaction/basics/buildfile | 13 + common/transaction/basics/driver.cxx | 13 +- common/transaction/basics/makefile | 87 ---- common/transaction/basics/test.std | 26 -- common/transaction/basics/testscript | 62 +++ common/transaction/callback/buildfile | 13 + common/transaction/callback/driver.cxx | 11 +- common/transaction/callback/makefile | 87 ---- common/transaction/callback/test.std | 36 -- common/transaction/callback/testscript | 72 +++ common/types/buildfile | 39 ++ common/types/driver.cxx | 6 +- common/types/makefile | 116 ----- common/types/test.std | 0 common/types/testscript | 6 + common/view/basics/buildfile | 42 ++ common/view/basics/driver.cxx | 42 +- common/view/basics/makefile | 117 ----- common/view/basics/test.hxx | 26 +- common/view/basics/test.std | 0 common/view/basics/testscript | 33 ++ common/view/olv/.gitignore | 46 ++ common/view/olv/buildfile | 50 ++ common/view/olv/driver.cxx | 36 +- common/view/olv/makefile | 114 ----- common/view/olv/test.std | 0 common/view/olv/testscript | 39 ++ common/virtual/buildfile | 42 ++ common/virtual/driver.cxx | 14 +- common/virtual/makefile | 117 ----- common/virtual/test.std | 0 common/virtual/testscript | 33 ++ common/wrapper/buildfile | 40 ++ common/wrapper/driver.cxx | 30 +- common/wrapper/makefile | 116 ----- common/wrapper/test.hxx | 35 +- common/wrapper/test.std | 0 common/wrapper/testscript | 33 ++ configure.ac | 115 ----- database-options.testscript | 75 +++ diagnostics/containers-of-containers.hxx | 68 --- evolution/Makefile.am | 5 - evolution/add-column/makefile | 145 ------ evolution/add-foreign-key/makefile | 146 ------ evolution/add-index/makefile | 145 ------ evolution/add-table/makefile | 145 ------ evolution/alter-column/makefile | 145 ------ evolution/combined/makefile | 145 ------ evolution/data/makefile | 142 ------ evolution/drop-column/makefile | 145 ------ evolution/drop-foreign-key/makefile | 146 ------ evolution/drop-index/makefile | 145 ------ evolution/drop-table/makefile | 145 ------ evolution/embedded/makefile | 134 ------ evolution/makefile | 64 --- evolution/soft-add/makefile | 145 ------ evolution/soft-delete/makefile | 145 ------ evolution/template/Makefile.am | 59 --- evolution/template/makefile | 145 ------ evolution/test.bat | 79 ---- evolution/tester.bat | 87 ---- evolution/tester.in | 42 -- evolution/version/makefile | 145 ------ libcommon/.gitignore | 3 + libcommon/Makefile.am | 5 - libcommon/buffer.hxx | 104 +++++ libcommon/buildfile | 50 ++ libcommon/common.cxx | 355 +++++++++++++++ libcommon/common.hxx | 47 ++ libcommon/common.txx | 24 + libcommon/common/Makefile.am | 11 - libcommon/common/buffer.hxx | 104 ----- libcommon/common/common.cxx | 360 --------------- libcommon/common/common.hxx | 53 --- libcommon/common/common.txx | 24 - libcommon/common/concrete.hxx | 57 --- libcommon/common/config-vc.h | 25 - libcommon/common/config.h.in | 19 - libcommon/common/config.hxx | 20 - libcommon/common/export.hxx | 35 -- libcommon/common/libcommon-vc10.vcxproj | 174 ------- libcommon/common/libcommon-vc10.vcxproj.filters | 19 - libcommon/common/libcommon-vc11.vcxproj | 178 -------- libcommon/common/libcommon-vc11.vcxproj.filters | 19 - libcommon/common/libcommon-vc12.vcxproj | 182 -------- libcommon/common/libcommon-vc12.vcxproj.filters | 19 - libcommon/common/libcommon-vc8.vcproj | 352 -------------- libcommon/common/libcommon-vc9.vcproj | 359 --------------- libcommon/common/makefile | 166 ------- libcommon/concrete.hxx | 57 +++ libcommon/config.hxx.in | 14 + libcommon/export.hxx | 39 ++ libcommon/makefile | 31 -- m4/acx-pthread.m4 | 259 ----------- m4/c++11.m4 | 37 -- m4/database.m4 | 59 --- m4/diff.m4 | 53 --- m4/libboost.m4 | 184 -------- m4/libodb-boost.m4 | 82 ---- m4/libodb-mssql.m4 | 82 ---- m4/libodb-mysql.m4 | 82 ---- m4/libodb-oracle.m4 | 82 ---- m4/libodb-pgsql.m4 | 82 ---- m4/libodb-qt.m4 | 82 ---- m4/libodb-sqlite.m4 | 82 ---- m4/libodb.m4 | 81 ---- m4/libqt.m4 | 121 ----- m4/libtool-link.m4 | 45 -- m4/mssql.m4 | 224 --------- m4/mysql.m4 | 270 ----------- m4/odb.m4 | 43 -- m4/oracle.m4 | 243 ---------- m4/pgsql.m4 | 204 --------- m4/sqlite.m4 | 59 --- m4/static-lib.m4 | 17 - m4/threads.m4 | 68 --- m4/tr1-memory.m4 | 38 -- makefile | 51 --- manifest | 48 ++ mssql-driver.bat | 61 --- mssql.options | 10 - mssql/Makefile.am | 5 - mssql/custom/makefile | 111 ----- mssql/custom/test.std | 0 mssql/database/makefile | 83 ---- mssql/database/test.std | 0 mssql/makefile | 41 -- mssql/native/makefile | 83 ---- mssql/native/test.std | 0 mssql/query/makefile | 108 ----- mssql/query/test.std | 0 mssql/stored-proc/makefile | 107 ----- mssql/stored-proc/test.std | 17 - mssql/template/Makefile.am | 34 -- mssql/template/makefile | 107 ----- mssql/template/test.std | 0 mssql/test.bat | 68 --- mssql/types/makefile | 109 ----- mssql/types/test.std | 0 mysql-driver.bat | 46 -- mysql-schema.testscript | 9 + mysql.options | 10 - mysql.testscript | 12 + mysql/Makefile.am | 5 - mysql/custom/buildfile | 37 ++ mysql/custom/driver.cxx | 14 +- mysql/custom/makefile | 110 ----- mysql/custom/query.hxx | 4 +- mysql/custom/test.hxx | 4 +- mysql/custom/test.std | 0 mysql/custom/testscript | 11 + mysql/custom/traits.hxx | 4 +- mysql/database/buildfile | 11 + mysql/database/driver.cxx | 3 + mysql/database/makefile | 83 ---- mysql/database/test.std | 0 mysql/database/testscript | 6 + mysql/index/buildfile | 34 ++ mysql/index/driver.cxx | 10 +- mysql/index/makefile | 107 ----- mysql/index/test.std | 0 mysql/index/testscript | 11 + mysql/makefile | 41 -- mysql/native/buildfile | 16 + mysql/native/driver.cxx | 10 +- mysql/native/makefile | 83 ---- mysql/native/test.std | 0 mysql/native/testscript | 9 + mysql/template/Makefile.am | 34 -- mysql/template/driver.cxx | 40 -- mysql/template/makefile | 107 ----- mysql/template/template-vc10.vcxproj | 180 -------- mysql/template/template-vc10.vcxproj.filters | 25 - mysql/template/template-vc11.vcxproj | 184 -------- mysql/template/template-vc11.vcxproj.filters | 25 - mysql/template/template-vc12.vcxproj | 188 -------- mysql/template/template-vc12.vcxproj.filters | 25 - mysql/template/template-vc8.vcproj | 354 --------------- mysql/template/template-vc9.vcproj | 361 --------------- mysql/template/test.hxx | 25 - mysql/template/test.std | 0 mysql/test.bat | 68 --- mysql/truncation/buildfile | 35 ++ mysql/truncation/driver.cxx | 20 +- mysql/truncation/makefile | 107 ----- mysql/truncation/test.std | 0 mysql/truncation/testscript | 11 + mysql/types/buildfile | 36 ++ mysql/types/driver.cxx | 18 +- mysql/types/makefile | 109 ----- mysql/types/test.hxx | 4 +- mysql/types/test.std | 0 mysql/types/testscript | 11 + oracle-driver.bat | 42 -- oracle.options | 9 - oracle/Makefile.am | 5 - oracle/custom/makefile | 110 ----- oracle/custom/test.std | 0 oracle/database/makefile | 83 ---- oracle/database/test.std | 0 oracle/makefile | 39 -- oracle/native/makefile | 83 ---- oracle/native/test.std | 0 oracle/template/Makefile.am | 34 -- oracle/template/makefile | 107 ----- oracle/template/test.std | 0 oracle/test.bat | 68 --- oracle/types/makefile | 109 ----- oracle/types/test.std | 0 pgsql-driver.bat | 50 -- pgsql-schema.testscript | 6 + pgsql.options | 10 - pgsql.testscript | 12 + pgsql/Makefile.am | 5 - pgsql/buildfile | 6 + pgsql/bulk/buildfile | 40 ++ pgsql/bulk/driver.cxx | 39 +- pgsql/bulk/makefile | 107 ----- pgsql/bulk/test.std | 0 pgsql/bulk/testscript | 18 + pgsql/custom/buildfile | 37 ++ pgsql/custom/driver.cxx | 14 +- pgsql/custom/makefile | 110 ----- pgsql/custom/test.std | 0 pgsql/custom/testscript | 11 + pgsql/database/buildfile | 11 + pgsql/database/driver.cxx | 3 + pgsql/database/makefile | 79 ---- pgsql/database/test.std | 0 pgsql/database/testscript | 6 + pgsql/index/buildfile | 34 ++ pgsql/index/driver.cxx | 10 +- pgsql/index/makefile | 107 ----- pgsql/index/test.std | 0 pgsql/index/testscript | 11 + pgsql/makefile | 41 -- pgsql/native/buildfile | 16 + pgsql/native/driver.cxx | 10 +- pgsql/native/makefile | 79 ---- pgsql/native/test.std | 0 pgsql/native/testscript | 9 + pgsql/savepoint/driver.cxx | 58 --- pgsql/savepoint/makefile | 107 ----- pgsql/savepoint/test.hxx | 27 -- pgsql/savepoint/test.std | 0 pgsql/template/Makefile.am | 34 -- pgsql/template/driver.cxx | 40 -- pgsql/template/makefile | 107 ----- pgsql/template/template-vc10.vcxproj | 180 -------- pgsql/template/template-vc10.vcxproj.filters | 25 - pgsql/template/template-vc11.vcxproj | 184 -------- pgsql/template/template-vc11.vcxproj.filters | 25 - pgsql/template/template-vc12.vcxproj | 188 -------- pgsql/template/template-vc12.vcxproj.filters | 25 - pgsql/template/template-vc8.vcproj | 354 --------------- pgsql/template/template-vc9.vcproj | 361 --------------- pgsql/template/test.hxx | 25 - pgsql/template/test.std | 0 pgsql/test.bat | 68 --- pgsql/truncation/buildfile | 35 ++ pgsql/truncation/driver.cxx | 16 +- pgsql/truncation/makefile | 107 ----- pgsql/truncation/test.std | 0 pgsql/truncation/testscript | 11 + pgsql/types/buildfile | 36 ++ pgsql/types/driver.cxx | 18 +- pgsql/types/makefile | 109 ----- pgsql/types/test.hxx | 6 +- pgsql/types/test.std | 0 pgsql/types/testscript | 11 + qt/Makefile.am | 26 -- qt/build.bat | 129 ------ qt/common/Makefile.am | 5 - qt/common/basic/makefile | 134 ------ qt/common/basic/test.std | 0 qt/common/containers/basics/makefile | 134 ------ qt/common/containers/basics/test.std | 0 qt/common/containers/change-tracking/makefile | 134 ------ qt/common/containers/change-tracking/test.std | 0 qt/common/makefile | 61 --- qt/common/smart-ptr/makefile | 134 ------ qt/common/smart-ptr/test.std | 0 qt/common/template/Makefile.am | 31 -- qt/common/template/makefile | 134 ------ qt/common/template/test.std | 0 qt/common/test.bat | 79 ---- qt/makefile | 38 -- qt/mssql/Makefile.am | 5 - qt/mssql/basic/makefile | 125 ----- qt/mssql/basic/test.std | 0 qt/mssql/date-time/makefile | 125 ----- qt/mssql/date-time/test.std | 0 qt/mssql/makefile | 46 -- qt/mssql/template/Makefile.am | 34 -- qt/mssql/template/makefile | 119 ----- qt/mssql/template/test.std | 0 qt/mssql/test.bat | 68 --- qt/mysql/Makefile.am | 5 - qt/mysql/basic/makefile | 125 ----- qt/mysql/basic/test.std | 0 qt/mysql/date-time/makefile | 125 ----- qt/mysql/date-time/test.std | 0 qt/mysql/makefile | 46 -- qt/mysql/template/Makefile.am | 34 -- qt/mysql/template/makefile | 119 ----- qt/mysql/template/test.std | 0 qt/mysql/test.bat | 68 --- qt/oracle/Makefile.am | 5 - qt/oracle/basic/makefile | 125 ----- qt/oracle/basic/test.std | 0 qt/oracle/date-time/makefile | 125 ----- qt/oracle/date-time/test.std | 0 qt/oracle/makefile | 46 -- qt/oracle/template/Makefile.am | 34 -- qt/oracle/template/makefile | 119 ----- qt/oracle/template/test.std | 0 qt/oracle/test.bat | 68 --- qt/pgsql/Makefile.am | 5 - qt/pgsql/basic/makefile | 125 ----- qt/pgsql/basic/test.std | 0 qt/pgsql/date-time/makefile | 125 ----- qt/pgsql/date-time/test.std | 0 qt/pgsql/makefile | 46 -- qt/pgsql/template/Makefile.am | 34 -- qt/pgsql/template/makefile | 119 ----- qt/pgsql/template/test.std | 0 qt/pgsql/test.bat | 68 --- qt/sqlite/Makefile.am | 5 - qt/sqlite/basic/makefile | 125 ----- qt/sqlite/basic/test.std | 0 qt/sqlite/date-time/makefile | 125 ----- qt/sqlite/date-time/test.std | 0 qt/sqlite/makefile | 46 -- qt/sqlite/template/Makefile.am | 34 -- qt/sqlite/template/makefile | 119 ----- qt/sqlite/template/test.std | 0 qt/sqlite/test.bat | 68 --- repositories.manifest | 44 ++ sqlite-driver.bat | 2 - sqlite.options | 5 - sqlite.testscript | 10 + sqlite/Makefile.am | 5 - sqlite/attach/buildfile | 32 ++ sqlite/attach/driver.cxx | 16 +- sqlite/attach/makefile | 108 ----- sqlite/attach/test.std | 0 sqlite/attach/testscript | 9 + sqlite/auto/buildfile | 32 ++ sqlite/auto/driver.cxx | 16 +- sqlite/auto/makefile | 108 ----- sqlite/auto/test.std | 0 sqlite/auto/testscript | 9 + sqlite/custom/buildfile | 31 ++ sqlite/custom/driver.cxx | 14 +- sqlite/custom/makefile | 107 ----- sqlite/custom/test.std | 0 sqlite/custom/testscript | 9 + sqlite/database/buildfile | 11 + sqlite/database/driver.cxx | 5 +- sqlite/database/makefile | 83 ---- sqlite/database/test.std | 0 sqlite/database/testscript | 6 + sqlite/makefile | 44 -- sqlite/native/buildfile | 12 + sqlite/native/driver.cxx | 10 +- sqlite/native/makefile | 83 ---- sqlite/native/test.std | 0 sqlite/native/testscript | 9 + sqlite/stream/buildfile | 31 ++ sqlite/stream/driver.cxx | 14 +- sqlite/stream/makefile | 107 ----- sqlite/stream/test.std | 0 sqlite/stream/testscript | 9 + sqlite/template/Makefile.am | 34 -- sqlite/template/driver.cxx | 40 -- sqlite/template/makefile | 108 ----- sqlite/template/template-vc10.vcxproj | 180 -------- sqlite/template/template-vc10.vcxproj.filters | 25 - sqlite/template/template-vc11.vcxproj | 184 -------- sqlite/template/template-vc11.vcxproj.filters | 25 - sqlite/template/template-vc12.vcxproj | 188 -------- sqlite/template/template-vc12.vcxproj.filters | 25 - sqlite/template/template-vc8.vcproj | 354 --------------- sqlite/template/template-vc9.vcproj | 361 --------------- sqlite/template/test.hxx | 25 - sqlite/template/test.std | 0 sqlite/test.bat | 68 --- sqlite/transaction/buildfile | 30 ++ sqlite/transaction/driver.cxx | 10 +- sqlite/transaction/makefile | 107 ----- sqlite/transaction/test.std | 0 sqlite/transaction/testscript | 9 + sqlite/truncation/buildfile | 31 ++ sqlite/truncation/driver.cxx | 16 +- sqlite/truncation/makefile | 107 ----- sqlite/truncation/test.std | 0 sqlite/truncation/testscript | 9 + sqlite/types/buildfile | 32 ++ sqlite/types/driver.cxx | 18 +- sqlite/types/makefile | 109 ----- sqlite/types/test.hxx | 4 +- sqlite/types/test.std | 0 sqlite/types/testscript | 9 + template-vc10.sln | 15 - template-vc11.sln | 15 - template-vc12.sln | 17 - template-vc8.sln | 15 - template-vc9.sln | 15 - test.bat | 66 --- tester.bat | 73 --- tester.in | 51 --- version | 1 - 835 files changed, 8225 insertions(+), 37138 deletions(-) delete mode 100644 INSTALL delete mode 100644 INSTALL-GIT delete mode 100644 Makefile.am delete mode 100644 README create mode 100644 README.md delete mode 100644 boost/Makefile.am delete mode 100644 boost/build.bat delete mode 100644 boost/common/Makefile.am delete mode 100644 boost/common/makefile delete mode 100644 boost/common/multi-index/makefile delete mode 100644 boost/common/multi-index/test.std delete mode 100644 boost/common/optional/makefile delete mode 100644 boost/common/optional/test.std delete mode 100644 boost/common/smart-ptr/makefile delete mode 100644 boost/common/smart-ptr/test.std delete mode 100644 boost/common/template/Makefile.am delete mode 100644 boost/common/template/makefile delete mode 100644 boost/common/template/test.std delete mode 100644 boost/common/test.bat delete mode 100644 boost/common/unordered/makefile delete mode 100644 boost/common/unordered/test.std delete mode 100644 boost/common/uuid/makefile delete mode 100644 boost/common/uuid/test.std delete mode 100644 boost/makefile delete mode 100644 boost/mssql/Makefile.am delete mode 100644 boost/mssql/date-time/makefile delete mode 100644 boost/mssql/date-time/test.std delete mode 100644 boost/mssql/makefile delete mode 100644 boost/mssql/template/Makefile.am delete mode 100644 boost/mssql/template/makefile delete mode 100644 boost/mssql/template/test.std delete mode 100644 boost/mssql/test.bat delete mode 100644 boost/mysql/Makefile.am delete mode 100644 boost/mysql/date-time/makefile delete mode 100644 boost/mysql/date-time/test.std delete mode 100644 boost/mysql/makefile delete mode 100644 boost/mysql/template/Makefile.am delete mode 100644 boost/mysql/template/makefile delete mode 100644 boost/mysql/template/test.std delete mode 100644 boost/mysql/test.bat delete mode 100644 boost/oracle/Makefile.am delete mode 100644 boost/oracle/date-time/makefile delete mode 100644 boost/oracle/date-time/test.std delete mode 100644 boost/oracle/makefile delete mode 100644 boost/oracle/template/Makefile.am delete mode 100644 boost/oracle/template/makefile delete mode 100644 boost/oracle/template/test.std delete mode 100644 boost/oracle/test.bat delete mode 100644 boost/pgsql/Makefile.am delete mode 100644 boost/pgsql/date-time/makefile delete mode 100644 boost/pgsql/date-time/test.std delete mode 100644 boost/pgsql/makefile delete mode 100644 boost/pgsql/template/Makefile.am delete mode 100644 boost/pgsql/template/makefile delete mode 100644 boost/pgsql/template/test.std delete mode 100644 boost/pgsql/test.bat delete mode 100644 boost/sqlite/Makefile.am delete mode 100644 boost/sqlite/date-time/makefile delete mode 100644 boost/sqlite/date-time/test.std delete mode 100644 boost/sqlite/makefile delete mode 100644 boost/sqlite/template/Makefile.am delete mode 100644 boost/sqlite/template/makefile delete mode 100644 boost/sqlite/template/test.std delete mode 100644 boost/sqlite/test.bat delete mode 100755 bootstrap delete mode 100644 build.bat create mode 100644 build/.gitignore create mode 100644 build/bootstrap.build delete mode 100644 build/bootstrap.make delete mode 100644 build/configuration-rules.make delete mode 100644 build/configuration.make delete mode 100755 build/configure create mode 100644 build/export.build delete mode 100644 build/import/libboost/configuration-rules.make delete mode 100755 build/import/libboost/configure delete mode 100644 build/import/libboost/date-time/rules.make delete mode 100644 build/import/libboost/date-time/stub.make delete mode 100644 build/import/libboost/header-only/rules.make delete mode 100644 build/import/libboost/header-only/stub.make delete mode 100644 build/import/libboost/version delete mode 100644 build/import/libodb-boost/configuration-rules.make delete mode 100755 build/import/libodb-boost/configure delete mode 100644 build/import/libodb-boost/stub.make delete mode 100644 build/import/libodb-mssql/configuration-rules.make delete mode 100755 build/import/libodb-mssql/configure delete mode 100644 build/import/libodb-mssql/stub.make delete mode 100644 build/import/libodb-mysql/configuration-rules.make delete mode 100755 build/import/libodb-mysql/configure delete mode 100644 build/import/libodb-mysql/stub.make delete mode 100644 build/import/libodb-oracle/configuration-rules.make delete mode 100755 build/import/libodb-oracle/configure delete mode 100644 build/import/libodb-oracle/stub.make delete mode 100644 build/import/libodb-pgsql/configuration-rules.make delete mode 100755 build/import/libodb-pgsql/configure delete mode 100644 build/import/libodb-pgsql/stub.make delete mode 100644 build/import/libodb-qt/configuration-rules.make delete mode 100755 build/import/libodb-qt/configure delete mode 100644 build/import/libodb-qt/stub.make delete mode 100644 build/import/libodb-sqlite/configuration-rules.make delete mode 100755 build/import/libodb-sqlite/configure delete mode 100644 build/import/libodb-sqlite/stub.make delete mode 100644 build/import/libodb/configuration-rules.make delete mode 100755 build/import/libodb/configure delete mode 100644 build/import/libodb/stub.make delete mode 100644 build/import/libqt/configuration-rules.make delete mode 100755 build/import/libqt/configure delete mode 100644 build/import/libqt/core/rules.make delete mode 100644 build/import/libqt/core/stub.make delete mode 100644 build/import/libqt/version delete mode 100644 build/import/odb/configuration-rules.make delete mode 100755 build/import/odb/configure delete mode 100644 build/import/odb/hxx-cxx.make delete mode 100644 build/import/odb/stub.make delete mode 100755 build/mssql/configure delete mode 100755 build/mssql/mssql delete mode 100755 build/mysql/configure delete mode 100755 build/mysql/mysql delete mode 100755 build/oracle/configure delete mode 100755 build/oracle/oracle delete mode 100755 build/pgsql/configure delete mode 100755 build/pgsql/pgsql create mode 100644 build/root.build delete mode 100755 build/sqlite/configure create mode 100644 buildfile delete mode 100644 common/Makefile.am create mode 100644 common/access/buildfile delete mode 100644 common/access/makefile delete mode 100644 common/access/test.std create mode 100644 common/access/testscript create mode 100644 common/as/buildfile delete mode 100644 common/as/makefile delete mode 100644 common/as/test.std create mode 100644 common/as/testscript create mode 100644 common/blob/buildfile delete mode 100644 common/blob/makefile delete mode 100644 common/blob/test.std create mode 100644 common/blob/testscript create mode 100644 common/buildfile create mode 100644 common/bulk/buildfile delete mode 100644 common/bulk/makefile delete mode 100644 common/bulk/test-mssql.std delete mode 100644 common/bulk/test-mysql.std delete mode 100644 common/bulk/test-oracle.std delete mode 100644 common/bulk/test-pgsql-enabled.std delete mode 100644 common/bulk/test-pgsql.std delete mode 100644 common/bulk/test-sqlite.std create mode 100644 common/bulk/testscript create mode 100644 common/callback/buildfile delete mode 100644 common/callback/makefile delete mode 100644 common/callback/test.std create mode 100644 common/callback/testscript create mode 100644 common/changelog/.gitignore create mode 100644 common/changelog/buildfile delete mode 100644 common/changelog/makefile create mode 100644 common/changelog/testscript create mode 100644 common/circular/multiple/.gitignore create mode 100644 common/circular/multiple/buildfile delete mode 100644 common/circular/multiple/makefile delete mode 100644 common/circular/multiple/test.std create mode 100644 common/circular/multiple/testscript create mode 100644 common/circular/single/buildfile delete mode 100644 common/circular/single/makefile delete mode 100644 common/circular/single/test.std create mode 100644 common/circular/single/testscript create mode 100644 common/composite/buildfile delete mode 100644 common/composite/makefile delete mode 100644 common/composite/test.std create mode 100644 common/composite/testscript create mode 100644 common/const-member/buildfile delete mode 100644 common/const-member/makefile delete mode 100644 common/const-member/test.std create mode 100644 common/const-member/testscript create mode 100644 common/const-object/buildfile delete mode 100644 common/const-object/makefile delete mode 100644 common/const-object/test.std create mode 100644 common/const-object/testscript create mode 100644 common/container/basics/buildfile delete mode 100644 common/container/basics/makefile delete mode 100644 common/container/basics/test.std create mode 100644 common/container/basics/testscript create mode 100644 common/container/change-tracking/buildfile delete mode 100644 common/container/change-tracking/makefile delete mode 100644 common/container/change-tracking/test.std create mode 100644 common/container/change-tracking/testscript create mode 100644 common/ctor/buildfile delete mode 100644 common/ctor/makefile delete mode 100644 common/ctor/test.std create mode 100644 common/ctor/testscript create mode 100644 common/default/buildfile delete mode 100644 common/default/makefile delete mode 100644 common/default/test.std create mode 100644 common/default/testscript create mode 100644 common/definition/.gitignore create mode 100644 common/definition/buildfile delete mode 100644 common/definition/makefile delete mode 100644 common/definition/test.std create mode 100644 common/definition/testscript create mode 100644 common/enum/buildfile delete mode 100644 common/enum/makefile delete mode 100644 common/enum/test.std create mode 100644 common/enum/testscript create mode 100644 common/erase-query/buildfile delete mode 100644 common/erase-query/makefile delete mode 100644 common/erase-query/test.std create mode 100644 common/erase-query/testscript create mode 100644 common/id/auto/buildfile delete mode 100644 common/id/auto/makefile delete mode 100644 common/id/auto/test.std create mode 100644 common/id/auto/testscript create mode 100644 common/id/composite/buildfile delete mode 100644 common/id/composite/makefile delete mode 100644 common/id/composite/test.std create mode 100644 common/id/composite/testscript create mode 100644 common/id/nested/buildfile delete mode 100644 common/id/nested/makefile delete mode 100644 common/id/nested/test.std create mode 100644 common/id/nested/testscript create mode 100644 common/include/.gitignore create mode 100644 common/include/buildfile delete mode 100644 common/include/makefile delete mode 100644 common/include/test.std create mode 100644 common/include/testscript create mode 100644 common/index/buildfile delete mode 100644 common/index/makefile delete mode 100644 common/index/test.std create mode 100644 common/index/testscript create mode 100644 common/inheritance/polymorphism/.gitignore create mode 100644 common/inheritance/polymorphism/buildfile delete mode 100644 common/inheritance/polymorphism/makefile delete mode 100644 common/inheritance/polymorphism/test.std create mode 100644 common/inheritance/polymorphism/testscript create mode 100644 common/inheritance/reuse/buildfile delete mode 100644 common/inheritance/reuse/makefile delete mode 100644 common/inheritance/reuse/test.std create mode 100644 common/inheritance/reuse/testscript create mode 100644 common/inheritance/transient/buildfile delete mode 100644 common/inheritance/transient/makefile delete mode 100644 common/inheritance/transient/test.std create mode 100644 common/inheritance/transient/testscript create mode 100644 common/inverse/buildfile delete mode 100644 common/inverse/makefile delete mode 100644 common/inverse/test.std create mode 100644 common/inverse/testscript create mode 100644 common/lazy-ptr/buildfile delete mode 100644 common/lazy-ptr/makefile delete mode 100644 common/lazy-ptr/test.std create mode 100644 common/lazy-ptr/testscript create mode 100644 common/lifecycle/buildfile delete mode 100644 common/lifecycle/makefile delete mode 100644 common/lifecycle/test.std create mode 100644 common/lifecycle/testscript delete mode 100644 common/makefile create mode 100644 common/no-id/buildfile delete mode 100644 common/no-id/makefile delete mode 100644 common/no-id/test.std create mode 100644 common/no-id/testscript create mode 100644 common/object/buildfile delete mode 100644 common/object/makefile delete mode 100644 common/object/test.std create mode 100644 common/object/testscript create mode 100644 common/optimistic/buildfile delete mode 100644 common/optimistic/makefile delete mode 100644 common/optimistic/test.std create mode 100644 common/optimistic/testscript create mode 100644 common/pragma/buildfile delete mode 100644 common/pragma/makefile delete mode 100644 common/pragma/test.std create mode 100644 common/pragma/testscript create mode 100644 common/prepared/buildfile delete mode 100644 common/prepared/makefile delete mode 100644 common/prepared/test.std create mode 100644 common/prepared/testscript create mode 100644 common/query/array/buildfile delete mode 100644 common/query/array/makefile delete mode 100644 common/query/array/test.std create mode 100644 common/query/array/testscript create mode 100644 common/query/basics/buildfile delete mode 100644 common/query/basics/makefile delete mode 100644 common/query/basics/test.std create mode 100644 common/query/basics/testscript create mode 100644 common/query/one/buildfile delete mode 100644 common/query/one/makefile delete mode 100644 common/query/one/test.std create mode 100644 common/query/one/testscript create mode 100644 common/readonly/buildfile delete mode 100644 common/readonly/makefile delete mode 100644 common/readonly/test.std create mode 100644 common/readonly/testscript create mode 100644 common/relationship/basics/buildfile delete mode 100644 common/relationship/basics/makefile delete mode 100644 common/relationship/basics/test.std create mode 100644 common/relationship/basics/testscript create mode 100644 common/relationship/on-delete/buildfile delete mode 100644 common/relationship/on-delete/makefile delete mode 100644 common/relationship/on-delete/test.std create mode 100644 common/relationship/on-delete/testscript create mode 100644 common/relationship/query/buildfile delete mode 100644 common/relationship/query/makefile delete mode 100644 common/relationship/query/test.std create mode 100644 common/relationship/query/testscript create mode 100644 common/schema/embedded/basics/buildfile delete mode 100644 common/schema/embedded/basics/makefile delete mode 100644 common/schema/embedded/basics/test.std create mode 100644 common/schema/embedded/basics/testscript create mode 100644 common/schema/embedded/order/.gitignore create mode 100644 common/schema/embedded/order/buildfile delete mode 100644 common/schema/embedded/order/makefile delete mode 100644 common/schema/embedded/order/test.std create mode 100644 common/schema/embedded/order/testscript create mode 100644 common/schema/namespace/buildfile delete mode 100644 common/schema/namespace/makefile delete mode 100644 common/schema/namespace/test.std create mode 100644 common/schema/namespace/testscript create mode 100644 common/section/basics/buildfile delete mode 100644 common/section/basics/makefile delete mode 100644 common/section/basics/test.std create mode 100644 common/section/basics/testscript create mode 100644 common/section/polymorphism/buildfile delete mode 100644 common/section/polymorphism/makefile delete mode 100644 common/section/polymorphism/test.std create mode 100644 common/section/polymorphism/testscript create mode 100644 common/session/cache/buildfile delete mode 100644 common/session/cache/makefile delete mode 100644 common/session/cache/test.std create mode 100644 common/session/cache/testscript create mode 100644 common/session/custom/buildfile delete mode 100644 common/session/custom/makefile delete mode 100644 common/session/custom/test.std create mode 100644 common/session/custom/testscript create mode 100644 common/statement/processing/buildfile delete mode 100644 common/statement/processing/makefile delete mode 100644 common/statement/processing/test.std create mode 100644 common/statement/processing/testscript delete mode 100644 common/template/Makefile.am delete mode 100644 common/template/driver.cxx delete mode 100644 common/template/makefile delete mode 100644 common/template/template-vc10.vcxproj delete mode 100644 common/template/template-vc10.vcxproj.filters delete mode 100644 common/template/template-vc11.vcxproj delete mode 100644 common/template/template-vc11.vcxproj.filters delete mode 100644 common/template/template-vc12.vcxproj delete mode 100644 common/template/template-vc12.vcxproj.filters delete mode 100644 common/template/template-vc8.vcproj delete mode 100644 common/template/template-vc9.vcproj delete mode 100644 common/template/test.hxx delete mode 100644 common/template/test.std delete mode 100644 common/test.bat create mode 100644 common/threads/buildfile delete mode 100644 common/threads/makefile delete mode 100644 common/threads/test.std create mode 100644 common/threads/testscript create mode 100644 common/transaction/basics/buildfile delete mode 100644 common/transaction/basics/makefile delete mode 100644 common/transaction/basics/test.std create mode 100644 common/transaction/basics/testscript create mode 100644 common/transaction/callback/buildfile delete mode 100644 common/transaction/callback/makefile delete mode 100644 common/transaction/callback/test.std create mode 100644 common/transaction/callback/testscript create mode 100644 common/types/buildfile delete mode 100644 common/types/makefile delete mode 100644 common/types/test.std create mode 100644 common/types/testscript create mode 100644 common/view/basics/buildfile delete mode 100644 common/view/basics/makefile delete mode 100644 common/view/basics/test.std create mode 100644 common/view/basics/testscript create mode 100644 common/view/olv/.gitignore create mode 100644 common/view/olv/buildfile delete mode 100644 common/view/olv/makefile delete mode 100644 common/view/olv/test.std create mode 100644 common/view/olv/testscript create mode 100644 common/virtual/buildfile delete mode 100644 common/virtual/makefile delete mode 100644 common/virtual/test.std create mode 100644 common/virtual/testscript create mode 100644 common/wrapper/buildfile delete mode 100644 common/wrapper/makefile delete mode 100644 common/wrapper/test.std create mode 100644 common/wrapper/testscript delete mode 100644 configure.ac create mode 100644 database-options.testscript delete mode 100644 diagnostics/containers-of-containers.hxx delete mode 100644 evolution/Makefile.am delete mode 100644 evolution/add-column/makefile delete mode 100644 evolution/add-foreign-key/makefile delete mode 100644 evolution/add-index/makefile delete mode 100644 evolution/add-table/makefile delete mode 100644 evolution/alter-column/makefile delete mode 100644 evolution/combined/makefile delete mode 100644 evolution/data/makefile delete mode 100644 evolution/drop-column/makefile delete mode 100644 evolution/drop-foreign-key/makefile delete mode 100644 evolution/drop-index/makefile delete mode 100644 evolution/drop-table/makefile delete mode 100644 evolution/embedded/makefile delete mode 100644 evolution/makefile delete mode 100644 evolution/soft-add/makefile delete mode 100644 evolution/soft-delete/makefile delete mode 100644 evolution/template/Makefile.am delete mode 100644 evolution/template/makefile delete mode 100644 evolution/test.bat delete mode 100644 evolution/tester.bat delete mode 100755 evolution/tester.in delete mode 100644 evolution/version/makefile create mode 100644 libcommon/.gitignore delete mode 100644 libcommon/Makefile.am create mode 100644 libcommon/buffer.hxx create mode 100644 libcommon/buildfile create mode 100644 libcommon/common.cxx create mode 100644 libcommon/common.hxx create mode 100644 libcommon/common.txx delete mode 100644 libcommon/common/Makefile.am delete mode 100644 libcommon/common/buffer.hxx delete mode 100644 libcommon/common/common.cxx delete mode 100644 libcommon/common/common.hxx delete mode 100644 libcommon/common/common.txx delete mode 100644 libcommon/common/concrete.hxx delete mode 100644 libcommon/common/config-vc.h delete mode 100644 libcommon/common/config.h.in delete mode 100644 libcommon/common/config.hxx delete mode 100644 libcommon/common/export.hxx delete mode 100644 libcommon/common/libcommon-vc10.vcxproj delete mode 100644 libcommon/common/libcommon-vc10.vcxproj.filters delete mode 100644 libcommon/common/libcommon-vc11.vcxproj delete mode 100644 libcommon/common/libcommon-vc11.vcxproj.filters delete mode 100644 libcommon/common/libcommon-vc12.vcxproj delete mode 100644 libcommon/common/libcommon-vc12.vcxproj.filters delete mode 100644 libcommon/common/libcommon-vc8.vcproj delete mode 100644 libcommon/common/libcommon-vc9.vcproj delete mode 100644 libcommon/common/makefile create mode 100644 libcommon/concrete.hxx create mode 100644 libcommon/config.hxx.in create mode 100644 libcommon/export.hxx delete mode 100644 libcommon/makefile delete mode 100644 m4/acx-pthread.m4 delete mode 100644 m4/c++11.m4 delete mode 100644 m4/database.m4 delete mode 100644 m4/diff.m4 delete mode 100644 m4/libboost.m4 delete mode 100644 m4/libodb-boost.m4 delete mode 100644 m4/libodb-mssql.m4 delete mode 100644 m4/libodb-mysql.m4 delete mode 100644 m4/libodb-oracle.m4 delete mode 100644 m4/libodb-pgsql.m4 delete mode 100644 m4/libodb-qt.m4 delete mode 100644 m4/libodb-sqlite.m4 delete mode 100644 m4/libodb.m4 delete mode 100644 m4/libqt.m4 delete mode 100644 m4/libtool-link.m4 delete mode 100644 m4/mssql.m4 delete mode 100644 m4/mysql.m4 delete mode 100644 m4/odb.m4 delete mode 100644 m4/oracle.m4 delete mode 100644 m4/pgsql.m4 delete mode 100644 m4/sqlite.m4 delete mode 100644 m4/static-lib.m4 delete mode 100644 m4/threads.m4 delete mode 100644 m4/tr1-memory.m4 delete mode 100644 makefile create mode 100644 manifest delete mode 100644 mssql-driver.bat delete mode 100644 mssql.options delete mode 100644 mssql/Makefile.am delete mode 100644 mssql/custom/makefile delete mode 100644 mssql/custom/test.std delete mode 100644 mssql/database/makefile delete mode 100644 mssql/database/test.std delete mode 100644 mssql/makefile delete mode 100644 mssql/native/makefile delete mode 100644 mssql/native/test.std delete mode 100644 mssql/query/makefile delete mode 100644 mssql/query/test.std delete mode 100644 mssql/stored-proc/makefile delete mode 100644 mssql/stored-proc/test.std delete mode 100644 mssql/template/Makefile.am delete mode 100644 mssql/template/makefile delete mode 100644 mssql/template/test.std delete mode 100644 mssql/test.bat delete mode 100644 mssql/types/makefile delete mode 100644 mssql/types/test.std delete mode 100644 mysql-driver.bat create mode 100644 mysql-schema.testscript delete mode 100644 mysql.options create mode 100644 mysql.testscript delete mode 100644 mysql/Makefile.am create mode 100644 mysql/custom/buildfile delete mode 100644 mysql/custom/makefile delete mode 100644 mysql/custom/test.std create mode 100644 mysql/custom/testscript create mode 100644 mysql/database/buildfile delete mode 100644 mysql/database/makefile delete mode 100644 mysql/database/test.std create mode 100644 mysql/database/testscript create mode 100644 mysql/index/buildfile delete mode 100644 mysql/index/makefile delete mode 100644 mysql/index/test.std create mode 100644 mysql/index/testscript delete mode 100644 mysql/makefile create mode 100644 mysql/native/buildfile delete mode 100644 mysql/native/makefile delete mode 100644 mysql/native/test.std create mode 100644 mysql/native/testscript delete mode 100644 mysql/template/Makefile.am delete mode 100644 mysql/template/driver.cxx delete mode 100644 mysql/template/makefile delete mode 100644 mysql/template/template-vc10.vcxproj delete mode 100644 mysql/template/template-vc10.vcxproj.filters delete mode 100644 mysql/template/template-vc11.vcxproj delete mode 100644 mysql/template/template-vc11.vcxproj.filters delete mode 100644 mysql/template/template-vc12.vcxproj delete mode 100644 mysql/template/template-vc12.vcxproj.filters delete mode 100644 mysql/template/template-vc8.vcproj delete mode 100644 mysql/template/template-vc9.vcproj delete mode 100644 mysql/template/test.hxx delete mode 100644 mysql/template/test.std delete mode 100644 mysql/test.bat create mode 100644 mysql/truncation/buildfile delete mode 100644 mysql/truncation/makefile delete mode 100644 mysql/truncation/test.std create mode 100644 mysql/truncation/testscript create mode 100644 mysql/types/buildfile delete mode 100644 mysql/types/makefile delete mode 100644 mysql/types/test.std create mode 100644 mysql/types/testscript delete mode 100644 oracle-driver.bat delete mode 100644 oracle.options delete mode 100644 oracle/Makefile.am delete mode 100644 oracle/custom/makefile delete mode 100644 oracle/custom/test.std delete mode 100644 oracle/database/makefile delete mode 100644 oracle/database/test.std delete mode 100644 oracle/makefile delete mode 100644 oracle/native/makefile delete mode 100644 oracle/native/test.std delete mode 100644 oracle/template/Makefile.am delete mode 100644 oracle/template/makefile delete mode 100644 oracle/template/test.std delete mode 100644 oracle/test.bat delete mode 100644 oracle/types/makefile delete mode 100644 oracle/types/test.std delete mode 100644 pgsql-driver.bat create mode 100644 pgsql-schema.testscript delete mode 100644 pgsql.options create mode 100644 pgsql.testscript delete mode 100644 pgsql/Makefile.am create mode 100644 pgsql/buildfile create mode 100644 pgsql/bulk/buildfile delete mode 100644 pgsql/bulk/makefile delete mode 100644 pgsql/bulk/test.std create mode 100644 pgsql/bulk/testscript create mode 100644 pgsql/custom/buildfile delete mode 100644 pgsql/custom/makefile delete mode 100644 pgsql/custom/test.std create mode 100644 pgsql/custom/testscript create mode 100644 pgsql/database/buildfile delete mode 100644 pgsql/database/makefile delete mode 100644 pgsql/database/test.std create mode 100644 pgsql/database/testscript create mode 100644 pgsql/index/buildfile delete mode 100644 pgsql/index/makefile delete mode 100644 pgsql/index/test.std create mode 100644 pgsql/index/testscript delete mode 100644 pgsql/makefile create mode 100644 pgsql/native/buildfile delete mode 100644 pgsql/native/makefile delete mode 100644 pgsql/native/test.std create mode 100644 pgsql/native/testscript delete mode 100644 pgsql/savepoint/driver.cxx delete mode 100644 pgsql/savepoint/makefile delete mode 100644 pgsql/savepoint/test.hxx delete mode 100644 pgsql/savepoint/test.std delete mode 100644 pgsql/template/Makefile.am delete mode 100644 pgsql/template/driver.cxx delete mode 100644 pgsql/template/makefile delete mode 100644 pgsql/template/template-vc10.vcxproj delete mode 100644 pgsql/template/template-vc10.vcxproj.filters delete mode 100644 pgsql/template/template-vc11.vcxproj delete mode 100644 pgsql/template/template-vc11.vcxproj.filters delete mode 100644 pgsql/template/template-vc12.vcxproj delete mode 100644 pgsql/template/template-vc12.vcxproj.filters delete mode 100644 pgsql/template/template-vc8.vcproj delete mode 100644 pgsql/template/template-vc9.vcproj delete mode 100644 pgsql/template/test.hxx delete mode 100644 pgsql/template/test.std delete mode 100644 pgsql/test.bat create mode 100644 pgsql/truncation/buildfile delete mode 100644 pgsql/truncation/makefile delete mode 100644 pgsql/truncation/test.std create mode 100644 pgsql/truncation/testscript create mode 100644 pgsql/types/buildfile delete mode 100644 pgsql/types/makefile delete mode 100644 pgsql/types/test.std create mode 100644 pgsql/types/testscript delete mode 100644 qt/Makefile.am delete mode 100644 qt/build.bat delete mode 100644 qt/common/Makefile.am delete mode 100644 qt/common/basic/makefile delete mode 100644 qt/common/basic/test.std delete mode 100644 qt/common/containers/basics/makefile delete mode 100644 qt/common/containers/basics/test.std delete mode 100644 qt/common/containers/change-tracking/makefile delete mode 100644 qt/common/containers/change-tracking/test.std delete mode 100644 qt/common/makefile delete mode 100644 qt/common/smart-ptr/makefile delete mode 100644 qt/common/smart-ptr/test.std delete mode 100644 qt/common/template/Makefile.am delete mode 100644 qt/common/template/makefile delete mode 100644 qt/common/template/test.std delete mode 100644 qt/common/test.bat delete mode 100644 qt/makefile delete mode 100644 qt/mssql/Makefile.am delete mode 100644 qt/mssql/basic/makefile delete mode 100644 qt/mssql/basic/test.std delete mode 100644 qt/mssql/date-time/makefile delete mode 100644 qt/mssql/date-time/test.std delete mode 100644 qt/mssql/makefile delete mode 100644 qt/mssql/template/Makefile.am delete mode 100644 qt/mssql/template/makefile delete mode 100644 qt/mssql/template/test.std delete mode 100644 qt/mssql/test.bat delete mode 100644 qt/mysql/Makefile.am delete mode 100644 qt/mysql/basic/makefile delete mode 100644 qt/mysql/basic/test.std delete mode 100644 qt/mysql/date-time/makefile delete mode 100644 qt/mysql/date-time/test.std delete mode 100644 qt/mysql/makefile delete mode 100644 qt/mysql/template/Makefile.am delete mode 100644 qt/mysql/template/makefile delete mode 100644 qt/mysql/template/test.std delete mode 100644 qt/mysql/test.bat delete mode 100644 qt/oracle/Makefile.am delete mode 100644 qt/oracle/basic/makefile delete mode 100644 qt/oracle/basic/test.std delete mode 100644 qt/oracle/date-time/makefile delete mode 100644 qt/oracle/date-time/test.std delete mode 100644 qt/oracle/makefile delete mode 100644 qt/oracle/template/Makefile.am delete mode 100644 qt/oracle/template/makefile delete mode 100644 qt/oracle/template/test.std delete mode 100644 qt/oracle/test.bat delete mode 100644 qt/pgsql/Makefile.am delete mode 100644 qt/pgsql/basic/makefile delete mode 100644 qt/pgsql/basic/test.std delete mode 100644 qt/pgsql/date-time/makefile delete mode 100644 qt/pgsql/date-time/test.std delete mode 100644 qt/pgsql/makefile delete mode 100644 qt/pgsql/template/Makefile.am delete mode 100644 qt/pgsql/template/makefile delete mode 100644 qt/pgsql/template/test.std delete mode 100644 qt/pgsql/test.bat delete mode 100644 qt/sqlite/Makefile.am delete mode 100644 qt/sqlite/basic/makefile delete mode 100644 qt/sqlite/basic/test.std delete mode 100644 qt/sqlite/date-time/makefile delete mode 100644 qt/sqlite/date-time/test.std delete mode 100644 qt/sqlite/makefile delete mode 100644 qt/sqlite/template/Makefile.am delete mode 100644 qt/sqlite/template/makefile delete mode 100644 qt/sqlite/template/test.std delete mode 100644 qt/sqlite/test.bat create mode 100644 repositories.manifest delete mode 100644 sqlite-driver.bat delete mode 100644 sqlite.options create mode 100644 sqlite.testscript delete mode 100644 sqlite/Makefile.am create mode 100644 sqlite/attach/buildfile delete mode 100644 sqlite/attach/makefile delete mode 100644 sqlite/attach/test.std create mode 100644 sqlite/attach/testscript create mode 100644 sqlite/auto/buildfile delete mode 100644 sqlite/auto/makefile delete mode 100644 sqlite/auto/test.std create mode 100644 sqlite/auto/testscript create mode 100644 sqlite/custom/buildfile delete mode 100644 sqlite/custom/makefile delete mode 100644 sqlite/custom/test.std create mode 100644 sqlite/custom/testscript create mode 100644 sqlite/database/buildfile delete mode 100644 sqlite/database/makefile delete mode 100644 sqlite/database/test.std create mode 100644 sqlite/database/testscript delete mode 100644 sqlite/makefile create mode 100644 sqlite/native/buildfile delete mode 100644 sqlite/native/makefile delete mode 100644 sqlite/native/test.std create mode 100644 sqlite/native/testscript create mode 100644 sqlite/stream/buildfile delete mode 100644 sqlite/stream/makefile delete mode 100644 sqlite/stream/test.std create mode 100644 sqlite/stream/testscript delete mode 100644 sqlite/template/Makefile.am delete mode 100644 sqlite/template/driver.cxx delete mode 100644 sqlite/template/makefile delete mode 100644 sqlite/template/template-vc10.vcxproj delete mode 100644 sqlite/template/template-vc10.vcxproj.filters delete mode 100644 sqlite/template/template-vc11.vcxproj delete mode 100644 sqlite/template/template-vc11.vcxproj.filters delete mode 100644 sqlite/template/template-vc12.vcxproj delete mode 100644 sqlite/template/template-vc12.vcxproj.filters delete mode 100644 sqlite/template/template-vc8.vcproj delete mode 100644 sqlite/template/template-vc9.vcproj delete mode 100644 sqlite/template/test.hxx delete mode 100644 sqlite/template/test.std delete mode 100644 sqlite/test.bat create mode 100644 sqlite/transaction/buildfile delete mode 100644 sqlite/transaction/makefile delete mode 100644 sqlite/transaction/test.std create mode 100644 sqlite/transaction/testscript create mode 100644 sqlite/truncation/buildfile delete mode 100644 sqlite/truncation/makefile delete mode 100644 sqlite/truncation/test.std create mode 100644 sqlite/truncation/testscript create mode 100644 sqlite/types/buildfile delete mode 100644 sqlite/types/makefile delete mode 100644 sqlite/types/test.std create mode 100644 sqlite/types/testscript delete mode 100644 template-vc10.sln delete mode 100644 template-vc11.sln delete mode 100644 template-vc12.sln delete mode 100644 template-vc8.sln delete mode 100644 template-vc9.sln delete mode 100644 test.bat delete mode 100644 tester.bat delete mode 100755 tester.in delete mode 100644 version diff --git a/.gitignore b/.gitignore index 405cbcc..e3bbf5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,41 @@ # Compiler/linker output. # +*.d +*.t +*.i +*.i.* +*.ii +*.ii.* *.o -*.o.d +*.obj +*.gcm +*.pcm +*.ifc *.so +*.dylib +*.dll *.a -*.l -*.l.cpp-options +*.lib +*.exp +*.pdb +*.ilk +*.exe +*.exe.dlls/ +*.exe.manifest +*.pc -# Test output +# Test executables. # -*.out +driver -# Generated documentation. +# ODB-generated files. # -*.pdf -*.ps +test-odb.?xx +test-odb-*.?xx +test.sql +test-*.sql -# Generated build system files. +# Testscript output directories (can be symlinks). # -*-dynamic.make -build/*.options -build/*-driver - -# Generated .gitignore files. -# -.gitignore +test +test-driver diff --git a/INSTALL b/INSTALL deleted file mode 100644 index c0f6c60..0000000 --- a/INSTALL +++ /dev/null @@ -1,215 +0,0 @@ -In this document we use to refer to the name of the database -system you would like to use. Valid values for are: - - 'mysql' - The MySQL database system - 'sqlite' - The SQLite database system - 'pgsql' - The PostgreSQL database system - 'oracle' - The Oracle database system - 'mssql' - The Microsoft SQL Server database system - -Prerequisites -============= - -Required: - - odb http://www.codesynthesis.com/products/odb/ - - libodb http://www.codesynthesis.com/products/odb/ - - libodb- http://www.codesynthesis.com/products/odb/ - -Optional: - - libodb-boost http://www.codesynthesis.com/products/odb/ - - Boost http://www.boost.org - - libodb-qt http://www.codesynthesis.com/products/odb/ - - Qt http://qt.nokia.com - -Building on UNIX -================ - -The following build instructions are for the Linux/UNIX/Mac OS X -operating systems as well as for Cygwin and MinGW on Windows. - -The standard autotools-based build system is used on these platforms. -After unpacking the source code archive, change to the odb-tests -package directory (referred to as odb-tests/ from now on) and run -the configure script, for example: - -./configure --with-database= - -To see the available configuration options run configure with --help: - -./configure --help - -The required --database option specifies the database system you would -like to use. - -The configure script expects the directory where the ODB compiler -binary is installed to be in the executable search path (the PATH -environment variable). If that's not the case, you can use the ODB -configure variable to specify the path to the ODB compiler, for -example: - -./configure ODB=/opt/odb/bin/odb - -If the ODB compiler is not installed and you would like to run it -from its build directory instead, you can use the --with-odb configure -option to specify the build directory, for example: - -./configure --with-odb=/tmp/odb - -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, and ---with-libodb- configure options to specify their locations, -for example: - -./configure --with-libodb=/tmp/libodb - -If you would also like to build the boost profile tests, then the -configure script should be able to find headers and libraries for -libodb-boost and Boost. Similarly, if you would like to build the qt -profile tests, then the configure script should be able to find headers -and libraries for libodb-qt and Qt. The same mechanisms as described -above can be used to specify locations of these libraries if they -cannot be discovered automatically. - -For each value the configure script has a set of options in -the form --with--* that allow you to specify various database -system parameters, such as the login name, password, and database name, -that should be used when running the tests. Run configure with --help -to see the available options for your database. - -As another example, the following configure command uses the specified -C++ compiler and compiles with optimization and without debug information: - -./configure CXX=g++-4.5 CXXFLAGS=-O3 - -If you would like to build the tests in the C++11 mode, then you will need -to pass the necessary options to turn the C++ compiler into this mode. For -example: - -./configure CXXFLAGS=-std=c++0x - -Once configuration is complete, run make to build the tests: - -make - -Once the build is completed successfully you can run the tests using -the check target: - -make check - - -Building on Windows -=================== - -The following build instructions are for Windows using Microsoft Visual -Studio. If you would like to build odb-tests with GCC either using -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 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. - -If you would also like to build the boost profile tests, then the header and -import library directories for libodb-boost and Boost must be in the VC++ -Directories Include and Library search lists. Similarly, if you would like -to build the qt profile tests, then the header and import library -directories for libodb-qt and Qt must 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. For Boost and -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 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 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. Note that with Visual Studio 10 (2010) and later the tests are -built in the C++11 mode. - -Alternatively, you can use the build.bat batch files located in the -odb-tests\, odb-tests\boost\, and odb-tests\qt\ directories to build all -the solutions, for all the configurations and for all the platforms -automatically. The build.bat file has the following command line interface: - -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. - -Once the build is completed successfully, you can run all the tests using -the test.bat batch file located in the odb-tests\ directory. - -Before you can run test.bat, you may need to adjust the database system -parameters, such as the login name, password, and database name, that -should be used when running the tests. To do this, edit the -.options and -driver.bat files located in the -odb-tests\ directory. Once this is done, you can run the tests by -executing the following command from the command prompt: - -test.bat - - -Test Suite Configuration -======================== - -The test suite supports additional configuration via the following -preprocessor macros: - -HOST_WIN32 Specifies that the tests will run on Windows. This - macro is only needed when cross-compiling for Windows - using, for example, a cross-compiler to MinGW. - -MSSQL_SERVER_VERSION Specifies the SQL Server version that will be used to - run the tests. The version is specified as XXYY where - XX is the major and YY is the minor SQL Server versions, - for example, 900 (SQL Server 2005/9.0), 1000 (2008/10.0), - 1050 (2008R2/10.5), 1100 (2012/11.0). If this macro is - not defined, then the test suite assumes SQL Server 2008. - -To define any of these macros when building on UNIX operating systems you -can use the CPPFLAGS configure variable, for example: - -./configure CPPFLAGS=-DMSSQL_SERVER_VERSION=900 - -When building on Windows with Visual Studio the extra macros have to be -specified in two places: in the default.options ODB configuration file -(located in the odb-X.Y.Z-i686-windows\etc\odb\ directory) as well as -in the CL environment variable. For example, to specify the SQL Server -version add the following line to the default.options file: - --DMSSQL_SERVER_VERSION=900 - -As well as set the CL environment variable before running the build.bat -batch file: - -SET CL=-DMSSQL_SERVER_VERSION=900 - -If you are using the Visual Studio IDE to build the tests, then you will -need to start the IDE from a command prompt after setting the CL variable, -for example: - -SET CL=-DMSSQL_SERVER_VERSION=900 -C:\Program Files (x86)\Microsoft Visual Studio \Common7\IDE\devenv.com diff --git a/INSTALL-GIT b/INSTALL-GIT deleted file mode 100644 index f917af5..0000000 --- a/INSTALL-GIT +++ /dev/null @@ -1,78 +0,0 @@ -The following instructions describe how to work with the source code that was -checked out from the git repository. - -The major difference between using a released source code package and source -code from the repository is that the former does not contain autotools-based -makefiles or Visual Studio project files. Instead, it contains templates for -these files as well as its own, custom build system. This build system is -used for development as well as to automatically generate the autotools and -Visual Studio files. - -This file describes how to use this build system to build the package as well -as to create a release-ready source distribution which contains the autotools -build system and Visual Studio project files. - - -Prerequisites -============= - -Besides the prerequisites listed in the INSTALL file, you will need the -following additional packages: - - - GNU bash >= 2.0.0 http://www.gnu.org/software/bash/ - - GNU make >= 3.81 http://www.gnu.org/software/make/ - - build >= latest http://www.codesynthesis.com/projects/build/ - -If you are planning to create the source code distributions, then you will -also need the following packages: - - - GNU m4 >= 1.4.0 http://www.gnu.org/software/m4/ - - GNU sed >= 4.0.0 http://www.gnu.org/software/sed/ - - tofrodos >= 1.7.0 http://www.thefreecountry.com/tofrodos/ - -As we as the GNU autotools: - - - GNU libtool >= 2.2.6b http://www.gnu.org/software/libtool/ - - GNU autoconf >= 2.67 http://www.gnu.org/software/autoconf/ - - GNU automake >= 1.11.1 http://www.gnu.org/software/automake/ - -Any reasonably up to date GNU/Linux installation would normally have all of -the above packages already present, except for build and maybe tofrodos. - - -Configuring and Building -======================== - -To build the source code simply run make in the root directory of the package. -The first time you run make, the build process will also configure the -package by asking you several questions. On the subsequent runs, make will -only rebuild what has changed. - -To run the automated test suite (if any), run 'make test'. To clean the object -files, executables, etc., run 'make clean'. To de-configure the package (that -is, to remove configuration files in addition to objects, executables, etc.), -run 'make disfigure'. - - -Creating Distribution -===================== - -To create the source code distribution, use the dist make target as well as -the dist_prefix variable to specify the directory where the distribution files -should be placed. For example: - -make dist dist_prefix=/tmp/package-1.1.0 - -Once the distribution files are ready, change to the distribution directory -and run the bootstrap script to bootstrap the autotools build system, for -example: - -cd /tmp/package-1.1.0 -./bootsrap - -To create the source code archives, use the autotools build system. First -configuring the package (see the INSTALL file for more information on this -step) and then use the dist target to make the archives, for example: - -./configure -make dist diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 46105dc..0000000 --- a/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# file : Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = libcommon common evolution - -if ODB_TESTS_BOOST -SUBDIRS += boost -endif - -if ODB_TESTS_QT -SUBDIRS += qt -endif - -if DATABASE_MYSQL -SUBDIRS += mysql -endif - -if DATABASE_SQLITE -SUBDIRS += sqlite -endif - -if DATABASE_PGSQL -SUBDIRS += pgsql -endif - -if DATABASE_ORACLE -SUBDIRS += oracle -endif - -if DATABASE_MSSQL -SUBDIRS += mssql -endif - -EXTRA_DIST = __file__(extra_dist) -ACLOCAL_AMFLAGS = -I m4 diff --git a/README b/README deleted file mode 100644 index b6705b9..0000000 --- a/README +++ /dev/null @@ -1,18 +0,0 @@ -ODB is an object-relational mapping (ORM) system for C++. It provides -tools, APIs, and library support that allow you to persist C++ objects -to a relational database (RDBMS) without having to deal with tables, -columns, or SQL and without manually writing any of the mapping code. -For more information see: - -http://www.codesynthesis.com/products/odb/ - -This package contains the ODB test suite. - -See the NEWS file for the user-visible changes from the previous release. - -See the LICENSE file for distribution conditions. - -See the INSTALL file for prerequisites and installation instructions. - -Send questions, bug reports, or any other feedback to the -odb-users@codesynthesis.com mailing list. diff --git a/README.md b/README.md new file mode 100644 index 0000000..24d3bf7 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# odb-tests - tests for ODB compiler + +This package contains tests for `odb`, object-relational mapping (ORM) +compiler for C++. diff --git a/boost/Makefile.am b/boost/Makefile.am deleted file mode 100644 index 05f9523..0000000 --- a/boost/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# file : boost/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = common - -if DATABASE_MYSQL -SUBDIRS += mysql -endif - -if DATABASE_SQLITE -SUBDIRS += sqlite -endif - -if DATABASE_PGSQL -SUBDIRS += pgsql -endif - -if DATABASE_ORACLE -SUBDIRS += oracle -endif - -if DATABASE_MSSQL -SUBDIRS += mssql -endif - -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/build.bat b/boost/build.bat deleted file mode 100644 index 7371b1a..0000000 --- a/boost/build.bat +++ /dev/null @@ -1,116 +0,0 @@ -@echo off -rem file : boost/build.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Build Boost tests using the VC++ batch mode compilation. -rem -rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] -rem -rem conf: {Debug,Release}|all -rem plat: {Win32,x64}|all -rem - -setlocal - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -if "_%2_" == "__" ( - echo no VC++ version specified - goto usage -) - -if "_%~3_" == "__" ( - echo no configuration specified - goto usage -) - -if "_%~4_" == "__" ( - echo no platform specified - goto usage -) - -set "failed=" - -if "_%2_" == "_8_" set "vcver=8" -if "_%2_" == "_9_" set "vcver=9" -if "_%2_" == "_10_" set "vcver=10" -if "_%2_" == "_11_" set "vcver=11" -if "_%2_" == "_12_" set "vcver=12" - -if "_%vcver%_" == "__" ( - echo unknown VC++ version %2 - goto usage -) - -set "confs=%~3" -set "plats=%~4" - -if "_%confs%_" == "_all_" set "confs=__path__(configurations)" -if "_%plats%_" == "_all_" set "plats=__path__(platforms)" - -set "action=%5" -if "_%action%_" == "__" set "action=/Build" - -set "devenv=%DEVENV%" -if "_%devenv%_" == "__" set "devenv=devenv.com" - -goto start - -rem -rem %1 - solution name -rem %2 - configuration to build -rem %3 - platform to build -rem -:run_build - echo. - echo building boost/%1 %3 %2 - "%devenv%" %1 %action% "%2|%3" 2>&1 - if errorlevel 1 set "failed=%failed% boost/%1\%3\%2" -goto :eof - -:start - -for %%d in (%1) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build %%d/boost-%%d-vc%vcver%.sln %%c %%p - ) - ) -) - -for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build common/boost-common-%1-vc%vcver%.sln %%c %%p - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL BUILDS SUCCEEDED -echo. -goto end - -:usage -echo. -echo usage: build.bat database vc-version conf plat [action] -echo valid configurations are: {Debug,Release}|all -echo valid platforms are: {Win32,x64}|all -echo valid actions are: /Build (default), /Clean, and /Rebuild -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/boost/common/Makefile.am b/boost/common/Makefile.am deleted file mode 100644 index 83f99ea..0000000 --- a/boost/common/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/common/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/common/makefile b/boost/common/makefile deleted file mode 100644 index 5d92e2d..0000000 --- a/boost/common/makefile +++ /dev/null @@ -1,54 +0,0 @@ -# file : boost/common/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -multi-index \ -optional \ -smart-ptr \ -template \ -unordered \ -uuid - -all_tests := $(tests) -build_tests := $(tests) - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) - -name := boost-common -$(dist): name := $(name) -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ -$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) \ -$(call vc12slns,$(name)) -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) - $(call meta-automake) - $(call meta-vc8slns,$(name)) - $(call meta-vc9slns,$(name)) - $(call meta-vc10slns,$(name)) - $(call meta-vc11slns,$(name)) - $(call meta-vc12slns,$(name)) - $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(tests)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) -else -$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) -endif diff --git a/boost/common/multi-index/makefile b/boost/common/multi-index/makefile deleted file mode 100644 index 8ac84f1..0000000 --- a/boost/common/multi-index/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/multi-index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile boost/multi-index --table-prefix boost_multi_index_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/multi-index/test.std b/boost/common/multi-index/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile deleted file mode 100644 index 4928bd3..0000000 --- a/boost/common/optional/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/optional/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---profile boost/optional --table-prefix boost_optional_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/optional/test.std b/boost/common/optional/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile deleted file mode 100644 index 14172dc..0000000 --- a/boost/common/smart-ptr/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/smart-ptr/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-session \ ---profile boost/smart-ptr --table-prefix boost_smart_ptr_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/smart-ptr/test.std b/boost/common/smart-ptr/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/common/template/Makefile.am b/boost/common/template/Makefile.am deleted file mode 100644 index 8f76465..0000000 --- a/boost/common/template/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# file : boost/common/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< diff --git a/boost/common/template/makefile b/boost/common/template/makefile deleted file mode 100644 index ca43223..0000000 --- a/boost/common/template/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile boost/version --table-prefix boost_template_ #@@ CHANGE prefix, profile -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/template/test.std b/boost/common/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/common/test.bat b/boost/common/test.bat deleted file mode 100644 index 1e61950..0000000 --- a/boost/common/test.bat +++ /dev/null @@ -1,79 +0,0 @@ -@echo off -rem file : boost/common/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem %4 - database -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 %4 %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 %1 - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:usage -echo. -echo usage: test.bat database -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile deleted file mode 100644 index 57b9dd5..0000000 --- a/boost/common/unordered/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/unordered/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile boost/unordered --table-prefix boost_unordered_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/unordered/test.std b/boost/common/unordered/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/common/uuid/makefile b/boost/common/uuid/makefile deleted file mode 100644 index ec683a5..0000000 --- a/boost/common/uuid/makefile +++ /dev/null @@ -1,127 +0,0 @@ -# file : boost/common/uuid/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---profile boost/uuid --table-prefix boost_uuid_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/boost/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/common/uuid/test.std b/boost/common/uuid/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/makefile b/boost/makefile deleted file mode 100644 index 0aa6ef2..0000000 --- a/boost/makefile +++ /dev/null @@ -1,38 +0,0 @@ -# file : boost/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -all_dirs := common mysql sqlite pgsql oracle mssql -dirs := common - -# Database-specific tests are not run in the multi-database configuration. -# -ifneq ($(db_id),common) -dirs += $(db_id) -endif - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) - -$(dist): export extra_dist := build.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) - $(call meta-vctest,common/boost-common-mysql-vc10.sln,build.bat) - $(call meta-automake) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) - -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) -else -$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) -endif diff --git a/boost/mssql/Makefile.am b/boost/mssql/Makefile.am deleted file mode 100644 index 65c21d7..0000000 --- a/boost/mssql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/mssql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mssql/date-time/makefile b/boost/mssql/date-time/makefile deleted file mode 100644 index 6857309..0000000 --- a/boost/mssql/date-time/makefile +++ /dev/null @@ -1,122 +0,0 @@ -# file : boost/mssql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql \ ---profile boost/date-time --generate-schema \ ---table-prefix boost_mssql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/mssql/date-time/test.std b/boost/mssql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/mssql/makefile b/boost/mssql/makefile deleted file mode 100644 index 6a37a2f..0000000 --- a/boost/mssql/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# file : boost/mssql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := boost-mssql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/boost/mssql/template/Makefile.am b/boost/mssql/template/Makefile.am deleted file mode 100644 index 3dc2977..0000000 --- a/boost/mssql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : boost/mssql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/boost/mssql/template/makefile b/boost/mssql/template/makefile deleted file mode 100644 index d729ffd..0000000 --- a/boost/mssql/template/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : boost/mssql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --profile boost \ ---generate-schema --table-prefix boost_mssql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/mssql/template/test.std b/boost/mssql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/mssql/test.bat b/boost/mssql/test.bat deleted file mode 100644 index 167cf55..0000000 --- a/boost/mssql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : boost/mssql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mssql %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/boost/mysql/Makefile.am b/boost/mysql/Makefile.am deleted file mode 100644 index 2e51d4d..0000000 --- a/boost/mysql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/mysql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/mysql/date-time/makefile b/boost/mysql/date-time/makefile deleted file mode 100644 index 1e2f9df..0000000 --- a/boost/mysql/date-time/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# file : boost/mysql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --profile boost/date-time --table-prefix boost_mysql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/mysql/date-time/test.std b/boost/mysql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/mysql/makefile b/boost/mysql/makefile deleted file mode 100644 index 08fe245..0000000 --- a/boost/mysql/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# file : boost/mysql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := boost-mysql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/boost/mysql/template/Makefile.am b/boost/mysql/template/Makefile.am deleted file mode 100644 index 79d7ec5..0000000 --- a/boost/mysql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : boost/mysql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/boost/mysql/template/makefile b/boost/mysql/template/makefile deleted file mode 100644 index 085221c..0000000 --- a/boost/mysql/template/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : boost/mysql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --profile boost \ ---generate-schema --table-prefix boost_mysql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/mysql/template/test.std b/boost/mysql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/mysql/test.bat b/boost/mysql/test.bat deleted file mode 100644 index 610e538..0000000 --- a/boost/mysql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : boost/mysql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mysql %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/boost/oracle/Makefile.am b/boost/oracle/Makefile.am deleted file mode 100644 index e485853..0000000 --- a/boost/oracle/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/oracle/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/oracle/date-time/makefile b/boost/oracle/date-time/makefile deleted file mode 100644 index 569c347..0000000 --- a/boost/oracle/date-time/makefile +++ /dev/null @@ -1,122 +0,0 @@ -# file : boost/oracle/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle \ ---profile boost/date-time --generate-schema \ ---table-prefix boost_or_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/oracle/date-time/test.std b/boost/oracle/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/oracle/makefile b/boost/oracle/makefile deleted file mode 100644 index fa4a43d..0000000 --- a/boost/oracle/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# file : boost/oracle/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := boost-oracle -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/boost/oracle/template/Makefile.am b/boost/oracle/template/Makefile.am deleted file mode 100644 index a2a40fb..0000000 --- a/boost/oracle/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : boost/oracle/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/boost/oracle/template/makefile b/boost/oracle/template/makefile deleted file mode 100644 index cde118e..0000000 --- a/boost/oracle/template/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : boost/oracle/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --profile boost \ ---generate-schema --table-prefix boost_oracle_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/oracle/template/test.std b/boost/oracle/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/oracle/test.bat b/boost/oracle/test.bat deleted file mode 100644 index 918708f..0000000 --- a/boost/oracle/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : boost/oracle/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat oracle %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/boost/pgsql/Makefile.am b/boost/pgsql/Makefile.am deleted file mode 100644 index 9e4072b..0000000 --- a/boost/pgsql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/pgsql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/pgsql/date-time/makefile b/boost/pgsql/date-time/makefile deleted file mode 100644 index 7ea0d50..0000000 --- a/boost/pgsql/date-time/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# file : boost/pgsql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --profile boost/date-time \ ---generate-schema --table-prefix boost_pgsql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/pgsql/date-time/test.std b/boost/pgsql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/pgsql/makefile b/boost/pgsql/makefile deleted file mode 100644 index 264bfaa..0000000 --- a/boost/pgsql/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# file : boost/pgsql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := boost-pgsql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/boost/pgsql/template/Makefile.am b/boost/pgsql/template/Makefile.am deleted file mode 100644 index a1015c7..0000000 --- a/boost/pgsql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : boost/pgsql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/boost/pgsql/template/makefile b/boost/pgsql/template/makefile deleted file mode 100644 index 9d14647..0000000 --- a/boost/pgsql/template/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# file : boost/pgsql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --profile boost \ ---generate-schema --table-prefix boost_pgsql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/pgsql/template/test.std b/boost/pgsql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/pgsql/test.bat b/boost/pgsql/test.bat deleted file mode 100644 index 7db2c4a..0000000 --- a/boost/pgsql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : boost/pgsql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat pgsql %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/boost/sqlite/Makefile.am b/boost/sqlite/Makefile.am deleted file mode 100644 index e86ed43..0000000 --- a/boost/sqlite/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : boost/sqlite/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/boost/sqlite/date-time/makefile b/boost/sqlite/date-time/makefile deleted file mode 100644 index b780298..0000000 --- a/boost/sqlite/date-time/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# file : boost/sqlite/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --profile boost/date-time \ ---generate-schema --table-prefix boost_sqlite_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/sqlite/date-time/test.std b/boost/sqlite/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/sqlite/makefile b/boost/sqlite/makefile deleted file mode 100644 index 159a92d..0000000 --- a/boost/sqlite/makefile +++ /dev/null @@ -1,36 +0,0 @@ -# file : boost/sqlite/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := boost-sqlite -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/boost/sqlite/template/Makefile.am b/boost/sqlite/template/Makefile.am deleted file mode 100644 index 39b318f..0000000 --- a/boost/sqlite/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : boost/sqlite/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/boost/sqlite/template/makefile b/boost/sqlite/template/makefile deleted file mode 100644 index 3ebeda1..0000000 --- a/boost/sqlite/template/makefile +++ /dev/null @@ -1,121 +0,0 @@ -# file : boost/sqlite/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-boost/stub.make,\ - l: odb_boost.l,cpp-options: odb_boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/header-only/stub.make,\ - cpp-options: boost.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libboost/date-time/stub.make,\ - l: boost_date_time.l) - -# Build. -# -$(driver): $(cxx_obj) $(odb_boost.l) $(common.l) $(boost_date_time.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --profile boost \ ---generate-schema --table-prefix boost_sqlite_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ -$(boost.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)/boost/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/boost/sqlite/template/test.std b/boost/sqlite/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/boost/sqlite/test.bat b/boost/sqlite/test.bat deleted file mode 100644 index 57a7f5e..0000000 --- a/boost/sqlite/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : boost/sqlite/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 - if errorlevel 1 ( - set "failed=%failed% %1\%3\%2" - ) - ) - - cd %curdir% -goto :eof - -:start - -for %%t in (%tests%) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_test %%t %%c %%p - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 85d1399..0000000 --- a/bootstrap +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh - -# file : bootstrap -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Bootstrap the automake build system. -# - -rm -f config.cache - -if test ! -d m4; then - mkdir m4 -fi - -autoreconf --install diff --git a/build.bat b/build.bat deleted file mode 100644 index 1da0b91..0000000 --- a/build.bat +++ /dev/null @@ -1,128 +0,0 @@ -@echo off -rem file : build.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Build tests using the VC++ batch mode compilation. -rem -rem build.bat database vc-version conf plat [/Build|/Clean|/Rebuild] -rem -rem conf: {Debug,Release}|all -rem plat: {Win32,x64}|all -rem - -setlocal - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -if "_%2_" == "__" ( - echo no VC++ version specified - goto usage -) - -if "_%~3_" == "__" ( - echo no configuration specified - goto usage -) - -if "_%~4_" == "__" ( - echo no platform specified - goto usage -) - -set "failed=" - -if "_%2_" == "_8_" set "vcver=8" -if "_%2_" == "_9_" set "vcver=9" -if "_%2_" == "_10_" set "vcver=10" -if "_%2_" == "_11_" set "vcver=11" -if "_%2_" == "_12_" set "vcver=12" - -if "_%vcver%_" == "__" ( - echo unknown VC++ version %2 - goto usage -) - -set "confs=%~3" -set "plats=%~4" - -if "_%confs%_" == "_all_" set "confs=__path__(configurations)" -if "_%plats%_" == "_all_" set "plats=__path__(platforms)" - -set "action=%5" -if "_%action%_" == "__" set "action=/Build" - -set "devenv=%DEVENV%" -if "_%devenv%_" == "__" set "devenv=devenv.com" - -goto start - -rem -rem %1 - solution name -rem %2 - configuration to build -rem %3 - platform to build -rem -:run_build - echo. - echo building %1 %3 %2 - "%devenv%" %1 %action% "%2|%3" 2>&1 - if errorlevel 1 set "failed=%failed% %1\%3\%2" -goto :eof - -:start - -for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build libcommon/libcommon-%1-vc%vcver%.sln %%c %%p - ) -) - -for %%d in (%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 - ) -) - -for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build evolution/evolution-%1-vc%vcver%.sln %%c %%p - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL BUILDS SUCCEEDED -echo. -goto end - -:usage -echo. -echo usage: build.bat database vc-version conf plat [action] -echo valid configurations are: {Debug,Release}|all -echo valid platforms are: {Win32,x64}|all -echo valid actions are: /Build (default), /Clean, and /Rebuild -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 0000000..2fb5824 --- /dev/null +++ b/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : build/bootstrap.build +# license : GNU GPL v2; see accompanying LICENSE file + +project = odb-tests + +using version +using config +using dist +using test diff --git a/build/bootstrap.make b/build/bootstrap.make deleted file mode 100644 index 34d2933..0000000 --- a/build/bootstrap.make +++ /dev/null @@ -1,277 +0,0 @@ -# file : build/bootstrap.make -# license : GNU GPL v2; see accompanying LICENSE file - -project_name := odb-tests - -# First try to include the bundled bootstrap.make if it exist. If that -# fails, let make search for the external bootstrap.make. -# -build := build-0.3 - --include $(dir $(lastword $(MAKEFILE_LIST)))../../$(build)/bootstrap.make - -ifeq ($(patsubst %build/bootstrap.make,,$(lastword $(MAKEFILE_LIST))),) -include $(build)/bootstrap.make -endif - -# Configuration -# -$(call include,$(scf_root)/configuration.make) - -def_goal := $(.DEFAULT_GOAL) - -# Include C++ configuration. We need to know if we are using the generic -# C++ compiler in which case we need to compensate for missing dependency -# auto-generation (see below). -# -$(call include,$(bld_root)/cxx/configuration.make) - -# Databases. -# -databases := mysql sqlite pgsql oracle mssql -$(dist): databases := $(databases) - -# Aliases -# -default := $(out_base)/ -driver := $(out_base)/driver -test := $(out_base)/.test -dist := $(out_base)/.dist -clean := $(out_base)/.clean - -.PHONY: $(default) \ - $(test) \ - $(dist) \ - $(clean) - -ifeq ($(db_id),common) -define db-test-target -test_$1 := $$(out_base)/.test-$1 -.PHONY: $$(test_$1) -$$(test): $$(test_$1) - -endef -$(foreach d,$(databases),$(eval $(call db-test-target,$d))) - -define db-test-dir -$$(test_$1): $$(addprefix $$(out_base)/,$$(addsuffix /.test-$1,$2)) - -endef -endif - -ifdef %interactive% -.PHONY: test dist clean -test: $(test) -dist: $(dist) -clean: $(clean) - -ifeq ($(db_id),common) -define db-test-alias -.PHONY: test-$1 -test-$1: $$(test_$1) - -endef -$(foreach d,$(databases),$(eval $(call db-test-alias,$d))) -endif -endif - -# Return the list of ODB-generated files given a list of header files. -# -ifdef db_id -ifneq ($(db_id),common) -odb-gen = $(foreach f,$(1:.hxx=),$(addprefix $f,-odb.hxx -odb.ixx -odb.cxx .sql)) -else -odb-gen = $(foreach f,$(1:.hxx=),$(addprefix $f, -odb.hxx -odb.ixx -odb.cxx \ -$(foreach d,$(databases),-odb-$d.hxx -odb-$d.ixx -odb-$d.cxx -$d.sql))) -endif -endif - -# By default the ODB header is called test.hxx. -# -$(out_base)/.dist: export odb_header_stem := test - -# Database schema creation. -# -ifneq ($(db_id),sqlite) -$(out_base)/.test $(addprefix $(out_base)/.test-,$(databases)): schema-body = \ -$(call message,sql $$1,$(dcf_root)/$1-driver $$1,$2)$(literal_newline)$(literal_tab) - -ifneq ($(db_id),common) -$(out_base)/.test: schema = \ -$(foreach s,$(if $1,$1,$(out_base)/test.sql),$(call schema-body,$(db_id),$s))@: -else -define db-schema -$$(out_base)/.test-$1: schema-$1 = \ -$$(foreach s,$$(if $$1,$$(filter %-$1.sql,$$1),$$(out_base)/test-$1.sql),$$(call schema-body,$1,$$s))@: - -endef -$(foreach d,$(filter-out sqlite,$(databases)),$(eval $(call db-schema,$d))) -endif -endif - -# Test rule templates. -# - -# $1 database name in the multi-database mode and empty otherwise -# $2 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) -# -define test-schemaless-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$2.std - $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ -$$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test$2.std $$(out_base)/test.out) - $$(call message,,rm -f $$(out_base)/test.out) - -endef - -# $1 database name in the multi-database mode and empty otherwise -# $2 optional list of schema files, by default test.sql -# $3 optional test.std file suffix (e.g., '-mysql' for test-mysql.std) -# -define test-rule -$$(test$(if $1,_$1)): $$(driver) $$(src_base)/test$3.std - $$(call schema$(if $1,-$1),$2) - $$(call message,test$(if $1, [$1]) $$<,$$< $1 --options-file \ -$$(dcf_root)/$(if $1,$1,$(db_id)).options >$$(out_base)/test.out) - $$(call message,,diff -u $$(src_base)/test$3.std $$(out_base)/test.out) - $$(call message,,rm -f $$(out_base)/test.out) - -endef - -# Dist setup. -# -ifneq ($(filter $(MAKECMDGOALS),dist),) - -# Make sure the distribution prefix is set if the goal is dist. -# -ifeq ($(dist_prefix),) -$(error dist_prefix is not set) -endif - -# $1 project template without the -vcN.vc[x]proj suffix. -# $2 project name without the -vcN.vc[x]proj suffix. -# -$(dist): meta-vc8projs = \ -$(foreach d,$(databases),$(call \ -meta-vc8proj,$1-vc8.vcproj,$(if $2,$2,$(notdir \ -$1))-$d-vc8.vcproj,database,$d)$(literal_newline)$(literal_tab))@: - -$(dist): meta-vc9projs = \ -$(foreach d,$(databases),$(call \ -meta-vc9proj,$1-vc9.vcproj,$(if $2,$2,$(notdir \ -$1))-$d-vc9.vcproj,database,$d)$(literal_newline)$(literal_tab))@: - -$(dist): meta-vc10projs = \ -$(foreach d,$(databases),$(call \ -meta-vc10proj,$1-vc10.vcxproj,$(if $2,$2,$(notdir \ -$1))-$d-vc10.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: - -$(dist): meta-vc11projs = \ -$(foreach d,$(databases),$(call \ -meta-vc11proj,$1-vc11.vcxproj,$(if $2,$2,$(notdir \ -$1))-$d-vc11.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: - -$(dist): meta-vc12projs = \ -$(foreach d,$(databases),$(call \ -meta-vc12proj,$1-vc12.vcxproj,$(if $2,$2,$(notdir \ -$1))-$d-vc12.vcxproj,database,$d)$(literal_newline)$(literal_tab))@: - -# $1 project name without the -vcN.vc[x]proj suffix. -# -vc8projs = $(addprefix $1-,$(addsuffix -vc8.vcproj,$(databases))) - -vc9projs = $(addprefix $1-,$(addsuffix -vc9.vcproj,$(databases))) - -vc10projs = $(addprefix $1-,$(addsuffix -vc10.vcxproj,$(databases))) \ -$(addprefix $1-,$(addsuffix -vc10.vcxproj.filters,$(databases))) - -vc11projs = $(addprefix $1-,$(addsuffix -vc11.vcxproj,$(databases))) \ -$(addprefix $1-,$(addsuffix -vc11.vcxproj.filters,$(databases))) - -vc12projs = $(addprefix $1-,$(addsuffix -vc12.vcxproj,$(databases))) \ -$(addprefix $1-,$(addsuffix -vc12.vcxproj.filters,$(databases))) - -# $1 solution name without the -vcN.sln suffix. -# $2 extra project suffix in addition to --vcN.vcproj (optional) -# -$(dist): meta-vc8sln1 = \ -$(call meta-vc8sln,$(src_root)/template-vc8.sln,$1-vc8.sln,$2-vc8.vcproj) - -$(dist): meta-vc8slns = \ -$(foreach d,$(databases),$(call \ -meta-vc8sln,$(src_root)/template-vc8.sln,$1-$d-vc8.sln,$2-$d-vc8.vcproj,database,$d)$(literal_newline)\ -$(literal_tab))@: - -$(dist): meta-vc9sln1 = \ -$(call meta-vc9sln,$(src_root)/template-vc9.sln,$1-vc9.sln,$2-vc9.vcproj) - -$(dist): meta-vc9slns = \ -$(foreach d,$(databases),$(call \ -meta-vc9sln,$(src_root)/template-vc9.sln,$1-$d-vc9.sln,$2-$d-vc9.vcproj,database,$d)$(literal_newline)\ -$(literal_tab))@: - -$(dist): meta-vc10sln1 = \ -$(call meta-vc10sln,$(src_root)/template-vc10.sln,$1-vc10.sln,$2-vc10.vcxproj) - -$(dist): meta-vc10slns = \ -$(foreach d,$(databases),$(call \ -meta-vc10sln,$(src_root)/template-vc10.sln,$1-$d-vc10.sln,$2-$d-vc10.vcxproj,database,$d)$(literal_newline)\ -$(literal_tab))@: - -$(dist): meta-vc11sln1 = \ -$(call meta-vc11sln,$(src_root)/template-vc11.sln,$1-vc11.sln,$2-vc11.vcxproj) - -$(dist): meta-vc11slns = \ -$(foreach d,$(databases),$(call \ -meta-vc11sln,$(src_root)/template-vc11.sln,$1-$d-vc11.sln,$2-$d-vc11.vcxproj,database,$d)$(literal_newline)\ -$(literal_tab))@: - -$(dist): meta-vc12sln1 = \ -$(call meta-vc12sln,$(src_root)/template-vc12.sln,$1-vc12.sln,$2-vc12.vcxproj) - -$(dist): meta-vc12slns = \ -$(foreach d,$(databases),$(call \ -meta-vc12sln,$(src_root)/template-vc12.sln,$1-$d-vc12.sln,$2-$d-vc12.vcxproj,database,$d)$(literal_newline)\ -$(literal_tab))@: - -vc8slns = $(addprefix $1-,$(addsuffix -vc8.sln,$(databases))) -vc9slns = $(addprefix $1-,$(addsuffix -vc9.sln,$(databases))) -vc10slns = $(addprefix $1-,$(addsuffix -vc10.sln,$(databases))) -vc11slns = $(addprefix $1-,$(addsuffix -vc11.sln,$(databases))) -vc12slns = $(addprefix $1-,$(addsuffix -vc12.sln,$(databases))) - -endif - -# If we don't have dependency auto-generation then we need to manually -# make sure that ODB files are generated before C++ file are compiler. -# To do this we make the object files ($2) depend in order-only on -# generated files ($3). -# -# Also make generated files depend on config.h so that we don't get -# annoying noise during dependency auto-generation. -# -ifeq ($(cxx_id),generic) - -define include-dep -$(if $2,$(eval $2: | $3)) \ -$(if $(and $3,$(subst $(out_root)/libcommon/common/config.h,,$3)),$(eval \ -$3: $(out_root)/libcommon/common/config.h)) -endef - -else - -define include-dep -$(if $(and $3,$(subst $(out_root)/libcommon/common/config.h,,$3)),$(eval \ -$3: $(out_root)/libcommon/common/config.h)) \ -$(call -include,$1) -endef - -endif - -# Don't include dependency info for certain targets. -# -ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),) -include-dep = -endif - -.DEFAULT_GOAL := $(def_goal) diff --git a/build/configuration-rules.make b/build/configuration-rules.make deleted file mode 100644 index ee464cd..0000000 --- a/build/configuration-rules.make +++ /dev/null @@ -1,18 +0,0 @@ -# file : build/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/configuration-dynamic.make: | $(dcf_root)/. - $(call message,,$(scf_root)/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $$1,rm -f $$1,$(dcf_root)/configuration-dynamic.make) - $(call message,rm $$1,rm -f $$1,$(dcf_root)/*.options) - $(call message,rm $$1,rm -f $$1,$(dcf_root)/*-driver) - -endif - -ifeq ($(.DEFAULT_GOAL),$(dcf_root)/configuration-dynamic.make) -.DEFAULT_GOAL := -endif diff --git a/build/configuration.make b/build/configuration.make deleted file mode 100644 index 9b6e0b8..0000000 --- a/build/configuration.make +++ /dev/null @@ -1,20 +0,0 @@ -# file : build/configuration.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/configuration-rules.make,$(dcf_root)) - -# Dynamic configuration. -# -db_id := - -$(call -include,$(dcf_root)/configuration-dynamic.make) - -ifdef db_id - -$(out_root)/%: db_id := $(db_id) - -else - -.NOTPARALLEL: - -endif diff --git a/build/configure b/build/configure deleted file mode 100755 index e421ec3..0000000 --- a/build/configure +++ /dev/null @@ -1,45 +0,0 @@ -#! /usr/bin/env bash - -# file : build/configure -# 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 -$echo "configuring '$project_name'" -$echo -$echo - -databases="mysql sqlite pgsql oracle mssql" - -$echo -$echo "Please select the database you would like to use:" -$echo -$echo "(1) MySQL" -$echo "(2) SQLite" -$echo "(3) PostgreSQL" -$echo "(4) Oracle" -$echo "(5) Microsoft SQL Server" -$echo "(6) Dynamic multi-database support (all above databases)" -$echo - -db_id=`read_option "$databases common"` - -echo "db_id := $db_id" >$1 - -if [ $db_id != "common" ]; then - source $scf_root/$db_id/configure -else - # For multi-database support we configure every database. - # - for db in $databases; do - source $scf_root/$db/configure - done -fi diff --git a/build/export.build b/build/export.build new file mode 100644 index 0000000..3c073d3 --- /dev/null +++ b/build/export.build @@ -0,0 +1,9 @@ +# file : build/export.build +# license : GNU GPL v2; see accompanying LICENSE file + +$out_root/ +{ + include libcommon/ +} + +export $out_root/libcommon/$import.target diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make deleted file mode 100644 index dba014c..0000000 --- a/build/import/libboost/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libboost/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. - $(call message,,$(scf_root)/import/libboost/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libboost/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libboost/configuration-dynamic.make) - -endif diff --git a/build/import/libboost/configure b/build/import/libboost/configure deleted file mode 100755 index 84d03b2..0000000 --- a/build/import/libboost/configure +++ /dev/null @@ -1,72 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libboost/configure -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out config file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'boost libraries' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'boost libraries' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -if [ "$installed" = "n" ]; then - - $echo - $echo "Please enter the 'boost' root directory." - $echo - - root=`read_path --directory --exist` - - $echo - $echo "Please select the library type you would like to use:" - $echo - $echo "(1) archive" - $echo "(2) shared object" - $echo - - type=`read_option "archive shared" "shared"` -fi - -$echo -$echo "Link explicitly to the boost system library? This library" -$echo "is available since boost 1.35.0 and linking to it explicitly" -$echo "may be required by newer linkers." -$echo - -link_system=`read_y_n y` - -$echo -$echo "Please enter optional suffix that may be embedded into the" -$echo "boost library names. For example, if your library names are in" -$echo "the libboost_regex-gcc41-mt-d.so form, then enter -gcc41-mt-d" -$echo "Otherwise leave this field blank." -$echo - -suffix= -read -e -p "[]: " suffix - -echo libboost_installed := $installed >$1 -echo libboost_suffix := $suffix >>$1 -echo libboost_system := $link_system >>$1 - -if [ "$installed" = "n" ]; then - - echo libboost_root := $root >>$1 - echo libboost_type := $type >>$1 - -fi diff --git a/build/import/libboost/date-time/rules.make b/build/import/libboost/date-time/rules.make deleted file mode 100644 index abc8819..0000000 --- a/build/import/libboost/date-time/rules.make +++ /dev/null @@ -1,49 +0,0 @@ -# file : build/import/libboost/date-time/rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libboost/%: root := $(libboost_root) - -$(dcf_root)/import/libboost/date-time/date-time.l: \ - | $(dcf_root)/import/libboost/date-time/. - -ifeq ($(libboost_type),archive) - -ifeq ($(libboost_system),y) -$(dcf_root)/import/libboost/date-time/date-time.l: \ - $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).a \ - $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).a -else -$(dcf_root)/import/libboost/date-time/date-time.l: \ - $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).a -endif - @echo $^ >$@ - -else - -ifeq ($(libboost_system),y) -$(dcf_root)/import/libboost/date-time/date-time.l: \ - $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).so \ - $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).so -else -$(dcf_root)/import/libboost/date-time/date-time.l: \ - $(libboost_root)/stage/lib/libboost_date_time$(libboost_suffix).so -endif - @echo $^ >$@ - @echo rpath:$(root)/stage/lib >>$@ - -endif - - -$(dcf_root)/import/libboost/date-time/date-time.l.cpp-options: \ - | $(dcf_root)/import/libboost/date-time/. - @echo include: -I$(root) >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libboost/date-time/date-time.l,\ -rm -f $(dcf_root)/import/libboost/date-time/date-time.l) - $(call message,,\ -rm -f $(dcf_root)/import/libboost/date-time/date-time.l.cpp-options) - -endif diff --git a/build/import/libboost/date-time/stub.make b/build/import/libboost/date-time/stub.make deleted file mode 100644 index 6f3aad2..0000000 --- a/build/import/libboost/date-time/stub.make +++ /dev/null @@ -1,34 +0,0 @@ -# file : build/import/libboost/date-time/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) - -libboost_installed := - -$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make) - -ifdef libboost_installed - -ifeq ($(libboost_installed),y) - -ifeq ($(libboost_system),y) -$(call export,l: -lboost_date_time$(libboost_suffix) -lboost_system$(libboost_suffix),cpp_options: ) -else -$(call export,l: -lboost_date_time$(libboost_suffix),cpp_options: ) -endif - -else - -$(call include-once,$(scf_root)/import/libboost/date-time/rules.make,$(dcf_root)) - -$(call export,\ - l: $(dcf_root)/import/libboost/date-time/date-time.l,\ - cpp-options: $(dcf_root)/import/libboost/date-time/date-time.l.cpp-options) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libboost/header-only/rules.make b/build/import/libboost/header-only/rules.make deleted file mode 100644 index b5b0726..0000000 --- a/build/import/libboost/header-only/rules.make +++ /dev/null @@ -1,16 +0,0 @@ -# file : build/import/libboost/header-only/rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libboost/%: root := $(libboost_root) - -$(dcf_root)/import/libboost/header-only/header-only.l.cpp-options: \ - | $(dcf_root)/import/libboost/header-only/. - @echo include: -I$(root) >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libboost/header-only/header-only.l,\ -rm -f $(dcf_root)/import/libboost/header-only/header-only.l.cpp-options) - -endif diff --git a/build/import/libboost/header-only/stub.make b/build/import/libboost/header-only/stub.make deleted file mode 100644 index eebddbf..0000000 --- a/build/import/libboost/header-only/stub.make +++ /dev/null @@ -1,26 +0,0 @@ -# file : build/import/libboost/header-only/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) - -libboost_installed := - -$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make) - -ifdef libboost_installed - -ifeq ($(libboost_installed),n) - -$(call include-once,$(scf_root)/import/libboost/header-only/rules.make,$(dcf_root)) - -$(call export,\ - l: ,\ - cpp-options: $(dcf_root)/import/libboost/header-only/header-only.l.cpp-options) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libboost/version b/build/import/libboost/version deleted file mode 100644 index faef31a..0000000 --- a/build/import/libboost/version +++ /dev/null @@ -1 +0,0 @@ -0.7.0 diff --git a/build/import/libodb-boost/configuration-rules.make b/build/import/libodb-boost/configuration-rules.make deleted file mode 100644 index a347655..0000000 --- a/build/import/libodb-boost/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-boost/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-boost/configuration-dynamic.make: | $(dcf_root)/import/libodb-boost/. - $(call message,,$(scf_root)/import/libodb-boost/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-boost/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-boost/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-boost/configure b/build/import/libodb-boost/configure deleted file mode 100755 index 8330535..0000000 --- a/build/import/libodb-boost/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-boost/configure -# 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-boost' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-boost' 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-boost'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-boost'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_boost_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-boost/stub.make b/build/import/libodb-boost/stub.make deleted file mode 100644 index 73e80e6..0000000 --- a/build/import/libodb-boost/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-boost/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-boost/configuration-rules.make,$(dcf_root)) - -libodb_boost_installed := - -$(call -include,$(dcf_root)/import/libodb-boost/configuration-dynamic.make) - -ifdef libodb_boost_installed - -ifeq ($(libodb_boost_installed),y) - -$(call export,l: -lodb-boost -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-boost/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-mssql/configuration-rules.make b/build/import/libodb-mssql/configuration-rules.make deleted file mode 100644 index 5fd58bc..0000000 --- a/build/import/libodb-mssql/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-mssql/configuration-rules.make -# license : ODB NCUEL; see accompanying LICENSE file - -$(dcf_root)/import/libodb-mssql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mssql/. - $(call message,,$(scf_root)/import/libodb-mssql/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-mssql/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-mssql/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-mssql/configure b/build/import/libodb-mssql/configure deleted file mode 100755 index 5e2a28a..0000000 --- a/build/import/libodb-mssql/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-mssql/configure -# license : ODB NCUEL; 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-mssql' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-mssql' 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-mssql'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-mssql'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_mssql_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-mssql/stub.make b/build/import/libodb-mssql/stub.make deleted file mode 100644 index eebf11a..0000000 --- a/build/import/libodb-mssql/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-mssql/stub.make -# license : ODB NCUEL; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-mssql/configuration-rules.make,$(dcf_root)) - -libodb_mssql_installed := - -$(call -include,$(dcf_root)/import/libodb-mssql/configuration-dynamic.make) - -ifdef libodb_mssql_installed - -ifeq ($(libodb_mssql_installed),y) - -$(call export,l: -lodb-mssql -lodb -lodbc,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-mssql/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-mysql/configuration-rules.make b/build/import/libodb-mysql/configuration-rules.make deleted file mode 100644 index 384d3d4..0000000 --- a/build/import/libodb-mysql/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-mysql/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-mysql/configuration-dynamic.make: | $(dcf_root)/import/libodb-mysql/. - $(call message,,$(scf_root)/import/libodb-mysql/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-mysql/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-mysql/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-mysql/configure b/build/import/libodb-mysql/configure deleted file mode 100755 index 2a1fa8d..0000000 --- a/build/import/libodb-mysql/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-mysql/configure -# 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-mysql' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-mysql' 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-mysql'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-mysql'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_mysql_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-mysql/stub.make b/build/import/libodb-mysql/stub.make deleted file mode 100644 index 1b1ecbb..0000000 --- a/build/import/libodb-mysql/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-mysql/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-mysql/configuration-rules.make,$(dcf_root)) - -libodb_mysql_installed := - -$(call -include,$(dcf_root)/import/libodb-mysql/configuration-dynamic.make) - -ifdef libodb_mysql_installed - -ifeq ($(libodb_mysql_installed),y) - -$(call export,l: -lodb-mysql -lodb -lmysqlclient_r,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-mysql/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-oracle/configuration-rules.make b/build/import/libodb-oracle/configuration-rules.make deleted file mode 100644 index cef4150..0000000 --- a/build/import/libodb-oracle/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-oracle/configuration-rules.make -# license : ODB NCUEL; see accompanying LICENSE file - -$(dcf_root)/import/libodb-oracle/configuration-dynamic.make: | $(dcf_root)/import/libodb-oracle/. - $(call message,,$(scf_root)/import/libodb-oracle/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-oracle/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-oracle/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-oracle/configure b/build/import/libodb-oracle/configure deleted file mode 100755 index 81cd5e4..0000000 --- a/build/import/libodb-oracle/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-oracle/configure -# license : ODB NCUEL; 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-oracle' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-oracle' 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-oracle'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-oracle'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_oracle_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-oracle/stub.make b/build/import/libodb-oracle/stub.make deleted file mode 100644 index 6861dc7..0000000 --- a/build/import/libodb-oracle/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-oracle/stub.make -# license : ODB NCUEL; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-oracle/configuration-rules.make,$(dcf_root)) - -libodb_oracle_installed := - -$(call -include,$(dcf_root)/import/libodb-oracle/configuration-dynamic.make) - -ifdef libodb_oracle_installed - -ifeq ($(libodb_oracle_installed),y) - -$(call export,l: -lodb-oracle -lodb -lclntsh,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-oracle/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-pgsql/configuration-rules.make b/build/import/libodb-pgsql/configuration-rules.make deleted file mode 100644 index 326a60c..0000000 --- a/build/import/libodb-pgsql/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-pgsql/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-pgsql/configuration-dynamic.make: | $(dcf_root)/import/libodb-pgsql/. - $(call message,,$(scf_root)/import/libodb-pgsql/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-pgsql/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-pgsql/configure b/build/import/libodb-pgsql/configure deleted file mode 100755 index 9d75cad..0000000 --- a/build/import/libodb-pgsql/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-pgsql/configure -# 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-pgsql' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-pgsql' 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-pgsql'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-pgsql'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_pgsql_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-pgsql/stub.make b/build/import/libodb-pgsql/stub.make deleted file mode 100644 index b770a63..0000000 --- a/build/import/libodb-pgsql/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-pgsql/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-pgsql/configuration-rules.make,$(dcf_root)) - -libodb_pgsql_installed := - -$(call -include,$(dcf_root)/import/libodb-pgsql/configuration-dynamic.make) - -ifdef libodb_pgsql_installed - -ifeq ($(libodb_pgsql_installed),y) - -$(call export,l: -lodb-pgsql -lodb -lpq,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-pgsql/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-qt/configuration-rules.make b/build/import/libodb-qt/configuration-rules.make deleted file mode 100644 index 9765a0c..0000000 --- a/build/import/libodb-qt/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-qt/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-qt/configuration-dynamic.make: | $(dcf_root)/import/libodb-qt/. - $(call message,,$(scf_root)/import/libodb-qt/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-qt/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-qt/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-qt/configure b/build/import/libodb-qt/configure deleted file mode 100755 index 6213974..0000000 --- a/build/import/libodb-qt/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-qt/configure -# 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-qt' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-qt' 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-qt'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-qt'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_qt_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-qt/stub.make b/build/import/libodb-qt/stub.make deleted file mode 100644 index bd5e2ea..0000000 --- a/build/import/libodb-qt/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-qt/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-qt/configuration-rules.make,$(dcf_root)) - -libodb_qt_installed := - -$(call -include,$(dcf_root)/import/libodb-qt/configuration-dynamic.make) - -ifdef libodb_qt_installed - -ifeq ($(libodb_qt_installed),y) - -$(call export,l: -lodb-qt -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-qt/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb-sqlite/configuration-rules.make b/build/import/libodb-sqlite/configuration-rules.make deleted file mode 100644 index bf8dee4..0000000 --- a/build/import/libodb-sqlite/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb-sqlite/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb-sqlite/configuration-dynamic.make: | $(dcf_root)/import/libodb-sqlite/. - $(call message,,$(scf_root)/import/libodb-sqlite/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb-sqlite/configuration-dynamic.make) - -endif diff --git a/build/import/libodb-sqlite/configure b/build/import/libodb-sqlite/configure deleted file mode 100755 index 9f245f5..0000000 --- a/build/import/libodb-sqlite/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb-sqlite/configure -# 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-sqlite' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'libodb-sqlite' 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-sqlite'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb-sqlite'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_sqlite_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-sqlite/stub.make b/build/import/libodb-sqlite/stub.make deleted file mode 100644 index 417e65a..0000000 --- a/build/import/libodb-sqlite/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb-sqlite/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb-sqlite/configuration-rules.make,$(dcf_root)) - -libodb_sqlite_installed := - -$(call -include,$(dcf_root)/import/libodb-sqlite/configuration-dynamic.make) - -ifdef libodb_sqlite_installed - -ifeq ($(libodb_sqlite_installed),y) - -$(call export,l: -lodb-sqlite -lodb -lsqlite3,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb-sqlite/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make deleted file mode 100644 index 340c418..0000000 --- a/build/import/libodb/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libodb/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/. - $(call message,,$(scf_root)/import/libodb/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/libodb/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libodb/configuration-dynamic.make) - -endif diff --git a/build/import/libodb/configure b/build/import/libodb/configure deleted file mode 100755 index 261a202..0000000 --- a/build/import/libodb/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libodb/configure -# 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' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed " -$echo "version of 'libodb' 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'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'libodb'." -$echo - -out_root=`read_path --directory $src_root` - -fi - -echo libodb_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/stub.make b/build/import/libodb/stub.make deleted file mode 100644 index 04dc786..0000000 --- a/build/import/libodb/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/libodb/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root)) - -libodb_installed := - -$(call -include,$(dcf_root)/import/libodb/configuration-dynamic.make) - -ifdef libodb_installed - -ifeq ($(libodb_installed),y) - -$(call export,l: -lodb,cpp-options: ) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/libodb/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libqt/configuration-rules.make b/build/import/libqt/configuration-rules.make deleted file mode 100644 index badc561..0000000 --- a/build/import/libqt/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/libqt/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libqt/configuration-dynamic.make: | $(dcf_root)/import/libqt/. - $(call message,,$(scf_root)/import/libqt/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libqt/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libqt/configuration-dynamic.make) - -endif diff --git a/build/import/libqt/configure b/build/import/libqt/configure deleted file mode 100755 index 904d126..0000000 --- a/build/import/libqt/configure +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libqt/configure -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out config file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'Qt libraries' for '$project_name'." -$echo - -$echo -$echo "Which version of Qt would you like to use?" -$echo -$echo "(1) Qt5" -$echo "(2) Qt4" -$echo -version=`read_option "5 4" "5"` - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'Qt libraries' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -if [ "$installed" = "n" ]; then - - $echo - $echo "Please enter the 'Qt' root directory." - $echo - - root=`read_path --directory --exist` - - $echo - $echo "Please select the library type you would like to use:" - $echo - $echo "(1) archive" - $echo "(2) shared object" - $echo - - type=`read_option "archive shared" "shared"` - -else - core_libs= - if [ "$version" = "5" ]; then - - if pkg-config --exists Qt5Core; then - core_cppflags=`pkg-config --cflags Qt5Core` - core_libs=`pkg-config --libs Qt5Core` - fi - - else - - if pkg-config --exists QtCore; then - core_cppflags=`pkg-config --cflags QtCore` - core_libs=`pkg-config --libs QtCore` - fi - - fi - - if [ "$core_libs" = "" ]; then - - $echo - $echo "Unable to discover installed 'Qt libraries' using pkg-config." - $echo "Assuming the C++ compiler will find them automatically." - $echo - - core_cppflags= - - if [ "$version" = "5" ]; then - core_libs=-lQt5Core - else - core_libs=-lQtCore - fi - fi -fi - - -echo libqt_version := $version >$1 -echo libqt_installed := $installed >>$1 - -if [ "$installed" = "n" ]; then - echo libqt_root := $root >>$1 - echo libqt_type := $type >>$1 -else - echo libqt_core_cppflags := $core_cppflags >>$1 - echo libqt_core_libs := $core_libs >>$1 -fi diff --git a/build/import/libqt/core/rules.make b/build/import/libqt/core/rules.make deleted file mode 100644 index 1fd6f10..0000000 --- a/build/import/libqt/core/rules.make +++ /dev/null @@ -1,26 +0,0 @@ -# file : build/import/libqt/core/rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libqt/%: root := $(libqt_root) -$(dcf_root)/import/libqt/core/core.l: | $(dcf_root)/import/libqt/core/. - -ifeq ($(libqt_type),archive) -$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.a - @echo $^ >$@ -else -$(dcf_root)/import/libqt/core/core.l: $(libqt_root)/lib/libQtCore.so - @echo $^ >$@ - @echo rpath:$(root)/lib >>$@ -endif - -$(dcf_root)/import/libqt/core/core.l.cpp-options: | $(dcf_root)/import/libqt/core/. - @echo include: -I$(root)/include -I$(root)/include/QtCore >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libqt/core/core.l,\ -rm -f $(dcf_root)/import/libqt/core/core.l) - $(call message,,rm -f $(dcf_root)/import/libqt/core/core.l.cpp-options) - -endif diff --git a/build/import/libqt/core/stub.make b/build/import/libqt/core/stub.make deleted file mode 100644 index 1a13bde..0000000 --- a/build/import/libqt/core/stub.make +++ /dev/null @@ -1,35 +0,0 @@ -# file : build/import/libqt/core/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libqt/configuration-rules.make,$(dcf_root)) - -libqt_version := -libqt_installed := - -$(call -include,$(dcf_root)/import/libqt/configuration-dynamic.make) - -ifdef libqt_installed - -ifeq ($(libqt_installed),y) - -$(call export,\ - l: $(libqt_core_libs),\ - cpp-options: ,\ - cpp-options-inline: $(libqt_core_cppflags)) - -else - -$(call include-once,$(scf_root)/import/libqt/core/rules.make,$(dcf_root)) - -$(call export,\ - l: $(dcf_root)/import/libqt/core/core.l,\ - cpp-options: $(dcf_root)/import/libqt/core/core.l.cpp-options,\ - cpp-options-inline: ) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libqt/version b/build/import/libqt/version deleted file mode 100644 index 6e8bf73..0000000 --- a/build/import/libqt/version +++ /dev/null @@ -1 +0,0 @@ -0.1.0 diff --git a/build/import/odb/configuration-rules.make b/build/import/odb/configuration-rules.make deleted file mode 100644 index eef9b0e..0000000 --- a/build/import/odb/configuration-rules.make +++ /dev/null @@ -1,13 +0,0 @@ -# file : build/import/odb/configuration-rules.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/odb/configuration-dynamic.make: | $(dcf_root)/import/odb/. - $(call message,,$(scf_root)/import/odb/configure $@) - -ifndef %foreign% - -$(dcf_root)/.disfigure:: - $(call message,rm $(dcf_root)/import/odb/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/odb/configuration-dynamic.make) - -endif diff --git a/build/import/odb/configure b/build/import/odb/configure deleted file mode 100755 index ee0cdfa..0000000 --- a/build/import/odb/configure +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/odb/configure -# 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 'odb' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed " -$echo "version of 'odb' 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 'odb'." -$echo - -src_root=`read_path --directory --exist` - -$echo -$echo "Please enter the out_root for 'odb'." -$eche - -out_root=`read_path --directory $src_root` - -fi - -echo odb_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/odb/hxx-cxx.make b/build/import/odb/hxx-cxx.make deleted file mode 100644 index 987acc0..0000000 --- a/build/import/odb/hxx-cxx.make +++ /dev/null @@ -1,127 +0,0 @@ -# file : build/import/odb/hxx-cxx.make -# license : GNU GPL v3; see accompanying LICENSE file - -# Here we are operating in the importing project's space, not in odb's. -# - -# Get the C++ configuration (file extensions, and extra CPP options). -# -$(call include,$(bld_root)/cxx/configuration.make) - -odb_databases := mysql sqlite pgsql oracle mssql - -odb_pattern := \ -$(out_base)/%-odb.$(cxx_s_suffix) \ -$(out_base)/%-odb.$(cxx_h_suffix) \ -$(out_base)/%-odb.$(cxx_i_suffix) \ -$(out_base)/%.sql - -odb_patterns := $(odb_pattern) - -define odb-db-pattern -odb_$1_pattern := \ -$$(out_base)/%-odb-$1.$$(cxx_s_suffix) \ -$$(out_base)/%-odb-$1.$$(cxx_h_suffix) \ -$$(out_base)/%-odb-$1.$$(cxx_i_suffix) \ -$$(out_base)/%-$1.sql - -odb_patterns += $$(odb_$1_pattern) - -endef # Trailing newline is important. - -$(foreach d,$(odb_databases),$(eval $(call odb-db-pattern,$d))) - -$(odb_patterns): odb_options := \ ---hxx-suffix .$(cxx_h_suffix) \ ---ixx-suffix .$(cxx_i_suffix) \ ---cxx-suffix .$(cxx_s_suffix) - -$(odb_patterns): odb-expand-cpp-options-impl = \ -$(if $1,$(shell sed -e 's%include: \(.*\)%\1%' -e t -e d $1)) - -$(odb_patterns): odb-expand-cpp-options = \ -$(call odb-expand-cpp-options-impl,$(filter %.cpp-options,$1)) - -# We only check for the long option name to avoid false positives. -# -$(odb_pattern): odb-default-database = \ -$(if $(filter --multi-database ,$(odb_options)),--database common ) - -$(odb_pattern): odb-default-database-message = \ -$(if $(filter --multi-database ,$(odb_options)),[common] ) - -.PRECIOUS: $(odb_patterns) - -ifeq ($(out_base),$(src_base)) - -$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) - $(call message,odb $(call odb-default-database-message)$<,$(odb) \ -$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ -$(odb_options) $(call odb-default-database)--output-dir $(dir $@) $<) - -define odb-db-rule -$$(odb_$1_pattern): $$(src_base)/%.$$(cxx_h_suffix) - $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ -$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ ---database $1 --output-dir $$(dir $$@) $$<) - -endef # Trailing newline is important. - -else - -$(odb_pattern): $(src_base)/%.$(cxx_h_suffix) | $$(dir $$@). - $(call message,odb $(call odb-default-database-message)$<,$(odb) \ -$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ -$(odb_options) $(call odb-default-database)--output-dir $(dir $@) $<) - -$(odb_pattern): $(out_base)/%.$(cxx_h_suffix) | $$(dir $$@). - $(call message,odb $(call odb-default-database-message)$<,$(odb) \ -$(cpp_options) $(call odb-expand-cpp-options,$^) $(cxx_pp_extra_options) \ -$(odb_options) $(call odb-default-database) --output-dir $(dir $@) $<) - -define odb-db-rule -$$(odb_$1_pattern): $$(src_base)/%.$$(cxx_h_suffix) | $$$$(dir $$$$@). - $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ -$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ ---database $1 --output-dir $$(dir $$@) $$<) - -$$(odb_$1_pattern): $$(out_base)/%.$$(cxx_h_suffix) | $$$$(dir $$$$@). - $$(call message,odb [$1] $$<,$$(odb) $$(cpp_options) \ -$$(call odb-expand-cpp-options,$$^) $$(cxx_pp_extra_options) $$(odb_options) \ ---database $1 --output-dir $$(dir $$@) $$<) - -endef # Trailing newline is important. -endif - -$(foreach d,$(odb_databases),$(eval $(call odb-db-rule,$d))) - -# Clean. -# -.PHONY: $(out_base)/%-odb.cxx.hxx.clean - -$(out_base)/%-odb.cxx.hxx.clean: cxx_s_suffix := $(cxx_s_suffix) -$(out_base)/%-odb.cxx.hxx.clean: cxx_h_suffix := $(cxx_h_suffix) -$(out_base)/%-odb.cxx.hxx.clean: cxx_i_suffix := $(cxx_i_suffix) - -$(out_base)/%-odb.cxx.hxx.clean: - $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_s_suffix))) - $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_h_suffix))) - $(call message,rm $$1,rm -f $$1,$(@:.cxx.hxx.clean=.$(cxx_i_suffix))) - $(call message,rm $$1,rm -f $$1,$(@:-odb.cxx.hxx.clean=.sql)) - -define odb-db-clean-rule -.PHONY: $$(out_base)/%-odb-$1.cxx.hxx.clean - -$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_s_suffix := $$(cxx_s_suffix) -$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_h_suffix := $$(cxx_h_suffix) -$$(out_base)/%-odb-$1.cxx.hxx.clean: cxx_i_suffix := $$(cxx_i_suffix) - -$$(out_base)/%-odb-$1.cxx.hxx.clean: - $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_s_suffix))) - $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_h_suffix))) - $$(call message,rm $$$$1,rm -f $$$$1,$$(@:.cxx.hxx.clean=.$$(cxx_i_suffix))) - $$(call message,rm $$$$1,rm -f $$$$1,$$(@:-odb-$1.cxx.hxx.clean=-$1.sql)) - -endef # Trailing newline is important. - -$(foreach d,$(odb_databases),$(eval $(call odb-db-clean-rule,$d))) diff --git a/build/import/odb/stub.make b/build/import/odb/stub.make deleted file mode 100644 index 05356ca..0000000 --- a/build/import/odb/stub.make +++ /dev/null @@ -1,28 +0,0 @@ -# file : build/import/odb/stub.make -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/odb/configuration-rules.make,$(dcf_root)) - -odb_installed := - -$(call -include,$(dcf_root)/import/odb/configuration-dynamic.make) - -ifdef odb_installed - -ifeq ($(odb_installed),y) - -$(call export,odb: /usr/local/bin/odb,odb-rules: $(scf_root)/import/odb/hxx-cxx.make) - -else - -# Include export stub. -# -$(call include,$(scf_root)/export/odb/stub.make) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/mssql/configure b/build/mssql/configure deleted file mode 100755 index 52cf34b..0000000 --- a/build/mssql/configure +++ /dev/null @@ -1,52 +0,0 @@ -#! /usr/bin/env bash - -# file : build/mssql/configure -# license : GNU GPL v2; see accompanying LICENSE file - -# -# dcf_root - dynamic configuration root -# - -$echo -$echo "Please enter the SQL Server client program path." -$echo - -driver=`read_path --command sqlcmd` - -$echo -$echo "Please enter the SQL Server database user." -$echo - -user=`read_value "odb_test"` - -$echo -$echo "Please enter the SQL Server database password." -$echo - -passwd=`read_value "odb_test"` - -$echo -$echo "Please enter the SQL Server database name. Note that it WILL BE" -$echo "MODIFIED by the tests." -$echo - -db=`read_value "odb_test"` - -$echo -$echo "Please enter the SQL Server instance address." -$echo - -server=`read_value ""` - -opt=$dcf_root/mssql.options -drv=$dcf_root/mssql-driver - -echo "--user '$user'" >$opt -echo "--password '$passwd'" >>$opt -echo "--database '$db'" >>$opt -echo "--server '$server'" >>$opt - -echo "#!/bin/sh" >$drv -echo "opt=\`cat $opt\`" >>$drv -echo "eval $scf_root/mssql/mssql --driver $driver \$opt \$*" >>$drv -chmod 755 $drv diff --git a/build/mssql/mssql b/build/mssql/mssql deleted file mode 100755 index 37792f6..0000000 --- a/build/mssql/mssql +++ /dev/null @@ -1,51 +0,0 @@ -#! /usr/bin/env bash - -# file : build/mssql/mssql -# license : GNU GPL v2; see accompanying LICENSE file - -# -# SQL Server driver wrapper. -# - -opt= -driver= - -while [ $# -gt 0 ]; do - case $1 in - --driver) - driver=$2 - shift 2 - ;; - --user) - opt="$opt -U $2" - shift 2 - ;; - --password) - opt="$opt -P $2" - shift 2 - ;; - --database) - opt="$opt -d $2" - shift 2 - ;; - --server) - opt="$opt -S $2" - shift 2 - ;; - *) - break - ;; - esac -done - -if [ -z "$driver" ]; then - driver=sqlcmd -fi - -opt="-x -r -b $opt" - -if [ -n "$1" ]; then - exec $driver $opt -i $1 -else - exec $driver $opt -fi diff --git a/build/mysql/configure b/build/mysql/configure deleted file mode 100755 index 0ea5120..0000000 --- a/build/mysql/configure +++ /dev/null @@ -1,75 +0,0 @@ -#! /usr/bin/env bash - -# file : build/mysql/configure -# license : GNU GPL v2; see accompanying LICENSE file - -# -# dcf_root - dynamic configuration root -# - -$echo -$echo "Please enter the MySQL client program path." -$echo - -driver=`read_path --command mysql` - -$echo -$echo "Please enter the MySQL database user." -$echo - -user=`read_value "odb_test"` - -$echo -$echo "Please enter the MySQL database password. Enter NULL for" -$echo "unspecified password as opposed to the empty password." -$echo - -passwd=`read_value "NULL"` - -$echo -$echo "Please enter the MySQL database name. Note that it WILL BE" -$echo "MODIFIED by the tests." -$echo - -db=`read_value "odb_test"` - -$echo -$echo "Please enter the MySQL database host." -$echo - -host=`read_value ""` - -$echo -$echo "Please enter the MySQL database port." -$echo - -port=`read_value "0"` - -$echo -$echo "Please enter the MySQL database socket name. Enter NULL for" -$echo "unspecified name as opposed to the empty name." -$echo - -socket=`read_value "NULL"` - -opt=$dcf_root/mysql.options -drv=$dcf_root/mysql-driver - -echo "--user '$user'" >$opt - -if [ "$passwd" != "NULL" ]; then -echo "--password '$passwd'" >>$opt -fi - -echo "--database '$db'" >>$opt -echo "--host '$host'" >>$opt -echo "--port $port" >>$opt - -if [ "$socket" != "NULL" ]; then -echo "--socket '$socket'" >>$opt -fi - -echo "#!/bin/sh" >$drv -echo "opt=\`cat $opt\`" >>$drv -echo "eval $scf_root/mysql/mysql --driver $driver \$opt \$*" >>$drv -chmod 755 $drv diff --git a/build/mysql/mysql b/build/mysql/mysql deleted file mode 100755 index 7d224c8..0000000 --- a/build/mysql/mysql +++ /dev/null @@ -1,57 +0,0 @@ -#! /usr/bin/env bash - -# file : build/mysql/mysql -# license : GNU GPL v2; see accompanying LICENSE file - -# -# MySQL driver wrapper. -# - -opt= -driver= - -while [ $# -gt 0 ]; do - case $1 in - --driver) - driver=$2 - shift 2 - ;; - --user) - opt="$opt --user=$2" - shift 2 - ;; - --password) - opt="$opt --password=$2" - shift 2 - ;; - --database) - opt="$opt --database=$2" - shift 2 - ;; - --host) - opt="$opt --host=$2" - shift 2 - ;; - --port) - opt="$opt --port=$2" - shift 2 - ;; - --socket) - opt="$opt --socket=$2" - shift 2 - ;; - *) - break - ;; - esac -done - -if [ -z "$driver" ]; then - driver=mysql -fi - -if [ -n "$1" ]; then - exec $driver $opt <$1 -else - exec $driver $opt -fi diff --git a/build/oracle/configure b/build/oracle/configure deleted file mode 100755 index 4a87e51..0000000 --- a/build/oracle/configure +++ /dev/null @@ -1,97 +0,0 @@ -#! /usr/bin/env bash - -# file : build/oracle/configure -# license : GNU GPL v2; see accompanying LICENSE file - -# -# dcf_root - dynamic configuration root -# - -$echo -$echo "Please enter the Oracle client program path." -$echo - -driver=`read_path --command sqlplus` - -$echo -$echo "Please enter the Oracle database user." -$echo - -user=`read_value "odb_test"` - -$echo -$echo "Please enter the Oracle database password." -$echo - -# If the user is odb_test then default to odb_test as a password since -# it is unlikely there is the odb_test user with external authentication. -# -if [ "$user" = "odb_test" ]; then - def_passwd=odb_test -else - def_passwd= -fi - -passwd=`read_value "$def_passwd"` - -$echo -$echo "Please enter the Oracle listener host (localhost if left empty)." -$echo - -host=`read_value ""` - -$echo -$echo "Please enter the Oracle listener port (default port if left empty)." -$echo - -port=`read_value ""` - -$echo -$echo "Please enter the Oracle service to use (default service if left" -$echo "empty). Note that the database associated with user $user on this" -$echo "service WILL BE MODIFIED." -$echo - -service=`read_value ""` - -opt=$dcf_root/oracle.options -drv=$dcf_root/oracle-driver - -if [ -n "$user" ]; then -echo "--user '$user'" >$opt -fi - -if [ -n "$passwd" ]; then -echo "--password '$passwd'" >>$opt -fi - -if [ -n "$service" ]; then -echo "--service '$service'" >>$opt -fi - -if [ -n "$host" ]; then -echo "--host '$host'" >>$opt -fi - -if [ -n "$port" ]; then -echo "--port '$port'" >>$opt -fi - -echo "#!/bin/sh" >$drv - -dir=`dirname $driver` -if [ "$dir" != "." ]; then - echo >>$drv - echo 'LD_LIBRARY_PATH="'$dir':$LD_LIBRARY_PATH"' >>$drv - echo "export LD_LIBRARY_PATH" >>$drv - echo >>$drv - echo 'if [ -z "$SQLPATH" ]; then' >>$drv - echo ' SQLPATH="'$dir'"' >>$drv - echo " export SQLPATH" >>$drv - echo "fi" >>$drv - echo >>$drv -fi - -echo "opt=\`cat $opt\`" >>$drv -echo "eval $scf_root/oracle/oracle --driver $driver \$opt \$*" >>$drv -chmod 755 $drv diff --git a/build/oracle/oracle b/build/oracle/oracle deleted file mode 100755 index 58e94f2..0000000 --- a/build/oracle/oracle +++ /dev/null @@ -1,80 +0,0 @@ -#! /usr/bin/env bash - -# file : build/oracle/oracle -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Oracle driver wrapper. -# - -driver= -user= -passwd= -service= -host= -port= - -while [ $# -gt 0 ]; do - case $1 in - --driver) - driver=$2 - shift 2 - ;; - --user) - user="$2" - shift 2 - ;; - --password) - passwd="$2" - shift 2 - ;; - --service) - service="$2" - shift 2 - ;; - --host) - host="$2" - shift 2 - ;; - --port) - port="$2" - shift 2 - ;; - *) - break - ;; - esac -done - -if [ -z "$driver" ]; then - driver=sqlplus -fi - -conn=$user - -if [ -n "$passwd" ]; then - conn="$conn/$passwd" -fi - -if [ -n "$host" ]; then - conn="$conn@//$host" - - if [ -n "$port" ]; then - conn="$conn:$port" - fi - - if [ -n "$service" ]; then - conn="$conn/$service" - fi -elif [ -n "$service" ]; then - conn="$conn@$service" -fi - -opt="-L" - -if [ -n "$1" ]; then - opt="-S $opt" - exec $driver $opt $conn @$1 -else - exec $driver $opt $conn -fi diff --git a/build/pgsql/configure b/build/pgsql/configure deleted file mode 100755 index 9673c15..0000000 --- a/build/pgsql/configure +++ /dev/null @@ -1,63 +0,0 @@ -#! /usr/bin/env bash - -# file : build/pgsql/configure -# license : GNU GPL v2; see accompanying LICENSE file - -# -# dcf_root - dynamic configuration root -# - -$echo -$echo "Please enter the PostgreSQL client program path." -$echo - -driver=`read_path --command psql` - -$echo -$echo "Please enter the PostgreSQL database user. Note that the named" -$echo "user must be allowed to connect to the database server without" -$echo "specifying credentials." -$echo - -user=`read_value "odb_test"` - -$echo -$echo "Please enter the PostgreSQL database name. Note that it WILL BE" -$echo "MODIFIED by the tests." -$echo - -db=`read_value "odb_test"` - -$echo -$echo "Please enter the PostgreSQL database host. Leaving this field" -$echo "blank results in using Unix-domain sockets. Machines without" -$echo "Unix-domain sockets will connect to localhost." -$echo - -host=`read_value ""` - -$echo -$echo "Please enter the PostgreSQL database port or the socket file name" -$echo "extension for Unix-domain connections." -$echo - -port=`read_value ""` - -opt=$dcf_root/pgsql.options -drv=$dcf_root/pgsql-driver - -echo "--user '$user'" >$opt -echo "--database '$db'" >>$opt - -if [ -n "$host" ]; then -echo "--host '$host'" >>$opt -fi - -if [ -n "$port" ]; then -echo "--port '$port'" >>$opt -fi - -echo "#!/bin/sh" >$drv -echo "opt=\`cat $opt\`" >>$drv -echo "eval $scf_root/pgsql/pgsql --driver $driver \$opt \$*" >>$drv -chmod 755 $drv diff --git a/build/pgsql/pgsql b/build/pgsql/pgsql deleted file mode 100755 index d30a102..0000000 --- a/build/pgsql/pgsql +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env bash - -# file : build/pgsql/pgsql -# license : GNU GPL v2; see accompanying LICENSE file - -# -# PostgreSQL driver wrapper. -# - -driver= -opt= - -while [ $# -gt 0 ]; do - case $1 in - --driver) - driver=$2 - shift 2 - ;; - --user) - opt="$opt --user=$2" - shift 2 - ;; - --database) - opt="$opt --dbname=$2" - shift 2 - ;; - --host) - opt="$opt --host=$2" - shift 2 - ;; - --port) - opt="$opt --port=$2" - shift 2 - ;; - *) - break - ;; - esac -done - -if [ -z "$driver" ]; then - driver=psql -fi - -opt="--quiet $opt" - -export PGOPTIONS=--client-min-messages=warning - -if [ -n "$1" ]; then - exec $driver $opt --set ON_ERROR_STOP=1 -f $1 -else - exec $driver $opt -fi diff --git a/build/root.build b/build/root.build new file mode 100644 index 0000000..5336399 --- /dev/null +++ b/build/root.build @@ -0,0 +1,270 @@ +# file : build/root.build +# license : GNU GPL v2; see accompanying LICENSE file + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +# List of the identifiers of the databases to compile and run the tests +# against. The valid identifiers are mysql, sqlite, pgsql, oracle, and mssql. +# +# @@ TODO: change to string_set once available. +# +config [strings] config.odb_tests.database + +assert ($defined(config.odb_tests.database) && \ + $size($config.odb_tests.database) > 0) \ +'at least one database must be configured via config.odb_tests.database variable' + +databases = $config.odb_tests.database + +mysql = false +sqlite = false +pgsql = false +oracle = false +mssql = false + +for db: $databases +{ + switch $db + { + case 'mysql' + mysql = true + + case 'sqlite' + sqlite = true + + case 'pgsql' + pgsql = true + + case 'oracle' + oracle = true + + case 'mssql' + mssql = true + + default + fail "invalid database '$db' specified in config.odb_tests.database value" + } +} + +# If true, then build and run the test drivers in the dynamic multi-database +# mode. +# +config [bool] config.odb_tests.multi_database ?= ($size($databases) > 1) +multi = $config.odb_tests.multi_database + +assert ($multi || $size($databases) == 1) \ +'only one database can be configured if config.odb_tests.multi_database value is false' + +# Database connections. +# + +# PostgreSQL +# +# The database user. Note that the named user must be allowed to connect to +# the database server without specifying credentials. +# +config [string] config.odb_tests.pgsql.user ?= 'odb_test' + +# The database name. Note that it WILL BE MODIFIED by the tests. +# +config [string] config.odb_tests.pgsql.database ?= 'odb_test' + +# The database host. Leaving this variable undefined results in using +# Unix-domain sockets. Machines without Unix-domain sockets will connect to +# localhost. +# +config [string] config.odb_tests.pgsql.host + +# The database port or the socket file name extension for Unix-domain +# connections. +# +config [string] config.odb_tests.pgsql.port + +# If true, then assume that libodb-pgsql supports the bulk operations. +# +# Note: config.odb_tests.pgsql.bulk_default is reflected from manifest. +# +config [bool] config.odb_tests.pgsql.bulk_default ?= false +config [bool] config.odb_tests.pgsql.bulk ?= ($cxx.target.class != 'windows' && \ + $config.odb_tests.pgsql.bulk_default) +pgsql_bulk = $config.odb_tests.pgsql.bulk + +# MySQL +# +# The database user. +# +config [string] config.odb_tests.mysql.user ?= 'odb_test' + +# The database password. +# +config [string] config.odb_tests.mysql.passwd + +# The database name. Note that it WILL BE MODIFIED by the tests. +# +config [string] config.odb_tests.mysql.database ?= 'odb_test' + +# The database host. +# +config [string] config.odb_tests.mysql.host + +# The database port. +# +config [uint64] config.odb_tests.mysql.port + +# The database socket path. +# +config [path] config.odb_tests.mysql.socket + +define sql: file +sql{*}: extension = sql + +define xml: file +xml{*}: extension = xml + +if ($build.mode != 'skeleton') +{ + if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + + switch $cxx.class + { + case 'gcc' + { + cxx.coptions += -Wno-unknown-pragmas + } + case 'msvc' + { + cxx.coptions += /wd4068 /wd4251 /wd4275 /wd4800 + } + } + + # @@ BUILD2 Clang issues the following warnings while compile the + # odb-generated headers: + # + # In file included from odb-tests/common/view/olv/test1-odb-sqlite.cxx:10: + # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: warning: instantiation of variable 'odb::query_columns>::id' required here, but no definition is available [-Wundefined-var-template] + # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, + # | ^ + # odb-tests/common/view/olv/test1-odb.hxx:91:21: note: forward declaration of template entity is here + # 91 | static id_type_ id; + # | ^ + # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: note: add an explicit instantiation declaration to suppress this warning if 'odb::query_columns>::id' is explicitly instantiated in another translation unit + # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, + # + # Note: -Wno-undefined-var-template is temporarily added to suppress them. + # + if ($cxx.id.type == 'clang') + cxx.coptions += -Wno-undefined-var-template + + # Import odb that we are testing. + # + import! [metadata] odb = odb%exe{odb} + + # Import the mysql client for creating the database schemas, etc. + # + if $mysql + { + import! mysql_client = mysql%exe{mysql} + testscript{*}: mysql_client = $mysql_client + } + + # Import the psql client for creating the database schemas, etc. + # + if $pgsql + { + import! pgsql_client = psql%exe{psql} + testscript{*}: pgsql_client = $pgsql_client + } + + # Note that we need ((-.+)?) instead of just (-.+)? because we use this + # capture as a back-reference in the pattern. + # + [rule_name=odb_compile] \ + : hxx{~'/\1/'} libue{~'/.+-meta/'} $odb + {{ + pops = $cxx.lib_poptions($<[1]) + depdb hash $pops + + hp = $path($>[0]) + bn = $base($leaf($hp)) + db = $regex.replace($bn, '.+-odb(-(.+))?', '\2') + + if ($db == '') # *-odb.?xx target group? + db = ($multi ? 'common' : $databases[0]) + end + + # If the external SQL schema file will be generated, then add it as a + # dynamic target group member. + # + # @@ BUILD2 Probably we should add support for --generate-dep ODB compiler + # option. Then presumably this will be take care of automatically. + # + # We assume that the '--generate-schema' and '--schema-format' strings + # will never appear as standalone option values. + # + if ($db != 'common' && $regex.find_match($odb_options, '--generate-schema')) + schema_format = ($db == 'sqlite' ? 'embedded' : 'sql') + + for o: $odb_options + if ($o == '--schema-format') + schema_format = [null] # Indicate that the schema format comes next. + elif ($schema_format == [null]) + schema_format = $o + end + end + else + schema_format = '' + end + + t = ($schema_format == 'sql' \ + ? $directory($hp)/$regex.replace($bn, '(.+)-odb(-.+)?', '\1\2').sql \ + : '') + + depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ + -- echo "$t" + + $odb --std c++11 \ + ($multi ? --multi-database dynamic : ) \ + --database $db \ + --output-dir $out_base \ + $odb_options \ + "-I$src_base" \ + $pops \ + $path($<[0]) + }} + + # Every exe{} in this project is by default a test. + # + exe{*}: test = true + + # Specify the test target for cross-testing. + # + test.target = $cxx.target +} + +# The helper targets which can be used as prerequisites of test drivers +# which require either a specific database client or multiple clients for +# all the enabled databases. +# +alias{mysql-client}: $mysql_client: +{ + include = $mysql + clean = false +} + +alias{pgsql-client}: $pgsql_client: +{ + include = $pgsql + clean = false +} + +alias{database-client}: alias{mysql-client pgsql-client} diff --git a/build/sqlite/configure b/build/sqlite/configure deleted file mode 100755 index 24cc288..0000000 --- a/build/sqlite/configure +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env bash - -# file : build/sqlite/configure -# license : GNU GPL v2; see accompanying LICENSE file - -# -# dcf_root - dynamic configuration root -# - -$echo -$echo "Please enter the SQLite database file name. Note that it WILL" -$echo "BE MODIFIED by the tests. You can also specify ':memory:' as a" -$echo "file name to use a temporary in-memory database." -$echo - -db=`read_value "/tmp/odb-test.db"` - -opt=$dcf_root/sqlite.options - -echo "--database '$db'" >$opt diff --git a/buildfile b/buildfile new file mode 100644 index 0000000..2acd9fc --- /dev/null +++ b/buildfile @@ -0,0 +1,10 @@ +# file : buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: libcommon/ common/ doc{README.md} legal{GPLv2 LICENSE} manifest + +./: mysql/: include = ($mysql && !$multi) +./: sqlite/: include = ($sqlite && !$multi) +./: pgsql/: include = ($pgsql && !$multi) + +./: testscript{*}: include = adhoc diff --git a/common/Makefile.am b/common/Makefile.am deleted file mode 100644 index bd6fd0e..0000000 --- a/common/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# file : common/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) - -if ODB_TESTS_THREADS -SUBDIRS += __path__(thread_dirs) -endif - -if HAVE_CXX11 -SUBDIRS += __path__(cxx11_dirs) -endif - -EXTRA_DIST = __file__(extra_dist) diff --git a/common/access/buildfile b/common/access/buildfile new file mode 100644 index 0000000..f1264d9 --- /dev/null +++ b/common/access/buildfile @@ -0,0 +1,45 @@ +# file : common/access/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix access_ \ + --generate-schema \ + --accessor-regex '#(.+)#Get\u\1#' \ + --modifier-regex '#(.+)#Set\u\1#' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +# @@ BUILD2: Eventually we should be able to mark it as test.input once +# this is supported for testscript tests. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/access/driver.cxx b/common/access/driver.cxx index 483f986..b40e73c 100644 --- a/common/access/driver.cxx +++ b/common/access/driver.cxx @@ -4,18 +4,20 @@ // Test accessor/modifier expressions. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic accessor/modifier functionality. // @@ -49,7 +51,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id ())); + unique_ptr p (db->load (o.id ())); t.commit (); assert (o == *p); @@ -76,7 +78,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id ())); + unique_ptr p (db->load (o.id ())); t.commit (); assert (o == *p); @@ -103,7 +105,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id ())); + unique_ptr p (db->load (o.id ())); t.commit (); assert (p->p1 ()->id () == o.p1 ()->id () && @@ -149,7 +151,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id ())); + unique_ptr p (db->load (o.id ())); t.commit (); assert (o == *p); @@ -179,10 +181,10 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id ())); - auto_ptr p2 (db->load (o2.id ())); - auto_ptr p3 (db->load (o3.id_)); - auto_ptr p4 (db->load (o4.id ())); + unique_ptr p1 (db->load (o1.id ())); + unique_ptr p2 (db->load (o2.id ())); + unique_ptr p3 (db->load (o3.id_)); + unique_ptr p4 (db->load (o4.id ())); t.commit (); } } @@ -245,7 +247,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); + unique_ptr p (db->load (o.id_)); t.commit (); assert (o == *p); diff --git a/common/access/makefile b/common/access/makefile deleted file mode 100644 index 523531e..0000000 --- a/common/access/makefile +++ /dev/null @@ -1,118 +0,0 @@ -# file : common/access/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix access_ --accessor-regex "\#(.+)\#Get\u\1\#" \ ---modifier-regex "\#(.+)\#Set\u\1\#" -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/access/test.hxx b/common/access/test.hxx index ae71103..3a3424d 100644 --- a/common/access/test.hxx +++ b/common/access/test.hxx @@ -4,12 +4,10 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include // std::memcpy, std::memcmp, std::memset -#include // std::auto_ptr/std::unique_ptr +#include // std::unique_ptr #include // std::move #include @@ -239,11 +237,7 @@ namespace test3 { struct object1; -#ifdef HAVE_CXX11 typedef std::unique_ptr object1_ptr; -#else - typedef std::auto_ptr object1_ptr; -#endif #pragma db object pointer(object1_ptr) struct object1 @@ -282,17 +276,11 @@ namespace test3 public: const object1_ptr& p2 () const {return p2_;} -#ifdef HAVE_CXX11 void p2 (object1_ptr p2) {p2_ = std::move (p2);} -#else - void p2 (object1_ptr p2) {p2_ = p2;} -#endif + private: -#ifdef HAVE_CXX11 #pragma db get(p2) set(p2 (std::move (?))) -#else - #pragma db access(p2) -#endif + object1_ptr p2_; }; } diff --git a/common/access/test.std b/common/access/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/access/testscript b/common/access/testscript new file mode 100644 index 0000000..04f0ec0 --- /dev/null +++ b/common/access/testscript @@ -0,0 +1,33 @@ +# file : common/access/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/as/buildfile b/common/as/buildfile new file mode 100644 index 0000000..dcdc961 --- /dev/null +++ b/common/as/buildfile @@ -0,0 +1,49 @@ +# file : common/as/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix as_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# @@ BUILD@ Temporarily suppress the following warning: +# +# test-odb.cxx(6234): warning C4244: 'argument': conversion from 'id_type::value_type' to 'test5::version_type::value_type', possible loss of data +# +if ($cxx.class == 'msvc') + cxx.coptions += /wd4244 + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/as/driver.cxx b/common/as/driver.cxx index 28ce88a..578eb23 100644 --- a/common/as/driver.cxx +++ b/common/as/driver.cxx @@ -4,19 +4,21 @@ // Test C++ type mapping (#pragma map type as ...). // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic type mapping functionality. // @@ -53,8 +55,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -89,8 +91,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -121,8 +123,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -145,8 +147,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -179,8 +181,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -203,8 +205,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -236,8 +238,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -261,8 +263,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); @@ -287,8 +289,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); assert (*p1 == o1); assert (*p2 == o2); @@ -329,8 +331,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (*p1 == o1); diff --git a/common/as/makefile b/common/as/makefile deleted file mode 100644 index 0036ee1..0000000 --- a/common/as/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/as/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix as_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/as/test.std b/common/as/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/as/testscript b/common/as/testscript new file mode 100644 index 0000000..12d9753 --- /dev/null +++ b/common/as/testscript @@ -0,0 +1,33 @@ +# file : common/as/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/blob/buildfile b/common/blob/buildfile new file mode 100644 index 0000000..cc6d164 --- /dev/null +++ b/common/blob/buildfile @@ -0,0 +1,40 @@ +# file : common/blob/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix blob_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx index 57a9e3d..269f415 100644 --- a/common/blob/driver.cxx +++ b/common/blob/driver.cxx @@ -4,20 +4,20 @@ // Test BLOB mapping. // -#include // HAVE_CXX11 - -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -26,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); const char data[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -48,10 +48,8 @@ main (int argc, char* argv[]) o.vuc.assign (udata, udata + sizeof (data)); memcpy (o.c, data, sizeof (data)); memcpy (o.uc, udata, sizeof (data)); -#ifdef HAVE_CXX11 memcpy (o.a.data (), data, sizeof (data)); memcpy (o.ua.data (), udata, sizeof (data)); -#endif o.cont.push_back (1); o.cont.push_back (2); o.cont.push_back (3); @@ -64,7 +62,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/common/blob/makefile b/common/blob/makefile deleted file mode 100644 index 2933c8a..0000000 --- a/common/blob/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/blob/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --table-prefix blob_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/blob/test.hxx b/common/blob/test.hxx index 13f1815..9602ca2 100644 --- a/common/blob/test.hxx +++ b/common/blob/test.hxx @@ -4,15 +4,10 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - +#include #include #include // std::memcmp -#ifdef HAVE_CXX11 -# include -#endif - #include #ifdef ODB_COMPILER @@ -48,13 +43,11 @@ struct object #pragma db type(BLOB_TYPE) unsigned char uc[1024]; -#ifdef HAVE_CXX11 #pragma db type(BLOB_TYPE) std::array a; #pragma db type(BLOB_TYPE) std::array ua; -#endif // Make sure we can still use std::vector and std::array // as containers. @@ -70,10 +63,8 @@ operator== (const object& x, const object& y) && x.vuc == y.vuc && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 && std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 -#ifdef HAVE_CXX11 && x.a == y.a && x.ua == y.ua -#endif && x.cont == y.cont; } diff --git a/common/blob/test.std b/common/blob/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/blob/testscript b/common/blob/testscript new file mode 100644 index 0000000..4fb9955 --- /dev/null +++ b/common/blob/testscript @@ -0,0 +1,33 @@ +# file : common/blob/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/buildfile b/common/buildfile new file mode 100644 index 0000000..cb9c748 --- /dev/null +++ b/common/buildfile @@ -0,0 +1,6 @@ +# file : common/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -bulk/} + +./: bulk/: include = (!$pgsql || $pgsql_bulk || $size($databases) != 1) diff --git a/common/bulk/buildfile b/common/bulk/buildfile new file mode 100644 index 0000000..417eb22 --- /dev/null +++ b/common/bulk/buildfile @@ -0,0 +1,49 @@ +# file : common/bulk/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert (!$pgsql || $pgsql_bulk || $size($databases) != 1) \ +"bulk operations are disabled for pgsql which is specified as single database" + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases +{ + if ($db != 'pgsql' || $pgsql_bulk) + import libs += libodb-$db%lib{odb-$db} +} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: \ + include = ($multi && ($db != 'pgsql' || $pgsql_bulk)) + + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix bulk_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 2214bfd..23b49ad 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -4,9 +4,8 @@ // Test bulk database operations. // -#include // std::auto_ptr +#include // std::unique_ptr #include -#include #include #include @@ -15,12 +14,15 @@ #include -#include // HAVE_CXX11, DATABASE_* -#include +#include // DATABASE_* +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -41,7 +43,7 @@ struct element_traits { typedef T type; typedef T* pointer; - typedef std::auto_ptr auto_ptr; + typedef std::unique_ptr unique_ptr; static T& ref (T& x) {return x;} static T* ptr (T* p) {return p;} @@ -52,43 +54,30 @@ struct element_traits { typedef T type; typedef T* pointer; - typedef std::auto_ptr auto_ptr; + typedef std::unique_ptr unique_ptr; static T& ref (T* p) {return *p;} static T* ptr (T* p) {return p;} }; template -struct element_traits > -{ - typedef T type; - typedef std::auto_ptr pointer; - typedef std::auto_ptr auto_ptr; - - static T& ref (const auto_ptr& p) {return *p;} - static T* ptr (const auto_ptr& p) {return p.get ();} -}; - -#ifdef HAVE_CXX11 -template -struct element_traits> +struct element_traits > { typedef T type; typedef std::unique_ptr pointer; - typedef std::unique_ptr auto_ptr; + typedef std::unique_ptr unique_ptr; - static T& ref (const unique_ptr& p) {return *p;} - static T* ptr (const unique_ptr& p) {return p.get ();} + static T& ref (const unique_ptr& p) {return *p;} + static T* ptr (const unique_ptr& p) {return p.get ();} }; -#endif template void -persist (const auto_ptr& db, I b, I e, bool cont = true) +persist (const unique_ptr& db, I b, I e, bool cont = true) { typedef element_traits traits; typedef typename traits::type type; - typedef typename traits::auto_ptr auto_ptr; + typedef typename traits::unique_ptr unique_ptr; { transaction t (db->begin ()); @@ -104,7 +93,7 @@ persist (const auto_ptr& db, I b, I e, bool cont = true) for (I i (b); i != e; ++i) { type& x (traits::ref (*i)); - auto_ptr p (db->load (x.id)); + unique_ptr p (db->load (x.id)); assert (p->n == x.n && p->s == x.s); } @@ -114,7 +103,7 @@ persist (const auto_ptr& db, I b, I e, bool cont = true) template void -try_persist (const auto_ptr& db, I b, I e, bool cont = true) +try_persist (const unique_ptr& db, I b, I e, bool cont = true) { try { @@ -129,12 +118,12 @@ try_persist (const auto_ptr& db, I b, I e, bool cont = true) template void -update (const auto_ptr& db, I b, I e, +update (const unique_ptr& db, I b, I e, bool modify = true, bool cont = true) { typedef element_traits traits; typedef typename traits::type type; - typedef typename traits::auto_ptr auto_ptr; + typedef typename traits::unique_ptr unique_ptr; if (modify) { @@ -160,7 +149,7 @@ update (const auto_ptr& db, I b, I e, for (I i (b); i != e; ++i) { type& x (traits::ref (*i)); - auto_ptr p (db->load (x.id)); + unique_ptr p (db->load (x.id)); assert (p->n == x.n && p->s == x.s); } @@ -170,7 +159,7 @@ update (const auto_ptr& db, I b, I e, template void -try_update (const auto_ptr& db, I b, I e, bool cont = true) +try_update (const unique_ptr& db, I b, I e, bool cont = true) { try { @@ -185,7 +174,7 @@ try_update (const auto_ptr& db, I b, I e, bool cont = true) template void -erase (const auto_ptr& db, I b, I e) +erase (const unique_ptr& db, I b, I e) { typedef element_traits traits; typedef typename traits::type type; @@ -214,7 +203,7 @@ erase (const auto_ptr& db, I b, I e) template void -erase_id (const auto_ptr& db, I b, I e, bool cont = true) +erase_id (const unique_ptr& db, I b, I e, bool cont = true) { typedef element_traits traits; typedef T type; @@ -239,7 +228,7 @@ erase_id (const auto_ptr& db, I b, I e, bool cont = true) template void -try_erase (const auto_ptr& db, const A& a, bool cont = true) +try_erase (const unique_ptr& db, const A& a, bool cont = true) { try { @@ -255,7 +244,7 @@ try_erase (const auto_ptr& db, const A& a, bool cont = true) template void -test (const auto_ptr& db, I b, I e) +test (const unique_ptr& db, I b, I e) { persist (db, b, e); update (db, b, e); @@ -286,11 +275,12 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); -// @@ TODO: bulk operations in PostgreSQL are only available with libpq >= 14. -// -#if defined(DATABASE_ORACLE) || defined(DATABASE_MSSQL) || defined(DATABASE_PGSQL) +#if !defined(MULTI_DATABASE) && \ + (defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) || \ + defined(DATABASE_PGSQL)) // Test database class API with various forms of containers // and elements (test #6 is a copy). @@ -328,21 +318,12 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } -#ifdef HAVE_CXX11 { vector> v; v.push_back (unique_ptr (new unique_object (1, "a"))); v.push_back (unique_ptr (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } -#else - { - auto_ptr a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } -#endif { vector v; @@ -425,7 +406,6 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } -#ifdef HAVE_CXX11 { typedef unique_ptr unique_ptr; @@ -434,7 +414,6 @@ main (int argc, char* argv[]) v.push_back (unique_ptr (new unique_object ("2", 2, "b"))); test (db, v.begin (), v.end ()); } -#endif // Test const objects. // @@ -990,21 +969,12 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } -#ifdef HAVE_CXX11 { vector> v; v.push_back (unique_ptr (new unique_object (1, "a"))); v.push_back (unique_ptr (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } -#else - { - auto_ptr a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } -#endif { vector v; diff --git a/common/bulk/makefile b/common/bulk/makefile deleted file mode 100644 index 7e28921..0000000 --- a/common/bulk/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/bulk/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix bulk_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := $(foreach d,$(databases),test-$d.std) -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule,,,-$(db_id))) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d,,-sqlite))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/bulk/test-mssql.std b/common/bulk/test-mssql.std deleted file mode 100644 index e72869d..0000000 --- a/common/bulk/test-mssql.std +++ /dev/null @@ -1,226 +0,0 @@ -multiple exceptions, 1 element attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent -[5] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[3] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 7 elements attempted, 3 failed: -[1] object already persistent -[3] object already persistent -[5] object already persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object already persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 7 elements attempted, 7 failed: -[0-5] (some) object not persistent -[6] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 8 elements attempted, 8 failed: -[0-7] (some) object not persistent - -multiple exceptions, 10 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent -[7] object not persistent -[8] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - diff --git a/common/bulk/test-mysql.std b/common/bulk/test-mysql.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/bulk/test-oracle.std b/common/bulk/test-oracle.std deleted file mode 100644 index e72869d..0000000 --- a/common/bulk/test-oracle.std +++ /dev/null @@ -1,226 +0,0 @@ -multiple exceptions, 1 element attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent -[3] object already persistent -[4] object already persistent -[5] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[2] object already persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object already persistent -[1] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[3] object already persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object already persistent -[1] object already persistent -[2] object already persistent - -multiple exceptions, 7 elements attempted, 3 failed: -[1] object already persistent -[3] object already persistent -[5] object already persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object already persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 7 elements attempted, 7 failed: -[0-5] (some) object not persistent -[6] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0-1] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 8 elements attempted, 8 failed: -[0-7] (some) object not persistent - -multiple exceptions, 10 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent -[7] object not persistent -[8] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0-2] (some) object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - -multiple exceptions, 4 elements attempted, 4 failed: -[0-2] (some) object changed concurrently -[3] object changed concurrently - diff --git a/common/bulk/test-pgsql-enabled.std b/common/bulk/test-pgsql-enabled.std deleted file mode 100644 index 0882bf2..0000000 --- a/common/bulk/test-pgsql-enabled.std +++ /dev/null @@ -1,217 +0,0 @@ -multiple exceptions, 1 element attempted, 1 failed: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed, fatal: -[1] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 1 element attempted, 1 failed, fatal: -[0] object already persistent - -multiple exceptions, 2 elements attempted, 1 failed, fatal: -[1] object already persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object already persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object not persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object not persistent -[2] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object not persistent -[2] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[2] object not persistent -[4] object not persistent -[6] object not persistent - -multiple exceptions, 7 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object not persistent - -multiple exceptions, 1 element attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 2 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 3 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 4 elements attempted, 4 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 5 elements attempted, 5 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent - -multiple exceptions, 6 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[3] object not persistent -[4] object not persistent -[5] object not persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[1] object not persistent - -multiple exceptions, 2 elements attempted, 1 failed: -[0] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[1] object not persistent -[2] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object not persistent -[2] object not persistent - -multiple exceptions, 3 elements attempted, 2 failed: -[0] object not persistent -[1] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[1] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[2] object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[3] object not persistent - -multiple exceptions, 4 elements attempted, 3 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent - -multiple exceptions, 8 elements attempted, 4 failed: -[1] object not persistent -[3] object not persistent -[5] object not persistent -[7] object not persistent - -multiple exceptions, 10 elements attempted, 6 failed: -[0] object not persistent -[1] object not persistent -[2] object not persistent -[6] object not persistent -[7] object not persistent -[8] object not persistent - -multiple exceptions, 3 elements attempted, 1 failed: -[2] object not persistent - -multiple exceptions, 4 elements attempted, 2 failed: -[1] object changed concurrently -[3] object changed concurrently - -multiple exceptions, 4 elements attempted, 2 failed: -[1] object changed concurrently -[3] object changed concurrently - diff --git a/common/bulk/test-pgsql.std b/common/bulk/test-pgsql.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/bulk/test-sqlite.std b/common/bulk/test-sqlite.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index effc79a..71755f2 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -1,13 +1,11 @@ -// file : common/driver/test.hxx +// file : common/bulk/test.hxx // license : GNU GPL v2; see accompanying LICENSE file #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include -#include // std::auto_ptr, std::unique_ptr +#include // std::unique_ptr #include @@ -31,7 +29,6 @@ namespace test1 std::string s; }; -#ifdef HAVE_CXX11 #pragma db object bulk(3) pointer(std::unique_ptr) struct unique_object { @@ -44,20 +41,6 @@ namespace test1 unsigned int n; std::string s; }; -#else - #pragma db object bulk(3) pointer(std::auto_ptr) - struct auto_object - { - auto_object (unsigned int n_ = 0, std::string s_ = "") - : id (0), n (n_), s (s_) {} - - #pragma db id auto - unsigned long id; - - unsigned int n; - std::string s; - }; -#endif } // Test object with manually assigned id. @@ -80,7 +63,6 @@ namespace test2 std::string s; }; -#ifdef HAVE_CXX11 #pragma db object bulk(3) pointer(std::unique_ptr) struct unique_object { @@ -95,7 +77,6 @@ namespace test2 unsigned int n; std::string s; }; -#endif } // Test failure. @@ -175,17 +156,10 @@ namespace test6 #pragma db object(object) bulk(3) #pragma db member(object::id) id auto -#ifdef HAVE_CXX11 typedef object_template<3> unique_object; #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) #pragma db member(unique_object::id) id auto -#else - typedef object_template<2> auto_object; - - #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) - #pragma db member(auto_object::id) id auto -#endif } // Test optimistic concurrency. diff --git a/common/bulk/testscript b/common/bulk/testscript new file mode 100644 index 0000000..e7567c9 --- /dev/null +++ b/common/bulk/testscript @@ -0,0 +1,503 @@ +# file : common/bulk/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + ++cat <=output + multiple exceptions, 1 element attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object already persistent + [1] object already persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + [4] object already persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + [4] object already persistent + [5] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object already persistent + [2] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object already persistent + [2] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object already persistent + [1] object already persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [3] object already persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + + multiple exceptions, 7 elements attempted, 3 failed: + [1] object already persistent + [3] object already persistent + [5] object already persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object already persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 7 elements attempted, 7 failed: + [0-5] (some) object not persistent + [6] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 8 elements attempted, 8 failed: + [0-7] (some) object not persistent + + multiple exceptions, 10 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + [7] object not persistent + [8] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object changed concurrently + [3] object changed concurrently + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object changed concurrently + [3] object changed concurrently + + EOI + ++cat <=pgsql-output + multiple exceptions, 1 element attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed, fatal: + [1] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed, fatal: + [1] object already persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object already persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [2] object not persistent + [4] object not persistent + [6] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object not persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 8 elements attempted, 4 failed: + [1] object not persistent + [3] object not persistent + [5] object not persistent + [7] object not persistent + + multiple exceptions, 10 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + [7] object not persistent + [8] object not persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object not persistent + + multiple exceptions, 4 elements attempted, 2 failed: + [1] object changed concurrently + [3] object changed concurrently + + multiple exceptions, 4 elements attempted, 2 failed: + [1] object changed concurrently + [3] object changed concurrently + + EOI + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if ($pgsql && $pgsql_bulk) +{ + .include ../../pgsql.testscript + + $create_schema; + + # Query the PostgreSQL server version and only run the test if it is 7.4 or + # above. + # + $pgsql_client_cmd --tuples-only -c 'SELECT VERSION()' | \ + sed -n -e 's/.*PostgreSQL (\d+\.\d+).*/\1/p' | \ + set version [string]; + + if ("$version" == "") + exit "unable to obtain PostgreSQL server version" + end; + + sed -n -e 's/(.+)\..+/\1/p' <"$version" | set major_version [uint64]; + sed -n -e 's/.+\.(.+)/\1/p' <"$version" | set minor_version [uint64]; + + if (($major_version == 7 && minor_version >= 4) || $major_version > 7) + if $multi + $* # Noop. + else + $* >>>../pgsql-output + end + end +} diff --git a/common/callback/buildfile b/common/callback/buildfile new file mode 100644 index 0000000..2ecc3b8 --- /dev/null +++ b/common/callback/buildfile @@ -0,0 +1,41 @@ +# file : common/callback/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix callback_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index bcbbe7a..80513c6 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -4,18 +4,20 @@ // Test database operation callbacks. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -56,7 +58,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Persist. // @@ -76,7 +78,7 @@ main (int argc, char* argv[]) cout << "load" << endl; { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); object o2; db->load (2, o2); t.commit (); @@ -109,8 +111,8 @@ main (int argc, char* argv[]) cout << "update" << endl; { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - auto_ptr o2 (db->load (2)); + unique_ptr o1 (db->load (1)); + unique_ptr o2 (db->load (2)); o1->data++; o2->data++; db->update (o1.get ()); @@ -124,8 +126,8 @@ main (int argc, char* argv[]) cout << "erase" << endl; { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - auto_ptr o2 (db->load (2)); + unique_ptr o1 (db->load (1)); + unique_ptr o2 (db->load (2)); db->erase (static_cast (o1.get ())); db->erase (*o2); t.commit (); @@ -158,7 +160,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); object* o2 (o1->pobj); cout << o1->id_ << ' ' << o1->ref << ' ' << o1->robj->id_ << endl; diff --git a/common/callback/makefile b/common/callback/makefile deleted file mode 100644 index 2bc54ef..0000000 --- a/common/callback/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/callback/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix callback_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/callback/test.std b/common/callback/test.std deleted file mode 100644 index b34a8de..0000000 --- a/common/callback/test.std +++ /dev/null @@ -1,62 +0,0 @@ -persist - pre_persist 1 const - post_persist 1 const - pre_persist 2 const - post_persist 2 const -*** -load - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 -*** -query - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 -*** -update - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - pre_update 1 const - post_update 1 const - pre_update 2 const - post_update 2 const -*** -erase - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - pre_erase 1 const - post_erase 1 const - pre_erase 2 const - post_erase 2 const -*** -delayed load - pre_persist 1 const - post_persist 1 const - pre_persist 2 const - post_persist 2 const - pre_persist 3 const - post_persist 3 const - pre_persist 4 const - post_persist 4 const - pre_load 0 - pre_load 0 - pre_load 0 - post_load 3 - post_load 2 - pre_load 0 - post_load 4 - 2 4 4 - post_load 1 - pre_load 0 - post_load 4 - 1 4 4 -1 4 4 -2 4 4 -*** diff --git a/common/callback/testscript b/common/callback/testscript new file mode 100644 index 0000000..c7d03ee --- /dev/null +++ b/common/callback/testscript @@ -0,0 +1,100 @@ +# file : common/callback/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + ++cat <=output + persist + pre_persist 1 const + post_persist 1 const + pre_persist 2 const + post_persist 2 const + *** + load + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + *** + query + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + *** + update + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_update 1 const + post_update 1 const + pre_update 2 const + post_update 2 const + *** + erase + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_erase 1 const + post_erase 1 const + pre_erase 2 const + post_erase 2 const + *** + delayed load + pre_persist 1 const + post_persist 1 const + pre_persist 2 const + post_persist 2 const + pre_persist 3 const + post_persist 3 const + pre_persist 4 const + post_persist 4 const + pre_load 0 + pre_load 0 + pre_load 0 + post_load 3 + post_load 2 + pre_load 0 + post_load 4 + 2 4 4 + post_load 1 + pre_load 0 + post_load 4 + 1 4 4 + 1 4 4 + 2 4 4 + *** + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/changelog/.gitignore b/common/changelog/.gitignore new file mode 100644 index 0000000..5352a2b --- /dev/null +++ b/common/changelog/.gitignore @@ -0,0 +1,3 @@ +# Generate ODB options file. +# +odb.options diff --git a/common/changelog/buildfile b/common/changelog/buildfile new file mode 100644 index 0000000..04e0685 --- /dev/null +++ b/common/changelog/buildfile @@ -0,0 +1,30 @@ +# file : common/changelog/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +./: file{odb.options} xml{*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the below ad hoc recipe. +# +libue{test-meta}: $libodb + +file{odb.options}: libue{test-meta} +{{ + pops = $cxx.lib_poptions($<[0]) + depdb hash $pops + + f = $path($>[0]) + rm -f $f + + for o: $pops + echo $o >+$f + end +}} + +# Testscript's run-time prerequisites. +# +testscript@./: test = $odb + +./: $odb: clean = false diff --git a/common/changelog/makefile b/common/changelog/makefile deleted file mode 100644 index 99f6333..0000000 --- a/common/changelog/makefile +++ /dev/null @@ -1,101 +0,0 @@ -# file : common/changelog/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -odb_hdr := \ -model.hxx \ -add-table.hxx \ -drop-table.hxx \ -add-column.hxx \ -drop-column.hxx \ -alter-column.hxx \ -add-index.hxx \ -drop-index.hxx \ -add-foreign-key.hxx \ -drop-foreign-key.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) - -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(default): - -$(gen): $(odb) FORCE # Force regeneration even if up to date. -$(gen): odb := $(odb) -$(gen): export odb_options += --database $(db_id) --generate-schema-only \ ---schema-format sql --suppress-migration --changelog-dir $(out_base) -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifdef STEP - -ifeq ($(STEP),1) -$(gen): cpp_options += -DBVER=1 -DCVER=1 # Initialize. -$(gen): odb_options += --init-changelog # Suppress notice. -else ifeq ($(STEP),2) -$(gen): cpp_options += -DBVER=1 -DCVER=2 # Diff. -else ifeq ($(STEP),3) -$(gen): cpp_options += -DBVER=2 -DCVER=3 # Patch (via rewind). -else -$(error unexpected STEP value $(STEP) -endif - -$(default): $(gen) -else -$(default): -endif - -# Dist: not supported. -# -$(dist): - -# Test. -# -$(test): tests := $(odb_hdr:.hxx=) -$(test): diff = $(call message,,diff -u $(src_base)/$1-$(db_id)-$2.xml \ -$(out_base)/$1.xml)$(literal_newline)$(literal_tab) -$(test): | $(out_base)/. - $(call message,,rm -f $(addprefix $(out_base)/,$(addsuffix .xml,$(tests)))) - $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=1) - $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=2) - $(foreach t,$(tests),$(call diff,$t,diff)) - $(call message,,$(MAKE) --no-print-directory -C $(out_base) -f $(src_base)/makefile STEP=3) - $(foreach t,$(tests),$(call diff,$t,patch)) - -# Clean. -# -$(clean): changelogs := $(addprefix $(out_base)/,$(odb_hdr:.hxx=.xml)) -$(clean): $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(changelogs)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(default) $(test): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/changelog/testscript b/common/changelog/testscript new file mode 100644 index 0000000..9368938 --- /dev/null +++ b/common/changelog/testscript @@ -0,0 +1,66 @@ +# file : common/changelog/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +headers = [paths] $path_search($src_base/*.hxx) + +odb_options = --generate-schema-only \ + --schema-format sql \ + --suppress-migration \ + --options-file $out_base/odb.options + +: mysql +: +if $mysql +{ + odb_options += --database 'mysql' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-mysql-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-mysql-patch.xml $(n).xml + end +} + +: sqlite +: +if $sqlite +{ + odb_options += --database 'sqlite' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-sqlite-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-sqlite-patch.xml $(n).xml + end +} + +: pgsql +: +if $pgsql +{ + odb_options += --database 'pgsql' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-pgsql-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-pgsql-patch.xml $(n).xml + end +} diff --git a/common/circular/multiple/.gitignore b/common/circular/multiple/.gitignore new file mode 100644 index 0000000..5d39d39 --- /dev/null +++ b/common/circular/multiple/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx diff --git a/common/circular/multiple/buildfile b/common/circular/multiple/buildfile new file mode 100644 index 0000000..b060cb5 --- /dev/null +++ b/common/circular/multiple/buildfile @@ -0,0 +1,49 @@ +# file : common/circular/multiple/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix circular_m_ \ + --generate-schema \ + --generate-query \ + --schema-format embedded + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx index d6d49cc..4887ac2 100644 --- a/common/circular/multiple/driver.cxx +++ b/common/circular/multiple/driver.cxx @@ -5,8 +5,7 @@ // files version. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -14,7 +13,7 @@ #include #include -#include +#include #include "test1.hxx" #include "test2.hxx" @@ -22,6 +21,9 @@ #include "test2-odb.hxx" #include "test1-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -30,7 +32,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + unique_ptr db (create_database (argc, argv, false)); // Create the database schema. // diff --git a/common/circular/multiple/makefile b/common/circular/multiple/makefile deleted file mode 100644 index 4364574..0000000 --- a/common/circular/multiple/makefile +++ /dev/null @@ -1,122 +0,0 @@ -# file : common/circular/multiple/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---schema-format embedded --table-prefix circular_m_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -# Extra dependecy for the ODB-generated code. -# -$(gen): $(addprefix $(src_base)/,$(odb_hdr)) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/circular/multiple/test.std b/common/circular/multiple/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/circular/multiple/testscript b/common/circular/multiple/testscript new file mode 100644 index 0000000..6a05dc6 --- /dev/null +++ b/common/circular/multiple/testscript @@ -0,0 +1,31 @@ +# file : common/circular/multiple/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/common/circular/single/buildfile b/common/circular/single/buildfile new file mode 100644 index 0000000..740ce91 --- /dev/null +++ b/common/circular/single/buildfile @@ -0,0 +1,41 @@ +# file : common/circular/single/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix circular_s_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx index 67d79ba..9bcb135 100644 --- a/common/circular/single/driver.cxx +++ b/common/circular/single/driver.cxx @@ -5,18 +5,20 @@ // file version. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); query bq (query::d->id != 0); query dq (query::b->id != 0); diff --git a/common/circular/single/makefile b/common/circular/single/makefile deleted file mode 100644 index be08cc5..0000000 --- a/common/circular/single/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/circular/single/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix circular_s_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/circular/single/test.std b/common/circular/single/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/circular/single/testscript b/common/circular/single/testscript new file mode 100644 index 0000000..b870306 --- /dev/null +++ b/common/circular/single/testscript @@ -0,0 +1,33 @@ +# file : common/circular/single/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/composite/buildfile b/common/composite/buildfile new file mode 100644 index 0000000..0a60638 --- /dev/null +++ b/common/composite/buildfile @@ -0,0 +1,41 @@ +# file : common/composite/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_comp_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx index cefd72b..06b24b2 100644 --- a/common/composite/driver.cxx +++ b/common/composite/driver.cxx @@ -4,14 +4,13 @@ // Test composite value types. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" @@ -19,12 +18,15 @@ using namespace std; using namespace odb::core; +#undef NDEBUG +#include + int main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic composite functionality. // @@ -55,7 +57,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); + unique_ptr p1 (db->load (1)); t.commit (); assert (p == *p1); @@ -78,7 +80,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); + unique_ptr p1 (db->load (1)); t.commit (); assert (p == *p1); @@ -157,7 +159,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -184,7 +186,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -212,7 +214,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/common/composite/makefile b/common/composite/makefile deleted file mode 100644 index 41d4d68..0000000 --- a/common/composite/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/composite/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_comp_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/composite/test.std b/common/composite/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/composite/testscript b/common/composite/testscript new file mode 100644 index 0000000..0747507 --- /dev/null +++ b/common/composite/testscript @@ -0,0 +1,33 @@ +# file : common/composite/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/const-member/buildfile b/common/const-member/buildfile new file mode 100644 index 0000000..868f7fd --- /dev/null +++ b/common/const-member/buildfile @@ -0,0 +1,40 @@ +# file : common/const-member/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix constm_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx index 2b6cfca..0c71dfa 100644 --- a/common/const-member/driver.cxx +++ b/common/const-member/driver.cxx @@ -5,18 +5,20 @@ // members are automatically treated as read-only. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Const ids. // @@ -57,7 +59,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); t.commit (); assert (o->id == 1); } @@ -76,7 +78,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); t.commit (); assert (o->ccom.vec.size () == 1 && o->ccom.vec[0] == 1 && @@ -98,7 +100,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); t.commit (); assert (*o->str == "abc" && diff --git a/common/const-member/makefile b/common/const-member/makefile deleted file mode 100644 index c5996a2..0000000 --- a/common/const-member/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/const-member/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --table-prefix constm_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx index cf8ba94..ab75c55 100644 --- a/common/const-member/test.hxx +++ b/common/const-member/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include // std::auto_ptr @@ -103,15 +101,9 @@ struct wrapper #pragma db id unsigned long id; -#ifdef HAVE_CXX11 const std::unique_ptr str; const std::unique_ptr com; const std::unique_ptr> vec; -#else - const std::auto_ptr str; - const std::auto_ptr com; - const std::auto_ptr< const std::vector > vec; -#endif }; #endif // TEST_HXX diff --git a/common/const-member/test.std b/common/const-member/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/const-member/testscript b/common/const-member/testscript new file mode 100644 index 0000000..c81d856 --- /dev/null +++ b/common/const-member/testscript @@ -0,0 +1,33 @@ +# file : common/const-member/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/const-object/buildfile b/common/const-object/buildfile new file mode 100644 index 0000000..853c831 --- /dev/null +++ b/common/const-object/buildfile @@ -0,0 +1,41 @@ +# file : common/const-object/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix consto_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 90efb4e..7ef48ee 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -4,19 +4,21 @@ // Test database operations with const objects. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); aggr a (1); aggr ca_ (2); // o1 and o2 are NULL @@ -36,18 +38,10 @@ main (int argc, char* argv[]) const obj1* co1 (co1_); a.o1 = co1; -#ifdef HAVE_CXX11 unique_ptr o2 (new obj2 (1)); -#else - auto_ptr o2 (new obj2 (1)); -#endif obj2* co2_ (new obj2 (2)); a.o2.reset (co2_); -#ifdef HAVE_CXX11 unique_ptr& co2 (a.o2); -#else - auto_ptr& co2 (a.o2); -#endif // persist via references // @@ -83,13 +77,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr a (db->load (1)); unique_ptr ca (db->load (2)); -#else - auto_ptr a (db->load (1)); - auto_ptr ca (db->load (2)); -#endif t.commit (); @@ -160,13 +149,8 @@ main (int argc, char* argv[]) { // i->f (); // error i->cf (); -#ifdef HAVE_CXX11 //unique_ptr p (i.load ()); // error unique_ptr p (i.load ()); -#else - // auto_ptr p (i.load ()); // error - auto_ptr p (i.load ()); -#endif obj2 o (0); i.load (o); assert (p->id == o.id); diff --git a/common/const-object/makefile b/common/const-object/makefile deleted file mode 100644 index ababb8f..0000000 --- a/common/const-object/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/const-object/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix consto_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx index 919ba08..4e66231 100644 --- a/common/const-object/test.hxx +++ b/common/const-object/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include @@ -22,11 +20,7 @@ struct obj1 void cf () const {} }; -#ifdef HAVE_CXX11 #pragma db object pointer (std::unique_ptr) -#else -#pragma db object pointer (std::auto_ptr) -#endif struct obj2 { obj2 () {} @@ -51,11 +45,7 @@ struct aggr const obj1* o1; -#ifdef HAVE_CXX11 std::unique_ptr o2; -#else - std::auto_ptr o2; -#endif }; #endif // TEST_HXX diff --git a/common/const-object/test.std b/common/const-object/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/const-object/testscript b/common/const-object/testscript new file mode 100644 index 0000000..3885e96 --- /dev/null +++ b/common/const-object/testscript @@ -0,0 +1,33 @@ +# file : common/const-object/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/container/basics/buildfile b/common/container/basics/buildfile new file mode 100644 index 0000000..f83444e --- /dev/null +++ b/common/container/basics/buildfile @@ -0,0 +1,40 @@ +# file : common/container/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_cont_bs_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index cdd22d6..14e1984 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -4,18 +4,20 @@ // Test basic container persistence. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); for (unsigned short i (0); i < 2; ++i) { @@ -37,7 +39,6 @@ main (int argc, char* argv[]) empty.num = 0; empty.str = ""; -#ifdef HAVE_CXX11 // array // empty.na[0] = 123; @@ -51,7 +52,6 @@ main (int argc, char* argv[]) empty.ca[0] = comp (123, "aaa"); empty.ca[1] = comp (234, "bbbb"); empty.ca[2] = comp (345, "ccccc"); -#endif // @@ -110,7 +110,6 @@ main (int argc, char* argv[]) med.csm[comp (123, "aaa")] = "aaa"; med.csm[comp (234, "bbbb")] = "bbbb"; -#ifdef HAVE_CXX11 // array // med.na[0] = 123; @@ -160,7 +159,6 @@ main (int argc, char* argv[]) med.csum[comp (123, "aaa")] = "aaa"; med.csum[comp (234, "bbbb")] = "bbbb"; -#endif // // full @@ -231,7 +229,6 @@ main (int argc, char* argv[]) full.csm[comp (2345, "bbbbb")] = "bbbbb"; full.csm[comp (3456, "cccccc")] = "cccccc"; -#ifdef HAVE_CXX11 // array // full.na[0] = 123; @@ -291,7 +288,6 @@ main (int argc, char* argv[]) full.csum[comp (1234, "aaaa")] = "aaaa"; full.csum[comp (2345, "bbbbb")] = "bbbbb"; full.csum[comp (3456, "cccccc")] = "cccccc"; -#endif // persist // @@ -307,9 +303,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); + unique_ptr e (db->load ("empty")); + unique_ptr m (db->load ("medium")); + unique_ptr f (db->load ("full")); t.commit (); assert (empty == *e); @@ -340,7 +336,6 @@ main (int argc, char* argv[]) empty.ncm[12] = comp (12, "aa"); empty.csm[comp (12, "aa")] = "aa"; -#ifdef HAVE_CXX11 empty.nfl.push_front (12); empty.sfl.push_front ("aa"); empty.cfl.push_front (comp (12, "aa")); @@ -353,7 +348,6 @@ main (int argc, char* argv[]) empty.snum["aa"] = 12; empty.ncum[12] = comp (12, "aa"); empty.csum[comp (12, "aa")] = "aa"; -#endif // // med @@ -380,7 +374,6 @@ main (int argc, char* argv[]) med.ncm.clear (); med.csm.clear (); -#ifdef HAVE_CXX11 med.nfl.clear (); med.sfl.clear (); med.cfl.clear (); @@ -393,7 +386,6 @@ main (int argc, char* argv[]) med.snum.clear (); med.ncum.clear (); med.csum.clear (); -#endif // // full @@ -447,7 +439,6 @@ main (int argc, char* argv[]) full.csm[comp (3456, "cccccc")] += "c"; full.csm[comp (4567, "ddddddd")] = "ddddddd"; -#ifdef HAVE_CXX11 // array // full.na[0]++; @@ -487,7 +478,6 @@ main (int argc, char* argv[]) full.csum[comp (3456, "cccccc")] += "c"; full.csum[comp (4567, "ddddddd1")] = "ddddddd"; -#endif // update // @@ -503,9 +493,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); + unique_ptr e (db->load ("empty")); + unique_ptr m (db->load ("medium")); + unique_ptr f (db->load ("full")); t.commit (); assert (empty == *e); diff --git a/common/container/basics/makefile b/common/container/basics/makefile deleted file mode 100644 index 3da6b71..0000000 --- a/common/container/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/container/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix t_cont_bs_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index b7d50ae..e8e329e 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -4,21 +4,16 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include #include #include +#include #include - -#ifdef HAVE_CXX11 -# include -# include -# include -# include -#endif +#include +#include +#include #include @@ -29,7 +24,7 @@ struct comp comp (int n, const std::string& s) : num (n), str (s) {} #pragma db column("number") - int num; + int num = 0; std::string str; }; @@ -66,7 +61,6 @@ typedef std::map str_num_map; typedef std::map num_comp_map; typedef std::map comp_str_map; -#ifdef HAVE_CXX11 struct comp_hash { std::size_t @@ -92,7 +86,6 @@ typedef std::unordered_map num_str_umap; typedef std::unordered_map str_num_umap; typedef std::unordered_map num_comp_umap; typedef std::unordered_map comp_str_umap; -#endif #pragma db value struct cont_comp1 @@ -162,7 +155,6 @@ struct object num_comp_map ncm; comp_str_map csm; -#ifdef HAVE_CXX11 // array // num_array na; @@ -187,26 +179,6 @@ struct object str_num_umap snum; num_comp_umap ncum; comp_str_umap csum; -#else - // Dummy containers to get the equivalent DROP TABLE statements. - // - num_vector na; - num_vector sa; - num_vector ca; - - num_vector nfl; - num_vector sfl; - num_vector cfl; - - num_set nus; - str_set sus; - comp_set cus; - - num_str_map nsum; - str_num_map snum; - num_comp_map ncum; - comp_str_map csum; -#endif std::string str; }; @@ -250,7 +222,6 @@ operator== (const object& x, const object& y) x.ncm == y.ncm && x.csm == y.csm && -#ifdef HAVE_CXX11 x.na == y.na && x.sa == y.sa && x.ca == y.ca && @@ -267,7 +238,6 @@ operator== (const object& x, const object& y) x.snum == y.snum && x.ncum == y.ncum && x.csum == y.csum && -#endif x.str == y.str; } diff --git a/common/container/basics/test.std b/common/container/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/container/basics/testscript b/common/container/basics/testscript new file mode 100644 index 0000000..ea99498 --- /dev/null +++ b/common/container/basics/testscript @@ -0,0 +1,33 @@ +# file : common/container/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/container/change-tracking/buildfile b/common/container/change-tracking/buildfile new file mode 100644 index 0000000..1dda818 --- /dev/null +++ b/common/container/change-tracking/buildfile @@ -0,0 +1,40 @@ +# file : common/container/change-tracking/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_cont_changet_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx index f7407bd..4894ed9 100644 --- a/common/container/change-tracking/driver.cxx +++ b/common/container/change-tracking/driver.cxx @@ -4,26 +4,23 @@ // Test change-tracking containers. // -#include // HAVE_CXX11 - -#include // std::auto_ptr -#include +#include // std::unique_ptr +#include // std::move #include -#ifdef HAVE_CXX11 -# include // std::move -#endif - #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -58,8 +55,7 @@ static counting_tracer tr; // #ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC -#if !defined (HAVE_CXX11) || \ - (defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) +#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 struct item {}; template class odb::vector; template class odb::vector_iterator, @@ -111,7 +107,7 @@ main (int argc, char* argv[]) #endif } - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test traits logic. // @@ -136,11 +132,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr p (db->load ("1")); -#else - auto_ptr p (db->load ("1")); -#endif assert (p->s._tracking ()); t.commit (); } @@ -554,11 +546,7 @@ main (int argc, char* argv[]) // Armed copy. // { -#ifdef HAVE_CXX11 unique_ptr c; -#else - auto_ptr c; -#endif { o.s.pop_back (); @@ -621,7 +609,6 @@ main (int argc, char* argv[]) // Armed move. // -#ifdef HAVE_CXX11 { unique_ptr c; @@ -652,7 +639,6 @@ main (int argc, char* argv[]) t.commit (); } } -#endif // Test mixing "smart" and "dumb" container (specifically, erase(obj)). // @@ -699,13 +685,8 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr p1 (db->load (o1.id_)); unique_ptr p2 (db->load (o2.id_)); -#else - auto_ptr p1 (db->load (o1.id_)); - auto_ptr p2 (db->load (o2.id_)); -#endif assert (p2->o1[0] == p1.get ()); assert (!p2->o1._tracking ()); t.commit (); diff --git a/common/container/change-tracking/makefile b/common/container/change-tracking/makefile deleted file mode 100644 index 53fd314..0000000 --- a/common/container/change-tracking/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/container/change-tracking/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix t_cont_changet_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx index be78244..8e06f4a 100644 --- a/common/container/change-tracking/test.hxx +++ b/common/container/change-tracking/test.hxx @@ -4,33 +4,22 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include - -#ifdef HAVE_CXX11 -# include // std::move -#endif +#include // std::move #include #include -#ifdef HAVE_CXX11 #pragma db object pointer(std::unique_ptr) -#else -#pragma db object pointer(std::auto_ptr) -#endif struct object { object () {} object (const std::string& id): id_ (id) {} -#ifdef HAVE_CXX11 object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} -#endif #pragma db id std::string id_; @@ -40,7 +29,7 @@ struct object odb::vector s; inline bool - operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;} + operator== (const object& o) const {return id_ == o.id_ && i == o.i && s == o.s;} }; // Test mixing "smart" and "dumb" container (specifically, erase(obj)). diff --git a/common/container/change-tracking/test.std b/common/container/change-tracking/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/container/change-tracking/testscript b/common/container/change-tracking/testscript new file mode 100644 index 0000000..2169869 --- /dev/null +++ b/common/container/change-tracking/testscript @@ -0,0 +1,33 @@ +# file : common/container/change-tracking/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/ctor/buildfile b/common/ctor/buildfile new file mode 100644 index 0000000..a9892bc --- /dev/null +++ b/common/ctor/buildfile @@ -0,0 +1,41 @@ +# file : common/ctor/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix ctor_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx index 03c706b..c9b445d 100644 --- a/common/ctor/driver.cxx +++ b/common/ctor/driver.cxx @@ -4,18 +4,20 @@ // Test support for persistent objects without default constructors. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) typedef odb::query query; typedef odb::result result; - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); person p1 ("John", "Doe", 30); person p2 ("Jane", "Doe", 29); diff --git a/common/ctor/makefile b/common/ctor/makefile deleted file mode 100644 index c35d577..0000000 --- a/common/ctor/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/ctor/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix ctor_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/ctor/test.std b/common/ctor/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/ctor/testscript b/common/ctor/testscript new file mode 100644 index 0000000..8946ddb --- /dev/null +++ b/common/ctor/testscript @@ -0,0 +1,33 @@ +# file : common/ctor/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/default/buildfile b/common/default/buildfile new file mode 100644 index 0000000..e25bd08 --- /dev/null +++ b/common/default/buildfile @@ -0,0 +1,41 @@ +# file : common/default/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix default_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/default/driver.cxx b/common/default/driver.cxx index 276f5f2..2d3ef01 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -4,18 +4,20 @@ // Test default values. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Insert an object using an ad-hoc SQL statement. This way // we get all the default values. @@ -44,7 +46,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); t.commit (); assert (o->b); diff --git a/common/default/makefile b/common/default/makefile deleted file mode 100644 index c8b3cde..0000000 --- a/common/default/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/default/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix default_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/default/test.std b/common/default/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/default/testscript b/common/default/testscript new file mode 100644 index 0000000..f29cef4 --- /dev/null +++ b/common/default/testscript @@ -0,0 +1,33 @@ +# file : common/default/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/definition/.gitignore b/common/definition/.gitignore new file mode 100644 index 0000000..5838670 --- /dev/null +++ b/common/definition/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +time-mapping-odb.?xx +time-mapping-odb-*.?xx +time-mapping.sql +time-mapping-*.sql diff --git a/common/definition/buildfile b/common/definition/buildfile new file mode 100644 index 0000000..09ad1db --- /dev/null +++ b/common/definition/buildfile @@ -0,0 +1,52 @@ +# file : common/definition/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test time-mapping + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix definition_ \ + --generate-schema + +<{hxx ixx cxx}{time-mapping-odb}>: odb_options = + +for db: $databases + {hxx ixx cxx}{time-mapping-odb-$db}: odb_options = + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx index d909644..223eeaf 100644 --- a/common/definition/driver.cxx +++ b/common/definition/driver.cxx @@ -5,18 +5,20 @@ // useful to make composite values out of third-party types. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o; o.time.tv_sec = 1; @@ -39,7 +41,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); t.commit (); assert (p->time.tv_sec == o.time.tv_sec && diff --git a/common/definition/makefile b/common/definition/makefile deleted file mode 100644 index 61227c3..0000000 --- a/common/definition/makefile +++ /dev/null @@ -1,122 +0,0 @@ -# file : common/definition/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx time-mapping.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix definition_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -# Extra dependecy for the ODB-generated code. -# -$(gen): $(src_base)/time-mapping.hxx - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/definition/test.std b/common/definition/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/definition/testscript b/common/definition/testscript new file mode 100644 index 0000000..c9dea6d --- /dev/null +++ b/common/definition/testscript @@ -0,0 +1,33 @@ +# file : common/definition/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/enum/buildfile b/common/enum/buildfile new file mode 100644 index 0000000..eb3a29a --- /dev/null +++ b/common/enum/buildfile @@ -0,0 +1,41 @@ +# file : common/enum/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix enum_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx index e9b4bfb..ed3eb59 100644 --- a/common/enum/driver.cxx +++ b/common/enum/driver.cxx @@ -4,18 +4,20 @@ // Test automatic C++ enum mapping. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,18 +29,16 @@ main (int argc, char* argv[]) typedef odb::query query; typedef odb::result result; - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o; o.color_ = green; o.taste_ = object::sweet; o.position_ = object::left; -#ifdef HAVE_CXX11_ENUM o.gender_ = object::gender::female; o.scale_ = object::scale::ten; o.yesno_ = object::yesno::yes; -#endif { transaction t (db->begin ()); @@ -48,7 +48,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (o.id_)); + unique_ptr o1 (db->load (o.id_)); t.commit (); assert (o == *o1); @@ -65,7 +65,6 @@ main (int argc, char* argv[]) assert (!r2.empty ()); assert (!r3.empty ()); -#ifdef HAVE_CXX11_ENUM result r4 (db->query (query::gender == object::gender::female)); result r5 (db->query (query::scale == object::scale::ten)); result r6 (db->query (query::yesno == object::yesno::yes)); @@ -73,7 +72,6 @@ main (int argc, char* argv[]) assert (!r4.empty ()); assert (!r5.empty ()); assert (!r6.empty ()); -#endif t.commit (); } diff --git a/common/enum/makefile b/common/enum/makefile deleted file mode 100644 index d5957fa..0000000 --- a/common/enum/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/enum/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix enum_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/enum/test.hxx b/common/enum/test.hxx index 0391581..a279112 100644 --- a/common/enum/test.hxx +++ b/common/enum/test.hxx @@ -5,7 +5,6 @@ #define TEST_HXX #include -#include // HAVE_CXX11_ENUM enum color {red, green, blue}; @@ -23,7 +22,6 @@ struct object position position_; -#ifdef HAVE_CXX11_ENUM enum class gender {male, female}; enum class scale: unsigned char {one = 1, ten = 10, hundred = 100}; enum class yesno: bool {no, yes}; @@ -31,8 +29,6 @@ struct object gender gender_; scale scale_; yesno yesno_; -#endif - }; inline bool @@ -43,12 +39,9 @@ operator == (const object& x, const object& y) && x.color_ == y.color_ && x.taste_ == y.taste_ && x.position_ == y.position_ -#ifdef HAVE_CXX11_ENUM && x.gender_ == y.gender_ && x.scale_ == y.scale_ && x.yesno_ == y.yesno_; -#endif - ; } #endif // TEST_HXX diff --git a/common/enum/test.std b/common/enum/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/enum/testscript b/common/enum/testscript new file mode 100644 index 0000000..d2ca28c --- /dev/null +++ b/common/enum/testscript @@ -0,0 +1,33 @@ +# file : common/enum/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/erase-query/buildfile b/common/erase-query/buildfile new file mode 100644 index 0000000..d833b6e --- /dev/null +++ b/common/erase-query/buildfile @@ -0,0 +1,41 @@ +# file : common/erase-query/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix erase_query_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index f4a4374..6c11957 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -4,18 +4,20 @@ // Test query-based erase. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -42,7 +44,7 @@ main (int argc, char* argv[]) { typedef odb::query query; - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // erase_query() // diff --git a/common/erase-query/makefile b/common/erase-query/makefile deleted file mode 100644 index 0092fea..0000000 --- a/common/erase-query/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/erase-query/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix erase_query_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/erase-query/test.std b/common/erase-query/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/erase-query/testscript b/common/erase-query/testscript new file mode 100644 index 0000000..90862ab --- /dev/null +++ b/common/erase-query/testscript @@ -0,0 +1,33 @@ +# file : common/erase-query/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/id/auto/buildfile b/common/id/auto/buildfile new file mode 100644 index 0000000..c340200 --- /dev/null +++ b/common/id/auto/buildfile @@ -0,0 +1,40 @@ +# file : common/id/auto/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_auto_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx index 19e0f14..d294e69 100644 --- a/common/id/auto/driver.cxx +++ b/common/id/auto/driver.cxx @@ -4,18 +4,20 @@ // Test automatic id assignment. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // object // @@ -52,9 +54,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); - auto_ptr o3 (db->load (id3)); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + unique_ptr o3 (db->load (id3)); t.commit (); assert (o1->id_ == id1 && o1->str_ == "one"); @@ -79,7 +81,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (id)); + unique_ptr o (db->load (id)); t.commit (); assert (o->id_ == id); diff --git a/common/id/auto/makefile b/common/id/auto/makefile deleted file mode 100644 index e0477ba..0000000 --- a/common/id/auto/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/id/auto/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix t_id_auto_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/auto/test.std b/common/id/auto/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/id/auto/testscript b/common/id/auto/testscript new file mode 100644 index 0000000..bb2a3a4 --- /dev/null +++ b/common/id/auto/testscript @@ -0,0 +1,33 @@ +# file : common/id/auto/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/id/composite/buildfile b/common/id/composite/buildfile new file mode 100644 index 0000000..4bc9f9a --- /dev/null +++ b/common/id/composite/buildfile @@ -0,0 +1,42 @@ +# file : common/id/composite/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_comp_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx index f394091..3d66101 100644 --- a/common/id/composite/driver.cxx +++ b/common/id/composite/driver.cxx @@ -4,19 +4,21 @@ // Test composite object ids. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test 1. // @@ -55,9 +57,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); t.commit (); assert (*p1 == o1); @@ -69,7 +71,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); + unique_ptr p (db->load (o1.id)); p->num++; db->update (*p); t.commit (); @@ -77,7 +79,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); + unique_ptr p (db->load (o1.id)); t.commit (); assert (p->num == o1.num + 1); @@ -93,7 +95,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->find (o1.id)); + unique_ptr p (db->find (o1.id)); assert (p.get () == 0); t.commit (); } @@ -134,9 +136,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); - auto_ptr p4 (db->load (o4.id)); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); + unique_ptr p4 (db->load (o4.id)); t.commit (); assert (p2->o1->id == o2.o1->id); @@ -155,13 +157,13 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p2 (db->load (o2.id)); delete p2->o1; p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); id2 = db->persist (p2->o1); db->update (*p2); - auto_ptr p3 (db->load (o3.id)); + unique_ptr p3 (db->load (o3.id)); delete p3->o1.back (); p3->o1.pop_back (); p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); @@ -173,8 +175,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); - auto_ptr p3 (db->load (o3.id)); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); t.commit (); assert (p2->o1->id == id2); @@ -298,7 +300,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p2->o1->o2->id == o2.id); @@ -375,7 +377,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p2->o1.size () == 2); @@ -458,7 +460,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p2->o1.size () == 2); @@ -519,7 +521,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p2->o1.size () == 2); @@ -571,7 +573,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); t.commit (); assert (*p == o); @@ -581,7 +583,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); p->num++; db->update (*p); @@ -599,7 +601,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); t.commit (); assert (p->num == o.num + 1); @@ -651,9 +653,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p2a (db->load (o2a.id)); - auto_ptr p2b (db->load (o2b.id)); - auto_ptr p3 (db->load (o3.id)); + unique_ptr p2a (db->load (o2a.id)); + unique_ptr p2b (db->load (o2b.id)); + unique_ptr p3 (db->load (o3.id)); t.commit (); assert (p2a->o1 == 0); @@ -683,9 +685,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p2a (db->load (o2a.id)); - auto_ptr p2b (db->load (o2b.id)); - auto_ptr p3 (db->load (o3.id)); + unique_ptr p2a (db->load (o2a.id)); + unique_ptr p2b (db->load (o2b.id)); + unique_ptr p3 (db->load (o3.id)); t.commit (); assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); diff --git a/common/id/composite/makefile b/common/id/composite/makefile deleted file mode 100644 index 3edac7f..0000000 --- a/common/id/composite/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/id/composite/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix t_id_comp_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/composite/test.std b/common/id/composite/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/id/composite/testscript b/common/id/composite/testscript new file mode 100644 index 0000000..f87d4bc --- /dev/null +++ b/common/id/composite/testscript @@ -0,0 +1,33 @@ +# file : common/id/composite/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/id/nested/buildfile b/common/id/nested/buildfile new file mode 100644 index 0000000..777cb65 --- /dev/null +++ b/common/id/nested/buildfile @@ -0,0 +1,41 @@ +# file : common/nested/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_nested_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx index 57647fd..92a80f6 100644 --- a/common/id/nested/driver.cxx +++ b/common/id/nested/driver.cxx @@ -4,19 +4,21 @@ // Test nested ids. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Simple nested id. @@ -54,9 +56,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); - auto_ptr p (db->load (o.id)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + unique_ptr p (db->load (o.id)); t.commit (); assert (*p1 == o1); @@ -86,9 +88,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); - auto_ptr p (db->load (o.id)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + unique_ptr p (db->load (o.id)); t.commit (); assert (*p1 == o1); @@ -122,9 +124,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.c)); - auto_ptr p2 (db->load (o2.id.c)); - auto_ptr p (db->load (o.id)); + unique_ptr p1 (db->load (o1.id.c)); + unique_ptr p2 (db->load (o2.id.c)); + unique_ptr p (db->load (o.id)); t.commit (); assert (*p1 == o1); @@ -154,9 +156,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.c)); - auto_ptr p2 (db->load (o2.id.c)); - auto_ptr p (db->load (o.id)); + unique_ptr p1 (db->load (o1.id.c)); + unique_ptr p2 (db->load (o2.id.c)); + unique_ptr p (db->load (o.id)); t.commit (); assert (*p1 == o1); @@ -182,8 +184,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); t.commit (); assert (*p1 == o1); @@ -202,8 +204,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); t.commit (); assert (*p1 == o1); @@ -228,8 +230,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); t.commit (); assert (*p1 == o1); @@ -247,8 +249,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id.y)); - auto_ptr p2 (db->load (o2.id.y)); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); t.commit (); assert (*p1 == o1); diff --git a/common/id/nested/makefile b/common/id/nested/makefile deleted file mode 100644 index 120a8f0..0000000 --- a/common/id/nested/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/id/nested/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_id_nested_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/id/nested/test.std b/common/id/nested/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/id/nested/testscript b/common/id/nested/testscript new file mode 100644 index 0000000..89e8d7a --- /dev/null +++ b/common/id/nested/testscript @@ -0,0 +1,33 @@ +# file : common/nested/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/include/.gitignore b/common/include/.gitignore new file mode 100644 index 0000000..d52f166 --- /dev/null +++ b/common/include/.gitignore @@ -0,0 +1,17 @@ +# ODB-generated files. +# +obj1-odb.?xx +obj1-odb-*.?xx +obj2-odb.?xx +obj2-odb-*.?xx +obj3-odb.?xx +obj3-odb-*.?xx + +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx +test3-odb.?xx +test3-odb-*.?xx +test4-odb.?xx +test4-odb-*.?xx diff --git a/common/include/buildfile b/common/include/buildfile new file mode 100644 index 0000000..6db878c --- /dev/null +++ b/common/include/buildfile @@ -0,0 +1,51 @@ +# file : common/include/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = obj1 obj2 obj3 test1 test2 test3 test4 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). Also see driver.cxx for the details on +# the -I options usage. +# +odb_options = --table-prefix include_ \ + "-I$out_base" \ + "-I$src_base/.." \ + "-I$src_base/../.." + +cxx.poptions =+ "-I$out_base" "-I$src_base" \ + "-I$out_base/../.." "-I$src_base/../.." + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/include/driver.cxx b/common/include/driver.cxx index 935d285..561746a 100644 --- a/common/include/driver.cxx +++ b/common/include/driver.cxx @@ -11,13 +11,12 @@ // #include -#include #include #include #include -#include +#include #include "test1.hxx" #include "test1-odb.hxx" @@ -31,6 +30,9 @@ #include "test4.hxx" #include "test4-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; diff --git a/common/include/makefile b/common/include/makefile deleted file mode 100644 index 2ee3f38..0000000 --- a/common/include/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : common/include/makefile -# 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 -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) \ --I$(out_base)/../.. -I$(src_base)/../.. -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen): 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. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/include/test.std b/common/include/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/include/testscript b/common/include/testscript new file mode 100644 index 0000000..089f7a1 --- /dev/null +++ b/common/include/testscript @@ -0,0 +1,31 @@ +# file : common/include/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* &!odb-test.db +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $* +} diff --git a/common/index/buildfile b/common/index/buildfile new file mode 100644 index 0000000..535bd26 --- /dev/null +++ b/common/index/buildfile @@ -0,0 +1,40 @@ +# file : common/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix index_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/index/driver.cxx b/common/index/driver.cxx index 7634349..7a22a7c 100644 --- a/common/index/driver.cxx +++ b/common/index/driver.cxx @@ -5,18 +5,20 @@ // tests. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { // This is just a schema creation test. // - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); { transaction t (db->begin ()); diff --git a/common/index/makefile b/common/index/makefile deleted file mode 100644 index b0d062b..0000000 --- a/common/index/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --table-prefix index_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/index/test.std b/common/index/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/index/testscript b/common/index/testscript new file mode 100644 index 0000000..cbce341 --- /dev/null +++ b/common/index/testscript @@ -0,0 +1,33 @@ +# file : common/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/inheritance/polymorphism/.gitignore b/common/inheritance/polymorphism/.gitignore new file mode 100644 index 0000000..f183a6f --- /dev/null +++ b/common/inheritance/polymorphism/.gitignore @@ -0,0 +1,76 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test1.sql +test1-*.sql + +test2-odb.?xx +test2-odb-*.?xx +test2.sql +test2-*.sql + +test3-odb.?xx +test3-odb-*.?xx +test3.sql +test3-*.sql + +test4-odb.?xx +test4-odb-*.?xx +test4.sql +test4-*.sql + +test5-odb.?xx +test5-odb-*.?xx +test5.sql +test5-*.sql + +test6-odb.?xx +test6-odb-*.?xx +test6.sql +test6-*.sql + +test7-odb.?xx +test7-odb-*.?xx +test7.sql +test7-*.sql + +test8-odb.?xx +test8-odb-*.?xx +test8.sql +test8-*.sql + +test9-odb.?xx +test9-odb-*.?xx +test9.sql +test9-*.sql + +test10-odb.?xx +test10-odb-*.?xx +test10.sql +test10-*.sql + +test11-odb.?xx +test11-odb-*.?xx +test11.sql +test11-*.sql + +test12-odb.?xx +test12-odb-*.?xx +test12.sql +test12-*.sql + +test13-odb.?xx +test13-odb-*.?xx +test13.sql +test13-*.sql + +test14-odb.?xx +test14-odb-*.?xx +test14.sql +test14-*.sql + +test15-odb.?xx +test15-odb-*.?xx +test15.sql +test15-*.sql diff --git a/common/inheritance/polymorphism/buildfile b/common/inheritance/polymorphism/buildfile new file mode 100644 index 0000000..846eb12 --- /dev/null +++ b/common/inheritance/polymorphism/buildfile @@ -0,0 +1,52 @@ +# file : common/inheritance/polymorphism/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \ + test12 test13 test14 test15 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_p_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc + +testscript@./: schemas = $hs diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx index 6d4e615..12f4666 100644 --- a/common/inheritance/polymorphism/driver.cxx +++ b/common/inheritance/polymorphism/driver.cxx @@ -4,15 +4,14 @@ // Test polymorphic object inheritance. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test1.hxx" #include "test2.hxx" @@ -46,6 +45,9 @@ #include "test14-odb.hxx" #include "test15-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -87,7 +89,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test 1: basic polymorphism functionality. // @@ -136,9 +138,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); t.commit (); assert (*pr == r); @@ -150,9 +152,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d.id)); - auto_ptr pd2 (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d.id)); + unique_ptr pd2 (db->load (d.id)); t.commit (); assert (*pb == b); @@ -167,14 +169,14 @@ main (int argc, char* argv[]) try { - auto_ptr p (db->load (r.id)); + unique_ptr p (db->load (r.id)); assert (false); } catch (const object_not_persistent&) {} try { - auto_ptr p (db->load (b.id)); + unique_ptr p (db->load (b.id)); assert (false); } catch (const object_not_persistent&) {} @@ -452,14 +454,14 @@ main (int argc, char* argv[]) if (ds == "test1::base") { - auto_ptr d1 (db->load (d.id)); + unique_ptr d1 (db->load (d.id)); assert (*d1 == d); assert (*i == b); mask |= 1; } else if (ds == "test1::derived") { - auto_ptr b1 (db->load (b.id)); + unique_ptr b1 (db->load (b.id)); assert (*b1 == b); assert (*i == d); mask |= 2; @@ -562,9 +564,9 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); t.commit (); assert (*pr == r); @@ -661,9 +663,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); - auto_ptr pb (db->load (d.id)); - auto_ptr pr (db->load (d.id)); + unique_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (d.id)); + unique_ptr pr (db->load (d.id)); t.commit (); assert (pd->rp.object_id () == rp.id && @@ -791,18 +793,18 @@ main (int argc, char* argv[]) transaction t (db->begin ()); { - auto_ptr p1 (db->load (b1.id)); - auto_ptr p2 (db->load (b2.id)); - auto_ptr p3 (db->load (b3.id)); + unique_ptr p1 (db->load (b1.id)); + unique_ptr p2 (db->load (b2.id)); + unique_ptr p3 (db->load (b3.id)); assert (*p1 == b1); assert (*p2 == b2); assert (*p3 == b3); } { - auto_ptr p1 (db->load (d1.id)); - auto_ptr p2 (db->load (d2.id)); - auto_ptr p3 (db->load (d3.id)); + unique_ptr p1 (db->load (d1.id)); + unique_ptr p2 (db->load (d2.id)); + unique_ptr p3 (db->load (d3.id)); assert (*p1 == d1); assert (*p2 == d2); assert (*p3 == d3); @@ -1028,11 +1030,7 @@ main (int argc, char* argv[]) // Root. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (r.id)); -#else - auto_ptr p (db->load (r.id)); -#endif r.num++; r.strs.push_back ("aaaa"); @@ -1056,11 +1054,7 @@ main (int argc, char* argv[]) // Base. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (b.id)); -#else - auto_ptr p (db->load (b.id)); -#endif b.num++; b.str += "b"; @@ -1088,11 +1082,7 @@ main (int argc, char* argv[]) // Derived. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (d.id)); // Via root. -#else - auto_ptr p (db->load (d.id)); // Via root. -#endif d.num++; d.str += "d"; @@ -1156,11 +1146,7 @@ main (int argc, char* argv[]) // Root. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (r.id)); -#else - auto_ptr p (db->load (r.id)); -#endif r.num++; r.strs.push_back ("aaaaa"); @@ -1180,11 +1166,7 @@ main (int argc, char* argv[]) // Base. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (b.id)); -#else - auto_ptr p (db->load (b.id)); -#endif b.num++; b.str += "b"; @@ -1206,11 +1188,7 @@ main (int argc, char* argv[]) // Derived. // { -#ifdef HAVE_CXX11 unique_ptr p (db->load (d.id)); // Via root. -#else - auto_ptr p (db->load (d.id)); // Via root. -#endif d.num++; d.str += "d"; @@ -1264,11 +1242,7 @@ main (int argc, char* argv[]) base b (1, 1, "bbb"); -#ifdef HAVE_CXX11 unique_ptr d (new derived (2, 2, "ddd")); -#else - auto_ptr d (new derived (2, 2, "ddd")); -#endif // Persist. // @@ -1284,13 +1258,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd (db->load (d->id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d->id)); -#endif db->load (b.id, *pb); db->load (d->id, *pd); @@ -1353,11 +1322,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr p (db->load (d.id)); -#else - auto_ptr p (db->load (d.id)); -#endif t.commit (); } } @@ -1365,7 +1330,6 @@ main (int argc, char* argv[]) // Test 7: polymorphism and object cache (session). // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { using namespace test7; @@ -1468,7 +1432,6 @@ main (int argc, char* argv[]) } } } -#endif // Test 8: polymorphism and abstract bases. // @@ -1517,15 +1480,9 @@ main (int argc, char* argv[]) // load (id) // -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd1 (db->load (d1.id)); unique_ptr pd2 (db->load (d2.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d1.id)); - auto_ptr pd2 (db->load (d2.id)); -#endif assert (*pb == b); assert (*pd1 == d1); @@ -1608,15 +1565,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd1 (db->load (d1.id)); unique_ptr pd2 (db->load (d2.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd1 (db->load (d1.id)); - auto_ptr pd2 (db->load (d2.id)); -#endif t.commit (); @@ -1743,7 +1694,6 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr p_ro_r (db->load (ro_r.id)); unique_ptr p_rw_b (db->load (rw_b.id)); unique_ptr p_ro_d (db->load (ro_d.id)); @@ -1751,15 +1701,6 @@ main (int argc, char* argv[]) unique_ptr p_rw_r (db->load (rw_r.id)); unique_ptr p_ro_b (db->load (ro_b.id)); unique_ptr p_rw_d (db->load (rw_d.id)); -#else - auto_ptr p_ro_r (db->load (ro_r.id)); - auto_ptr p_rw_b (db->load (rw_b.id)); - auto_ptr p_ro_d (db->load (ro_d.id)); - - auto_ptr p_rw_r (db->load (rw_r.id)); - auto_ptr p_ro_b (db->load (ro_b.id)); - auto_ptr p_rw_d (db->load (rw_d.id)); -#endif t.commit (); @@ -1795,13 +1736,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd (db->load (d.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); -#endif t.commit (); assert (*pb == b); @@ -1825,13 +1761,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd (db->load (d.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); -#endif t.commit (); assert (*pb == b); @@ -1867,13 +1798,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd (db->load (d.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); -#endif t.commit (); assert (*pb == b); @@ -1906,13 +1832,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (b.id)); unique_ptr pd (db->load (d.id)); -#else - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); -#endif t.commit (); @@ -1975,13 +1896,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (id1)); unique_ptr pd (db->load (id2)); -#else - auto_ptr pb (db->load (id1)); - auto_ptr pd (db->load (id2)); -#endif t.commit (); @@ -2019,17 +1935,10 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pbr (db->load (b.id)); unique_ptr pdr (db->load (d.id)); unique_ptr pdb (db->load (d.id)); unique_ptr pb1r (db->load (b1.id)); -#else - auto_ptr pbr (db->load (b.id)); - auto_ptr pdr (db->load (d.id)); - auto_ptr pdb (db->load (d.id)); - auto_ptr pb1r (db->load (b1.id)); -#endif t.commit (); base& rb (static_cast (*pbr)); @@ -2083,10 +1992,10 @@ main (int argc, char* argv[]) object4* p4 (db->load (d.o4[0]->id)); t.commit (); - assert (p1->d->num = d.num); - assert (p2->d[0]->num = d.num); - assert (p3->d[0]->num = d.num); - assert (p4->d->num = d.num); + assert (p1->d->num == d.num); + assert (p2->d[0]->num == d.num); + assert (p3->d[0]->num == d.num); + assert (p4->d->num == d.num); delete p1->d; } @@ -2149,11 +2058,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr pb (db->load (d.id)); -#else - auto_ptr pb (db->load (d.id)); -#endif t.commit (); derived* pd (dynamic_cast (pb.get ())); diff --git a/common/inheritance/polymorphism/makefile b/common/inheritance/polymorphism/makefile deleted file mode 100644 index 2b969f5..0000000 --- a/common/inheritance/polymorphism/makefile +++ /dev/null @@ -1,120 +0,0 @@ -# file : common/inheritance/polymorphism/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx test10.hxx test11.hxx test12.hxx test13.hxx \ -test14.hxx test15.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix inhrt_p_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule,,$(filter %.sql,$(gen)))) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d,$(filter %.sql,$(gen))))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/polymorphism/test.std b/common/inheritance/polymorphism/test.std deleted file mode 100644 index 5c18191..0000000 --- a/common/inheritance/polymorphism/test.std +++ /dev/null @@ -1,36 +0,0 @@ -base pre_persist 1 const -base post_persist 1 const -derived pre_persist 2 const -derived post_persist 2 const -base pre_load 0 -base post_load 1 -derived pre_load 0 const -derived post_load 2 const -base pre_load 1 -base post_load 1 -derived pre_load 2 const -derived post_load 2 const -base pre_load 1 -base post_load 1 -derived pre_load 2 const -derived post_load 2 const -base pre_update 1 const -base post_update 1 const -derived pre_update 2 const -derived post_update 2 const -base pre_load 0 -base post_load 1 -derived pre_load 0 const -derived post_load 2 const -base pre_erase 1 const -base post_erase 1 const -derived pre_erase 2 const -derived post_erase 2 const -derived pre_persist 3 const -derived post_persist 3 const -derived pre_persist 4 const -derived post_persist 4 const -derived pre_load 0 const -derived pre_load 0 const -derived post_load 4 const -derived post_load 3 const diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx index e6dba8d..172e7e8 100644 --- a/common/inheritance/polymorphism/test5.hxx +++ b/common/inheritance/polymorphism/test5.hxx @@ -4,8 +4,6 @@ #ifndef TEST5_HXX #define TEST5_HXX -#include // HAVE_CXX11 - #include #include #include @@ -18,11 +16,7 @@ #pragma db namespace table("t5_") namespace test5 { -#ifdef HAVE_CXX11 #pragma db object polymorphic optimistic pointer(std::unique_ptr) -#else - #pragma db object polymorphic optimistic pointer(std::auto_ptr) -#endif struct root { virtual ~root () {} diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx index 1e42400..b0f9a16 100644 --- a/common/inheritance/polymorphism/test6.hxx +++ b/common/inheritance/polymorphism/test6.hxx @@ -4,8 +4,6 @@ #ifndef TEST6_HXX #define TEST6_HXX -#include // HAVE_CXX11 - #include #include @@ -17,11 +15,7 @@ #pragma db namespace table("t6_") namespace test6 { -#ifdef HAVE_CXX11 #pragma db object polymorphic pointer(std::unique_ptr) -#else - #pragma db object polymorphic pointer(std::auto_ptr) -#endif struct root { virtual ~root () {} @@ -60,11 +54,7 @@ namespace test6 unsigned long dnum; std::string dstr; -#ifdef HAVE_CXX11 std::unique_ptr ptr; -#else - std::auto_ptr ptr; -#endif void db_callback (odb::callback_event, odb::database&) const; diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx index 6edb834..60da98e 100644 --- a/common/inheritance/polymorphism/test7.hxx +++ b/common/inheritance/polymorphism/test7.hxx @@ -4,28 +4,17 @@ #ifndef TEST7_HXX #define TEST7_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - #include // Test polymorphism and object cache (session). // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) #pragma db namespace table("t7_") namespace test7 { -#ifdef HAVE_CXX11 using std::shared_ptr; -#else - using std::tr1::shared_ptr; -#endif #pragma db object polymorphic pointer(shared_ptr) session struct root @@ -61,6 +50,5 @@ namespace test7 std::string dstr; }; } -#endif #endif // TEST7_HXX diff --git a/common/inheritance/polymorphism/testscript b/common/inheritance/polymorphism/testscript new file mode 100644 index 0000000..89e5726 --- /dev/null +++ b/common/inheritance/polymorphism/testscript @@ -0,0 +1,80 @@ +# file : common/inheritance/polymorphism/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + base pre_persist 1 const + base post_persist 1 const + derived pre_persist 2 const + derived post_persist 2 const + base pre_load 0 + base post_load 1 + derived pre_load 0 const + derived post_load 2 const + base pre_load 1 + base post_load 1 + derived pre_load 2 const + derived post_load 2 const + base pre_load 1 + base post_load 1 + derived pre_load 2 const + derived post_load 2 const + base pre_update 1 const + base post_update 1 const + derived pre_update 2 const + derived post_update 2 const + base pre_load 0 + base post_load 1 + derived pre_load 0 const + derived post_load 2 const + base pre_erase 1 const + base post_erase 1 const + derived pre_erase 2 const + derived post_erase 2 const + derived pre_persist 3 const + derived post_persist 3 const + derived pre_persist 4 const + derived post_persist 4 const + derived pre_load 0 const + derived pre_load 0 const + derived post_load 4 const + derived post_load 3 const + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql-schema.testscript + + for s: $schemas + cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd + end; + + $* ($multi ? 'mysql' : ) $mysql_options +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql-schema.testscript + + for s: $schemas + $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql + end; + + $* ($multi ? 'pgsql' : ) $pgsql_options +} diff --git a/common/inheritance/reuse/buildfile b/common/inheritance/reuse/buildfile new file mode 100644 index 0000000..b82439a --- /dev/null +++ b/common/inheritance/reuse/buildfile @@ -0,0 +1,41 @@ +# file : common/inheritance/reuse/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_r_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx index 616c6a4..e6122bb 100644 --- a/common/inheritance/reuse/driver.cxx +++ b/common/inheritance/reuse/driver.cxx @@ -4,18 +4,20 @@ // Test reuse object inheritance. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); base b; b.comp_.bools.push_back (true); @@ -99,7 +101,7 @@ main (int argc, char* argv[]) reference r; r.o1_ = &o1; - empty e; + empty_object e; e.comp_.bools.push_back (true); e.comp_.bools.push_back (true); e.comp_.obools.push_back (true); @@ -134,12 +136,12 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr lb (db->load (b.id_)); - auto_ptr lo1 (db->load (o1.id_)); - auto_ptr lo2 (db->load (o2.id_)); - auto_ptr lo3 (db->load (o3.id_)); - auto_ptr le (db->load (e.id_)); - auto_ptr lr (db->load (r.id_)); + unique_ptr lb (db->load (b.id_)); + unique_ptr lo1 (db->load (o1.id_)); + unique_ptr lo2 (db->load (o2.id_)); + unique_ptr lo3 (db->load (o3.id_)); + unique_ptr le (db->load (e.id_)); + unique_ptr lr (db->load (r.id_)); t.commit (); assert (b == *lb); diff --git a/common/inheritance/reuse/makefile b/common/inheritance/reuse/makefile deleted file mode 100644 index 58222f3..0000000 --- a/common/inheritance/reuse/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/inheritance/reuse/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix inhrt_r_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx index 8124417..48f474f 100644 --- a/common/inheritance/reuse/test.hxx +++ b/common/inheritance/reuse/test.hxx @@ -146,7 +146,7 @@ struct object3: abstract_base, id_base // Empty derived object. // #pragma db object -struct empty: base +struct empty_object: base { }; diff --git a/common/inheritance/reuse/test.std b/common/inheritance/reuse/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/inheritance/reuse/testscript b/common/inheritance/reuse/testscript new file mode 100644 index 0000000..995b3f5 --- /dev/null +++ b/common/inheritance/reuse/testscript @@ -0,0 +1,33 @@ +# file : common/inheritance/reuse/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/inheritance/transient/buildfile b/common/inheritance/transient/buildfile new file mode 100644 index 0000000..1961abc --- /dev/null +++ b/common/inheritance/transient/buildfile @@ -0,0 +1,41 @@ +# file : common/inheritance/transient/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_t_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx index fa6e05d..1caae6c 100644 --- a/common/inheritance/transient/driver.cxx +++ b/common/inheritance/transient/driver.cxx @@ -4,18 +4,20 @@ // Test transient inheritance of objects, composite value types, and views. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o; o.num = 1; @@ -48,7 +50,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); + unique_ptr p (db->load (o.id_)); t.commit (); assert (*p == o); diff --git a/common/inheritance/transient/makefile b/common/inheritance/transient/makefile deleted file mode 100644 index 57e7909..0000000 --- a/common/inheritance/transient/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/inheritance/transient/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix inhrt_t_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inheritance/transient/test.std b/common/inheritance/transient/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/inheritance/transient/testscript b/common/inheritance/transient/testscript new file mode 100644 index 0000000..bce91de --- /dev/null +++ b/common/inheritance/transient/testscript @@ -0,0 +1,33 @@ +# file : common/inheritance/transient/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/inverse/buildfile b/common/inverse/buildfile new file mode 100644 index 0000000..63fa1cb --- /dev/null +++ b/common/inverse/buildfile @@ -0,0 +1,42 @@ +# file : common/inverse/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_inverse_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx index 07c584d..842438e 100644 --- a/common/inverse/driver.cxx +++ b/common/inverse/driver.cxx @@ -4,19 +4,21 @@ // Test bidirectional relationships with inverse sides. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test raw pointers. // @@ -211,7 +213,6 @@ main (int argc, char* argv[]) // Test shared_ptr/weak_ptr. // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { using namespace test2; @@ -323,7 +324,6 @@ main (int argc, char* argv[]) } } } -#endif // Test inverse based on points_to. // @@ -346,7 +346,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); + unique_ptr p (db->load (o1.id)); assert (p->o2->id == o1.o2->id); t.commit (); @@ -357,7 +357,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - auto_ptr p (db->query_one (query::o2->o1.i == o1.id.i && + unique_ptr p (db->query_one (query::o2->o1.i == o1.id.i && query::o2->o1.j == o1.id.j)); assert (p->o2->id == o1.o2->id); @@ -383,7 +383,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o3.id)); + unique_ptr p (db->load (o3.id)); assert (p->o4[0]->id == o3.o4[0]->id); assert (p->o4[1]->id == o3.o4[1]->id); @@ -395,7 +395,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - auto_ptr p (db->query_one (query::id == o3.id)); + unique_ptr p (db->query_one (query::id == o3.id)); assert (p->o4[0]->id == o3.o4[0]->id); assert (p->o4[1]->id == o3.o4[1]->id); @@ -426,7 +426,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); + unique_ptr p (db->load (o1.id)); assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); t.commit (); @@ -437,7 +437,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - auto_ptr p (db->query_one ( + unique_ptr p (db->query_one ( query::o2->id.i == o1.o2->id.i && query::o2->id.j == o1.o2->id.j)); assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); @@ -466,7 +466,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o3.id)); + unique_ptr p (db->load (o3.id)); assert (p->o4[0]->id.i == o3.o4[0]->id.i && p->o4[0]->id.j == o3.o4[0]->id.j); @@ -481,7 +481,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - auto_ptr p (db->query_one (query::id == o3.id)); + unique_ptr p (db->query_one (query::id == o3.id)); assert (p->o4[0]->id.i == o3.o4[0]->id.i && p->o4[0]->id.j == o3.o4[0]->id.j); diff --git a/common/inverse/makefile b/common/inverse/makefile deleted file mode 100644 index 59d86c1..0000000 --- a/common/inverse/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/inverse/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix t_inverse_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index 35fd813..a7b8678 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include #include #include @@ -13,10 +11,6 @@ #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - // Test raw pointers. // #pragma db namespace table("t1_") @@ -127,18 +121,11 @@ namespace test1 // Test shared_ptr/weak_ptr. // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - #pragma db namespace table("t2_") namespace test2 { -#ifdef HAVE_CXX11 using std::shared_ptr; using std::weak_ptr; -#else - using std::tr1::shared_ptr; - using std::tr1::weak_ptr; -#endif struct obj1; struct obj2; @@ -229,7 +216,6 @@ namespace test2 obj1_wptr_vec o1; }; } -#endif // Test inverse based on points_to. // diff --git a/common/inverse/test.std b/common/inverse/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/inverse/testscript b/common/inverse/testscript new file mode 100644 index 0000000..c2a4e3e --- /dev/null +++ b/common/inverse/testscript @@ -0,0 +1,33 @@ +# file : common/inverse/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/lazy-ptr/buildfile b/common/lazy-ptr/buildfile new file mode 100644 index 0000000..d495d2f --- /dev/null +++ b/common/lazy-ptr/buildfile @@ -0,0 +1,41 @@ +# file : common/lazy-ptr/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix lazy_ptr_ \ + --generate-schema \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx index 9458772..9a3b324 100644 --- a/common/lazy-ptr/driver.cxx +++ b/common/lazy-ptr/driver.cxx @@ -4,26 +4,32 @@ // Test lazy object pointers. // -#include // std::auto_ptr +#include // std::unique_ptr #include // std::move -#include #include #include #include #include -#include // ODB_CXX11_* -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; namespace test2 { + cont::cont (unsigned long i) + : id (i) + { + } + obj_ptr create (unsigned int id) { @@ -44,7 +50,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Raw. // @@ -61,8 +67,8 @@ main (int argc, char* argv[]) t.commit (); } - auto_ptr c1 (new cont (1)); - auto_ptr c2 (new cont (2)); + unique_ptr c1 (new cont (1)); + unique_ptr c2 (new cont (2)); lazy_ptr lo1 (*db, 1); obj* o2 (new obj (2)); @@ -104,7 +110,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr c (db->load (1)); + unique_ptr c (db->load (1)); obj* o (db->load (1)); // Not loaded. @@ -117,13 +123,8 @@ main (int argc, char* argv[]) // Correct object ids. // -#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); -#else - assert (c->o[0].object_id () == o->id); - assert (o->c.object_id () == c->id); -#endif // Load. // @@ -144,7 +145,7 @@ main (int argc, char* argv[]) } } - // std::auto_ptr/std::unique_ptr + // std::unique_ptr // { using namespace test2; @@ -164,11 +165,7 @@ main (int argc, char* argv[]) lazy_obj_ptr lo1 = create (*db, 1); lo1 = create (*db, 1); -#ifdef HAVE_CXX11 c1->o = std::move (lo1); -#else - c1->o = lo1; -#endif c2->o = create (2); { @@ -197,13 +194,8 @@ main (int argc, char* argv[]) // Correct object ids. // -#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o.object_id () == o->id); assert (o->c.object_id () == c->id); -#else - assert (c->o.object_id () == o->id); - assert (o->c.object_id () == c->id); -#endif // Load. // @@ -237,7 +229,6 @@ main (int argc, char* argv[]) // Shared pointer from C++11 or TR1. // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { using namespace test3; @@ -276,7 +267,6 @@ main (int argc, char* argv[]) // Test move constructors. // -#ifdef HAVE_CXX11 { lazy_shared_ptr tmp (*db, 1); lazy_shared_ptr l (std::move (tmp)); @@ -288,7 +278,6 @@ main (int argc, char* argv[]) lazy_shared_ptr l (*db, std::move (tmp)); assert (lc1 == l); } -#endif { transaction t (db->begin ()); @@ -321,13 +310,8 @@ main (int argc, char* argv[]) // Correct object ids. // -#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (c->o[0].object_id () == o->id); assert (o->c.object_id () == c->id); -#else - assert (c->o[0].object_id () == o->id); - assert (o->c.object_id () == c->id); -#endif // Load. // @@ -352,12 +336,7 @@ main (int argc, char* argv[]) assert (!c->o[1].loaded ()); lazy_shared_ptr l (c->o[1].lock ()); assert (!l.loaded ()); - -#if defined(HAVE_CXX11) && defined(ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT) assert (l.object_id () == c->o[1].object_id ()); -#else - assert (l.object_id () == c->o[1].object_id ()); -#endif // Reload. // @@ -372,7 +351,6 @@ main (int argc, char* argv[]) t.commit (); } } -#endif } catch (const odb::exception& e) { diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile deleted file mode 100644 index 62880fa..0000000 --- a/common/lazy-ptr/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/lazy-ptr/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-session \ ---table-prefix lazy_ptr_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index da1f2c4..f946029 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include #include #include @@ -13,11 +11,6 @@ #include #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -# include -#endif - // Raw pointer. // #pragma db namespace table("t1_") @@ -76,22 +69,16 @@ namespace test2 class obj; class cont; -#ifdef HAVE_CXX11 typedef std::unique_ptr obj_ptr; typedef std::unique_ptr cont_ptr; typedef odb::lazy_unique_ptr lazy_obj_ptr; -#else - typedef std::auto_ptr obj_ptr; - typedef std::auto_ptr cont_ptr; - typedef odb::lazy_auto_ptr lazy_obj_ptr; -#endif #pragma db object class cont { public: - cont () {} - cont (unsigned long i): id (i) {} + cont () = default; + cont (unsigned long id); #pragma db id unsigned long id; @@ -104,7 +91,7 @@ namespace test2 class obj { public: - obj () {} + obj () = default; obj (unsigned long i): id (i) {} #pragma db id @@ -117,19 +104,12 @@ namespace test2 // shared_ptr // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) #pragma db namespace table("t3_") namespace test3 { -#ifdef HAVE_CXX11 using std::shared_ptr; using odb::lazy_shared_ptr; using odb::lazy_weak_ptr; -#else - using std::tr1::shared_ptr; - using odb::tr1::lazy_shared_ptr; - using odb::tr1::lazy_weak_ptr; -#endif class obj; @@ -163,6 +143,5 @@ namespace test3 lazy_shared_ptr c; }; } -#endif #endif // TEST_HXX diff --git a/common/lazy-ptr/test.std b/common/lazy-ptr/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/lazy-ptr/testscript b/common/lazy-ptr/testscript new file mode 100644 index 0000000..736fa4c --- /dev/null +++ b/common/lazy-ptr/testscript @@ -0,0 +1,33 @@ +# file : common/lazy-ptr/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/lifecycle/buildfile b/common/lifecycle/buildfile new file mode 100644 index 0000000..b5b2b00 --- /dev/null +++ b/common/lifecycle/buildfile @@ -0,0 +1,40 @@ +# file : common/lifecycle/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix lifecycle_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 460cae1..a01d5bd 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -4,18 +4,20 @@ // Test object state transistions. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Database operation out of transaction. // @@ -43,7 +45,7 @@ main (int argc, char* argv[]) try { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); assert (false); t.commit (); } @@ -78,10 +80,10 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->find (1)); + unique_ptr o1 (db->find (1)); assert (o1.get () != 0 && o1->str_ == "value 1"); - auto_ptr o2 (db->find (2)); + unique_ptr o2 (db->find (2)); assert (o2.get () == 0); t.commit (); @@ -106,14 +108,14 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); assert (o->str_ == "value 1"); t.commit (); try { transaction t (db->begin ()); - auto_ptr o (db->load (2)); + unique_ptr o (db->load (2)); assert (false); t.commit (); } @@ -173,7 +175,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); o->str_ = "value 2"; db->update (*o); t.commit (); @@ -193,7 +195,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); assert (o->str_ == "value 2"); t.commit (); } @@ -202,7 +204,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); db->update (*o); t.commit (); } @@ -211,7 +213,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); db->erase (*o); t.commit (); @@ -230,7 +232,7 @@ main (int argc, char* argv[]) try { transaction t (db->begin ()); - auto_ptr o (db->load (1)); + unique_ptr o (db->load (1)); assert (false); t.commit (); } diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile deleted file mode 100644 index da954eb..0000000 --- a/common/lifecycle/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/lifecycle/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix lifecycle_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/lifecycle/test.std b/common/lifecycle/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/lifecycle/testscript b/common/lifecycle/testscript new file mode 100644 index 0000000..0337bba --- /dev/null +++ b/common/lifecycle/testscript @@ -0,0 +1,33 @@ +# file : common/lifecycle/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/makefile b/common/makefile deleted file mode 100644 index 555851a..0000000 --- a/common/makefile +++ /dev/null @@ -1,123 +0,0 @@ -# file : common/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -access \ -as \ -blob \ -bulk \ -callback \ -changelog \ -circular/single \ -circular/multiple \ -composite \ -const-object \ -const-member \ -container/basics \ -container/change-tracking \ -ctor \ -default \ -definition \ -enum \ -erase-query \ -id/auto \ -id/composite \ -id/nested \ -include \ -index \ -inheritance/polymorphism \ -inheritance/reuse \ -inheritance/transient \ -inverse \ -lazy-ptr \ -lifecycle \ -no-id \ -object \ -optimistic \ -pragma \ -prepared \ -query/basics \ -query/array \ -query/one \ -readonly \ -relationship/basics \ -relationship/on-delete \ -relationship/query \ -schema/namespace \ -schema/embedded/basics \ -schema/embedded/order \ -section/basics \ -section/polymorphism \ -session/cache \ -statement/processing \ -template \ -transaction/basics \ -transaction/callback \ -types \ -view/basics \ -virtual \ -wrapper - -thread_tests := threads -cxx11_tests := session/custom view/olv - -no_dist_tests := changelog include - -no_multi_tests := changelog include - -$(default): -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard - -all_tests := $(tests) $(thread_tests) $(cxx11_tests) -build_tests := $(tests) $(thread_tests) - -ifeq ($(cxx_standard),c++11) -build_tests += $(cxx11_tests) -endif - -ifeq ($(db_id),common) -build_tests := $(filter-out $(no_multi_tests),$(build_tests)) -endif - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) - -name := common -$(dist): name := $(name) -$(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) -$(dist): export thread_dirs := $(thread_tests) -$(dist): export cxx11_dirs := $(cxx11_tests) -$(dist): export extra_dist := test.bat $(call vc8slns,$(name)) \ -$(call vc9slns,$(name)) $(call vc10slns,$(name)) $(call vc11slns,$(name)) \ -$(call vc12slns,$(name)) -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) - $(call meta-automake) - $(call meta-vc8slns,$(name)) - $(call meta-vc9slns,$(name)) - $(call meta-vc10slns,$(name)) - $(call meta-vc11slns,$(name)) - $(call meta-vc12slns,$(name)) - $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(build_tests)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) -else -$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) -endif diff --git a/common/no-id/buildfile b/common/no-id/buildfile new file mode 100644 index 0000000..1a64401 --- /dev/null +++ b/common/no-id/buildfile @@ -0,0 +1,41 @@ +# file : common/no-id/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix no_id_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx index ce51883..eee69a5 100644 --- a/common/no-id/driver.cxx +++ b/common/no-id/driver.cxx @@ -4,18 +4,20 @@ // Test persistent classes without id. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o1 (1, "aaa"); object o2 (2, "bbb"); diff --git a/common/no-id/makefile b/common/no-id/makefile deleted file mode 100644 index 1005447..0000000 --- a/common/no-id/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/no-id/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix no_id_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/no-id/test.std b/common/no-id/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/no-id/testscript b/common/no-id/testscript new file mode 100644 index 0000000..5ec57ee --- /dev/null +++ b/common/no-id/testscript @@ -0,0 +1,33 @@ +# file : common/no-id/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/object/buildfile b/common/object/buildfile new file mode 100644 index 0000000..cb56aee --- /dev/null +++ b/common/object/buildfile @@ -0,0 +1,41 @@ +# file : common/object/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix object_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/object/driver.cxx b/common/object/driver.cxx index e8700b4..1c29417 100644 --- a/common/object/driver.cxx +++ b/common/object/driver.cxx @@ -4,18 +4,20 @@ // Test persistent classes. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test persistent class template instantiation. // @@ -51,8 +53,8 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr po1 (db->load (po.first)); - auto_ptr d1 (db->load (d.id)); + unique_ptr po1 (db->load (po.first)); + unique_ptr d1 (db->load (d.id)); t.commit (); assert (po == *po1); diff --git a/common/object/makefile b/common/object/makefile deleted file mode 100644 index d8c534e..0000000 --- a/common/object/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : common/object/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix object_ --generate-query -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/object/test.std b/common/object/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/object/testscript b/common/object/testscript new file mode 100644 index 0000000..6982409 --- /dev/null +++ b/common/object/testscript @@ -0,0 +1,33 @@ +# file : common/object/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/optimistic/buildfile b/common/optimistic/buildfile new file mode 100644 index 0000000..06af705 --- /dev/null +++ b/common/optimistic/buildfile @@ -0,0 +1,41 @@ +# file : common/optimistic/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_optimistic_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx index 3d33eb4..6dfec6e 100644 --- a/common/optimistic/driver.cxx +++ b/common/optimistic/driver.cxx @@ -4,23 +4,25 @@ // Test optimistic concurrency support. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; unsigned long -version (const auto_ptr& db, unsigned long id) +version (const unique_ptr& db, unsigned long id) { typedef odb::query query; typedef odb::result result; @@ -34,7 +36,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o (1); o.num = 123; @@ -80,7 +82,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); @@ -103,7 +105,7 @@ main (int argc, char* argv[]) // Verify the data hasn't changed. // - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); // Reload the object. @@ -201,7 +203,7 @@ main (int argc, char* argv[]) // Verify the container data hasn't changed. // - auto_ptr o1 (db->load ("abc")); + unique_ptr o1 (db->load ("abc")); assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); t.commit (); diff --git a/common/optimistic/makefile b/common/optimistic/makefile deleted file mode 100644 index dc179bd..0000000 --- a/common/optimistic/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/optimistic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_optimistic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/optimistic/test.std b/common/optimistic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/optimistic/testscript b/common/optimistic/testscript new file mode 100644 index 0000000..9ebafb2 --- /dev/null +++ b/common/optimistic/testscript @@ -0,0 +1,33 @@ +# file : common/optimistic/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/pragma/buildfile b/common/pragma/buildfile new file mode 100644 index 0000000..a2eeaa0 --- /dev/null +++ b/common/pragma/buildfile @@ -0,0 +1,39 @@ +# file : common/pragma/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pragma_ + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx index 932ca14..a9cc6e0 100644 --- a/common/pragma/driver.cxx +++ b/common/pragma/driver.cxx @@ -5,17 +5,19 @@ // #include -#include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; diff --git a/common/pragma/makefile b/common/pragma/makefile deleted file mode 100644 index fb7ab20..0000000 --- a/common/pragma/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/pragma/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --table-prefix pragma_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/pragma/test.std b/common/pragma/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/pragma/testscript b/common/pragma/testscript new file mode 100644 index 0000000..089f7a1 --- /dev/null +++ b/common/pragma/testscript @@ -0,0 +1,31 @@ +# file : common/include/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* &!odb-test.db +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $* +} diff --git a/common/prepared/buildfile b/common/prepared/buildfile new file mode 100644 index 0000000..4006a4f --- /dev/null +++ b/common/prepared/buildfile @@ -0,0 +1,43 @@ +# file : common/prepared/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix prepared_ \ + --generate-schema \ + --generate-query \ + --generate-prepared \ + --omit-unprepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx index a7a6a21..44df651 100644 --- a/common/prepared/driver.cxx +++ b/common/prepared/driver.cxx @@ -4,20 +4,21 @@ // Test prepared query functionality. // -#include // std::auto_ptr, std::unique_ptr +#include // std::unique_ptr #include // std::move -#include #include #include #include -#include -#include // HAVE_CXX11 +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -32,21 +33,13 @@ query_factory (const char* name, connection& c) { typedef odb::query query; -#ifdef HAVE_CXX11 unique_ptr p (new params); -#else - auto_ptr p (new params); -#endif prepared_query pq ( c.prepare_query ( name, query::age > query::_ref (p->age) && query::name != query::_ref (p->name))); -#ifdef HAVE_CXX11 c.cache_query (pq, move (p)); -#else - c.cache_query (pq, p); -#endif } int @@ -54,7 +47,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); { person p1 ("John First", 91); @@ -184,21 +177,13 @@ main (int argc, char* argv[]) { assert (i == 1); -#ifdef HAVE_CXX11 unique_ptr p (new unsigned short); -#else - auto_ptr p (new unsigned short); -#endif age = p.get (); pq = db->prepare_query ( "person-ref-age-query", query::age > query::_ref (*age)); -#ifdef HAVE_CXX11 db->cache_query (pq, move (p)); -#else - db->cache_query (pq, p); -#endif } else if (i == 2) { @@ -285,7 +270,6 @@ main (int argc, char* argv[]) // Cached query with lambda factory. // -#ifdef HAVE_CXX11 { db->query_factory ( "person-params-query-2", @@ -353,15 +337,8 @@ main (int argc, char* argv[]) t.commit (); } - db->query_factory ("person-params-query-3", -#ifdef HAVE_CXX11_NULLPTR - nullptr -#else - database::query_factory_ptr () -#endif - ); + db->query_factory ("person-params-query-3", nullptr); } -#endif // View prepared query. // @@ -433,12 +410,12 @@ main (int argc, char* argv[]) db->prepare_query ("query-0", query::id == p.id_ + 1)); { - auto_ptr p (pq1.execute_one ()); + unique_ptr p (pq1.execute_one ()); assert (p.get () != 0 && p->name_ == "John Doe"); } { - auto_ptr p (pq0.execute_one ()); + unique_ptr p (pq0.execute_one ()); assert (p.get () == 0); } diff --git a/common/prepared/makefile b/common/prepared/makefile deleted file mode 100644 index ae18002..0000000 --- a/common/prepared/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/prepared/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --omit-unprepared --table-prefix prepared_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/prepared/test.std b/common/prepared/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/prepared/testscript b/common/prepared/testscript new file mode 100644 index 0000000..3530c5b --- /dev/null +++ b/common/prepared/testscript @@ -0,0 +1,33 @@ +# file : common/prepared/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/query/array/buildfile b/common/query/array/buildfile new file mode 100644 index 0000000..3beb6d0 --- /dev/null +++ b/common/query/array/buildfile @@ -0,0 +1,43 @@ +# file : common/query/array/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_array_ \ + --generate-schema \ + --generate-query \ + --generate-prepared \ + --sql-name-case oracle:upper + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx index 4559553..9327751 100644 --- a/common/query/array/driver.cxx +++ b/common/query/array/driver.cxx @@ -5,36 +5,39 @@ // #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::memcpy -#include #include #include #include -#include // DATABASE_* -#include +#include // DATABASE_* +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; -#if defined(DATABASE_MYSQL) +#ifndef MULTI_DATABASE +# if defined(DATABASE_MYSQL) const odb::mysql::database_type_id bt = odb::mysql::id_blob; -#elif defined(DATABASE_SQLITE) +# elif defined(DATABASE_SQLITE) const odb::sqlite::database_type_id bt = odb::sqlite::id_blob; -#elif defined(DATABASE_PGSQL) +# elif defined(DATABASE_PGSQL) const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; -#elif defined(DATABASE_ORACLE) +# elif defined(DATABASE_ORACLE) const odb::oracle::database_type_id bt = odb::oracle::id_raw; -#elif defined(DATABASE_MSSQL) +# elif defined(DATABASE_MSSQL) const odb::mssql::database_type_id bt = odb::mssql::id_binary; -#elif defined(DATABASE_COMMON) -#else -# error unknown database +# else +# error unknown database +# endif #endif int @@ -42,7 +45,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); typedef odb::query query; @@ -67,7 +70,7 @@ main (int argc, char* argv[]) // string // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::s == "abc")) == 1); assert (size (db->query (query::s == query::_val ("bcd"))) == 1); assert (size (db->query ("s = " + query::_val ("bcd"))) == 1); @@ -77,12 +80,12 @@ main (int argc, char* argv[]) { char a[] = "bcd"; char* ra = a; -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::s == a)) == 1); assert (size (db->query (query::s == query::_val (a))) == 1); #endif assert (size (db->query (query::s == query::_ref (ra))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("s = " + query::_val (a))) == 1); assert (size (db->query ("s = " + query::_ref (a))) == 1); #endif @@ -91,12 +94,12 @@ main (int argc, char* argv[]) { const char a[] = "bcd"; const char* ra = a; -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::s == a)) == 1); assert (size (db->query (query::s == query::_val (a))) == 1); #endif assert (size (db->query (query::s == query::_ref (ra))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("s = " + query::_val (a))) == 1); assert (size (db->query ("s = " + query::_ref (a))) == 1); #endif @@ -104,12 +107,12 @@ main (int argc, char* argv[]) { const char* p = "cde"; -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::s == p)) == 1); assert (size (db->query (query::s == query::_val (p))) == 1); #endif assert (size (db->query (query::s == query::_ref (p))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("s = " + query::_val (p))) == 1); assert (size (db->query ("s = " + query::_ref (p))) == 1); #endif @@ -118,18 +121,18 @@ main (int argc, char* argv[]) { char a[] = "cde"; char* p = a; -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::s == p)) == 1); assert (size (db->query (query::s == query::_val (p))) == 1); #endif assert (size (db->query (query::s == query::_ref (p))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("s = " + query::_val (p))) == 1); assert (size (db->query ("s = " + query::_ref (p))) == 1); #endif } -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE string s ("abc"); //assert (size (db->query (query::s == s)) == 1); assert (size (db->query (query::s == s.c_str ())) == 1); @@ -140,24 +143,42 @@ main (int argc, char* argv[]) assert (size (db->query ("s = " + query::_ref (s))) == 1); #endif + // @@ BUILD2 Ends up with the following warning, but strangely only in the + // multi-database mode: + // + // In file included from odb/odb-tests/common/query/array/test-odb.hxx:31, + // from odb/odb-tests/common/query/array/driver.cxx:20: + // odb/libodb/odb/query-dynamic.hxx: In instantiation of ‘odb::query_base odb::query_column::operator==(const odb::query_column&) const [with T2 = char [17]; T = char [17]]’: + // odb/odb-tests/common/query/array/driver.cxx:144:7: required from here + // odb/libodb/odb/query-dynamic.hxx:895:43: error: comparison between two arrays is deprecated in C++20 [-Werror=array-compare] + // 895 | (void) (sizeof (type_instance () == type_instance ())); + // | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ + // odb/libodb/odb/query-dynamic.hxx:895:43: note: use unary ‘+’ which decays operands to pointers or ‘&‘indirect_ref’ not supported by dump_decl[0] == &‘indirect_ref’ not supported by dump_decl[0]’ to compare the addresses + // + // Looks like compile-time assertion. Doesn't make much sense for + // arrays since compares pointers to objects rather than objects. + // Should we somehow suppress the assertion for arrays or similar? + // + // Note: temporarily ifndef-ed. + // +#ifndef MULTI_DATABASE assert (size (db->query (query::s == query::s1)) == 3); +#endif // std::array // -#ifdef ODB_CXX11 array a; memcpy (a.data (), "abc", 4); // VC++ strcpy deprecation. -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::a == a)) == 1); assert (size (db->query (query::a == query::_val (a))) == 1); #endif assert (size (db->query (query::a == query::_ref (a))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("a = " + query::_val (a))) == 1); assert (size (db->query ("a = " + query::_ref (a))) == 1); #endif -#endif // char // @@ -167,7 +188,7 @@ main (int argc, char* argv[]) assert (size (db->query (query::c == query::_val (c))) == 1); assert (size (db->query (query::c == query::_ref (c))) == 1); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("c = " + query::_val ('c'))) == 1); assert (size (db->query ("c = " + query::_ref (c))) == 1); #endif @@ -176,14 +197,14 @@ main (int argc, char* argv[]) // buffer // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query (query::b == buf)) == 3); assert (size (db->query (query::b == query::_val (buf))) == 3); #endif assert (size (db->query (query::b == query::_ref (buf))) == 3); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE assert (size (db->query ("b = " + query::_val (buf))) == 3); assert (size (db->query ("b = " + query::_ref (buf))) == 3); #endif diff --git a/common/query/array/makefile b/common/query/array/makefile deleted file mode 100644 index e873a34..0000000 --- a/common/query/array/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/query/array/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --sql-name-case oracle:upper --table-prefix t_query_array_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx index d280f02..f0d5f3b 100644 --- a/common/query/array/test.hxx +++ b/common/query/array/test.hxx @@ -4,14 +4,9 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - +#include #include // std::memcpy, std::strlen -#ifdef HAVE_CXX11 -# include -#endif - #include #pragma db object @@ -23,10 +18,7 @@ struct object { std::memcpy (s_, s, std::strlen (s) + 1); // VC++ strncpy deprecation. std::memcpy (s1_, s, std::strlen (s) + 1); - -#ifdef HAVE_CXX11 std::memcpy (a_.data (), s, std::strlen (s) + 1); -#endif c_ = c1_ = *s; std::memcpy (b_, b, sizeof (b_)); } @@ -37,7 +29,6 @@ struct object char s_[17]; char s1_[17]; -#ifdef HAVE_CXX11 #ifdef ODB_COMPILER # if defined(ODB_DATABASE_MYSQL) || \ defined(ODB_DATABASE_PGSQL) || \ @@ -53,7 +44,6 @@ struct object # endif #endif std::array a_; -#endif char c_; char c1_; diff --git a/common/query/array/test.std b/common/query/array/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/query/array/testscript b/common/query/array/testscript new file mode 100644 index 0000000..631ae24 --- /dev/null +++ b/common/query/array/testscript @@ -0,0 +1,33 @@ +# file : common/query/array/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/query/basics/buildfile b/common/query/basics/buildfile new file mode 100644 index 0000000..e38e6fe --- /dev/null +++ b/common/query/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/query/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_basics_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx index 86bae4b..73b81d2 100644 --- a/common/query/basics/driver.cxx +++ b/common/query/basics/driver.cxx @@ -4,19 +4,21 @@ // Test basic query support. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include // DATABASE_XXX -#include +#include // DATABASE_XXX +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ print (result& r) { for (result::iterator i (r.begin ()); i != r.end (); ++i) { - auto_ptr o (i.load ()); + unique_ptr o (i.load ()); cout << *o << endl; } cout << endl; @@ -46,7 +48,7 @@ main (int argc, char* argv[]) try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); odb::database_id db_id (db->id ()); typedef odb::query query; @@ -76,7 +78,7 @@ main (int argc, char* argv[]) // Compilation tests. // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE if (false) { string name; @@ -164,7 +166,7 @@ main (int argc, char* argv[]) const char* name = "Doe"; -#if defined(DATABASE_COMMON) +#if defined(MULTI_DATABASE) result r ( db->query ( query::age >= query::_val (30) && @@ -195,7 +197,7 @@ main (int argc, char* argv[]) string name; unsigned short age; -#if defined(DATABASE_COMMON) +#if defined(MULTI_DATABASE) query q (query::age >= query::_ref (age) && query::last_name == query::_ref (name)); #elif defined(DATABASE_ORACLE) @@ -249,7 +251,7 @@ main (int argc, char* argv[]) //db->query (query::age == query::_ref (name)); db->query (query::last_name == "Doe"); db->query (query::last_name == name); -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE db->query (query::last_name == query::_val ("Doe")); #endif db->query (query::last_name == query::_val (name)); @@ -450,7 +452,7 @@ main (int argc, char* argv[]) assert (i != r.end ()); { - auto_ptr joe (db->load (3)); + unique_ptr joe (db->load (3)); } { @@ -467,7 +469,7 @@ main (int argc, char* argv[]) // Overwrite object image again. // - auto_ptr joe (db->load (3)); + unique_ptr joe (db->load (3)); person p; i.load (p); assert (p.last_name_ == "Doe"); @@ -499,7 +501,7 @@ main (int argc, char* argv[]) // Oracle does not support LOB comparisons. // -#ifndef DATABASE_ORACLE +#if defined(MULTI_DATABASE) || !defined(DATABASE_ORACLE) if (db_id != odb::id_oracle) { r = db->query (query::public_key == key2); diff --git a/common/query/basics/makefile b/common/query/basics/makefile deleted file mode 100644 index b1749e7..0000000 --- a/common/query/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/query/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix t_query_basics_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx index 22a8d32..239f6d6 100644 --- a/common/query/basics/test.hxx +++ b/common/query/basics/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include @@ -56,11 +54,7 @@ struct person std::string first_name_; #pragma db column ("middle") null -#ifdef HAVE_CXX11 std::unique_ptr middle_name_; -#else - std::auto_ptr middle_name_; -#endif #pragma db column ("last") std::string last_name_; diff --git a/common/query/basics/test.std b/common/query/basics/test.std deleted file mode 100644 index d420dc4..0000000 --- a/common/query/basics/test.std +++ /dev/null @@ -1,112 +0,0 @@ -test 001 -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single -test 002 -Jane Doe 29 married -John Doe 30 married -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 003 -John Doe 30 married - -test 004 -John Doe 30 married - -test 005 -John Doe 30 married - -Joe Squeaky Dirt 31 single - -test 006 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 007 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 008 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single - -John Doe 30 married -Jane Doe 29 married - -test 009 -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -John Doe 30 married -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -test 010 -Jane Doe 29 married - -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single - -Jane Doe 29 married - -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -Jane Doe 29 married -John Doe 30 married - -test 011 -John Doe 30 married -Jane Doe 29 married - -John Doe 30 married -Jane Doe 29 married -Joe Squeaky Dirt 31 single - -test 012 -Johansen J Johansen 32 single - -test 013 -Joe Squeaky Dirt 31 single - -test 014 -test 015 -John Doe 30 married -Jane Doe 29 married - -test 016 -test 017 -test 018 -test 019 -test 020 -John Doe 30 married -Joe Squeaky Dirt 31 single -Johansen J Johansen 32 single - -Jane Doe 29 married - - -Jane Doe 29 married - diff --git a/common/query/basics/testscript b/common/query/basics/testscript new file mode 100644 index 0000000..9086b66 --- /dev/null +++ b/common/query/basics/testscript @@ -0,0 +1,150 @@ +# file : common/query/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + test 001 + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + test 002 + Jane Doe 29 married + John Doe 30 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 003 + John Doe 30 married + + test 004 + John Doe 30 married + + test 005 + John Doe 30 married + + Joe Squeaky Dirt 31 single + + test 006 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 007 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 008 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + + John Doe 30 married + Jane Doe 29 married + + test 009 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 010 + Jane Doe 29 married + + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + Jane Doe 29 married + John Doe 30 married + + test 011 + John Doe 30 married + Jane Doe 29 married + + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + + test 012 + Johansen J Johansen 32 single + + test 013 + Joe Squeaky Dirt 31 single + + test 014 + test 015 + John Doe 30 married + Jane Doe 29 married + + test 016 + test 017 + test 018 + test 019 + test 020 + John Doe 30 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + Jane Doe 29 married + + + Jane Doe 29 married + + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/query/one/buildfile b/common/query/one/buildfile new file mode 100644 index 0000000..76a36b0 --- /dev/null +++ b/common/query/one/buildfile @@ -0,0 +1,42 @@ +# file : common/query/one/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_one_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx index f3ab921..4c3dcdc 100644 --- a/common/query/one/driver.cxx +++ b/common/query/one/driver.cxx @@ -8,18 +8,20 @@ // specific to query_one() and query_value(). // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -28,7 +30,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); odb::database_id db_id (db->id ()); transaction t (db->begin ()); @@ -36,7 +38,7 @@ main (int argc, char* argv[]) // query_one() // { - auto_ptr o (db->query_one ()); + unique_ptr o (db->query_one ()); assert (o.get () == 0); } @@ -57,7 +59,7 @@ main (int argc, char* argv[]) db->persist (o); { - auto_ptr o (db->query_one ()); + unique_ptr o (db->query_one ()); assert (o.get () != 0 && o->str_ == "value 1"); } @@ -77,12 +79,12 @@ main (int argc, char* argv[]) const char* q0_c (db_id == odb::id_oracle ? "\"id\" = 2" : "id = 2"); { - auto_ptr o (db->query_one (q1_c)); + unique_ptr o (db->query_one (q1_c)); assert (o.get () != 0 && o->str_ == "value 1"); } { - auto_ptr o (db->query_one (q0_c)); + unique_ptr o (db->query_one (q0_c)); assert (o.get () == 0); } @@ -108,12 +110,12 @@ main (int argc, char* argv[]) string q0_s (q0_c); { - auto_ptr o (db->query_one (q1_s)); + unique_ptr o (db->query_one (q1_s)); assert (o.get () != 0 && o->str_ == "value 1"); } { - auto_ptr o (db->query_one (q0_s)); + unique_ptr o (db->query_one (q0_s)); assert (o.get () == 0); } @@ -141,12 +143,12 @@ main (int argc, char* argv[]) query q0 (query::id == 2); { - auto_ptr o (db->query_one (q1)); + unique_ptr o (db->query_one (q1)); assert (o.get () != 0 && o->str_ == "value 1"); } { - auto_ptr o (db->query_one (q0)); + unique_ptr o (db->query_one (q0)); assert (o.get () == 0); } @@ -175,7 +177,7 @@ main (int argc, char* argv[]) /* { - auto_ptr o (db->query_one ()); + unique_ptr o (db->query_one ()); assert (false); } */ diff --git a/common/query/one/makefile b/common/query/one/makefile deleted file mode 100644 index fa3b557..0000000 --- a/common/query/one/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/query/one/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix t_query_one_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/query/one/test.std b/common/query/one/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/query/one/testscript b/common/query/one/testscript new file mode 100644 index 0000000..963a206 --- /dev/null +++ b/common/query/one/testscript @@ -0,0 +1,33 @@ +# file : common/query/one/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/readonly/buildfile b/common/readonly/buildfile new file mode 100644 index 0000000..2d83cf1 --- /dev/null +++ b/common/readonly/buildfile @@ -0,0 +1,40 @@ +# file : common/readonly/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix readonly_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index 3358799..b207627 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -6,19 +6,21 @@ // member test. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include // DATABASE_* -#include +#include // DATABASE_* +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Simple. // @@ -63,7 +65,7 @@ main (int argc, char* argv[]) // { pointer p (1, new pointer (2)); - auto_ptr p1 (new pointer (3)); + unique_ptr p1 (new pointer (3)); { transaction t (db->begin ()); @@ -86,7 +88,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (1)); + unique_ptr p (db->load (1)); t.commit (); assert (p->ro->id == 2 && p->co->id == 2 && p->rw->id == 3); @@ -204,7 +206,7 @@ main (int argc, char* argv[]) // Readonly object. // { -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE typedef odb::object_traits_impl so_traits; typedef odb::object_traits_impl ro_traits; typedef odb::object_traits_impl rw_traits; @@ -305,8 +307,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p1->num == o1.num); diff --git a/common/readonly/makefile b/common/readonly/makefile deleted file mode 100644 index 49c6779..0000000 --- a/common/readonly/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/readonly/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix readonly_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx index ad7727b..45797b6 100644 --- a/common/readonly/test.hxx +++ b/common/readonly/test.hxx @@ -4,10 +4,8 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include -#include // std::auto_ptr +#include // std::unique_ptr #include @@ -204,17 +202,10 @@ struct wrapper #pragma db id unsigned long id; -#ifdef HAVE_CXX11 std::unique_ptr pl; const std::unique_ptr cpl; std::unique_ptr pcl; const std::unique_ptr cpcl; -#else - std::auto_ptr pl; - const std::auto_ptr cpl; - std::auto_ptr pcl; - const std::auto_ptr cpcl; -#endif }; // Readonly object with auto id. diff --git a/common/readonly/test.std b/common/readonly/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/readonly/testscript b/common/readonly/testscript new file mode 100644 index 0000000..c798201 --- /dev/null +++ b/common/readonly/testscript @@ -0,0 +1,33 @@ +# file : common/readonly/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/relationship/basics/buildfile b/common/relationship/basics/buildfile new file mode 100644 index 0000000..d7bbb7e --- /dev/null +++ b/common/relationship/basics/buildfile @@ -0,0 +1,41 @@ +# file : common/relationship/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_basics_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx index 6eec1e2..e27c127 100644 --- a/common/relationship/basics/driver.cxx +++ b/common/relationship/basics/driver.cxx @@ -4,18 +4,20 @@ // Test object relationships. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,19 +26,16 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); aggr a ("aggr"); a.o1 = new obj1 ("o1", "obj1"); a.o2.reset (new obj2 ("obj2")); -#ifdef HAVE_CXX11 a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); a.v2.push_back (0); a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); -#endif -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (new obj3 ("obj3")); a.c.num = 123; @@ -45,7 +44,6 @@ main (int argc, char* argv[]) a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); a.cv.push_back (comp (235, obj3_ptr ())); a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); -#endif a.v1.push_back (new obj1 ("v1 0", "v1 0")); a.v1.push_back (0); @@ -67,13 +65,10 @@ main (int argc, char* argv[]) db->persist (a.o1); db->persist (a.o2); -#ifdef HAVE_CXX11 for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) if (*i) db->persist (*i); -#endif -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) db->persist (a.o3); db->persist (a.c.o3); @@ -81,7 +76,6 @@ main (int argc, char* argv[]) for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) if (i->o3) db->persist (i->o3); -#endif for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) if (*i) @@ -103,7 +97,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr a1 (db->load (a.id)); + unique_ptr a1 (db->load (a.id)); t.commit (); assert (*a1 == a); @@ -130,9 +124,7 @@ main (int argc, char* argv[]) delete a.o1; a.o1 = 0; a.o2.reset (); -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (); -#endif { transaction t (db->begin ()); @@ -144,7 +136,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr a1 (db->load (a.id)); + unique_ptr a1 (db->load (a.id)); t.commit (); assert (*a1 == a); diff --git a/common/relationship/basics/makefile b/common/relationship/basics/makefile deleted file mode 100644 index 775d850..0000000 --- a/common/relationship/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/relationship/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_rel_basics_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx index 9496581..8a2742e 100644 --- a/common/relationship/basics/test.hxx +++ b/common/relationship/basics/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include #include #include @@ -14,10 +12,6 @@ #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - // Raw pointer. // #pragma db object pointer(obj1*) @@ -121,11 +115,7 @@ operator== (const obj1_map& x, const obj1_map& y) // struct obj2; -#ifdef HAVE_CXX11 typedef std::unique_ptr obj2_ptr; -#else -typedef std::auto_ptr obj2_ptr; -#endif #pragma db object pointer(obj2_ptr) struct obj2 @@ -145,7 +135,6 @@ operator== (const obj2& x, const obj2& y) return x.id == y.id && x.str == y.str; } -#ifdef HAVE_CXX11 typedef std::vector obj2_vec; inline bool @@ -160,18 +149,12 @@ operator== (const obj2_vec& x, const obj2_vec& y) return true; } -#endif // shared_ptr // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) struct obj3; -#ifdef HAVE_CXX11 typedef std::shared_ptr obj3_ptr; -#else -typedef std::tr1::shared_ptr obj3_ptr; -#endif #pragma db object pointer(obj3_ptr) struct obj3 @@ -211,7 +194,6 @@ operator== (const comp& x, const comp& y) } typedef std::vector comp_vec; -#endif // // @@ -241,19 +223,11 @@ struct aggr obj1* o1; obj2_ptr o2; // std::auto_ptr or std::unique_ptr -#ifdef HAVE_CXX11 obj2_vec v2; -#else - // Dummy containers to get the equivalent DROP TABLE statements. - // - std::vector v2; -#endif -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) obj3_ptr o3; comp c; comp_vec cv; -#endif obj1_vec v1; obj1_set s1; @@ -273,14 +247,10 @@ operator== (const aggr& x, const aggr& y) x.id == y.id && (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && -#ifdef HAVE_CXX11 x.v2 == y.v2 && -#endif -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && x.c == y.c && x.cv == y.cv && -#endif x.v1 == y.v1 && x.s1 == y.s1 && x.m1 == y.m1 && diff --git a/common/relationship/basics/test.std b/common/relationship/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/relationship/basics/testscript b/common/relationship/basics/testscript new file mode 100644 index 0000000..b498bfa --- /dev/null +++ b/common/relationship/basics/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/relationship/on-delete/buildfile b/common/relationship/on-delete/buildfile new file mode 100644 index 0000000..965a2eb --- /dev/null +++ b/common/relationship/on-delete/buildfile @@ -0,0 +1,43 @@ +# file : common/relationship/on-delete/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_on_d_ \ + --generate-schema \ + --fkeys-deferrable-mode mysql:not_deferrable \ + --fkeys-deferrable-mode mssql:not_deferrable + + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx index b7cc37a..eec57cf 100644 --- a/common/relationship/on-delete/driver.cxx +++ b/common/relationship/on-delete/driver.cxx @@ -4,18 +4,20 @@ // Test ON DELETE functionality. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); object o; @@ -60,13 +62,13 @@ main (int argc, char* argv[]) transaction t (db->begin ()); assert (db->find (c.id) == 0); - auto_ptr pcc (db->load (cc.id)); + unique_ptr pcc (db->load (cc.id)); assert (pcc->p.empty ()); - auto_ptr pn (db->load (n.id)); + unique_ptr pn (db->load (n.id)); assert (pn->p == 0); - auto_ptr pnc (db->load (nc.id)); + unique_ptr pnc (db->load (nc.id)); assert (pnc->p.size () == 1 && pnc->p[0] == 0); t.commit (); diff --git a/common/relationship/on-delete/makefile b/common/relationship/on-delete/makefile deleted file mode 100644 index 88fcff0..0000000 --- a/common/relationship/on-delete/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : common/relationship/on-delete/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---fkeys-deferrable-mode mysql:not_deferrable \ ---fkeys-deferrable-mode mssql:not_deferrable \ ---table-prefix t_rel_on_d_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/on-delete/test.std b/common/relationship/on-delete/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/relationship/on-delete/testscript b/common/relationship/on-delete/testscript new file mode 100644 index 0000000..8288ebc --- /dev/null +++ b/common/relationship/on-delete/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/on-delete/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/relationship/query/buildfile b/common/relationship/query/buildfile new file mode 100644 index 0000000..b70edc4 --- /dev/null +++ b/common/relationship/query/buildfile @@ -0,0 +1,42 @@ +# file : common/relationship/query/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_query_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx index 1cee751..20d5370 100644 --- a/common/relationship/query/driver.cxx +++ b/common/relationship/query/driver.cxx @@ -4,20 +4,21 @@ // Test relationship queries. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include // HAVE_CXX11, HAVE_TR1_MEMORY -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -26,9 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) + unique_ptr db (create_database (argc, argv)); // // @@ -160,9 +159,6 @@ main (int argc, char* argv[]) t.commit (); } - -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY - } catch (const odb::exception& e) { diff --git a/common/relationship/query/makefile b/common/relationship/query/makefile deleted file mode 100644 index 1632f1b..0000000 --- a/common/relationship/query/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/relationship-query/query/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix t_rel_query_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx index b25e27e..c6e2d6d 100644 --- a/common/relationship/query/test.hxx +++ b/common/relationship/query/test.hxx @@ -4,21 +4,12 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - #include +#include #include -#ifdef HAVE_CXX11 -# include using std::shared_ptr; -#else -# include -using std::tr1::shared_ptr; -#endif struct country; @@ -146,5 +137,4 @@ struct country std::string name; }; -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY #endif // TEST_HXX diff --git a/common/relationship/query/test.std b/common/relationship/query/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/relationship/query/testscript b/common/relationship/query/testscript new file mode 100644 index 0000000..d5ad419 --- /dev/null +++ b/common/relationship/query/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/query/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/schema/embedded/basics/buildfile b/common/schema/embedded/basics/buildfile new file mode 100644 index 0000000..0cfe85e --- /dev/null +++ b/common/schema/embedded/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/schema/embedded/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_embd_bscs_ \ + --generate-schema \ + --schema-format embedded \ + --schema-name test + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx index 131c438..7ba2bce 100644 --- a/common/schema/embedded/basics/driver.cxx +++ b/common/schema/embedded/basics/driver.cxx @@ -4,19 +4,21 @@ // Test basic embedded schema functionality. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + unique_ptr db (create_database (argc, argv, false)); // Create the database schema. // diff --git a/common/schema/embedded/basics/makefile b/common/schema/embedded/basics/makefile deleted file mode 100644 index 8bbbd09..0000000 --- a/common/schema/embedded/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/schema/embedded/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---schema-format embedded --schema-name test --table-prefix schema_embd_bscs_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../../template/Makefile.am) - $(call meta-vc8projs,../../../template/template,$(name)) - $(call meta-vc9projs,../../../template/template,$(name)) - $(call meta-vc10projs,../../../template/template,$(name)) - $(call meta-vc11projs,../../../template/template,$(name)) - $(call meta-vc12projs,../../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/embedded/basics/test.std b/common/schema/embedded/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/schema/embedded/basics/testscript b/common/schema/embedded/basics/testscript new file mode 100644 index 0000000..24448c0 --- /dev/null +++ b/common/schema/embedded/basics/testscript @@ -0,0 +1,31 @@ +# file : common/schema/embedded/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../../pgsql.testscript + + $* +} diff --git a/common/schema/embedded/order/.gitignore b/common/schema/embedded/order/.gitignore new file mode 100644 index 0000000..5d39d39 --- /dev/null +++ b/common/schema/embedded/order/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx diff --git a/common/schema/embedded/order/buildfile b/common/schema/embedded/order/buildfile new file mode 100644 index 0000000..57ad7dd --- /dev/null +++ b/common/schema/embedded/order/buildfile @@ -0,0 +1,48 @@ +# file : common/schema/embedded/order/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_embd_ordr_ \ + --generate-schema \ + --schema-format embedded + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx index b035b69..fde5e96 100644 --- a/common/schema/embedded/order/driver.cxx +++ b/common/schema/embedded/order/driver.cxx @@ -4,15 +4,14 @@ // Test statement execution order in embedded schemas. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test1.hxx" #include "test2.hxx" @@ -20,6 +19,9 @@ #include "test1-odb.hxx" #include "test2-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -28,7 +30,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + unique_ptr db (create_database (argc, argv, false)); odb::database_id db_id (db->id ()); // Create the database schema. diff --git a/common/schema/embedded/order/makefile b/common/schema/embedded/order/makefile deleted file mode 100644 index bcdf185..0000000 --- a/common/schema/embedded/order/makefile +++ /dev/null @@ -1,122 +0,0 @@ -# file : common/schema/embedded/order/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test2.hxx test1.hxx # Reverse order. -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---schema-format embedded --table-prefix schema_embd_ordr_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -# Extra dependecy for the ODB-generated code. -# -$(gen): $(addprefix $(src_base)/,$(odb_hdr)) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../../template/Makefile.am) - $(call meta-vc8projs,../../../template/template,$(name)) - $(call meta-vc9projs,../../../template/template,$(name)) - $(call meta-vc10projs,../../../template/template,$(name)) - $(call meta-vc11projs,../../../template/template,$(name)) - $(call meta-vc12projs,../../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/embedded/order/test.std b/common/schema/embedded/order/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/schema/embedded/order/testscript b/common/schema/embedded/order/testscript new file mode 100644 index 0000000..6dfe58c --- /dev/null +++ b/common/schema/embedded/order/testscript @@ -0,0 +1,31 @@ +# file : common/schema/embedded/order/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../../pgsql.testscript + + $* +} diff --git a/common/schema/namespace/buildfile b/common/schema/namespace/buildfile new file mode 100644 index 0000000..fa496d7 --- /dev/null +++ b/common/schema/namespace/buildfile @@ -0,0 +1,41 @@ +# file : common/schema/namespace/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_ns_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx index b8739d8..25515f2 100644 --- a/common/schema/namespace/driver.cxx +++ b/common/schema/namespace/driver.cxx @@ -4,18 +4,20 @@ // Test database schemas (aka database namespaces). // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test database schema (aka database namespace). // @@ -47,7 +49,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p2 (db->load ("aaa")); + unique_ptr p2 (db->load ("aaa")); t.commit (); assert (o2 == *p2); diff --git a/common/schema/namespace/makefile b/common/schema/namespace/makefile deleted file mode 100644 index e6f4016..0000000 --- a/common/schema/namespace/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/schema/namespace/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix schema_ns_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/schema/namespace/test.std b/common/schema/namespace/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/schema/namespace/testscript b/common/schema/namespace/testscript new file mode 100644 index 0000000..0fabe6e --- /dev/null +++ b/common/schema/namespace/testscript @@ -0,0 +1,33 @@ +# file : common/schema/namespace/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/section/basics/buildfile b/common/section/basics/buildfile new file mode 100644 index 0000000..5ccdd6b --- /dev/null +++ b/common/section/basics/buildfile @@ -0,0 +1,41 @@ +# file : common/section/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_section_b_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index b333c59..53783a3 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -4,19 +4,21 @@ // Test object section basics. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test lazy-loaded, always updating section. // @@ -46,7 +48,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && @@ -76,7 +78,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -98,7 +100,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n != o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -121,7 +123,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); @@ -138,7 +140,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); db->reload (o); assert (p->n == o.n && @@ -154,7 +156,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); db->reload (o); assert (p->n == o.n && @@ -235,7 +237,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && @@ -265,7 +267,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); @@ -285,7 +287,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -309,7 +311,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n != o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -334,7 +336,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && @@ -364,7 +366,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); @@ -384,7 +386,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -406,7 +408,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n != o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); @@ -418,7 +420,7 @@ main (int argc, char* argv[]) try { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (*p, p->s); assert (false); } @@ -444,7 +446,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->s.loaded ()); assert (p->n == o.n && @@ -468,7 +470,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); t.commit (); @@ -487,7 +489,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); t.commit (); @@ -511,7 +513,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->s.loaded ()); assert (p->n == o.n && @@ -535,7 +537,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); t.commit (); @@ -554,7 +556,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); t.commit (); @@ -575,7 +577,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (p->n != o.n && p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); t.commit (); @@ -601,7 +603,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s1.loaded ()); assert (!p->s2.loaded ()); @@ -636,7 +638,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s1); db->load (*p, p->s2); assert (p->n == o.n && @@ -660,7 +662,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s1); db->load (*p, p->s2); assert (p->n != o.n && @@ -688,7 +690,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s1.loaded ()); assert (!p->s2.loaded ()); @@ -722,7 +724,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s1); db->load (*p, p->s2); assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && @@ -746,7 +748,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s1); db->load (*p, p->s2); assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && @@ -777,7 +779,7 @@ main (int argc, char* argv[]) session s; transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); + unique_ptr p1 (db->load (o1.id)); object* p (p1->p); assert (!p->s.loaded ()); @@ -809,7 +811,7 @@ main (int argc, char* argv[]) session s; transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); + unique_ptr p1 (db->load (o1.id)); object* p (p1->p); db->load (*p, p->s); @@ -837,7 +839,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (o.id == o.id && @@ -865,7 +867,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (o.id == o.id && p->sn != o.sn && p->ss != o.ss); @@ -882,7 +884,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (o.id == o.id && p->sn == o.sn && p->ss == o.ss); @@ -907,7 +909,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && p->sn != o.sn); @@ -934,7 +936,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn != o.sn); t.commit (); @@ -958,7 +960,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && @@ -988,7 +990,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); @@ -1045,7 +1047,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); t.commit (); @@ -1071,7 +1073,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s ().loaded ()); assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss); @@ -1099,7 +1101,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->rw_s ()); assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); t.commit (); @@ -1136,7 +1138,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && p->sn != o.sn && p->sb != o.sb); @@ -1163,7 +1165,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); t.commit (); @@ -1183,7 +1185,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->n != o.n && p->sn == o.sn && p->sb == o.sb); t.commit (); @@ -1207,7 +1209,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->n == o.n && @@ -1232,7 +1234,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (o1); assert (o.v != o1.v); @@ -1267,7 +1269,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (o1, o1.s); assert (o.v != o1.v); @@ -1275,7 +1277,7 @@ main (int argc, char* argv[]) // Double-check object version was updated. // { - auto_ptr p1 (db->load (o.id)); + unique_ptr p1 (db->load (o.id)); assert (o1.v == p1->v); } @@ -1343,7 +1345,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->sv != o.sv); @@ -1363,7 +1365,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (o1); assert (o.v != o1.v); @@ -1394,7 +1396,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (o1, o1.s); assert (o.v != o1.v); @@ -1402,7 +1404,7 @@ main (int argc, char* argv[]) // Double-check object version was updated. // { - auto_ptr p1 (db->load (o.id)); + unique_ptr p1 (db->load (o.id)); assert (o1.v == p1->v); } @@ -1467,7 +1469,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s1.loaded ()); assert (!p->s2.loaded ()); @@ -1493,7 +1495,7 @@ main (int argc, char* argv[]) o1.s2v[0]++; transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->update (o1); assert (o.v != o1.v); @@ -1532,7 +1534,7 @@ main (int argc, char* argv[]) for (unsigned short s (1); s < 3; ++s) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); switch (s) { @@ -1642,7 +1644,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); assert (!p->s.loaded ()); assert (p->sn != o.sn && p->sv != o.sv); @@ -1668,7 +1670,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->sn == o.sn && p->sv == o.sv); t.commit (); @@ -1687,7 +1689,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->sn == o.sn && p->sv == o.sv); t.commit (); @@ -1716,7 +1718,7 @@ main (int argc, char* argv[]) connection_ptr c (db->connection ()); transaction t (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); db->load (*p, p->s); assert (p->m[1].b == o.m[1].b); diff --git a/common/section/basics/makefile b/common/section/basics/makefile deleted file mode 100644 index 482672f..0000000 --- a/common/section/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/section/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_section_b_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/section/basics/test.std b/common/section/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/section/basics/testscript b/common/section/basics/testscript new file mode 100644 index 0000000..c0c6617 --- /dev/null +++ b/common/section/basics/testscript @@ -0,0 +1,33 @@ +# file : common/section/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/section/polymorphism/buildfile b/common/section/polymorphism/buildfile new file mode 100644 index 0000000..b9a7514 --- /dev/null +++ b/common/section/polymorphism/buildfile @@ -0,0 +1,41 @@ +# file : common/section/polymorphism/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_section_p_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx index 321b852..c15d317 100644 --- a/common/section/polymorphism/driver.cxx +++ b/common/section/polymorphism/driver.cxx @@ -4,19 +4,21 @@ // Test sections in polymorphic objects. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic polymorphic section functionality. // @@ -59,8 +61,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); assert (!pb->rs1.loaded ()); assert (!pb->rs2.loaded ()); @@ -177,8 +179,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pb, pb->rs1); db->load (*pb, pb->rs2); @@ -252,8 +254,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pb, pb->rs1); db->load (*pb, pb->rs2); @@ -312,8 +314,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pb, pb->rs1); db->load (*pb, pb->rs2); @@ -369,7 +371,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); assert (!pd->s.loaded ()); assert (pd->sn != d.sn && pd->sv != d.sv); @@ -396,7 +398,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); base* pb (pd.get ()); db->load (*pb, pb->s); // Via base. @@ -419,7 +421,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->load (*pd, pd->s); @@ -434,7 +436,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->load (*pd, pd->s); @@ -482,9 +484,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); assert (!pr->s1.loaded ()); assert (!pr->s2.loaded ()); @@ -595,9 +597,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pr, pr->s1); db->load (*pr, pr->s2); @@ -674,9 +676,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pr, pr->s1); db->load (*pr, pr->s2); @@ -733,9 +735,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pr (db->load (r.id)); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->load (*pr, pr->s1); db->load (*pr, pr->s2); @@ -808,8 +810,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); assert (!pb->rs1.loaded ()); assert (!pb->rs2.loaded ()); @@ -904,8 +906,8 @@ main (int argc, char* argv[]) d1.ds1v[0]++; transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); db->update (b1); db->update (d1); @@ -1023,8 +1025,8 @@ main (int argc, char* argv[]) for (unsigned short s (1); s < 7; ++s) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); switch (s) { @@ -1311,8 +1313,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); assert (!pb->s.loaded ()); assert (!pd->s.loaded ()); @@ -1338,7 +1340,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (d1); @@ -1370,7 +1372,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (b1, b1.s); // No-op. db->update (d1, d1.s); @@ -1439,7 +1441,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); assert (pd->s.loaded ()); assert (pd->sn == d.sn); @@ -1526,8 +1528,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pb (db->load (b.id)); - auto_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); assert (!pb->s.loaded ()); assert (!pd->s.loaded ()); @@ -1553,7 +1555,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (d1); @@ -1585,7 +1587,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (b1, b1.s); // No-op. db->update (d1, d1.s); @@ -1653,7 +1655,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); assert (!pd->s.loaded ()); assert (pd->sn != d.sn); @@ -1674,7 +1676,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (d1); @@ -1706,7 +1708,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr pd (db->load (d.id)); + unique_ptr pd (db->load (d.id)); db->update (d1, d1.s); assert (d.v != d1.v); @@ -1754,7 +1756,6 @@ main (int argc, char* argv[]) } } -#ifdef HAVE_CXX11 // Test reuse/polymorphic inheritance and optimistic mix. // { @@ -1797,7 +1798,6 @@ main (int argc, char* argv[]) t.commit (); } } -#endif } catch (const odb::exception& e) { diff --git a/common/section/polymorphism/makefile b/common/section/polymorphism/makefile deleted file mode 100644 index 5b7db2d..0000000 --- a/common/section/polymorphism/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/section/polymorphism/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_section_p_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx index 7db7118..6d524bd 100644 --- a/common/section/polymorphism/test.hxx +++ b/common/section/polymorphism/test.hxx @@ -4,8 +4,6 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11 - #include #include #include @@ -501,7 +499,6 @@ namespace test8 // objects derive polymorphically from the same base (and thus shared the id // bindind). // -#ifdef HAVE_CXX11 #pragma db namespace table("t9_") namespace test9 { @@ -541,6 +538,5 @@ namespace test9 elements e2; }; } -#endif #endif // TEST_HXX diff --git a/common/section/polymorphism/test.std b/common/section/polymorphism/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/section/polymorphism/testscript b/common/section/polymorphism/testscript new file mode 100644 index 0000000..f2cd536 --- /dev/null +++ b/common/section/polymorphism/testscript @@ -0,0 +1,33 @@ +# file : common/section/polymorphism/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/session/cache/buildfile b/common/session/cache/buildfile new file mode 100644 index 0000000..6d5b0bc --- /dev/null +++ b/common/session/cache/buildfile @@ -0,0 +1,41 @@ +# file : common/session/cache/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix session_cache_ \ + --generate-schema \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx index 6858d06..4b4ea12 100644 --- a/common/session/cache/driver.cxx +++ b/common/session/cache/driver.cxx @@ -4,19 +4,21 @@ // Test session object cache. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,11 +27,10 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test the session_required exception. // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) { using namespace test1; @@ -73,7 +74,6 @@ main (int argc, char* argv[]) t.commit (); } } -#endif } catch (const odb::exception& e) { diff --git a/common/session/cache/makefile b/common/session/cache/makefile deleted file mode 100644 index 8e475a2..0000000 --- a/common/session/cache/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/session/cache/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-session \ ---table-prefix session_cache_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx index 3ee2fbf..d2b1b2b 100644 --- a/common/session/cache/test.hxx +++ b/common/session/cache/test.hxx @@ -4,31 +4,18 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include #include #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - // Test the session_required exception. // -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) - #pragma db namespace table("t1_") namespace test1 { -#ifdef HAVE_CXX11 using std::shared_ptr; using std::weak_ptr; -#else - using std::tr1::shared_ptr; - using std::tr1::weak_ptr; -#endif #pragma db namespace(test1) pointer(shared_ptr) @@ -60,6 +47,4 @@ namespace test1 }; } -#endif // HAVE_CXX11 || HAVE_TR1_MEMORY - #endif // TEST_HXX diff --git a/common/session/cache/test.std b/common/session/cache/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/session/cache/testscript b/common/session/cache/testscript new file mode 100644 index 0000000..6d013eb --- /dev/null +++ b/common/session/cache/testscript @@ -0,0 +1,33 @@ +# file : common/session/cache/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/session/custom/buildfile b/common/session/custom/buildfile new file mode 100644 index 0000000..1b64de1 --- /dev/null +++ b/common/session/custom/buildfile @@ -0,0 +1,43 @@ +# file : common/session/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx txx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix session_custom_ \ + --generate-schema \ + --generate-session \ + --session-type ::session \ + --hxx-prologue '#include "session.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx index 851443e..3056fd6 100644 --- a/common/session/custom/driver.cxx +++ b/common/session/custom/driver.cxx @@ -6,7 +6,6 @@ #include #include // std::size_t -#include #include #include @@ -15,13 +14,16 @@ #include #include // ODB_CXX11_* -#include +#include #include "session.hxx" #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using odb::database; @@ -43,7 +45,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Simple Tech Ltd. // diff --git a/common/session/custom/makefile b/common/session/custom/makefile deleted file mode 100644 index c1fa5bc..0000000 --- a/common/session/custom/makefile +++ /dev/null @@ -1,115 +0,0 @@ -# file : common/session/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx session.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-session \ ---session-type ::session --hxx-prologue '\#include "session.hxx"' \ ---table-prefix session_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := session.hxx session.txx -$(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -$(call vc11projs,$(name)) $(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index 29ac040..2d2f597 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -106,6 +106,15 @@ public: cache_position (): map_ (0) {} cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + cache_position (const cache_position& p) + : map_ (p.map_) + { + // It might not be ok to use an uninitialized iterator. + // + if (p.map_ != 0) + pos_ = p.pos_; + } + cache_position& operator= (const cache_position& p) { diff --git a/common/session/custom/test.std b/common/session/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/session/custom/testscript b/common/session/custom/testscript new file mode 100644 index 0000000..39c281d --- /dev/null +++ b/common/session/custom/testscript @@ -0,0 +1,33 @@ +# file : common/session/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/statement/processing/buildfile b/common/statement/processing/buildfile new file mode 100644 index 0000000..97124e8 --- /dev/null +++ b/common/statement/processing/buildfile @@ -0,0 +1,8 @@ +# file : common/statement/processing/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx index 778498b..2d00107 100644 --- a/common/statement/processing/driver.cxx +++ b/common/statement/processing/driver.cxx @@ -5,11 +5,13 @@ // #include -#include #include #include +#undef NDEBUG +#include + using namespace std; static bool diff --git a/common/statement/processing/makefile b/common/statement/processing/makefile deleted file mode 100644 index 982dbe5..0000000 --- a/common/statement/processing/makefile +++ /dev/null @@ -1,87 +0,0 @@ -# file : common/statement/processing/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/statement/processing/test.std b/common/statement/processing/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/statement/processing/testscript b/common/statement/processing/testscript new file mode 100644 index 0000000..2460dc6 --- /dev/null +++ b/common/statement/processing/testscript @@ -0,0 +1,6 @@ +# file : common/statement/processing/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/common/template/Makefile.am b/common/template/Makefile.am deleted file mode 100644 index f35394b..0000000 --- a/common/template/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# file : common/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, -# ODB compilation. -# -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -nodist_driver_SOURCES = -BUILT_SOURCES = -CLEANFILES = - -__foreach_w__(__f,__path__(odb_header_stem), -driver_SOURCES += __f.hxx -nodist_driver_SOURCES += __f-odb.cxx -BUILT_SOURCES += __f-odb.hxx -CLEANFILES += __f-odb.hxx __f-odb.ixx __f-odb.cxx - -__f-odb.hxx: __f.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< - -)) diff --git a/common/template/driver.cxx b/common/template/driver.cxx deleted file mode 100644 index 83f9336..0000000 --- a/common/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : common/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/template/makefile b/common/template/makefile deleted file mode 100644 index 2fba29d..0000000 --- a/common/template/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---table-prefix template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj deleted file mode 100644 index fb21140..0000000 --- a/common/template/template-vc10.vcxproj +++ /dev/null @@ -1,185 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - - __foreach_w__(__f,__path__(odb_header_stem), - __custom_build_entry__( -__f.hxx, -odb __f.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, -__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) -) - ) - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_entry__(__f-odb.hxx) -__header_entry__(__f-odb.ixx) -))__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_entry__(__f-odb.cxx) -))__source_entries__(extra_sources) - - - - - diff --git a/common/template/template-vc10.vcxproj.filters b/common/template/template-vc10.vcxproj.filters deleted file mode 100644 index 3460ffd..0000000 --- a/common/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_filter_entry__(__f.hxx) -__header_filter_entry__(__f-odb.hxx) -__header_filter_entry__(__f-odb.ixx) -))__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_filter_entry__(__f-odb.cxx) -))__source_filter_entries__(extra_sources) - - diff --git a/common/template/template-vc11.vcxproj b/common/template/template-vc11.vcxproj deleted file mode 100644 index d336611..0000000 --- a/common/template/template-vc11.vcxproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - - __foreach_w__(__f,__path__(odb_header_stem), - __custom_build_entry__( -__f.hxx, -odb __f.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) __f.hxx, -__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) -) - ) - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_entry__(__f-odb.hxx) -__header_entry__(__f-odb.ixx) -))__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_entry__(__f-odb.cxx) -))__source_entries__(extra_sources) - - - - - diff --git a/common/template/template-vc11.vcxproj.filters b/common/template/template-vc11.vcxproj.filters deleted file mode 100644 index 3460ffd..0000000 --- a/common/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_filter_entry__(__f.hxx) -__header_filter_entry__(__f-odb.hxx) -__header_filter_entry__(__f-odb.ixx) -))__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_filter_entry__(__f-odb.cxx) -))__source_filter_entries__(extra_sources) - - diff --git a/common/template/template-vc12.vcxproj b/common/template/template-vc12.vcxproj deleted file mode 100644 index b738145..0000000 --- a/common/template/template-vc12.vcxproj +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - - __foreach_w__(__f,__path__(odb_header_stem), - __custom_build_entry__( -__f.hxx, -odb __f.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) __f.hxx, -__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) -) - ) - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_entry__(__f-odb.hxx) -__header_entry__(__f-odb.ixx) -))__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_entry__(__f-odb.cxx) -))__source_entries__(extra_sources) - - - - - diff --git a/common/template/template-vc12.vcxproj.filters b/common/template/template-vc12.vcxproj.filters deleted file mode 100644 index 3460ffd..0000000 --- a/common/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__header_filter_entry__(__f.hxx) -__header_filter_entry__(__f-odb.hxx) -__header_filter_entry__(__f-odb.ixx) -))__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), -__source_filter_entry__(__f-odb.cxx) -))__source_filter_entries__(extra_sources) - - diff --git a/common/template/template-vc8.vcproj b/common/template/template-vc8.vcproj deleted file mode 100644 index 33ad5ae..0000000 --- a/common/template/template-vc8.vcproj +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), - __source_entry__(__f-odb.cxx))) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), - __file_entry_custom_build__( -__f.hxx, -odb __f.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) __f.hxx, -__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) -__file_entry__(__f-odb.hxx) -__file_entry__(__f-odb.ixx))) -__file_entries__(extra_headers) - - - - - diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj deleted file mode 100644 index 976b870..0000000 --- a/common/template/template-vc9.vcproj +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), - __source_entry__(__f-odb.cxx))) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, - __foreach_w__(__f,__path__(odb_header_stem), - __file_entry_custom_build__( -__f.hxx, -odb __f.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, -__f-odb.hxx;__f-odb.ixx;__f-odb.cxx) -__file_entry__(__f-odb.hxx) -__file_entry__(__f-odb.ixx))) -__file_entries__(extra_headers) - - - - - diff --git a/common/template/test.hxx b/common/template/test.hxx deleted file mode 100644 index 39ea826..0000000 --- a/common/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : common/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/common/template/test.std b/common/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/test.bat b/common/test.bat deleted file mode 100644 index 8ca4cb6..0000000 --- a/common/test.bat +++ /dev/null @@ -1,79 +0,0 @@ -@echo off -rem file : common/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs) __path__(thread_dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem %4 - database -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 %4 %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 %1 - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:usage -echo. -echo usage: test.bat database -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/common/threads/buildfile b/common/threads/buildfile new file mode 100644 index 0000000..53b98ec --- /dev/null +++ b/common/threads/buildfile @@ -0,0 +1,49 @@ +# file : common/threads/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix threads_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# While we don't call any pthread_*() functions, this appears to be needed for +# some std::thread implementations (like libstdc++). Note that +# odb::details::thread inlines some std::thread API calls. +# +if ($cxx.target.class != 'windows') + cxx.libs += -pthread + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx index 3a2d408..1add011 100644 --- a/common/threads/driver.cxx +++ b/common/threads/driver.cxx @@ -5,9 +5,8 @@ // #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::size_t -#include #include #include @@ -16,16 +15,19 @@ #include #include -#include // DATABASE_* -#include +#include // DATABASE_* +#include -#if defined(DATABASE_SQLITE) || defined(DATABASE_COMMON) +#if defined(DATABASE_SQLITE) # include #endif #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; namespace details = odb::details; @@ -61,6 +63,7 @@ struct task try { transaction t (db_.begin ()); + db_.persist (o1); db_.persist (o2); db_.persist (o3); @@ -74,7 +77,7 @@ struct task { try { -#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) +#if !defined(DATABASE_SQLITE) transaction t (db_.begin ()); #else // SQLite has a peculiar table locking mode (shared cache) @@ -93,7 +96,7 @@ struct task static_cast (db_).begin_immediate ()); } #endif - auto_ptr o (db_.load (id)); + unique_ptr o (db_.load (id)); assert (o->str_ == "first object"); o->str_ = "another value"; db_.update (*o); @@ -178,7 +181,7 @@ struct task bool test (int argc, char* argv[], size_t max_connections) { - auto_ptr db (create_database (argc, argv, true, max_connections)); + unique_ptr db (create_database (argc, argv, true, max_connections)); vector > threads; vector > tasks; diff --git a/common/threads/makefile b/common/threads/makefile deleted file mode 100644 index 59e6514..0000000 --- a/common/threads/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/threads/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix threads_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/threads/test.std b/common/threads/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/threads/testscript b/common/threads/testscript new file mode 100644 index 0000000..87e03e0 --- /dev/null +++ b/common/threads/testscript @@ -0,0 +1,50 @@ +# file : common/threads/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + # Note: this is quite slow: + # + # $ time ./driver --database ~/odb-test.db + # real 3m5.593s + # user 1m1.244s + # sys 0m26.793s + # + # $ time ./driver --database /tmp/odb-test.db + # real 0m13.909s + # user 0m16.724s + # sys 0m4.874s + # + # $ time ./driver --database "file::memory:" + # real 0m12.406s + # user 0m15.694s + # sys 0m4.207s + # + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/transaction/basics/buildfile b/common/transaction/basics/buildfile new file mode 100644 index 0000000..f412235 --- /dev/null +++ b/common/transaction/basics/buildfile @@ -0,0 +1,13 @@ +# file : common/transaction/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx index 721561d..1833555 100644 --- a/common/transaction/basics/driver.cxx +++ b/common/transaction/basics/driver.cxx @@ -5,7 +5,7 @@ // #include -#include +#include // std::unique_ptr #include #include @@ -14,8 +14,11 @@ #include #include -#include -#include +#include +#include + +#undef NDEBUG +#include using namespace std; using namespace odb::core; @@ -49,7 +52,7 @@ main (int argc, char* argv[]) { { transaction_tracer tracer; - auto_ptr db (create_database (argc, argv, false)); + unique_ptr db (create_database (argc, argv, false)); db->tracer (tracer); assert (!transaction::has_current ()); @@ -137,7 +140,7 @@ main (int argc, char* argv[]) // Test early connection release. // { - auto_ptr db (create_database (argc, argv, false, 1)); + unique_ptr db (create_database (argc, argv, false, 1)); transaction t1 (db->begin ()); t1.commit (); transaction t2 (db->begin ()); diff --git a/common/transaction/basics/makefile b/common/transaction/basics/makefile deleted file mode 100644 index a45080a..0000000 --- a/common/transaction/basics/makefile +++ /dev/null @@ -1,87 +0,0 @@ -# file : common/transaction/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/basics/test.std b/common/transaction/basics/test.std deleted file mode 100644 index 37d3598..0000000 --- a/common/transaction/basics/test.std +++ /dev/null @@ -1,26 +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 -test 007 -begin transaction -commit transaction -begin transaction -commit transaction diff --git a/common/transaction/basics/testscript b/common/transaction/basics/testscript new file mode 100644 index 0000000..94c58b6 --- /dev/null +++ b/common/transaction/basics/testscript @@ -0,0 +1,62 @@ +# file : common/transaction/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + 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 + test 007 + begin transaction + commit transaction + begin transaction + commit transaction + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/common/transaction/callback/buildfile b/common/transaction/callback/buildfile new file mode 100644 index 0000000..78b1b03 --- /dev/null +++ b/common/transaction/callback/buildfile @@ -0,0 +1,13 @@ +# file : common/transaction/callback/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx index 90564a4..d0af993 100644 --- a/common/transaction/callback/driver.cxx +++ b/common/transaction/callback/driver.cxx @@ -4,14 +4,17 @@ // Test transaction callbacks. // -#include // std::size_t -#include +#include // std::unique_ptr +#include // std::size_t #include #include #include -#include +#include + +#undef NDEBUG +#include using namespace std; using namespace odb::core; @@ -104,7 +107,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv, false)); + unique_ptr db (create_database (argc, argv, false)); // We want to test both stack and dynamic slots. // diff --git a/common/transaction/callback/makefile b/common/transaction/callback/makefile deleted file mode 100644 index 1d0be66..0000000 --- a/common/transaction/callback/makefile +++ /dev/null @@ -1,87 +0,0 @@ -# file : common/transaction/callback/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/transaction/callback/test.std b/common/transaction/callback/test.std deleted file mode 100644 index 4298c1e..0000000 --- a/common/transaction/callback/test.std +++ /dev/null @@ -1,36 +0,0 @@ -test 1/001 - callback 1 commit - callback 1 rollback - callback 1 rollback - unregister callback 1 - unregister callback 1 - callback 2 commit -test 1/002 - unregister callback 2 - callback 1 commit - callback 3 commit - unregister callback 2 - callback 1 commit - callback 4 commit - callback 3 commit -test 1/003 - callback 1 commit - callback 2 commit -test 2/001 - callback 1 commit - callback 1 rollback - callback 1 rollback - unregister callback 1 - unregister callback 1 - callback 2 commit -test 2/002 - unregister callback 2 - callback 1 commit - callback 3 commit - unregister callback 2 - callback 1 commit - callback 4 commit - callback 3 commit -test 2/003 - callback 1 commit - callback 2 commit diff --git a/common/transaction/callback/testscript b/common/transaction/callback/testscript new file mode 100644 index 0000000..7229ecd --- /dev/null +++ b/common/transaction/callback/testscript @@ -0,0 +1,72 @@ +# file : common/transaction/callback/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + test 1/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit + test 1/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit + test 1/003 + callback 1 commit + callback 2 commit + test 2/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit + test 2/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit + test 2/003 + callback 1 commit + callback 2 commit + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/common/types/buildfile b/common/types/buildfile new file mode 100644 index 0000000..95fe5b6 --- /dev/null +++ b/common/types/buildfile @@ -0,0 +1,39 @@ +# file : common/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix types_ + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/types/driver.cxx b/common/types/driver.cxx index 92cf9af..bdc66b8 100644 --- a/common/types/driver.cxx +++ b/common/types/driver.cxx @@ -5,14 +5,16 @@ // #include -#include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; diff --git a/common/types/makefile b/common/types/makefile deleted file mode 100644 index 732ba0a..0000000 --- a/common/types/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --table-prefix types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-schemaless-rule)) -else -$(foreach d,$(databases),$(eval $(call test-schemaless-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/types/test.std b/common/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/types/testscript b/common/types/testscript new file mode 100644 index 0000000..159972b --- /dev/null +++ b/common/types/testscript @@ -0,0 +1,6 @@ +# file : common/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basic +: +$* diff --git a/common/view/basics/buildfile b/common/view/basics/buildfile new file mode 100644 index 0000000..d9738a4 --- /dev/null +++ b/common/view/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/view/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_b_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx index d55e7c5..e2f611a 100644 --- a/common/view/basics/driver.cxx +++ b/common/view/basics/driver.cxx @@ -4,19 +4,21 @@ // Test view basics. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include -#include // DATABASE_XXX +#include +#include // DATABASE_XXX #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -41,7 +43,7 @@ view1_check (odb::result& r) template void -view2_test (const auto_ptr& db) +view2_test (const unique_ptr& db) { typedef odb::query query; typedef odb::result result; @@ -76,12 +78,12 @@ view2_test (const auto_ptr& db) } { - auto_ptr v (db->query_one ()); + unique_ptr v (db->query_one ()); assert (v->count == 4); } { - auto_ptr v; + unique_ptr v; if (db->id () != odb::id_oracle) v.reset (db->query_one ("age < 31")); else @@ -90,7 +92,7 @@ view2_test (const auto_ptr& db) } { - auto_ptr v (db->query_one (query::age < 31)); + unique_ptr v (db->query_one (query::age < 31)); assert (v->count == 2); } @@ -99,7 +101,7 @@ view2_test (const auto_ptr& db) template void -view4_test (const auto_ptr& db) +view4_test (const unique_ptr& db) { typedef odb::query query; typedef odb::result result; @@ -162,7 +164,7 @@ view4_test (const auto_ptr& db) template void -view6_test (const auto_ptr& db, const odb::query& q) +view6_test (const unique_ptr& db, const odb::query& q) { typedef odb::result result; typedef typename result::iterator iterator; @@ -193,7 +195,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // // @@ -309,7 +311,7 @@ main (int argc, char* argv[]) // No native parameter support in dynamic multi-database mode. // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE { typedef odb::query query; @@ -487,7 +489,7 @@ main (int argc, char* argv[]) // No native parameter support in dynamic multi-database mode. // -#ifndef DATABASE_COMMON +#ifndef MULTI_DATABASE view6_test ( #ifndef DATABASE_ORACLE db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); @@ -719,7 +721,12 @@ main (int argc, char* argv[]) t.commit (); } -#if !defined(DATABASE_SQLITE) && !defined(DATABASE_COMMON) + // @@ BUILD2 Also disable for DATABASE_MYSQL and DATABASE_PGSQL (see + // vright definition for details). + // +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_PGSQL) { typedef odb::query query; typedef odb::result result; @@ -736,9 +743,12 @@ main (int argc, char* argv[]) } #endif -#if !defined(DATABASE_MYSQL) && \ + // @@ BUILD2 Also disable for DATABASE_PGSQL (see vfull definition for + // details). + // +#if !defined(DATABASE_MYSQL) && \ !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_COMMON) + !defined(DATABASE_PGSQL) { typedef odb::query query; typedef odb::result result; diff --git a/common/view/basics/makefile b/common/view/basics/makefile deleted file mode 100644 index eafe550..0000000 --- a/common/view/basics/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/view/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-prepared --table-prefix t_view_b_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template,$(name)) - $(call meta-vc9projs,../../template/template,$(name)) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx index 66bf86c..130bcd4 100644 --- a/common/view/basics/test.hxx +++ b/common/view/basics/test.hxx @@ -543,7 +543,18 @@ namespace test2 odb::nullable id2; }; -#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) + // @@ BUILD2 Also disable for ODB_DATABASE_MYSQL and ODB_DATABASE_PGSQL, + // otherwise we end up with the following error: + // + // test-odb-mysql.hxx:3202:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ + // 3202 | public access::view_traits< ::test2::vright > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +//#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ + !defined(ODB_DATABASE_COMMON) #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) struct vright @@ -554,8 +565,21 @@ namespace test2 #endif + // @@ BUILD2 Also disable for ODB_DATABASE_PGSQL, otherwise we end up with the + // following error: + // + // test-odb-pgsql.hxx:3325:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ + // 3325 | public access::view_traits< ::test2::vfull > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +/* +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_COMMON) +*/ #if !defined(ODB_DATABASE_MYSQL) && \ !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ !defined(ODB_DATABASE_COMMON) #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) diff --git a/common/view/basics/test.std b/common/view/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/view/basics/testscript b/common/view/basics/testscript new file mode 100644 index 0000000..faa8408 --- /dev/null +++ b/common/view/basics/testscript @@ -0,0 +1,33 @@ +# file : common/view/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/view/olv/.gitignore b/common/view/olv/.gitignore new file mode 100644 index 0000000..2b95165 --- /dev/null +++ b/common/view/olv/.gitignore @@ -0,0 +1,46 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test1.sql +test1-*.sql + +test2-odb.?xx +test2-odb-*.?xx +test2.sql +test2-*.sql + +test3-odb.?xx +test3-odb-*.?xx +test3.sql +test3-*.sql + +test4-odb.?xx +test4-odb-*.?xx +test4.sql +test4-*.sql + +test5-odb.?xx +test5-odb-*.?xx +test5.sql +test5-*.sql + +test6-odb.?xx +test6-odb-*.?xx +test6.sql +test6-*.sql + +test7-odb.?xx +test7-odb-*.?xx +test7.sql +test7-*.sql + +test8-odb.?xx +test8-odb-*.?xx +test8.sql +test8-*.sql + +test9-odb.?xx +test9-odb-*.?xx +test9.sql +test9-*.sql diff --git a/common/view/olv/buildfile b/common/view/olv/buildfile new file mode 100644 index 0000000..89ecbcf --- /dev/null +++ b/common/view/olv/buildfile @@ -0,0 +1,50 @@ +# file : common/view/olv/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_olv_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc + +testscript@./: schemas = $hs diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx index c417cc3..c08015e 100644 --- a/common/view/olv/driver.cxx +++ b/common/view/olv/driver.cxx @@ -4,8 +4,7 @@ // Test object loading views. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -13,7 +12,7 @@ #include #include -#include +#include #include "test1.hxx" #include "test2.hxx" @@ -35,6 +34,9 @@ #include "test8-odb.hxx" #include "test9-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -43,7 +45,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic object loading functionality. // @@ -365,7 +367,15 @@ main (int argc, char* argv[]) transaction t (db->begin ()); session s; view2 v (db->query_value ()); - assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + + // @@ BUILD2 As of cl 19.29.30136 (VS 2019 16.11.5) v.o2.o1 points to + // the address of o1 member of the object being returned by + // query_value() which v is a copy of, and thus the + // original assertion fails. Note that changing `view2 v` to + // `const view2& v` doesn't help. + // + //assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + assert (v.o1.n == 123 && v.o2.s == "abc"); t.commit (); } @@ -588,20 +598,23 @@ main (int argc, char* argv[]) // { view1r r (db->query_value (query::n == 1)); - assert (r.n == 1 && r.o->n == 1 && typeid (*r.o) == typeid (root)); + auto& o (*r.o); + assert (r.n == 1 && r.o->n == 1 && typeid (o) == typeid (root)); } { view1r r (db->query_value (query::n == 2)); - assert (r.n == 2 && r.o->n == 2 && typeid (*r.o) == typeid (base)); + auto& o (*r.o); + assert (r.n == 2 && r.o->n == 2 && typeid (o) == typeid (base)); base& b (dynamic_cast (*r.o)); assert (b.s == "a"); } { view1r r (db->query_value (query::n == 3)); - assert (r.n == 3 && r.o->n == 3 && typeid (*r.o) == typeid (derived)); - derived& d (dynamic_cast (*r.o)); + auto& o (*r.o); + assert (r.n == 3 && r.o->n == 3 && typeid (o) == typeid (derived)); + derived& d (dynamic_cast (o)); assert (d.s == "b" && d.b); } @@ -614,9 +627,10 @@ main (int argc, char* argv[]) { view1b r (db->query_value (query::n == 3)); + auto& o (*r.o); assert (r.s == "b" && r.n == 3 && r.o->n == 3 && - typeid (*r.o) == typeid (derived)); - derived& d (dynamic_cast (*r.o)); + typeid (o) == typeid (derived)); + derived& d (dynamic_cast (o)); assert (d.s == "b" && d.b); } diff --git a/common/view/olv/makefile b/common/view/olv/makefile deleted file mode 100644 index c65d7e9..0000000 --- a/common/view/olv/makefile +++ /dev/null @@ -1,114 +0,0 @@ -# file : common/view/olv/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx test4.hxx test5.hxx test6.hxx \ -test7.hxx test8.hxx test9.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---table-prefix t_view_olv_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export odb_header_stem := $(basename $(odb_hdr)) -$(dist): export extra_dist := $(data_dist) $(call vc10projs,$(name)) \ -$(call vc11projs,$(name)) $(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc10projs,../../template/template,$(name)) - $(call meta-vc11projs,../../template/template,$(name)) - $(call meta-vc12projs,../../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule,,$(filter %.sql,$(gen)))) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d,$(filter %.sql,$(gen))))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/view/olv/test.std b/common/view/olv/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/view/olv/testscript b/common/view/olv/testscript new file mode 100644 index 0000000..160426d --- /dev/null +++ b/common/view/olv/testscript @@ -0,0 +1,39 @@ +# file : common/view/olv/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql-schema.testscript + + for s: $schemas + cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd + end; + + $* ($multi ? 'mysql' : ) $mysql_options +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql-schema.testscript + + for s: $schemas + $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql + end; + + $* ($multi ? 'pgsql' : ) $pgsql_options +} diff --git a/common/virtual/buildfile b/common/virtual/buildfile new file mode 100644 index 0000000..96d062e --- /dev/null +++ b/common/virtual/buildfile @@ -0,0 +1,42 @@ +# file : common/virtual/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix virtual_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx index 35e0923..f96f543 100644 --- a/common/virtual/driver.cxx +++ b/common/virtual/driver.cxx @@ -5,18 +5,20 @@ // #include // std::auto_ptr -#include #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test basic virtual data member functionality. // @@ -50,7 +52,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (o.id1.v)); + unique_ptr p (db->load (o.id1.v)); t.commit (); assert (o == *p); @@ -77,7 +79,7 @@ main (int argc, char* argv[]) { session s; transaction t (db->begin ()); - auto_ptr p (db->load (o1.id)); + unique_ptr p (db->load (o1.id)); t.commit (); assert (p->o2->id == o1.o2->id); @@ -137,7 +139,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p (db->load (id)); + unique_ptr p (db->load (id)); t.commit (); assert (o.first_ == p->first_ && o.last_ == p->last_); diff --git a/common/virtual/makefile b/common/virtual/makefile deleted file mode 100644 index e112d31..0000000 --- a/common/virtual/makefile +++ /dev/null @@ -1,117 +0,0 @@ -# file : common/virtual/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---generate-session --table-prefix virtual_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/virtual/test.std b/common/virtual/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/virtual/testscript b/common/virtual/testscript new file mode 100644 index 0000000..769c7f9 --- /dev/null +++ b/common/virtual/testscript @@ -0,0 +1,33 @@ +# file : common/virtual/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/common/wrapper/buildfile b/common/wrapper/buildfile new file mode 100644 index 0000000..57f43f2 --- /dev/null +++ b/common/wrapper/buildfile @@ -0,0 +1,40 @@ +# file : common/wrapper/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix wrapper_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx index 255e138..9c352fc 100644 --- a/common/wrapper/driver.cxx +++ b/common/wrapper/driver.cxx @@ -4,18 +4,20 @@ // Test wrapper machinery. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -24,7 +26,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); // Test 1: simple values. // @@ -40,10 +42,8 @@ main (int argc, char* argv[]) o1.nstrs.push_back (nullable_string ()); o1.nstrs.push_back (nullable_string ("123")); -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) o2.sstrs.push_back (str_sptr ()); o2.sstrs.push_back (str_sptr (new string ("123"))); -#endif transaction t (db->begin ()); id1 = db->persist (o1); @@ -53,8 +53,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); t.commit (); assert (*o1->num == 123); @@ -63,11 +63,9 @@ main (int argc, char* argv[]) assert (o1->nstrs[0].null ()); assert (o1->nstrs[1].get () == "123"); -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) assert (!o2->sstr); assert (!o2->sstrs[0]); assert (*o2->sstrs[1] == "123"); -#endif } } @@ -96,7 +94,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (id)); + unique_ptr o (db->load (id)); t.commit (); assert (*o->c1 == *co.c1); @@ -130,7 +128,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (id)); + unique_ptr o (db->load (id)); t.commit (); assert (*o->nums == *co.nums); @@ -164,8 +162,8 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p1->p.get () == 0); @@ -196,8 +194,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (o1.id)); - auto_ptr p2 (db->load (o2.id)); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); t.commit (); assert (p1->p.get () != 0 && *p1->p == *o1.p); diff --git a/common/wrapper/makefile b/common/wrapper/makefile deleted file mode 100644 index 4393d16..0000000 --- a/common/wrapper/makefile +++ /dev/null @@ -1,116 +0,0 @@ -# file : common/wrapper/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --table-prefix wrapper_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(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): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 27d020b..3ae4151 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -4,19 +4,13 @@ #ifndef TEST_HXX #define TEST_HXX -#include // HAVE_CXX11, HAVE_TR1_MEMORY - #include -#include // std::auto_ptr +#include // std::unique_ptr #include #include #include -#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY) -# include -#endif - using odb::nullable; // Test 1: simple values. @@ -26,17 +20,9 @@ namespace test1 { typedef nullable nullable_string; -#ifdef HAVE_CXX11 typedef std::unique_ptr num_uptr; typedef std::unique_ptr str_uptr; typedef std::shared_ptr str_sptr; -#else - typedef std::auto_ptr num_uptr; - typedef std::auto_ptr str_uptr; -# ifdef HAVE_TR1_MEMORY - typedef std::tr1::shared_ptr str_sptr; -# endif -#endif #pragma db object table("obj1") struct object1 @@ -59,13 +45,11 @@ namespace test1 #pragma db id auto unsigned long id_; -#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) #pragma db null str_sptr sstr; #pragma db value_null std::vector sstrs; -#endif }; } @@ -110,15 +94,9 @@ operator== (const comp2& x, const comp2& y) struct comp3; -#ifdef HAVE_CXX11 typedef std::unique_ptr comp1_uptr; typedef std::unique_ptr comp2_uptr; typedef std::unique_ptr comp3_uptr; -#else -typedef std::auto_ptr comp1_uptr; -typedef std::auto_ptr comp2_uptr; -typedef std::auto_ptr comp3_uptr; -#endif #pragma db object struct comp_object @@ -153,13 +131,8 @@ struct comp_object2 // Containers. // -#ifdef HAVE_CXX11 typedef std::unique_ptr> nums_uptr; typedef std::unique_ptr> strs_uptr; -#else -typedef std::auto_ptr > nums_uptr; -typedef std::auto_ptr > strs_uptr; -#endif #pragma db value struct cont_comp @@ -195,7 +168,7 @@ namespace test5 base () {} base (int n): num (n) {} - int num; + int num = 0; }; inline bool @@ -230,11 +203,7 @@ namespace test5 unsigned long id; #pragma db null -#ifdef HAVE_CXX11 std::unique_ptr p; -#else - std::auto_ptr p; -#endif odb::nullable n; diff --git a/common/wrapper/test.std b/common/wrapper/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/common/wrapper/testscript b/common/wrapper/testscript new file mode 100644 index 0000000..6630813 --- /dev/null +++ b/common/wrapper/testscript @@ -0,0 +1,33 @@ +# file : common/wrapper/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 0c307c5..0000000 --- a/configure.ac +++ /dev/null @@ -1,115 +0,0 @@ -# file : configure.ac -# license : GNU GPL v2; see accompanying LICENSE file - -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([common/template/driver.cxx]) - -AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) -m4_equote()[m4_ifdef]m4_dquote()([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. - -LT_INIT([win32-dll]) - -AC_CANONICAL_HOST - -# Check for diff. -# -DIFF_TOOL - -# Check for C++ compiler and use it to compile the tests. -# -AC_PROG_CXX -AC_LANG(C++) - -# Create the libtool executable so that we can use it in further tests. -# -LT_OUTPUT - -# Check for threads. -# -THREADS - -AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) - -# Check for C++11. -# -CXX11([HAVE_CXX11], [Compiling in the C++11 mode.]) - -# Check for the ODB compiler. -# -ODB_COMPILER([], [AC_MSG_ERROR([odb compiler is not found; consider setting ODB variable or using --with-odb=DIR])]) - -# Check for the ODB libs. -# -LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) - -# Check for TR1 availability (has to be after libodb). -# -TR1_MEMORY - -# Check for boost. -# -odb_tests_boost=yes -LIBBOOST([], [odb_tests_boost=no]) -LIBBOOST_SYSTEM -LIBBOOST_SMART_PTR([], [odb_tests_boost=no]) -LIBBOOST_UNORDERED([], [odb_tests_boost=no]) -LIBBOOST_DATE_TIME([], [odb_tests_boost=no]) - -# Check for libodb-boost. -# -LIBODB_BOOST([], [odb_tests_boost=no]) - -AM_CONDITIONAL([ODB_TESTS_BOOST], [test x$odb_tests_boost != xno]) - -# Check for Qt. -# -odb_tests_qt=yes -LIBQTCORE([], [odb_tests_qt=no]) - -# Check for libodb-qt. -# -LIBODB_QT([], [odb_tests_qt=no]) - -AM_CONDITIONAL([ODB_TESTS_QT], [test x$odb_tests_qt != xno]) - -# Check which database we are using. -# -DATABASE - -case $database in - mysql) - LIBODB_MYSQL([], [AC_MSG_ERROR([libodb-mysql is not found; consider using --with-libodb-mysql=DIR])]) - MYSQL - ;; - sqlite) - LIBODB_SQLITE([], [AC_MSG_ERROR([libodb-sqlite is not found; consider using --with-libodb-sqlite=DIR])]) - SQLITE - ;; - pgsql) - LIBODB_PGSQL([], [AC_MSG_ERROR([libodb-pgsql is not found; consider using --with-libodb-pgsql=DIR])]) - PGSQL - ;; - oracle) - LIBODB_ORACLE([], [AC_MSG_ERROR([libodb-oracle is not found; consider using --with-libodb-oracle=DIR])]) - ORACLE - ;; - mssql) - LIBODB_MSSQL([], [AC_MSG_ERROR([libodb-mssql is not found; consider using --with-libodb-mssql=DIR])]) - MSSQL - ;; -esac - -# Define LIBCOMMON_STATIC_LIB if we are build static library on certain -# platforms. -# -STATIC_LIB([LIBCOMMON_STATIC_LIB], [Static library interface.]) - -# Output. -# -AC_CONFIG_HEADERS([config.h libcommon/common/config.h]) -AC_CONFIG_FILES([__path__(config_files)]) -AC_CONFIG_COMMANDS([tester-mode], [chmod +x tester evolution/tester]) -AC_OUTPUT diff --git a/database-options.testscript b/database-options.testscript new file mode 100644 index 0000000..2c0ee82 --- /dev/null +++ b/database-options.testscript @@ -0,0 +1,75 @@ +# file : database-options.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# For the enabled databases create the test driver option lists (*_options) +# for subsequent use in the tests. Also create the database-specific client +# option lists (*_client_options) and command lines (*_client_cmd) which can +# be used as a base for the data manipulation commands. +# ++if $mysql + mysql_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + mysql_client_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + if $defined(config.odb_tests.mysql.passwd) + mysql_options += --password $config.odb_tests.mysql.passwd + mysql_client_options += --password=$config.odb_tests.mysql.passwd + end + + if $defined(config.odb_tests.mysql.host) + mysql_options += --host $config.odb_tests.mysql.host + mysql_client_options += --host $config.odb_tests.mysql.host + end + + if $defined(config.odb_tests.mysql.port) + mysql_options += --port $config.odb_tests.mysql.port + mysql_client_options += --port $config.odb_tests.mysql.port + end + + if $defined(config.odb_tests.mysql.socket) + mysql_options += --socket $config.odb_tests.mysql.socket + mysql_client_options += --socket $config.odb_tests.mysql.socket + end + + mysql_client_cmd = $path($mysql_client) $mysql_client_options +end + ++if $sqlite + sqlite_options = --database odb-test.db + + # Note that we currently don't manipulate the data using the sqlite3 + # utility. Thus, we don't create the sqlite client option list and command + # line. + # +end + ++if $pgsql + pgsql_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + pgsql_client_options = --quiet \ + --set ON_ERROR_STOP=1 \ + --username $config.odb_tests.pgsql.user \ + --dbname $config.odb_tests.pgsql.database + + if $defined(config.odb_tests.pgsql.host) + pgsql_options += --host $config.odb_tests.pgsql.host + pgsql_client_options += --host $config.odb_tests.pgsql.host + end + + if $defined(config.odb_tests.pgsql.port) + pgsql_options += --port $config.odb_tests.pgsql.port + pgsql_client_options += --port $config.odb_tests.pgsql.port + end + + pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options + + export PGOPTIONS=--client-min-messages=warning +end + +# Set the default schema file name, which can be overridden by the subsequent +# tests in their own scopes. +# +schema = test diff --git a/diagnostics/containers-of-containers.hxx b/diagnostics/containers-of-containers.hxx deleted file mode 100644 index 95e5161..0000000 --- a/diagnostics/containers-of-containers.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// file : common/id/auto/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -# define BLOB_TYPE "VARBINARY(max)" -# else -# define BLOB_TYPE "BLOB" -# endif -#endif - -#pragma db value -struct value_cont -{ - int n; - std::vector v; -}; - -#pragma db value -struct value_blob -{ - int n; - #pragma db type(BLOB_TYPE) - std::vector v; -}; - -#pragma db object -struct object -{ - #pragma db id - int id; - - //std::vector > vv; - - std::vector vc; - std::map mc; - - std::vector vb; - std::map mb; -}; - -/* - -#include -#include - -using float3 = std::array; - -#pragma db value(float3) transient -#pragma db member(float3::e1) virtual(float) get(this[0]) set(this[0]) -#pragma db member(float3::e2) virtual(float) get(this[1]) set(this[1]) -#pragma db member(float3::e3) virtual(float) get(this[2]) set(this[2]) - -#pragma db object -struct object -{ - #pragma db id - int id; - - std::vector vf3; -}; - -*/ diff --git a/evolution/Makefile.am b/evolution/Makefile.am deleted file mode 100644 index 2459530..0000000 --- a/evolution/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : evolution/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/evolution/add-column/makefile b/evolution/add-column/makefile deleted file mode 100644 index b05edab..0000000 --- a/evolution/add-column/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/add-column/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_add_c_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-foreign-key/makefile b/evolution/add-foreign-key/makefile deleted file mode 100644 index 701ba43..0000000 --- a/evolution/add-foreign-key/makefile +++ /dev/null @@ -1,146 +0,0 @@ -# file : evolution/add-foreign-key/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ ---table-prefix evo_add_fk_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-index/makefile b/evolution/add-index/makefile deleted file mode 100644 index c0e0289..0000000 --- a/evolution/add-index/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/add-index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_add_i_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/add-table/makefile b/evolution/add-table/makefile deleted file mode 100644 index d7d8cc9..0000000 --- a/evolution/add-table/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/add-table/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_add_t_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/alter-column/makefile b/evolution/alter-column/makefile deleted file mode 100644 index f92842a..0000000 --- a/evolution/alter-column/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/alter-column/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_alter_c_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/combined/makefile b/evolution/combined/makefile deleted file mode 100644 index 3e44dd1..0000000 --- a/evolution/combined/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/combined/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --sqlite-override-null --table-prefix evo_comb_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/data/makefile b/evolution/data/makefile deleted file mode 100644 index 20e3501..0000000 --- a/evolution/data/makefile +++ /dev/null @@ -1,142 +0,0 @@ -# file : evolution/data/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_data_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-column/makefile b/evolution/drop-column/makefile deleted file mode 100644 index a4bb228..0000000 --- a/evolution/drop-column/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/drop-column/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --sqlite-override-null --table-prefix evo_drop_c_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-foreign-key/makefile b/evolution/drop-foreign-key/makefile deleted file mode 100644 index 2cad4b8..0000000 --- a/evolution/drop-foreign-key/makefile +++ /dev/null @@ -1,146 +0,0 @@ -# file : evolution/drop-foreign-key/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --fkeys-deferrable-mode not_deferrable \ ---table-prefix evo_drop_fk_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-index/makefile b/evolution/drop-index/makefile deleted file mode 100644 index 775834b..0000000 --- a/evolution/drop-index/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/drop-index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_drop_i_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/drop-table/makefile b/evolution/drop-table/makefile deleted file mode 100644 index c6a5f65..0000000 --- a/evolution/drop-table/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/drop-table/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_drop_t_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/embedded/makefile b/evolution/embedded/makefile deleted file mode 100644 index 372cecd..0000000 --- a/evolution/embedded/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : evolution/embedded/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --schema-format embedded --at-once --table-prefix evo_embedded_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Base schema. - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/makefile b/evolution/makefile deleted file mode 100644 index 3d9cdb1..0000000 --- a/evolution/makefile +++ /dev/null @@ -1,64 +0,0 @@ -# file : evolution/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -add-table \ -drop-table \ -add-column \ -drop-column \ -alter-column \ -add-foreign-key \ -drop-foreign-key \ -add-index \ -drop-index \ -combined \ -embedded \ -soft-add \ -soft-delete \ -version \ -data \ -template - -all_tests := $(tests) -build_tests := $(tests) - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) - -name := evolution -$(dist): name := $(name) -$(dist): data_dist := tester.bat -$(dist): exec_dist := tester.in -$(dist): export dirs := $(filter-out $(no_dist_tests),$(tests)) -$(dist): export extra_dist := $(data_dist) $(exec_dist) test.bat \ -$(call vc8slns,$(name)) $(call vc9slns,$(name)) $(call vc10slns,$(name)) \ -$(call vc11slns,$(name)) $(call vc12slns,$(name)) -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) - $(call dist-data,$(data_dist)) - $(call dist-exec,$(exec_dist)) - $(call meta-automake) - $(call meta-vc8slns,$(name)) - $(call meta-vc9slns,$(name)) - $(call meta-vc10slns,$(name)) - $(call meta-vc11slns,$(name)) - $(call meta-vc12slns,$(name)) - $(call meta-vctest,$(name)-mysql-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) - -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) -else -$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) -endif diff --git a/evolution/soft-add/makefile b/evolution/soft-add/makefile deleted file mode 100644 index 7455c98..0000000 --- a/evolution/soft-add/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/soft-add/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ ---generate-schema --at-once --table-prefix evo_soft_a_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/soft-delete/makefile b/evolution/soft-delete/makefile deleted file mode 100644 index 92815bc..0000000 --- a/evolution/soft-delete/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/soft-delete/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query --generate-prepared \ ---generate-schema --at-once --sqlite-override-null --table-prefix evo_soft_d_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/template/Makefile.am b/evolution/template/Makefile.am deleted file mode 100644 index dddb6b9..0000000 --- a/evolution/template/Makefile.am +++ /dev/null @@ -1,59 +0,0 @@ -# file : evolution/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/evolution/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -# test1.hxx -# -driver_SOURCES += test1.hxx -nodist_driver_SOURCES = test1-odb.cxx -BUILT_SOURCES = test1-odb.hxx -CLEANFILES = test1-odb.hxx test1-odb.ixx test1-odb.cxx test1.sql model.xml - -test1-odb.hxx: test1.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options1) --changelog model.xml $< - -# test2.hxx -# -driver_SOURCES += test2.hxx -nodist_driver_SOURCES += test2-odb.cxx -BUILT_SOURCES += test2-odb.hxx -CLEANFILES += test2-odb.hxx test2-odb.ixx test2-odb.cxx test2.sql - -test2-odb.hxx: test2.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options2) --changelog model.xml $< - -# test3.hxx -# -driver_SOURCES += test3.hxx -nodist_driver_SOURCES += test3-odb.cxx -BUILT_SOURCES += test3-odb.hxx -CLEANFILES += test3-odb.hxx test3-odb.ixx test3-odb.cxx test3.sql \ -test3-002-pre.sql test3-002-post.sql test3-003-pre.sql test3-003-post.sql - -test3-odb.hxx: test3.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options3) --changelog model.xml $< - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -test2-odb.hxx: test1-odb.hxx -test3-odb.hxx: test2-odb.hxx -test1-odb.hxx test2-odb.hxx test3-odb.hxx: model.hxx diff --git a/evolution/template/makefile b/evolution/template/makefile deleted file mode 100644 index 474145c..0000000 --- a/evolution/template/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_template_ #@@ CHANGE THIS -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/evolution/test.bat b/evolution/test.bat deleted file mode 100644 index 953965c..0000000 --- a/evolution/test.bat +++ /dev/null @@ -1,79 +0,0 @@ -@echo off -rem file : evolution/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs) __path__(thread_dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem %4 - database -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%\evolution\tester.bat %4 %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 %1 - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:usage -echo. -echo usage: test.bat database -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/evolution/tester.bat b/evolution/tester.bat deleted file mode 100644 index 3b7401f..0000000 --- a/evolution/tester.bat +++ /dev/null @@ -1,87 +0,0 @@ -@echo off -rem file : evolution/tester.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Run an evolution test. The test directory is the current directory. -rem -rem %1 database -rem %2 configuration, for example, Debug or Release -rem %3 platform, for example Win32 or x64 -rem topdir variable containing the path to top project directory -rem - -setlocal - -set "PATH=%topdir%\libcommon\bin64;%topdir%\libcommon\bin;%PATH%" - -if "_%3_" == "_Win32_" ( - set "dir=%2" -) else ( - set "dir=%3\%2" -) - -if exist test*.sql ( - rem Standalone schema. - rem - - rem Drop everything. - rem - call %topdir%\%1-driver.bat test3.sql - if errorlevel 1 goto error - - call %topdir%\%1-driver.bat test2.sql - if errorlevel 1 goto error - - call %topdir%\%1-driver.bat test1.sql - if errorlevel 1 goto error - - rem Base schema. - rem - call %topdir%\%1-driver.bat test3-002-pre.sql - if errorlevel 1 goto error - - call %topdir%\%1-driver.bat test3-002-post.sql - if errorlevel 1 goto error - - %dir%\driver.exe --options-file %topdir%\%1.options 1 - if errorlevel 1 goto error - - rem Migration. - rem - call %topdir%\%1-driver.bat test3-003-pre.sql - if errorlevel 1 goto error - - %dir%\driver.exe --options-file %topdir%\%1.options 2 - if errorlevel 1 goto error - - call %topdir%\%1-driver.bat test3-003-post.sql - if errorlevel 1 goto error - - rem Current schema. - rem - %dir%\driver.exe --options-file %topdir%\%1.options 3 - if errorlevel 1 goto error - -) else ( - - rem Embedded schema. Just run the driver. - rem - %dir%\driver.exe --options-file %topdir%\%1.options 1 - if errorlevel 1 goto error - - %dir%\driver.exe --options-file %topdir%\%1.options 2 - if errorlevel 1 goto error - - %dir%\driver.exe --options-file %topdir%\%1.options 3 - if errorlevel 1 goto error -) - -goto end - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/evolution/tester.in b/evolution/tester.in deleted file mode 100755 index 1fef1c2..0000000 --- a/evolution/tester.in +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh - -# file : evolution/tester.in -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Run an evolution test. The test driver is in the current directory. The -# data files, if any, are in $srcdir. -# - -db_driver="$top_builddir/@database@-driver" -db_options="$top_builddir/@database@.options" - -if test -f test1.sql; then - # Standalone schema. - # - - # Drop everything. - $db_driver test3.sql || exit 1 - $db_driver test2.sql || exit 1 - $db_driver test1.sql || exit 1 - - # Base schema. - $db_driver test3-002-pre.sql || exit 1 - $db_driver test3-002-post.sql || exit 1 - ./driver --options-file "$db_options" 1 || exit 1 - - # Migration. - $db_driver test3-003-pre.sql || exit 1 - ./driver --options-file "$db_options" 2 || exit 1 - $db_driver test3-003-post.sql || exit 1 - - # Current schema. - ./driver --options-file "$db_options" 3 || exit 1 - -else - # Embedded schema. Just run the driver. - # - ./driver --options-file "$db_options" 1 || exit 1 - ./driver --options-file "$db_options" 2 || exit 1 - ./driver --options-file "$db_options" 3 || exit 1 -fi diff --git a/evolution/version/makefile b/evolution/version/makefile deleted file mode 100644 index eb63ffc..0000000 --- a/evolution/version/makefile +++ /dev/null @@ -1,145 +0,0 @@ -# file : evolution/version/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test1.hxx test2.hxx test3.hxx -genf1 := test1-odb.hxx test1-odb.ixx test1-odb.cxx -gen1 := $(addprefix $(out_base)/,$(genf1)) -genf2 := test2-odb.hxx test2-odb.ixx test2-odb.cxx -gen2 := $(addprefix $(out_base)/,$(genf2)) -genf3 := test3-odb.hxx test3-odb.ixx test3-odb.cxx -gen3 := $(addprefix $(out_base)/,$(genf3)) -genf := $(genf1) $(genf2) $(genf3) -gen := $(gen1) $(gen2) $(gen3) -gens := test1.sql test2.sql test3.sql test3-002-pre.sql test3-002-post.sql \ -test3-003-pre.sql test3-003-post.sql -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): odb_common_options = --generate-query \ ---generate-schema --at-once --table-prefix evo_version_ -$(gen): odb_common_options += --database $(db_id) -$(gen1) $(dist): export odb_options1 = $(odb_common_options) --init-changelog -$(gen2) $(dist): export odb_options2 = $(odb_common_options) --omit-create \ ---suppress-migration -$(gen3) $(dist): export odb_options3 = $(odb_common_options) --omit-create -$(gen1): odb_options += $(odb_options1) --changelog $(out_base)/model.xml -$(gen2): odb_options += $(odb_options2) --changelog $(out_base)/model.xml -$(gen3): odb_options += $(odb_options3) --changelog $(out_base)/model.xml -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Make sure testN.hxx are compiled serially since they share the -# changelog. Also add dependency on model.hxx -# -$(gen2): $(gen1) -$(gen3): $(gen2) -$(gen): $(src_base)/model.hxx - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/evolution/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := model.hxx -$(dist): export name := $(name) -$(dist): export extra_dist := $(call vc8projs,$(name)) \ -$(call vc9projs,$(name)) $(call vc10projs,$(name)) $(call vc11projs,$(name)) \ -$(call vc12projs,$(name)) -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template,$(name)) - $(call meta-vc9projs,../template/template,$(name)) - $(call meta-vc10projs,../template/template,$(name)) - $(call meta-vc11projs,../template/template,$(name)) - $(call meta-vc12projs,../template/template,$(name)) - -# Test. -# -$(test): $(driver) - # Drop everything. - $(call schema,$(out_base)/test3.sql) - $(call schema,$(out_base)/test2.sql) - $(call schema,$(out_base)/test1.sql) - # Base schema. - $(call schema,$(out_base)/test3-002-pre.sql) - $(call schema,$(out_base)/test3-002-post.sql) - $(call message,test $< base,$< --options-file $(dcf_root)/$(db_id).options 1) - # Migration. - $(call schema,$(out_base)/test3-003-pre.sql) - $(call message,test $< migration,$< --options-file $(dcf_root)/$(db_id).options 2) - $(call schema,$(out_base)/test3-003-post.sql) - # Current schema. - $(call message,test $< current,$< --options-file $(dcf_root)/$(db_id).options 3) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/model.xml) # Changelog. - $(call message,,rm -f $(out_base)/test3-*.sql) # Migration files. - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver model.xml $(genf) $(gens) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/libcommon/.gitignore b/libcommon/.gitignore new file mode 100644 index 0000000..a994ddc --- /dev/null +++ b/libcommon/.gitignore @@ -0,0 +1,3 @@ +# Generated config header. +# +config.hxx diff --git a/libcommon/Makefile.am b/libcommon/Makefile.am deleted file mode 100644 index 18d287d..0000000 --- a/libcommon/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : libcommon/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/libcommon/buffer.hxx b/libcommon/buffer.hxx new file mode 100644 index 0000000..41b7e46 --- /dev/null +++ b/libcommon/buffer.hxx @@ -0,0 +1,104 @@ +// file : libcommon/buffer.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_BUFFER_HXX +#define LIBCOMMON_BUFFER_HXX + +#include +#include // std::size_t +#include // std::{memcmp,memcpy} + +struct basic_buffer_base +{ + ~basic_buffer_base () + { + operator delete (data_); + } + + basic_buffer_base () + : data_ (0), size_ (0) + { + } + + basic_buffer_base (const void* data, std::size_t size) + : data_ (0), size_ (size) + { + data_ = operator new (size_); + std::memcpy (data_, data, size_); + } + + basic_buffer_base (const basic_buffer_base& y) + : data_ (0), size_ (0) + { + assign (y.data_, y.size_); + } + + basic_buffer_base& + operator= (const basic_buffer_base& y) + { + if (this != &y) + assign (y.data_, y.size_); + + return *this; + } + + void + assign (const void* data, std::size_t size) + { + if (size_ < size) + { + void *p (operator new (size)); + operator delete (data_); + data_ = p; + } + + std::memcpy (data_, data, size); + size_ = size; + } + + std::size_t + size () const + { + return size_; + } + + bool + operator== (const basic_buffer_base& y) const + { + return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; + } + +protected: + void* data_; + std::size_t size_; +}; + +template +struct basic_buffer: basic_buffer_base +{ + basic_buffer () + { + } + + basic_buffer (const T* data, std::size_t size) + : basic_buffer_base (data, size) + { + } + + T* + data () + { + return static_cast (data_); + } + + const T* + data () const + { + return static_cast (data_); + } +}; + +typedef basic_buffer buffer; +typedef basic_buffer ubuffer; + +#endif // LIBCOMMON_BUFFER_HXX diff --git a/libcommon/buildfile b/libcommon/buildfile new file mode 100644 index 0000000..eb61455 --- /dev/null +++ b/libcommon/buildfile @@ -0,0 +1,50 @@ +# file : libcommon/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import intf_libs = libodb%lib{odb} + +for db: $databases + import intf_libs += libodb-$db%lib{odb-$db} + +lib{common}: {hxx ixx txx cxx}{** -config} hxx{config} $intf_libs + +# Generated config file. +# +using autoconf + +hxx{config}: in{config} +{ + DATABASE_MYSQL = $mysql + DATABASE_SQLITE = $sqlite + DATABASE_PGSQL = $pgsql + DATABASE_ORACLE = $oracle + DATABASE_MSSQL = $mssql + MULTI_DATABASE = $multi +} + +# Build options. +# +cxx.poptions =+ "-I$out_root" "-I$src_root" + +{hbmia obja}{*}: cxx.poptions += -DLIBCOMMON_STATIC_BUILD +{hbmis objs}{*}: cxx.poptions += -DLIBCOMMON_SHARED_BUILD + +# Export options. +# +lib{common}: +{ + cxx.export.poptions = "-I$out_root" "-I$src_root" + cxx.export.libs = $intf_libs +} + +liba{common}: cxx.export.poptions += -DLIBCOMMON_STATIC +libs{common}: cxx.export.poptions += -DLIBCOMMON_SHARED + +# For pre-releases use the complete version to make sure they cannot +# be used in place of another pre-release or the final version. See +# the version module for details on the version.* variable values. +# +if $version.pre_release + lib{common}: bin.lib.version = "-$version.project_id" +else + lib{common}: bin.lib.version = "-$version.major.$version.minor" diff --git a/libcommon/common.cxx b/libcommon/common.cxx new file mode 100644 index 0000000..b3e4cfd --- /dev/null +++ b/libcommon/common.cxx @@ -0,0 +1,355 @@ +// file : libcommon/common.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::exit +#include // std::move +#include + +#include + +#include +#include + +using namespace std; +using namespace odb::core; + + +// MySQL. +// +#if defined(DATABASE_MYSQL) + +#include +#include + +static unique_ptr +create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mysql = odb::mysql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new mysql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new mysql::database (argc, argv, false, "", 0, move (f))); +} +#endif // MySQL + + +// SQLite. +// +#if defined(DATABASE_SQLITE) + +#include +#include +#include +#include +#include + +static unique_ptr +create_sqlite_database (int& argc, + char* argv[], + bool schema, + size_t max_connections) +{ + namespace sqlite = odb::sqlite; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new sqlite::connection_pool_factory (max_connections)); + + unique_ptr db ( + new sqlite::database ( + argc, argv, false, + SQLITE_OPEN_READWRITE + | SQLITE_OPEN_CREATE +#ifdef SQLITE_OPEN_URI + | SQLITE_OPEN_URI +#endif + , + true, + "", + move (f))); + + // Create the database schema. Due to bugs in SQLite foreign key + // support for DDL statements, we need to temporarily disable + // foreign keys. + // + if (schema) + { + connection_ptr c (db->connection ()); + + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); + } + + return db; +} +#endif // SQLite + + +// PostgreSQL. +// +#if defined(DATABASE_PGSQL) + +#include +#include + +static unique_ptr +create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace pgsql = odb::pgsql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new pgsql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new pgsql::database (argc, argv, false, "", move (f))); +} +#endif // PostgreSQL + + +// Oracle. +// +#if defined(DATABASE_ORACLE) + +#include +#include + +static unique_ptr +create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace oracle = odb::oracle; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new oracle::connection_pool_factory (max_connections)); + + // Set client database character set and client national character set + // to UTF-8. + // + return unique_ptr ( + new oracle::database (argc, argv, false, 873, 873, 0, move (f))); +} +#endif // Oracle + +// SQL Server. +// +#if defined(DATABASE_MSSQL) + +#include +#include + +static unique_ptr +create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mssql = odb::mssql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new mssql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new mssql::database (argc, argv, false, "", + mssql::isolation_read_committed, 0, move (f))); +} +#endif // SQL Server + +// +// +unique_ptr +create_database (int argc, + char* argv[], + bool schema, + size_t max_connections, +#if defined(MULTI_DATABASE) + odb::database_id db +#else + odb::database_id +#endif +) +{ + char** argp = argv + 1; // Position of the next argument. Assignment for VC8. + int argn (argc - 1); // Number of arguments left. + +#if defined(MULTI_DATABASE) + // Figure out which database we are creating. We may be given the + // database name as a program argument or as an id. + // + if (db == odb::id_common && argn != 0) + { + string s (*argp); + + if (s == "mysql") + db = odb::id_mysql; + else if (s == "sqlite") + db = odb::id_sqlite; + else if (s == "pgsql") + db = odb::id_pgsql; + else if (s == "oracle") + db = odb::id_oracle; + else if (s == "mssql") + db = odb::id_mssql; + + if (db != odb::id_common) + { + argp++; + argn--; + } + } + + if (db == odb::id_common) + { + cerr << "Usage: " << argv[0] << " [options]" << endl; + exit (1); + } +#endif + + if (argn != 0 && *argp == string ("--help")) + { +#if defined(MULTI_DATABASE) + cout << "Usage: " << argv[0] << " [options]" << endl; +#else + cout << "Usage: " << argv[0] << " [options]" << endl; +#endif + + cout << "Options:" << endl; + +#if defined(MULTI_DATABASE) + switch (db) + { + case odb::id_mysql: +#if defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_sqlite: +#if defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_pgsql: +#if defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_oracle: +#if defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_mssql: +#if defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_common: + assert (false); + } +#elif defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#elif defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#elif defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#elif defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#elif defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#else +# error unknown database +#endif + + exit (0); + } + +#if defined(MULTI_DATABASE) + switch (db) + { + case odb::id_mysql: +#if defined(DATABASE_MYSQL) + return create_mysql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_sqlite: +#if defined(DATABASE_SQLITE) + return create_sqlite_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_pgsql: +#if defined(DATABASE_PGSQL) + return create_pgsql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_oracle: +#if defined(DATABASE_ORACLE) + return create_oracle_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_mssql: +#if defined(DATABASE_MSSQL) + return create_mssql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_common: + assert (false); + } + return unique_ptr (); +#elif defined(DATABASE_MYSQL) + return create_mysql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_SQLITE) + return create_sqlite_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_PGSQL) + return create_pgsql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_ORACLE) + return create_oracle_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_MSSQL) + return create_mssql_database (argc, argv, schema, max_connections); +#else +# error unknown database +#endif +} + +bool +size_available () +{ +#if defined(MULTI_DATABASE) || \ + defined(DATABASE_SQLITE) || \ + defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) + return false; +#else + return true; +#endif +} diff --git a/libcommon/common.hxx b/libcommon/common.hxx new file mode 100644 index 0000000..9ab978d --- /dev/null +++ b/libcommon/common.hxx @@ -0,0 +1,47 @@ +// file : libcommon/common.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_HXX +#define LIBCOMMON_COMMON_HXX + +#include // std::unique_ptr +#include // std::size_t + +#include +#include + +#include + +LIBCOMMON_SYMEXPORT std::unique_ptr +create_database (int argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0, + odb::database_id db = odb::id_common); + +template +std::unique_ptr +create_specific_database (int argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0) +{ + std::unique_ptr r ( + create_database (argc, argv, + create_schema, + max_connections, + T::database_id)); + + return std::unique_ptr (&dynamic_cast (*r.release ())); +} + +// This function returns an accurate result only if the result iterator +// hasn't been advanced and after the call the result is no longer valid. +// +template +std::size_t +size (odb::result); + +#include + +#endif // LIBCOMMON_COMMON_HXX diff --git a/libcommon/common.txx b/libcommon/common.txx new file mode 100644 index 0000000..caa7481 --- /dev/null +++ b/libcommon/common.txx @@ -0,0 +1,24 @@ +// file : libcommon/common.txx +// license : GNU GPL v2; see accompanying LICENSE file + +// We have to use this helper function instead of just checking which +// database is used because the DATABASE_* macro may not be defined +// in a project that includes this header. +// +LIBCOMMON_SYMEXPORT bool +size_available (); + +template +std::size_t +size (odb::result r) +{ + if (size_available ()) + return r.size (); + else + { + std::size_t n (0); + for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) + n++; + return n; + } +} diff --git a/libcommon/common/Makefile.am b/libcommon/common/Makefile.am deleted file mode 100644 index 3ff50d5..0000000 --- a/libcommon/common/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -# file : libcommon/common/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -noinst_LTLIBRARIES = libcommon.la -libcommon_la_SOURCES = __path__(sources) __path__(headers) - -EXTRA_DIST = __file__(extra_dist) - -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -DLIBCOMMON_DYNAMIC_LIB -AM_LDFLAGS = -no-undefined -rpath '$(libdir)' diff --git a/libcommon/common/buffer.hxx b/libcommon/common/buffer.hxx deleted file mode 100644 index 3d82915..0000000 --- a/libcommon/common/buffer.hxx +++ /dev/null @@ -1,104 +0,0 @@ -// file : libcommon/common/buffer.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_BUFFER_HXX -#define LIBCOMMON_COMMON_BUFFER_HXX - -#include -#include // std::size_t -#include // std::{memcmp,memcpy} - -struct basic_buffer_base -{ - ~basic_buffer_base () - { - operator delete (data_); - } - - basic_buffer_base () - : data_ (0), size_ (0) - { - } - - basic_buffer_base (const void* data, std::size_t size) - : data_ (0), size_ (size) - { - data_ = operator new (size_); - std::memcpy (data_, data, size_); - } - - basic_buffer_base (const basic_buffer_base& y) - : data_ (0), size_ (0) - { - assign (y.data_, y.size_); - } - - basic_buffer_base& - operator= (const basic_buffer_base& y) - { - if (this != &y) - assign (y.data_, y.size_); - - return *this; - } - - void - assign (const void* data, std::size_t size) - { - if (size_ < size) - { - void *p (operator new (size)); - operator delete (data_); - data_ = p; - } - - std::memcpy (data_, data, size); - size_ = size; - } - - std::size_t - size () const - { - return size_; - } - - bool - operator== (const basic_buffer_base& y) const - { - return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; - } - -protected: - void* data_; - std::size_t size_; -}; - -template -struct basic_buffer: basic_buffer_base -{ - basic_buffer () - { - } - - basic_buffer (const T* data, std::size_t size) - : basic_buffer_base (data, size) - { - } - - T* - data () - { - return static_cast (data_); - } - - const T* - data () const - { - return static_cast (data_); - } -}; - -typedef basic_buffer buffer; -typedef basic_buffer ubuffer; - -#endif // LIBCOMMON_COMMON_BUFFER_HXX diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx deleted file mode 100644 index 4b8afe1..0000000 --- a/libcommon/common/common.cxx +++ /dev/null @@ -1,360 +0,0 @@ -// file : libcommon/common/common.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include // std::exit -#include // std::move -#include - -#include - -#include -#include - -using namespace std; -using namespace odb::core; - - -// MySQL. -// -#if defined(DATABASE_MYSQL) || defined(DATABASE_COMMON) - -#include -#include - -static auto_ptr -create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace mysql = odb::mysql; - -#ifdef HAVE_CXX11 - unique_ptr f; -#else - auto_ptr f; -#endif - - if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); - - return auto_ptr ( - new mysql::database (argc, argv, false, "", 0, -#ifdef HAVE_CXX11 - move (f) -#else - f -#endif - )); -} -#endif // MySQL - - -// SQLite. -// -#if defined(DATABASE_SQLITE) || defined(DATABASE_COMMON) - -#include -#include -#include -#include -#include - -static auto_ptr -create_sqlite_database (int& argc, - char* argv[], - bool schema, - size_t max_connections) -{ - namespace sqlite = odb::sqlite; - -#ifdef HAVE_CXX11 - unique_ptr f; -#else - auto_ptr f; -#endif - - if (max_connections != 0) - f.reset (new sqlite::connection_pool_factory (max_connections)); - - auto_ptr db ( - new sqlite::database ( - argc, argv, false, - SQLITE_OPEN_READWRITE - | SQLITE_OPEN_CREATE -#ifdef SQLITE_OPEN_URI - | SQLITE_OPEN_URI -#endif - , - true, - "", -#ifdef HAVE_CXX11 - move (f) -#else - f -#endif - )); - - // Create the database schema. Due to bugs in SQLite foreign key - // support for DDL statements, we need to temporarily disable - // foreign keys. - // - if (schema) - { - connection_ptr c (db->connection ()); - - c->execute ("PRAGMA foreign_keys=OFF"); - - transaction t (c->begin ()); - schema_catalog::create_schema (*db); - t.commit (); - - c->execute ("PRAGMA foreign_keys=ON"); - } - - return db; -} -#endif // SQLite - - -// PostgreSQL. -// -#if defined(DATABASE_PGSQL) || defined(DATABASE_COMMON) - -#include -#include - -static auto_ptr -create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace pgsql = odb::pgsql; - -#ifdef HAVE_CXX11 - unique_ptr f; -#else - auto_ptr f; -#endif - - if (max_connections != 0) - f.reset (new pgsql::connection_pool_factory (max_connections)); - - return auto_ptr ( - new pgsql::database (argc, argv, false, "", -#ifdef HAVE_CXX11 - move (f) -#else - f -#endif - )); -} -#endif // PostgreSQL - - -// Oracle. -// -#if defined(DATABASE_ORACLE) || defined(DATABASE_COMMON) - -#include -#include - -static auto_ptr -create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace oracle = odb::oracle; - -#ifdef HAVE_CXX11 - unique_ptr f; -#else - auto_ptr f; -#endif - - if (max_connections != 0) - f.reset (new oracle::connection_pool_factory (max_connections)); - - // Set client database character set and client national character set - // to UTF-8. - // - return auto_ptr ( - new oracle::database (argc, argv, false, 873, 873, 0, -#ifdef HAVE_CXX11 - move (f) -#else - f -#endif - )); -} -#endif // Oracle - -// SQL Server. -// -#if defined(DATABASE_MSSQL) || defined(DATABASE_COMMON) - -#include -#include - -static auto_ptr -create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace mssql = odb::mssql; - -#ifdef HAVE_CXX11 - unique_ptr f; -#else - auto_ptr f; -#endif - - if (max_connections != 0) - f.reset (new mssql::connection_pool_factory (max_connections)); - - return auto_ptr ( - new mssql::database (argc, argv, false, "", - mssql::isolation_read_committed, 0, - -#ifdef HAVE_CXX11 - move (f) -#else - f -#endif - )); -} -#endif // SQL Server - -// -// -auto_ptr -create_database (int argc, - char* argv[], - bool schema, - size_t max_connections, -#if defined(DATABASE_COMMON) - odb::database_id db -#else - odb::database_id -#endif -) -{ - char** argp = argv + 1; // Position of the next argument. Assignment for VC8. - int argn (argc - 1); // Number of arguments left. - -#if defined(DATABASE_COMMON) - // Figure out which database we are creating. We may be given the - // database name as a program argument or as an id. - // - if (db == odb::id_common && argn != 0) - { - string s (*argp); - - if (s == "mysql") - db = odb::id_mysql; - else if (s == "sqlite") - db = odb::id_sqlite; - else if (s == "pgsql") - db = odb::id_pgsql; - else if (s == "oracle") - db = odb::id_oracle; - else if (s == "mssql") - db = odb::id_mssql; - - if (db != odb::id_common) - { - argp++; - argn--; - } - } - - if (db == odb::id_common) - { - cerr << "Usage: " << argv[0] << " [options]" << endl; - exit (1); - } -#endif - - if (argn != 0 && *argp == string ("--help")) - { -#if defined(DATABASE_COMMON) - cout << "Usage: " << argv[0] << " [options]" << endl; -#else - cout << "Usage: " << argv[0] << " [options]" << endl; -#endif - - cout << "Options:" << endl; - -#if defined(DATABASE_MYSQL) - odb::mysql::database::print_usage (cout); -#elif defined(DATABASE_SQLITE) - odb::sqlite::database::print_usage (cout); -#elif defined(DATABASE_PGSQL) - odb::pgsql::database::print_usage (cout); -#elif defined(DATABASE_ORACLE) - odb::oracle::database::print_usage (cout); -#elif defined(DATABASE_MSSQL) - odb::mssql::database::print_usage (cout); -#elif defined(DATABASE_COMMON) - switch (db) - { - case odb::id_mysql: - odb::mysql::database::print_usage (cout); - break; - case odb::id_sqlite: - odb::sqlite::database::print_usage (cout); - break; - case odb::id_pgsql: - odb::pgsql::database::print_usage (cout); - break; - case odb::id_oracle: - odb::oracle::database::print_usage (cout); - break; - case odb::id_mssql: - odb::mssql::database::print_usage (cout); - break; - case odb::id_common: - assert (false); - } -#else -# error unknown database -#endif - - exit (0); - } - -#if defined(DATABASE_MYSQL) - return create_mysql_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_SQLITE) - return create_sqlite_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_PGSQL) - return create_pgsql_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_ORACLE) - return create_oracle_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_MSSQL) - return create_mssql_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_COMMON) - switch (db) - { - case odb::id_mysql: - return create_mysql_database (argc, argv, schema, max_connections); - case odb::id_sqlite: - return create_sqlite_database (argc, argv, schema, max_connections); - case odb::id_pgsql: - return create_pgsql_database (argc, argv, schema, max_connections); - case odb::id_oracle: - return create_oracle_database (argc, argv, schema, max_connections); - case odb::id_mssql: - return create_mssql_database (argc, argv, schema, max_connections); - case odb::id_common: - assert (false); - } - return auto_ptr (); -#else -# error unknown database -#endif -} - -bool -size_available () -{ -#if defined(DATABASE_SQLITE) || \ - defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) || \ - defined(DATABASE_COMMON) - return false; -#else - return true; -#endif -} diff --git a/libcommon/common/common.hxx b/libcommon/common/common.hxx deleted file mode 100644 index 21672b1..0000000 --- a/libcommon/common/common.hxx +++ /dev/null @@ -1,53 +0,0 @@ -// file : libcommon/common/common.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_COMMON_HXX -#define LIBCOMMON_COMMON_COMMON_HXX - -#include // std::auto_ptr -#include // std::size_t - -#include // odb::database -#include - -#include - -// Make sure assert() is not disabled. -// -#ifdef NDEBUG -# error ODB tests require enabled assert(); un-define the NDEBUG macro -#endif - -LIBCOMMON_EXPORT std::auto_ptr -create_database (int argc, - char* argv[], - bool create_schema = true, - std::size_t max_connections = 0, - odb::database_id db = odb::id_common); - -template -std::auto_ptr -create_specific_database (int argc, - char* argv[], - bool create_schema = true, - std::size_t max_connections = 0) -{ - std::auto_ptr r ( - create_database (argc, argv, - create_schema, - max_connections, - T::database_id)); - - return std::auto_ptr (&dynamic_cast (*r.release ())); -} - -// This function returns an accurate result only if the result iterator -// hasn't been advanced and after the call the result is no longer valid. -// -template -std::size_t -size (odb::result); - -#include - -#endif // LIBCOMMON_COMMON_COMMON_HXX diff --git a/libcommon/common/common.txx b/libcommon/common/common.txx deleted file mode 100644 index 9dd2a35..0000000 --- a/libcommon/common/common.txx +++ /dev/null @@ -1,24 +0,0 @@ -// file : libcommon/common/common.txx -// license : GNU GPL v2; see accompanying LICENSE file - -// We have to use this helper function instead of just checking which -// database is used because the DATABASE_* macro may not be defined -// in a project that includes this header. -// -LIBCOMMON_EXPORT bool -size_available (); - -template -std::size_t -size (odb::result r) -{ - if (size_available ()) - return r.size (); - else - { - std::size_t n (0); - for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) - n++; - return n; - } -} diff --git a/libcommon/common/concrete.hxx b/libcommon/common/concrete.hxx deleted file mode 100644 index 2014b24..0000000 --- a/libcommon/common/concrete.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : libcommon/common/concrete.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_CONCRETE_HXX -#define LIBCOMMON_COMMON_CONCRETE_HXX - -#include - -// Namespace alias for the concrete database namespace. -// -#if defined(DATABASE_MYSQL) - -#include -#include - -namespace odb_db = odb::mysql; - -#elif defined(DATABASE_SQLITE) - -#include -#include - -namespace odb_db = odb::sqlite; - -#elif defined(DATABASE_PGSQL) - -#include -#include - -namespace odb_db = odb::pgsql; - -#elif defined(DATABASE_ORACLE) - -#include -#include - -namespace odb_db = odb::oracle; - -#elif defined(DATABASE_MSSQL) - -#include -#include - -namespace odb_db = odb::mssql; - -#elif defined(DATABASE_COMMON) - -// Fallback to common interface. -// -#include -#include - -namespace odb_db = odb; - -#endif - -#endif // LIBCOMMON_COMMON_CONCRETE_HXX diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h deleted file mode 100644 index 16d89a0..0000000 --- a/libcommon/common/config-vc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* file : libcommon/common/config-vc.h - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* Configuration file for Windows/VC++. */ - -#ifndef LIBCOMMON_COMMON_CONFIG_VC_H -#define LIBCOMMON_COMMON_CONFIG_VC_H - -#define HAVE_TR1_MEMORY - -/* VC++10 and later has C++11 always enabled. - */ -#if (defined(_MSC_VER) && _MSC_VER >= 1600) || \ - (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1600) -# define HAVE_CXX11 -// Strongly typed enums are supported starting from VC++11. -// -# if (defined(_MSC_VER) && _MSC_VER >= 1700) || \ - (defined(ODB_MSC_VER) && ODB_MSC_VER >= 1700) -# define HAVE_CXX11_ENUM -# endif -#endif - -#endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in deleted file mode 100644 index 9d3e0fc..0000000 --- a/libcommon/common/config.h.in +++ /dev/null @@ -1,19 +0,0 @@ -/* file : libcommon/common/config.h.in - * license : GNU GPL v2; see accompanying LICENSE file - */ - -/* This file is automatically processed by configure. */ - -#ifndef LIBCOMMON_COMMON_CONFIG_H -#define LIBCOMMON_COMMON_CONFIG_H - -#undef DATABASE_MYSQL -#undef DATABASE_SQLITE -#undef DATABASE_PGSQL -#undef DATABASE_ORACLE -#undef DATABASE_MSSQL -#undef HAVE_TR1_MEMORY -#undef HAVE_CXX11 -#undef LIBCOMMON_STATIC_LIB - -#endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx deleted file mode 100644 index 5c6d938..0000000 --- a/libcommon/common/config.hxx +++ /dev/null @@ -1,20 +0,0 @@ -// file : libcommon/common/config.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_CONFIG_HXX -#define LIBCOMMON_COMMON_CONFIG_HXX - -#ifdef HAVE_CONFIG_VC_H -# include -#else -# include - -// GCC supports strongly typed enums from 4.4 (forward -- 4.6), -// Clang -- 2.9 (3.1). -// -# ifdef HAVE_CXX11 -# define HAVE_CXX11_ENUM -# endif -#endif - -#endif // LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx deleted file mode 100644 index 926d7a5..0000000 --- a/libcommon/common/export.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : libcommon/common/export.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_EXPORT_HXX -#define LIBCOMMON_COMMON_EXPORT_HXX - -#include - -#ifdef LIBCOMMON_STATIC_LIB -# define LIBCOMMON_EXPORT -#else -# ifdef _WIN32 -# ifdef _MSC_VER -# ifdef LIBCOMMON_DYNAMIC_LIB -# define LIBCOMMON_EXPORT __declspec(dllexport) -# else -# define LIBCOMMON_EXPORT __declspec(dllimport) -# endif -# else -# ifdef LIBCOMMON_DYNAMIC_LIB -# ifdef DLL_EXPORT -# define LIBCOMMON_EXPORT __declspec(dllexport) -# else -# define LIBCOMMON_EXPORT -# endif -# else -# define LIBCOMMON_EXPORT __declspec(dllimport) -# endif -# endif -# else -# define LIBCOMMON_EXPORT -# endif -#endif - -#endif // LIBCOMMON_COMMON_EXPORT_HXX diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj deleted file mode 100644 index a07a9a6..0000000 --- a/libcommon/common/libcommon-vc10.vcxproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {019C2E51-BF41-4490-AB96-4156741B8CC9} - Win32Proj - libcommon - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\bin\ - common-d - - - true - ..\bin64\ - common-d - - - false - ..\bin\ - common - - - false - ..\bin64\ - common - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib\common-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib64\common-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib\common.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib64\common.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/libcommon/common/libcommon-vc10.vcxproj.filters b/libcommon/common/libcommon-vc10.vcxproj.filters deleted file mode 100644 index ecc3613..0000000 --- a/libcommon/common/libcommon-vc10.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} - cxx - - - {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/libcommon/common/libcommon-vc11.vcxproj b/libcommon/common/libcommon-vc11.vcxproj deleted file mode 100644 index c5a6758..0000000 --- a/libcommon/common/libcommon-vc11.vcxproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {019C2E51-BF41-4490-AB96-4156741B8CC9} - Win32Proj - libcommon - - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - true - v110 - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - DynamicLibrary - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\bin\ - common-d - - - true - ..\bin64\ - common-d - - - false - ..\bin\ - common - - - false - ..\bin64\ - common - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib\common-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib64\common-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib\common.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib64\common.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/libcommon/common/libcommon-vc11.vcxproj.filters b/libcommon/common/libcommon-vc11.vcxproj.filters deleted file mode 100644 index ecc3613..0000000 --- a/libcommon/common/libcommon-vc11.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} - cxx - - - {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/libcommon/common/libcommon-vc12.vcxproj b/libcommon/common/libcommon-vc12.vcxproj deleted file mode 100644 index e577c79..0000000 --- a/libcommon/common/libcommon-vc12.vcxproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {019C2E51-BF41-4490-AB96-4156741B8CC9} - Win32Proj - libcommon - - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - true - v120 - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - DynamicLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - ..\bin\ - common-d - - - true - ..\bin64\ - common-d - - - false - ..\bin\ - common - - - false - ..\bin64\ - common - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib\common-d.lib - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Windows - true - $(TargetPath) - ..\lib64\common-d.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib\common.lib - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) - .. - 4355;4800;4290;4251;%(DisableSpecificWarnings) - true - - - odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Windows - true - true - true - $(TargetPath) - ..\lib64\common.lib - - - -__header_entries__(headers) - - -__source_entries__(sources) - - - - - diff --git a/libcommon/common/libcommon-vc12.vcxproj.filters b/libcommon/common/libcommon-vc12.vcxproj.filters deleted file mode 100644 index ecc3613..0000000 --- a/libcommon/common/libcommon-vc12.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {6B7BDACA-0BDC-48B2-B5BD-BEFC5826ABC9} - cxx - - - {F2B8743C-E39C-4FE0-AA8F-FF7FA2DA7191} - h;hxx;ixx;txx - - - -__header_filter_entries__(headers) - - -__source_filter_entries__(sources) - - diff --git a/libcommon/common/libcommon-vc8.vcproj b/libcommon/common/libcommon-vc8.vcproj deleted file mode 100644 index ab5656a..0000000 --- a/libcommon/common/libcommon-vc8.vcproj +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entries__(sources) - - -__file_entries__(headers) - - - - - diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj deleted file mode 100644 index 49bfe21..0000000 --- a/libcommon/common/libcommon-vc9.vcproj +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entries__(sources) - - -__file_entries__(headers) - - - - - diff --git a/libcommon/common/makefile b/libcommon/common/makefile deleted file mode 100644 index 2f6537f..0000000 --- a/libcommon/common/makefile +++ /dev/null @@ -1,166 +0,0 @@ -# file : libcommon/common/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := common.cxx - -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_base)/common.l -common.l.cpp-options := $(out_base)/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/libodb/stub.make,\ - l: odb.l,cpp-options: odb.l.cpp-options) - -ifdef db_id -ifneq ($(db_id),common) -$(call import,\ - $(scf_root)/import/libodb-$(db_id)/stub.make,\ - l: odb_db.l,cpp-options: odb_db.l.cpp-options) -else -# Import all database runtimes. -# -$(call import,\ - $(scf_root)/import/libodb-mysql/stub.make,\ - l: odb_mysql.l,cpp-options: odb_mysql.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-sqlite/stub.make,\ - l: odb_sqlite.l,cpp-options: odb_sqlite.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-pgsql/stub.make,\ - l: odb_pgsql.l,cpp-options: odb_pgsql.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-oracle/stub.make,\ - l: odb_oracle.l,cpp-options: odb_oracle.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libodb-mssql/stub.make,\ - l: odb_mssql.l,cpp-options: odb_mssql.l.cpp-options) - -odb_db.l := \ -$(odb_mysql.l) \ -$(odb_sqlite.l) \ -$(odb_pgsql.l) \ -$(odb_oracle.l) \ -$(odb_mssql.l) - -odb_db.l.cpp-options := \ -$(odb_mysql.l.cpp-options) \ -$(odb_sqlite.l.cpp-options) \ -$(odb_pgsql.l.cpp-options) \ -$(odb_oracle.l.cpp-options) \ -$(odb_mssql.l.cpp-options) -endif -endif - -ifeq ($(odb_db.l.cpp-options),) -odb_db.l.cpp-options := $(out_base)/.unbuildable -endif - -# Build. -# -$(common.l): $(cxx_obj) $(odb.l) $(odb_db.l) - -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h -$(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon -$(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard - -ifdef db_id -ifdef cxx_standard -$(out_base)/config.h: | $(out_base)/. - @echo '/* file : libcommon/common/config.h' >$@ - @echo ' * note : automatically generated' >>$@ - @echo ' */' >>$@ - @echo '' >>$@ - @echo '#ifndef LIBCOMMON_COMMON_CONFIG_H' >>$@ - @echo '#define LIBCOMMON_COMMON_CONFIG_H' >>$@ - @echo '' >>$@ -ifeq ($(db_id),mysql) - @echo '#define DATABASE_MYSQL 1' >>$@ -else ifeq ($(db_id),sqlite) - @echo '#define DATABASE_SQLITE 1' >>$@ -else ifeq ($(db_id),pgsql) - @echo '#define DATABASE_PGSQL 1' >>$@ -else ifeq ($(db_id),oracle) - @echo '#define DATABASE_ORACLE 1' >>$@ -else ifeq ($(db_id),mssql) - @echo '#define DATABASE_MSSQL 1' >>$@ -else ifeq ($(db_id),common) - @echo '#define DATABASE_COMMON 1' >>$@ -endif -ifeq ($(cxx_standard),c++11) - @echo '#define HAVE_CXX11 1' >>$@ -endif - @echo '#define HAVE_TR1_MEMORY 1' >>$@ - @echo '' >>$@ - @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ -endif -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) - -# Convenience alias for default target. -# -$(out_base)/: $(common.l) - -# Dist. -# -$(dist): export sources := $(cxx_tun) -$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ --name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) -$(dist): data_dist := config.h.in config-vc.h -$(dist): export extra_dist := $(data_dist) $(call vc8projs,libcommon) \ -$(call vc9projs,libcommon) $(call vc10projs,libcommon) \ -$(call vc11projs,libcommon) $(call vc12projs,libcommon) - -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake) - $(call meta-vc8projs,libcommon) - $(call meta-vc9projs,libcommon) - $(call meta-vc10projs,libcommon) - $(call meta-vc11projs,libcommon) - $(call meta-vc12projs,libcommon) - -# Clean. -# -$(clean): $(common.l).o.clean \ - $(common.l.cpp-options).clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,rm $$1,rm -f $$1,$(out_base)/config.h) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(common.l): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := config.h -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-l.make) diff --git a/libcommon/concrete.hxx b/libcommon/concrete.hxx new file mode 100644 index 0000000..e0f64a5 --- /dev/null +++ b/libcommon/concrete.hxx @@ -0,0 +1,57 @@ +// file : libcommon/concrete.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_CONCRETE_HXX +#define LIBCOMMON_CONCRETE_HXX + +#include + +// Namespace alias for the concrete database namespace. +// +#if defined(MULTI_DATABASE) + +// Fallback to common interface. +// +#include +#include + +namespace odb_db = odb; + +#elif defined(DATABASE_MYSQL) + +#include +#include + +namespace odb_db = odb::mysql; + +#elif defined(DATABASE_SQLITE) + +#include +#include + +namespace odb_db = odb::sqlite; + +#elif defined(DATABASE_PGSQL) + +#include +#include + +namespace odb_db = odb::pgsql; + +#elif defined(DATABASE_ORACLE) + +#include +#include + +namespace odb_db = odb::oracle; + +#elif defined(DATABASE_MSSQL) + +#include +#include + +namespace odb_db = odb::mssql; + +#endif + +#endif // LIBCOMMON_CONCRETE_HXX diff --git a/libcommon/config.hxx.in b/libcommon/config.hxx.in new file mode 100644 index 0000000..ff90e61 --- /dev/null +++ b/libcommon/config.hxx.in @@ -0,0 +1,14 @@ +// file : libcommon/config.hxx.in +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_CONFIG_HXX +#define LIBCOMMON_CONFIG_HXX + +#undef DATABASE_MYSQL +#undef DATABASE_SQLITE +#undef DATABASE_PGSQL +#undef DATABASE_ORACLE +#undef DATABASE_MSSQL +#undef MULTI_DATABASE + +#endif // LIBCOMMON_CONFIG_HXX diff --git a/libcommon/export.hxx b/libcommon/export.hxx new file mode 100644 index 0000000..0de4565 --- /dev/null +++ b/libcommon/export.hxx @@ -0,0 +1,39 @@ +#pragma once + +// Normally we don't export class templates (but do complete specializations), +// inline functions, and classes with only inline member functions. Exporting +// classes that inherit from non-exported/imported bases (e.g., std::string) +// will end up badly. The only known workarounds are to not inherit or to not +// export. Also, MinGW GCC doesn't like seeing non-exported functions being +// used before their inline definition. The workaround is to reorder code. In +// the end it's all trial and error. + +#if defined(LIBCOMMON_STATIC) // Using static. +# define LIBCOMMON_SYMEXPORT +#elif defined(LIBCOMMON_STATIC_BUILD) // Building static. +# define LIBCOMMON_SYMEXPORT +#elif defined(LIBCOMMON_SHARED) // Using shared. +# ifdef _WIN32 +# define LIBCOMMON_SYMEXPORT __declspec(dllimport) +# else +# define LIBCOMMON_SYMEXPORT +# endif +#elif defined(LIBCOMMON_SHARED_BUILD) // Building shared. +# ifdef _WIN32 +# define LIBCOMMON_SYMEXPORT __declspec(dllexport) +# else +# define LIBCOMMON_SYMEXPORT +# endif +#else +// If none of the above macros are defined, then we assume we are being used +// by some third-party build system that cannot/doesn't signal the library +// type. Note that this fallback works for both static and shared libraries +// provided the library only exports functions (in other words, no global +// exported data) and for the shared case the result will be sub-optimal +// compared to having dllimport. If, however, your library does export data, +// then you will probably want to replace the fallback with the (commented +// out) error since it won't work for the shared case. +// +# define LIBCOMMON_SYMEXPORT // Using static or shared. +//# error define LIBCOMMON_STATIC or LIBCOMMON_SHARED preprocessor macro to signal libcommon library type being linked +#endif diff --git a/libcommon/makefile b/libcommon/makefile deleted file mode 100644 index ac0bb3c..0000000 --- a/libcommon/makefile +++ /dev/null @@ -1,31 +0,0 @@ -# file : libcommon/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -dirs := common - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) - -$(dist): export dirs := $(dirs) -$(dist): export extra_dist := $(call vc8slns,libcommon) \ -$(call vc9slns,libcommon) $(call vc10slns,libcommon) \ -$(call vc11slns,libcommon) $(call vc12slns,libcommon) -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) - $(call meta-automake) - $(call meta-vc8slns,libcommon) - $(call meta-vc9slns,libcommon) - $(call meta-vc10slns,libcommon) - $(call meta-vc11slns,libcommon) - $(call meta-vc12slns,libcommon) - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/m4/acx-pthread.m4 b/m4/acx-pthread.m4 deleted file mode 100644 index 204b32d..0000000 --- a/m4/acx-pthread.m4 +++ /dev/null @@ -1,259 +0,0 @@ -dnl -dnl NOTE: This file was modified. See the comments starting with 'CS:' -dnl for more information. In particular, it was changed to use C++ -dnl instead of C. -dnl -dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl @summary figure out how to build C++ programs using POSIX threads -dnl -dnl This macro figures out how to build C++ programs using POSIX threads. -dnl It sets the PTHREAD_LIBS output variable to the threads library and -dnl linker flags, and the PTHREAD_CXXFLAGS output variable to any special -dnl C++ compiler flags that are needed. (The user can also force certain -dnl compiler flags/libs to be tested by setting these environment -dnl variables.) -dnl -dnl Also sets PTHREAD_CXX to any special C++ compiler that is needed for -dnl multi-threaded programs (defaults to the value of CXX otherwise). -dnl (This is necessary on AIX to use the special xlC_r compiler alias.) -dnl -dnl NOTE: You are assumed to not only compile your program with these -dnl flags, but also link it with them as well. e.g. you should link -dnl with $PTHREAD_CXX $CXXFLAGS $PTHREAD_CXXFLAGS $LDFLAGS ... $PTHREAD_LIBS -dnl $LIBS -dnl -dnl If you are only building threads programs, you may wish to use -dnl these variables in your default LIBS, CXXFLAGS, and CXX: -dnl -dnl LIBS="$PTHREAD_LIBS $LIBS" -dnl CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" -dnl CXX="$PTHREAD_CXX" -dnl -dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute -dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to -dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a threads -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to -dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the -dnl default action will define HAVE_PTHREAD. -dnl -dnl Please let the authors know if this macro fails on any platform, or -dnl if you have any other suggestions or comments. This macro was based -dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with -dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros -dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. -dnl We are also grateful for the helpful feedback of numerous users. -dnl -dnl @category InstalledPackages -dnl @author Steven G. Johnson -dnl @version 2006-05-29 -dnl @license GPLWithACException - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG(C++) -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CXXFLAGS="" - fi - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -# CS: On GNU/Linux with gcc both -pthread and -lpthread are valid. -# However, libtool links libraries with -nostdlib which results in -# -pthread being stripped from the linker command line. To resolve -# this we move pthread from after -mthreads to after pthreads. -# -acx_pthread_flags="pthreads pthread none -Kthread -kthread lthread -pthread -pthreads -mthreads --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - # CS: Move -mt to the front of the list; Sun CC will use -mt, - # gcc will use -pthreads. - # - acx_pthread_flags="-mt -pthreads pthread -pthread $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CXXFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CXXFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CXXFLAGS="$CXXFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - # - AC_TRY_LINK([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0);], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CXXFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - -dnl # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. -dnl AC_MSG_CHECKING([for joinable pthread attribute]) -dnl attr_name=unknown -dnl for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do -dnl AC_TRY_LINK([#include ], [int attr=$attr; return attr;], -dnl [attr_name=$attr; break]) -dnl done -dnl AC_MSG_RESULT($attr_name) -dnl if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then -dnl AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, -dnl [Define to necessary symbol if this constant -dnl uses a non-standard name on your system.]) -dnl fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - # CS: Add _REENTRANT in Linux to emulate -pthread. - # - *-linux* | *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS" - fi - - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" - -dnl # More AIX lossage: must compile with xlC_r -dnl if test x"$GXX" != xyes; then -dnl AC_CHECK_PROGS(PTHREAD_CXX, xlC_r, ${CXX}) -dnl else -dnl PTHREAD_CXX=$CXX -dnl fi - -else - PTHREAD_CXX="$CXX" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CXXFLAGS) -AC_SUBST(PTHREAD_CXX) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD diff --git a/m4/c++11.m4 b/m4/c++11.m4 deleted file mode 100644 index 42d38ad..0000000 --- a/m4/c++11.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl file : m4/cxx11.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl CXX11(MACRO, DESCRIPTION) -dnl -dnl Check if we are compiling in the C++11 mode. If we are, define MACRO as -dnl both a macro and conditional as well as set the cxx11 variable to 'yes'. -dnl -AC_DEFUN([CXX11], -[ -cxx11=no - -AC_MSG_CHECKING([whether we are in C++11 mode]) - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -int -main () -{ - std::shared_ptr p (new int (10)); - *p = 11; -} -])], -[cxx11=yes]) - -if test x"$cxx11" = xyes; then - AC_MSG_RESULT([yes]) - AC_DEFINE([$1], [1], [$2]) -else - AC_MSG_RESULT([no]) -fi - -AM_CONDITIONAL([$1], [test x$cxx11 = xyes]) - -])dnl diff --git a/m4/database.m4 b/m4/database.m4 deleted file mode 100644 index e74a826..0000000 --- a/m4/database.m4 +++ /dev/null @@ -1,59 +0,0 @@ -dnl file : m4/database.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl DATABASE -dnl -AC_DEFUN([DATABASE], [ -database=none - -AC_MSG_CHECKING([for database to use]) - -AC_ARG_WITH( - [database], - [AC_HELP_STRING([--with-database=DB], - [database to use for tests; valid values are: 'mysql', 'sqlite', 'pgsql', and 'oracle'])], - [case $withval in - no | yes) - AC_MSG_RESULT([]) - AC_MSG_ERROR([no database specified in the --with-database option]) - ;; - mysql) - database=mysql - AC_DEFINE([DATABASE_MYSQL], [1], [Using MySQL.]) - ;; - sqlite) - database=sqlite - AC_DEFINE([DATABASE_SQLITE], [1], [Using SQLite.]) - ;; - pgsql) - database=pgsql - AC_DEFINE([DATABASE_PGSQL], [1], [Using PostgreSQL.]) - ;; - oracle) - database=oracle - AC_DEFINE([DATABASE_ORACLE], [1], [Using Oracle.]) - ;; - mssql) - database=mssql - AC_DEFINE([DATABASE_MSSQL], [1], [Using SQL Server.]) - ;; - *) - AC_MSG_RESULT([]) - AC_MSG_ERROR([unknown database $withval]) - ;; - esac], - [ - AC_MSG_RESULT([]) - AC_MSG_ERROR([no database specified with the --with-database option]) - ]) - -AC_MSG_RESULT([$database]) -AC_SUBST([database]) - -AM_CONDITIONAL([DATABASE_MYSQL], [test x$database = xmysql]) -AM_CONDITIONAL([DATABASE_SQLITE], [test x$database = xsqlite]) -AM_CONDITIONAL([DATABASE_PGSQL], [test x$database = xpgsql]) -AM_CONDITIONAL([DATABASE_ORACLE], [test x$database = xoracle]) -AM_CONDITIONAL([DATABASE_MSSQL], [test x$database = xmssql]) - -])dnl diff --git a/m4/diff.m4 b/m4/diff.m4 deleted file mode 100644 index 44996fb..0000000 --- a/m4/diff.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl file : m4/diff.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl DIFF_TOOL -dnl -AC_DEFUN([DIFF_TOOL], [ -diff_found=no - -AC_ARG_VAR([DIFF],[diff command]) -AC_ARG_VAR([DIFFFLAGS],[diff flags]) - -AC_ARG_WITH( - [diff], - [AC_HELP_STRING([--with-diff=PATH],[path to the diff program])], - [diff_path=${withval}], - [diff_path=]) - -AC_MSG_CHECKING([for diff]) - -if test x"$DIFF" = x; then - if test x"$diff_path" != x; then - AS_SET_CATFILE([abs_diff_path], [$ac_pwd], [$diff_path]) - DIFF="$abs_diff_path" - else - DIFF=diff - fi -fi - -cat >conftest.txt - -$DIFF conftest.txt conftest.txt 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$DIFF]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([diff command is not found; consider setting the DIFF variable or using --with-diff=PATH]) -fi - -AC_MSG_CHECKING([whether $DIFF accepts -u]) - -$DIFF -u conftest.txt conftest.txt 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([yes]) - DIFFFLAGS="$DIFFFLAGS -u" -else - AC_MSG_RESULT([no]) -fi - -rm -f conftest.txt - -])dnl diff --git a/m4/libboost.m4 b/m4/libboost.m4 deleted file mode 100644 index 2223493..0000000 --- a/m4/libboost.m4 +++ /dev/null @@ -1,184 +0,0 @@ -dnl file : m4/libboost.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBBOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBBOOST], [ -libboost_found=no - -AC_MSG_CHECKING([for boost base headers]) - -AC_ARG_WITH( - [boost], - [AC_HELP_STRING([--with-boost=DIR],[location of boost build directory])], - [libboost_dir=${withval}], - [libboost_dir=]) - -# If libboost_dir was given, add the necessary preprocessor and linker flags. -# -if test x"$libboost_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libboost_dir], [$ac_pwd], [$libboost_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libboost_dir" - LDFLAGS="$LDFLAGS -L$abs_libboost_dir/stage/lib" -fi - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -#ifndef BOOST_VERSION -# error BOOST_VERSION not defined -#endif - -int -main () -{ -} -])], -[ -libboost_found=yes -]) - -if test x"$libboost_found" = xno; then - if test x"$libboost_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libboost_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl -dnl -dnl LIBBOOST_HEADER_LIB(NAME, SOURCE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -dnl -AC_DEFUN([LIBBOOST_HEADER_LIB], [ -libboost_$1_found=no - -AC_MSG_CHECKING([for boost $1 library]) -CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) - -if test x"$libboost_$1_found" = xyes; then - AC_MSG_RESULT([yes]) - [$3] -else - AC_MSG_RESULT([no]) - [$4] -fi -])dnl -dnl -dnl LIBBOOST_LIB(NAME, SOURCE, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) -dnl -AC_DEFUN([LIBBOOST_LIB], [ -libboost_$1_found=no - -AC_MSG_CHECKING([for boost $1 library]) - -save_LIBS="$LIBS" -LIBS="-lboost_$1 $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) - -# Try to fall back on the -mt version for backwards-compatibility. -# -if test x"$libboost_$1_found" = xno; then - LIBS="-lboost_$1-mt $save_LIBS" - CXX_LIBTOOL_LINK_IFELSE([$2],[libboost_$1_found=yes]) -fi - -if test x"$libboost_$1_found" = xno; then - LIBS="$save_LIBS" -fi - -if test x"$libboost_$1_found" = xyes; then - AC_MSG_RESULT([yes]) - [$3] -else - AC_MSG_RESULT([no]) - [$4] -fi -])dnl -dnl -dnl LIBBOOST_SMART_PTR([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([LIBBOOST_SMART_PTR], [ -LIBBOOST_HEADER_LIB([smart_ptr],[ -AC_LANG_SOURCE([ -#include -#include - -int -main () -{ - boost::shared_ptr sp (new int (10)); - boost::weak_ptr wp (sp); -} -])], -[$1], -[$2]) -])dnl -dnl -dnl LIBBOOST_UNORDERED([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([LIBBOOST_UNORDERED], [ -LIBBOOST_HEADER_LIB([unordered],[ -AC_LANG_SOURCE([ -#include -#include - -int -main () -{ - boost::unordered_set s; - boost::unordered_map m; - - s.insert (1); - return m.find (1) != m.end (); -} -])], -[$1], -[$2]) -])dnl -dnl -dnl LIBBOOST_SYSTEM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([LIBBOOST_SYSTEM], [ -LIBBOOST_LIB([system],[ -AC_LANG_SOURCE([ -int -main () -{ -} -])], -[$1], -[$2]) -])dnl -dnl -dnl LIBBOOST_DATE_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([LIBBOOST_DATE_TIME], [ -LIBBOOST_LIB([date_time],[ -AC_LANG_SOURCE([ -#include - -int -main () -{ - boost::gregorian::greg_month m (1); - const char* s (m.as_short_string ()); - return s == 0; -} -])], -[$1], -[$2]) -])dnl diff --git a/m4/libodb-boost.m4 b/m4/libodb-boost.m4 deleted file mode 100644 index 454bd90..0000000 --- a/m4/libodb-boost.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-boost.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_BOOST([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_BOOST], [ -libodb_boost_found=no - -AC_ARG_WITH( - [libodb-boost], - [AC_HELP_STRING([--with-libodb-boost=DIR],[location of libodb-boost build directory])], - [libodb_boost_dir=${withval}], - [libodb_boost_dir=]) - -AC_MSG_CHECKING([for libodb-boost]) - -# If libodb_boost_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_boost_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_boost_dir], [$ac_pwd], [$libodb_boost_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_boost_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_boost_dir/odb/boost" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-boost $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::boost::exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_boost_found=yes]) - -if test x"$libodb_boost_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_boost_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_boost_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-mssql.m4 b/m4/libodb-mssql.m4 deleted file mode 100644 index 7ab52d8..0000000 --- a/m4/libodb-mssql.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-mssql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_MSSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_MSSQL], [ -libodb_mssql_found=no - -AC_ARG_WITH( - [libodb-mssql], - [AC_HELP_STRING([--with-libodb-mssql=DIR],[location of libodb-mssql build directory])], - [libodb_mssql_dir=${withval}], - [libodb_mssql_dir=]) - -AC_MSG_CHECKING([for libodb-mssql]) - -# If libodb_mssql_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_mssql_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_mssql_dir], [$ac_pwd], [$libodb_mssql_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_mssql_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_mssql_dir/odb/mssql" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-mssql $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::mssql::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_mssql_found=yes]) - -if test x"$libodb_mssql_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_mssql_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_mssql_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-mysql.m4 b/m4/libodb-mysql.m4 deleted file mode 100644 index f0f6d1b..0000000 --- a/m4/libodb-mysql.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-mysql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_MYSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_MYSQL], [ -libodb_mysql_found=no - -AC_ARG_WITH( - [libodb-mysql], - [AC_HELP_STRING([--with-libodb-mysql=DIR],[location of libodb-mysql build directory])], - [libodb_mysql_dir=${withval}], - [libodb_mysql_dir=]) - -AC_MSG_CHECKING([for libodb-mysql]) - -# If libodb_mysql_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_mysql_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_mysql_dir], [$ac_pwd], [$libodb_mysql_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_mysql_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_mysql_dir/odb/mysql" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-mysql $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::mysql::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_mysql_found=yes]) - -if test x"$libodb_mysql_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_mysql_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_mysql_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-oracle.m4 b/m4/libodb-oracle.m4 deleted file mode 100644 index 10028ff..0000000 --- a/m4/libodb-oracle.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-oracle.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_ORACLE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_ORACLE], [ -libodb_oracle_found=no - -AC_ARG_WITH( - [libodb-oracle], - [AC_HELP_STRING([--with-libodb-oracle=DIR],[location of libodb-oracle build directory])], - [libodb_oracle_dir=${withval}], - [libodb_oracle_dir=]) - -AC_MSG_CHECKING([for libodb-oracle]) - -# If libodb_oracle_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_oracle_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_oracle_dir], [$ac_pwd], [$libodb_oracle_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_oracle_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_oracle_dir/odb/oracle" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-oracle $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::oracle::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_oracle_found=yes]) - -if test x"$libodb_oracle_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_oracle_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_oracle_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-pgsql.m4 b/m4/libodb-pgsql.m4 deleted file mode 100644 index cd6495d..0000000 --- a/m4/libodb-pgsql.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-pgsql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_PGSQL([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_PGSQL], [ -libodb_pgsql_found=no - -AC_ARG_WITH( - [libodb-pgsql], - [AC_HELP_STRING([--with-libodb-pgsql=DIR],[location of libodb-pgsql build directory])], - [libodb_pgsql_dir=${withval}], - [libodb_pgsql_dir=]) - -AC_MSG_CHECKING([for libodb-pgsql]) - -# If libodb_pgsql_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_pgsql_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_pgsql_dir], [$ac_pwd], [$libodb_pgsql_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_pgsql_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_pgsql_dir/odb/pgsql" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-pgsql $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::pgsql::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_pgsql_found=yes]) - -if test x"$libodb_pgsql_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_pgsql_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_pgsql_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-qt.m4 b/m4/libodb-qt.m4 deleted file mode 100644 index 76ebfb3..0000000 --- a/m4/libodb-qt.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-qt.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_QT([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_QT], [ -libodb_qt_found=no - -AC_ARG_WITH( - [libodb-qt], - [AC_HELP_STRING([--with-libodb-qt=DIR],[location of libodb-qt build directory])], - [libodb_qt_dir=${withval}], - [libodb_qt_dir=]) - -AC_MSG_CHECKING([for libodb-qt]) - -# If libodb_qt_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_qt_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_qt_dir], [$ac_pwd], [$libodb_qt_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_qt_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_qt_dir/odb/qt" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-qt $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::qt::exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_qt_found=yes]) - -if test x"$libodb_qt_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_qt_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_qt_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb-sqlite.m4 b/m4/libodb-sqlite.m4 deleted file mode 100644 index 46ea966..0000000 --- a/m4/libodb-sqlite.m4 +++ /dev/null @@ -1,82 +0,0 @@ -dnl file : m4/libodb-sqlite.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB_SQLITE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB_SQLITE], [ -libodb_sqlite_found=no - -AC_ARG_WITH( - [libodb-sqlite], - [AC_HELP_STRING([--with-libodb-sqlite=DIR],[location of libodb-sqlite build directory])], - [libodb_sqlite_dir=${withval}], - [libodb_sqlite_dir=]) - -AC_MSG_CHECKING([for libodb-sqlite]) - -# If libodb_sqlite_dir was given, add the necessary preprocessor and -# linker flags. -# -if test x"$libodb_sqlite_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_sqlite_dir], [$ac_pwd], [$libodb_sqlite_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_sqlite_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_sqlite_dir/odb/sqlite" -fi - -save_LIBS="$LIBS" -LIBS="-lodb-sqlite $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::sqlite::database_exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_sqlite_found=yes]) - -if test x"$libodb_sqlite_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_sqlite_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_sqlite_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libodb.m4 b/m4/libodb.m4 deleted file mode 100644 index 0dba7c4..0000000 --- a/m4/libodb.m4 +++ /dev/null @@ -1,81 +0,0 @@ -dnl file : m4/libodb.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl LIBODB([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBODB], [ -libodb_found=no - -AC_ARG_WITH( - [libodb], - [AC_HELP_STRING([--with-libodb=DIR],[location of libodb build directory])], - [libodb_dir=${withval}], - [libodb_dir=]) - -AC_MSG_CHECKING([for libodb]) - -# If libodb_dir was given, add the necessary preprocessor and linker flags. -# -if test x"$libodb_dir" != x; then - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - - AS_SET_CATFILE([abs_libodb_dir], [$ac_pwd], [$libodb_dir]) - - CPPFLAGS="$CPPFLAGS -I$abs_libodb_dir" - LDFLAGS="$LDFLAGS -L$abs_libodb_dir/odb" -fi - -save_LIBS="$LIBS" -LIBS="-lodb $LIBS" - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -void -f () -{ -} - -const char* -g () -{ - try - { - f (); - } - catch (const odb::exception& e) - { - return e.what (); - } - return 0; -} - -int -main () -{ - const char* m (g ()); - return m != 0; -} -])], -[libodb_found=yes]) - -if test x"$libodb_found" = xno; then - LIBS="$save_LIBS" - - if test x"$libodb_dir" != x; then - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - fi -fi - -if test x"$libodb_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libqt.m4 b/m4/libqt.m4 deleted file mode 100644 index c2be2e7..0000000 --- a/m4/libqt.m4 +++ /dev/null @@ -1,121 +0,0 @@ -dnl file : m4/libqt.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl -dnl LIBQTCORE_COMPILE() -dnl -AC_DEFUN([LIBQTCORE_COMPILE], [ -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -// See libodb-qt/odb/qt/details/config.hxx for more information on -// what's going on here. -// -# if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__) -# include // QT_REDUCE_RELOCATIONS -# ifdef QT_REDUCE_RELOCATIONS -# define __PIE__ -# endif -# endif -#include -#include - -int -main () -{ - QString qs ("test"); - std::string ss (qs.toStdString ()); - return ss.size () != 0; -} -])], -[libqt_found=yes]) -])dnl -dnl -dnl LIBQTCORE([ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]]) -dnl -dnl -AC_DEFUN([LIBQTCORE], [ -libqt_found=no - -# QtCore libraries and pkg-config names in the order we should try -# them. -# -libqt_lib_names="Qt5Core QtCore5 QtCore Qt4Core QtCore4" -libqt_pkg_names="Qt5Core QtCore" - -AC_PATH_PROG([pkg_config],[pkg-config]) - -AC_MSG_CHECKING([for QtCore]) - -# First check for QtCore using default CPPFLAGS/LDFLAGS/LIBS. This -# test allows the user to override the QtCore library name (e.g., -# QtCored4, Qt5Core) via the LIBS variable. -# -LIBQTCORE_COMPILE - -# Then check for QtCore using default CPPFLAGS/LDFLAGS. -# -if test x"$libqt_found" = xno; then - for lib in $libqt_lib_names; do - save_LIBS="$LIBS" - LIBS="-l$lib $LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - else - break - fi - done -fi - -# Try framework in case we are on Mac OS X. -# -if test x"$libqt_found" = xno; then - save_LIBS="$LIBS" - LIBS="-framework QtCore $LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - LIBS="$save_LIBS" - fi -fi - -# If default CPPFLAGS/LDFLAGS didn't work, try to discover -# them using pkg-config. -# -if test x"$libqt_found" = xno; then - if test x"$pkg_config" != x; then - for pkg in $libqt_pkg_names; do - if $pkg_config --exists $pkg; then - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - - CPPFLAGS=`$pkg_config --cflags $pkg` - LIBS=`$pkg_config --libs $pkg` - - CPPFLAGS="$CPPFLAGS $save_CPPFLAGS" - LIBS="$LIBS $save_LIBS" - - LIBQTCORE_COMPILE - - if test x"$libqt_found" = xno; then - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - else - break - fi - fi - done - fi -fi - -if test x"$libqt_found" = xyes; then - AC_MSG_RESULT([yes]) - $1 -else - AC_MSG_RESULT([no]) - $2 -fi -])dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 deleted file mode 100644 index 302639f..0000000 --- a/m4/libtool-link.m4 +++ /dev/null @@ -1,45 +0,0 @@ -dnl file : m4/libtool-link.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl -dnl CXX_LIBTOOL_LINK_IFELSE (input, [action-if-true], [action-if-false]) -dnl -dnl Similar to AC_LINK_IFELSE except it uses libtool to perform the -dnl linking and it does this using the C++ compiler. -dnl -AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[ -AC_LANG_SAVE -AC_LANG(C++) - -if test -d .libs; then - delete_libs_dir=no -else - delete_libs_dir=yes -fi - -AC_COMPILE_IFELSE([$1], -[ - ac_try='./libtool --tag=CXX --mode=link $CXX -no-install $CXXFLAGS $LDFLAGS -o conftest conftest.$OBJEXT $LIBS >&AS_MESSAGE_LOG_FD' - if _AC_DO_VAR(ac_try); then - libtool_link_ok=yes - else - libtool_link_ok=no - fi -], -[ - libtool_link_ok=no -]) - -if test x"$delete_libs_dir" = xyes; then - rm -rf .libs -fi - -if test x"$libtool_link_ok" = xyes; then -[$2] -: -else -[$3] -: -fi - -AC_LANG_RESTORE])dnl diff --git a/m4/mssql.m4 b/m4/mssql.m4 deleted file mode 100644 index 5debeb2..0000000 --- a/m4/mssql.m4 +++ /dev/null @@ -1,224 +0,0 @@ -dnl file : m4/mssql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl MSSQL -dnl -AC_DEFUN([MSSQL], [ - -# Client. -# -AC_MSG_CHECKING([for mssql client program]) -AC_ARG_WITH( - [mssql-client], - [AC_HELP_STRING([--with-mssql-client=PATH], [SQL Server client program path (sqlcmd by default)])], - [case $withval in - yes) - mssql_client=sqlcmd - ;; - no) - AC_MSG_RESULT([]) - AC_MSG_ERROR([need mssql client to run the tests]) - ;; - *) - mssql_client=$withval - ;; - esac], - [mssql_client=sqlcmd]) - -$mssql_client -? 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$mssql_client]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([mssql client is not found; consider using --with-mssql-client=PATH]) -fi - -# User. If 'no' is specified, then use Windows authentication. -# -AC_MSG_CHECKING([for mssql database user]) -AC_ARG_WITH( - [mssql-user], - [AC_HELP_STRING([--with-mssql-user=NAME], [SQL Server database user (odb_test by default)])], - [case $withval in - yes) - mssql_user=odb_test - mssql_user_set=yes - ;; - no) - mssql_user_set=no - ;; - *) - mssql_user=$withval - mssql_user_set=yes - ;; - esac], - [mssql_user=odb_test - mssql_user_set=yes]) - -if test x$mssql_user_set = xyes; then - AC_MSG_RESULT(['$mssql_user']) -else - AC_MSG_RESULT([none]) -fi - -# Password. Can be left unspecified if using Windows authentication. -# -AC_MSG_CHECKING([for mssql database password]) -AC_ARG_WITH( - [mssql-password], - [AC_HELP_STRING([--with-mssql-password=PASS], [SQL Server database password (odb_test by default)])], - [case $withval in - yes) - mssql_password=odb_test - mssql_password_set=yes - ;; - no) - mssql_password_set=no - ;; - *) - mssql_password=$withval - mssql_password_set=yes - ;; - esac], - [mssql_password_set=no]) - -if test x$mssql_password_set = xyes; then - AC_MSG_RESULT(['$mssql_password']) -elif test x$mssql_user = xodb_test; then - mssql_password=odb_test - mssql_password_set=yes - AC_MSG_RESULT(['$mssql_password']) -else - AC_MSG_RESULT([none]) - if test x$mssql_user_set = xyes; then - AC_MSG_ERROR([password not specified; SQL Server requires a password (--with-mssql-password=PASS)]) - fi -fi - -# Database. If not specified, use the user's default. -# -AC_MSG_CHECKING([for mssql database name]) -AC_ARG_WITH( - [mssql-db], - [AC_HELP_STRING([--with-mssql-db=NAME], [SQL Server database name (odb_test by default). Note that all data in this database WILL BE LOST!])], - [case $withval in - yes) - mssql_db=odb_test - mssql_db_set=yes - ;; - no) - mssql_db_set=no - ;; - *) - mssql_db=$withval - mssql_db_set=yes - ;; - esac], - [mssql_db=odb_test - mssql_db_set=yes]) - -if test x$mssql_db_set = xyes; then - AC_MSG_RESULT(['$mssql_db']) -else - AC_MSG_RESULT([default]) -fi - -# Server. -# -AC_MSG_CHECKING([for mssql instance address]) -AC_ARG_WITH( - [mssql-server], - [AC_HELP_STRING([--with-mssql-server=ADDR], [SQL Server instance address])], - [case $withval in - yes | no) - mssql_server_set=no - ;; - *) - mssql_server=$withval - mssql_server_set=yes - ;; - esac], - [mssql_server_set=no]) - -if test x$mssql_server_set = xyes; then - AC_MSG_RESULT(['$mssql_server']) -else - AC_MSG_RESULT([none]) - AC_MSG_ERROR([instance address not specified; SQL Server instance address is required (--with-mssql-server=ADDR)]) -fi - -# Driver. -# -AC_MSG_CHECKING([for mssql native client odbc driver]) -AC_ARG_WITH( - [mssql-driver], - [AC_HELP_STRING([--with-mssql-driver=NAME], [SQL Server Native Client ODBC driver (latest available by default)])], - [case $withval in - yes | no) - mssql_driver_set=no - ;; - *) - mssql_driver=$withval - mssql_driver_set=yes - ;; - esac], - [mssql_driver_set=no]) - -if test x$mssql_driver_set = xyes; then - AC_MSG_RESULT(['$mssql_driver']) -else - AC_MSG_RESULT([latest]) -fi - -# Create options file. -# -AC_CONFIG_COMMANDS([mssql.options], - [ - rm -f mssql.options - echo '#! /bin/sh' >mssql-driver - - echo 'opt=' >>mssql-driver - - if test x$mssql_user_set = xyes; then - echo "--user '$mssql_user'" >>mssql.options - echo 'opt="$opt -U '"$mssql_user"'"' >>mssql-driver - - echo "--password '$mssql_password'" >>mssql.options - echo 'opt="$opt -P '"$mssql_password"'"' >>mssql-driver - fi - - if test x$mssql_db_set = xyes; then - echo "--database '$mssql_db'" >>mssql.options - echo 'opt="$opt -d '"$mssql_db"'"' >>mssql-driver - fi - - echo "--server '$mssql_server'" >>mssql.options - echo 'opt="$opt -S '"$mssql_server"'"' >>mssql-driver - - if test x$mssql_driver_set = xyes; then - echo "--driver '$mssql_driver'" >>mssql.options - fi - - echo 'opt="$opt -x -r -b"' >>mssql-driver - echo 'if test x$[]1 != x; then' >>mssql-driver - echo " exec $mssql_client "'$opt -i $[]1' >>mssql-driver - echo "else" >>mssql-driver - echo " exec $mssql_client "'$opt' >>mssql-driver - echo "fi" >>mssql-driver - - chmod +x mssql-driver - ], - [ - mssql_client="$mssql_client" - mssql_user="$mssql_user" - mssql_user_set="$mssql_user_set" - mssql_password="$mssql_password" - mssql_db="$mssql_db" - mssql_db_set="$mssql_db_set" - mssql_server="$mssql_server" - mssql_driver="$mssql_driver" - mssql_driver_set="$mssql_driver_set" - ]) - -])dnl diff --git a/m4/mysql.m4 b/m4/mysql.m4 deleted file mode 100644 index 7564726..0000000 --- a/m4/mysql.m4 +++ /dev/null @@ -1,270 +0,0 @@ -dnl file : m4/mysql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl MYSQL -dnl -AC_DEFUN([MYSQL], [ - -# Client. -# -AC_MSG_CHECKING([for mysql client program]) -AC_ARG_WITH( - [mysql-client], - [AC_HELP_STRING([--with-mysql-client=PATH], [MySQL client program path (mysql by default)])], - [case $withval in - yes) - mysql_client=mysql - ;; - no) - AC_MSG_RESULT([]) - AC_MSG_ERROR([need mysql client to run the tests]) - ;; - *) - mysql_client=$withval - ;; - esac], - [mysql_client=mysql]) - -$mysql_client --version 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$mysql_client]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([mysql client is not found; consider using --with-mysql-client=PATH]) -fi - -# User. -# -AC_MSG_CHECKING([for mysql database user]) -AC_ARG_WITH( - [mysql-user], - [AC_HELP_STRING([--with-mysql-user=NAME], [MySQL database user (odb_test by default)])], - [case $withval in - yes) - mysql_user=odb_test - mysql_user_set=yes - ;; - no) - mysql_user_set=no - ;; - *) - mysql_user=$withval - mysql_user_set=yes - ;; - esac], - [mysql_user=odb_test - mysql_user_set=yes]) - -if test x$mysql_user_set = xyes; then - AC_MSG_RESULT(['$mysql_user']) -else - AC_MSG_RESULT([none]) -fi - -# Password. -# -AC_MSG_CHECKING([for mysql database password]) -AC_ARG_WITH( - [mysql-password], - [AC_HELP_STRING([--with-mysql-password=PASS], [MySQL database password (no password by default)])], - [case $withval in - yes) - mysql_password= - mysql_password_set=yes - ;; - no) - mysql_password_set=no - ;; - *) - mysql_password=$withval - mysql_password_set=yes - ;; - esac], - [mysql_password_set=no]) - -if test x$mysql_password_set = xyes; then - AC_MSG_RESULT(['$mysql_password']) -else - AC_MSG_RESULT([none]) -fi - -# Database name. -# -AC_MSG_CHECKING([for mysql database name]) -AC_ARG_WITH( - [mysql-db], - [AC_HELP_STRING([--with-mysql-db=NAME], [MySQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], - [case $withval in - yes) - mysql_db=odb_test - mysql_db_set=yes - ;; - no) - mysql_db_set=no - ;; - *) - mysql_db=$withval - mysql_db_set=yes - ;; - esac], - [mysql_db=odb_test - mysql_db_set=yes]) - -if test x$mysql_db_set = xyes; then - AC_MSG_RESULT(['$mysql_db']) -else - AC_MSG_RESULT([none]) -fi - -# Host. -# -AC_MSG_CHECKING([for mysql database host]) -AC_ARG_WITH( - [mysql-host], - [AC_HELP_STRING([--with-mysql-host=HOST], [MySQL database host (localhost by default)])], - [case $withval in - yes) - mysql_host=localhost - mysql_host_set=yes - ;; - no) - mysql_host_set=no - ;; - *) - mysql_host=$withval - mysql_host_set=yes - ;; - esac], - [mysql_host_set=no]) - -if test x$mysql_host_set = xyes; then - AC_MSG_RESULT(['$mysql_host']) -else - AC_MSG_RESULT([localhost]) -fi - -# Port. -# -AC_MSG_CHECKING([for mysql database port]) -AC_ARG_WITH( - [mysql-port], - [AC_HELP_STRING([--with-mysql-port=PORT], [MySQL database port (standard MySQL port by default)])], - [case $withval in - yes) - mysql_port=0 - mysql_port_set=yes - ;; - no) - mysql_port_set=no - ;; - *) - mysql_port=$withval - mysql_port_set=yes - ;; - esac], - [mysql_port_set=no]) - -if test x$mysql_port_set = xyes; then - AC_MSG_RESULT(['$mysql_port']) -else - AC_MSG_RESULT([default]) -fi - -# Socket. -# -AC_MSG_CHECKING([for mysql database socket]) -AC_ARG_WITH( - [mysql-socket], - [AC_HELP_STRING([--with-mysql-socket=SOCKET], [MySQL database socket (standard MySQL socket by default)])], - [case $withval in - yes) - mysql_socket= - mysql_socket_set=yes - ;; - no) - mysql_socket_set=no - ;; - *) - mysql_socket=$withval - mysql_socket_set=yes - ;; - esac], - [mysql_socket_set=no]) - -if test x$mysql_socket_set = xyes; then - AC_MSG_RESULT(['$mysql_socket']) -else - AC_MSG_RESULT([default]) -fi - -# Create options file. -# -AC_CONFIG_COMMANDS([mysql.options], - [ - rm -f mysql.options - echo '#! /bin/sh' >mysql-driver - - echo 'opt=' >>mysql-driver - - if test x$mysql_user_set = xyes; then - echo "--user '$mysql_user'" >>mysql.options - echo 'opt="$opt --user='"$mysql_user"'"' >>mysql-driver - fi - - if test x$mysql_password_set = xyes; then - echo "--password '$mysql_password'" >>mysql.options - echo 'opt="$opt --password='"$mysql_password"'"' >>mysql-driver - fi - - if test x$mysql_db_set = xyes; then - echo "--database '$mysql_db'" >>mysql.options - echo 'opt="$opt --database='"$mysql_db"'"' >>mysql-driver - fi - - if test x$mysql_host_set = xyes; then - echo "--host '$mysql_host'" >>mysql.options - echo 'opt="$opt --host='"$mysql_host"'"' >>mysql-driver - fi - - if test x$mysql_port_set = xyes; then - echo "--port '$mysql_port'" >>mysql.options - echo 'opt="$opt --port='"$mysql_port"'"' >>mysql-driver - fi - - if test x$mysql_socket_set = xyes; then - echo "--socket '$mysql_socket'" >>mysql.options - echo 'opt="$opt --socket='"$mysql_socket"'"' >>mysql-driver - fi - - echo 'if test x$[]1 != x; then' >>mysql-driver - echo " exec $mysql_client "'$opt <$[]1' >>mysql-driver - echo "else" >>mysql-driver - echo " exec $mysql_client "'$opt' >>mysql-driver - echo "fi" >>mysql-driver - - chmod +x mysql-driver - ], - [ - mysql_client="$mysql_client" - - mysql_user="$mysql_user" - mysql_user_set="$mysql_user_set" - - mysql_password="$mysql_password" - mysql_password_set="$mysql_password_set" - - mysql_db="$mysql_db" - mysql_db_set="$mysql_db_set" - - mysql_host="$mysql_host" - mysql_host_set="$mysql_host_set" - - mysql_port="$mysql_port" - mysql_port_set="$mysql_port_set" - - mysql_socket="$mysql_socket" - mysql_socket_set="$mysql_socket_set" - ]) - -])dnl diff --git a/m4/odb.m4 b/m4/odb.m4 deleted file mode 100644 index 3e1b19b..0000000 --- a/m4/odb.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl file : m4/odb.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl ODB_COMPILER([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([ODB_COMPILER], [ -odb_found=no - -AC_ARG_VAR([ODB],[ODB compiler command]) -AC_ARG_VAR([ODBFLAGS],[ODB compiler flags]) -AC_ARG_VAR([ODBCPPFLAGS],[ODB-specific C++ preprocessor flags]) - -AC_ARG_WITH( - [odb], - [AC_HELP_STRING([--with-odb=DIR],[location of odb compiler build directory])], - [odb_dir=${withval}], - [odb_dir=]) - -AC_MSG_CHECKING([for odb]) - -save_ODB="$ODB" - -if test x"$ODB" = x; then - if test x"$odb_dir" != x; then - AS_SET_CATFILE([abs_odb_dir], [$ac_pwd], [$odb_dir]) - ODB="$abs_odb_dir/odb/odb" - else - ODB=odb - fi -fi - -$ODB --version 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$ODB]) - $1 -else - AC_MSG_RESULT([no]) - ODB="$save_ODB" - $2 -fi - -])dnl diff --git a/m4/oracle.m4 b/m4/oracle.m4 deleted file mode 100644 index c095214..0000000 --- a/m4/oracle.m4 +++ /dev/null @@ -1,243 +0,0 @@ -dnl file : m4/oracle.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl ORACLE -dnl -AC_DEFUN([ORACLE], [ - -# Client. -# -AC_MSG_CHECKING([for oracle client program]) -AC_ARG_WITH( - [oracle-client], - [AC_HELP_STRING([--with-oracle-client=PATH], [Oracle client program path (sqlplus by default)])], - [case $withval in - yes) - oracle_client=sqlplus - ;; - no) - AC_MSG_RESULT([]) - AC_MSG_ERROR([need oracle client to run the tests]) - ;; - *) - oracle_client=$withval - ;; - esac], - [oracle_client=sqlplus]) - -$oracle_client -V 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$oracle_client]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([oracle client is not found; consider using --with-oracle-client=PATH]) -fi - -# User. -# -AC_MSG_CHECKING([for oracle database user]) -AC_ARG_WITH( - [oracle-user], - [AC_HELP_STRING([--with-oracle-user=NAME], [Oracle database user (odb_test by default)])], - [case $withval in - yes) - oracle_user=odb_test - oracle_user_set=yes - ;; - no) - oracle_user_set=no - ;; - *) - oracle_user=$withval - oracle_user_set=yes - ;; - esac], - [oracle_user=odb_test - oracle_user_set=yes]) - -if test x$oracle_user_set = xyes; then - AC_MSG_RESULT(['$oracle_user']) -else - AC_MSG_RESULT([none]) -fi - -# Password. -# -AC_MSG_CHECKING([for oracle database password]) -AC_ARG_WITH( - [oracle-password], - [AC_HELP_STRING([--with-oracle-password=PASS], [Oracle database password (odb_test by default)])], - [case $withval in - yes) - oracle_password=odb_test - oracle_password_set=yes - ;; - no) - oracle_password_set=no - ;; - *) - oracle_password=$withval - oracle_password_set=yes - ;; - esac], - [oracle_password_set=no]) - -if test x$oracle_password_set = xyes; then - AC_MSG_RESULT(['$oracle_password']) -elif test x$oracle_user = xodb_test; then - oracle_password=odb_test - oracle_password_set=yes - AC_MSG_RESULT(['$oracle_password']) -elif test x$oracle_user != x/; then - AC_MSG_RESULT([none]) - AC_MSG_ERROR([password not specified; Oracle requires a password (--with-oracle-password=PASS)]) -fi - -# Service name. -# -AC_MSG_CHECKING([for oracle service name]) -AC_ARG_WITH( - [oracle-service], - [AC_HELP_STRING([--with-oracle-service=NAME], [Oracle service name (default service if left empty). Note that all data associated with this user on this service WILL BE LOST!])], - [case $withval in - yes) - oracle_service= - oracle_service_set=yes - ;; - no) - oracle_service_set=no - ;; - *) - oracle_service=$withval - oracle_service_set=yes - ;; - esac], - [oracle_service_set=no]) - -if test x$oracle_service_set = xyes; then - AC_MSG_RESULT(['$oracle_service']) -else - AC_MSG_RESULT([default]) -fi - -# Host. -# -AC_MSG_CHECKING([for oracle database host]) -AC_ARG_WITH( - [oracle-host], - [AC_HELP_STRING([--with-oracle-host=HOST], [Oracle database host (localhost by default)])], - [case $withval in - yes) - oracle_host=localhost - oracle_host_set=yes - ;; - no) - oracle_host_set=no - ;; - *) - oracle_host=$withval - oracle_host_set=yes - ;; - esac], - [oracle_host_set=no]) - -if test x$oracle_host_set = xyes; then - AC_MSG_RESULT(['$oracle_host']) -else - AC_MSG_RESULT([localhost]) -fi - -# Port. -# -AC_MSG_CHECKING([for oracle database port]) -AC_ARG_WITH( - [oracle-port], - [AC_HELP_STRING([--with-oracle-port=PORT], [Oracle database port (standard Oracle port by default)])], - [case $withval in - yes) - oracle_port=1521 - oracle_port_set=yes - ;; - no) - oracle_port_set=no - ;; - *) - oracle_port=$withval - oracle_port_set=yes - ;; - esac], - [oracle_port_set=no]) - -if test x$oracle_port_set = xyes; then - AC_MSG_RESULT(['$oracle_port']) -else - AC_MSG_RESULT([default]) -fi - -# Create options file. -# -AC_CONFIG_COMMANDS([oracle.options], - [ - rm -f oracle.options - echo '#! /bin/sh' >oracle-driver - - echo 'conn_str=' >>oracle-driver - - if test x$oracle_user_set = xyes; then - echo "--user '$oracle_user'" >>oracle.options - echo 'conn_str="'"$oracle_user"'"' >>oracle-driver - fi - - if test x$oracle_password_set = xyes; then - echo "--password '$oracle_password'" >>oracle.options - echo 'conn_str="$conn_str/'"$oracle_password"'"' >>oracle-driver - fi - - if test x$oracle_host_set = xyes; then - echo "--host '$oracle_host'" >>oracle.options - echo 'conn_str="$conn_str@//'"$oracle_host"'"' >>oracle-driver - - if test x$oracle_port_set = xyes; then - echo "--port '$oracle_port'" >>oracle.options - echo 'conn_str="$conn_str:'"$oracle_port"'"' >>oracle-driver - fi - fi - - if test x$oracle_service != x; then - if test x$oracle_host_set = xno; then - echo 'conn_str="$conn_str@"' >>oracle-driver - fi - - echo "--service '$oracle_service'" >>oracle.options - echo 'conn_str="$conn_str/'"$oracle_service"'"' >>oracle-driver - fi - - echo 'if test x$[]1 != x; then' >>oracle-driver - echo " exec $oracle_client -L -S "'$conn_str @$[]1' >>oracle-driver - echo "else" >>oracle-driver - echo " exec $oracle_client -L -S "'$conn_str' >>oracle-driver - echo "fi" >>oracle-driver - - chmod +x oracle-driver - ], - [ - oracle_client="$oracle_client" - - oracle_user="$oracle_user" - oracle_user_set="$oracle_user_set" - - oracle_password="$oracle_password" - oracle_password_set="$oracle_password_set" - - oracle_service="$oracle_service" - oracle_service_set="$oracle_service_set" - - oracle_host="$oracle_host" - oracle_host_set="$oracle_host_set" - - oracle_port="$oracle_port" - oracle_port_set="$oracle_port_set" - ]) - -])dnl diff --git a/m4/pgsql.m4 b/m4/pgsql.m4 deleted file mode 100644 index eb29a62..0000000 --- a/m4/pgsql.m4 +++ /dev/null @@ -1,204 +0,0 @@ -dnl file : m4/pgsql.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl PGSQL -dnl -AC_DEFUN([PGSQL], [ - -# Client. -# -AC_MSG_CHECKING([for pgsql client program]) -AC_ARG_WITH( - [pgsql-client], - [AC_HELP_STRING([--with-pgsql-client=PATH], [PostgreSQL client program path (psql by default)])], - [case $withval in - yes) - pgsql_client=psql - ;; - no) - AC_MSG_RESULT([]) - AC_MSG_ERROR([need pgsql client to run the tests]) - ;; - *) - pgsql_client=$withval - ;; - esac], - [pgsql_client=psql]) - -$pgsql_client --version 2>/dev/null 1>&2 - -if test x"$?" = x0; then - AC_MSG_RESULT([$pgsql_client]) -else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([pgsql client is not found; consider using --with-pgsql-client=PATH]) -fi - -# User. -# -AC_MSG_CHECKING([for pgsql database user]) -AC_ARG_WITH( - [pgsql-user], - [AC_HELP_STRING([--with-pgsql-user=NAME], [PostgreSQL database user (odb_test by default). The user must be able to login without specifying a password.])], - [case $withval in - yes) - pgsql_user=odb_test - pgsql_user_set=yes - ;; - no) - pgsql_user_set=no - ;; - *) - pgsql_user=$withval - pgsql_user_set=yes - ;; - esac], - [pgsql_user=odb_test - pgsql_user_set=yes]) - -if test x$pgsql_user_set = xyes; then - AC_MSG_RESULT(['$pgsql_user']) -else - AC_MSG_RESULT([none]) -fi - -# Database name. -# -AC_MSG_CHECKING([for pgsql database name]) -AC_ARG_WITH( - [pgsql-db], - [AC_HELP_STRING([--with-pgsql-db=NAME], [PostgreSQL database name (odb_test by default). Note that all data in this database WILL BE LOST!])], - [case $withval in - yes) - pgsql_db=odb_test - pgsql_db_set=yes - ;; - no) - pgsql_db_set=no - ;; - *) - pgsql_db=$withval - pgsql_db_set=yes - ;; - esac], - [pgsql_db=odb_test - pgsql_db_set=yes]) - -if test x$pgsql_db_set = xyes; then - AC_MSG_RESULT(['$pgsql_db']) -else - AC_MSG_RESULT([none]) -fi - -# Host. -# -AC_MSG_CHECKING([for pgsql database host]) -AC_ARG_WITH( - [pgsql-host], - [AC_HELP_STRING([--with-pgsql-host=HOST], [PostgreSQL database host (local host by default)])], - [case $withval in - yes) - pgsql_host= - pgsql_host_set=yes - ;; - no) - pgsql_host_set=no - ;; - *) - pgsql_host=$withval - pgsql_host_set=yes - ;; - esac], - [pgsql_host_set=no]) - -if test x$pgsql_host_set = xyes; then - AC_MSG_RESULT(['$pgsql_host']) -else - AC_MSG_RESULT([localhost]) -fi - -# Port. -# -AC_MSG_CHECKING([for pgsql database port]) -AC_ARG_WITH( - [pgsql-port], - [AC_HELP_STRING([--with-pgsql-port=PORT], [PostgreSQL database port (standard PostgreSQL port by default)])], - [case $withval in - yes) - pgsql_port=0 - pgsql_port_set=yes - ;; - no) - pgsql_port_set=no - ;; - *) - pgsql_port=$withval - pgsql_port_set=yes - ;; - esac], - [pgsql_port_set=no]) - -if test x$pgsql_port_set = xyes; then - AC_MSG_RESULT(['$pgsql_port']) -else - AC_MSG_RESULT([default]) -fi - -# Create options file. -# -AC_CONFIG_COMMANDS([pgsql.options], - [ - rm -f pgsql.options - echo '#! /bin/sh' >pgsql-driver - - echo 'opt=' >>pgsql-driver - - if test x$pgsql_user_set = xyes; then - echo "--username '$pgsql_user'" >>pgsql.options - echo 'opt="$opt --username='"$pgsql_user"'"' >>pgsql-driver - fi - - if test x$pgsql_db_set = xyes; then - echo "--dbname '$pgsql_db'" >>pgsql.options - echo 'opt="$opt --dbname='"$pgsql_db"'"' >>pgsql-driver - fi - - if test x$pgsql_host_set = xyes; then - echo "--host '$pgsql_host'" >>pgsql.options - echo 'opt="$opt --host='"$pgsql_host"'"' >>pgsql-driver - fi - - if test x$pgsql_port_set = xyes; then - echo "--port '$pgsql_port'" >>pgsql.options - echo 'opt="$opt --port='"$pgsql_port"'"' >>pgsql-driver - fi - - echo 'opt="$opt --quiet"' >>pgsql-driver - echo 'PGOPTIONS=--client-min-messages=warning' >>pgsql-driver - echo 'export PGOPTIONS' >>pgsql-driver - - echo 'if test x$[]1 != x; then' >>pgsql-driver - echo " exec $pgsql_client "'$opt --set ON_ERROR_STOP=1 -f $[]1' >>pgsql-driver - echo "else" >>pgsql-driver - echo " exec $pgsql_client "'$opt' >>pgsql-driver - echo "fi" >>pgsql-driver - - chmod +x pgsql-driver - ], - [ - pgsql_client="$pgsql_client" - - pgsql_user="$pgsql_user" - pgsql_user_set="$pgsql_user_set" - - pgsql_db="$pgsql_db" - pgsql_db_set="$pgsql_db_set" - - pgsql_host="$pgsql_host" - pgsql_host_set="$pgsql_host_set" - - pgsql_port="$pgsql_port" - pgsql_port_set="$pgsql_port_set" - ]) - -])dnl diff --git a/m4/sqlite.m4 b/m4/sqlite.m4 deleted file mode 100644 index 7c1a53e..0000000 --- a/m4/sqlite.m4 +++ /dev/null @@ -1,59 +0,0 @@ -dnl file : m4/sqlite.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl SQLITE -dnl -AC_DEFUN([SQLITE], [ - -# Database file. -# -AC_MSG_CHECKING([for sqlite database file]) -AC_ARG_WITH( - [sqlite-db], - [AC_HELP_STRING([--with-sqlite-db=FILE], [SQLite database file (odb-test.db by default). Note that all data in this database WILL BE LOST!])], - [case $withval in - yes) - sqlite_db=odb-test.db - sqlite_db_set=yes - ;; - no) - sqlite_db_set=no - ;; - *) - sqlite_db=$withval - sqlite_db_set=yes - ;; - esac], - [sqlite_db=odb-test.db - sqlite_db_set=yes]) - -if test x$sqlite_db_set = xyes; then - - # Make it an absolute path unless it is one of the special values. - # - if test x$sqlite_db != x -a x$sqlite_db != x:memory:; then - AS_SET_CATFILE([abs_sqlite_db], [$ac_pwd], [$sqlite_db]) - sqlite_db=$abs_sqlite_db - fi - - AC_MSG_RESULT(['$sqlite_db']) -else - AC_MSG_RESULT([none]) -fi - -# Create options file. -# -AC_CONFIG_COMMANDS([sqlite.options], - [ - rm -f sqlite.options - - if test x$sqlite_db_set = xyes; then - echo "--database '$sqlite_db'" >>sqlite.options - fi - ], - [ - sqlite_db="$sqlite_db" - sqlite_db_set="$sqlite_db_set" - ]) - -])dnl diff --git a/m4/static-lib.m4 b/m4/static-lib.m4 deleted file mode 100644 index 5fb1c11..0000000 --- a/m4/static-lib.m4 +++ /dev/null @@ -1,17 +0,0 @@ -dnl file : m4/static-lib.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl STATIC_LIB(MACRO, DESCRIPTION) -dnl -dnl Define MACRO if we are on MinGW and are only building static library. -dnl -AC_DEFUN([STATIC_LIB], -[ -if test x$enable_shared = xno; then - case $host_os in - mingw*) - AC_DEFINE([$1], [1], [$2]) - ;; - esac -fi -])dnl diff --git a/m4/threads.m4 b/m4/threads.m4 deleted file mode 100644 index 6f2e25f..0000000 --- a/m4/threads.m4 +++ /dev/null @@ -1,68 +0,0 @@ -dnl file : m4/threads.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -AC_DEFUN([THREADS],[ - -threads_thread_keyword=no - -AC_ARG_ENABLE( - [threads], - AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), - [AS_IF([test x"$enableval" = xno], [threads=none], [threads=check])], - [threads=check]) - -# If thread support is not disabled by the user, figure out what we can use. -# -if test x$threads = xcheck; then - case $host_os in - windows* | mingw*) - case $host_os in - mingw*) - CXXFLAGS="$CXXFLAGS -mthreads" - ;; - esac - - # Newer versions of GCC can be configured to use either Win32 or POSIX - # threads. It appears that -mthreads should be used in both cases but - # if the model is POSIX then GCC will also link -lpthread by default. - # Use that fact to test which model we have. - # - AC_TRY_LINK([#include ], - [pthread_create(0,0,0,0);], - [threads=posix], - [threads=win32]) - ;; - *) - ACX_PTHREAD - - if test x$acx_pthread_ok = xyes; then - threads=posix - LIBS="$LIBS $PTHREAD_LIBS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - - # Check if we can use the __thread keyword. - # - AC_MSG_CHECKING([for __thread keyword]) - - CXX_LIBTOOL_LINK_IFELSE([ - AC_LANG_SOURCE([ - __thread int tls_var; - - int - main () - { - tls_var = 0; - } - ])], - [threads_thread_keyword=yes]) - - AC_MSG_RESULT([$threads_thread_keyword]) - fi - ;; - esac -fi - -if test x$threads = xcheck; then - AC_MSG_ERROR([thread support not available; use --disable-threads to force single-threaded mode]) -fi -])dnl diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 deleted file mode 100644 index a70f397..0000000 --- a/m4/tr1-memory.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl file : m4/tr1-memory.m4 -dnl license : GNU GPL v2; see accompanying LICENSE file -dnl -dnl TR1_MEMORY -dnl -dnl Check for TR1 availability. If successful, define HAVE_TR1_MEMORY -dnl as both a macro and conditional as well as set the tr1_memory variable -dnl to 'yes'. -dnl -AC_DEFUN([TR1_MEMORY], -[ -tr1_memory=no - -AC_MSG_CHECKING([for TR1 ]) - -CXX_LIBTOOL_LINK_IFELSE([ -AC_LANG_SOURCE([ -#include - -int -main () -{ - std::tr1::shared_ptr p (new int (10)); - *p = 11; -} -])], -[tr1_memory=yes]) - -if test x"$tr1_memory" = xyes; then - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_TR1_MEMORY], [1], [Have TR1 .]) -else - AC_MSG_RESULT([no]) -fi - -AM_CONDITIONAL([HAVE_TR1_MEMORY], [test x$tr1_memory = xyes]) - -])dnl diff --git a/makefile b/makefile deleted file mode 100644 index 509e74b..0000000 --- a/makefile +++ /dev/null @@ -1,51 +0,0 @@ -# file : makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make - -all_dirs := libcommon common evolution mysql sqlite pgsql oracle mssql boost qt -dirs := common boost qt - -# Evolution and database-specific tests are not run in the multi-database -# configuration. -# -ifneq ($(db_id),common) -dirs += evolution $(db_id) -endif - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) - -$(dist): data_dist := GPLv2 LICENSE README INSTALL version test.bat \ -tester.bat mysql-driver.bat mysql.options sqlite-driver.bat \ -sqlite.options pgsql-driver.bat pgsql.options oracle.options \ -oracle-driver.bat mssql.options mssql-driver.bat -$(dist): exec_dist := bootstrap tester.in -$(dist): export extra_dist := $(data_dist) $(exec_dist) build.bat -$(dist): export version = $(shell cat $(src_root)/version) - -$(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,libcommon/libcommon-mysql-vc10.sln,build.bat) - $(call meta-automake) - $(call meta-autoconf) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) - -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) -$(call include,$(bld_root)/meta/autoconf.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) -else -$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) -endif diff --git a/manifest b/manifest new file mode 100644 index 0000000..858baa7 --- /dev/null +++ b/manifest @@ -0,0 +1,48 @@ +: 1 +name: odb-tests +version: 2.5.0-b.26.z +project: odb +type: tests +language: c++ +summary: ODB compiler tests +license: GPL-2.0-only +description-file: README.md +url: https://www.codesynthesis.com/products/odb/ +doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml +src-url: https://git.codesynthesis.com/cgit/odb/odb/ +email: odb-users@codesynthesis.com ; Mailing list + +# @@ BUILD2 The odb dependency can only be built with GCC. However, shouldn't +# we test that the odb-generated mappings can be compiled by other +# compilers and properly run afterwards? +# +builds: default +builds: -( +windows -gcc ) ; Requires MinGW GCC. +builds: &gcc ; Requires GCC with plugin support enabled. +builds: &gcc-5+ ; Requires GCC 5 or later. +builds: -static ; Implementation uses plugins and requires -fPIC. + +depends: * build2 >= 0.16.0 +depends: * bpkg >= 0.16.0 + +depends: * odb [2.5.0-b.26.1 2.5.0-b.27) + +depends: libodb [2.5.0-b.26.1 2.5.0-b.27) +depends: libodb-mysql [2.5.0-b.26.1 2.5.0-b.27) ? ($mysql) +depends: libodb-sqlite [2.5.0-b.26.1 2.5.0-b.27) ? ($sqlite) +depends: libodb-pgsql [2.5.0-b.26.1 2.5.0-b.27) ? ($pgsql) +depends: libodb-oracle [2.5.0-b.26.1 2.5.0-b.27) ? ($oracle) +depends: libodb-mssql [2.5.0-b.26.1 2.5.0-b.27) ? ($mssql) + +# Reflect whether libodb-pgsql is likely to support bulk operations. This is +# normally the case on POSIX platforms if libodb-pgsql is linked against libpq +# of the version 14 or above. +# +depends: libpq >= 14.0.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=true | \ + libpq >= 7.4.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=false + +# @@ TODO/LATER: use an alternative to automatically detect whether we are +# using MySQL or MariaDB? But maybe we don't need to know? + +depends: mysql >= 5.0.3 ? ($mysql) +depends: psql >= 7.4.0 ? ($pgsql) diff --git a/mssql-driver.bat b/mssql-driver.bat deleted file mode 100644 index 174cbf0..0000000 --- a/mssql-driver.bat +++ /dev/null @@ -1,61 +0,0 @@ -@echo off -rem file : mssql-driver.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem mssql-driver.bat sql-file -rem -rem Run the mssql client on the SQL file specified. Adjust the -rem options below to match your SQL Server setup. -rem - -setlocal - -set "options=%MSSQL_OPTIONS%" - -rem User. -rem -set "options=%options% -U odb_test" - -rem Password. -rem -set "options=%options% -P odb_test" - -rem Database name. -rem -set "options=%options% -d odb_test" - -rem SQL Server instance address. -rem -rem set "options=%options% -S host\instance" -rem set "options=%options% -S tcp:host,port" - -rem Standard options. -rem -set "options=%options% -x -r -b" - -set "mssql=%MSSQL_CLIENT%" - -if "_%mssql%_" == "__" set "mssql=sqlcmd" - -if "_%1_" == "__" ( - echo no sql file specified - goto usage -) - -%mssql% %options% -i %1 - -if errorlevel 1 goto error -goto end - -:usage -echo. -echo usage: mssql-driver.bat sql-file -echo. - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/mssql.options b/mssql.options deleted file mode 100644 index 6e201e2..0000000 --- a/mssql.options +++ /dev/null @@ -1,10 +0,0 @@ -# Sample Microsoft SQL Server options file used to run the tests. Adjust to -# match your SQL Server setup. -# - ---user odb_test ---password odb_test ---database odb_test -# --server host\instance -# --server tcp:host,port -# --driver diff --git a/mssql/Makefile.am b/mssql/Makefile.am deleted file mode 100644 index 3df7091..0000000 --- a/mssql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : mssql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/mssql/custom/makefile b/mssql/custom/makefile deleted file mode 100644 index 5d8d5ae..0000000 --- a/mssql/custom/makefile +++ /dev/null @@ -1,111 +0,0 @@ -# file : mssql/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx traits.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ ---sql-interlude ":r $(src_base)/custom.sql" --table-prefix mssql_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx query.hxx -$(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) -$(dist): data_dist := test.std custom.sql -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/custom/test.std b/mssql/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mssql/database/makefile b/mssql/database/makefile deleted file mode 100644 index 58b9702..0000000 --- a/mssql/database/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : mssql/database/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/database/test.std b/mssql/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mssql/makefile b/mssql/makefile deleted file mode 100644 index 05f25f0..0000000 --- a/mssql/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# file : mssql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -custom \ -database \ -native \ -query \ -stored-proc \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := mssql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mssql/native/makefile b/mssql/native/makefile deleted file mode 100644 index ac27130..0000000 --- a/mssql/native/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : mssql/native/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/native/test.std b/mssql/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mssql/query/makefile b/mssql/query/makefile deleted file mode 100644 index 269a7f7..0000000 --- a/mssql/query/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : mssql/query/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --default-database \ -common --generate-schema --generate-query --mssql-server-version 9.0 \ ---table-prefix mssql_query_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/query/test.std b/mssql/query/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mssql/stored-proc/makefile b/mssql/stored-proc/makefile deleted file mode 100644 index c787dc0..0000000 --- a/mssql/stored-proc/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : mssql/stored-proc/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --default-database \ -common --generate-schema --generate-query --table-prefix mssql_stored_proc_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/stored-proc/test.std b/mssql/stored-proc/test.std deleted file mode 100644 index 6635bcc..0000000 --- a/mssql/stored-proc/test.std +++ /dev/null @@ -1,17 +0,0 @@ -1 a -2 b -3 c - -a -b - -1 3 - -4 d - -5 e - -123 6 - -123 7 - diff --git a/mssql/template/Makefile.am b/mssql/template/Makefile.am deleted file mode 100644 index 8db5c16..0000000 --- a/mssql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : mssql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) m4_patsubst(__value__(odb_options), __value__(src_base), $(srcdir)) $< -) diff --git a/mssql/template/makefile b/mssql/template/makefile deleted file mode 100644 index 18a665d..0000000 --- a/mssql/template/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : mssql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --default-database \ -common --generate-schema --table-prefix mssql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/template/test.std b/mssql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mssql/test.bat b/mssql/test.bat deleted file mode 100644 index 4da8fa5..0000000 --- a/mssql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : mssql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mssql %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/mssql/types/makefile b/mssql/types/makefile deleted file mode 100644 index 5b96d57..0000000 --- a/mssql/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : mssql/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --table-prefix mssql_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mssql/types/test.std b/mssql/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql-driver.bat b/mysql-driver.bat deleted file mode 100644 index 8dde6f9..0000000 --- a/mysql-driver.bat +++ /dev/null @@ -1,46 +0,0 @@ -@echo off -rem file : mysql-driver.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem mysql-driver.bat sql-file -rem -rem Run the mysql client on the SQL file specified. Adjust the -rem options below to match your MySQL setup. -rem - -setlocal - -set "options=%MYSQL_OPTIONS%" -set "options=%options% --user=odb_test" -set "options=%options% --database=odb_test" -rem set "options=%options% --password=" -rem set "options=%options% --host=" -rem set "options=%options% --port=" -rem set "options=%options% --socket=" - -set "mysql=%MYSQL_CLIENT%" - -if "_%mysql%_" == "__" set "mysql=mysql" - -if "_%1_" == "__" ( - echo no sql file specified - goto usage -) - -%mysql% %options% < %1 - -if errorlevel 1 goto error -goto end - -:usage -echo. -echo usage: mysql-driver.bat sql-file -echo. - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/mysql-schema.testscript b/mysql-schema.testscript new file mode 100644 index 0000000..dfa7852 --- /dev/null +++ b/mysql-schema.testscript @@ -0,0 +1,9 @@ +# file : mysql-schema.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the MySQL database schema creation canned command base. +# +create_schema_cmd = [cmdline] \ + $mysql_client_cmd 2>&1 | \ + sed -e "'"'s/^mysql: \[Warning\] Using a password on the command .*//'"'" | \ + sed -n -e "'"'s/(.+)/\1/p'"'" >&2 diff --git a/mysql.options b/mysql.options deleted file mode 100644 index fe79a7c..0000000 --- a/mysql.options +++ /dev/null @@ -1,10 +0,0 @@ -# Sample MySQL options file used to run the tests. Adjust to -# match your MySQL setup. -# - ---user odb_test ---database odb_test -# --password -# --host -# --port -# --socket diff --git a/mysql.testscript b/mysql.testscript new file mode 100644 index 0000000..e218ece --- /dev/null +++ b/mysql.testscript @@ -0,0 +1,12 @@ +# file : mysql.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the MySQL database schema creation canned command and setup the test +# driver command line for the subsequent tests. +# +.include mysql-schema.testscript + +schema_file = [path] $out_base/"$schema"($multi ? '-mysql' : '').sql +create_schema = [cmdline] cat "'""$schema_file""'" | $create_schema_cmd + +test.arguments += ($multi ? 'mysql' : ) $mysql_options diff --git a/mysql/Makefile.am b/mysql/Makefile.am deleted file mode 100644 index 05ffc60..0000000 --- a/mysql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : mysql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/custom/buildfile b/mysql/custom/buildfile new file mode 100644 index 0000000..4934e7c --- /dev/null +++ b/mysql/custom/buildfile @@ -0,0 +1,37 @@ +# file : mysql/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' \ + --hxx-prologue '#include "query.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx index e9cc7d9..526dbdc 100644 --- a/mysql/custom/driver.cxx +++ b/mysql/custom/driver.cxx @@ -4,18 +4,20 @@ // Test custom database type mapping in MySQL. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace mysql = odb::mysql; using namespace mysql; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); o.p = point (1.1111, 2222222222.2); @@ -48,7 +50,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -101,7 +103,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/mysql/custom/makefile b/mysql/custom/makefile deleted file mode 100644 index 575cfa6..0000000 --- a/mysql/custom/makefile +++ /dev/null @@ -1,110 +0,0 @@ -# file : mysql/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ ---table-prefix mysql_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx query.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx index aa0c9ed..2fa8f73 100644 --- a/mysql/custom/query.hxx +++ b/mysql/custom/query.hxx @@ -128,8 +128,8 @@ namespace odb public: query_column (const char* table, const char* column, const char* conv) : table_ (table), column_ (column), conversion_ (conv), - x_table_ ("X(" + std::string (table)), // @@ Not very clean. - y_table_ ("Y(" + std::string (table)), + x_table_ ("ST_X(" + std::string (table)), // @@ Not very clean. + y_table_ ("ST_Y(" + std::string (table)), s_column_ (std::string (column) + ")"), // X & Y column suffix. x (x_table_.c_str (), s_column_.c_str (), 0), y (y_table_.c_str (), s_column_.c_str (), 0) diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx index b6c2c86..82cc59d 100644 --- a/mysql/custom/test.hxx +++ b/mysql/custom/test.hxx @@ -13,8 +13,8 @@ // #pragma db map type("GEOMETRY") \ as("VARCHAR(256)") \ - to("GeomFromText((?))") \ - from("AsText((?))") + to("ST_GeomFromText((?))") \ + from("ST_AsText((?))") #pragma db value type("GEOMETRY") struct point diff --git a/mysql/custom/test.std b/mysql/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/custom/testscript b/mysql/custom/testscript new file mode 100644 index 0000000..9bc8839 --- /dev/null +++ b/mysql/custom/testscript @@ -0,0 +1,11 @@ +# file : mysql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx index 9c9ec93..5386d86 100644 --- a/mysql/custom/traits.hxx +++ b/mysql/custom/traits.hxx @@ -16,7 +16,7 @@ namespace odb { namespace mysql { - template <> + template <> class value_traits { public: @@ -79,7 +79,7 @@ namespace odb struct conversion { - static const char* to () {return "GeomFromText((?))";} + static const char* to () {return "ST_GeomFromText((?))";} }; }; } diff --git a/mysql/database/buildfile b/mysql/database/buildfile new file mode 100644 index 0000000..304034e --- /dev/null +++ b/mysql/database/buildfile @@ -0,0 +1,11 @@ +# file : mysql/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-mysql%lib{odb-mysql} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx index aebb251..525ee87 100644 --- a/mysql/database/driver.cxx +++ b/mysql/database/driver.cxx @@ -8,6 +8,9 @@ #include +#undef NDEBUG +#include + using std::string; namespace mysql = odb::mysql; using namespace mysql; diff --git a/mysql/database/makefile b/mysql/database/makefile deleted file mode 100644 index 746fc9e..0000000 --- a/mysql/database/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : mysql/database/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/database/test.std b/mysql/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/database/testscript b/mysql/database/testscript new file mode 100644 index 0000000..c2ff256 --- /dev/null +++ b/mysql/database/testscript @@ -0,0 +1,6 @@ +# file : mysql/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/mysql/index/buildfile b/mysql/index/buildfile new file mode 100644 index 0000000..9cadce3 --- /dev/null +++ b/mysql/index/buildfile @@ -0,0 +1,34 @@ +# file : mysql/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_index_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx index 99138d3..4d0b7ad 100644 --- a/mysql/index/driver.cxx +++ b/mysql/index/driver.cxx @@ -4,18 +4,20 @@ // Test MySQL index creation. See also the common test. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace mysql = odb::mysql; using namespace mysql; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { // This is just a schema creation test. // - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); { transaction t (db->begin ()); diff --git a/mysql/index/makefile b/mysql/index/makefile deleted file mode 100644 index 4bca75c..0000000 --- a/mysql/index/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : mysql/index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --default-database \ -common --generate-schema --table-prefix mysql_index_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/index/test.std b/mysql/index/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/index/testscript b/mysql/index/testscript new file mode 100644 index 0000000..26dfc4f --- /dev/null +++ b/mysql/index/testscript @@ -0,0 +1,11 @@ +# file : mysql/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/mysql/makefile b/mysql/makefile deleted file mode 100644 index a4b86a0..0000000 --- a/mysql/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# file : mysql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -custom \ -database \ -index \ -native \ -truncation \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := mysql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mysql/native/buildfile b/mysql/native/buildfile new file mode 100644 index 0000000..57c3c30 --- /dev/null +++ b/mysql/native/buildfile @@ -0,0 +1,16 @@ +# file : mysql/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx index 0a7dffb..9b34fd2 100644 --- a/mysql/native/driver.cxx +++ b/mysql/native/driver.cxx @@ -4,14 +4,16 @@ // Test native SQL execution. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include + +#undef NDEBUG +#include using namespace std; namespace mysql = odb::mysql; @@ -22,7 +24,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/mysql/native/makefile b/mysql/native/makefile deleted file mode 100644 index f3bf417..0000000 --- a/mysql/native/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : mysql/native/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/native/test.std b/mysql/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/native/testscript b/mysql/native/testscript new file mode 100644 index 0000000..21327ff --- /dev/null +++ b/mysql/native/testscript @@ -0,0 +1,9 @@ +# file : mysql/native/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + +: basics +: +$* diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am deleted file mode 100644 index 2568e1e..0000000 --- a/mysql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : mysql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx deleted file mode 100644 index 7034a95..0000000 --- a/mysql/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : mysql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/template/makefile b/mysql/template/makefile deleted file mode 100644 index 9ed17ca..0000000 --- a/mysql/template/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : mysql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --default-database \ -common --generate-schema --table-prefix mysql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj deleted file mode 100644 index 0da2efe..0000000 --- a/mysql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mysql/template/template-vc10.vcxproj.filters b/mysql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mysql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mysql/template/template-vc11.vcxproj b/mysql/template/template-vc11.vcxproj deleted file mode 100644 index 5fb45bb..0000000 --- a/mysql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mysql/template/template-vc11.vcxproj.filters b/mysql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mysql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mysql/template/template-vc12.vcxproj b/mysql/template/template-vc12.vcxproj deleted file mode 100644 index 32e2930..0000000 --- a/mysql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mysql/template/template-vc12.vcxproj.filters b/mysql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mysql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mysql/template/template-vc8.vcproj b/mysql/template/template-vc8.vcproj deleted file mode 100644 index afe88c4..0000000 --- a/mysql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj deleted file mode 100644 index 58e1a54..0000000 --- a/mysql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/mysql/template/test.hxx b/mysql/template/test.hxx deleted file mode 100644 index 5f16f63..0000000 --- a/mysql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : mysql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/mysql/template/test.std b/mysql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/test.bat b/mysql/test.bat deleted file mode 100644 index f9d3af0..0000000 --- a/mysql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : mysql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mysql %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/mysql/truncation/buildfile b/mysql/truncation/buildfile new file mode 100644 index 0000000..fbd936b --- /dev/null +++ b/mysql/truncation/buildfile @@ -0,0 +1,35 @@ +# file : mysql/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 9f044e6..21084f5 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -4,19 +4,21 @@ // Test insufficient buffer/truncation handling. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace mysql = odb::mysql; using namespace mysql; @@ -34,7 +36,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -72,7 +74,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == long_str); t.commit (); } @@ -90,7 +92,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == longer_str); t.commit (); } @@ -102,7 +104,7 @@ main (int argc, char* argv[]) typedef mysql::query query; typedef odb::result result; - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/query so that the initial bindings are established // (version == 0). @@ -157,7 +159,7 @@ main (int argc, char* argv[]) // Test containers. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Use different connections to persist and load the object. // @@ -175,7 +177,7 @@ main (int argc, char* argv[]) { transaction t (c2->begin ()); - auto_ptr p (db->load (1)); + unique_ptr p (db->load (1)); t.commit (); assert (p->vec_ == o.vec_); diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile deleted file mode 100644 index 358a136..0000000 --- a/mysql/truncation/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : mysql/truncation/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --default-database \ -common --generate-schema --generate-query --table-prefix mysql_truncation_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/truncation/test.std b/mysql/truncation/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/truncation/testscript b/mysql/truncation/testscript new file mode 100644 index 0000000..b9b6792 --- /dev/null +++ b/mysql/truncation/testscript @@ -0,0 +1,11 @@ +# file : mysql/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/mysql/types/buildfile b/mysql/types/buildfile new file mode 100644 index 0000000..112a81f --- /dev/null +++ b/mysql/types/buildfile @@ -0,0 +1,36 @@ +# file : mysql/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index 04c8ebf..2354b04 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -4,18 +4,20 @@ // Test MySQL type conversion. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace mysql = odb::mysql; using namespace mysql; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); mysql_version v; { @@ -124,7 +126,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -147,9 +149,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); t.commit (); assert (o1 == *p1); diff --git a/mysql/types/makefile b/mysql/types/makefile deleted file mode 100644 index 779f9b1..0000000 --- a/mysql/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : mysql/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --table-prefix mysql_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 12eb4e0..82f7496 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -7,7 +7,7 @@ #include #include #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::memcpy, std::str[n]cmp, std::strlen #include @@ -84,7 +84,7 @@ operator== (bitfield x, bitfield y) #pragma db value(bitfield) type ("BIT(4)") typedef std::set set; -typedef std::auto_ptr string_ptr; +typedef std::unique_ptr string_ptr; enum color {red, green, blue}; diff --git a/mysql/types/test.std b/mysql/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/mysql/types/testscript b/mysql/types/testscript new file mode 100644 index 0000000..2962d1c --- /dev/null +++ b/mysql/types/testscript @@ -0,0 +1,11 @@ +# file : mysql/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/oracle-driver.bat b/oracle-driver.bat deleted file mode 100644 index cf08e46..0000000 --- a/oracle-driver.bat +++ /dev/null @@ -1,42 +0,0 @@ -@echo off -rem file : oracle-driver.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem oracle-driver.bat sql-file -rem -rem Run the oracle client on the SQL file specified. Adjust the -rem options below to match your Oracle setup. -rem - -setlocal - -set "options=%ORACLE_OPTIONS% -L -S" -set "options=%options% odb_test/odb_test" -rem set "options=%options% odb_test/odb_test@//192.168.0.5:1521/xe" - -set "oracle=%ORACLE_CLIENT%" - -if "_%oracle%_" == "__" set "oracle=sqlplus" - -if "_%1_" == "__" ( - echo no sql file specified - goto usage -) - -%oracle% %options% @%1 - -if errorlevel 1 goto error -goto end - -:usage -echo. -echo usage: oracle-driver.bat sql-file -echo. - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/oracle.options b/oracle.options deleted file mode 100644 index f01413e..0000000 --- a/oracle.options +++ /dev/null @@ -1,9 +0,0 @@ -# Sample Oracle options file used to run the tests. Adjust to -# match your Oracle setup. -# - ---user odb_test ---password odb_test -# --host -# --port -# --service diff --git a/oracle/Makefile.am b/oracle/Makefile.am deleted file mode 100644 index e3f50e7..0000000 --- a/oracle/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : oracle/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/oracle/custom/makefile b/oracle/custom/makefile deleted file mode 100644 index 63e3a32..0000000 --- a/oracle/custom/makefile +++ /dev/null @@ -1,110 +0,0 @@ -# file : oracle/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --sql-interlude "@ $(src_base)/custom.sql" \ ---table-prefix oracle_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std custom.sql -$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/custom/test.std b/oracle/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/oracle/database/makefile b/oracle/database/makefile deleted file mode 100644 index 0554681..0000000 --- a/oracle/database/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : oracle/database/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/database/test.std b/oracle/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/oracle/makefile b/oracle/makefile deleted file mode 100644 index cb457a3..0000000 --- a/oracle/makefile +++ /dev/null @@ -1,39 +0,0 @@ -# file : oracle/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -custom \ -database \ -native \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := oracle -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/oracle/native/makefile b/oracle/native/makefile deleted file mode 100644 index 195fb62..0000000 --- a/oracle/native/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : oracle/native/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/native/test.std b/oracle/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/oracle/template/Makefile.am b/oracle/template/Makefile.am deleted file mode 100644 index b3b60e9..0000000 --- a/oracle/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : oracle/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) m4_patsubst(__value__(odb_options), __value__(src_base), $(srcdir)) $< -) diff --git a/oracle/template/makefile b/oracle/template/makefile deleted file mode 100644 index e2a64f7..0000000 --- a/oracle/template/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : oracle/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --default-database \ -common --generate-schema --table-prefix oracle_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/template/test.std b/oracle/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/oracle/test.bat b/oracle/test.bat deleted file mode 100644 index 5105054..0000000 --- a/oracle/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : oracle/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat oracle %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/oracle/types/makefile b/oracle/types/makefile deleted file mode 100644 index 5378617..0000000 --- a/oracle/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : oracle/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --table-prefix oracle_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/oracle/types/test.std b/oracle/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql-driver.bat b/pgsql-driver.bat deleted file mode 100644 index 5240bc5..0000000 --- a/pgsql-driver.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off -rem file : pgsql-driver.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem pgsql-driver.bat sql-file -rem -rem Run the pgsql client on the SQL file specified. Adjust the -rem options below to match your PostgreSQL setup. -rem - -setlocal - -set "options=%PGSQL_OPTIONS%" - -rem This user must be able to login without specifying a password. -rem -set "options=%options% --username=odb_test" - -set "options=%options% --dbname=odb_test" -rem set "options=%options% --host=" -rem set "options=%options% --port=" -set "options=%options% --quiet" -set "PGOPTIONS=--client-min-messages=warning" - -set "pgsql=%PGSQL_CLIENT%" - -if "_%pgsql%_" == "__" set "pgsql=psql" - -if "_%1_" == "__" ( - echo no sql file specified - goto usage -) - -%pgsql% %options% < %1 - -if errorlevel 1 goto error -goto end - -:usage -echo. -echo usage: pgsql-driver.bat sql-file -echo. - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/pgsql-schema.testscript b/pgsql-schema.testscript new file mode 100644 index 0000000..8659bcd --- /dev/null +++ b/pgsql-schema.testscript @@ -0,0 +1,6 @@ +# file : pgsql-schema.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the PostgreSQL database schema creation canned command base. +# +create_schema_cmd = [cmdline] $pgsql_client_cmd diff --git a/pgsql.options b/pgsql.options deleted file mode 100644 index 841de56..0000000 --- a/pgsql.options +++ /dev/null @@ -1,10 +0,0 @@ -# Sample PostgreSQL options file used to run the tests. Adjust to -# match your PostgreSQL setup. -# - -# This use must be able to login without specifying a password. -# ---user odb_test ---database odb_test -# --host -# --port diff --git a/pgsql.testscript b/pgsql.testscript new file mode 100644 index 0000000..e4b4636 --- /dev/null +++ b/pgsql.testscript @@ -0,0 +1,12 @@ +# file : pgsql.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the PostgreSQL database schema creation canned command and setup the +# test driver command line for the subsequent tests. +# +.include pgsql-schema.testscript + +schema_file = [path] $out_base/"$schema"($multi ? '-pgsql' : '').sql +create_schema = [cmdline] $create_schema_cmd -f $schema_file + +test.arguments += ($multi ? 'pgsql' : ) $pgsql_options diff --git a/pgsql/Makefile.am b/pgsql/Makefile.am deleted file mode 100644 index fcf14e8..0000000 --- a/pgsql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : pgsql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/pgsql/buildfile b/pgsql/buildfile new file mode 100644 index 0000000..c6385c0 --- /dev/null +++ b/pgsql/buildfile @@ -0,0 +1,6 @@ +# file : pgsql/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -bulk/} + +./: bulk/: include = ($pgsql && !$multi && $pgsql_bulk) diff --git a/pgsql/bulk/buildfile b/pgsql/bulk/buildfile new file mode 100644 index 0000000..6984edb --- /dev/null +++ b/pgsql/bulk/buildfile @@ -0,0 +1,40 @@ +# file : pgsql/bulk/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +if ($build.meta_operation != 'dist') +{ + assert ($pgsql && !$multi) \ + "pgsql should be configured via config.odb_tests.database variable as a single database" + + assert ($pgsql_bulk) "bulk operations are disabled for pgsql" +} + +import libodb = libodb%lib{odb} + +import libs = libpq%lib{pq} +import libs += libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_bulk_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/bulk/driver.cxx b/pgsql/bulk/driver.cxx index fd629b8..ba25542 100644 --- a/pgsql/bulk/driver.cxx +++ b/pgsql/bulk/driver.cxx @@ -1,4 +1,4 @@ -// file : pgsql/savepoint/driver.cxx +// file : pgsql/bulk/driver.cxx // license : GNU GPL v2; see accompanying LICENSE file // Test transaction savepoints. @@ -10,7 +10,6 @@ #include #include #include -#include #include // Note: hack. @@ -18,6 +17,9 @@ #include #define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) +#undef NDEBUG +#include + static const size_t columns = 3; struct data @@ -255,20 +257,22 @@ test (PGconn* conn) } } -#include // std::auto_ptr -#include -#include - #include +#include // std::unique_ptr +#include +#include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace pgsql = odb::pgsql; using namespace pgsql; @@ -276,9 +280,26 @@ using namespace pgsql; int main (int argc, char* argv[]) { + bool fail_already_persistent (false); + + for (int i (1); i != argc; ++i) + { + if (strcmp (argv[i], "--fail-already-persistent") == 0) + { + fail_already_persistent = true; + + for (; i != argc - 1; ++i) + argv[i] = argv[i + 1]; + + --argc; + + break; + } + } + try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); connection_ptr cn (db->connection ()); @@ -297,7 +318,7 @@ main (int argc, char* argv[]) { os.push_back (object {i, i, string (i, 'x')}); - if (i == n / 2) + if (fail_already_persistent && i == n / 2) os.push_back (object {i, i, to_string (i)}); } diff --git a/pgsql/bulk/makefile b/pgsql/bulk/makefile deleted file mode 100644 index 12f8dbb..0000000 --- a/pgsql/bulk/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : pgsql/savepoint/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --generate-schema \ ---generate-query --table-prefix pgsql_bulk_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/bulk/test.std b/pgsql/bulk/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/bulk/testscript b/pgsql/bulk/testscript new file mode 100644 index 0000000..60b7d92 --- /dev/null +++ b/pgsql/bulk/testscript @@ -0,0 +1,18 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +{ + $*; + + $* --fail-already-persistent 2>>EOE != 0 + multiple exceptions, 252 elements attempted, 1 failed, fatal: + [251] object already persistent + EOE +} diff --git a/pgsql/custom/buildfile b/pgsql/custom/buildfile new file mode 100644 index 0000000..a5c6717 --- /dev/null +++ b/pgsql/custom/buildfile @@ -0,0 +1,37 @@ +# file : pgsql/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' \ + --hxx-prologue '#include "query.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx index bc52674..91ff0ce 100644 --- a/pgsql/custom/driver.cxx +++ b/pgsql/custom/driver.cxx @@ -4,18 +4,20 @@ // Test custom database type mapping in PostgreSQL. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace pgsql = odb::pgsql; using namespace pgsql; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); o.p = point (1.1111, 2222222222.2); @@ -53,7 +55,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -109,7 +111,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/pgsql/custom/makefile b/pgsql/custom/makefile deleted file mode 100644 index 18f11e6..0000000 --- a/pgsql/custom/makefile +++ /dev/null @@ -1,110 +0,0 @@ -# file : pgsql/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --generate-query --hxx-prologue \ -'\#include "traits.hxx"' --hxx-prologue '\#include "query.hxx"' \ ---table-prefix pgsql_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx query.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/custom/test.std b/pgsql/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/custom/testscript b/pgsql/custom/testscript new file mode 100644 index 0000000..8e1448b --- /dev/null +++ b/pgsql/custom/testscript @@ -0,0 +1,11 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/pgsql/database/buildfile b/pgsql/database/buildfile new file mode 100644 index 0000000..6977ea6 --- /dev/null +++ b/pgsql/database/buildfile @@ -0,0 +1,11 @@ +# file : pgsql/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-pgsql%lib{odb-pgsql} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx index 5673caa..56bde0a 100644 --- a/pgsql/database/driver.cxx +++ b/pgsql/database/driver.cxx @@ -6,6 +6,9 @@ #include +#undef NDEBUG +#include + namespace pgsql = odb::pgsql; using namespace pgsql; diff --git a/pgsql/database/makefile b/pgsql/database/makefile deleted file mode 100644 index 2948467..0000000 --- a/pgsql/database/makefile +++ /dev/null @@ -1,79 +0,0 @@ -# file : pgsql/database/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/database/test.std b/pgsql/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/database/testscript b/pgsql/database/testscript new file mode 100644 index 0000000..f57a8e1 --- /dev/null +++ b/pgsql/database/testscript @@ -0,0 +1,6 @@ +# file : pgsql/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/pgsql/index/buildfile b/pgsql/index/buildfile new file mode 100644 index 0000000..a84ed9a --- /dev/null +++ b/pgsql/index/buildfile @@ -0,0 +1,34 @@ +# file : pgsql/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_index_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx index eb7de4b..dc4c11e 100644 --- a/pgsql/index/driver.cxx +++ b/pgsql/index/driver.cxx @@ -4,18 +4,20 @@ // Test PostgreSQL index creation. See also the common test. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace pgsql = odb::pgsql; using namespace pgsql; @@ -27,7 +29,7 @@ main (int argc, char* argv[]) { // This is just a schema creation test. // - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); { transaction t (db->begin ()); diff --git a/pgsql/index/makefile b/pgsql/index/makefile deleted file mode 100644 index 9db50ce..0000000 --- a/pgsql/index/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : pgsql/index/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --table-prefix pgsql_index_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/index/test.std b/pgsql/index/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/index/testscript b/pgsql/index/testscript new file mode 100644 index 0000000..671a8c3 --- /dev/null +++ b/pgsql/index/testscript @@ -0,0 +1,11 @@ +# file : pgsql/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/pgsql/makefile b/pgsql/makefile deleted file mode 100644 index 91520b2..0000000 --- a/pgsql/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# file : pgsql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -custom \ -database \ -index \ -native \ -truncation \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := pgsql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/pgsql/native/buildfile b/pgsql/native/buildfile new file mode 100644 index 0000000..ec4c80c --- /dev/null +++ b/pgsql/native/buildfile @@ -0,0 +1,16 @@ +# file : pgsql/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx index 2cea8dd..843db41 100644 --- a/pgsql/native/driver.cxx +++ b/pgsql/native/driver.cxx @@ -4,14 +4,16 @@ // Test PostgreSQL native SQL execution. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include + +#undef NDEBUG +#include using namespace std; namespace pgsql = odb::pgsql; @@ -22,7 +24,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Create the database schema. // diff --git a/pgsql/native/makefile b/pgsql/native/makefile deleted file mode 100644 index f82e0fc..0000000 --- a/pgsql/native/makefile +++ /dev/null @@ -1,79 +0,0 @@ -# file : pgsql/native/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) diff --git a/pgsql/native/test.std b/pgsql/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/native/testscript b/pgsql/native/testscript new file mode 100644 index 0000000..4fd9d2c --- /dev/null +++ b/pgsql/native/testscript @@ -0,0 +1,9 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + +: basics +: +$* diff --git a/pgsql/savepoint/driver.cxx b/pgsql/savepoint/driver.cxx deleted file mode 100644 index 7ac3df0..0000000 --- a/pgsql/savepoint/driver.cxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : pgsql/savepoint/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction savepoints. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - object o1 (1); - object o2 (2); - - transaction t (db->begin ()); - db->persist (o1); - - /* - try - { - db->persist (o1); - assert (false); - } - catch (const odb::object_already_persistent&) - { - } - */ - - //db->persist (o2); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/savepoint/makefile b/pgsql/savepoint/makefile deleted file mode 100644 index f2046f8..0000000 --- a/pgsql/savepoint/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : pgsql/savepoint/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --generate-query --table-prefix pgsql_savepoint_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/savepoint/test.hxx b/pgsql/savepoint/test.hxx deleted file mode 100644 index 7e01992..0000000 --- a/pgsql/savepoint/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : pgsql/savepoint/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object bulk(100) -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/pgsql/savepoint/test.std b/pgsql/savepoint/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/template/Makefile.am b/pgsql/template/Makefile.am deleted file mode 100644 index a9c40d3..0000000 --- a/pgsql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : pgsql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/pgsql/template/driver.cxx b/pgsql/template/driver.cxx deleted file mode 100644 index 98ce17a..0000000 --- a/pgsql/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : pgsql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/template/makefile b/pgsql/template/makefile deleted file mode 100644 index 70b23c3..0000000 --- a/pgsql/template/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : pgsql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --table-prefix pgsql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/template/template-vc10.vcxproj b/pgsql/template/template-vc10.vcxproj deleted file mode 100644 index 4bf096a..0000000 --- a/pgsql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/pgsql/template/template-vc10.vcxproj.filters b/pgsql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/pgsql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/pgsql/template/template-vc11.vcxproj b/pgsql/template/template-vc11.vcxproj deleted file mode 100644 index 9e7c682..0000000 --- a/pgsql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/pgsql/template/template-vc11.vcxproj.filters b/pgsql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/pgsql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/pgsql/template/template-vc12.vcxproj b/pgsql/template/template-vc12.vcxproj deleted file mode 100644 index 415dad4..0000000 --- a/pgsql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/pgsql/template/template-vc12.vcxproj.filters b/pgsql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/pgsql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/pgsql/template/template-vc8.vcproj b/pgsql/template/template-vc8.vcproj deleted file mode 100644 index 3b2bbc3..0000000 --- a/pgsql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/pgsql/template/template-vc9.vcproj b/pgsql/template/template-vc9.vcproj deleted file mode 100644 index 3a75a38..0000000 --- a/pgsql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/pgsql/template/test.hxx b/pgsql/template/test.hxx deleted file mode 100644 index 01670b1..0000000 --- a/pgsql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : pgsql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/pgsql/template/test.std b/pgsql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/test.bat b/pgsql/test.bat deleted file mode 100644 index 6b4dd61..0000000 --- a/pgsql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : pgsql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat pgsql %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/pgsql/truncation/buildfile b/pgsql/truncation/buildfile new file mode 100644 index 0000000..2f2f3a2 --- /dev/null +++ b/pgsql/truncation/buildfile @@ -0,0 +1,35 @@ +# file : pgsql/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx index 63135d4..337a26e 100644 --- a/pgsql/truncation/driver.cxx +++ b/pgsql/truncation/driver.cxx @@ -4,18 +4,20 @@ // Test insufficient buffer/truncation handling. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace pgsql = odb::pgsql; using namespace pgsql; @@ -33,7 +35,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -71,7 +73,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == long_str); t.commit (); } @@ -89,7 +91,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == longer_str); t.commit (); } @@ -101,7 +103,7 @@ main (int argc, char* argv[]) typedef pgsql::query query; typedef odb::result result; - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/query so that the initial bindings are established // (version == 0). diff --git a/pgsql/truncation/makefile b/pgsql/truncation/makefile deleted file mode 100644 index 9519291..0000000 --- a/pgsql/truncation/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : pgsql/truncation/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --generate-query --table-prefix pgsql_truncation_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/truncation/test.std b/pgsql/truncation/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/truncation/testscript b/pgsql/truncation/testscript new file mode 100644 index 0000000..c57b723 --- /dev/null +++ b/pgsql/truncation/testscript @@ -0,0 +1,11 @@ +# file : pgsql/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/pgsql/types/buildfile b/pgsql/types/buildfile new file mode 100644 index 0000000..64f0c02 --- /dev/null +++ b/pgsql/types/buildfile @@ -0,0 +1,36 @@ +# file : pgsql/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} +import libcommon = lib{common} +import libs = libodb-pgsql%lib{odb-pgsql} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb and libcommon +# libraries are resolved for the odb_compile ad hoc rule (see build/root.build +# for details). +# +libue{test-meta}: $libodb $libcommon + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --cxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index c2b54be..710f601 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -4,18 +4,20 @@ // Test PostgreSQL type conversion. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace pgsql = odb::pgsql; using namespace pgsql; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); @@ -79,7 +81,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -144,9 +146,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); t.commit (); assert (o1 == *p1); diff --git a/pgsql/types/makefile b/pgsql/types/makefile deleted file mode 100644 index c3321b7..0000000 --- a/pgsql/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : pgsql/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --default-database \ -common --generate-schema --generate-query --cxx-prologue \ -'\#include "traits.hxx"' --table-prefix pgsql_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index f44d73e..462ebad 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -7,13 +7,13 @@ #include #include #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen #include // std::size_t #include -#include +#include struct bitfield { @@ -71,7 +71,7 @@ operator== (const varbit& x, const varbit& y) #pragma db value(bitfield) type ("BIT(4)") -typedef std::auto_ptr string_ptr; +typedef std::unique_ptr string_ptr; enum color {red, green, blue}; diff --git a/pgsql/types/test.std b/pgsql/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/pgsql/types/testscript b/pgsql/types/testscript new file mode 100644 index 0000000..57218e1 --- /dev/null +++ b/pgsql/types/testscript @@ -0,0 +1,11 @@ +# file : pgsql/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/qt/Makefile.am b/qt/Makefile.am deleted file mode 100644 index 7edbd44..0000000 --- a/qt/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# file : qt/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = common - -if DATABASE_MYSQL -SUBDIRS += mysql -endif - -if DATABASE_SQLITE -SUBDIRS += sqlite -endif - -if DATABASE_PGSQL -SUBDIRS += pgsql -endif - -if DATABASE_ORACLE -SUBDIRS += oracle -endif - -if DATABASE_MSSQL -SUBDIRS += mssql -endif - -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/build.bat b/qt/build.bat deleted file mode 100644 index 97b9330..0000000 --- a/qt/build.bat +++ /dev/null @@ -1,129 +0,0 @@ -@echo off -rem file : qt/build.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Build Qt tests using the VC++ batch mode compilation. -rem -rem build.bat database qt-version vc-version conf plat [/Build|/Clean|/Rebuild] -rem -rem conf: {Debug,Release}|all -rem plat: {Win32,x64}|all -rem - -setlocal - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -if "_%2_" == "__" ( - echo no Qt version specified - goto usage -) - -if "_%3_" == "__" ( - echo no VC++ version specified - goto usage -) - -if "_%~4_" == "__" ( - echo no configuration specified - goto usage -) - -if "_%~5_" == "__" ( - echo no platform specified - goto usage -) - -set "failed=" - -if "_%2_" == "_4_" set "qtver=4" -if "_%2_" == "_5_" set "qtver=5" - -if "_%qtver%_" == "__" ( - echo unknown Qt version %2 - goto usage -) - -if "_%3_" == "_8_" set "vcver=8" -if "_%3_" == "_9_" set "vcver=9" -if "_%3_" == "_10_" set "vcver=10" -if "_%3_" == "_11_" set "vcver=11" -if "_%3_" == "_12_" set "vcver=12" - -if "_%vcver%_" == "__" ( - echo unknown VC++ version %3 - goto usage -) - -set "confs=%~4" -set "plats=%~5" - -if "_%confs%_" == "_all_" set "confs=Debug Release" -if "_%plats%_" == "_all_" set "plats=Win32 x64" - -set "action=%6" -if "_%action%_" == "__" set "action=/Build" - -set "devenv=%DEVENV%" -if "_%devenv%_" == "__" set "devenv=devenv.com" - -goto start - -rem -rem %1 - solution name -rem %2 - configuration to build -rem %3 - platform to build -rem -:run_build - echo. - echo building qt/%1 %3 %2 - "%devenv%" %1 %action% "%2|%3" 2>&1 - if errorlevel 1 set "failed=%failed% qt/%1\%3\%2" -goto :eof - -:start - -for %%d in (%1) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build %%d/qt-%%d-qt%qtver%-vc%vcver%.sln %%c %%p - ) - ) -) - -for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_build common/qt-common-qt%qtver%-%1-vc%vcver%.sln %%c %%p - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL BUILDS SUCCEEDED -echo. -goto end - -:usage -echo. -echo usage: build.bat database qt-version vc-version conf plat [action] -echo valid configurations are: {Debug,Release}|all -echo valid platforms are: {Win32,x64}|all -echo valid actions are: /Build (default), /Clean, and /Rebuild -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/qt/common/Makefile.am b/qt/common/Makefile.am deleted file mode 100644 index 0093f76..0000000 --- a/qt/common/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/common/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/common/basic/makefile b/qt/common/basic/makefile deleted file mode 100644 index 7b604a4..0000000 --- a/qt/common/basic/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : qt/common/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-query \ ---profile qt/basic --table-prefix qt_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) \ -$(call vc8projs,$(name)-qt4) \ -$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ -$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ -$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/basic/test.std b/qt/common/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/containers/basics/makefile b/qt/common/containers/basics/makefile deleted file mode 100644 index efc9da1..0000000 --- a/qt/common/containers/basics/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : qt/common/containers/basics/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile qt/containers --profile qt/basic --table-prefix qt_cont_bs_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) \ -$(call vc8projs,$(name)-qt4) \ -$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ -$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ -$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc12projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc12projs,../../template/template-qt5,$(name)-qt5) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/containers/basics/test.std b/qt/common/containers/basics/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/containers/change-tracking/makefile b/qt/common/containers/change-tracking/makefile deleted file mode 100644 index 13864c5..0000000 --- a/qt/common/containers/change-tracking/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : qt/common/containers/change-tracking/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile qt/containers --profile qt/basic --table-prefix qt_cont_ct_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) \ -$(call vc8projs,$(name)-qt4) \ -$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ -$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ -$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../../template/Makefile.am) - $(call meta-vc8projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc10projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc10projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc11projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc12projs,../../template/template-qt4,$(name)-qt4) - $(call meta-vc11projs,../../template/template-qt5,$(name)-qt5) - $(call meta-vc12projs,../../template/template-qt5,$(name)-qt5) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/containers/change-tracking/test.std b/qt/common/containers/change-tracking/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/makefile b/qt/common/makefile deleted file mode 100644 index 874b374..0000000 --- a/qt/common/makefile +++ /dev/null @@ -1,61 +0,0 @@ -# file : qt/common/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -containers/basics \ -containers/change-tracking \ -smart-ptr \ -template - -all_tests := $(tests) -build_tests := $(tests) - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(build_tests))) - -name := qt-common -$(dist): name := $(name) -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(call vc9slns,$(name)-qt4) \ -$(call vc9slns,$(name)-qt4) $(call vc9slns,$(name)-qt5) \ -$(call vc10slns,$(name)-qt4) $(call vc10slns,$(name)-qt5) \ -$(call vc11slns,$(name)-qt4) $(call vc11slns,$(name)-qt5) \ -$(call vc12slns,$(name)-qt4) $(call vc12slns,$(name)-qt5) -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_tests))) - $(call meta-automake) - $(call meta-vc8slns,$(name)-qt4,-qt4) - $(call meta-vc9slns,$(name)-qt4,-qt4) - $(call meta-vc9slns,$(name)-qt5,-qt5) - $(call meta-vc10slns,$(name)-qt4,-qt4) - $(call meta-vc10slns,$(name)-qt5,-qt5) - $(call meta-vc11slns,$(name)-qt4,-qt4) - $(call meta-vc11slns,$(name)-qt5,-qt5) - $(call meta-vc12slns,$(name)-qt4,-qt4) - $(call meta-vc12slns,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-mysql-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(build_tests))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(tests)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach t,$(all_tests),$(call import,$(src_base)/$t/makefile)) -else -$(foreach t,$(build_tests),$(call import,$(src_base)/$t/makefile)) -endif diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile deleted file mode 100644 index c678001..0000000 --- a/qt/common/smart-ptr/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : qt/common/smart-ptr/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -DQWEAKPOINTER_ENABLE_ARROW -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema --generate-session \ ---profile qt/smart-ptr --table-prefix qt_smart_ptr_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) \ -$(call vc8projs,$(name)-qt4) \ -$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ -$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ -$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/smart-ptr/test.std b/qt/common/smart-ptr/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/template/Makefile.am b/qt/common/template/Makefile.am deleted file mode 100644 index 75652f3..0000000 --- a/qt/common/template/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# file : qt/common/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< diff --git a/qt/common/template/makefile b/qt/common/template/makefile deleted file mode 100644 index afe6b53..0000000 --- a/qt/common/template/makefile +++ /dev/null @@ -1,134 +0,0 @@ -# file : qt/common/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --generate-schema \ ---profile qt/version --table-prefix qt_template_ #@@ CHANGE prefix, profile -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -ifneq ($(db_id),common) -$(gen): odb_options += --database $(db_id) -else -$(gen): odb_options += --multi-database dynamic -endif - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -name := $(subst /,-,$(subst $(src_root)/qt/common/,,$(src_base))) - -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(name) -$(dist): export extra_dist := $(data_dist) \ -$(call vc8projs,$(name)-qt4) \ -$(call vc9projs,$(name)-qt4) $(call vc9projs,$(name)-qt5) \ -$(call vc10projs,$(name)-qt4) $(call vc10projs,$(name)-qt5) \ -$(call vc11projs,$(name)-qt4) $(call vc11projs,$(name)-qt5) \ -$(call vc12projs,$(name)-qt4) $(call vc12projs,$(name)-qt5) -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc9projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc10projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc10projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc11projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc12projs,../template/template-qt4,$(name)-qt4) - $(call meta-vc11projs,../template/template-qt5,$(name)-qt5) - $(call meta-vc12projs,../template/template-qt5,$(name)-qt5) - -# Test. -# -ifneq ($(db_id),common) -$(eval $(call test-rule)) -else -$(foreach d,$(databases),$(eval $(call test-rule,$d))) -endif - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/common/template/test.std b/qt/common/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/common/test.bat b/qt/common/test.bat deleted file mode 100644 index 100628f..0000000 --- a/qt/common/test.bat +++ /dev/null @@ -1,79 +0,0 @@ -@echo off -rem file : qt/common/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem %4 - database -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 %4 %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 %1 - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:usage -echo. -echo usage: test.bat database -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/qt/makefile b/qt/makefile deleted file mode 100644 index 4575b34..0000000 --- a/qt/makefile +++ /dev/null @@ -1,38 +0,0 @@ -# file : qt/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -all_dirs := common mysql sqlite pgsql oracle mssql -dirs := common - -# Database-specific tests are not run in the multi-database configuration. -# -ifneq ($(db_id),common) -dirs += $(db_id) -endif - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) - -$(dist): export extra_dist := build.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(all_dirs))) - $(call meta-vctest,common/qt-common-qt4-mysql-vc10.sln,build.bat) - $(call meta-automake) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) - -ifeq ($(db_id),common) -$(foreach d,$(databases),$(eval $(call db-test-dir,$d,$(dirs)))) -endif - -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(all_dirs))) - -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -ifneq ($(filter $(MAKECMDGOALS),dist clean),) -$(foreach d,$(all_dirs),$(call import,$(src_base)/$d/makefile)) -else -$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) -endif diff --git a/qt/mssql/Makefile.am b/qt/mssql/Makefile.am deleted file mode 100644 index 3ac285b..0000000 --- a/qt/mssql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/mssql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mssql/basic/makefile b/qt/mssql/basic/makefile deleted file mode 100644 index c8f1725..0000000 --- a/qt/mssql/basic/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/mssql/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --profile qt/basic \ ---generate-schema --table-prefix qt_mssql_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mssql/basic/test.std b/qt/mssql/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mssql/date-time/makefile b/qt/mssql/date-time/makefile deleted file mode 100644 index ff52b50..0000000 --- a/qt/mssql/date-time/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/mssql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --profile qt/date-time \ ---generate-schema --table-prefix qt_mssql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mssql/date-time/test.std b/qt/mssql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mssql/makefile b/qt/mssql/makefile deleted file mode 100644 index 861cee6..0000000 --- a/qt/mssql/makefile +++ /dev/null @@ -1,46 +0,0 @@ -# file : qt/mssql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := qt-mssql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(name)-qt4-vc8.sln \ -$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ -$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ -$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt5,-qt5) - $(call meta-vc10sln1,$(name)-qt4,-qt4) - $(call meta-vc10sln1,$(name)-qt5,-qt5) - $(call meta-vc11sln1,$(name)-qt4,-qt4) - $(call meta-vc11sln1,$(name)-qt5,-qt5) - $(call meta-vc12sln1,$(name)-qt4,-qt4) - $(call meta-vc12sln1,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/mssql/template/Makefile.am b/qt/mssql/template/Makefile.am deleted file mode 100644 index df51831..0000000 --- a/qt/mssql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : qt/mssql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/qt/mssql/template/makefile b/qt/mssql/template/makefile deleted file mode 100644 index f53ed9f..0000000 --- a/qt/mssql/template/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : qt/mssql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -#Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mssql --profile qt \ ---generate-schema --table-prefix qt_mssql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mssql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mssql/template/test.std b/qt/mssql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mssql/test.bat b/qt/mssql/test.bat deleted file mode 100644 index 6e47030..0000000 --- a/qt/mssql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : qt/mssql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mssql %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/qt/mysql/Makefile.am b/qt/mysql/Makefile.am deleted file mode 100644 index 674dd40..0000000 --- a/qt/mysql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/mysql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/mysql/basic/makefile b/qt/mysql/basic/makefile deleted file mode 100644 index 93696ad..0000000 --- a/qt/mysql/basic/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/mysql/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --profile qt/basic \ ---generate-schema --table-prefix qt_mysql_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mysql/basic/test.std b/qt/mysql/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mysql/date-time/makefile b/qt/mysql/date-time/makefile deleted file mode 100644 index 1fe52fd..0000000 --- a/qt/mysql/date-time/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/mysql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --generate-schema \ ---generate-query --profile qt/date-time --table-prefix qt_mysql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mysql/date-time/test.std b/qt/mysql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mysql/makefile b/qt/mysql/makefile deleted file mode 100644 index ea036fa..0000000 --- a/qt/mysql/makefile +++ /dev/null @@ -1,46 +0,0 @@ -# file : qt/mysql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := qt-mysql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(name)-qt4-vc8.sln \ -$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ -$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ -$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt5,-qt5) - $(call meta-vc10sln1,$(name)-qt4,-qt4) - $(call meta-vc10sln1,$(name)-qt5,-qt5) - $(call meta-vc11sln1,$(name)-qt4,-qt4) - $(call meta-vc11sln1,$(name)-qt5,-qt5) - $(call meta-vc12sln1,$(name)-qt4,-qt4) - $(call meta-vc12sln1,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/mysql/template/Makefile.am b/qt/mysql/template/Makefile.am deleted file mode 100644 index 819fe92..0000000 --- a/qt/mysql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : qt/mysql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/qt/mysql/template/makefile b/qt/mysql/template/makefile deleted file mode 100644 index 267908f..0000000 --- a/qt/mysql/template/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : qt/mysql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -#Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database mysql --profile qt \ ---generate-schema --table-prefix qt_mysql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/mysql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/mysql/template/test.std b/qt/mysql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/mysql/test.bat b/qt/mysql/test.bat deleted file mode 100644 index e927529..0000000 --- a/qt/mysql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : qt/mysql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat mysql %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/qt/oracle/Makefile.am b/qt/oracle/Makefile.am deleted file mode 100644 index 2a46a58..0000000 --- a/qt/oracle/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/oracle/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/oracle/basic/makefile b/qt/oracle/basic/makefile deleted file mode 100644 index 32df442..0000000 --- a/qt/oracle/basic/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/oracle/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --profile qt/basic \ ---generate-schema --table-prefix qt_oracle_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/oracle/basic/test.std b/qt/oracle/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/oracle/date-time/makefile b/qt/oracle/date-time/makefile deleted file mode 100644 index f985090..0000000 --- a/qt/oracle/date-time/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/oracle/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --profile qt/date-time \ ---generate-schema --table-prefix qt_oracle_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/oracle/date-time/test.std b/qt/oracle/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/oracle/makefile b/qt/oracle/makefile deleted file mode 100644 index 8d99559..0000000 --- a/qt/oracle/makefile +++ /dev/null @@ -1,46 +0,0 @@ -# file : qt/oracle/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := qt-oracle -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(name)-qt4-vc8.sln \ -$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ -$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ -$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt5,-qt5) - $(call meta-vc10sln1,$(name)-qt4,-qt4) - $(call meta-vc10sln1,$(name)-qt5,-qt5) - $(call meta-vc11sln1,$(name)-qt4,-qt4) - $(call meta-vc11sln1,$(name)-qt5,-qt5) - $(call meta-vc12sln1,$(name)-qt4,-qt4) - $(call meta-vc12sln1,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/oracle/template/Makefile.am b/qt/oracle/template/Makefile.am deleted file mode 100644 index 27f30c7..0000000 --- a/qt/oracle/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : qt/oracle/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/qt/oracle/template/makefile b/qt/oracle/template/makefile deleted file mode 100644 index 89d2ced..0000000 --- a/qt/oracle/template/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : qt/oracle/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -#Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database oracle --profile qt \ ---generate-schema --table-prefix qt_oracle_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/oracle/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/oracle/template/test.std b/qt/oracle/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/oracle/test.bat b/qt/oracle/test.bat deleted file mode 100644 index 6a1fd48..0000000 --- a/qt/oracle/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : qt/oracle/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat oracle %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/qt/pgsql/Makefile.am b/qt/pgsql/Makefile.am deleted file mode 100644 index 98b1489..0000000 --- a/qt/pgsql/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/pgsql/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/pgsql/basic/makefile b/qt/pgsql/basic/makefile deleted file mode 100644 index df5ac74..0000000 --- a/qt/pgsql/basic/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/pgsql/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --profile qt/basic \ ---generate-schema --table-prefix qt_pgsql_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/pgsql/basic/test.std b/qt/pgsql/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/pgsql/date-time/makefile b/qt/pgsql/date-time/makefile deleted file mode 100644 index 20b5d10..0000000 --- a/qt/pgsql/date-time/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/pgsql/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --profile qt/date-time \ ---generate-schema --table-prefix qt_pgsql_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/pgsql/date-time/test.std b/qt/pgsql/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/pgsql/makefile b/qt/pgsql/makefile deleted file mode 100644 index 9c9ba58..0000000 --- a/qt/pgsql/makefile +++ /dev/null @@ -1,46 +0,0 @@ -# file : qt/pgsql/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := qt-pgsql -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(name)-qt4-vc8.sln \ -$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ -$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ -$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt5,-qt5) - $(call meta-vc10sln1,$(name)-qt4,-qt4) - $(call meta-vc10sln1,$(name)-qt5,-qt5) - $(call meta-vc11sln1,$(name)-qt4,-qt4) - $(call meta-vc11sln1,$(name)-qt5,-qt5) - $(call meta-vc12sln1,$(name)-qt4,-qt4) - $(call meta-vc12sln1,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/pgsql/template/Makefile.am b/qt/pgsql/template/Makefile.am deleted file mode 100644 index 470ecbf..0000000 --- a/qt/pgsql/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : qt/pgsql/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/qt/pgsql/template/makefile b/qt/pgsql/template/makefile deleted file mode 100644 index 22379c4..0000000 --- a/qt/pgsql/template/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : qt/pgsql/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -#Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database pgsql --profile qt \ ---generate-schema --table-prefix qt_pgsql_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/pgsql/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/pgsql/template/test.std b/qt/pgsql/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/pgsql/test.bat b/qt/pgsql/test.bat deleted file mode 100644 index 8f144f8..0000000 --- a/qt/pgsql/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : qt/pgsql/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat pgsql %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/qt/sqlite/Makefile.am b/qt/sqlite/Makefile.am deleted file mode 100644 index 0ddfc7d..0000000 --- a/qt/sqlite/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : qt/sqlite/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/qt/sqlite/basic/makefile b/qt/sqlite/basic/makefile deleted file mode 100644 index 3719c98..0000000 --- a/qt/sqlite/basic/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/sqlite/basic/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l:odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --profile qt/basic \ ---generate-schema --table-prefix qt_sqlite_basic_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/sqlite/basic/test.std b/qt/sqlite/basic/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/sqlite/date-time/makefile b/qt/sqlite/date-time/makefile deleted file mode 100644 index ec7c0ea..0000000 --- a/qt/sqlite/date-time/makefile +++ /dev/null @@ -1,125 +0,0 @@ -# file : qt/sqlite/date-time/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -$(call import,\ - $(scf_root)/import/libqt/core/stub.make,\ - l: qt_core.l,cpp-options: qt_core.l.cpp-options) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) $(odb_qt.l) $(qt_core.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --profile qt/date-time \ ---generate-schema --table-prefix qt_sqlite_dt_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ -$(qt_core.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)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/sqlite/date-time/test.std b/qt/sqlite/date-time/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/sqlite/makefile b/qt/sqlite/makefile deleted file mode 100644 index db8724c..0000000 --- a/qt/sqlite/makefile +++ /dev/null @@ -1,46 +0,0 @@ -# file : qt/sqlite/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -tests := \ -basic \ -date-time \ -template - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := qt-sqlite -$(dist): export dirs := $(tests) -$(dist): export extra_dist := test.bat \ -$(name)-qt4-vc8.sln \ -$(name)-qt4-vc9.sln $(name)-qt5-vc9.sln \ -$(name)-qt4-vc10.sln $(name)-qt5-vc10.sln \ -$(name)-qt4-vc11.sln $(name)-qt5-vc11.sln \ -$(name)-qt4-vc12.sln $(name)-qt5-vc12.sln -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt4,-qt4) - $(call meta-vc9sln1,$(name)-qt5,-qt5) - $(call meta-vc10sln1,$(name)-qt4,-qt4) - $(call meta-vc10sln1,$(name)-qt5,-qt5) - $(call meta-vc11sln1,$(name)-qt4,-qt4) - $(call meta-vc11sln1,$(name)-qt5,-qt5) - $(call meta-vc12sln1,$(name)-qt4,-qt4) - $(call meta-vc12sln1,$(name)-qt5,-qt5) - # Can't have Qt-version specific tests. - $(call meta-vctest,$(name)-qt4-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/qt/sqlite/template/Makefile.am b/qt/sqlite/template/Makefile.am deleted file mode 100644 index d28b0d3..0000000 --- a/qt/sqlite/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : qt/sqlite/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/qt/sqlite/template/makefile b/qt/sqlite/template/makefile deleted file mode 100644 index 480429f..0000000 --- a/qt/sqlite/template/makefile +++ /dev/null @@ -1,119 +0,0 @@ -# file : qt/sqlite/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -$(call import,\ - $(scf_root)/import/libodb-qt/stub.make,\ - l: odb_qt.l,cpp-options: odb_qt.l.cpp-options) - -#Build. -# -$(driver): $(cxx_obj) $(odb_qt.l) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(odb_qt.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --profile qt \ ---generate-schema --table-prefix qt_sqlite_template_ #@@ CHANGE THIS -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) $(odb_qt.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)/qt/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-qt4-vc8.vcproj \ -$(name)-qt4-vc9.vcproj $(name)-qt5-vc9.vcproj \ -$(name)-qt4-vc10.vcxproj $(name)-qt4-vc10.vcxproj.filters \ -$(name)-qt5-vc10.vcxproj $(name)-qt5-vc10.vcxproj.filters \ -$(name)-qt4-vc11.vcxproj $(name)-qt4-vc11.vcxproj.filters \ -$(name)-qt5-vc11.vcxproj $(name)-qt5-vc11.vcxproj.filters \ -$(name)-qt4-vc12.vcxproj $(name)-qt4-vc12.vcxproj.filters \ -$(name)-qt5-vc12.vcxproj $(name)-qt5-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-qt4-vc8.vcproj,$(name)-qt4-vc8.vcproj) - $(call meta-vc9proj,../template/template-qt4-vc9.vcproj,$(name)-qt4-vc9.vcproj) - $(call meta-vc9proj,../template/template-qt5-vc9.vcproj,$(name)-qt5-vc9.vcproj) - $(call meta-vc10proj,../template/template-qt4-vc10.vcxproj,$(name)-qt4-vc10.vcxproj) - $(call meta-vc10proj,../template/template-qt5-vc10.vcxproj,$(name)-qt5-vc10.vcxproj) - $(call meta-vc11proj,../template/template-qt4-vc11.vcxproj,$(name)-qt4-vc11.vcxproj) - $(call meta-vc11proj,../template/template-qt5-vc11.vcxproj,$(name)-qt5-vc11.vcxproj) - $(call meta-vc12proj,../template/template-qt4-vc12.vcxproj,$(name)-qt4-vc12.vcxproj) - $(call meta-vc12proj,../template/template-qt5-vc12.vcxproj,$(name)-qt5-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/qt/sqlite/template/test.std b/qt/sqlite/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/qt/sqlite/test.bat b/qt/sqlite/test.bat deleted file mode 100644 index 80e0f03..0000000 --- a/qt/sqlite/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : qt/sqlite/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\..\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 - if errorlevel 1 ( - set "failed=%failed% %1\%3\%2" - ) - ) - - cd %curdir% -goto :eof - -:start - -for %%t in (%tests%) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_test %%t %%c %%p - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/repositories.manifest b/repositories.manifest new file mode 100644 index 0000000..a5b9faa --- /dev/null +++ b/repositories.manifest @@ -0,0 +1,44 @@ +: 1 +summary: ODB test suite repository + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb-mysql.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb-sqlite.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb-pgsql.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb-oracle.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/libodb-mssql.git##HEAD + +: +role: prerequisite +location: https://git.codesynthesis.com/odb/odb.git##HEAD + +# @@ TMP Uncomment when mysql package is added to mysql.git repository. +# +#: +#role: prerequisite +#location: https://git.build2.org/packaging/mysql/mysql.git##HEAD + +: +role: prerequisite +location: https://git.build2.org/packaging/sqlite/sqlite.git##HEAD + +: +role: prerequisite +location: https://git.build2.org/packaging/postgresql/postgresql.git##HEAD diff --git a/sqlite-driver.bat b/sqlite-driver.bat deleted file mode 100644 index c5f1187..0000000 --- a/sqlite-driver.bat +++ /dev/null @@ -1,2 +0,0 @@ -rem Client driver is not used for SQLite so you don't need to -rem change anything here. diff --git a/sqlite.options b/sqlite.options deleted file mode 100644 index 208a7d7..0000000 --- a/sqlite.options +++ /dev/null @@ -1,5 +0,0 @@ -# Sample SQLite options file used to run the tests. Adjust to -# match your SQLite setup. -# - ---database C:\Temp\odb_test.db diff --git a/sqlite.testscript b/sqlite.testscript new file mode 100644 index 0000000..986bb37 --- /dev/null +++ b/sqlite.testscript @@ -0,0 +1,10 @@ +# file : sqlite.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Setup the test driver command line for the subsequent SQLite tests. +# +# Note that for SQLite the schema is created implicitly by the database object +# creation function called by the test driver. +# +test.arguments += ($multi ? 'sqlite' : ) $sqlite_options +test.cleanups += &odb-test.db # See database-options.testscript for details. diff --git a/sqlite/Makefile.am b/sqlite/Makefile.am deleted file mode 100644 index 998e823..0000000 --- a/sqlite/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# file : sqlite/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -SUBDIRS = __path__(dirs) -EXTRA_DIST = __file__(extra_dist) diff --git a/sqlite/attach/buildfile b/sqlite/attach/buildfile new file mode 100644 index 0000000..959f050 --- /dev/null +++ b/sqlite/attach/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/attach/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_attach_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --schema main + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/attach/driver.cxx b/sqlite/attach/driver.cxx index 8d0672f..25d279f 100644 --- a/sqlite/attach/driver.cxx +++ b/sqlite/attach/driver.cxx @@ -4,8 +4,7 @@ // Test attached database support. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -14,11 +13,14 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -28,7 +30,7 @@ main (int argc, char* argv[]) { try { - auto_ptr mdb (create_specific_database (argc, argv)); + unique_ptr mdb (create_specific_database (argc, argv)); { object o ("one"); @@ -58,7 +60,7 @@ main (int argc, char* argv[]) { transaction t (c->begin ()); - auto_ptr p (adb.load (o.id)); + unique_ptr p (adb.load (o.id)); t.commit (); assert (p->str == o.str); @@ -76,7 +78,7 @@ main (int argc, char* argv[]) typedef sqlite::query query; transaction t (c->begin ()); - auto_ptr p (adb.query_one (query::str == "two")); + unique_ptr p (adb.query_one (query::str == "two")); t.commit (); assert (p->str == o.str); @@ -90,7 +92,7 @@ main (int argc, char* argv[]) { transaction t (c->begin ()); - auto_ptr p (mdb->load (o.id)); + unique_ptr p (mdb->load (o.id)); t.commit (); assert (p.get () != 0); diff --git a/sqlite/attach/makefile b/sqlite/attach/makefile deleted file mode 100644 index 1ae325d..0000000 --- a/sqlite/attach/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/attach/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_attach_ \ ---schema main -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/attach/test.std b/sqlite/attach/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/attach/testscript b/sqlite/attach/testscript new file mode 100644 index 0000000..db5089d --- /dev/null +++ b/sqlite/attach/testscript @@ -0,0 +1,9 @@ +# file : sqlite/attach/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/auto/buildfile b/sqlite/auto/buildfile new file mode 100644 index 0000000..2c70b7c --- /dev/null +++ b/sqlite/auto/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/auto/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_auto_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --sqlite-lax-auto-id + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx index 4ac29b3..bcd42c1 100644 --- a/sqlite/auto/driver.cxx +++ b/sqlite/auto/driver.cxx @@ -4,18 +4,20 @@ // Test manual/automatic id assignment. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // object // @@ -55,9 +57,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (id1)); - auto_ptr o2 (db->load (id2)); - auto_ptr o3 (db->load (id3)); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + unique_ptr o3 (db->load (id3)); t.commit (); assert (*o1->id_ == id1 && o1->str_ == "one"); diff --git a/sqlite/auto/makefile b/sqlite/auto/makefile deleted file mode 100644 index 6da7071..0000000 --- a/sqlite/auto/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/auto/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_auto_ \ ---sqlite-lax-auto-id -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/auto/test.std b/sqlite/auto/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/auto/testscript b/sqlite/auto/testscript new file mode 100644 index 0000000..a5a7da5 --- /dev/null +++ b/sqlite/auto/testscript @@ -0,0 +1,9 @@ +# file : sqlite/auto/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/custom/buildfile b/sqlite/custom/buildfile new file mode 100644 index 0000000..3325762 --- /dev/null +++ b/sqlite/custom/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx index b53c0f6..0627708 100644 --- a/sqlite/custom/driver.cxx +++ b/sqlite/custom/driver.cxx @@ -4,18 +4,20 @@ // Test custom database type mapping in SQLite. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); o.nv.push_back ("123"); // INTEGER @@ -44,7 +46,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -62,7 +64,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); diff --git a/sqlite/custom/makefile b/sqlite/custom/makefile deleted file mode 100644 index 39f1c76..0000000 --- a/sqlite/custom/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/custom/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --table-prefix sqlitex_custom_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/custom/test.std b/sqlite/custom/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/custom/testscript b/sqlite/custom/testscript new file mode 100644 index 0000000..53561ae --- /dev/null +++ b/sqlite/custom/testscript @@ -0,0 +1,9 @@ +# file : sqlite/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/database/buildfile b/sqlite/database/buildfile new file mode 100644 index 0000000..e74ab1a --- /dev/null +++ b/sqlite/database/buildfile @@ -0,0 +1,11 @@ +# file : sqlite/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx index d0fe198..5e16653 100644 --- a/sqlite/database/driver.cxx +++ b/sqlite/database/driver.cxx @@ -4,10 +4,11 @@ // Test that database constructors are unambiguous and some other things. // -#include - #include +#undef NDEBUG +#include + namespace sqlite = odb::sqlite; using namespace sqlite; diff --git a/sqlite/database/makefile b/sqlite/database/makefile deleted file mode 100644 index 4a2a5ef..0000000 --- a/sqlite/database/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : sqlite/database/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/database/test.std b/sqlite/database/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/database/testscript b/sqlite/database/testscript new file mode 100644 index 0000000..b9c0f5f --- /dev/null +++ b/sqlite/database/testscript @@ -0,0 +1,6 @@ +# file : sqlite/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/sqlite/makefile b/sqlite/makefile deleted file mode 100644 index a80d464..0000000 --- a/sqlite/makefile +++ /dev/null @@ -1,44 +0,0 @@ -# file : sqlite/makefile -# license : GNU GPL; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make - -tests := \ -template \ -attach \ -auto \ -custom \ -database \ -native \ -stream \ -transaction \ -truncation \ -types - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) - -$(dist): name := sqlite -$(dist): export dirs := $(tests) -$(dist): export extra_dist := $(name)-vc8.sln $(name)-vc9.sln \ -$(name)-vc10.sln $(name)-vc11.sln $(name)-vc12.sln test.bat -$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) - $(call meta-automake) - $(call meta-vc8sln1,$(name)) - $(call meta-vc9sln1,$(name)) - $(call meta-vc10sln1,$(name)) - $(call meta-vc11sln1,$(name)) - $(call meta-vc12sln1,$(name)) - $(call meta-vctest,$(name)-vc10.sln,test.bat) - -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(call include,$(bld_root)/meta/vc8sln.make) -$(call include,$(bld_root)/meta/vc9sln.make) -$(call include,$(bld_root)/meta/vc10sln.make) -$(call include,$(bld_root)/meta/vc11sln.make) -$(call include,$(bld_root)/meta/vc12sln.make) -$(call include,$(bld_root)/meta/vctest.make) -$(call include,$(bld_root)/meta/automake.make) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/sqlite/native/buildfile b/sqlite/native/buildfile new file mode 100644 index 0000000..49aa05b --- /dev/null +++ b/sqlite/native/buildfile @@ -0,0 +1,12 @@ +# file : sqlite/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx index 10a6b05..c87aa5d 100644 --- a/sqlite/native/driver.cxx +++ b/sqlite/native/driver.cxx @@ -4,14 +4,16 @@ // Test native SQL execution. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include + +#undef NDEBUG +#include using namespace std; namespace sqlite = odb::sqlite; @@ -22,7 +24,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db ( + unique_ptr db ( create_specific_database (argc, argv, false)); // Create the database schema. diff --git a/sqlite/native/makefile b/sqlite/native/makefile deleted file mode 100644 index c5434f0..0000000 --- a/sqlite/native/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : sqlite/native/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/native/test.std b/sqlite/native/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/native/testscript b/sqlite/native/testscript new file mode 100644 index 0000000..16f05e0 --- /dev/null +++ b/sqlite/native/testscript @@ -0,0 +1,9 @@ +# file : sqlite/native/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/stream/buildfile b/sqlite/stream/buildfile new file mode 100644 index 0000000..fb8f605 --- /dev/null +++ b/sqlite/stream/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/stream/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} +import libodb_sqlite = libodb-sqlite%lib{odb-sqlite} +import libs = lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb and +# libodb-sqlite libraries are resolved for the odb_compile ad hoc rule (see +# build/root.build for details). +# +libue{test-meta}: $libodb $libodb_sqlite + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_stream_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx index 7049b8b..86522ec 100644 --- a/sqlite/stream/driver.cxx +++ b/sqlite/stream/driver.cxx @@ -5,8 +5,7 @@ // #include -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include @@ -15,11 +14,14 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -41,7 +43,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); string txt (1024 * 1024, 't'); vector blb (1024 * 1024, 'b'); @@ -80,7 +82,7 @@ main (int argc, char* argv[]) { transaction tx (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); print (p->t); print (p->b); @@ -169,7 +171,7 @@ main (int argc, char* argv[]) { transaction tx (db->begin ()); - auto_ptr p (db->load (o.id)); + unique_ptr p (db->load (o.id)); print (p->t); print (p->b); diff --git a/sqlite/stream/makefile b/sqlite/stream/makefile deleted file mode 100644 index 1a46b62..0000000 --- a/sqlite/stream/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/stream/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-query --generate-schema --table-prefix sqlitex_stream_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/stream/test.std b/sqlite/stream/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/stream/testscript b/sqlite/stream/testscript new file mode 100644 index 0000000..2b9f019 --- /dev/null +++ b/sqlite/stream/testscript @@ -0,0 +1,9 @@ +# file : sqlite/stream/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/template/Makefile.am b/sqlite/template/Makefile.am deleted file mode 100644 index b922bf1..0000000 --- a/sqlite/template/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# file : sqlite/template/Makefile.am -# license : GNU GPL v2; see accompanying LICENSE file - -EXTRA_DIST = __file__(extra_dist) - -noinst_PROGRAMS = driver -driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -LDADD = $(top_builddir)/libcommon/common/libcommon.la -AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' -AM_CPPFLAGS += -I'$(builddir)' -I'$(srcdir)' - -TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; - -__ifelse__(__value__(odb_options),,, - -# ODB compilation. -# -driver_SOURCES += test.hxx -nodist_driver_SOURCES = test-odb.cxx -BUILT_SOURCES = test-odb.hxx -CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx - -ODB = @ODB@ -ODBFLAGS = @ODBFLAGS@ -ODBCPPFLAGS = @ODBCPPFLAGS@ - -if HAVE_CXX11 -ODBFLAGS += --std c++11 -endif - -test-odb.hxx: test.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< -) diff --git a/sqlite/template/driver.cxx b/sqlite/template/driver.cxx deleted file mode 100644 index 95fdfb0..0000000 --- a/sqlite/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : sqlite/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/template/makefile b/sqlite/template/makefile deleted file mode 100644 index 45ba099..0000000 --- a/sqlite/template/makefile +++ /dev/null @@ -1,108 +0,0 @@ -# file : sqlite/template/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --table-prefix sqlitex_template_ #@@ CHANGE THIS -# Note: 'x' here is not a typo. -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/template/template-vc10.vcxproj b/sqlite/template/template-vc10.vcxproj deleted file mode 100644 index 8e11aa6..0000000 --- a/sqlite/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc10.vcxproj.filters b/sqlite/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc11.vcxproj b/sqlite/template/template-vc11.vcxproj deleted file mode 100644 index 54fc9ef..0000000 --- a/sqlite/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc11.vcxproj.filters b/sqlite/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc12.vcxproj b/sqlite/template/template-vc12.vcxproj deleted file mode 100644 index 09beff2..0000000 --- a/sqlite/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/sqlite/template/template-vc12.vcxproj.filters b/sqlite/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/sqlite/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/sqlite/template/template-vc8.vcproj b/sqlite/template/template-vc8.vcproj deleted file mode 100644 index ef608ba..0000000 --- a/sqlite/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/sqlite/template/template-vc9.vcproj b/sqlite/template/template-vc9.vcproj deleted file mode 100644 index 960f086..0000000 --- a/sqlite/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/sqlite/template/test.hxx b/sqlite/template/test.hxx deleted file mode 100644 index 63e07d5..0000000 --- a/sqlite/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : sqlite/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/sqlite/template/test.std b/sqlite/template/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/test.bat b/sqlite/test.bat deleted file mode 100644 index ab29f82..0000000 --- a/sqlite/test.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off -rem file : sqlite/test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -setlocal - -set "tests=__path__(dirs)" -set "confs=__path__(configurations)" -set "plats=__path__(platforms)" -set "curdir=%CD%" -set "topdir=%curdir%\.." -set "failed=" - -goto start - -rem -rem %1 - test directory -rem %2 - configuration -rem %3 - platform -rem -:run_test - cd %1 - - if "_%3_" == "_Win32_" ( - set "dir=%2" - ) else ( - set "dir=%3\%2" - ) - - if exist %dir%\driver.exe ( - echo %1\%3\%2 - call %topdir%\tester.bat sqlite %2 %3 - if errorlevel 1 ( - set "failed=%failed% %1\%3\%2" - ) - ) - - cd %curdir% -goto :eof - -:start - -for %%t in (%tests%) do ( - for %%c in (%confs%) do ( - for %%p in (%plats%) do ( - call :run_test %%t %%c %%p - ) - ) -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/sqlite/transaction/buildfile b/sqlite/transaction/buildfile new file mode 100644 index 0000000..e29092d --- /dev/null +++ b/sqlite/transaction/buildfile @@ -0,0 +1,30 @@ +# file : sqlite/transaction/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_transaction_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx index 8eb8f2c..80a0804 100644 --- a/sqlite/transaction/driver.cxx +++ b/sqlite/transaction/driver.cxx @@ -4,18 +4,20 @@ // Test esoteric SQLite transaction semantics aspects. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // In SQLite, when a commit fails because of the deferred foreign // key constraint violation, the transaction is not automatically diff --git a/sqlite/transaction/makefile b/sqlite/transaction/makefile deleted file mode 100644 index 14e4ca0..0000000 --- a/sqlite/transaction/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/transaction/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --table-prefix sqlitex_transaction_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/transaction/test.std b/sqlite/transaction/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/transaction/testscript b/sqlite/transaction/testscript new file mode 100644 index 0000000..c3388cb --- /dev/null +++ b/sqlite/transaction/testscript @@ -0,0 +1,9 @@ +# file : sqlite/transaction/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/truncation/buildfile b/sqlite/truncation/buildfile new file mode 100644 index 0000000..9a014e6 --- /dev/null +++ b/sqlite/truncation/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx index 5ab6c29..a2f6d66 100644 --- a/sqlite/truncation/driver.cxx +++ b/sqlite/truncation/driver.cxx @@ -4,18 +4,20 @@ // Test insufficient buffer/truncation handling. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -33,7 +35,7 @@ main (int argc, char* argv[]) // Test basic operations. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); // Run persist/load so that the initial bindings are established // (version == 0). @@ -71,7 +73,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == long_str); t.commit (); } @@ -89,7 +91,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o (db->load (3)); + unique_ptr o (db->load (3)); assert (o->str_ == longer_str); t.commit (); } @@ -98,7 +100,7 @@ main (int argc, char* argv[]) // Test query. // { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); typedef sqlite::query query; typedef odb::result result; diff --git a/sqlite/truncation/makefile b/sqlite/truncation/makefile deleted file mode 100644 index 4e7e0e3..0000000 --- a/sqlite/truncation/makefile +++ /dev/null @@ -1,107 +0,0 @@ -# file : sqlite/truncation/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --table-prefix sqlitex_truncation_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/truncation/test.std b/sqlite/truncation/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/truncation/testscript b/sqlite/truncation/testscript new file mode 100644 index 0000000..97e04f7 --- /dev/null +++ b/sqlite/truncation/testscript @@ -0,0 +1,9 @@ +# file : sqlite/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/sqlite/types/buildfile b/sqlite/types/buildfile new file mode 100644 index 0000000..1bf719d --- /dev/null +++ b/sqlite/types/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --cxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 8f25330..b444d94 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -5,18 +5,20 @@ // #include // std::numeric_limits -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; namespace sqlite = odb::sqlite; using namespace sqlite; @@ -26,7 +28,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_specific_database (argc, argv)); + unique_ptr db (create_specific_database (argc, argv)); object o (1); @@ -51,7 +53,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); + unique_ptr o1 (db->load (1)); t.commit (); assert (o == *o1); @@ -92,9 +94,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); t.commit (); assert (o1 == *p1); diff --git a/sqlite/types/makefile b/sqlite/types/makefile deleted file mode 100644 index f3810b2..0000000 --- a/sqlite/types/makefile +++ /dev/null @@ -1,109 +0,0 @@ -# file : sqlite/types/makefile -# license : GNU GPL v2; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make - -cxx_tun := driver.cxx -odb_hdr := test.hxx -genf := $(call odb-gen,$(odb_hdr)) -gen := $(addprefix $(out_base)/,$(genf)) -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) $(filter %.o,$(gen:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -common.l := $(out_root)/libcommon/common/common.l -common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options - -# Import. -# -$(call import,\ - $(scf_root)/import/odb/stub.make,\ - odb: odb,odb-rules: odb_rules) - -# Build. -# -$(driver): $(cxx_obj) $(common.l) -$(cxx_obj) $(cxx_od): cpp_options := -I$(out_base) -I$(src_base) -$(cxx_obj) $(cxx_od): $(common.l.cpp-options) - -$(gen): $(odb) -$(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database sqlite --default-database \ -common --generate-schema --generate-query --cxx-prologue \ -'\#include "traits.hxx"' --table-prefix sqlitex_types_ -$(gen): cpp_options := -I$(src_base) -$(gen): $(common.l.cpp-options) - -$(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) - -# Alias for default target. -# -$(out_base)/: $(driver) - -# Dist -# -$(dist): sources := $(cxx_tun) -$(dist): headers := $(odb_hdr) -$(dist): export extra_headers := traits.hxx -$(dist): data_dist := test.std -$(dist): export name := $(subst /,-,$(subst $(src_root)/sqlite/,,$(src_base))) -$(dist): export extra_dist := $(data_dist) \ -$(name)-vc8.vcproj $(name)-vc9.vcproj \ -$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters \ -$(name)-vc11.vcxproj $(name)-vc11.vcxproj.filters \ -$(name)-vc12.vcxproj $(name)-vc12.vcxproj.filters -$(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) - $(call meta-automake,../template/Makefile.am) - $(call meta-vc8proj,../template/template-vc8.vcproj,$(name)-vc8.vcproj) - $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) - $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) - $(call meta-vc11proj,../template/template-vc11.vcxproj,$(name)-vc11.vcxproj) - $(call meta-vc12proj,../template/template-vc12.vcxproj,$(name)-vc12.vcxproj) - -# Test. -# -$(eval $(call test-schemaless-rule)) - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) \ - $(addsuffix .hxx.clean,$(filter %.cxx,$(gen))) - $(call message,,rm -f $(out_base)/test.out) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver $(genf) -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - -# How to. -# -$(call include,$(bld_root)/dist.make) -$(call include,$(bld_root)/meta/vc8proj.make) -$(call include,$(bld_root)/meta/vc9proj.make) -$(call include,$(bld_root)/meta/vc10proj.make) -$(call include,$(bld_root)/meta/vc11proj.make) -$(call include,$(bld_root)/meta/vc12proj.make) -$(call include,$(bld_root)/meta/automake.make) - -$(call include,$(bld_root)/cxx/standard.make) # cxx_standard -ifdef cxx_standard -$(gen): odb_options += --std $(cxx_standard) -$(call include,$(odb_rules)) -endif - -$(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/o-e.make) - -# Dependencies. -# -$(call import,$(src_root)/libcommon/makefile) diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index f642738..fe0b274 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -7,7 +7,7 @@ #include #include #include -#include // std::auto_ptr +#include // std::unique_ptr #include // std::memcpy, std::str[n]cmp, std::strlen #ifdef _WIN32 @@ -16,7 +16,7 @@ #include -typedef std::auto_ptr string_ptr; +typedef std::unique_ptr string_ptr; #pragma db object struct object diff --git a/sqlite/types/test.std b/sqlite/types/test.std deleted file mode 100644 index e69de29..0000000 diff --git a/sqlite/types/testscript b/sqlite/types/testscript new file mode 100644 index 0000000..5e50d32 --- /dev/null +++ b/sqlite/types/testscript @@ -0,0 +1,9 @@ +# file : sqlite/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/template-vc10.sln b/template-vc10.sln deleted file mode 100644 index 9a5dc32..0000000 --- a/template-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/template-vc11.sln b/template-vc11.sln deleted file mode 100644 index 436eeea..0000000 --- a/template-vc11.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/template-vc12.sln b/template-vc12.sln deleted file mode 100644 index 446d701..0000000 --- a/template-vc12.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/template-vc8.sln b/template-vc8.sln deleted file mode 100644 index f38bad2..0000000 --- a/template-vc8.sln +++ /dev/null @@ -1,15 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -__projects__ -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution -__solution_configurations__ - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution -__project_configurations__ - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/template-vc9.sln b/template-vc9.sln deleted file mode 100644 index 2ec9432..0000000 --- a/template-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/test.bat b/test.bat deleted file mode 100644 index 3be39d4..0000000 --- a/test.bat +++ /dev/null @@ -1,66 +0,0 @@ -@echo off -rem file : test.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem test.bat database -rem -rem Run tests built with VC++. -rem - -setlocal - -set "failed=" -set "curdir=%CD%" - -if "_%1_" == "__" ( - echo no database specified - goto usage -) - - -goto start - -rem -rem %1 - directory -rem %2 - database -rem -:run_test - echo. - echo testing %1 - echo. - cd %1 - call test.bat %2 - if errorlevel 1 set "failed=%failed% %1" - cd %curdir% -goto :eof - -:start - -for %%d in (common evolution %1 boost\common boost\%1 qt\common qt\%1) do ( - call :run_test %%d %1 -) - -if not "_%failed%_" == "__" goto error - -echo. -echo ALL TESTS PASSED -echo. -goto end - -:usage -echo. -echo usage: test.bat database -echo. - -:error -if not "_%failed%_" == "__" ( - echo. - for %%t in (%failed%) do echo FAILED: %%t - echo. -) -endlocal -exit /b 1 - -:end -endlocal diff --git a/tester.bat b/tester.bat deleted file mode 100644 index d5d667a..0000000 --- a/tester.bat +++ /dev/null @@ -1,73 +0,0 @@ -@echo off -rem file : tester.bat -rem license : GNU GPL v2; see accompanying LICENSE file - -rem -rem Run an ODB test. The test directory is the current directory. -rem -rem %1 database -rem %2 configuration, for example, Debug or Release -rem %3 platform, for example Win32 or x64 -rem topdir variable containing the path to top project directory -rem - -setlocal - -set "PATH=%topdir%\libcommon\bin64;%topdir%\libcommon\bin;%PATH%" - -if "_%DIFF%_" == "__" set DIFF=fc - -if "_%3_" == "_Win32_" ( - set "dir=%2" -) else ( - set "dir=%3\%2" -) - -rem Globbing returns files in alphabetic order. -rem -if exist test*.sql ( - for %%f in (test*.sql) do ( - call %topdir%\%1-driver.bat %%f - if errorlevel 1 goto error - ) -) - -if exist test-%1.std ( - set "std=test-%1.std" -) else ( - if exist test.std ( - set "std=test.std" - ) else ( - set "std=" - ) -) - -if "_%std%" == "__" ( - - %dir%\driver.exe --options-file %topdir%\%1.options - if errorlevel 1 goto error - -) else ( - - %dir%\driver.exe --options-file %topdir%\%1.options >test.out - if errorlevel 1 goto error - %DIFF% %std% test.out - - if errorlevel 1 ( - del /f test.out - goto error - ) - - del /f test.out - goto end - -) - -goto end - -:error -endlocal -exit /b 1 - -:end -endlocal diff --git a/tester.in b/tester.in deleted file mode 100755 index a83db1b..0000000 --- a/tester.in +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/sh - -# file : tester.in -# license : GNU GPL v2; see accompanying LICENSE file - -# -# Run an ODB test. The test driver is in the current directory. The -# data files, if any, are in $srcdir. -# - -db_driver="$top_builddir/@database@-driver" -db_options="$top_builddir/@database@.options" - -# Globbing returns files in alphabetic order. -# -for f in `echo test*.sql`; do - if test -f $f; then - $db_driver $f - - if test $? -ne 0; then - exit 1 - fi - fi -done - -echo ./driver --options-file "$db_options" - -std= -if test -f "$srcdir/test-@database@.std"; then - std="$srcdir/test-@database@.std" -elif test -f "$srcdir/test.std"; then - std="$srcdir/test.std" -else - std= -fi - -if test -n "$std"; then - ./driver --options-file "$db_options" >test.out - - if test $? -ne 0; then - rm -f test.out - exit 1 - fi - - @DIFF@ @DIFFFLAGS@ "$std" test.out - r=$? - rm -f test.out - exit $r -else - ./driver --options-file "$db_options" -fi diff --git a/version b/version deleted file mode 100644 index 6bc2f39..0000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -2.5.0-b.26 -- cgit v1.1 From 0d49ea1fe08cf1eab41a00149393a291c65a59d7 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Jan 2024 20:32:06 +0300 Subject: Turn odb-tests repository into package for muti-package repository --- .gitignore | 41 - GPLv2 | 340 --- LICENSE | 20 - README.md | 4 - boost/common/multi-index/driver.cxx | 189 -- boost/common/multi-index/test.hxx | 113 - boost/common/optional/driver.cxx | 74 - boost/common/optional/test.hxx | 31 - boost/common/smart-ptr/driver.cxx | 202 -- boost/common/smart-ptr/test.hxx | 82 - boost/common/template/driver.cxx | 39 - boost/common/template/template-vc10.vcxproj | 177 -- .../common/template/template-vc10.vcxproj.filters | 24 - boost/common/template/template-vc11.vcxproj | 181 -- .../common/template/template-vc11.vcxproj.filters | 24 - boost/common/template/template-vc12.vcxproj | 185 -- .../common/template/template-vc12.vcxproj.filters | 24 - boost/common/template/template-vc8.vcproj | 353 ---- boost/common/template/template-vc9.vcproj | 360 ---- boost/common/template/test.hxx | 25 - boost/common/unordered/driver.cxx | 212 -- boost/common/unordered/test.hxx | 113 - boost/common/uuid/driver.cxx | 69 - boost/common/uuid/test.hxx | 37 - boost/mssql/date-time/driver.cxx | 158 -- boost/mssql/date-time/test.hxx | 58 - boost/mssql/template/driver.cxx | 39 - boost/mssql/template/template-vc10.vcxproj | 180 -- boost/mssql/template/template-vc10.vcxproj.filters | 25 - boost/mssql/template/template-vc11.vcxproj | 184 -- boost/mssql/template/template-vc11.vcxproj.filters | 25 - boost/mssql/template/template-vc12.vcxproj | 188 -- boost/mssql/template/template-vc12.vcxproj.filters | 25 - boost/mssql/template/template-vc8.vcproj | 354 ---- boost/mssql/template/template-vc9.vcproj | 361 ---- boost/mssql/template/test.hxx | 25 - boost/mysql/date-time/driver.cxx | 218 -- boost/mysql/date-time/test.hxx | 65 - boost/mysql/template/driver.cxx | 39 - boost/mysql/template/template-vc10.vcxproj | 180 -- boost/mysql/template/template-vc10.vcxproj.filters | 25 - boost/mysql/template/template-vc11.vcxproj | 184 -- boost/mysql/template/template-vc11.vcxproj.filters | 25 - boost/mysql/template/template-vc12.vcxproj | 188 -- boost/mysql/template/template-vc12.vcxproj.filters | 25 - boost/mysql/template/template-vc8.vcproj | 354 ---- boost/mysql/template/template-vc9.vcproj | 361 ---- boost/mysql/template/test.hxx | 25 - boost/oracle/date-time/driver.cxx | 136 -- boost/oracle/date-time/test.hxx | 42 - boost/oracle/template/driver.cxx | 39 - boost/oracle/template/template-vc10.vcxproj | 180 -- .../oracle/template/template-vc10.vcxproj.filters | 25 - boost/oracle/template/template-vc11.vcxproj | 184 -- .../oracle/template/template-vc11.vcxproj.filters | 25 - boost/oracle/template/template-vc12.vcxproj | 188 -- .../oracle/template/template-vc12.vcxproj.filters | 25 - boost/oracle/template/template-vc8.vcproj | 354 ---- boost/oracle/template/template-vc9.vcproj | 361 ---- boost/oracle/template/test.hxx | 25 - boost/pgsql/date-time/driver.cxx | 157 -- boost/pgsql/date-time/test.hxx | 39 - boost/pgsql/template/driver.cxx | 39 - boost/pgsql/template/template-vc10.vcxproj | 180 -- boost/pgsql/template/template-vc10.vcxproj.filters | 25 - boost/pgsql/template/template-vc11.vcxproj | 184 -- boost/pgsql/template/template-vc11.vcxproj.filters | 25 - boost/pgsql/template/template-vc12.vcxproj | 188 -- boost/pgsql/template/template-vc12.vcxproj.filters | 25 - boost/pgsql/template/template-vc8.vcproj | 354 ---- boost/pgsql/template/template-vc9.vcproj | 361 ---- boost/pgsql/template/test.hxx | 25 - boost/sqlite/date-time/driver.cxx | 208 -- boost/sqlite/date-time/test.hxx | 57 - boost/sqlite/template/driver.cxx | 39 - boost/sqlite/template/template-vc10.vcxproj | 180 -- .../sqlite/template/template-vc10.vcxproj.filters | 25 - boost/sqlite/template/template-vc11.vcxproj | 184 -- .../sqlite/template/template-vc11.vcxproj.filters | 25 - boost/sqlite/template/template-vc12.vcxproj | 188 -- .../sqlite/template/template-vc12.vcxproj.filters | 25 - boost/sqlite/template/template-vc8.vcproj | 354 ---- boost/sqlite/template/template-vc9.vcproj | 361 ---- boost/sqlite/template/test.hxx | 25 - build/.gitignore | 3 - build/bootstrap.build | 9 - build/export.build | 9 - build/root.build | 270 --- buildfile | 10 - common/access/buildfile | 45 - common/access/driver.cxx | 262 --- common/access/test.hxx | 592 ------ common/access/testscript | 33 - common/as/buildfile | 49 - common/as/driver.cxx | 348 --- common/as/test.hxx | 270 --- common/as/testscript | 33 - common/blob/buildfile | 40 - common/blob/driver.cxx | 76 - common/blob/test.hxx | 71 - common/blob/testscript | 33 - common/buildfile | 6 - common/bulk/buildfile | 49 - common/bulk/driver.cxx | 1203 ----------- common/bulk/test.hxx | 211 -- common/bulk/testscript | 503 ----- common/callback/buildfile | 41 - common/callback/driver.cxx | 184 -- common/callback/test.hxx | 43 - common/callback/testscript | 100 - common/changelog/.gitignore | 3 - common/changelog/add-column-mssql-diff.xml | 16 - common/changelog/add-column-mssql-patch.xml | 13 - common/changelog/add-column-mysql-diff.xml | 16 - common/changelog/add-column-mysql-patch.xml | 13 - common/changelog/add-column-oracle-diff.xml | 16 - common/changelog/add-column-oracle-patch.xml | 13 - common/changelog/add-column-pgsql-diff.xml | 16 - common/changelog/add-column-pgsql-patch.xml | 13 - common/changelog/add-column-sqlite-diff.xml | 16 - common/changelog/add-column-sqlite-patch.xml | 13 - common/changelog/add-column.hxx | 20 - common/changelog/add-foreign-key-diff.xml | 28 - common/changelog/add-foreign-key-mssql-diff.xml | 28 - common/changelog/add-foreign-key-mssql-patch.xml | 25 - common/changelog/add-foreign-key-mysql-diff.xml | 28 - common/changelog/add-foreign-key-mysql-patch.xml | 25 - common/changelog/add-foreign-key-oracle-diff.xml | 28 - common/changelog/add-foreign-key-oracle-patch.xml | 25 - common/changelog/add-foreign-key-pgsql-diff.xml | 28 - common/changelog/add-foreign-key-pgsql-patch.xml | 25 - common/changelog/add-foreign-key-sqlite-diff.xml | 28 - common/changelog/add-foreign-key-sqlite-patch.xml | 25 - common/changelog/add-foreign-key.hxx | 29 - common/changelog/add-index-mssql-diff.xml | 21 - common/changelog/add-index-mssql-patch.xml | 18 - common/changelog/add-index-mysql-diff.xml | 21 - common/changelog/add-index-mysql-patch.xml | 18 - common/changelog/add-index-oracle-diff.xml | 21 - common/changelog/add-index-oracle-patch.xml | 18 - common/changelog/add-index-pgsql-diff.xml | 21 - common/changelog/add-index-pgsql-patch.xml | 18 - common/changelog/add-index-sqlite-diff.xml | 21 - common/changelog/add-index-sqlite-patch.xml | 18 - common/changelog/add-index.hxx | 24 - common/changelog/add-table-mssql-diff.xml | 45 - common/changelog/add-table-mssql-patch.xml | 44 - common/changelog/add-table-mysql-diff.xml | 45 - common/changelog/add-table-mysql-patch.xml | 44 - common/changelog/add-table-oracle-diff.xml | 45 - common/changelog/add-table-oracle-patch.xml | 44 - common/changelog/add-table-pgsql-diff.xml | 45 - common/changelog/add-table-pgsql-patch.xml | 44 - common/changelog/add-table-sqlite-diff.xml | 45 - common/changelog/add-table-sqlite-patch.xml | 44 - common/changelog/add-table.hxx | 34 - common/changelog/alter-column-mssql-diff.xml | 17 - common/changelog/alter-column-mssql-patch.xml | 13 - common/changelog/alter-column-mysql-diff.xml | 17 - common/changelog/alter-column-mysql-patch.xml | 13 - common/changelog/alter-column-oracle-diff.xml | 17 - common/changelog/alter-column-oracle-patch.xml | 13 - common/changelog/alter-column-pgsql-diff.xml | 17 - common/changelog/alter-column-pgsql-patch.xml | 13 - common/changelog/alter-column-sqlite-diff.xml | 17 - common/changelog/alter-column-sqlite-patch.xml | 13 - common/changelog/alter-column.hxx | 21 - common/changelog/buildfile | 30 - common/changelog/drop-column-mssql-diff.xml | 17 - common/changelog/drop-column-mssql-patch.xml | 12 - common/changelog/drop-column-mysql-diff.xml | 17 - common/changelog/drop-column-mysql-patch.xml | 12 - common/changelog/drop-column-oracle-diff.xml | 17 - common/changelog/drop-column-oracle-patch.xml | 12 - common/changelog/drop-column-pgsql-diff.xml | 17 - common/changelog/drop-column-pgsql-patch.xml | 12 - common/changelog/drop-column-sqlite-diff.xml | 17 - common/changelog/drop-column-sqlite-patch.xml | 12 - common/changelog/drop-column.hxx | 20 - common/changelog/drop-foreign-key-mssql-diff.xml | 30 - common/changelog/drop-foreign-key-mssql-patch.xml | 18 - common/changelog/drop-foreign-key-mysql-diff.xml | 30 - common/changelog/drop-foreign-key-mysql-patch.xml | 18 - common/changelog/drop-foreign-key-oracle-diff.xml | 30 - common/changelog/drop-foreign-key-oracle-patch.xml | 18 - common/changelog/drop-foreign-key-pgsql-diff.xml | 30 - common/changelog/drop-foreign-key-pgsql-patch.xml | 18 - common/changelog/drop-foreign-key-sqlite-diff.xml | 30 - common/changelog/drop-foreign-key-sqlite-patch.xml | 18 - common/changelog/drop-foreign-key.hxx | 29 - common/changelog/drop-index-mssql-diff.xml | 20 - common/changelog/drop-index-mssql-patch.xml | 13 - common/changelog/drop-index-mysql-diff.xml | 20 - common/changelog/drop-index-mysql-patch.xml | 13 - common/changelog/drop-index-oracle-diff.xml | 20 - common/changelog/drop-index-oracle-patch.xml | 13 - common/changelog/drop-index-pgsql-diff.xml | 20 - common/changelog/drop-index-pgsql-patch.xml | 13 - common/changelog/drop-index-sqlite-diff.xml | 20 - common/changelog/drop-index-sqlite-patch.xml | 13 - common/changelog/drop-index.hxx | 21 - common/changelog/drop-table-mssql-diff.xml | 47 - common/changelog/drop-table-mssql-patch.xml | 13 - common/changelog/drop-table-mysql-diff.xml | 47 - common/changelog/drop-table-mysql-patch.xml | 13 - common/changelog/drop-table-oracle-diff.xml | 47 - common/changelog/drop-table-oracle-patch.xml | 13 - common/changelog/drop-table-pgsql-diff.xml | 47 - common/changelog/drop-table-pgsql-patch.xml | 13 - common/changelog/drop-table-sqlite-diff.xml | 47 - common/changelog/drop-table-sqlite-patch.xml | 13 - common/changelog/drop-table.hxx | 34 - common/changelog/model-mssql-diff.xml | 1 - common/changelog/model-mssql-patch.xml | 1 - common/changelog/model-mssql.xml | 56 - common/changelog/model-mysql-diff.xml | 1 - common/changelog/model-mysql-patch.xml | 1 - common/changelog/model-mysql.xml | 56 - common/changelog/model-oracle-diff.xml | 1 - common/changelog/model-oracle-patch.xml | 1 - common/changelog/model-oracle.xml | 56 - common/changelog/model-pgsql-diff.xml | 1 - common/changelog/model-pgsql-patch.xml | 1 - common/changelog/model-pgsql.xml | 56 - common/changelog/model-sqlite-diff.xml | 1 - common/changelog/model-sqlite-patch.xml | 1 - common/changelog/model-sqlite.xml | 56 - common/changelog/model.hxx | 46 - common/changelog/testscript | 66 - common/circular/multiple/.gitignore | 6 - common/circular/multiple/buildfile | 49 - common/circular/multiple/driver.cxx | 69 - common/circular/multiple/test1.hxx | 27 - common/circular/multiple/test2.hxx | 17 - common/circular/multiple/testscript | 31 - common/circular/single/buildfile | 41 - common/circular/single/driver.cxx | 40 - common/circular/single/test.hxx | 28 - common/circular/single/testscript | 33 - common/composite/buildfile | 41 - common/composite/driver.cxx | 229 -- common/composite/test.hxx | 250 --- common/composite/testscript | 33 - common/const-member/buildfile | 40 - common/const-member/driver.cxx | 119 -- common/const-member/test.hxx | 109 - common/const-member/testscript | 33 - common/const-object/buildfile | 41 - common/const-object/driver.cxx | 216 -- common/const-object/test.hxx | 51 - common/const-object/testscript | 33 - common/container/basics/buildfile | 40 - common/container/basics/driver.cxx | 523 ----- common/container/basics/test.hxx | 245 --- common/container/basics/testscript | 33 - common/container/change-tracking/buildfile | 40 - common/container/change-tracking/driver.cxx | 729 ------- common/container/change-tracking/test.hxx | 106 - common/container/change-tracking/testscript | 33 - common/ctor/buildfile | 41 - common/ctor/driver.cxx | 79 - common/ctor/test.hxx | 29 - common/ctor/testscript | 33 - common/default/buildfile | 41 - common/default/driver.cxx | 81 - common/default/test.hxx | 67 - common/default/testscript | 33 - common/definition/.gitignore | 6 - common/definition/buildfile | 52 - common/definition/driver.cxx | 56 - common/definition/test.hxx | 26 - common/definition/testscript | 33 - common/definition/time-mapping.hxx | 17 - common/enum/buildfile | 41 - common/enum/driver.cxx | 84 - common/enum/test.hxx | 47 - common/enum/testscript | 33 - common/erase-query/buildfile | 41 - common/erase-query/driver.cxx | 181 -- common/erase-query/test.hxx | 46 - common/erase-query/testscript | 33 - common/id/auto/buildfile | 40 - common/id/auto/driver.cxx | 96 - common/id/auto/test.hxx | 40 - common/id/auto/testscript | 33 - common/id/composite/buildfile | 42 - common/id/composite/driver.cxx | 731 ------- common/id/composite/test.hxx | 519 ----- common/id/composite/testscript | 33 - common/id/nested/buildfile | 41 - common/id/nested/driver.cxx | 266 --- common/id/nested/test.hxx | 217 -- common/id/nested/testscript | 33 - common/include/.gitignore | 17 - common/include/buildfile | 51 - common/include/driver.cxx | 42 - common/include/obj1.hxx | 25 - common/include/obj2.hxx | 25 - common/include/obj3.hxx | 25 - common/include/objs1.hxx | 13 - common/include/objs2.hxx | 13 - common/include/objs3.hxx | 11 - common/include/objs4.hxx | 11 - common/include/test1.hxx | 16 - common/include/test2.hxx | 15 - common/include/test3.hxx | 12 - common/include/test4.hxx | 12 - common/include/testscript | 31 - common/index/buildfile | 40 - common/index/driver.cxx | 44 - common/index/test.hxx | 142 -- common/index/testscript | 33 - common/inheritance/polymorphism/.gitignore | 76 - common/inheritance/polymorphism/buildfile | 52 - common/inheritance/polymorphism/driver.cxx | 2093 ------------------ common/inheritance/polymorphism/test1.hxx | 115 - common/inheritance/polymorphism/test10.hxx | 78 - common/inheritance/polymorphism/test11.hxx | 78 - common/inheritance/polymorphism/test12.hxx | 79 - common/inheritance/polymorphism/test13.hxx | 46 - common/inheritance/polymorphism/test14.hxx | 99 - common/inheritance/polymorphism/test15.hxx | 44 - common/inheritance/polymorphism/test2.hxx | 105 - common/inheritance/polymorphism/test3.hxx | 146 -- common/inheritance/polymorphism/test4.hxx | 84 - common/inheritance/polymorphism/test5.hxx | 92 - common/inheritance/polymorphism/test6.hxx | 64 - common/inheritance/polymorphism/test7.hxx | 54 - common/inheritance/polymorphism/test8.hxx | 129 -- common/inheritance/polymorphism/test9.hxx | 161 -- common/inheritance/polymorphism/testscript | 80 - common/inheritance/reuse/buildfile | 41 - common/inheritance/reuse/driver.cxx | 237 --- common/inheritance/reuse/test.hxx | 163 -- common/inheritance/reuse/testscript | 33 - common/inheritance/transient/buildfile | 41 - common/inheritance/transient/driver.cxx | 80 - common/inheritance/transient/test.hxx | 60 - common/inheritance/transient/testscript | 33 - common/inverse/buildfile | 42 - common/inverse/driver.cxx | 502 ----- common/inverse/test.hxx | 391 ---- common/inverse/testscript | 33 - common/lazy-ptr/buildfile | 41 - common/lazy-ptr/driver.cxx | 360 ---- common/lazy-ptr/test.hxx | 147 -- common/lazy-ptr/testscript | 33 - common/lifecycle/buildfile | 40 - common/lifecycle/driver.cxx | 248 --- common/lifecycle/test.hxx | 27 - common/lifecycle/testscript | 33 - common/no-id/buildfile | 41 - common/no-id/driver.cxx | 102 - common/no-id/test.hxx | 21 - common/no-id/testscript | 33 - common/object/buildfile | 41 - common/object/driver.cxx | 84 - common/object/test.hxx | 49 - common/object/testscript | 33 - common/optimistic/buildfile | 41 - common/optimistic/driver.cxx | 300 --- common/optimistic/test.hxx | 76 - common/optimistic/testscript | 33 - common/pragma/buildfile | 39 - common/pragma/driver.cxx | 27 - common/pragma/test.hxx | 40 - common/pragma/testscript | 31 - common/prepared/buildfile | 43 - common/prepared/driver.cxx | 444 ---- common/prepared/test.hxx | 32 - common/prepared/testscript | 33 - common/query/array/buildfile | 43 - common/query/array/driver.cxx | 220 -- common/query/array/test.hxx | 70 - common/query/array/testscript | 33 - common/query/basics/buildfile | 42 - common/query/basics/driver.cxx | 668 ------ common/query/basics/test.hxx | 117 -- common/query/basics/testscript | 150 -- common/query/one/buildfile | 42 - common/query/one/driver.cxx | 205 -- common/query/one/test.hxx | 26 - common/query/one/testscript | 33 - common/readonly/buildfile | 40 - common/readonly/driver.cxx | 324 --- common/readonly/test.hxx | 225 -- common/readonly/testscript | 33 - common/relationship/basics/buildfile | 41 - common/relationship/basics/driver.cxx | 150 -- common/relationship/basics/test.hxx | 260 --- common/relationship/basics/testscript | 33 - common/relationship/on-delete/buildfile | 43 - common/relationship/on-delete/driver.cxx | 82 - common/relationship/on-delete/test.hxx | 58 - common/relationship/on-delete/testscript | 33 - common/relationship/query/buildfile | 42 - common/relationship/query/driver.cxx | 168 -- common/relationship/query/test.hxx | 140 -- common/relationship/query/testscript | 33 - common/schema/embedded/basics/buildfile | 42 - common/schema/embedded/basics/driver.cxx | 59 - common/schema/embedded/basics/test.hxx | 23 - common/schema/embedded/basics/testscript | 31 - common/schema/embedded/order/.gitignore | 6 - common/schema/embedded/order/buildfile | 48 - common/schema/embedded/order/driver.cxx | 65 - common/schema/embedded/order/test1.hxx | 23 - common/schema/embedded/order/test2.hxx | 17 - common/schema/embedded/order/testscript | 31 - common/schema/namespace/buildfile | 41 - common/schema/namespace/driver.cxx | 113 - common/schema/namespace/test.hxx | 158 -- common/schema/namespace/testscript | 33 - common/section/basics/buildfile | 41 - common/section/basics/driver.cxx | 1735 --------------- common/section/basics/test.hxx | 628 ------ common/section/basics/testscript | 33 - common/section/polymorphism/buildfile | 41 - common/section/polymorphism/driver.cxx | 1807 ---------------- common/section/polymorphism/test.hxx | 542 ----- common/section/polymorphism/testscript | 33 - common/session/cache/buildfile | 41 - common/session/cache/driver.cxx | 83 - common/session/cache/test.hxx | 50 - common/session/cache/testscript | 33 - common/session/custom/buildfile | 43 - common/session/custom/driver.cxx | 231 -- common/session/custom/session.cxx | 57 - common/session/custom/session.hxx | 191 -- common/session/custom/session.txx | 159 -- common/session/custom/test.hxx | 118 -- common/session/custom/testscript | 33 - common/statement/processing/buildfile | 8 - common/statement/processing/driver.cxx | 619 ------ common/statement/processing/testscript | 6 - common/threads/buildfile | 49 - common/threads/driver.cxx | 236 --- common/threads/test.hxx | 29 - common/threads/testscript | 50 - common/transaction/basics/buildfile | 13 - common/transaction/basics/driver.cxx | 151 -- common/transaction/basics/testscript | 62 - common/transaction/callback/buildfile | 13 - common/transaction/callback/driver.cxx | 231 -- common/transaction/callback/testscript | 72 - common/types/buildfile | 39 - common/types/driver.cxx | 37 - common/types/test.hxx | 55 - common/types/testscript | 6 - common/view/basics/buildfile | 42 - common/view/basics/driver.cxx | 846 -------- common/view/basics/test.hxx | 640 ------ common/view/basics/testscript | 33 - common/view/olv/.gitignore | 46 - common/view/olv/buildfile | 50 - common/view/olv/driver.cxx | 654 ------ common/view/olv/test1.hxx | 116 - common/view/olv/test2.hxx | 122 -- common/view/olv/test3.hxx | 106 - common/view/olv/test4.hxx | 151 -- common/view/olv/test5.hxx | 86 - common/view/olv/test6.hxx | 57 - common/view/olv/test7.hxx | 57 - common/view/olv/test8.hxx | 54 - common/view/olv/test9.hxx | 78 - common/view/olv/testscript | 39 - common/virtual/buildfile | 42 - common/virtual/driver.cxx | 154 -- common/virtual/test.hxx | 171 -- common/virtual/testscript | 33 - common/wrapper/buildfile | 40 - common/wrapper/driver.cxx | 216 -- common/wrapper/test.hxx | 214 -- common/wrapper/testscript | 33 - database-options.testscript | 75 - evolution/add-column/driver.cxx | 125 -- evolution/add-column/model.hxx | 38 - evolution/add-column/test1.hxx | 9 - evolution/add-column/test2.hxx | 11 - evolution/add-column/test3.hxx | 11 - evolution/add-foreign-key/driver.cxx | 173 -- evolution/add-foreign-key/model.hxx | 66 - evolution/add-foreign-key/test1.hxx | 9 - evolution/add-foreign-key/test2.hxx | 11 - evolution/add-foreign-key/test3.hxx | 11 - evolution/add-index/driver.cxx | 165 -- evolution/add-index/model.hxx | 33 - evolution/add-index/test1.hxx | 9 - evolution/add-index/test2.hxx | 11 - evolution/add-index/test3.hxx | 11 - evolution/add-table/driver.cxx | 140 -- evolution/add-table/model.hxx | 48 - evolution/add-table/test1.hxx | 9 - evolution/add-table/test2.hxx | 11 - evolution/add-table/test3.hxx | 11 - evolution/alter-column/driver.cxx | 160 -- evolution/alter-column/model.hxx | 56 - evolution/alter-column/test1.hxx | 9 - evolution/alter-column/test2.hxx | 11 - evolution/alter-column/test3.hxx | 11 - evolution/combined/driver.cxx | 157 -- evolution/combined/model.hxx | 174 -- evolution/combined/test1.hxx | 9 - evolution/combined/test2.hxx | 11 - evolution/combined/test3.hxx | 11 - evolution/data/driver.cxx | 178 -- evolution/data/model.hxx | 45 - evolution/data/test1.hxx | 9 - evolution/data/test2.hxx | 11 - evolution/data/test3.hxx | 11 - evolution/drop-column/driver.cxx | 126 -- evolution/drop-column/model.hxx | 59 - evolution/drop-column/test1.hxx | 9 - evolution/drop-column/test2.hxx | 11 - evolution/drop-column/test3.hxx | 11 - evolution/drop-foreign-key/driver.cxx | 145 -- evolution/drop-foreign-key/model.hxx | 50 - evolution/drop-foreign-key/test1.hxx | 9 - evolution/drop-foreign-key/test2.hxx | 11 - evolution/drop-foreign-key/test3.hxx | 11 - evolution/drop-index/driver.cxx | 154 -- evolution/drop-index/model.hxx | 33 - evolution/drop-index/test1.hxx | 9 - evolution/drop-index/test2.hxx | 11 - evolution/drop-index/test3.hxx | 11 - evolution/drop-table/driver.cxx | 168 -- evolution/drop-table/model.hxx | 94 - evolution/drop-table/test1.hxx | 9 - evolution/drop-table/test2.hxx | 11 - evolution/drop-table/test3.hxx | 11 - evolution/embedded/driver.cxx | 181 -- evolution/embedded/model.hxx | 45 - evolution/embedded/test1.hxx | 9 - evolution/embedded/test2.hxx | 11 - evolution/embedded/test3.hxx | 11 - evolution/soft-add/driver.cxx | 2219 -------------------- evolution/soft-add/model.hxx | 504 ----- evolution/soft-add/test1.hxx | 9 - evolution/soft-add/test2.hxx | 11 - evolution/soft-add/test3.hxx | 11 - evolution/soft-delete/driver.cxx | 2202 ------------------- evolution/soft-delete/model.hxx | 518 ----- evolution/soft-delete/test1.hxx | 9 - evolution/soft-delete/test2.hxx | 11 - evolution/soft-delete/test3.hxx | 11 - evolution/template/driver.cxx | 124 -- evolution/template/model.hxx | 40 - evolution/template/template-vc10.vcxproj | 196 -- evolution/template/template-vc10.vcxproj.filters | 32 - evolution/template/template-vc11.vcxproj | 200 -- evolution/template/template-vc11.vcxproj.filters | 32 - evolution/template/template-vc12.vcxproj | 204 -- evolution/template/template-vc12.vcxproj.filters | 32 - evolution/template/template-vc8.vcproj | 372 ---- evolution/template/template-vc9.vcproj | 379 ---- evolution/template/test1.hxx | 9 - evolution/template/test2.hxx | 11 - evolution/template/test3.hxx | 11 - evolution/version/driver.cxx | 156 -- evolution/version/model.hxx | 45 - evolution/version/test1.hxx | 9 - evolution/version/test2.hxx | 11 - evolution/version/test3.hxx | 11 - libcommon/.gitignore | 3 - libcommon/buffer.hxx | 104 - libcommon/buildfile | 50 - libcommon/common.cxx | 355 ---- libcommon/common.hxx | 47 - libcommon/common.txx | 24 - libcommon/concrete.hxx | 57 - libcommon/config.hxx.in | 14 - libcommon/export.hxx | 39 - manifest | 48 - mssql/custom/custom.sql | 42 - mssql/custom/driver.cxx | 135 -- mssql/custom/query.hxx | 183 -- mssql/custom/test.hxx | 121 -- mssql/custom/traits.cxx | 128 -- mssql/custom/traits.hxx | 148 -- mssql/database/driver.cxx | 105 - mssql/native/driver.cxx | 73 - mssql/query/driver.cxx | 188 -- mssql/query/test.hxx | 38 - mssql/stored-proc/driver.cxx | 231 -- mssql/stored-proc/test.hxx | 63 - mssql/template/driver.cxx | 40 - mssql/template/template-vc10.vcxproj | 180 -- mssql/template/template-vc10.vcxproj.filters | 25 - mssql/template/template-vc11.vcxproj | 184 -- mssql/template/template-vc11.vcxproj.filters | 25 - mssql/template/template-vc12.vcxproj | 188 -- mssql/template/template-vc12.vcxproj.filters | 25 - mssql/template/template-vc8.vcproj | 354 ---- mssql/template/template-vc9.vcproj | 361 ---- mssql/template/test.hxx | 25 - mssql/types/driver.cxx | 381 ---- mssql/types/test.hxx | 517 ----- mssql/types/traits.hxx | 223 -- mysql-schema.testscript | 9 - mysql.testscript | 12 - mysql/custom/buildfile | 37 - mysql/custom/driver.cxx | 117 -- mysql/custom/query.hxx | 160 -- mysql/custom/test.hxx | 54 - mysql/custom/testscript | 11 - mysql/custom/traits.hxx | 88 - mysql/database/buildfile | 11 - mysql/database/driver.cxx | 72 - mysql/database/testscript | 6 - mysql/index/buildfile | 34 - mysql/index/driver.cxx | 44 - mysql/index/test.hxx | 20 - mysql/index/testscript | 11 - mysql/native/buildfile | 16 - mysql/native/driver.cxx | 75 - mysql/native/testscript | 9 - mysql/truncation/buildfile | 35 - mysql/truncation/driver.cxx | 192 -- mysql/truncation/test.hxx | 48 - mysql/truncation/testscript | 11 - mysql/types/buildfile | 36 - mysql/types/driver.cxx | 168 -- mysql/types/test.hxx | 328 --- mysql/types/testscript | 11 - mysql/types/traits.hxx | 198 -- odb-tests/.gitignore | 41 + odb-tests/GPLv2 | 340 +++ odb-tests/LICENSE | 20 + odb-tests/README.md | 4 + odb-tests/boost/common/multi-index/driver.cxx | 189 ++ odb-tests/boost/common/multi-index/test.hxx | 113 + odb-tests/boost/common/optional/driver.cxx | 74 + odb-tests/boost/common/optional/test.hxx | 31 + odb-tests/boost/common/smart-ptr/driver.cxx | 202 ++ odb-tests/boost/common/smart-ptr/test.hxx | 82 + odb-tests/boost/common/template/driver.cxx | 39 + .../boost/common/template/template-vc10.vcxproj | 177 ++ .../common/template/template-vc10.vcxproj.filters | 24 + .../boost/common/template/template-vc11.vcxproj | 181 ++ .../common/template/template-vc11.vcxproj.filters | 24 + .../boost/common/template/template-vc12.vcxproj | 185 ++ .../common/template/template-vc12.vcxproj.filters | 24 + .../boost/common/template/template-vc8.vcproj | 353 ++++ .../boost/common/template/template-vc9.vcproj | 360 ++++ odb-tests/boost/common/template/test.hxx | 25 + odb-tests/boost/common/unordered/driver.cxx | 212 ++ odb-tests/boost/common/unordered/test.hxx | 113 + odb-tests/boost/common/uuid/driver.cxx | 69 + odb-tests/boost/common/uuid/test.hxx | 37 + odb-tests/boost/mssql/date-time/driver.cxx | 158 ++ odb-tests/boost/mssql/date-time/test.hxx | 58 + odb-tests/boost/mssql/template/driver.cxx | 39 + .../boost/mssql/template/template-vc10.vcxproj | 180 ++ .../mssql/template/template-vc10.vcxproj.filters | 25 + .../boost/mssql/template/template-vc11.vcxproj | 184 ++ .../mssql/template/template-vc11.vcxproj.filters | 25 + .../boost/mssql/template/template-vc12.vcxproj | 188 ++ .../mssql/template/template-vc12.vcxproj.filters | 25 + odb-tests/boost/mssql/template/template-vc8.vcproj | 354 ++++ odb-tests/boost/mssql/template/template-vc9.vcproj | 361 ++++ odb-tests/boost/mssql/template/test.hxx | 25 + odb-tests/boost/mysql/date-time/driver.cxx | 218 ++ odb-tests/boost/mysql/date-time/test.hxx | 65 + odb-tests/boost/mysql/template/driver.cxx | 39 + .../boost/mysql/template/template-vc10.vcxproj | 180 ++ .../mysql/template/template-vc10.vcxproj.filters | 25 + .../boost/mysql/template/template-vc11.vcxproj | 184 ++ .../mysql/template/template-vc11.vcxproj.filters | 25 + .../boost/mysql/template/template-vc12.vcxproj | 188 ++ .../mysql/template/template-vc12.vcxproj.filters | 25 + odb-tests/boost/mysql/template/template-vc8.vcproj | 354 ++++ odb-tests/boost/mysql/template/template-vc9.vcproj | 361 ++++ odb-tests/boost/mysql/template/test.hxx | 25 + odb-tests/boost/oracle/date-time/driver.cxx | 136 ++ odb-tests/boost/oracle/date-time/test.hxx | 42 + odb-tests/boost/oracle/template/driver.cxx | 39 + .../boost/oracle/template/template-vc10.vcxproj | 180 ++ .../oracle/template/template-vc10.vcxproj.filters | 25 + .../boost/oracle/template/template-vc11.vcxproj | 184 ++ .../oracle/template/template-vc11.vcxproj.filters | 25 + .../boost/oracle/template/template-vc12.vcxproj | 188 ++ .../oracle/template/template-vc12.vcxproj.filters | 25 + .../boost/oracle/template/template-vc8.vcproj | 354 ++++ .../boost/oracle/template/template-vc9.vcproj | 361 ++++ odb-tests/boost/oracle/template/test.hxx | 25 + odb-tests/boost/pgsql/date-time/driver.cxx | 157 ++ odb-tests/boost/pgsql/date-time/test.hxx | 39 + odb-tests/boost/pgsql/template/driver.cxx | 39 + .../boost/pgsql/template/template-vc10.vcxproj | 180 ++ .../pgsql/template/template-vc10.vcxproj.filters | 25 + .../boost/pgsql/template/template-vc11.vcxproj | 184 ++ .../pgsql/template/template-vc11.vcxproj.filters | 25 + .../boost/pgsql/template/template-vc12.vcxproj | 188 ++ .../pgsql/template/template-vc12.vcxproj.filters | 25 + odb-tests/boost/pgsql/template/template-vc8.vcproj | 354 ++++ odb-tests/boost/pgsql/template/template-vc9.vcproj | 361 ++++ odb-tests/boost/pgsql/template/test.hxx | 25 + odb-tests/boost/sqlite/date-time/driver.cxx | 208 ++ odb-tests/boost/sqlite/date-time/test.hxx | 57 + odb-tests/boost/sqlite/template/driver.cxx | 39 + .../boost/sqlite/template/template-vc10.vcxproj | 180 ++ .../sqlite/template/template-vc10.vcxproj.filters | 25 + .../boost/sqlite/template/template-vc11.vcxproj | 184 ++ .../sqlite/template/template-vc11.vcxproj.filters | 25 + .../boost/sqlite/template/template-vc12.vcxproj | 188 ++ .../sqlite/template/template-vc12.vcxproj.filters | 25 + .../boost/sqlite/template/template-vc8.vcproj | 354 ++++ .../boost/sqlite/template/template-vc9.vcproj | 361 ++++ odb-tests/boost/sqlite/template/test.hxx | 25 + odb-tests/build/.gitignore | 3 + odb-tests/build/bootstrap.build | 9 + odb-tests/build/export.build | 9 + odb-tests/build/root.build | 270 +++ odb-tests/buildfile | 10 + odb-tests/common/access/buildfile | 45 + odb-tests/common/access/driver.cxx | 262 +++ odb-tests/common/access/test.hxx | 592 ++++++ odb-tests/common/access/testscript | 33 + odb-tests/common/as/buildfile | 49 + odb-tests/common/as/driver.cxx | 348 +++ odb-tests/common/as/test.hxx | 270 +++ odb-tests/common/as/testscript | 33 + odb-tests/common/blob/buildfile | 40 + odb-tests/common/blob/driver.cxx | 76 + odb-tests/common/blob/test.hxx | 71 + odb-tests/common/blob/testscript | 33 + odb-tests/common/buildfile | 6 + odb-tests/common/bulk/buildfile | 49 + odb-tests/common/bulk/driver.cxx | 1203 +++++++++++ odb-tests/common/bulk/test.hxx | 211 ++ odb-tests/common/bulk/testscript | 503 +++++ odb-tests/common/callback/buildfile | 41 + odb-tests/common/callback/driver.cxx | 184 ++ odb-tests/common/callback/test.hxx | 43 + odb-tests/common/callback/testscript | 100 + odb-tests/common/changelog/.gitignore | 3 + .../common/changelog/add-column-mssql-diff.xml | 16 + .../common/changelog/add-column-mssql-patch.xml | 13 + .../common/changelog/add-column-mysql-diff.xml | 16 + .../common/changelog/add-column-mysql-patch.xml | 13 + .../common/changelog/add-column-oracle-diff.xml | 16 + .../common/changelog/add-column-oracle-patch.xml | 13 + .../common/changelog/add-column-pgsql-diff.xml | 16 + .../common/changelog/add-column-pgsql-patch.xml | 13 + .../common/changelog/add-column-sqlite-diff.xml | 16 + .../common/changelog/add-column-sqlite-patch.xml | 13 + odb-tests/common/changelog/add-column.hxx | 20 + .../common/changelog/add-foreign-key-diff.xml | 28 + .../changelog/add-foreign-key-mssql-diff.xml | 28 + .../changelog/add-foreign-key-mssql-patch.xml | 25 + .../changelog/add-foreign-key-mysql-diff.xml | 28 + .../changelog/add-foreign-key-mysql-patch.xml | 25 + .../changelog/add-foreign-key-oracle-diff.xml | 28 + .../changelog/add-foreign-key-oracle-patch.xml | 25 + .../changelog/add-foreign-key-pgsql-diff.xml | 28 + .../changelog/add-foreign-key-pgsql-patch.xml | 25 + .../changelog/add-foreign-key-sqlite-diff.xml | 28 + .../changelog/add-foreign-key-sqlite-patch.xml | 25 + odb-tests/common/changelog/add-foreign-key.hxx | 29 + .../common/changelog/add-index-mssql-diff.xml | 21 + .../common/changelog/add-index-mssql-patch.xml | 18 + .../common/changelog/add-index-mysql-diff.xml | 21 + .../common/changelog/add-index-mysql-patch.xml | 18 + .../common/changelog/add-index-oracle-diff.xml | 21 + .../common/changelog/add-index-oracle-patch.xml | 18 + .../common/changelog/add-index-pgsql-diff.xml | 21 + .../common/changelog/add-index-pgsql-patch.xml | 18 + .../common/changelog/add-index-sqlite-diff.xml | 21 + .../common/changelog/add-index-sqlite-patch.xml | 18 + odb-tests/common/changelog/add-index.hxx | 24 + .../common/changelog/add-table-mssql-diff.xml | 45 + .../common/changelog/add-table-mssql-patch.xml | 44 + .../common/changelog/add-table-mysql-diff.xml | 45 + .../common/changelog/add-table-mysql-patch.xml | 44 + .../common/changelog/add-table-oracle-diff.xml | 45 + .../common/changelog/add-table-oracle-patch.xml | 44 + .../common/changelog/add-table-pgsql-diff.xml | 45 + .../common/changelog/add-table-pgsql-patch.xml | 44 + .../common/changelog/add-table-sqlite-diff.xml | 45 + .../common/changelog/add-table-sqlite-patch.xml | 44 + odb-tests/common/changelog/add-table.hxx | 34 + .../common/changelog/alter-column-mssql-diff.xml | 17 + .../common/changelog/alter-column-mssql-patch.xml | 13 + .../common/changelog/alter-column-mysql-diff.xml | 17 + .../common/changelog/alter-column-mysql-patch.xml | 13 + .../common/changelog/alter-column-oracle-diff.xml | 17 + .../common/changelog/alter-column-oracle-patch.xml | 13 + .../common/changelog/alter-column-pgsql-diff.xml | 17 + .../common/changelog/alter-column-pgsql-patch.xml | 13 + .../common/changelog/alter-column-sqlite-diff.xml | 17 + .../common/changelog/alter-column-sqlite-patch.xml | 13 + odb-tests/common/changelog/alter-column.hxx | 21 + odb-tests/common/changelog/buildfile | 30 + .../common/changelog/drop-column-mssql-diff.xml | 17 + .../common/changelog/drop-column-mssql-patch.xml | 12 + .../common/changelog/drop-column-mysql-diff.xml | 17 + .../common/changelog/drop-column-mysql-patch.xml | 12 + .../common/changelog/drop-column-oracle-diff.xml | 17 + .../common/changelog/drop-column-oracle-patch.xml | 12 + .../common/changelog/drop-column-pgsql-diff.xml | 17 + .../common/changelog/drop-column-pgsql-patch.xml | 12 + .../common/changelog/drop-column-sqlite-diff.xml | 17 + .../common/changelog/drop-column-sqlite-patch.xml | 12 + odb-tests/common/changelog/drop-column.hxx | 20 + .../changelog/drop-foreign-key-mssql-diff.xml | 30 + .../changelog/drop-foreign-key-mssql-patch.xml | 18 + .../changelog/drop-foreign-key-mysql-diff.xml | 30 + .../changelog/drop-foreign-key-mysql-patch.xml | 18 + .../changelog/drop-foreign-key-oracle-diff.xml | 30 + .../changelog/drop-foreign-key-oracle-patch.xml | 18 + .../changelog/drop-foreign-key-pgsql-diff.xml | 30 + .../changelog/drop-foreign-key-pgsql-patch.xml | 18 + .../changelog/drop-foreign-key-sqlite-diff.xml | 30 + .../changelog/drop-foreign-key-sqlite-patch.xml | 18 + odb-tests/common/changelog/drop-foreign-key.hxx | 29 + .../common/changelog/drop-index-mssql-diff.xml | 20 + .../common/changelog/drop-index-mssql-patch.xml | 13 + .../common/changelog/drop-index-mysql-diff.xml | 20 + .../common/changelog/drop-index-mysql-patch.xml | 13 + .../common/changelog/drop-index-oracle-diff.xml | 20 + .../common/changelog/drop-index-oracle-patch.xml | 13 + .../common/changelog/drop-index-pgsql-diff.xml | 20 + .../common/changelog/drop-index-pgsql-patch.xml | 13 + .../common/changelog/drop-index-sqlite-diff.xml | 20 + .../common/changelog/drop-index-sqlite-patch.xml | 13 + odb-tests/common/changelog/drop-index.hxx | 21 + .../common/changelog/drop-table-mssql-diff.xml | 47 + .../common/changelog/drop-table-mssql-patch.xml | 13 + .../common/changelog/drop-table-mysql-diff.xml | 47 + .../common/changelog/drop-table-mysql-patch.xml | 13 + .../common/changelog/drop-table-oracle-diff.xml | 47 + .../common/changelog/drop-table-oracle-patch.xml | 13 + .../common/changelog/drop-table-pgsql-diff.xml | 47 + .../common/changelog/drop-table-pgsql-patch.xml | 13 + .../common/changelog/drop-table-sqlite-diff.xml | 47 + .../common/changelog/drop-table-sqlite-patch.xml | 13 + odb-tests/common/changelog/drop-table.hxx | 34 + odb-tests/common/changelog/model-mssql-diff.xml | 1 + odb-tests/common/changelog/model-mssql-patch.xml | 1 + odb-tests/common/changelog/model-mssql.xml | 56 + odb-tests/common/changelog/model-mysql-diff.xml | 1 + odb-tests/common/changelog/model-mysql-patch.xml | 1 + odb-tests/common/changelog/model-mysql.xml | 56 + odb-tests/common/changelog/model-oracle-diff.xml | 1 + odb-tests/common/changelog/model-oracle-patch.xml | 1 + odb-tests/common/changelog/model-oracle.xml | 56 + odb-tests/common/changelog/model-pgsql-diff.xml | 1 + odb-tests/common/changelog/model-pgsql-patch.xml | 1 + odb-tests/common/changelog/model-pgsql.xml | 56 + odb-tests/common/changelog/model-sqlite-diff.xml | 1 + odb-tests/common/changelog/model-sqlite-patch.xml | 1 + odb-tests/common/changelog/model-sqlite.xml | 56 + odb-tests/common/changelog/model.hxx | 46 + odb-tests/common/changelog/testscript | 66 + odb-tests/common/circular/multiple/.gitignore | 6 + odb-tests/common/circular/multiple/buildfile | 49 + odb-tests/common/circular/multiple/driver.cxx | 69 + odb-tests/common/circular/multiple/test1.hxx | 27 + odb-tests/common/circular/multiple/test2.hxx | 17 + odb-tests/common/circular/multiple/testscript | 31 + odb-tests/common/circular/single/buildfile | 41 + odb-tests/common/circular/single/driver.cxx | 40 + odb-tests/common/circular/single/test.hxx | 28 + odb-tests/common/circular/single/testscript | 33 + odb-tests/common/composite/buildfile | 41 + odb-tests/common/composite/driver.cxx | 229 ++ odb-tests/common/composite/test.hxx | 250 +++ odb-tests/common/composite/testscript | 33 + odb-tests/common/const-member/buildfile | 40 + odb-tests/common/const-member/driver.cxx | 119 ++ odb-tests/common/const-member/test.hxx | 109 + odb-tests/common/const-member/testscript | 33 + odb-tests/common/const-object/buildfile | 41 + odb-tests/common/const-object/driver.cxx | 216 ++ odb-tests/common/const-object/test.hxx | 51 + odb-tests/common/const-object/testscript | 33 + odb-tests/common/container/basics/buildfile | 40 + odb-tests/common/container/basics/driver.cxx | 523 +++++ odb-tests/common/container/basics/test.hxx | 245 +++ odb-tests/common/container/basics/testscript | 33 + .../common/container/change-tracking/buildfile | 40 + .../common/container/change-tracking/driver.cxx | 729 +++++++ .../common/container/change-tracking/test.hxx | 106 + .../common/container/change-tracking/testscript | 33 + odb-tests/common/ctor/buildfile | 41 + odb-tests/common/ctor/driver.cxx | 79 + odb-tests/common/ctor/test.hxx | 29 + odb-tests/common/ctor/testscript | 33 + odb-tests/common/default/buildfile | 41 + odb-tests/common/default/driver.cxx | 81 + odb-tests/common/default/test.hxx | 67 + odb-tests/common/default/testscript | 33 + odb-tests/common/definition/.gitignore | 6 + odb-tests/common/definition/buildfile | 52 + odb-tests/common/definition/driver.cxx | 56 + odb-tests/common/definition/test.hxx | 26 + odb-tests/common/definition/testscript | 33 + odb-tests/common/definition/time-mapping.hxx | 17 + odb-tests/common/enum/buildfile | 41 + odb-tests/common/enum/driver.cxx | 84 + odb-tests/common/enum/test.hxx | 47 + odb-tests/common/enum/testscript | 33 + odb-tests/common/erase-query/buildfile | 41 + odb-tests/common/erase-query/driver.cxx | 181 ++ odb-tests/common/erase-query/test.hxx | 46 + odb-tests/common/erase-query/testscript | 33 + odb-tests/common/id/auto/buildfile | 40 + odb-tests/common/id/auto/driver.cxx | 96 + odb-tests/common/id/auto/test.hxx | 40 + odb-tests/common/id/auto/testscript | 33 + odb-tests/common/id/composite/buildfile | 42 + odb-tests/common/id/composite/driver.cxx | 731 +++++++ odb-tests/common/id/composite/test.hxx | 519 +++++ odb-tests/common/id/composite/testscript | 33 + odb-tests/common/id/nested/buildfile | 41 + odb-tests/common/id/nested/driver.cxx | 266 +++ odb-tests/common/id/nested/test.hxx | 217 ++ odb-tests/common/id/nested/testscript | 33 + odb-tests/common/include/.gitignore | 17 + odb-tests/common/include/buildfile | 51 + odb-tests/common/include/driver.cxx | 42 + odb-tests/common/include/obj1.hxx | 25 + odb-tests/common/include/obj2.hxx | 25 + odb-tests/common/include/obj3.hxx | 25 + odb-tests/common/include/objs1.hxx | 13 + odb-tests/common/include/objs2.hxx | 13 + odb-tests/common/include/objs3.hxx | 11 + odb-tests/common/include/objs4.hxx | 11 + odb-tests/common/include/test1.hxx | 16 + odb-tests/common/include/test2.hxx | 15 + odb-tests/common/include/test3.hxx | 12 + odb-tests/common/include/test4.hxx | 12 + odb-tests/common/include/testscript | 31 + odb-tests/common/index/buildfile | 40 + odb-tests/common/index/driver.cxx | 44 + odb-tests/common/index/test.hxx | 142 ++ odb-tests/common/index/testscript | 33 + .../common/inheritance/polymorphism/.gitignore | 76 + .../common/inheritance/polymorphism/buildfile | 52 + .../common/inheritance/polymorphism/driver.cxx | 2093 ++++++++++++++++++ .../common/inheritance/polymorphism/test1.hxx | 115 + .../common/inheritance/polymorphism/test10.hxx | 78 + .../common/inheritance/polymorphism/test11.hxx | 78 + .../common/inheritance/polymorphism/test12.hxx | 79 + .../common/inheritance/polymorphism/test13.hxx | 46 + .../common/inheritance/polymorphism/test14.hxx | 99 + .../common/inheritance/polymorphism/test15.hxx | 44 + .../common/inheritance/polymorphism/test2.hxx | 105 + .../common/inheritance/polymorphism/test3.hxx | 146 ++ .../common/inheritance/polymorphism/test4.hxx | 84 + .../common/inheritance/polymorphism/test5.hxx | 92 + .../common/inheritance/polymorphism/test6.hxx | 64 + .../common/inheritance/polymorphism/test7.hxx | 54 + .../common/inheritance/polymorphism/test8.hxx | 129 ++ .../common/inheritance/polymorphism/test9.hxx | 161 ++ .../common/inheritance/polymorphism/testscript | 80 + odb-tests/common/inheritance/reuse/buildfile | 41 + odb-tests/common/inheritance/reuse/driver.cxx | 237 +++ odb-tests/common/inheritance/reuse/test.hxx | 163 ++ odb-tests/common/inheritance/reuse/testscript | 33 + odb-tests/common/inheritance/transient/buildfile | 41 + odb-tests/common/inheritance/transient/driver.cxx | 80 + odb-tests/common/inheritance/transient/test.hxx | 60 + odb-tests/common/inheritance/transient/testscript | 33 + odb-tests/common/inverse/buildfile | 42 + odb-tests/common/inverse/driver.cxx | 502 +++++ odb-tests/common/inverse/test.hxx | 391 ++++ odb-tests/common/inverse/testscript | 33 + odb-tests/common/lazy-ptr/buildfile | 41 + odb-tests/common/lazy-ptr/driver.cxx | 360 ++++ odb-tests/common/lazy-ptr/test.hxx | 147 ++ odb-tests/common/lazy-ptr/testscript | 33 + odb-tests/common/lifecycle/buildfile | 40 + odb-tests/common/lifecycle/driver.cxx | 248 +++ odb-tests/common/lifecycle/test.hxx | 27 + odb-tests/common/lifecycle/testscript | 33 + odb-tests/common/no-id/buildfile | 41 + odb-tests/common/no-id/driver.cxx | 102 + odb-tests/common/no-id/test.hxx | 21 + odb-tests/common/no-id/testscript | 33 + odb-tests/common/object/buildfile | 41 + odb-tests/common/object/driver.cxx | 84 + odb-tests/common/object/test.hxx | 49 + odb-tests/common/object/testscript | 33 + odb-tests/common/optimistic/buildfile | 41 + odb-tests/common/optimistic/driver.cxx | 300 +++ odb-tests/common/optimistic/test.hxx | 76 + odb-tests/common/optimistic/testscript | 33 + odb-tests/common/pragma/buildfile | 39 + odb-tests/common/pragma/driver.cxx | 27 + odb-tests/common/pragma/test.hxx | 40 + odb-tests/common/pragma/testscript | 31 + odb-tests/common/prepared/buildfile | 43 + odb-tests/common/prepared/driver.cxx | 444 ++++ odb-tests/common/prepared/test.hxx | 32 + odb-tests/common/prepared/testscript | 33 + odb-tests/common/query/array/buildfile | 43 + odb-tests/common/query/array/driver.cxx | 220 ++ odb-tests/common/query/array/test.hxx | 70 + odb-tests/common/query/array/testscript | 33 + odb-tests/common/query/basics/buildfile | 42 + odb-tests/common/query/basics/driver.cxx | 668 ++++++ odb-tests/common/query/basics/test.hxx | 117 ++ odb-tests/common/query/basics/testscript | 150 ++ odb-tests/common/query/one/buildfile | 42 + odb-tests/common/query/one/driver.cxx | 205 ++ odb-tests/common/query/one/test.hxx | 26 + odb-tests/common/query/one/testscript | 33 + odb-tests/common/readonly/buildfile | 40 + odb-tests/common/readonly/driver.cxx | 324 +++ odb-tests/common/readonly/test.hxx | 225 ++ odb-tests/common/readonly/testscript | 33 + odb-tests/common/relationship/basics/buildfile | 41 + odb-tests/common/relationship/basics/driver.cxx | 150 ++ odb-tests/common/relationship/basics/test.hxx | 260 +++ odb-tests/common/relationship/basics/testscript | 33 + odb-tests/common/relationship/on-delete/buildfile | 43 + odb-tests/common/relationship/on-delete/driver.cxx | 82 + odb-tests/common/relationship/on-delete/test.hxx | 58 + odb-tests/common/relationship/on-delete/testscript | 33 + odb-tests/common/relationship/query/buildfile | 42 + odb-tests/common/relationship/query/driver.cxx | 168 ++ odb-tests/common/relationship/query/test.hxx | 140 ++ odb-tests/common/relationship/query/testscript | 33 + odb-tests/common/schema/embedded/basics/buildfile | 42 + odb-tests/common/schema/embedded/basics/driver.cxx | 59 + odb-tests/common/schema/embedded/basics/test.hxx | 23 + odb-tests/common/schema/embedded/basics/testscript | 31 + odb-tests/common/schema/embedded/order/.gitignore | 6 + odb-tests/common/schema/embedded/order/buildfile | 48 + odb-tests/common/schema/embedded/order/driver.cxx | 65 + odb-tests/common/schema/embedded/order/test1.hxx | 23 + odb-tests/common/schema/embedded/order/test2.hxx | 17 + odb-tests/common/schema/embedded/order/testscript | 31 + odb-tests/common/schema/namespace/buildfile | 41 + odb-tests/common/schema/namespace/driver.cxx | 113 + odb-tests/common/schema/namespace/test.hxx | 158 ++ odb-tests/common/schema/namespace/testscript | 33 + odb-tests/common/section/basics/buildfile | 41 + odb-tests/common/section/basics/driver.cxx | 1735 +++++++++++++++ odb-tests/common/section/basics/test.hxx | 628 ++++++ odb-tests/common/section/basics/testscript | 33 + odb-tests/common/section/polymorphism/buildfile | 41 + odb-tests/common/section/polymorphism/driver.cxx | 1807 ++++++++++++++++ odb-tests/common/section/polymorphism/test.hxx | 542 +++++ odb-tests/common/section/polymorphism/testscript | 33 + odb-tests/common/session/cache/buildfile | 41 + odb-tests/common/session/cache/driver.cxx | 83 + odb-tests/common/session/cache/test.hxx | 50 + odb-tests/common/session/cache/testscript | 33 + odb-tests/common/session/custom/buildfile | 43 + odb-tests/common/session/custom/driver.cxx | 231 ++ odb-tests/common/session/custom/session.cxx | 57 + odb-tests/common/session/custom/session.hxx | 191 ++ odb-tests/common/session/custom/session.txx | 159 ++ odb-tests/common/session/custom/test.hxx | 118 ++ odb-tests/common/session/custom/testscript | 33 + odb-tests/common/statement/processing/buildfile | 8 + odb-tests/common/statement/processing/driver.cxx | 619 ++++++ odb-tests/common/statement/processing/testscript | 6 + odb-tests/common/threads/buildfile | 49 + odb-tests/common/threads/driver.cxx | 236 +++ odb-tests/common/threads/test.hxx | 29 + odb-tests/common/threads/testscript | 50 + odb-tests/common/transaction/basics/buildfile | 13 + odb-tests/common/transaction/basics/driver.cxx | 151 ++ odb-tests/common/transaction/basics/testscript | 62 + odb-tests/common/transaction/callback/buildfile | 13 + odb-tests/common/transaction/callback/driver.cxx | 231 ++ odb-tests/common/transaction/callback/testscript | 72 + odb-tests/common/types/buildfile | 39 + odb-tests/common/types/driver.cxx | 37 + odb-tests/common/types/test.hxx | 55 + odb-tests/common/types/testscript | 6 + odb-tests/common/view/basics/buildfile | 42 + odb-tests/common/view/basics/driver.cxx | 846 ++++++++ odb-tests/common/view/basics/test.hxx | 640 ++++++ odb-tests/common/view/basics/testscript | 33 + odb-tests/common/view/olv/.gitignore | 46 + odb-tests/common/view/olv/buildfile | 50 + odb-tests/common/view/olv/driver.cxx | 654 ++++++ odb-tests/common/view/olv/test1.hxx | 116 + odb-tests/common/view/olv/test2.hxx | 122 ++ odb-tests/common/view/olv/test3.hxx | 106 + odb-tests/common/view/olv/test4.hxx | 151 ++ odb-tests/common/view/olv/test5.hxx | 86 + odb-tests/common/view/olv/test6.hxx | 57 + odb-tests/common/view/olv/test7.hxx | 57 + odb-tests/common/view/olv/test8.hxx | 54 + odb-tests/common/view/olv/test9.hxx | 78 + odb-tests/common/view/olv/testscript | 39 + odb-tests/common/virtual/buildfile | 42 + odb-tests/common/virtual/driver.cxx | 154 ++ odb-tests/common/virtual/test.hxx | 171 ++ odb-tests/common/virtual/testscript | 33 + odb-tests/common/wrapper/buildfile | 40 + odb-tests/common/wrapper/driver.cxx | 216 ++ odb-tests/common/wrapper/test.hxx | 214 ++ odb-tests/common/wrapper/testscript | 33 + odb-tests/database-options.testscript | 75 + odb-tests/evolution/add-column/driver.cxx | 125 ++ odb-tests/evolution/add-column/model.hxx | 38 + odb-tests/evolution/add-column/test1.hxx | 9 + odb-tests/evolution/add-column/test2.hxx | 11 + odb-tests/evolution/add-column/test3.hxx | 11 + odb-tests/evolution/add-foreign-key/driver.cxx | 173 ++ odb-tests/evolution/add-foreign-key/model.hxx | 66 + odb-tests/evolution/add-foreign-key/test1.hxx | 9 + odb-tests/evolution/add-foreign-key/test2.hxx | 11 + odb-tests/evolution/add-foreign-key/test3.hxx | 11 + odb-tests/evolution/add-index/driver.cxx | 165 ++ odb-tests/evolution/add-index/model.hxx | 33 + odb-tests/evolution/add-index/test1.hxx | 9 + odb-tests/evolution/add-index/test2.hxx | 11 + odb-tests/evolution/add-index/test3.hxx | 11 + odb-tests/evolution/add-table/driver.cxx | 140 ++ odb-tests/evolution/add-table/model.hxx | 48 + odb-tests/evolution/add-table/test1.hxx | 9 + odb-tests/evolution/add-table/test2.hxx | 11 + odb-tests/evolution/add-table/test3.hxx | 11 + odb-tests/evolution/alter-column/driver.cxx | 160 ++ odb-tests/evolution/alter-column/model.hxx | 56 + odb-tests/evolution/alter-column/test1.hxx | 9 + odb-tests/evolution/alter-column/test2.hxx | 11 + odb-tests/evolution/alter-column/test3.hxx | 11 + odb-tests/evolution/combined/driver.cxx | 157 ++ odb-tests/evolution/combined/model.hxx | 174 ++ odb-tests/evolution/combined/test1.hxx | 9 + odb-tests/evolution/combined/test2.hxx | 11 + odb-tests/evolution/combined/test3.hxx | 11 + odb-tests/evolution/data/driver.cxx | 178 ++ odb-tests/evolution/data/model.hxx | 45 + odb-tests/evolution/data/test1.hxx | 9 + odb-tests/evolution/data/test2.hxx | 11 + odb-tests/evolution/data/test3.hxx | 11 + odb-tests/evolution/drop-column/driver.cxx | 126 ++ odb-tests/evolution/drop-column/model.hxx | 59 + odb-tests/evolution/drop-column/test1.hxx | 9 + odb-tests/evolution/drop-column/test2.hxx | 11 + odb-tests/evolution/drop-column/test3.hxx | 11 + odb-tests/evolution/drop-foreign-key/driver.cxx | 145 ++ odb-tests/evolution/drop-foreign-key/model.hxx | 50 + odb-tests/evolution/drop-foreign-key/test1.hxx | 9 + odb-tests/evolution/drop-foreign-key/test2.hxx | 11 + odb-tests/evolution/drop-foreign-key/test3.hxx | 11 + odb-tests/evolution/drop-index/driver.cxx | 154 ++ odb-tests/evolution/drop-index/model.hxx | 33 + odb-tests/evolution/drop-index/test1.hxx | 9 + odb-tests/evolution/drop-index/test2.hxx | 11 + odb-tests/evolution/drop-index/test3.hxx | 11 + odb-tests/evolution/drop-table/driver.cxx | 168 ++ odb-tests/evolution/drop-table/model.hxx | 94 + odb-tests/evolution/drop-table/test1.hxx | 9 + odb-tests/evolution/drop-table/test2.hxx | 11 + odb-tests/evolution/drop-table/test3.hxx | 11 + odb-tests/evolution/embedded/driver.cxx | 181 ++ odb-tests/evolution/embedded/model.hxx | 45 + odb-tests/evolution/embedded/test1.hxx | 9 + odb-tests/evolution/embedded/test2.hxx | 11 + odb-tests/evolution/embedded/test3.hxx | 11 + odb-tests/evolution/soft-add/driver.cxx | 2219 ++++++++++++++++++++ odb-tests/evolution/soft-add/model.hxx | 504 +++++ odb-tests/evolution/soft-add/test1.hxx | 9 + odb-tests/evolution/soft-add/test2.hxx | 11 + odb-tests/evolution/soft-add/test3.hxx | 11 + odb-tests/evolution/soft-delete/driver.cxx | 2202 +++++++++++++++++++ odb-tests/evolution/soft-delete/model.hxx | 518 +++++ odb-tests/evolution/soft-delete/test1.hxx | 9 + odb-tests/evolution/soft-delete/test2.hxx | 11 + odb-tests/evolution/soft-delete/test3.hxx | 11 + odb-tests/evolution/template/driver.cxx | 124 ++ odb-tests/evolution/template/model.hxx | 40 + odb-tests/evolution/template/template-vc10.vcxproj | 196 ++ .../template/template-vc10.vcxproj.filters | 32 + odb-tests/evolution/template/template-vc11.vcxproj | 200 ++ .../template/template-vc11.vcxproj.filters | 32 + odb-tests/evolution/template/template-vc12.vcxproj | 204 ++ .../template/template-vc12.vcxproj.filters | 32 + odb-tests/evolution/template/template-vc8.vcproj | 372 ++++ odb-tests/evolution/template/template-vc9.vcproj | 379 ++++ odb-tests/evolution/template/test1.hxx | 9 + odb-tests/evolution/template/test2.hxx | 11 + odb-tests/evolution/template/test3.hxx | 11 + odb-tests/evolution/version/driver.cxx | 156 ++ odb-tests/evolution/version/model.hxx | 45 + odb-tests/evolution/version/test1.hxx | 9 + odb-tests/evolution/version/test2.hxx | 11 + odb-tests/evolution/version/test3.hxx | 11 + odb-tests/libcommon/.gitignore | 3 + odb-tests/libcommon/buffer.hxx | 104 + odb-tests/libcommon/buildfile | 50 + odb-tests/libcommon/common.cxx | 355 ++++ odb-tests/libcommon/common.hxx | 47 + odb-tests/libcommon/common.txx | 24 + odb-tests/libcommon/concrete.hxx | 57 + odb-tests/libcommon/config.hxx.in | 14 + odb-tests/libcommon/export.hxx | 39 + odb-tests/manifest | 48 + odb-tests/mssql/custom/custom.sql | 42 + odb-tests/mssql/custom/driver.cxx | 135 ++ odb-tests/mssql/custom/query.hxx | 183 ++ odb-tests/mssql/custom/test.hxx | 121 ++ odb-tests/mssql/custom/traits.cxx | 128 ++ odb-tests/mssql/custom/traits.hxx | 148 ++ odb-tests/mssql/database/driver.cxx | 105 + odb-tests/mssql/native/driver.cxx | 73 + odb-tests/mssql/query/driver.cxx | 188 ++ odb-tests/mssql/query/test.hxx | 38 + odb-tests/mssql/stored-proc/driver.cxx | 231 ++ odb-tests/mssql/stored-proc/test.hxx | 63 + odb-tests/mssql/template/driver.cxx | 40 + odb-tests/mssql/template/template-vc10.vcxproj | 180 ++ .../mssql/template/template-vc10.vcxproj.filters | 25 + odb-tests/mssql/template/template-vc11.vcxproj | 184 ++ .../mssql/template/template-vc11.vcxproj.filters | 25 + odb-tests/mssql/template/template-vc12.vcxproj | 188 ++ .../mssql/template/template-vc12.vcxproj.filters | 25 + odb-tests/mssql/template/template-vc8.vcproj | 354 ++++ odb-tests/mssql/template/template-vc9.vcproj | 361 ++++ odb-tests/mssql/template/test.hxx | 25 + odb-tests/mssql/types/driver.cxx | 381 ++++ odb-tests/mssql/types/test.hxx | 517 +++++ odb-tests/mssql/types/traits.hxx | 223 ++ odb-tests/mysql-schema.testscript | 9 + odb-tests/mysql.testscript | 12 + odb-tests/mysql/custom/buildfile | 37 + odb-tests/mysql/custom/driver.cxx | 117 ++ odb-tests/mysql/custom/query.hxx | 160 ++ odb-tests/mysql/custom/test.hxx | 54 + odb-tests/mysql/custom/testscript | 11 + odb-tests/mysql/custom/traits.hxx | 88 + odb-tests/mysql/database/buildfile | 11 + odb-tests/mysql/database/driver.cxx | 72 + odb-tests/mysql/database/testscript | 6 + odb-tests/mysql/index/buildfile | 34 + odb-tests/mysql/index/driver.cxx | 44 + odb-tests/mysql/index/test.hxx | 20 + odb-tests/mysql/index/testscript | 11 + odb-tests/mysql/native/buildfile | 16 + odb-tests/mysql/native/driver.cxx | 75 + odb-tests/mysql/native/testscript | 9 + odb-tests/mysql/truncation/buildfile | 35 + odb-tests/mysql/truncation/driver.cxx | 192 ++ odb-tests/mysql/truncation/test.hxx | 48 + odb-tests/mysql/truncation/testscript | 11 + odb-tests/mysql/types/buildfile | 36 + odb-tests/mysql/types/driver.cxx | 168 ++ odb-tests/mysql/types/test.hxx | 328 +++ odb-tests/mysql/types/testscript | 11 + odb-tests/mysql/types/traits.hxx | 198 ++ odb-tests/oracle/custom/custom.sql | 53 + odb-tests/oracle/custom/driver.cxx | 77 + odb-tests/oracle/custom/test.hxx | 40 + odb-tests/oracle/custom/traits.hxx | 76 + odb-tests/oracle/database/driver.cxx | 33 + odb-tests/oracle/native/driver.cxx | 77 + odb-tests/oracle/template/driver.cxx | 40 + odb-tests/oracle/template/template-vc10.vcxproj | 180 ++ .../oracle/template/template-vc10.vcxproj.filters | 25 + odb-tests/oracle/template/template-vc11.vcxproj | 184 ++ .../oracle/template/template-vc11.vcxproj.filters | 25 + odb-tests/oracle/template/template-vc12.vcxproj | 188 ++ .../oracle/template/template-vc12.vcxproj.filters | 25 + odb-tests/oracle/template/template-vc8.vcproj | 354 ++++ odb-tests/oracle/template/template-vc9.vcproj | 361 ++++ odb-tests/oracle/template/test.hxx | 25 + odb-tests/oracle/types/driver.cxx | 366 ++++ odb-tests/oracle/types/test.hxx | 353 ++++ odb-tests/oracle/types/traits.hxx | 192 ++ odb-tests/pgsql-schema.testscript | 6 + odb-tests/pgsql.testscript | 12 + odb-tests/pgsql/buildfile | 6 + odb-tests/pgsql/bulk/buildfile | 40 + odb-tests/pgsql/bulk/driver.cxx | 361 ++++ odb-tests/pgsql/bulk/test.hxx | 34 + odb-tests/pgsql/bulk/testscript | 18 + odb-tests/pgsql/custom/buildfile | 37 + odb-tests/pgsql/custom/driver.cxx | 125 ++ odb-tests/pgsql/custom/query.hxx | 158 ++ odb-tests/pgsql/custom/test.hxx | 86 + odb-tests/pgsql/custom/testscript | 11 + odb-tests/pgsql/custom/traits.hxx | 166 ++ odb-tests/pgsql/database/buildfile | 11 + odb-tests/pgsql/database/driver.cxx | 44 + odb-tests/pgsql/database/testscript | 6 + odb-tests/pgsql/index/buildfile | 34 + odb-tests/pgsql/index/driver.cxx | 44 + odb-tests/pgsql/index/test.hxx | 19 + odb-tests/pgsql/index/testscript | 11 + odb-tests/pgsql/native/buildfile | 16 + odb-tests/pgsql/native/driver.cxx | 75 + odb-tests/pgsql/native/testscript | 9 + odb-tests/pgsql/truncation/buildfile | 35 + odb-tests/pgsql/truncation/driver.cxx | 163 ++ odb-tests/pgsql/truncation/test.hxx | 46 + odb-tests/pgsql/truncation/testscript | 11 + odb-tests/pgsql/types/buildfile | 36 + odb-tests/pgsql/types/driver.cxx | 165 ++ odb-tests/pgsql/types/test.hxx | 220 ++ odb-tests/pgsql/types/testscript | 11 + odb-tests/pgsql/types/traits.hxx | 171 ++ odb-tests/qt/common/basic/driver.cxx | 66 + odb-tests/qt/common/basic/test.hxx | 35 + odb-tests/qt/common/containers/basics/driver.cxx | 569 +++++ odb-tests/qt/common/containers/basics/test.hxx | 224 ++ .../common/containers/change-tracking/driver.cxx | 643 ++++++ .../qt/common/containers/change-tracking/test.hxx | 46 + odb-tests/qt/common/smart-ptr/driver.cxx | 248 +++ odb-tests/qt/common/smart-ptr/test.hxx | 77 + odb-tests/qt/common/template/driver.cxx | 43 + .../qt/common/template/template-qt4-vc10.vcxproj | 177 ++ .../template/template-qt4-vc10.vcxproj.filters | 24 + .../qt/common/template/template-qt4-vc11.vcxproj | 181 ++ .../template/template-qt4-vc11.vcxproj.filters | 24 + .../qt/common/template/template-qt4-vc12.vcxproj | 185 ++ .../template/template-qt4-vc12.vcxproj.filters | 24 + .../qt/common/template/template-qt4-vc8.vcproj | 353 ++++ .../qt/common/template/template-qt4-vc9.vcproj | 360 ++++ .../qt/common/template/template-qt5-vc10.vcxproj | 177 ++ .../template/template-qt5-vc10.vcxproj.filters | 24 + .../qt/common/template/template-qt5-vc11.vcxproj | 181 ++ .../template/template-qt5-vc11.vcxproj.filters | 24 + .../qt/common/template/template-qt5-vc12.vcxproj | 185 ++ .../template/template-qt5-vc12.vcxproj.filters | 24 + .../qt/common/template/template-qt5-vc9.vcproj | 360 ++++ odb-tests/qt/common/template/test.hxx | 25 + odb-tests/qt/mssql/basic/driver.cxx | 65 + odb-tests/qt/mssql/basic/test.hxx | 46 + odb-tests/qt/mssql/date-time/driver.cxx | 94 + odb-tests/qt/mssql/date-time/test.hxx | 68 + odb-tests/qt/mssql/template/driver.cxx | 43 + .../qt/mssql/template/template-qt4-vc10.vcxproj | 180 ++ .../template/template-qt4-vc10.vcxproj.filters | 25 + .../qt/mssql/template/template-qt4-vc11.vcxproj | 184 ++ .../template/template-qt4-vc11.vcxproj.filters | 25 + .../qt/mssql/template/template-qt4-vc12.vcxproj | 188 ++ .../template/template-qt4-vc12.vcxproj.filters | 25 + .../qt/mssql/template/template-qt4-vc8.vcproj | 354 ++++ .../qt/mssql/template/template-qt4-vc9.vcproj | 361 ++++ .../qt/mssql/template/template-qt5-vc10.vcxproj | 180 ++ .../template/template-qt5-vc10.vcxproj.filters | 25 + .../qt/mssql/template/template-qt5-vc11.vcxproj | 184 ++ .../template/template-qt5-vc11.vcxproj.filters | 25 + .../qt/mssql/template/template-qt5-vc12.vcxproj | 188 ++ .../template/template-qt5-vc12.vcxproj.filters | 25 + .../qt/mssql/template/template-qt5-vc9.vcproj | 361 ++++ odb-tests/qt/mssql/template/test.hxx | 25 + odb-tests/qt/mysql/basic/driver.cxx | 60 + odb-tests/qt/mysql/basic/test.hxx | 27 + odb-tests/qt/mysql/date-time/driver.cxx | 178 ++ odb-tests/qt/mysql/date-time/test.hxx | 70 + odb-tests/qt/mysql/template/driver.cxx | 43 + .../qt/mysql/template/template-qt4-vc10.vcxproj | 180 ++ .../template/template-qt4-vc10.vcxproj.filters | 25 + .../qt/mysql/template/template-qt4-vc11.vcxproj | 184 ++ .../template/template-qt4-vc11.vcxproj.filters | 25 + .../qt/mysql/template/template-qt4-vc12.vcxproj | 188 ++ .../template/template-qt4-vc12.vcxproj.filters | 25 + .../qt/mysql/template/template-qt4-vc8.vcproj | 354 ++++ .../qt/mysql/template/template-qt4-vc9.vcproj | 361 ++++ .../qt/mysql/template/template-qt5-vc10.vcxproj | 180 ++ .../template/template-qt5-vc10.vcxproj.filters | 25 + .../qt/mysql/template/template-qt5-vc11.vcxproj | 184 ++ .../template/template-qt5-vc11.vcxproj.filters | 25 + .../qt/mysql/template/template-qt5-vc12.vcxproj | 188 ++ .../template/template-qt5-vc12.vcxproj.filters | 25 + .../qt/mysql/template/template-qt5-vc9.vcproj | 361 ++++ odb-tests/qt/mysql/template/test.hxx | 25 + odb-tests/qt/oracle/basic/driver.cxx | 81 + odb-tests/qt/oracle/basic/test.hxx | 51 + odb-tests/qt/oracle/date-time/driver.cxx | 80 + odb-tests/qt/oracle/date-time/test.hxx | 45 + odb-tests/qt/oracle/template/driver.cxx | 43 + .../qt/oracle/template/template-qt4-vc10.vcxproj | 180 ++ .../template/template-qt4-vc10.vcxproj.filters | 25 + .../qt/oracle/template/template-qt4-vc11.vcxproj | 184 ++ .../template/template-qt4-vc11.vcxproj.filters | 25 + .../qt/oracle/template/template-qt4-vc12.vcxproj | 188 ++ .../template/template-qt4-vc12.vcxproj.filters | 25 + .../qt/oracle/template/template-qt4-vc8.vcproj | 354 ++++ .../qt/oracle/template/template-qt4-vc9.vcproj | 361 ++++ .../qt/oracle/template/template-qt5-vc10.vcxproj | 180 ++ .../template/template-qt5-vc10.vcxproj.filters | 25 + .../qt/oracle/template/template-qt5-vc11.vcxproj | 184 ++ .../template/template-qt5-vc11.vcxproj.filters | 25 + .../qt/oracle/template/template-qt5-vc12.vcxproj | 188 ++ .../template/template-qt5-vc12.vcxproj.filters | 25 + .../qt/oracle/template/template-qt5-vc9.vcproj | 361 ++++ odb-tests/qt/oracle/template/test.hxx | 25 + odb-tests/qt/pgsql/basic/driver.cxx | 60 + odb-tests/qt/pgsql/basic/test.hxx | 27 + odb-tests/qt/pgsql/date-time/driver.cxx | 108 + odb-tests/qt/pgsql/date-time/test.hxx | 43 + odb-tests/qt/pgsql/template/driver.cxx | 43 + .../qt/pgsql/template/template-qt4-vc10.vcxproj | 180 ++ .../template/template-qt4-vc10.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt4-vc11.vcxproj | 184 ++ .../template/template-qt4-vc11.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt4-vc12.vcxproj | 188 ++ .../template/template-qt4-vc12.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt4-vc8.vcproj | 354 ++++ .../qt/pgsql/template/template-qt4-vc9.vcproj | 361 ++++ .../qt/pgsql/template/template-qt5-vc10.vcxproj | 180 ++ .../template/template-qt5-vc10.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt5-vc11.vcxproj | 184 ++ .../template/template-qt5-vc11.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt5-vc12.vcxproj | 188 ++ .../template/template-qt5-vc12.vcxproj.filters | 25 + .../qt/pgsql/template/template-qt5-vc9.vcproj | 361 ++++ odb-tests/qt/pgsql/template/test.hxx | 25 + odb-tests/qt/sqlite/basic/driver.cxx | 60 + odb-tests/qt/sqlite/basic/test.hxx | 27 + odb-tests/qt/sqlite/date-time/driver.cxx | 140 ++ odb-tests/qt/sqlite/date-time/test.hxx | 60 + odb-tests/qt/sqlite/template/driver.cxx | 43 + .../qt/sqlite/template/template-qt4-vc10.vcxproj | 180 ++ .../template/template-qt4-vc10.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt4-vc11.vcxproj | 184 ++ .../template/template-qt4-vc11.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt4-vc12.vcxproj | 188 ++ .../template/template-qt4-vc12.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt4-vc8.vcproj | 354 ++++ .../qt/sqlite/template/template-qt4-vc9.vcproj | 361 ++++ .../qt/sqlite/template/template-qt5-vc10.vcxproj | 180 ++ .../template/template-qt5-vc10.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt5-vc11.vcxproj | 184 ++ .../template/template-qt5-vc11.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt5-vc12.vcxproj | 188 ++ .../template/template-qt5-vc12.vcxproj.filters | 25 + .../qt/sqlite/template/template-qt5-vc9.vcproj | 361 ++++ odb-tests/qt/sqlite/template/test.hxx | 25 + odb-tests/sqlite.testscript | 10 + odb-tests/sqlite/attach/buildfile | 32 + odb-tests/sqlite/attach/driver.cxx | 109 + odb-tests/sqlite/attach/test.hxx | 32 + odb-tests/sqlite/attach/testscript | 9 + odb-tests/sqlite/auto/buildfile | 32 + odb-tests/sqlite/auto/driver.cxx | 76 + odb-tests/sqlite/auto/test.hxx | 32 + odb-tests/sqlite/auto/testscript | 9 + odb-tests/sqlite/custom/buildfile | 31 + odb-tests/sqlite/custom/driver.cxx | 78 + odb-tests/sqlite/custom/test.hxx | 39 + odb-tests/sqlite/custom/testscript | 9 + odb-tests/sqlite/database/buildfile | 11 + odb-tests/sqlite/database/driver.cxx | 40 + odb-tests/sqlite/database/testscript | 6 + odb-tests/sqlite/native/buildfile | 12 + odb-tests/sqlite/native/driver.cxx | 74 + odb-tests/sqlite/native/testscript | 9 + odb-tests/sqlite/stream/buildfile | 31 + odb-tests/sqlite/stream/driver.cxx | 281 +++ odb-tests/sqlite/stream/test.hxx | 37 + odb-tests/sqlite/stream/testscript | 9 + odb-tests/sqlite/transaction/buildfile | 30 + odb-tests/sqlite/transaction/driver.cxx | 61 + odb-tests/sqlite/transaction/test.hxx | 26 + odb-tests/sqlite/transaction/testscript | 9 + odb-tests/sqlite/truncation/buildfile | 31 + odb-tests/sqlite/truncation/driver.cxx | 163 ++ odb-tests/sqlite/truncation/test.hxx | 46 + odb-tests/sqlite/truncation/testscript | 9 + odb-tests/sqlite/types/buildfile | 32 + odb-tests/sqlite/types/driver.cxx | 113 + odb-tests/sqlite/types/test.hxx | 125 ++ odb-tests/sqlite/types/testscript | 9 + odb-tests/sqlite/types/traits.hxx | 57 + oracle/custom/custom.sql | 53 - oracle/custom/driver.cxx | 77 - oracle/custom/test.hxx | 40 - oracle/custom/traits.hxx | 76 - oracle/database/driver.cxx | 33 - oracle/native/driver.cxx | 77 - oracle/template/driver.cxx | 40 - oracle/template/template-vc10.vcxproj | 180 -- oracle/template/template-vc10.vcxproj.filters | 25 - oracle/template/template-vc11.vcxproj | 184 -- oracle/template/template-vc11.vcxproj.filters | 25 - oracle/template/template-vc12.vcxproj | 188 -- oracle/template/template-vc12.vcxproj.filters | 25 - oracle/template/template-vc8.vcproj | 354 ---- oracle/template/template-vc9.vcproj | 361 ---- oracle/template/test.hxx | 25 - oracle/types/driver.cxx | 366 ---- oracle/types/test.hxx | 353 ---- oracle/types/traits.hxx | 192 -- pgsql-schema.testscript | 6 - pgsql.testscript | 12 - pgsql/buildfile | 6 - pgsql/bulk/buildfile | 40 - pgsql/bulk/driver.cxx | 361 ---- pgsql/bulk/test.hxx | 34 - pgsql/bulk/testscript | 18 - pgsql/custom/buildfile | 37 - pgsql/custom/driver.cxx | 125 -- pgsql/custom/query.hxx | 158 -- pgsql/custom/test.hxx | 86 - pgsql/custom/testscript | 11 - pgsql/custom/traits.hxx | 166 -- pgsql/database/buildfile | 11 - pgsql/database/driver.cxx | 44 - pgsql/database/testscript | 6 - pgsql/index/buildfile | 34 - pgsql/index/driver.cxx | 44 - pgsql/index/test.hxx | 19 - pgsql/index/testscript | 11 - pgsql/native/buildfile | 16 - pgsql/native/driver.cxx | 75 - pgsql/native/testscript | 9 - pgsql/truncation/buildfile | 35 - pgsql/truncation/driver.cxx | 163 -- pgsql/truncation/test.hxx | 46 - pgsql/truncation/testscript | 11 - pgsql/types/buildfile | 36 - pgsql/types/driver.cxx | 165 -- pgsql/types/test.hxx | 220 -- pgsql/types/testscript | 11 - pgsql/types/traits.hxx | 171 -- qt/common/basic/driver.cxx | 66 - qt/common/basic/test.hxx | 35 - qt/common/containers/basics/driver.cxx | 569 ----- qt/common/containers/basics/test.hxx | 224 -- qt/common/containers/change-tracking/driver.cxx | 643 ------ qt/common/containers/change-tracking/test.hxx | 46 - qt/common/smart-ptr/driver.cxx | 248 --- qt/common/smart-ptr/test.hxx | 77 - qt/common/template/driver.cxx | 43 - qt/common/template/template-qt4-vc10.vcxproj | 177 -- .../template/template-qt4-vc10.vcxproj.filters | 24 - qt/common/template/template-qt4-vc11.vcxproj | 181 -- .../template/template-qt4-vc11.vcxproj.filters | 24 - qt/common/template/template-qt4-vc12.vcxproj | 185 -- .../template/template-qt4-vc12.vcxproj.filters | 24 - qt/common/template/template-qt4-vc8.vcproj | 353 ---- qt/common/template/template-qt4-vc9.vcproj | 360 ---- qt/common/template/template-qt5-vc10.vcxproj | 177 -- .../template/template-qt5-vc10.vcxproj.filters | 24 - qt/common/template/template-qt5-vc11.vcxproj | 181 -- .../template/template-qt5-vc11.vcxproj.filters | 24 - qt/common/template/template-qt5-vc12.vcxproj | 185 -- .../template/template-qt5-vc12.vcxproj.filters | 24 - qt/common/template/template-qt5-vc9.vcproj | 360 ---- qt/common/template/test.hxx | 25 - qt/mssql/basic/driver.cxx | 65 - qt/mssql/basic/test.hxx | 46 - qt/mssql/date-time/driver.cxx | 94 - qt/mssql/date-time/test.hxx | 68 - qt/mssql/template/driver.cxx | 43 - qt/mssql/template/template-qt4-vc10.vcxproj | 180 -- .../template/template-qt4-vc10.vcxproj.filters | 25 - qt/mssql/template/template-qt4-vc11.vcxproj | 184 -- .../template/template-qt4-vc11.vcxproj.filters | 25 - qt/mssql/template/template-qt4-vc12.vcxproj | 188 -- .../template/template-qt4-vc12.vcxproj.filters | 25 - qt/mssql/template/template-qt4-vc8.vcproj | 354 ---- qt/mssql/template/template-qt4-vc9.vcproj | 361 ---- qt/mssql/template/template-qt5-vc10.vcxproj | 180 -- .../template/template-qt5-vc10.vcxproj.filters | 25 - qt/mssql/template/template-qt5-vc11.vcxproj | 184 -- .../template/template-qt5-vc11.vcxproj.filters | 25 - qt/mssql/template/template-qt5-vc12.vcxproj | 188 -- .../template/template-qt5-vc12.vcxproj.filters | 25 - qt/mssql/template/template-qt5-vc9.vcproj | 361 ---- qt/mssql/template/test.hxx | 25 - qt/mysql/basic/driver.cxx | 60 - qt/mysql/basic/test.hxx | 27 - qt/mysql/date-time/driver.cxx | 178 -- qt/mysql/date-time/test.hxx | 70 - qt/mysql/template/driver.cxx | 43 - qt/mysql/template/template-qt4-vc10.vcxproj | 180 -- .../template/template-qt4-vc10.vcxproj.filters | 25 - qt/mysql/template/template-qt4-vc11.vcxproj | 184 -- .../template/template-qt4-vc11.vcxproj.filters | 25 - qt/mysql/template/template-qt4-vc12.vcxproj | 188 -- .../template/template-qt4-vc12.vcxproj.filters | 25 - qt/mysql/template/template-qt4-vc8.vcproj | 354 ---- qt/mysql/template/template-qt4-vc9.vcproj | 361 ---- qt/mysql/template/template-qt5-vc10.vcxproj | 180 -- .../template/template-qt5-vc10.vcxproj.filters | 25 - qt/mysql/template/template-qt5-vc11.vcxproj | 184 -- .../template/template-qt5-vc11.vcxproj.filters | 25 - qt/mysql/template/template-qt5-vc12.vcxproj | 188 -- .../template/template-qt5-vc12.vcxproj.filters | 25 - qt/mysql/template/template-qt5-vc9.vcproj | 361 ---- qt/mysql/template/test.hxx | 25 - qt/oracle/basic/driver.cxx | 81 - qt/oracle/basic/test.hxx | 51 - qt/oracle/date-time/driver.cxx | 80 - qt/oracle/date-time/test.hxx | 45 - qt/oracle/template/driver.cxx | 43 - qt/oracle/template/template-qt4-vc10.vcxproj | 180 -- .../template/template-qt4-vc10.vcxproj.filters | 25 - qt/oracle/template/template-qt4-vc11.vcxproj | 184 -- .../template/template-qt4-vc11.vcxproj.filters | 25 - qt/oracle/template/template-qt4-vc12.vcxproj | 188 -- .../template/template-qt4-vc12.vcxproj.filters | 25 - qt/oracle/template/template-qt4-vc8.vcproj | 354 ---- qt/oracle/template/template-qt4-vc9.vcproj | 361 ---- qt/oracle/template/template-qt5-vc10.vcxproj | 180 -- .../template/template-qt5-vc10.vcxproj.filters | 25 - qt/oracle/template/template-qt5-vc11.vcxproj | 184 -- .../template/template-qt5-vc11.vcxproj.filters | 25 - qt/oracle/template/template-qt5-vc12.vcxproj | 188 -- .../template/template-qt5-vc12.vcxproj.filters | 25 - qt/oracle/template/template-qt5-vc9.vcproj | 361 ---- qt/oracle/template/test.hxx | 25 - qt/pgsql/basic/driver.cxx | 60 - qt/pgsql/basic/test.hxx | 27 - qt/pgsql/date-time/driver.cxx | 108 - qt/pgsql/date-time/test.hxx | 43 - qt/pgsql/template/driver.cxx | 43 - qt/pgsql/template/template-qt4-vc10.vcxproj | 180 -- .../template/template-qt4-vc10.vcxproj.filters | 25 - qt/pgsql/template/template-qt4-vc11.vcxproj | 184 -- .../template/template-qt4-vc11.vcxproj.filters | 25 - qt/pgsql/template/template-qt4-vc12.vcxproj | 188 -- .../template/template-qt4-vc12.vcxproj.filters | 25 - qt/pgsql/template/template-qt4-vc8.vcproj | 354 ---- qt/pgsql/template/template-qt4-vc9.vcproj | 361 ---- qt/pgsql/template/template-qt5-vc10.vcxproj | 180 -- .../template/template-qt5-vc10.vcxproj.filters | 25 - qt/pgsql/template/template-qt5-vc11.vcxproj | 184 -- .../template/template-qt5-vc11.vcxproj.filters | 25 - qt/pgsql/template/template-qt5-vc12.vcxproj | 188 -- .../template/template-qt5-vc12.vcxproj.filters | 25 - qt/pgsql/template/template-qt5-vc9.vcproj | 361 ---- qt/pgsql/template/test.hxx | 25 - qt/sqlite/basic/driver.cxx | 60 - qt/sqlite/basic/test.hxx | 27 - qt/sqlite/date-time/driver.cxx | 140 -- qt/sqlite/date-time/test.hxx | 60 - qt/sqlite/template/driver.cxx | 43 - qt/sqlite/template/template-qt4-vc10.vcxproj | 180 -- .../template/template-qt4-vc10.vcxproj.filters | 25 - qt/sqlite/template/template-qt4-vc11.vcxproj | 184 -- .../template/template-qt4-vc11.vcxproj.filters | 25 - qt/sqlite/template/template-qt4-vc12.vcxproj | 188 -- .../template/template-qt4-vc12.vcxproj.filters | 25 - qt/sqlite/template/template-qt4-vc8.vcproj | 354 ---- qt/sqlite/template/template-qt4-vc9.vcproj | 361 ---- qt/sqlite/template/template-qt5-vc10.vcxproj | 180 -- .../template/template-qt5-vc10.vcxproj.filters | 25 - qt/sqlite/template/template-qt5-vc11.vcxproj | 184 -- .../template/template-qt5-vc11.vcxproj.filters | 25 - qt/sqlite/template/template-qt5-vc12.vcxproj | 188 -- .../template/template-qt5-vc12.vcxproj.filters | 25 - qt/sqlite/template/template-qt5-vc9.vcproj | 361 ---- qt/sqlite/template/test.hxx | 25 - repositories.manifest | 44 - sqlite.testscript | 10 - sqlite/attach/buildfile | 32 - sqlite/attach/driver.cxx | 109 - sqlite/attach/test.hxx | 32 - sqlite/attach/testscript | 9 - sqlite/auto/buildfile | 32 - sqlite/auto/driver.cxx | 76 - sqlite/auto/test.hxx | 32 - sqlite/auto/testscript | 9 - sqlite/custom/buildfile | 31 - sqlite/custom/driver.cxx | 78 - sqlite/custom/test.hxx | 39 - sqlite/custom/testscript | 9 - sqlite/database/buildfile | 11 - sqlite/database/driver.cxx | 40 - sqlite/database/testscript | 6 - sqlite/native/buildfile | 12 - sqlite/native/driver.cxx | 74 - sqlite/native/testscript | 9 - sqlite/stream/buildfile | 31 - sqlite/stream/driver.cxx | 281 --- sqlite/stream/test.hxx | 37 - sqlite/stream/testscript | 9 - sqlite/transaction/buildfile | 30 - sqlite/transaction/driver.cxx | 61 - sqlite/transaction/test.hxx | 26 - sqlite/transaction/testscript | 9 - sqlite/truncation/buildfile | 31 - sqlite/truncation/driver.cxx | 163 -- sqlite/truncation/test.hxx | 46 - sqlite/truncation/testscript | 9 - sqlite/types/buildfile | 32 - sqlite/types/driver.cxx | 113 - sqlite/types/test.hxx | 125 -- sqlite/types/testscript | 9 - sqlite/types/traits.hxx | 57 - 1685 files changed, 90096 insertions(+), 90140 deletions(-) delete mode 100644 .gitignore delete mode 100644 GPLv2 delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 boost/common/multi-index/driver.cxx delete mode 100644 boost/common/multi-index/test.hxx delete mode 100644 boost/common/optional/driver.cxx delete mode 100644 boost/common/optional/test.hxx delete mode 100644 boost/common/smart-ptr/driver.cxx delete mode 100644 boost/common/smart-ptr/test.hxx delete mode 100644 boost/common/template/driver.cxx delete mode 100644 boost/common/template/template-vc10.vcxproj delete mode 100644 boost/common/template/template-vc10.vcxproj.filters delete mode 100644 boost/common/template/template-vc11.vcxproj delete mode 100644 boost/common/template/template-vc11.vcxproj.filters delete mode 100644 boost/common/template/template-vc12.vcxproj delete mode 100644 boost/common/template/template-vc12.vcxproj.filters delete mode 100644 boost/common/template/template-vc8.vcproj delete mode 100644 boost/common/template/template-vc9.vcproj delete mode 100644 boost/common/template/test.hxx delete mode 100644 boost/common/unordered/driver.cxx delete mode 100644 boost/common/unordered/test.hxx delete mode 100644 boost/common/uuid/driver.cxx delete mode 100644 boost/common/uuid/test.hxx delete mode 100644 boost/mssql/date-time/driver.cxx delete mode 100644 boost/mssql/date-time/test.hxx delete mode 100644 boost/mssql/template/driver.cxx delete mode 100644 boost/mssql/template/template-vc10.vcxproj delete mode 100644 boost/mssql/template/template-vc10.vcxproj.filters delete mode 100644 boost/mssql/template/template-vc11.vcxproj delete mode 100644 boost/mssql/template/template-vc11.vcxproj.filters delete mode 100644 boost/mssql/template/template-vc12.vcxproj delete mode 100644 boost/mssql/template/template-vc12.vcxproj.filters delete mode 100644 boost/mssql/template/template-vc8.vcproj delete mode 100644 boost/mssql/template/template-vc9.vcproj delete mode 100644 boost/mssql/template/test.hxx delete mode 100644 boost/mysql/date-time/driver.cxx delete mode 100644 boost/mysql/date-time/test.hxx delete mode 100644 boost/mysql/template/driver.cxx delete mode 100644 boost/mysql/template/template-vc10.vcxproj delete mode 100644 boost/mysql/template/template-vc10.vcxproj.filters delete mode 100644 boost/mysql/template/template-vc11.vcxproj delete mode 100644 boost/mysql/template/template-vc11.vcxproj.filters delete mode 100644 boost/mysql/template/template-vc12.vcxproj delete mode 100644 boost/mysql/template/template-vc12.vcxproj.filters delete mode 100644 boost/mysql/template/template-vc8.vcproj delete mode 100644 boost/mysql/template/template-vc9.vcproj delete mode 100644 boost/mysql/template/test.hxx delete mode 100644 boost/oracle/date-time/driver.cxx delete mode 100644 boost/oracle/date-time/test.hxx delete mode 100644 boost/oracle/template/driver.cxx delete mode 100644 boost/oracle/template/template-vc10.vcxproj delete mode 100644 boost/oracle/template/template-vc10.vcxproj.filters delete mode 100644 boost/oracle/template/template-vc11.vcxproj delete mode 100644 boost/oracle/template/template-vc11.vcxproj.filters delete mode 100644 boost/oracle/template/template-vc12.vcxproj delete mode 100644 boost/oracle/template/template-vc12.vcxproj.filters delete mode 100644 boost/oracle/template/template-vc8.vcproj delete mode 100644 boost/oracle/template/template-vc9.vcproj delete mode 100644 boost/oracle/template/test.hxx delete mode 100644 boost/pgsql/date-time/driver.cxx delete mode 100644 boost/pgsql/date-time/test.hxx delete mode 100644 boost/pgsql/template/driver.cxx delete mode 100644 boost/pgsql/template/template-vc10.vcxproj delete mode 100644 boost/pgsql/template/template-vc10.vcxproj.filters delete mode 100644 boost/pgsql/template/template-vc11.vcxproj delete mode 100644 boost/pgsql/template/template-vc11.vcxproj.filters delete mode 100644 boost/pgsql/template/template-vc12.vcxproj delete mode 100644 boost/pgsql/template/template-vc12.vcxproj.filters delete mode 100644 boost/pgsql/template/template-vc8.vcproj delete mode 100644 boost/pgsql/template/template-vc9.vcproj delete mode 100644 boost/pgsql/template/test.hxx delete mode 100644 boost/sqlite/date-time/driver.cxx delete mode 100644 boost/sqlite/date-time/test.hxx delete mode 100644 boost/sqlite/template/driver.cxx delete mode 100644 boost/sqlite/template/template-vc10.vcxproj delete mode 100644 boost/sqlite/template/template-vc10.vcxproj.filters delete mode 100644 boost/sqlite/template/template-vc11.vcxproj delete mode 100644 boost/sqlite/template/template-vc11.vcxproj.filters delete mode 100644 boost/sqlite/template/template-vc12.vcxproj delete mode 100644 boost/sqlite/template/template-vc12.vcxproj.filters delete mode 100644 boost/sqlite/template/template-vc8.vcproj delete mode 100644 boost/sqlite/template/template-vc9.vcproj delete mode 100644 boost/sqlite/template/test.hxx delete mode 100644 build/.gitignore delete mode 100644 build/bootstrap.build delete mode 100644 build/export.build delete mode 100644 build/root.build delete mode 100644 buildfile delete mode 100644 common/access/buildfile delete mode 100644 common/access/driver.cxx delete mode 100644 common/access/test.hxx delete mode 100644 common/access/testscript delete mode 100644 common/as/buildfile delete mode 100644 common/as/driver.cxx delete mode 100644 common/as/test.hxx delete mode 100644 common/as/testscript delete mode 100644 common/blob/buildfile delete mode 100644 common/blob/driver.cxx delete mode 100644 common/blob/test.hxx delete mode 100644 common/blob/testscript delete mode 100644 common/buildfile delete mode 100644 common/bulk/buildfile delete mode 100644 common/bulk/driver.cxx delete mode 100644 common/bulk/test.hxx delete mode 100644 common/bulk/testscript delete mode 100644 common/callback/buildfile delete mode 100644 common/callback/driver.cxx delete mode 100644 common/callback/test.hxx delete mode 100644 common/callback/testscript delete mode 100644 common/changelog/.gitignore delete mode 100644 common/changelog/add-column-mssql-diff.xml delete mode 100644 common/changelog/add-column-mssql-patch.xml delete mode 100644 common/changelog/add-column-mysql-diff.xml delete mode 100644 common/changelog/add-column-mysql-patch.xml delete mode 100644 common/changelog/add-column-oracle-diff.xml delete mode 100644 common/changelog/add-column-oracle-patch.xml delete mode 100644 common/changelog/add-column-pgsql-diff.xml delete mode 100644 common/changelog/add-column-pgsql-patch.xml delete mode 100644 common/changelog/add-column-sqlite-diff.xml delete mode 100644 common/changelog/add-column-sqlite-patch.xml delete mode 100644 common/changelog/add-column.hxx delete mode 100644 common/changelog/add-foreign-key-diff.xml delete mode 100644 common/changelog/add-foreign-key-mssql-diff.xml delete mode 100644 common/changelog/add-foreign-key-mssql-patch.xml delete mode 100644 common/changelog/add-foreign-key-mysql-diff.xml delete mode 100644 common/changelog/add-foreign-key-mysql-patch.xml delete mode 100644 common/changelog/add-foreign-key-oracle-diff.xml delete mode 100644 common/changelog/add-foreign-key-oracle-patch.xml delete mode 100644 common/changelog/add-foreign-key-pgsql-diff.xml delete mode 100644 common/changelog/add-foreign-key-pgsql-patch.xml delete mode 100644 common/changelog/add-foreign-key-sqlite-diff.xml delete mode 100644 common/changelog/add-foreign-key-sqlite-patch.xml delete mode 100644 common/changelog/add-foreign-key.hxx delete mode 100644 common/changelog/add-index-mssql-diff.xml delete mode 100644 common/changelog/add-index-mssql-patch.xml delete mode 100644 common/changelog/add-index-mysql-diff.xml delete mode 100644 common/changelog/add-index-mysql-patch.xml delete mode 100644 common/changelog/add-index-oracle-diff.xml delete mode 100644 common/changelog/add-index-oracle-patch.xml delete mode 100644 common/changelog/add-index-pgsql-diff.xml delete mode 100644 common/changelog/add-index-pgsql-patch.xml delete mode 100644 common/changelog/add-index-sqlite-diff.xml delete mode 100644 common/changelog/add-index-sqlite-patch.xml delete mode 100644 common/changelog/add-index.hxx delete mode 100644 common/changelog/add-table-mssql-diff.xml delete mode 100644 common/changelog/add-table-mssql-patch.xml delete mode 100644 common/changelog/add-table-mysql-diff.xml delete mode 100644 common/changelog/add-table-mysql-patch.xml delete mode 100644 common/changelog/add-table-oracle-diff.xml delete mode 100644 common/changelog/add-table-oracle-patch.xml delete mode 100644 common/changelog/add-table-pgsql-diff.xml delete mode 100644 common/changelog/add-table-pgsql-patch.xml delete mode 100644 common/changelog/add-table-sqlite-diff.xml delete mode 100644 common/changelog/add-table-sqlite-patch.xml delete mode 100644 common/changelog/add-table.hxx delete mode 100644 common/changelog/alter-column-mssql-diff.xml delete mode 100644 common/changelog/alter-column-mssql-patch.xml delete mode 100644 common/changelog/alter-column-mysql-diff.xml delete mode 100644 common/changelog/alter-column-mysql-patch.xml delete mode 100644 common/changelog/alter-column-oracle-diff.xml delete mode 100644 common/changelog/alter-column-oracle-patch.xml delete mode 100644 common/changelog/alter-column-pgsql-diff.xml delete mode 100644 common/changelog/alter-column-pgsql-patch.xml delete mode 100644 common/changelog/alter-column-sqlite-diff.xml delete mode 100644 common/changelog/alter-column-sqlite-patch.xml delete mode 100644 common/changelog/alter-column.hxx delete mode 100644 common/changelog/buildfile delete mode 100644 common/changelog/drop-column-mssql-diff.xml delete mode 100644 common/changelog/drop-column-mssql-patch.xml delete mode 100644 common/changelog/drop-column-mysql-diff.xml delete mode 100644 common/changelog/drop-column-mysql-patch.xml delete mode 100644 common/changelog/drop-column-oracle-diff.xml delete mode 100644 common/changelog/drop-column-oracle-patch.xml delete mode 100644 common/changelog/drop-column-pgsql-diff.xml delete mode 100644 common/changelog/drop-column-pgsql-patch.xml delete mode 100644 common/changelog/drop-column-sqlite-diff.xml delete mode 100644 common/changelog/drop-column-sqlite-patch.xml delete mode 100644 common/changelog/drop-column.hxx delete mode 100644 common/changelog/drop-foreign-key-mssql-diff.xml delete mode 100644 common/changelog/drop-foreign-key-mssql-patch.xml delete mode 100644 common/changelog/drop-foreign-key-mysql-diff.xml delete mode 100644 common/changelog/drop-foreign-key-mysql-patch.xml delete mode 100644 common/changelog/drop-foreign-key-oracle-diff.xml delete mode 100644 common/changelog/drop-foreign-key-oracle-patch.xml delete mode 100644 common/changelog/drop-foreign-key-pgsql-diff.xml delete mode 100644 common/changelog/drop-foreign-key-pgsql-patch.xml delete mode 100644 common/changelog/drop-foreign-key-sqlite-diff.xml delete mode 100644 common/changelog/drop-foreign-key-sqlite-patch.xml delete mode 100644 common/changelog/drop-foreign-key.hxx delete mode 100644 common/changelog/drop-index-mssql-diff.xml delete mode 100644 common/changelog/drop-index-mssql-patch.xml delete mode 100644 common/changelog/drop-index-mysql-diff.xml delete mode 100644 common/changelog/drop-index-mysql-patch.xml delete mode 100644 common/changelog/drop-index-oracle-diff.xml delete mode 100644 common/changelog/drop-index-oracle-patch.xml delete mode 100644 common/changelog/drop-index-pgsql-diff.xml delete mode 100644 common/changelog/drop-index-pgsql-patch.xml delete mode 100644 common/changelog/drop-index-sqlite-diff.xml delete mode 100644 common/changelog/drop-index-sqlite-patch.xml delete mode 100644 common/changelog/drop-index.hxx delete mode 100644 common/changelog/drop-table-mssql-diff.xml delete mode 100644 common/changelog/drop-table-mssql-patch.xml delete mode 100644 common/changelog/drop-table-mysql-diff.xml delete mode 100644 common/changelog/drop-table-mysql-patch.xml delete mode 100644 common/changelog/drop-table-oracle-diff.xml delete mode 100644 common/changelog/drop-table-oracle-patch.xml delete mode 100644 common/changelog/drop-table-pgsql-diff.xml delete mode 100644 common/changelog/drop-table-pgsql-patch.xml delete mode 100644 common/changelog/drop-table-sqlite-diff.xml delete mode 100644 common/changelog/drop-table-sqlite-patch.xml delete mode 100644 common/changelog/drop-table.hxx delete mode 120000 common/changelog/model-mssql-diff.xml delete mode 120000 common/changelog/model-mssql-patch.xml delete mode 100644 common/changelog/model-mssql.xml delete mode 120000 common/changelog/model-mysql-diff.xml delete mode 120000 common/changelog/model-mysql-patch.xml delete mode 100644 common/changelog/model-mysql.xml delete mode 120000 common/changelog/model-oracle-diff.xml delete mode 120000 common/changelog/model-oracle-patch.xml delete mode 100644 common/changelog/model-oracle.xml delete mode 120000 common/changelog/model-pgsql-diff.xml delete mode 120000 common/changelog/model-pgsql-patch.xml delete mode 100644 common/changelog/model-pgsql.xml delete mode 120000 common/changelog/model-sqlite-diff.xml delete mode 120000 common/changelog/model-sqlite-patch.xml delete mode 100644 common/changelog/model-sqlite.xml delete mode 100644 common/changelog/model.hxx delete mode 100644 common/changelog/testscript delete mode 100644 common/circular/multiple/.gitignore delete mode 100644 common/circular/multiple/buildfile delete mode 100644 common/circular/multiple/driver.cxx delete mode 100644 common/circular/multiple/test1.hxx delete mode 100644 common/circular/multiple/test2.hxx delete mode 100644 common/circular/multiple/testscript delete mode 100644 common/circular/single/buildfile delete mode 100644 common/circular/single/driver.cxx delete mode 100644 common/circular/single/test.hxx delete mode 100644 common/circular/single/testscript delete mode 100644 common/composite/buildfile delete mode 100644 common/composite/driver.cxx delete mode 100644 common/composite/test.hxx delete mode 100644 common/composite/testscript delete mode 100644 common/const-member/buildfile delete mode 100644 common/const-member/driver.cxx delete mode 100644 common/const-member/test.hxx delete mode 100644 common/const-member/testscript delete mode 100644 common/const-object/buildfile delete mode 100644 common/const-object/driver.cxx delete mode 100644 common/const-object/test.hxx delete mode 100644 common/const-object/testscript delete mode 100644 common/container/basics/buildfile delete mode 100644 common/container/basics/driver.cxx delete mode 100644 common/container/basics/test.hxx delete mode 100644 common/container/basics/testscript delete mode 100644 common/container/change-tracking/buildfile delete mode 100644 common/container/change-tracking/driver.cxx delete mode 100644 common/container/change-tracking/test.hxx delete mode 100644 common/container/change-tracking/testscript delete mode 100644 common/ctor/buildfile delete mode 100644 common/ctor/driver.cxx delete mode 100644 common/ctor/test.hxx delete mode 100644 common/ctor/testscript delete mode 100644 common/default/buildfile delete mode 100644 common/default/driver.cxx delete mode 100644 common/default/test.hxx delete mode 100644 common/default/testscript delete mode 100644 common/definition/.gitignore delete mode 100644 common/definition/buildfile delete mode 100644 common/definition/driver.cxx delete mode 100644 common/definition/test.hxx delete mode 100644 common/definition/testscript delete mode 100644 common/definition/time-mapping.hxx delete mode 100644 common/enum/buildfile delete mode 100644 common/enum/driver.cxx delete mode 100644 common/enum/test.hxx delete mode 100644 common/enum/testscript delete mode 100644 common/erase-query/buildfile delete mode 100644 common/erase-query/driver.cxx delete mode 100644 common/erase-query/test.hxx delete mode 100644 common/erase-query/testscript delete mode 100644 common/id/auto/buildfile delete mode 100644 common/id/auto/driver.cxx delete mode 100644 common/id/auto/test.hxx delete mode 100644 common/id/auto/testscript delete mode 100644 common/id/composite/buildfile delete mode 100644 common/id/composite/driver.cxx delete mode 100644 common/id/composite/test.hxx delete mode 100644 common/id/composite/testscript delete mode 100644 common/id/nested/buildfile delete mode 100644 common/id/nested/driver.cxx delete mode 100644 common/id/nested/test.hxx delete mode 100644 common/id/nested/testscript delete mode 100644 common/include/.gitignore delete mode 100644 common/include/buildfile delete mode 100644 common/include/driver.cxx delete mode 100644 common/include/obj1.hxx delete mode 100644 common/include/obj2.hxx delete mode 100644 common/include/obj3.hxx delete mode 100644 common/include/objs1.hxx delete mode 100644 common/include/objs2.hxx delete mode 100644 common/include/objs3.hxx delete mode 100644 common/include/objs4.hxx delete mode 100644 common/include/test1.hxx delete mode 100644 common/include/test2.hxx delete mode 100644 common/include/test3.hxx delete mode 100644 common/include/test4.hxx delete mode 100644 common/include/testscript delete mode 100644 common/index/buildfile delete mode 100644 common/index/driver.cxx delete mode 100644 common/index/test.hxx delete mode 100644 common/index/testscript delete mode 100644 common/inheritance/polymorphism/.gitignore delete mode 100644 common/inheritance/polymorphism/buildfile delete mode 100644 common/inheritance/polymorphism/driver.cxx delete mode 100644 common/inheritance/polymorphism/test1.hxx delete mode 100644 common/inheritance/polymorphism/test10.hxx delete mode 100644 common/inheritance/polymorphism/test11.hxx delete mode 100644 common/inheritance/polymorphism/test12.hxx delete mode 100644 common/inheritance/polymorphism/test13.hxx delete mode 100644 common/inheritance/polymorphism/test14.hxx delete mode 100644 common/inheritance/polymorphism/test15.hxx delete mode 100644 common/inheritance/polymorphism/test2.hxx delete mode 100644 common/inheritance/polymorphism/test3.hxx delete mode 100644 common/inheritance/polymorphism/test4.hxx delete mode 100644 common/inheritance/polymorphism/test5.hxx delete mode 100644 common/inheritance/polymorphism/test6.hxx delete mode 100644 common/inheritance/polymorphism/test7.hxx delete mode 100644 common/inheritance/polymorphism/test8.hxx delete mode 100644 common/inheritance/polymorphism/test9.hxx delete mode 100644 common/inheritance/polymorphism/testscript delete mode 100644 common/inheritance/reuse/buildfile delete mode 100644 common/inheritance/reuse/driver.cxx delete mode 100644 common/inheritance/reuse/test.hxx delete mode 100644 common/inheritance/reuse/testscript delete mode 100644 common/inheritance/transient/buildfile delete mode 100644 common/inheritance/transient/driver.cxx delete mode 100644 common/inheritance/transient/test.hxx delete mode 100644 common/inheritance/transient/testscript delete mode 100644 common/inverse/buildfile delete mode 100644 common/inverse/driver.cxx delete mode 100644 common/inverse/test.hxx delete mode 100644 common/inverse/testscript delete mode 100644 common/lazy-ptr/buildfile delete mode 100644 common/lazy-ptr/driver.cxx delete mode 100644 common/lazy-ptr/test.hxx delete mode 100644 common/lazy-ptr/testscript delete mode 100644 common/lifecycle/buildfile delete mode 100644 common/lifecycle/driver.cxx delete mode 100644 common/lifecycle/test.hxx delete mode 100644 common/lifecycle/testscript delete mode 100644 common/no-id/buildfile delete mode 100644 common/no-id/driver.cxx delete mode 100644 common/no-id/test.hxx delete mode 100644 common/no-id/testscript delete mode 100644 common/object/buildfile delete mode 100644 common/object/driver.cxx delete mode 100644 common/object/test.hxx delete mode 100644 common/object/testscript delete mode 100644 common/optimistic/buildfile delete mode 100644 common/optimistic/driver.cxx delete mode 100644 common/optimistic/test.hxx delete mode 100644 common/optimistic/testscript delete mode 100644 common/pragma/buildfile delete mode 100644 common/pragma/driver.cxx delete mode 100644 common/pragma/test.hxx delete mode 100644 common/pragma/testscript delete mode 100644 common/prepared/buildfile delete mode 100644 common/prepared/driver.cxx delete mode 100644 common/prepared/test.hxx delete mode 100644 common/prepared/testscript delete mode 100644 common/query/array/buildfile delete mode 100644 common/query/array/driver.cxx delete mode 100644 common/query/array/test.hxx delete mode 100644 common/query/array/testscript delete mode 100644 common/query/basics/buildfile delete mode 100644 common/query/basics/driver.cxx delete mode 100644 common/query/basics/test.hxx delete mode 100644 common/query/basics/testscript delete mode 100644 common/query/one/buildfile delete mode 100644 common/query/one/driver.cxx delete mode 100644 common/query/one/test.hxx delete mode 100644 common/query/one/testscript delete mode 100644 common/readonly/buildfile delete mode 100644 common/readonly/driver.cxx delete mode 100644 common/readonly/test.hxx delete mode 100644 common/readonly/testscript delete mode 100644 common/relationship/basics/buildfile delete mode 100644 common/relationship/basics/driver.cxx delete mode 100644 common/relationship/basics/test.hxx delete mode 100644 common/relationship/basics/testscript delete mode 100644 common/relationship/on-delete/buildfile delete mode 100644 common/relationship/on-delete/driver.cxx delete mode 100644 common/relationship/on-delete/test.hxx delete mode 100644 common/relationship/on-delete/testscript delete mode 100644 common/relationship/query/buildfile delete mode 100644 common/relationship/query/driver.cxx delete mode 100644 common/relationship/query/test.hxx delete mode 100644 common/relationship/query/testscript delete mode 100644 common/schema/embedded/basics/buildfile delete mode 100644 common/schema/embedded/basics/driver.cxx delete mode 100644 common/schema/embedded/basics/test.hxx delete mode 100644 common/schema/embedded/basics/testscript delete mode 100644 common/schema/embedded/order/.gitignore delete mode 100644 common/schema/embedded/order/buildfile delete mode 100644 common/schema/embedded/order/driver.cxx delete mode 100644 common/schema/embedded/order/test1.hxx delete mode 100644 common/schema/embedded/order/test2.hxx delete mode 100644 common/schema/embedded/order/testscript delete mode 100644 common/schema/namespace/buildfile delete mode 100644 common/schema/namespace/driver.cxx delete mode 100644 common/schema/namespace/test.hxx delete mode 100644 common/schema/namespace/testscript delete mode 100644 common/section/basics/buildfile delete mode 100644 common/section/basics/driver.cxx delete mode 100644 common/section/basics/test.hxx delete mode 100644 common/section/basics/testscript delete mode 100644 common/section/polymorphism/buildfile delete mode 100644 common/section/polymorphism/driver.cxx delete mode 100644 common/section/polymorphism/test.hxx delete mode 100644 common/section/polymorphism/testscript delete mode 100644 common/session/cache/buildfile delete mode 100644 common/session/cache/driver.cxx delete mode 100644 common/session/cache/test.hxx delete mode 100644 common/session/cache/testscript delete mode 100644 common/session/custom/buildfile delete mode 100644 common/session/custom/driver.cxx delete mode 100644 common/session/custom/session.cxx delete mode 100644 common/session/custom/session.hxx delete mode 100644 common/session/custom/session.txx delete mode 100644 common/session/custom/test.hxx delete mode 100644 common/session/custom/testscript delete mode 100644 common/statement/processing/buildfile delete mode 100644 common/statement/processing/driver.cxx delete mode 100644 common/statement/processing/testscript delete mode 100644 common/threads/buildfile delete mode 100644 common/threads/driver.cxx delete mode 100644 common/threads/test.hxx delete mode 100644 common/threads/testscript delete mode 100644 common/transaction/basics/buildfile delete mode 100644 common/transaction/basics/driver.cxx delete mode 100644 common/transaction/basics/testscript delete mode 100644 common/transaction/callback/buildfile delete mode 100644 common/transaction/callback/driver.cxx delete mode 100644 common/transaction/callback/testscript delete mode 100644 common/types/buildfile delete mode 100644 common/types/driver.cxx delete mode 100644 common/types/test.hxx delete mode 100644 common/types/testscript delete mode 100644 common/view/basics/buildfile delete mode 100644 common/view/basics/driver.cxx delete mode 100644 common/view/basics/test.hxx delete mode 100644 common/view/basics/testscript delete mode 100644 common/view/olv/.gitignore delete mode 100644 common/view/olv/buildfile delete mode 100644 common/view/olv/driver.cxx delete mode 100644 common/view/olv/test1.hxx delete mode 100644 common/view/olv/test2.hxx delete mode 100644 common/view/olv/test3.hxx delete mode 100644 common/view/olv/test4.hxx delete mode 100644 common/view/olv/test5.hxx delete mode 100644 common/view/olv/test6.hxx delete mode 100644 common/view/olv/test7.hxx delete mode 100644 common/view/olv/test8.hxx delete mode 100644 common/view/olv/test9.hxx delete mode 100644 common/view/olv/testscript delete mode 100644 common/virtual/buildfile delete mode 100644 common/virtual/driver.cxx delete mode 100644 common/virtual/test.hxx delete mode 100644 common/virtual/testscript delete mode 100644 common/wrapper/buildfile delete mode 100644 common/wrapper/driver.cxx delete mode 100644 common/wrapper/test.hxx delete mode 100644 common/wrapper/testscript delete mode 100644 database-options.testscript delete mode 100644 evolution/add-column/driver.cxx delete mode 100644 evolution/add-column/model.hxx delete mode 100644 evolution/add-column/test1.hxx delete mode 100644 evolution/add-column/test2.hxx delete mode 100644 evolution/add-column/test3.hxx delete mode 100644 evolution/add-foreign-key/driver.cxx delete mode 100644 evolution/add-foreign-key/model.hxx delete mode 100644 evolution/add-foreign-key/test1.hxx delete mode 100644 evolution/add-foreign-key/test2.hxx delete mode 100644 evolution/add-foreign-key/test3.hxx delete mode 100644 evolution/add-index/driver.cxx delete mode 100644 evolution/add-index/model.hxx delete mode 100644 evolution/add-index/test1.hxx delete mode 100644 evolution/add-index/test2.hxx delete mode 100644 evolution/add-index/test3.hxx delete mode 100644 evolution/add-table/driver.cxx delete mode 100644 evolution/add-table/model.hxx delete mode 100644 evolution/add-table/test1.hxx delete mode 100644 evolution/add-table/test2.hxx delete mode 100644 evolution/add-table/test3.hxx delete mode 100644 evolution/alter-column/driver.cxx delete mode 100644 evolution/alter-column/model.hxx delete mode 100644 evolution/alter-column/test1.hxx delete mode 100644 evolution/alter-column/test2.hxx delete mode 100644 evolution/alter-column/test3.hxx delete mode 100644 evolution/combined/driver.cxx delete mode 100644 evolution/combined/model.hxx delete mode 100644 evolution/combined/test1.hxx delete mode 100644 evolution/combined/test2.hxx delete mode 100644 evolution/combined/test3.hxx delete mode 100644 evolution/data/driver.cxx delete mode 100644 evolution/data/model.hxx delete mode 100644 evolution/data/test1.hxx delete mode 100644 evolution/data/test2.hxx delete mode 100644 evolution/data/test3.hxx delete mode 100644 evolution/drop-column/driver.cxx delete mode 100644 evolution/drop-column/model.hxx delete mode 100644 evolution/drop-column/test1.hxx delete mode 100644 evolution/drop-column/test2.hxx delete mode 100644 evolution/drop-column/test3.hxx delete mode 100644 evolution/drop-foreign-key/driver.cxx delete mode 100644 evolution/drop-foreign-key/model.hxx delete mode 100644 evolution/drop-foreign-key/test1.hxx delete mode 100644 evolution/drop-foreign-key/test2.hxx delete mode 100644 evolution/drop-foreign-key/test3.hxx delete mode 100644 evolution/drop-index/driver.cxx delete mode 100644 evolution/drop-index/model.hxx delete mode 100644 evolution/drop-index/test1.hxx delete mode 100644 evolution/drop-index/test2.hxx delete mode 100644 evolution/drop-index/test3.hxx delete mode 100644 evolution/drop-table/driver.cxx delete mode 100644 evolution/drop-table/model.hxx delete mode 100644 evolution/drop-table/test1.hxx delete mode 100644 evolution/drop-table/test2.hxx delete mode 100644 evolution/drop-table/test3.hxx delete mode 100644 evolution/embedded/driver.cxx delete mode 100644 evolution/embedded/model.hxx delete mode 100644 evolution/embedded/test1.hxx delete mode 100644 evolution/embedded/test2.hxx delete mode 100644 evolution/embedded/test3.hxx delete mode 100644 evolution/soft-add/driver.cxx delete mode 100644 evolution/soft-add/model.hxx delete mode 100644 evolution/soft-add/test1.hxx delete mode 100644 evolution/soft-add/test2.hxx delete mode 100644 evolution/soft-add/test3.hxx delete mode 100644 evolution/soft-delete/driver.cxx delete mode 100644 evolution/soft-delete/model.hxx delete mode 100644 evolution/soft-delete/test1.hxx delete mode 100644 evolution/soft-delete/test2.hxx delete mode 100644 evolution/soft-delete/test3.hxx delete mode 100644 evolution/template/driver.cxx delete mode 100644 evolution/template/model.hxx delete mode 100644 evolution/template/template-vc10.vcxproj delete mode 100644 evolution/template/template-vc10.vcxproj.filters delete mode 100644 evolution/template/template-vc11.vcxproj delete mode 100644 evolution/template/template-vc11.vcxproj.filters delete mode 100644 evolution/template/template-vc12.vcxproj delete mode 100644 evolution/template/template-vc12.vcxproj.filters delete mode 100644 evolution/template/template-vc8.vcproj delete mode 100644 evolution/template/template-vc9.vcproj delete mode 100644 evolution/template/test1.hxx delete mode 100644 evolution/template/test2.hxx delete mode 100644 evolution/template/test3.hxx delete mode 100644 evolution/version/driver.cxx delete mode 100644 evolution/version/model.hxx delete mode 100644 evolution/version/test1.hxx delete mode 100644 evolution/version/test2.hxx delete mode 100644 evolution/version/test3.hxx delete mode 100644 libcommon/.gitignore delete mode 100644 libcommon/buffer.hxx delete mode 100644 libcommon/buildfile delete mode 100644 libcommon/common.cxx delete mode 100644 libcommon/common.hxx delete mode 100644 libcommon/common.txx delete mode 100644 libcommon/concrete.hxx delete mode 100644 libcommon/config.hxx.in delete mode 100644 libcommon/export.hxx delete mode 100644 manifest delete mode 100644 mssql/custom/custom.sql delete mode 100644 mssql/custom/driver.cxx delete mode 100644 mssql/custom/query.hxx delete mode 100644 mssql/custom/test.hxx delete mode 100644 mssql/custom/traits.cxx delete mode 100644 mssql/custom/traits.hxx delete mode 100644 mssql/database/driver.cxx delete mode 100644 mssql/native/driver.cxx delete mode 100644 mssql/query/driver.cxx delete mode 100644 mssql/query/test.hxx delete mode 100644 mssql/stored-proc/driver.cxx delete mode 100644 mssql/stored-proc/test.hxx delete mode 100644 mssql/template/driver.cxx delete mode 100644 mssql/template/template-vc10.vcxproj delete mode 100644 mssql/template/template-vc10.vcxproj.filters delete mode 100644 mssql/template/template-vc11.vcxproj delete mode 100644 mssql/template/template-vc11.vcxproj.filters delete mode 100644 mssql/template/template-vc12.vcxproj delete mode 100644 mssql/template/template-vc12.vcxproj.filters delete mode 100644 mssql/template/template-vc8.vcproj delete mode 100644 mssql/template/template-vc9.vcproj delete mode 100644 mssql/template/test.hxx delete mode 100644 mssql/types/driver.cxx delete mode 100644 mssql/types/test.hxx delete mode 100644 mssql/types/traits.hxx delete mode 100644 mysql-schema.testscript delete mode 100644 mysql.testscript delete mode 100644 mysql/custom/buildfile delete mode 100644 mysql/custom/driver.cxx delete mode 100644 mysql/custom/query.hxx delete mode 100644 mysql/custom/test.hxx delete mode 100644 mysql/custom/testscript delete mode 100644 mysql/custom/traits.hxx delete mode 100644 mysql/database/buildfile delete mode 100644 mysql/database/driver.cxx delete mode 100644 mysql/database/testscript delete mode 100644 mysql/index/buildfile delete mode 100644 mysql/index/driver.cxx delete mode 100644 mysql/index/test.hxx delete mode 100644 mysql/index/testscript delete mode 100644 mysql/native/buildfile delete mode 100644 mysql/native/driver.cxx delete mode 100644 mysql/native/testscript delete mode 100644 mysql/truncation/buildfile delete mode 100644 mysql/truncation/driver.cxx delete mode 100644 mysql/truncation/test.hxx delete mode 100644 mysql/truncation/testscript delete mode 100644 mysql/types/buildfile delete mode 100644 mysql/types/driver.cxx delete mode 100644 mysql/types/test.hxx delete mode 100644 mysql/types/testscript delete mode 100644 mysql/types/traits.hxx create mode 100644 odb-tests/.gitignore create mode 100644 odb-tests/GPLv2 create mode 100644 odb-tests/LICENSE create mode 100644 odb-tests/README.md create mode 100644 odb-tests/boost/common/multi-index/driver.cxx create mode 100644 odb-tests/boost/common/multi-index/test.hxx create mode 100644 odb-tests/boost/common/optional/driver.cxx create mode 100644 odb-tests/boost/common/optional/test.hxx create mode 100644 odb-tests/boost/common/smart-ptr/driver.cxx create mode 100644 odb-tests/boost/common/smart-ptr/test.hxx create mode 100644 odb-tests/boost/common/template/driver.cxx create mode 100644 odb-tests/boost/common/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/common/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/common/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/common/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/common/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/common/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/common/template/template-vc8.vcproj create mode 100644 odb-tests/boost/common/template/template-vc9.vcproj create mode 100644 odb-tests/boost/common/template/test.hxx create mode 100644 odb-tests/boost/common/unordered/driver.cxx create mode 100644 odb-tests/boost/common/unordered/test.hxx create mode 100644 odb-tests/boost/common/uuid/driver.cxx create mode 100644 odb-tests/boost/common/uuid/test.hxx create mode 100644 odb-tests/boost/mssql/date-time/driver.cxx create mode 100644 odb-tests/boost/mssql/date-time/test.hxx create mode 100644 odb-tests/boost/mssql/template/driver.cxx create mode 100644 odb-tests/boost/mssql/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/mssql/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/mssql/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/mssql/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/mssql/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/mssql/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/mssql/template/template-vc8.vcproj create mode 100644 odb-tests/boost/mssql/template/template-vc9.vcproj create mode 100644 odb-tests/boost/mssql/template/test.hxx create mode 100644 odb-tests/boost/mysql/date-time/driver.cxx create mode 100644 odb-tests/boost/mysql/date-time/test.hxx create mode 100644 odb-tests/boost/mysql/template/driver.cxx create mode 100644 odb-tests/boost/mysql/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/mysql/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/mysql/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/mysql/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/mysql/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/mysql/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/mysql/template/template-vc8.vcproj create mode 100644 odb-tests/boost/mysql/template/template-vc9.vcproj create mode 100644 odb-tests/boost/mysql/template/test.hxx create mode 100644 odb-tests/boost/oracle/date-time/driver.cxx create mode 100644 odb-tests/boost/oracle/date-time/test.hxx create mode 100644 odb-tests/boost/oracle/template/driver.cxx create mode 100644 odb-tests/boost/oracle/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/oracle/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/oracle/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/oracle/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/oracle/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/oracle/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/oracle/template/template-vc8.vcproj create mode 100644 odb-tests/boost/oracle/template/template-vc9.vcproj create mode 100644 odb-tests/boost/oracle/template/test.hxx create mode 100644 odb-tests/boost/pgsql/date-time/driver.cxx create mode 100644 odb-tests/boost/pgsql/date-time/test.hxx create mode 100644 odb-tests/boost/pgsql/template/driver.cxx create mode 100644 odb-tests/boost/pgsql/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/pgsql/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/pgsql/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/pgsql/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/pgsql/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/pgsql/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/pgsql/template/template-vc8.vcproj create mode 100644 odb-tests/boost/pgsql/template/template-vc9.vcproj create mode 100644 odb-tests/boost/pgsql/template/test.hxx create mode 100644 odb-tests/boost/sqlite/date-time/driver.cxx create mode 100644 odb-tests/boost/sqlite/date-time/test.hxx create mode 100644 odb-tests/boost/sqlite/template/driver.cxx create mode 100644 odb-tests/boost/sqlite/template/template-vc10.vcxproj create mode 100644 odb-tests/boost/sqlite/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/boost/sqlite/template/template-vc11.vcxproj create mode 100644 odb-tests/boost/sqlite/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/boost/sqlite/template/template-vc12.vcxproj create mode 100644 odb-tests/boost/sqlite/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/boost/sqlite/template/template-vc8.vcproj create mode 100644 odb-tests/boost/sqlite/template/template-vc9.vcproj create mode 100644 odb-tests/boost/sqlite/template/test.hxx create mode 100644 odb-tests/build/.gitignore create mode 100644 odb-tests/build/bootstrap.build create mode 100644 odb-tests/build/export.build create mode 100644 odb-tests/build/root.build create mode 100644 odb-tests/buildfile create mode 100644 odb-tests/common/access/buildfile create mode 100644 odb-tests/common/access/driver.cxx create mode 100644 odb-tests/common/access/test.hxx create mode 100644 odb-tests/common/access/testscript create mode 100644 odb-tests/common/as/buildfile create mode 100644 odb-tests/common/as/driver.cxx create mode 100644 odb-tests/common/as/test.hxx create mode 100644 odb-tests/common/as/testscript create mode 100644 odb-tests/common/blob/buildfile create mode 100644 odb-tests/common/blob/driver.cxx create mode 100644 odb-tests/common/blob/test.hxx create mode 100644 odb-tests/common/blob/testscript create mode 100644 odb-tests/common/buildfile create mode 100644 odb-tests/common/bulk/buildfile create mode 100644 odb-tests/common/bulk/driver.cxx create mode 100644 odb-tests/common/bulk/test.hxx create mode 100644 odb-tests/common/bulk/testscript create mode 100644 odb-tests/common/callback/buildfile create mode 100644 odb-tests/common/callback/driver.cxx create mode 100644 odb-tests/common/callback/test.hxx create mode 100644 odb-tests/common/callback/testscript create mode 100644 odb-tests/common/changelog/.gitignore create mode 100644 odb-tests/common/changelog/add-column-mssql-diff.xml create mode 100644 odb-tests/common/changelog/add-column-mssql-patch.xml create mode 100644 odb-tests/common/changelog/add-column-mysql-diff.xml create mode 100644 odb-tests/common/changelog/add-column-mysql-patch.xml create mode 100644 odb-tests/common/changelog/add-column-oracle-diff.xml create mode 100644 odb-tests/common/changelog/add-column-oracle-patch.xml create mode 100644 odb-tests/common/changelog/add-column-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/add-column-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/add-column-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/add-column-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/add-column.hxx create mode 100644 odb-tests/common/changelog/add-foreign-key-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-mssql-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-mssql-patch.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-mysql-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-mysql-patch.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-oracle-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-oracle-patch.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/add-foreign-key-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/add-foreign-key.hxx create mode 100644 odb-tests/common/changelog/add-index-mssql-diff.xml create mode 100644 odb-tests/common/changelog/add-index-mssql-patch.xml create mode 100644 odb-tests/common/changelog/add-index-mysql-diff.xml create mode 100644 odb-tests/common/changelog/add-index-mysql-patch.xml create mode 100644 odb-tests/common/changelog/add-index-oracle-diff.xml create mode 100644 odb-tests/common/changelog/add-index-oracle-patch.xml create mode 100644 odb-tests/common/changelog/add-index-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/add-index-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/add-index-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/add-index-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/add-index.hxx create mode 100644 odb-tests/common/changelog/add-table-mssql-diff.xml create mode 100644 odb-tests/common/changelog/add-table-mssql-patch.xml create mode 100644 odb-tests/common/changelog/add-table-mysql-diff.xml create mode 100644 odb-tests/common/changelog/add-table-mysql-patch.xml create mode 100644 odb-tests/common/changelog/add-table-oracle-diff.xml create mode 100644 odb-tests/common/changelog/add-table-oracle-patch.xml create mode 100644 odb-tests/common/changelog/add-table-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/add-table-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/add-table-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/add-table-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/add-table.hxx create mode 100644 odb-tests/common/changelog/alter-column-mssql-diff.xml create mode 100644 odb-tests/common/changelog/alter-column-mssql-patch.xml create mode 100644 odb-tests/common/changelog/alter-column-mysql-diff.xml create mode 100644 odb-tests/common/changelog/alter-column-mysql-patch.xml create mode 100644 odb-tests/common/changelog/alter-column-oracle-diff.xml create mode 100644 odb-tests/common/changelog/alter-column-oracle-patch.xml create mode 100644 odb-tests/common/changelog/alter-column-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/alter-column-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/alter-column-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/alter-column-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/alter-column.hxx create mode 100644 odb-tests/common/changelog/buildfile create mode 100644 odb-tests/common/changelog/drop-column-mssql-diff.xml create mode 100644 odb-tests/common/changelog/drop-column-mssql-patch.xml create mode 100644 odb-tests/common/changelog/drop-column-mysql-diff.xml create mode 100644 odb-tests/common/changelog/drop-column-mysql-patch.xml create mode 100644 odb-tests/common/changelog/drop-column-oracle-diff.xml create mode 100644 odb-tests/common/changelog/drop-column-oracle-patch.xml create mode 100644 odb-tests/common/changelog/drop-column-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/drop-column-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/drop-column-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/drop-column-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/drop-column.hxx create mode 100644 odb-tests/common/changelog/drop-foreign-key-mssql-diff.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-mssql-patch.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-mysql-diff.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-mysql-patch.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-oracle-diff.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-oracle-patch.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/drop-foreign-key.hxx create mode 100644 odb-tests/common/changelog/drop-index-mssql-diff.xml create mode 100644 odb-tests/common/changelog/drop-index-mssql-patch.xml create mode 100644 odb-tests/common/changelog/drop-index-mysql-diff.xml create mode 100644 odb-tests/common/changelog/drop-index-mysql-patch.xml create mode 100644 odb-tests/common/changelog/drop-index-oracle-diff.xml create mode 100644 odb-tests/common/changelog/drop-index-oracle-patch.xml create mode 100644 odb-tests/common/changelog/drop-index-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/drop-index-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/drop-index-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/drop-index-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/drop-index.hxx create mode 100644 odb-tests/common/changelog/drop-table-mssql-diff.xml create mode 100644 odb-tests/common/changelog/drop-table-mssql-patch.xml create mode 100644 odb-tests/common/changelog/drop-table-mysql-diff.xml create mode 100644 odb-tests/common/changelog/drop-table-mysql-patch.xml create mode 100644 odb-tests/common/changelog/drop-table-oracle-diff.xml create mode 100644 odb-tests/common/changelog/drop-table-oracle-patch.xml create mode 100644 odb-tests/common/changelog/drop-table-pgsql-diff.xml create mode 100644 odb-tests/common/changelog/drop-table-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/drop-table-sqlite-diff.xml create mode 100644 odb-tests/common/changelog/drop-table-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/drop-table.hxx create mode 120000 odb-tests/common/changelog/model-mssql-diff.xml create mode 120000 odb-tests/common/changelog/model-mssql-patch.xml create mode 100644 odb-tests/common/changelog/model-mssql.xml create mode 120000 odb-tests/common/changelog/model-mysql-diff.xml create mode 120000 odb-tests/common/changelog/model-mysql-patch.xml create mode 100644 odb-tests/common/changelog/model-mysql.xml create mode 120000 odb-tests/common/changelog/model-oracle-diff.xml create mode 120000 odb-tests/common/changelog/model-oracle-patch.xml create mode 100644 odb-tests/common/changelog/model-oracle.xml create mode 120000 odb-tests/common/changelog/model-pgsql-diff.xml create mode 120000 odb-tests/common/changelog/model-pgsql-patch.xml create mode 100644 odb-tests/common/changelog/model-pgsql.xml create mode 120000 odb-tests/common/changelog/model-sqlite-diff.xml create mode 120000 odb-tests/common/changelog/model-sqlite-patch.xml create mode 100644 odb-tests/common/changelog/model-sqlite.xml create mode 100644 odb-tests/common/changelog/model.hxx create mode 100644 odb-tests/common/changelog/testscript create mode 100644 odb-tests/common/circular/multiple/.gitignore create mode 100644 odb-tests/common/circular/multiple/buildfile create mode 100644 odb-tests/common/circular/multiple/driver.cxx create mode 100644 odb-tests/common/circular/multiple/test1.hxx create mode 100644 odb-tests/common/circular/multiple/test2.hxx create mode 100644 odb-tests/common/circular/multiple/testscript create mode 100644 odb-tests/common/circular/single/buildfile create mode 100644 odb-tests/common/circular/single/driver.cxx create mode 100644 odb-tests/common/circular/single/test.hxx create mode 100644 odb-tests/common/circular/single/testscript create mode 100644 odb-tests/common/composite/buildfile create mode 100644 odb-tests/common/composite/driver.cxx create mode 100644 odb-tests/common/composite/test.hxx create mode 100644 odb-tests/common/composite/testscript create mode 100644 odb-tests/common/const-member/buildfile create mode 100644 odb-tests/common/const-member/driver.cxx create mode 100644 odb-tests/common/const-member/test.hxx create mode 100644 odb-tests/common/const-member/testscript create mode 100644 odb-tests/common/const-object/buildfile create mode 100644 odb-tests/common/const-object/driver.cxx create mode 100644 odb-tests/common/const-object/test.hxx create mode 100644 odb-tests/common/const-object/testscript create mode 100644 odb-tests/common/container/basics/buildfile create mode 100644 odb-tests/common/container/basics/driver.cxx create mode 100644 odb-tests/common/container/basics/test.hxx create mode 100644 odb-tests/common/container/basics/testscript create mode 100644 odb-tests/common/container/change-tracking/buildfile create mode 100644 odb-tests/common/container/change-tracking/driver.cxx create mode 100644 odb-tests/common/container/change-tracking/test.hxx create mode 100644 odb-tests/common/container/change-tracking/testscript create mode 100644 odb-tests/common/ctor/buildfile create mode 100644 odb-tests/common/ctor/driver.cxx create mode 100644 odb-tests/common/ctor/test.hxx create mode 100644 odb-tests/common/ctor/testscript create mode 100644 odb-tests/common/default/buildfile create mode 100644 odb-tests/common/default/driver.cxx create mode 100644 odb-tests/common/default/test.hxx create mode 100644 odb-tests/common/default/testscript create mode 100644 odb-tests/common/definition/.gitignore create mode 100644 odb-tests/common/definition/buildfile create mode 100644 odb-tests/common/definition/driver.cxx create mode 100644 odb-tests/common/definition/test.hxx create mode 100644 odb-tests/common/definition/testscript create mode 100644 odb-tests/common/definition/time-mapping.hxx create mode 100644 odb-tests/common/enum/buildfile create mode 100644 odb-tests/common/enum/driver.cxx create mode 100644 odb-tests/common/enum/test.hxx create mode 100644 odb-tests/common/enum/testscript create mode 100644 odb-tests/common/erase-query/buildfile create mode 100644 odb-tests/common/erase-query/driver.cxx create mode 100644 odb-tests/common/erase-query/test.hxx create mode 100644 odb-tests/common/erase-query/testscript create mode 100644 odb-tests/common/id/auto/buildfile create mode 100644 odb-tests/common/id/auto/driver.cxx create mode 100644 odb-tests/common/id/auto/test.hxx create mode 100644 odb-tests/common/id/auto/testscript create mode 100644 odb-tests/common/id/composite/buildfile create mode 100644 odb-tests/common/id/composite/driver.cxx create mode 100644 odb-tests/common/id/composite/test.hxx create mode 100644 odb-tests/common/id/composite/testscript create mode 100644 odb-tests/common/id/nested/buildfile create mode 100644 odb-tests/common/id/nested/driver.cxx create mode 100644 odb-tests/common/id/nested/test.hxx create mode 100644 odb-tests/common/id/nested/testscript create mode 100644 odb-tests/common/include/.gitignore create mode 100644 odb-tests/common/include/buildfile create mode 100644 odb-tests/common/include/driver.cxx create mode 100644 odb-tests/common/include/obj1.hxx create mode 100644 odb-tests/common/include/obj2.hxx create mode 100644 odb-tests/common/include/obj3.hxx create mode 100644 odb-tests/common/include/objs1.hxx create mode 100644 odb-tests/common/include/objs2.hxx create mode 100644 odb-tests/common/include/objs3.hxx create mode 100644 odb-tests/common/include/objs4.hxx create mode 100644 odb-tests/common/include/test1.hxx create mode 100644 odb-tests/common/include/test2.hxx create mode 100644 odb-tests/common/include/test3.hxx create mode 100644 odb-tests/common/include/test4.hxx create mode 100644 odb-tests/common/include/testscript create mode 100644 odb-tests/common/index/buildfile create mode 100644 odb-tests/common/index/driver.cxx create mode 100644 odb-tests/common/index/test.hxx create mode 100644 odb-tests/common/index/testscript create mode 100644 odb-tests/common/inheritance/polymorphism/.gitignore create mode 100644 odb-tests/common/inheritance/polymorphism/buildfile create mode 100644 odb-tests/common/inheritance/polymorphism/driver.cxx create mode 100644 odb-tests/common/inheritance/polymorphism/test1.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test10.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test11.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test12.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test13.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test14.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test15.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test2.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test3.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test4.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test5.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test6.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test7.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test8.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/test9.hxx create mode 100644 odb-tests/common/inheritance/polymorphism/testscript create mode 100644 odb-tests/common/inheritance/reuse/buildfile create mode 100644 odb-tests/common/inheritance/reuse/driver.cxx create mode 100644 odb-tests/common/inheritance/reuse/test.hxx create mode 100644 odb-tests/common/inheritance/reuse/testscript create mode 100644 odb-tests/common/inheritance/transient/buildfile create mode 100644 odb-tests/common/inheritance/transient/driver.cxx create mode 100644 odb-tests/common/inheritance/transient/test.hxx create mode 100644 odb-tests/common/inheritance/transient/testscript create mode 100644 odb-tests/common/inverse/buildfile create mode 100644 odb-tests/common/inverse/driver.cxx create mode 100644 odb-tests/common/inverse/test.hxx create mode 100644 odb-tests/common/inverse/testscript create mode 100644 odb-tests/common/lazy-ptr/buildfile create mode 100644 odb-tests/common/lazy-ptr/driver.cxx create mode 100644 odb-tests/common/lazy-ptr/test.hxx create mode 100644 odb-tests/common/lazy-ptr/testscript create mode 100644 odb-tests/common/lifecycle/buildfile create mode 100644 odb-tests/common/lifecycle/driver.cxx create mode 100644 odb-tests/common/lifecycle/test.hxx create mode 100644 odb-tests/common/lifecycle/testscript create mode 100644 odb-tests/common/no-id/buildfile create mode 100644 odb-tests/common/no-id/driver.cxx create mode 100644 odb-tests/common/no-id/test.hxx create mode 100644 odb-tests/common/no-id/testscript create mode 100644 odb-tests/common/object/buildfile create mode 100644 odb-tests/common/object/driver.cxx create mode 100644 odb-tests/common/object/test.hxx create mode 100644 odb-tests/common/object/testscript create mode 100644 odb-tests/common/optimistic/buildfile create mode 100644 odb-tests/common/optimistic/driver.cxx create mode 100644 odb-tests/common/optimistic/test.hxx create mode 100644 odb-tests/common/optimistic/testscript create mode 100644 odb-tests/common/pragma/buildfile create mode 100644 odb-tests/common/pragma/driver.cxx create mode 100644 odb-tests/common/pragma/test.hxx create mode 100644 odb-tests/common/pragma/testscript create mode 100644 odb-tests/common/prepared/buildfile create mode 100644 odb-tests/common/prepared/driver.cxx create mode 100644 odb-tests/common/prepared/test.hxx create mode 100644 odb-tests/common/prepared/testscript create mode 100644 odb-tests/common/query/array/buildfile create mode 100644 odb-tests/common/query/array/driver.cxx create mode 100644 odb-tests/common/query/array/test.hxx create mode 100644 odb-tests/common/query/array/testscript create mode 100644 odb-tests/common/query/basics/buildfile create mode 100644 odb-tests/common/query/basics/driver.cxx create mode 100644 odb-tests/common/query/basics/test.hxx create mode 100644 odb-tests/common/query/basics/testscript create mode 100644 odb-tests/common/query/one/buildfile create mode 100644 odb-tests/common/query/one/driver.cxx create mode 100644 odb-tests/common/query/one/test.hxx create mode 100644 odb-tests/common/query/one/testscript create mode 100644 odb-tests/common/readonly/buildfile create mode 100644 odb-tests/common/readonly/driver.cxx create mode 100644 odb-tests/common/readonly/test.hxx create mode 100644 odb-tests/common/readonly/testscript create mode 100644 odb-tests/common/relationship/basics/buildfile create mode 100644 odb-tests/common/relationship/basics/driver.cxx create mode 100644 odb-tests/common/relationship/basics/test.hxx create mode 100644 odb-tests/common/relationship/basics/testscript create mode 100644 odb-tests/common/relationship/on-delete/buildfile create mode 100644 odb-tests/common/relationship/on-delete/driver.cxx create mode 100644 odb-tests/common/relationship/on-delete/test.hxx create mode 100644 odb-tests/common/relationship/on-delete/testscript create mode 100644 odb-tests/common/relationship/query/buildfile create mode 100644 odb-tests/common/relationship/query/driver.cxx create mode 100644 odb-tests/common/relationship/query/test.hxx create mode 100644 odb-tests/common/relationship/query/testscript create mode 100644 odb-tests/common/schema/embedded/basics/buildfile create mode 100644 odb-tests/common/schema/embedded/basics/driver.cxx create mode 100644 odb-tests/common/schema/embedded/basics/test.hxx create mode 100644 odb-tests/common/schema/embedded/basics/testscript create mode 100644 odb-tests/common/schema/embedded/order/.gitignore create mode 100644 odb-tests/common/schema/embedded/order/buildfile create mode 100644 odb-tests/common/schema/embedded/order/driver.cxx create mode 100644 odb-tests/common/schema/embedded/order/test1.hxx create mode 100644 odb-tests/common/schema/embedded/order/test2.hxx create mode 100644 odb-tests/common/schema/embedded/order/testscript create mode 100644 odb-tests/common/schema/namespace/buildfile create mode 100644 odb-tests/common/schema/namespace/driver.cxx create mode 100644 odb-tests/common/schema/namespace/test.hxx create mode 100644 odb-tests/common/schema/namespace/testscript create mode 100644 odb-tests/common/section/basics/buildfile create mode 100644 odb-tests/common/section/basics/driver.cxx create mode 100644 odb-tests/common/section/basics/test.hxx create mode 100644 odb-tests/common/section/basics/testscript create mode 100644 odb-tests/common/section/polymorphism/buildfile create mode 100644 odb-tests/common/section/polymorphism/driver.cxx create mode 100644 odb-tests/common/section/polymorphism/test.hxx create mode 100644 odb-tests/common/section/polymorphism/testscript create mode 100644 odb-tests/common/session/cache/buildfile create mode 100644 odb-tests/common/session/cache/driver.cxx create mode 100644 odb-tests/common/session/cache/test.hxx create mode 100644 odb-tests/common/session/cache/testscript create mode 100644 odb-tests/common/session/custom/buildfile create mode 100644 odb-tests/common/session/custom/driver.cxx create mode 100644 odb-tests/common/session/custom/session.cxx create mode 100644 odb-tests/common/session/custom/session.hxx create mode 100644 odb-tests/common/session/custom/session.txx create mode 100644 odb-tests/common/session/custom/test.hxx create mode 100644 odb-tests/common/session/custom/testscript create mode 100644 odb-tests/common/statement/processing/buildfile create mode 100644 odb-tests/common/statement/processing/driver.cxx create mode 100644 odb-tests/common/statement/processing/testscript create mode 100644 odb-tests/common/threads/buildfile create mode 100644 odb-tests/common/threads/driver.cxx create mode 100644 odb-tests/common/threads/test.hxx create mode 100644 odb-tests/common/threads/testscript create mode 100644 odb-tests/common/transaction/basics/buildfile create mode 100644 odb-tests/common/transaction/basics/driver.cxx create mode 100644 odb-tests/common/transaction/basics/testscript create mode 100644 odb-tests/common/transaction/callback/buildfile create mode 100644 odb-tests/common/transaction/callback/driver.cxx create mode 100644 odb-tests/common/transaction/callback/testscript create mode 100644 odb-tests/common/types/buildfile create mode 100644 odb-tests/common/types/driver.cxx create mode 100644 odb-tests/common/types/test.hxx create mode 100644 odb-tests/common/types/testscript create mode 100644 odb-tests/common/view/basics/buildfile create mode 100644 odb-tests/common/view/basics/driver.cxx create mode 100644 odb-tests/common/view/basics/test.hxx create mode 100644 odb-tests/common/view/basics/testscript create mode 100644 odb-tests/common/view/olv/.gitignore create mode 100644 odb-tests/common/view/olv/buildfile create mode 100644 odb-tests/common/view/olv/driver.cxx create mode 100644 odb-tests/common/view/olv/test1.hxx create mode 100644 odb-tests/common/view/olv/test2.hxx create mode 100644 odb-tests/common/view/olv/test3.hxx create mode 100644 odb-tests/common/view/olv/test4.hxx create mode 100644 odb-tests/common/view/olv/test5.hxx create mode 100644 odb-tests/common/view/olv/test6.hxx create mode 100644 odb-tests/common/view/olv/test7.hxx create mode 100644 odb-tests/common/view/olv/test8.hxx create mode 100644 odb-tests/common/view/olv/test9.hxx create mode 100644 odb-tests/common/view/olv/testscript create mode 100644 odb-tests/common/virtual/buildfile create mode 100644 odb-tests/common/virtual/driver.cxx create mode 100644 odb-tests/common/virtual/test.hxx create mode 100644 odb-tests/common/virtual/testscript create mode 100644 odb-tests/common/wrapper/buildfile create mode 100644 odb-tests/common/wrapper/driver.cxx create mode 100644 odb-tests/common/wrapper/test.hxx create mode 100644 odb-tests/common/wrapper/testscript create mode 100644 odb-tests/database-options.testscript create mode 100644 odb-tests/evolution/add-column/driver.cxx create mode 100644 odb-tests/evolution/add-column/model.hxx create mode 100644 odb-tests/evolution/add-column/test1.hxx create mode 100644 odb-tests/evolution/add-column/test2.hxx create mode 100644 odb-tests/evolution/add-column/test3.hxx create mode 100644 odb-tests/evolution/add-foreign-key/driver.cxx create mode 100644 odb-tests/evolution/add-foreign-key/model.hxx create mode 100644 odb-tests/evolution/add-foreign-key/test1.hxx create mode 100644 odb-tests/evolution/add-foreign-key/test2.hxx create mode 100644 odb-tests/evolution/add-foreign-key/test3.hxx create mode 100644 odb-tests/evolution/add-index/driver.cxx create mode 100644 odb-tests/evolution/add-index/model.hxx create mode 100644 odb-tests/evolution/add-index/test1.hxx create mode 100644 odb-tests/evolution/add-index/test2.hxx create mode 100644 odb-tests/evolution/add-index/test3.hxx create mode 100644 odb-tests/evolution/add-table/driver.cxx create mode 100644 odb-tests/evolution/add-table/model.hxx create mode 100644 odb-tests/evolution/add-table/test1.hxx create mode 100644 odb-tests/evolution/add-table/test2.hxx create mode 100644 odb-tests/evolution/add-table/test3.hxx create mode 100644 odb-tests/evolution/alter-column/driver.cxx create mode 100644 odb-tests/evolution/alter-column/model.hxx create mode 100644 odb-tests/evolution/alter-column/test1.hxx create mode 100644 odb-tests/evolution/alter-column/test2.hxx create mode 100644 odb-tests/evolution/alter-column/test3.hxx create mode 100644 odb-tests/evolution/combined/driver.cxx create mode 100644 odb-tests/evolution/combined/model.hxx create mode 100644 odb-tests/evolution/combined/test1.hxx create mode 100644 odb-tests/evolution/combined/test2.hxx create mode 100644 odb-tests/evolution/combined/test3.hxx create mode 100644 odb-tests/evolution/data/driver.cxx create mode 100644 odb-tests/evolution/data/model.hxx create mode 100644 odb-tests/evolution/data/test1.hxx create mode 100644 odb-tests/evolution/data/test2.hxx create mode 100644 odb-tests/evolution/data/test3.hxx create mode 100644 odb-tests/evolution/drop-column/driver.cxx create mode 100644 odb-tests/evolution/drop-column/model.hxx create mode 100644 odb-tests/evolution/drop-column/test1.hxx create mode 100644 odb-tests/evolution/drop-column/test2.hxx create mode 100644 odb-tests/evolution/drop-column/test3.hxx create mode 100644 odb-tests/evolution/drop-foreign-key/driver.cxx create mode 100644 odb-tests/evolution/drop-foreign-key/model.hxx create mode 100644 odb-tests/evolution/drop-foreign-key/test1.hxx create mode 100644 odb-tests/evolution/drop-foreign-key/test2.hxx create mode 100644 odb-tests/evolution/drop-foreign-key/test3.hxx create mode 100644 odb-tests/evolution/drop-index/driver.cxx create mode 100644 odb-tests/evolution/drop-index/model.hxx create mode 100644 odb-tests/evolution/drop-index/test1.hxx create mode 100644 odb-tests/evolution/drop-index/test2.hxx create mode 100644 odb-tests/evolution/drop-index/test3.hxx create mode 100644 odb-tests/evolution/drop-table/driver.cxx create mode 100644 odb-tests/evolution/drop-table/model.hxx create mode 100644 odb-tests/evolution/drop-table/test1.hxx create mode 100644 odb-tests/evolution/drop-table/test2.hxx create mode 100644 odb-tests/evolution/drop-table/test3.hxx create mode 100644 odb-tests/evolution/embedded/driver.cxx create mode 100644 odb-tests/evolution/embedded/model.hxx create mode 100644 odb-tests/evolution/embedded/test1.hxx create mode 100644 odb-tests/evolution/embedded/test2.hxx create mode 100644 odb-tests/evolution/embedded/test3.hxx create mode 100644 odb-tests/evolution/soft-add/driver.cxx create mode 100644 odb-tests/evolution/soft-add/model.hxx create mode 100644 odb-tests/evolution/soft-add/test1.hxx create mode 100644 odb-tests/evolution/soft-add/test2.hxx create mode 100644 odb-tests/evolution/soft-add/test3.hxx create mode 100644 odb-tests/evolution/soft-delete/driver.cxx create mode 100644 odb-tests/evolution/soft-delete/model.hxx create mode 100644 odb-tests/evolution/soft-delete/test1.hxx create mode 100644 odb-tests/evolution/soft-delete/test2.hxx create mode 100644 odb-tests/evolution/soft-delete/test3.hxx create mode 100644 odb-tests/evolution/template/driver.cxx create mode 100644 odb-tests/evolution/template/model.hxx create mode 100644 odb-tests/evolution/template/template-vc10.vcxproj create mode 100644 odb-tests/evolution/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/evolution/template/template-vc11.vcxproj create mode 100644 odb-tests/evolution/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/evolution/template/template-vc12.vcxproj create mode 100644 odb-tests/evolution/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/evolution/template/template-vc8.vcproj create mode 100644 odb-tests/evolution/template/template-vc9.vcproj create mode 100644 odb-tests/evolution/template/test1.hxx create mode 100644 odb-tests/evolution/template/test2.hxx create mode 100644 odb-tests/evolution/template/test3.hxx create mode 100644 odb-tests/evolution/version/driver.cxx create mode 100644 odb-tests/evolution/version/model.hxx create mode 100644 odb-tests/evolution/version/test1.hxx create mode 100644 odb-tests/evolution/version/test2.hxx create mode 100644 odb-tests/evolution/version/test3.hxx create mode 100644 odb-tests/libcommon/.gitignore create mode 100644 odb-tests/libcommon/buffer.hxx create mode 100644 odb-tests/libcommon/buildfile create mode 100644 odb-tests/libcommon/common.cxx create mode 100644 odb-tests/libcommon/common.hxx create mode 100644 odb-tests/libcommon/common.txx create mode 100644 odb-tests/libcommon/concrete.hxx create mode 100644 odb-tests/libcommon/config.hxx.in create mode 100644 odb-tests/libcommon/export.hxx create mode 100644 odb-tests/manifest create mode 100644 odb-tests/mssql/custom/custom.sql create mode 100644 odb-tests/mssql/custom/driver.cxx create mode 100644 odb-tests/mssql/custom/query.hxx create mode 100644 odb-tests/mssql/custom/test.hxx create mode 100644 odb-tests/mssql/custom/traits.cxx create mode 100644 odb-tests/mssql/custom/traits.hxx create mode 100644 odb-tests/mssql/database/driver.cxx create mode 100644 odb-tests/mssql/native/driver.cxx create mode 100644 odb-tests/mssql/query/driver.cxx create mode 100644 odb-tests/mssql/query/test.hxx create mode 100644 odb-tests/mssql/stored-proc/driver.cxx create mode 100644 odb-tests/mssql/stored-proc/test.hxx create mode 100644 odb-tests/mssql/template/driver.cxx create mode 100644 odb-tests/mssql/template/template-vc10.vcxproj create mode 100644 odb-tests/mssql/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/mssql/template/template-vc11.vcxproj create mode 100644 odb-tests/mssql/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/mssql/template/template-vc12.vcxproj create mode 100644 odb-tests/mssql/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/mssql/template/template-vc8.vcproj create mode 100644 odb-tests/mssql/template/template-vc9.vcproj create mode 100644 odb-tests/mssql/template/test.hxx create mode 100644 odb-tests/mssql/types/driver.cxx create mode 100644 odb-tests/mssql/types/test.hxx create mode 100644 odb-tests/mssql/types/traits.hxx create mode 100644 odb-tests/mysql-schema.testscript create mode 100644 odb-tests/mysql.testscript create mode 100644 odb-tests/mysql/custom/buildfile create mode 100644 odb-tests/mysql/custom/driver.cxx create mode 100644 odb-tests/mysql/custom/query.hxx create mode 100644 odb-tests/mysql/custom/test.hxx create mode 100644 odb-tests/mysql/custom/testscript create mode 100644 odb-tests/mysql/custom/traits.hxx create mode 100644 odb-tests/mysql/database/buildfile create mode 100644 odb-tests/mysql/database/driver.cxx create mode 100644 odb-tests/mysql/database/testscript create mode 100644 odb-tests/mysql/index/buildfile create mode 100644 odb-tests/mysql/index/driver.cxx create mode 100644 odb-tests/mysql/index/test.hxx create mode 100644 odb-tests/mysql/index/testscript create mode 100644 odb-tests/mysql/native/buildfile create mode 100644 odb-tests/mysql/native/driver.cxx create mode 100644 odb-tests/mysql/native/testscript create mode 100644 odb-tests/mysql/truncation/buildfile create mode 100644 odb-tests/mysql/truncation/driver.cxx create mode 100644 odb-tests/mysql/truncation/test.hxx create mode 100644 odb-tests/mysql/truncation/testscript create mode 100644 odb-tests/mysql/types/buildfile create mode 100644 odb-tests/mysql/types/driver.cxx create mode 100644 odb-tests/mysql/types/test.hxx create mode 100644 odb-tests/mysql/types/testscript create mode 100644 odb-tests/mysql/types/traits.hxx create mode 100644 odb-tests/oracle/custom/custom.sql create mode 100644 odb-tests/oracle/custom/driver.cxx create mode 100644 odb-tests/oracle/custom/test.hxx create mode 100644 odb-tests/oracle/custom/traits.hxx create mode 100644 odb-tests/oracle/database/driver.cxx create mode 100644 odb-tests/oracle/native/driver.cxx create mode 100644 odb-tests/oracle/template/driver.cxx create mode 100644 odb-tests/oracle/template/template-vc10.vcxproj create mode 100644 odb-tests/oracle/template/template-vc10.vcxproj.filters create mode 100644 odb-tests/oracle/template/template-vc11.vcxproj create mode 100644 odb-tests/oracle/template/template-vc11.vcxproj.filters create mode 100644 odb-tests/oracle/template/template-vc12.vcxproj create mode 100644 odb-tests/oracle/template/template-vc12.vcxproj.filters create mode 100644 odb-tests/oracle/template/template-vc8.vcproj create mode 100644 odb-tests/oracle/template/template-vc9.vcproj create mode 100644 odb-tests/oracle/template/test.hxx create mode 100644 odb-tests/oracle/types/driver.cxx create mode 100644 odb-tests/oracle/types/test.hxx create mode 100644 odb-tests/oracle/types/traits.hxx create mode 100644 odb-tests/pgsql-schema.testscript create mode 100644 odb-tests/pgsql.testscript create mode 100644 odb-tests/pgsql/buildfile create mode 100644 odb-tests/pgsql/bulk/buildfile create mode 100644 odb-tests/pgsql/bulk/driver.cxx create mode 100644 odb-tests/pgsql/bulk/test.hxx create mode 100644 odb-tests/pgsql/bulk/testscript create mode 100644 odb-tests/pgsql/custom/buildfile create mode 100644 odb-tests/pgsql/custom/driver.cxx create mode 100644 odb-tests/pgsql/custom/query.hxx create mode 100644 odb-tests/pgsql/custom/test.hxx create mode 100644 odb-tests/pgsql/custom/testscript create mode 100644 odb-tests/pgsql/custom/traits.hxx create mode 100644 odb-tests/pgsql/database/buildfile create mode 100644 odb-tests/pgsql/database/driver.cxx create mode 100644 odb-tests/pgsql/database/testscript create mode 100644 odb-tests/pgsql/index/buildfile create mode 100644 odb-tests/pgsql/index/driver.cxx create mode 100644 odb-tests/pgsql/index/test.hxx create mode 100644 odb-tests/pgsql/index/testscript create mode 100644 odb-tests/pgsql/native/buildfile create mode 100644 odb-tests/pgsql/native/driver.cxx create mode 100644 odb-tests/pgsql/native/testscript create mode 100644 odb-tests/pgsql/truncation/buildfile create mode 100644 odb-tests/pgsql/truncation/driver.cxx create mode 100644 odb-tests/pgsql/truncation/test.hxx create mode 100644 odb-tests/pgsql/truncation/testscript create mode 100644 odb-tests/pgsql/types/buildfile create mode 100644 odb-tests/pgsql/types/driver.cxx create mode 100644 odb-tests/pgsql/types/test.hxx create mode 100644 odb-tests/pgsql/types/testscript create mode 100644 odb-tests/pgsql/types/traits.hxx create mode 100644 odb-tests/qt/common/basic/driver.cxx create mode 100644 odb-tests/qt/common/basic/test.hxx create mode 100644 odb-tests/qt/common/containers/basics/driver.cxx create mode 100644 odb-tests/qt/common/containers/basics/test.hxx create mode 100644 odb-tests/qt/common/containers/change-tracking/driver.cxx create mode 100644 odb-tests/qt/common/containers/change-tracking/test.hxx create mode 100644 odb-tests/qt/common/smart-ptr/driver.cxx create mode 100644 odb-tests/qt/common/smart-ptr/test.hxx create mode 100644 odb-tests/qt/common/template/driver.cxx create mode 100644 odb-tests/qt/common/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/common/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/common/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/common/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/common/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/common/template/test.hxx create mode 100644 odb-tests/qt/mssql/basic/driver.cxx create mode 100644 odb-tests/qt/mssql/basic/test.hxx create mode 100644 odb-tests/qt/mssql/date-time/driver.cxx create mode 100644 odb-tests/qt/mssql/date-time/test.hxx create mode 100644 odb-tests/qt/mssql/template/driver.cxx create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/mssql/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/mssql/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/mssql/template/test.hxx create mode 100644 odb-tests/qt/mysql/basic/driver.cxx create mode 100644 odb-tests/qt/mysql/basic/test.hxx create mode 100644 odb-tests/qt/mysql/date-time/driver.cxx create mode 100644 odb-tests/qt/mysql/date-time/test.hxx create mode 100644 odb-tests/qt/mysql/template/driver.cxx create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/mysql/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/mysql/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/mysql/template/test.hxx create mode 100644 odb-tests/qt/oracle/basic/driver.cxx create mode 100644 odb-tests/qt/oracle/basic/test.hxx create mode 100644 odb-tests/qt/oracle/date-time/driver.cxx create mode 100644 odb-tests/qt/oracle/date-time/test.hxx create mode 100644 odb-tests/qt/oracle/template/driver.cxx create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/oracle/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/oracle/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/oracle/template/test.hxx create mode 100644 odb-tests/qt/pgsql/basic/driver.cxx create mode 100644 odb-tests/qt/pgsql/basic/test.hxx create mode 100644 odb-tests/qt/pgsql/date-time/driver.cxx create mode 100644 odb-tests/qt/pgsql/date-time/test.hxx create mode 100644 odb-tests/qt/pgsql/template/driver.cxx create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/pgsql/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/pgsql/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/pgsql/template/test.hxx create mode 100644 odb-tests/qt/sqlite/basic/driver.cxx create mode 100644 odb-tests/qt/sqlite/basic/test.hxx create mode 100644 odb-tests/qt/sqlite/date-time/driver.cxx create mode 100644 odb-tests/qt/sqlite/date-time/test.hxx create mode 100644 odb-tests/qt/sqlite/template/driver.cxx create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc8.vcproj create mode 100644 odb-tests/qt/sqlite/template/template-qt4-vc9.vcproj create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj.filters create mode 100644 odb-tests/qt/sqlite/template/template-qt5-vc9.vcproj create mode 100644 odb-tests/qt/sqlite/template/test.hxx create mode 100644 odb-tests/sqlite.testscript create mode 100644 odb-tests/sqlite/attach/buildfile create mode 100644 odb-tests/sqlite/attach/driver.cxx create mode 100644 odb-tests/sqlite/attach/test.hxx create mode 100644 odb-tests/sqlite/attach/testscript create mode 100644 odb-tests/sqlite/auto/buildfile create mode 100644 odb-tests/sqlite/auto/driver.cxx create mode 100644 odb-tests/sqlite/auto/test.hxx create mode 100644 odb-tests/sqlite/auto/testscript create mode 100644 odb-tests/sqlite/custom/buildfile create mode 100644 odb-tests/sqlite/custom/driver.cxx create mode 100644 odb-tests/sqlite/custom/test.hxx create mode 100644 odb-tests/sqlite/custom/testscript create mode 100644 odb-tests/sqlite/database/buildfile create mode 100644 odb-tests/sqlite/database/driver.cxx create mode 100644 odb-tests/sqlite/database/testscript create mode 100644 odb-tests/sqlite/native/buildfile create mode 100644 odb-tests/sqlite/native/driver.cxx create mode 100644 odb-tests/sqlite/native/testscript create mode 100644 odb-tests/sqlite/stream/buildfile create mode 100644 odb-tests/sqlite/stream/driver.cxx create mode 100644 odb-tests/sqlite/stream/test.hxx create mode 100644 odb-tests/sqlite/stream/testscript create mode 100644 odb-tests/sqlite/transaction/buildfile create mode 100644 odb-tests/sqlite/transaction/driver.cxx create mode 100644 odb-tests/sqlite/transaction/test.hxx create mode 100644 odb-tests/sqlite/transaction/testscript create mode 100644 odb-tests/sqlite/truncation/buildfile create mode 100644 odb-tests/sqlite/truncation/driver.cxx create mode 100644 odb-tests/sqlite/truncation/test.hxx create mode 100644 odb-tests/sqlite/truncation/testscript create mode 100644 odb-tests/sqlite/types/buildfile create mode 100644 odb-tests/sqlite/types/driver.cxx create mode 100644 odb-tests/sqlite/types/test.hxx create mode 100644 odb-tests/sqlite/types/testscript create mode 100644 odb-tests/sqlite/types/traits.hxx delete mode 100644 oracle/custom/custom.sql delete mode 100644 oracle/custom/driver.cxx delete mode 100644 oracle/custom/test.hxx delete mode 100644 oracle/custom/traits.hxx delete mode 100644 oracle/database/driver.cxx delete mode 100644 oracle/native/driver.cxx delete mode 100644 oracle/template/driver.cxx delete mode 100644 oracle/template/template-vc10.vcxproj delete mode 100644 oracle/template/template-vc10.vcxproj.filters delete mode 100644 oracle/template/template-vc11.vcxproj delete mode 100644 oracle/template/template-vc11.vcxproj.filters delete mode 100644 oracle/template/template-vc12.vcxproj delete mode 100644 oracle/template/template-vc12.vcxproj.filters delete mode 100644 oracle/template/template-vc8.vcproj delete mode 100644 oracle/template/template-vc9.vcproj delete mode 100644 oracle/template/test.hxx delete mode 100644 oracle/types/driver.cxx delete mode 100644 oracle/types/test.hxx delete mode 100644 oracle/types/traits.hxx delete mode 100644 pgsql-schema.testscript delete mode 100644 pgsql.testscript delete mode 100644 pgsql/buildfile delete mode 100644 pgsql/bulk/buildfile delete mode 100644 pgsql/bulk/driver.cxx delete mode 100644 pgsql/bulk/test.hxx delete mode 100644 pgsql/bulk/testscript delete mode 100644 pgsql/custom/buildfile delete mode 100644 pgsql/custom/driver.cxx delete mode 100644 pgsql/custom/query.hxx delete mode 100644 pgsql/custom/test.hxx delete mode 100644 pgsql/custom/testscript delete mode 100644 pgsql/custom/traits.hxx delete mode 100644 pgsql/database/buildfile delete mode 100644 pgsql/database/driver.cxx delete mode 100644 pgsql/database/testscript delete mode 100644 pgsql/index/buildfile delete mode 100644 pgsql/index/driver.cxx delete mode 100644 pgsql/index/test.hxx delete mode 100644 pgsql/index/testscript delete mode 100644 pgsql/native/buildfile delete mode 100644 pgsql/native/driver.cxx delete mode 100644 pgsql/native/testscript delete mode 100644 pgsql/truncation/buildfile delete mode 100644 pgsql/truncation/driver.cxx delete mode 100644 pgsql/truncation/test.hxx delete mode 100644 pgsql/truncation/testscript delete mode 100644 pgsql/types/buildfile delete mode 100644 pgsql/types/driver.cxx delete mode 100644 pgsql/types/test.hxx delete mode 100644 pgsql/types/testscript delete mode 100644 pgsql/types/traits.hxx delete mode 100644 qt/common/basic/driver.cxx delete mode 100644 qt/common/basic/test.hxx delete mode 100644 qt/common/containers/basics/driver.cxx delete mode 100644 qt/common/containers/basics/test.hxx delete mode 100644 qt/common/containers/change-tracking/driver.cxx delete mode 100644 qt/common/containers/change-tracking/test.hxx delete mode 100644 qt/common/smart-ptr/driver.cxx delete mode 100644 qt/common/smart-ptr/test.hxx delete mode 100644 qt/common/template/driver.cxx delete mode 100644 qt/common/template/template-qt4-vc10.vcxproj delete mode 100644 qt/common/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/common/template/template-qt4-vc11.vcxproj delete mode 100644 qt/common/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/common/template/template-qt4-vc12.vcxproj delete mode 100644 qt/common/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/common/template/template-qt4-vc8.vcproj delete mode 100644 qt/common/template/template-qt4-vc9.vcproj delete mode 100644 qt/common/template/template-qt5-vc10.vcxproj delete mode 100644 qt/common/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/common/template/template-qt5-vc11.vcxproj delete mode 100644 qt/common/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/common/template/template-qt5-vc12.vcxproj delete mode 100644 qt/common/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/common/template/template-qt5-vc9.vcproj delete mode 100644 qt/common/template/test.hxx delete mode 100644 qt/mssql/basic/driver.cxx delete mode 100644 qt/mssql/basic/test.hxx delete mode 100644 qt/mssql/date-time/driver.cxx delete mode 100644 qt/mssql/date-time/test.hxx delete mode 100644 qt/mssql/template/driver.cxx delete mode 100644 qt/mssql/template/template-qt4-vc10.vcxproj delete mode 100644 qt/mssql/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt4-vc11.vcxproj delete mode 100644 qt/mssql/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt4-vc12.vcxproj delete mode 100644 qt/mssql/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt4-vc8.vcproj delete mode 100644 qt/mssql/template/template-qt4-vc9.vcproj delete mode 100644 qt/mssql/template/template-qt5-vc10.vcxproj delete mode 100644 qt/mssql/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt5-vc11.vcxproj delete mode 100644 qt/mssql/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt5-vc12.vcxproj delete mode 100644 qt/mssql/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/mssql/template/template-qt5-vc9.vcproj delete mode 100644 qt/mssql/template/test.hxx delete mode 100644 qt/mysql/basic/driver.cxx delete mode 100644 qt/mysql/basic/test.hxx delete mode 100644 qt/mysql/date-time/driver.cxx delete mode 100644 qt/mysql/date-time/test.hxx delete mode 100644 qt/mysql/template/driver.cxx delete mode 100644 qt/mysql/template/template-qt4-vc10.vcxproj delete mode 100644 qt/mysql/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt4-vc11.vcxproj delete mode 100644 qt/mysql/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt4-vc12.vcxproj delete mode 100644 qt/mysql/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt4-vc8.vcproj delete mode 100644 qt/mysql/template/template-qt4-vc9.vcproj delete mode 100644 qt/mysql/template/template-qt5-vc10.vcxproj delete mode 100644 qt/mysql/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt5-vc11.vcxproj delete mode 100644 qt/mysql/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt5-vc12.vcxproj delete mode 100644 qt/mysql/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/mysql/template/template-qt5-vc9.vcproj delete mode 100644 qt/mysql/template/test.hxx delete mode 100644 qt/oracle/basic/driver.cxx delete mode 100644 qt/oracle/basic/test.hxx delete mode 100644 qt/oracle/date-time/driver.cxx delete mode 100644 qt/oracle/date-time/test.hxx delete mode 100644 qt/oracle/template/driver.cxx delete mode 100644 qt/oracle/template/template-qt4-vc10.vcxproj delete mode 100644 qt/oracle/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt4-vc11.vcxproj delete mode 100644 qt/oracle/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt4-vc12.vcxproj delete mode 100644 qt/oracle/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt4-vc8.vcproj delete mode 100644 qt/oracle/template/template-qt4-vc9.vcproj delete mode 100644 qt/oracle/template/template-qt5-vc10.vcxproj delete mode 100644 qt/oracle/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt5-vc11.vcxproj delete mode 100644 qt/oracle/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt5-vc12.vcxproj delete mode 100644 qt/oracle/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/oracle/template/template-qt5-vc9.vcproj delete mode 100644 qt/oracle/template/test.hxx delete mode 100644 qt/pgsql/basic/driver.cxx delete mode 100644 qt/pgsql/basic/test.hxx delete mode 100644 qt/pgsql/date-time/driver.cxx delete mode 100644 qt/pgsql/date-time/test.hxx delete mode 100644 qt/pgsql/template/driver.cxx delete mode 100644 qt/pgsql/template/template-qt4-vc10.vcxproj delete mode 100644 qt/pgsql/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt4-vc11.vcxproj delete mode 100644 qt/pgsql/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt4-vc12.vcxproj delete mode 100644 qt/pgsql/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt4-vc8.vcproj delete mode 100644 qt/pgsql/template/template-qt4-vc9.vcproj delete mode 100644 qt/pgsql/template/template-qt5-vc10.vcxproj delete mode 100644 qt/pgsql/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt5-vc11.vcxproj delete mode 100644 qt/pgsql/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt5-vc12.vcxproj delete mode 100644 qt/pgsql/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/pgsql/template/template-qt5-vc9.vcproj delete mode 100644 qt/pgsql/template/test.hxx delete mode 100644 qt/sqlite/basic/driver.cxx delete mode 100644 qt/sqlite/basic/test.hxx delete mode 100644 qt/sqlite/date-time/driver.cxx delete mode 100644 qt/sqlite/date-time/test.hxx delete mode 100644 qt/sqlite/template/driver.cxx delete mode 100644 qt/sqlite/template/template-qt4-vc10.vcxproj delete mode 100644 qt/sqlite/template/template-qt4-vc10.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt4-vc11.vcxproj delete mode 100644 qt/sqlite/template/template-qt4-vc11.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt4-vc12.vcxproj delete mode 100644 qt/sqlite/template/template-qt4-vc12.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt4-vc8.vcproj delete mode 100644 qt/sqlite/template/template-qt4-vc9.vcproj delete mode 100644 qt/sqlite/template/template-qt5-vc10.vcxproj delete mode 100644 qt/sqlite/template/template-qt5-vc10.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt5-vc11.vcxproj delete mode 100644 qt/sqlite/template/template-qt5-vc11.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt5-vc12.vcxproj delete mode 100644 qt/sqlite/template/template-qt5-vc12.vcxproj.filters delete mode 100644 qt/sqlite/template/template-qt5-vc9.vcproj delete mode 100644 qt/sqlite/template/test.hxx delete mode 100644 repositories.manifest delete mode 100644 sqlite.testscript delete mode 100644 sqlite/attach/buildfile delete mode 100644 sqlite/attach/driver.cxx delete mode 100644 sqlite/attach/test.hxx delete mode 100644 sqlite/attach/testscript delete mode 100644 sqlite/auto/buildfile delete mode 100644 sqlite/auto/driver.cxx delete mode 100644 sqlite/auto/test.hxx delete mode 100644 sqlite/auto/testscript delete mode 100644 sqlite/custom/buildfile delete mode 100644 sqlite/custom/driver.cxx delete mode 100644 sqlite/custom/test.hxx delete mode 100644 sqlite/custom/testscript delete mode 100644 sqlite/database/buildfile delete mode 100644 sqlite/database/driver.cxx delete mode 100644 sqlite/database/testscript delete mode 100644 sqlite/native/buildfile delete mode 100644 sqlite/native/driver.cxx delete mode 100644 sqlite/native/testscript delete mode 100644 sqlite/stream/buildfile delete mode 100644 sqlite/stream/driver.cxx delete mode 100644 sqlite/stream/test.hxx delete mode 100644 sqlite/stream/testscript delete mode 100644 sqlite/transaction/buildfile delete mode 100644 sqlite/transaction/driver.cxx delete mode 100644 sqlite/transaction/test.hxx delete mode 100644 sqlite/transaction/testscript delete mode 100644 sqlite/truncation/buildfile delete mode 100644 sqlite/truncation/driver.cxx delete mode 100644 sqlite/truncation/test.hxx delete mode 100644 sqlite/truncation/testscript delete mode 100644 sqlite/types/buildfile delete mode 100644 sqlite/types/driver.cxx delete mode 100644 sqlite/types/test.hxx delete mode 100644 sqlite/types/testscript delete mode 100644 sqlite/types/traits.hxx diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e3bbf5b..0000000 --- a/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# Compiler/linker output. -# -*.d -*.t -*.i -*.i.* -*.ii -*.ii.* -*.o -*.obj -*.gcm -*.pcm -*.ifc -*.so -*.dylib -*.dll -*.a -*.lib -*.exp -*.pdb -*.ilk -*.exe -*.exe.dlls/ -*.exe.manifest -*.pc - -# Test executables. -# -driver - -# ODB-generated files. -# -test-odb.?xx -test-odb-*.?xx -test.sql -test-*.sql - -# Testscript output directories (can be symlinks). -# -test -test-driver diff --git a/GPLv2 b/GPLv2 deleted file mode 100644 index 3912109..0000000 --- a/GPLv2 +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - 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 more 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9d92da1..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009-2024 Code Synthesis Tools CC. - -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. - -For more information on ODB licensing as well as for answers to -some of the common licensing questions, visit the ODB License -page: - -http://www.codesynthesis.com/products/odb/license.xhtml - -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/README.md b/README.md deleted file mode 100644 index 24d3bf7..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# odb-tests - tests for ODB compiler - -This package contains tests for `odb`, object-relational mapping (ORM) -compiler for C++. diff --git a/boost/common/multi-index/driver.cxx b/boost/common/multi-index/driver.cxx deleted file mode 100644 index a077008..0000000 --- a/boost/common/multi-index/driver.cxx +++ /dev/null @@ -1,189 +0,0 @@ -// file : boost/common/multi-index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Boost multi-index container persistence. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - { - using namespace odb; - - assert (odb::access::container_traits::kind == ck_ordered); - assert (odb::access::container_traits::kind == ck_ordered); - assert (odb::access::container_traits::kind == ck_set); - - assert (odb::access::container_traits::kind == ck_ordered); - assert (odb::access::container_traits::kind == ck_ordered); - assert (odb::access::container_traits::kind == ck_set); - } - - try - { - auto_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - // - // med - // - med.il.push_back (234); - med.il.push_back (123); - - med.iv.push_back (234); - med.iv.push_back (123); - - med.is.insert (234); - med.is.insert (123); - - med.ils.push_back (234); - med.ils.push_back (123); - - med.csv.insert (comp (234, "bcd")); - med.csv.insert (comp (123, "abc")); - - med.css.insert (comp (234, "bcd")); - med.css.insert (comp (123, "abc")); - - // - // full - // - full.il.push_back (2345); - full.il.push_back (1234); - full.il.push_back (3456); - - full.iv.push_back (2345); - full.iv.push_back (1234); - full.iv.push_back (3456); - - full.is.insert (2345); - full.is.insert (1234); - full.is.insert (3456); - - full.ils.push_back (2345); - full.ils.push_back (1234); - full.ils.push_back (3456); - - full.csv.insert (comp (234, "bcde")); - full.csv.insert (comp (123, "abcd")); - full.csv.insert (comp (234, "cdef")); - - full.css.insert (comp (234, "bcde")); - full.css.insert (comp (123, "abcd")); - full.css.insert (comp (234, "cdef")); - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // empty - // - empty.il.push_back (12); - empty.iv.push_back (12); - empty.is.insert (12); - empty.ils.push_back (12); - empty.csv.insert (comp (12, "ab")); - empty.css.insert (comp (12, "ab")); - - // med - // - med.il.clear (); - med.iv.clear (); - med.is.clear (); - med.ils.clear (); - med.csv.clear (); - med.css.clear (); - - // full - // - full.il.push_back (4567); - full.iv.push_back (4567); - full.is.insert (4567); - full.ils.push_back (4567); - full.csv.insert (comp (4567, "defg")); - full.css.insert (comp (4567, "defg")); - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/multi-index/test.hxx b/boost/common/multi-index/test.hxx deleted file mode 100644 index 22b9ea4..0000000 --- a/boost/common/multi-index/test.hxx +++ /dev/null @@ -1,113 +0,0 @@ -// file : boost/common/multi-index/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include -#include -#include - -#include - -namespace mi = boost::multi_index; - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const std::string& s) : num (n), str (s) {} - - #pragma db column("number") - int num; - std::string str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -typedef -mi::multi_index_container< - int, - mi::indexed_by > -> int_lst; - -typedef -mi::multi_index_container< - int, - mi::indexed_by > -> int_vec; - -typedef -mi::multi_index_container< - int, - mi::indexed_by > > -> int_set; - -typedef -mi::multi_index_container< - int, - mi::indexed_by< - mi::sequenced<>, - mi::ordered_unique > - > -> int_lst_set; - -typedef -mi::multi_index_container< - comp, - mi::indexed_by< - mi::ordered_unique >, - mi::random_access<> - > -> comp_set_vec; - -typedef -mi::multi_index_container< - comp, - mi::indexed_by< - mi::ordered_unique >, - mi::ordered_unique > - > -> comp_set_set; - -#pragma db object -struct object -{ - object () {} - object (const std::string& id): id (id) {} - - #pragma db id - std::string id; - - int_lst il; - int_lst iv; - int_set is; - - int_lst_set ils; - comp_set_vec csv; - comp_set_set css; -}; - -inline bool -operator== (const object& x, const object& y) -{ - return - x.id == y.id && - - x.il == y.il && - x.iv == y.iv && - x.is == y.is && - - x.ils == y.ils && - x.csv == y.csv && - x.css == y.css; -} - -#endif // TEST_HXX diff --git a/boost/common/optional/driver.cxx b/boost/common/optional/driver.cxx deleted file mode 100644 index c2e3079..0000000 --- a/boost/common/optional/driver.cxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : boost/common/optional/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost::optional persistence. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - object o1 (1); - object o2 (2); - o2.str = "abc"; - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - auto_ptr o2 (db->load (2)); - t.commit (); - - assert (!o1->str); - assert (o2->str && *o2->str == "abc"); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result r (db->query (query::str.is_null ())); - assert (!r.empty ()); - } - - { - result r (db->query (query::str == "abc")); - assert (!r.empty ()); - } - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/optional/test.hxx b/boost/common/optional/test.hxx deleted file mode 100644 index 65d951e..0000000 --- a/boost/common/optional/test.hxx +++ /dev/null @@ -1,31 +0,0 @@ -// file : boost/common/optional/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; - - boost::optional str; -}; - -#endif // TEST_HXX diff --git a/boost/common/smart-ptr/driver.cxx b/boost/common/smart-ptr/driver.cxx deleted file mode 100644 index 4bc6366..0000000 --- a/boost/common/smart-ptr/driver.cxx +++ /dev/null @@ -1,202 +0,0 @@ -// file : boost/common/smart-ptr/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost smart pointers. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace odb::boost; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - using boost::shared_ptr; - - try - { - auto_ptr db (create_database (argc, argv)); - - shared_ptr c1 (new cont (1)); - { - transaction t (db->begin ()); - db->persist (c1); - t.commit (); - } - - // Test comparison operators. - // - { - assert (lazy_shared_ptr () == lazy_shared_ptr ()); - assert (lazy_shared_ptr () != lazy_shared_ptr (c1)); - assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); - - lazy_shared_ptr lc1 (*db, 1); - assert (lc1 != lazy_shared_ptr ()); - assert (lc1 == lazy_shared_ptr (*db, c1)); - - shared_ptr c2 (new cont (2)); - assert (lc1 != lazy_shared_ptr (*db, c2)); - } - - // Test swap. - // - { - lazy_shared_ptr lx (*db, 1), ly; - assert (lx == lazy_shared_ptr (*db, c1)); - - swap (lx, ly); - assert (lx == lazy_shared_ptr ()); - assert (ly == lazy_shared_ptr (*db, c1)); - } - - // Test assignment from auto_ptr. - // - { - cont* p = new cont (3); - auto_ptr a (p); - lazy_shared_ptr l; - l = a; - - assert (l.get() == p); - assert (!a.get ()); - } - - shared_ptr o1 (new obj (1)); - shared_ptr o2 (new obj (2)); - shared_ptr o3 (new obj (3)); - shared_ptr o4 (new obj (4)); - shared_ptr c2 (new cont (2)); - - o1->c = c1; - o2->c = c1; - o3->c = c2; - o4->c = c2; - - // Persist. - // - { - transaction t (db->begin ()); - - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (o4); - db->persist (c2); - - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - - shared_ptr c (db->load (1)); - shared_ptr o (db->load (1)); - - // Ensure that lazy pointers are present but not loaded. - // - assert (c->o.size () == 2); - assert (!c->o[0].loaded ()); - assert (!c->o[1].loaded ()); - assert (!o->c.loaded ()); - - // Ensure that the correct object IDs were loaded. - // - assert (c->o[0].object_id () == 1); - assert (c->o[1].object_id () == 2); - assert (o->c.object_id () == 1); - - // Load the lazy pointer targets ensuring that the loaded - // targets correspond to the cached session objects. - // - shared_ptr cl (o->c.load ()); - shared_ptr ol (c->o[0].load ()); - - assert (c->o[0].loaded ()); - assert (o->c.loaded ()); - - assert (cl == c); - assert (ol == o); - - t.commit (); - } - - // Test lazy weak locking and reloading. - // - { - // No session. - // - transaction t (db->begin ()); - shared_ptr c (db->load (1)); - - // Lock. - // - assert (!c->o[1].loaded ()); - lazy_shared_ptr l (c->o[1].lock ()); - assert (!l.loaded ()); - assert (l.object_id () == c->o[1].object_id ()); - - // Reload. - // - assert (!c->o[1].loaded ()); - - shared_ptr ol (c->o[1].load ()); - assert (c->o[1].loaded ()); - - ol.reset (); - assert (!c->o[1].loaded ()); - - ol = c->o[1].load (); - assert (c->o[1].loaded ()); - - t.commit (); - } - - // - // Test shared_ptr as a value wrapper. - // - - { - obj2 o1 (1); - obj2 o2 (2); - o2.str.reset (new string ("abc")); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - shared_ptr o1 (db->load (1)); - shared_ptr o2 (db->load (2)); - t.commit (); - - assert (!o1->str); - assert (o2->str && *o2->str == "abc"); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/smart-ptr/test.hxx b/boost/common/smart-ptr/test.hxx deleted file mode 100644 index 26d7109..0000000 --- a/boost/common/smart-ptr/test.hxx +++ /dev/null @@ -1,82 +0,0 @@ -// file : boost/common/smart-ptr/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#include -#include - -struct obj; - -using boost::shared_ptr; -using odb::boost::lazy_shared_ptr; -using odb::boost::lazy_weak_ptr; - -#pragma db object -struct cont -{ - cont () - { - } - - cont (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - typedef std::vector > obj_list; - - #pragma db inverse(c) value_not_null - obj_list o; -}; - -#pragma db object -struct obj -{ - obj () - { - } - - obj (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - #pragma db not_null - lazy_shared_ptr c; -}; - -// Test shared_ptr as a value wrapper. -// -#pragma db object -struct obj2 -{ - obj2 () - { - } - - obj2 (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - #pragma db null - shared_ptr str; -}; - -#endif // TEST_HXX diff --git a/boost/common/template/driver.cxx b/boost/common/template/driver.cxx deleted file mode 100644 index 43e28c0..0000000 --- a/boost/common/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/common/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/template/template-vc10.vcxproj b/boost/common/template/template-vc10.vcxproj deleted file mode 100644 index 3c606f9..0000000 --- a/boost/common/template/template-vc10.vcxproj +++ /dev/null @@ -1,177 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/boost/common/template/template-vc10.vcxproj.filters b/boost/common/template/template-vc10.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/boost/common/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/common/template/template-vc11.vcxproj b/boost/common/template/template-vc11.vcxproj deleted file mode 100644 index 83d20c5..0000000 --- a/boost/common/template/template-vc11.vcxproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/boost/common/template/template-vc11.vcxproj.filters b/boost/common/template/template-vc11.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/boost/common/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/common/template/template-vc12.vcxproj b/boost/common/template/template-vc12.vcxproj deleted file mode 100644 index fd147f7..0000000 --- a/boost/common/template/template-vc12.vcxproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/boost/common/template/template-vc12.vcxproj.filters b/boost/common/template/template-vc12.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/boost/common/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/common/template/template-vc8.vcproj b/boost/common/template/template-vc8.vcproj deleted file mode 100644 index e0ac609..0000000 --- a/boost/common/template/template-vc8.vcproj +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/boost/common/template/template-vc9.vcproj b/boost/common/template/template-vc9.vcproj deleted file mode 100644 index b8bf4bc..0000000 --- a/boost/common/template/template-vc9.vcproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/boost/common/template/test.hxx b/boost/common/template/test.hxx deleted file mode 100644 index 1d2a5f3..0000000 --- a/boost/common/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/common/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/boost/common/unordered/driver.cxx b/boost/common/unordered/driver.cxx deleted file mode 100644 index eda5891..0000000 --- a/boost/common/unordered/driver.cxx +++ /dev/null @@ -1,212 +0,0 @@ -// file : boost/common/unordered/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Boost unordered containers persistence. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - // - // med - // - - // set - // - med.ns.insert (123); - med.ns.insert (234); - - med.ss.insert ("aaa"); - med.ss.insert ("bbbb"); - - med.cms.insert (comp (123, "aaa")); - med.cms.insert (comp (234, "bbbb")); - - // map - // - med.nsm[123] = "aaa"; - med.nsm[234] = "bbbb"; - - med.snm["aaa"] = 123; - med.snm["bbbb"] = 234; - - med.ncm[123] = comp (123, "aaa"); - med.ncm[234] = comp (234, "bbbb"); - - med.csmm.insert ( - comp_str_multimap::value_type (comp (123, "aaa"), "aaa")); - med.csmm.insert ( - comp_str_multimap::value_type (comp (234, "bbbb"), "bbbb")); - - // - // full - // - - // set - // - full.ns.insert (1234); - full.ns.insert (2345); - full.ns.insert (3456); - - full.ss.insert ("aaaa"); - full.ss.insert ("bbbbb"); - full.ss.insert ("cccccc"); - - full.cms.insert (comp (1234, "aaaa")); - full.cms.insert (comp (2345, "bbbbb")); - full.cms.insert (comp (3456, "cccccc")); - - // map - // - full.nsm[1234] = "aaaa"; - full.nsm[2345] = "bbbbb"; - full.nsm[3456] = "cccccc"; - - full.snm["aaaa"] = 1234; - full.snm["bbbbb"] = 2345; - full.snm["cccccc"] = 3456; - - full.ncm[1234] = comp (1234, "aaaa"); - full.ncm[2345] = comp (2345, "bbbbb"); - full.ncm[3456] = comp (3456, "cccccc"); - - full.csmm.insert ( - comp_str_multimap::value_type (comp (1234, "aaaa"), "aaaa")); - full.csmm.insert ( - comp_str_multimap::value_type (comp (2345, "bbbbb"), "bbbbb")); - full.csmm.insert ( - comp_str_multimap::value_type (comp (3456, "cccccc"), "cccccc")); - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // empty - // - empty.ns.insert (12); - empty.ss.insert ("aa"); - empty.cms.insert (comp (12, "aa")); - - empty.nsm[12] = "aa"; - empty.snm["aa"] = 12; - empty.ncm[12] = comp (12, "aa"); - empty.csmm.insert ( - comp_str_multimap::value_type (comp (12, "aa"), "aa")); - - // med - // - med.ns.clear (); - med.ss.clear (); - med.cms.clear (); - - med.nsm.clear (); - med.snm.clear (); - med.ncm.clear (); - med.csmm.clear (); - - // full - // - full.ns.insert (4567); - full.ss.insert ("ddddddd"); - full.cms.insert (comp (4567, "ddddddd")); - - full.nsm[3456] += 'c'; - full.nsm[4567] = "ddddddd"; - full.snm["cccccc"]++; - full.snm["ddddddd"] = 4567; - full.ncm[3456].num++; - full.ncm[3456].str += 'c'; - full.ncm[4567] = comp (4567, "ddddddd"); - full.csmm.find (comp (3456, "cccccc"))->second += "c"; - full.csmm.insert ( - comp_str_multimap::value_type (comp (4567, "ddddddd"), "ddddddd")); - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/unordered/test.hxx b/boost/common/unordered/test.hxx deleted file mode 100644 index cd77845..0000000 --- a/boost/common/unordered/test.hxx +++ /dev/null @@ -1,113 +0,0 @@ -// file : boost/common/unordered/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const std::string& s) : num (n), str (s) {} - - #pragma db column("number") - int num; - std::string str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -inline bool -operator!= (const comp& x, const comp& y) -{ - return !(x == y); -} - -inline bool -operator< (const comp& x, const comp& y) -{ - return x.num != y.num ? x.num < y.num : x.str < y.str; -} - -inline std::size_t -hash_value (const comp& x) -{ - std::size_t seed = 0; - boost::hash_combine (seed, x.num); - boost::hash_combine (seed, x.str); - return seed; -} - -using boost::unordered_set; -using boost::unordered_multiset; - -typedef unordered_set num_set; -typedef unordered_set str_set; -typedef unordered_multiset comp_multiset; - -using boost::unordered_map; -using boost::unordered_multimap; - -typedef unordered_map num_str_map; -typedef unordered_map str_num_map; -typedef unordered_map num_comp_map; -typedef unordered_multimap comp_str_multimap; - -#pragma db object -struct object -{ - object () - { - } - - object (const std::string& id) - : id (id) - { - } - - - #pragma db id - std::string id; - - // set - // - num_set ns; - str_set ss; - comp_multiset cms; - - // map - // - num_str_map nsm; - str_num_map snm; - num_comp_map ncm; - comp_str_multimap csmm; -}; - -inline bool -operator== (const object& x, const object& y) -{ - return - x.id == y.id && - - x.ns == y.ns && - x.ss == y.ss && - x.cms == y.cms && - - x.nsm == y.nsm && - x.snm == y.snm && - x.ncm == y.ncm && - x.csmm == y.csmm; -} - -#endif // TEST_HXX diff --git a/boost/common/uuid/driver.cxx b/boost/common/uuid/driver.cxx deleted file mode 100644 index aed3390..0000000 --- a/boost/common/uuid/driver.cxx +++ /dev/null @@ -1,69 +0,0 @@ -// file : boost/common/uuid/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Boost UUID persistence. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace boost::uuids; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o (1); - o.uuid_ = random_generator() (); - o.null_ = nil_uuid (); - o.zero_ = nil_uuid (); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - t.commit (); - - assert (*p == o); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::uuid == o.uuid_)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->id_ == o.id_); - assert (++i == r.end ()); - t.commit (); - } - - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/common/uuid/test.hxx b/boost/common/uuid/test.hxx deleted file mode 100644 index 82ed95b..0000000 --- a/boost/common/uuid/test.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// file : boost/common/uuid/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - typedef boost::uuids::uuid uuid; - - uuid uuid_; - uuid null_; - - #pragma db not_null - uuid zero_; - - bool operator== (const object& x) const - { - return id_ == x.id_ && - uuid_ == x.uuid_ && - null_ == x.null_ && - zero_ == x.zero_; - } -}; - -#endif // TEST_HXX diff --git a/boost/mssql/date-time/driver.cxx b/boost/mssql/date-time/driver.cxx deleted file mode 100644 index e97a276..0000000 --- a/boost/mssql/date-time/driver.cxx +++ /dev/null @@ -1,158 +0,0 @@ -// file : boost/mssql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost date/time type persistence. SQL Server version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace boost::gregorian; -using namespace boost::posix_time; - -using namespace odb::core; - -bool -test_invalid_special_value (object&, auto_ptr&); - -bool -test_out_of_range_value (object&, auto_ptr&); - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Test all valid date-time mappings. - // -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.dates.push_back (day_clock::local_day ()); - o.dates.push_back (date (not_a_date_time)); - o.dates.push_back (date (max_date_time)); - o.dates.push_back (date (min_date_time)); - - o.times.push_back (second_clock::local_time ()); - o.times.push_back (not_a_date_time); - o.times.push_back (min_date_time); - o.times.push_back (ptime (max_date_time)); -#endif - - // In DATETIME fractional seconds are rounded to .000, .003, or .007. - // - o.times_dt.push_back (ptime (date (2012, 1, 13), - time_duration (11, 57, 13, 7000))); - - // SMALLDATETIME doesn't have seconds (always 0). - // - o.times_sdt.push_back (ptime (date (2012, 1, 13), - time_duration (11, 57, 0, 0))); - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.durations.push_back (time_duration (1, 2, 3, 123456)); - o.durations.push_back (not_a_date_time); -#endif - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - // Test invalid date mappings. - // - { - object sv1, sv2; - sv1.dates.push_back (date (neg_infin)); - sv2.dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid ptime mappings. - // - { - object sv1, sv2; - sv1.times.push_back (neg_infin); - sv2.times.push_back (pos_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid time_duration mappings. - // - { - object sv1, sv2, or1; - sv1.durations.push_back (pos_infin); - sv2.durations.push_back (neg_infin); - or1.durations.push_back (time_duration (50, 2, 3, 123456700)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - - try - { - db->persist (or1); - assert (false); - } - catch (const odb::boost::date_time::value_out_of_range&) - { - } - - t.commit (); - } -#endif - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_invalid_special_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::special_value&) - { - } - - return true; -} diff --git a/boost/mssql/date-time/test.hxx b/boost/mssql/date-time/test.hxx deleted file mode 100644 index ed2276b..0000000 --- a/boost/mssql/date-time/test.hxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : boost/mssql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db object -struct object -{ - object () - { - } - - #pragma db id auto - unsigned long id; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - std::vector dates; - - std::vector times; -#endif - - #pragma db value_type("DATETIME") - std::vector times_dt; - - #pragma db value_type("SMALLDATETIME") - std::vector times_sdt; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - std::vector durations; -#endif - - bool - operator== (const object& x) const - { - return - id == x.id -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && dates == x.dates - && times == x.times -#endif - && times_dt == x.times_dt - && times_sdt == x.times_sdt -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && durations == x.durations -#endif - ; - } -}; - -#endif // TEST_HXX diff --git a/boost/mssql/template/driver.cxx b/boost/mssql/template/driver.cxx deleted file mode 100644 index 37614c4..0000000 --- a/boost/mssql/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/mssql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/mssql/template/template-vc10.vcxproj b/boost/mssql/template/template-vc10.vcxproj deleted file mode 100644 index dcb625e..0000000 --- a/boost/mssql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mssql/template/template-vc10.vcxproj.filters b/boost/mssql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mssql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mssql/template/template-vc11.vcxproj b/boost/mssql/template/template-vc11.vcxproj deleted file mode 100644 index d5951f1..0000000 --- a/boost/mssql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mssql/template/template-vc11.vcxproj.filters b/boost/mssql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mssql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mssql/template/template-vc12.vcxproj b/boost/mssql/template/template-vc12.vcxproj deleted file mode 100644 index e0cb56f..0000000 --- a/boost/mssql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mssql/template/template-vc12.vcxproj.filters b/boost/mssql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mssql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mssql/template/template-vc8.vcproj b/boost/mssql/template/template-vc8.vcproj deleted file mode 100644 index 6d1c40b..0000000 --- a/boost/mssql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/mssql/template/template-vc9.vcproj b/boost/mssql/template/template-vc9.vcproj deleted file mode 100644 index 422fbd7..0000000 --- a/boost/mssql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/mssql/template/test.hxx b/boost/mssql/template/test.hxx deleted file mode 100644 index 753498f..0000000 --- a/boost/mssql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/mssql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/boost/mysql/date-time/driver.cxx b/boost/mysql/date-time/driver.cxx deleted file mode 100644 index 8959f0c..0000000 --- a/boost/mysql/date-time/driver.cxx +++ /dev/null @@ -1,218 +0,0 @@ -// file : boost/mysql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost date/time type persistence. MySQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace boost::gregorian; -using namespace boost::posix_time; - -using namespace odb::core; - -bool -test_invalid_special_value (object&, auto_ptr&); - -bool -test_out_of_range_value (object&, auto_ptr&); - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - mysql_version v; - { - transaction t (db->begin ()); - db->query ().begin ().load (v); - t.commit (); - } - - // If we are running against MySQL 5.6.4 or later alter the tables - // to allow sub-second precision. - // - bool fs (v.major > 5 || - (v.major == 5 && (v.minor > 6 || - (v.minor == 6 && v.release >= 4)))); - if (fs) - { - transaction t (db->begin ()); - - db->execute ("ALTER TABLE `boost_mysql_dt_object_durations`" \ - " MODIFY COLUMN `value` TIME(6)"); - - db->execute ("ALTER TABLE `boost_mysql_dt_object_times`" \ - " MODIFY COLUMN `value` DATETIME(6)"); - - db->execute ("ALTER TABLE `boost_mysql_dt_object_timestamps`" \ - " MODIFY COLUMN `value` TIMESTAMP(6) NULL"); - - t.commit (); - } - - object o; - - // Test all valid date-time mappings. - // - o.dates.push_back (day_clock::local_day ()); - o.dates.push_back (date (not_a_date_time)); - o.dates.push_back (date (max_date_time)); - o.dates.push_back (date (min_date_time)); - - if (fs) - o.times.push_back (microsec_clock::local_time ()); - else - o.times.push_back (second_clock::local_time ()); - o.times.push_back (not_a_date_time); - o.times.push_back (min_date_time); - - // MySQL prior to 5.6.4 does not support fraction seconds. Construct - // with zero fractional seconds so that comparison test does not fail - // for invalid reasons. - // - o.times.push_back ( - ptime ( - date (max_date_time), - time_duration ( - ptime (max_date_time).time_of_day ().hours (), - ptime (max_date_time).time_of_day ().minutes (), - ptime (max_date_time).time_of_day ().seconds ()))); - - if (fs) - o.timestamps.push_back (microsec_clock::local_time ()); - else - o.timestamps.push_back (second_clock::local_time ()); - o.timestamps.push_back (not_a_date_time); - - o.durations.push_back (time_duration (1, 2, 3)); - if (fs) - o.durations.back () += time_duration (microseconds (123456)); - o.durations.push_back (time_duration (-1, 2, 3)); - o.durations.push_back (not_a_date_time); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - - { - // Test invalid date mappings. - // - object sv1, sv2; - sv1.dates.push_back (date (neg_infin)); - sv2.dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - - { - // Test invalid ptime (DATETIME) mappings. - // - object sv1, sv2; - sv1.times.push_back (neg_infin); - sv2.times.push_back (pos_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid ptime (TIMESTAMP) mappings. - // - object or1, or2, sv1, sv2; - or1.timestamps.push_back (min_date_time); - or2.timestamps.push_back (max_date_time); - sv1.timestamps.push_back (neg_infin); - sv2.timestamps.push_back (pos_infin); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, db)); - assert (test_out_of_range_value (or2, db)); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid time_duration mappings. - // - object or1, or2, sv1, sv2; - or1.durations.push_back (time_duration (850, 0, 0)); - or2.durations.push_back (time_duration (-850, 0, 0)); - sv1.durations.push_back (pos_infin); - sv2.durations.push_back (neg_infin); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, db)); - assert (test_out_of_range_value (or2, db)); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_invalid_special_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::special_value&) - { - } - - return true; -} - -bool -test_out_of_range_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::value_out_of_range&) - { - } - - return true; -} diff --git a/boost/mysql/date-time/test.hxx b/boost/mysql/date-time/test.hxx deleted file mode 100644 index bf73b09..0000000 --- a/boost/mysql/date-time/test.hxx +++ /dev/null @@ -1,65 +0,0 @@ -// file : boost/mysql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db object -struct object -{ - object () - { - } - - bool - operator== (const object& x) const - { - return - id == x.id && - dates == x.dates && - times == x.times && - timestamps == x.timestamps && - durations == x.durations; - } - - #pragma db id auto - unsigned long id; - - std::vector dates; - std::vector times; - - // Make timestamp NULL-able to suppress the auto-initialization and - // auto-update characteristics of the TIMESTAMP datatype, and to - // allow NULL values. - // - #pragma db value_type ("TIMESTAMP") value_null - std::vector timestamps; - - std::vector durations; -}; - -// MySQL server version view. -// -#pragma db view query( \ - "SELECT " \ - "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ - "@@protocol_version") -struct mysql_version -{ - unsigned int major; - unsigned int minor; - unsigned int release; - - unsigned int protocol; -}; - -#endif // TEST_HXX diff --git a/boost/mysql/template/driver.cxx b/boost/mysql/template/driver.cxx deleted file mode 100644 index 1164950..0000000 --- a/boost/mysql/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/mysql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/mysql/template/template-vc10.vcxproj b/boost/mysql/template/template-vc10.vcxproj deleted file mode 100644 index 3137abc..0000000 --- a/boost/mysql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mysql/template/template-vc10.vcxproj.filters b/boost/mysql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mysql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mysql/template/template-vc11.vcxproj b/boost/mysql/template/template-vc11.vcxproj deleted file mode 100644 index bc4b5a4..0000000 --- a/boost/mysql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mysql/template/template-vc11.vcxproj.filters b/boost/mysql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mysql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mysql/template/template-vc12.vcxproj b/boost/mysql/template/template-vc12.vcxproj deleted file mode 100644 index e7d70bc..0000000 --- a/boost/mysql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/mysql/template/template-vc12.vcxproj.filters b/boost/mysql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/mysql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/mysql/template/template-vc8.vcproj b/boost/mysql/template/template-vc8.vcproj deleted file mode 100644 index 2ef0383..0000000 --- a/boost/mysql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/mysql/template/template-vc9.vcproj b/boost/mysql/template/template-vc9.vcproj deleted file mode 100644 index b60c7e2..0000000 --- a/boost/mysql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/mysql/template/test.hxx b/boost/mysql/template/test.hxx deleted file mode 100644 index 7c97ca2..0000000 --- a/boost/mysql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/mysql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx deleted file mode 100644 index 82294c7..0000000 --- a/boost/oracle/date-time/driver.cxx +++ /dev/null @@ -1,136 +0,0 @@ -// file : boost/oracle/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost date/time type persistence. Oracle version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace boost::gregorian; -using namespace boost::posix_time; - -using namespace odb::core; - -bool -test_invalid_special_value (object&, auto_ptr&); - -bool -test_out_of_range_value (object&, auto_ptr&); - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Test all valid date-time mappings. - // - o.dates.push_back (day_clock::local_day ()); - o.dates.push_back (date (not_a_date_time)); - o.dates.push_back (date (max_date_time)); - o.dates.push_back (date (min_date_time)); - - o.times.push_back (second_clock::local_time ()); - o.times.push_back (not_a_date_time); - o.times.push_back (min_date_time); - o.times.push_back (ptime (max_date_time)); - - o.times_d.push_back (ptime (date (2012, 6, 27), - time_duration (14, 17, 05, 0))); - o.times_d.push_back (not_a_date_time); - - o.durations.push_back (time_duration (1, 2, 3, 123456)); - o.durations.push_back (time_duration (-1, 2, 3)); - o.durations.push_back (not_a_date_time); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - - // Test invalid date mappings. - // - { - object sv1, sv2; - sv1.dates.push_back (date (neg_infin)); - sv2.dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid ptime mappings. - // - { - object sv1, sv2; - sv1.times.push_back (neg_infin); - sv2.times.push_back (pos_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid time_duration mappings. - // - { - object sv1, sv2; - sv1.durations.push_back (pos_infin); - sv2.durations.push_back (neg_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_invalid_special_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::special_value&) - { - } - - return true; -} diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx deleted file mode 100644 index 5eaab88..0000000 --- a/boost/oracle/date-time/test.hxx +++ /dev/null @@ -1,42 +0,0 @@ -// file : boost/oracle/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db object -struct object -{ - object () - { - } - - bool - operator== (const object& x) const - { - return - id == x.id && - dates == x.dates && - times == x.times && - times_d == x.times_d && - durations == x.durations; - } - - #pragma db id auto - unsigned long id; - - std::vector dates; - std::vector times; - #pragma db value_type("DATE") - std::vector times_d; - std::vector durations; -}; - -#endif // TEST_HXX diff --git a/boost/oracle/template/driver.cxx b/boost/oracle/template/driver.cxx deleted file mode 100644 index 892b58f..0000000 --- a/boost/oracle/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/oracle/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/oracle/template/template-vc10.vcxproj b/boost/oracle/template/template-vc10.vcxproj deleted file mode 100644 index 0c93020..0000000 --- a/boost/oracle/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/oracle/template/template-vc10.vcxproj.filters b/boost/oracle/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/oracle/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/oracle/template/template-vc11.vcxproj b/boost/oracle/template/template-vc11.vcxproj deleted file mode 100644 index 4df5f5b..0000000 --- a/boost/oracle/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/oracle/template/template-vc11.vcxproj.filters b/boost/oracle/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/oracle/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/oracle/template/template-vc12.vcxproj b/boost/oracle/template/template-vc12.vcxproj deleted file mode 100644 index 0b942bc..0000000 --- a/boost/oracle/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/oracle/template/template-vc12.vcxproj.filters b/boost/oracle/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/oracle/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/oracle/template/template-vc8.vcproj b/boost/oracle/template/template-vc8.vcproj deleted file mode 100644 index c13f330..0000000 --- a/boost/oracle/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/oracle/template/template-vc9.vcproj b/boost/oracle/template/template-vc9.vcproj deleted file mode 100644 index a3061ee..0000000 --- a/boost/oracle/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/oracle/template/test.hxx b/boost/oracle/template/test.hxx deleted file mode 100644 index 141b6cd..0000000 --- a/boost/oracle/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/oracle/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx deleted file mode 100644 index 94fcc46..0000000 --- a/boost/pgsql/date-time/driver.cxx +++ /dev/null @@ -1,157 +0,0 @@ -// file : boost/pgsql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost date/time type persistence. PostgreSQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace boost::gregorian; -using namespace boost::posix_time; - -using namespace odb::core; - -bool -test_invalid_special_value (object&, auto_ptr&); - -bool -test_out_of_range_value (object&, auto_ptr&); - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Test all valid date-time mappings. - // - o.dates.push_back (day_clock::local_day ()); - o.dates.push_back (date (not_a_date_time)); - o.dates.push_back (date (max_date_time)); - o.dates.push_back (date (min_date_time)); - - o.times.push_back (microsec_clock::local_time ()); - o.times.push_back (not_a_date_time); - o.times.push_back (pos_infin); - o.times.push_back (neg_infin); - o.times.push_back (ptime (date (max_date_time), - time_duration (16, 23, 0, 123456))); - o.times.push_back (ptime (date (min_date_time), - time_duration (3, 14, 7, 123456))); - o.times.push_back (ptime (date (1969, 12, 31), // Before PG epoch. - time_duration (23, 59, 59, 123000))); - - o.durations.push_back (time_duration (0, 0, 0)); - o.durations.push_back (time_duration (12, 3, 4, 123456)); - o.durations.push_back (time_duration (23, 59, 59, 123456)); - o.durations.push_back (not_a_date_time); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - - { - // Test invalid date mappings. - // - object sv1, sv2; - sv1.dates.push_back (date (neg_infin)); - sv2.dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid ptime mappings. - // - // object sv1, sv2; - // sv1.times.push_back (neg_infin); - // sv2.times.push_back (pos_infin); - - // transaction t (db->begin ()); - // assert (test_invalid_special_value (sv1, db)); - // assert (test_invalid_special_value (sv2, db)); - // t.commit (); - } - - { - // Test invalid time_duration mappings. - // - // object or1, sv1, sv2; - // or1.durations.push_back (time_duration (0, 0, -1)); - // sv1.durations.push_back (pos_infin); - // sv2.durations.push_back (neg_infin); - - // transaction t (db->begin ()); - // assert (test_out_of_range_value (or1, db)); - // assert (test_invalid_special_value (sv1, db)); - // assert (test_invalid_special_value (sv2, db)); - // t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_invalid_special_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::special_value&) - { - } - - return true; -} - -bool -test_out_of_range_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::value_out_of_range&) - { - } - - return true; -} diff --git a/boost/pgsql/date-time/test.hxx b/boost/pgsql/date-time/test.hxx deleted file mode 100644 index 0b08093..0000000 --- a/boost/pgsql/date-time/test.hxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/pgsql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db object -struct object -{ - object () - { - } - - bool - operator== (const object& x) const - { - return - id == x.id && - dates == x.dates && - times == x.times && - durations == x.durations; - } - - #pragma db id auto - unsigned long id; - - std::vector dates; - std::vector times; - std::vector durations; -}; - -#endif // TEST_HXX diff --git a/boost/pgsql/template/driver.cxx b/boost/pgsql/template/driver.cxx deleted file mode 100644 index ed2d8a4..0000000 --- a/boost/pgsql/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/pgsql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/pgsql/template/template-vc10.vcxproj b/boost/pgsql/template/template-vc10.vcxproj deleted file mode 100644 index 7bc0243..0000000 --- a/boost/pgsql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/pgsql/template/template-vc10.vcxproj.filters b/boost/pgsql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/pgsql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/pgsql/template/template-vc11.vcxproj b/boost/pgsql/template/template-vc11.vcxproj deleted file mode 100644 index 9f8d2f0..0000000 --- a/boost/pgsql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/pgsql/template/template-vc11.vcxproj.filters b/boost/pgsql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/pgsql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/pgsql/template/template-vc12.vcxproj b/boost/pgsql/template/template-vc12.vcxproj deleted file mode 100644 index acbfc37..0000000 --- a/boost/pgsql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/pgsql/template/template-vc12.vcxproj.filters b/boost/pgsql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/pgsql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/pgsql/template/template-vc8.vcproj b/boost/pgsql/template/template-vc8.vcproj deleted file mode 100644 index 65773c9..0000000 --- a/boost/pgsql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/pgsql/template/template-vc9.vcproj b/boost/pgsql/template/template-vc9.vcproj deleted file mode 100644 index db49496..0000000 --- a/boost/pgsql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/pgsql/template/test.hxx b/boost/pgsql/template/test.hxx deleted file mode 100644 index 56eda31..0000000 --- a/boost/pgsql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/pgsql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/boost/sqlite/date-time/driver.cxx b/boost/sqlite/date-time/driver.cxx deleted file mode 100644 index 97a7a0c..0000000 --- a/boost/sqlite/date-time/driver.cxx +++ /dev/null @@ -1,208 +0,0 @@ -// file : boost/sqlite/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test boost date/time type persistence. SQLite version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; - -using namespace boost::gregorian; -using namespace boost::posix_time; - -using namespace odb::core; - -bool -test_invalid_special_value (object&, auto_ptr&); - -bool -test_out_of_range_value (object&, auto_ptr&); - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Test all valid date-time mappings. - // - o.dates.push_back (day_clock::local_day ()); - o.dates.push_back (date (not_a_date_time)); - o.dates.push_back (date (max_date_time)); - o.dates.push_back (date (min_date_time)); - - o.times.push_back (second_clock::local_time ()); - o.times.push_back (not_a_date_time); - o.times.push_back (min_date_time); - o.times.push_back (max_date_time); - - o.durations.push_back (time_duration (123, 4, 5)); - o.durations.push_back (not_a_date_time); - - o.u_dates.push_back (day_clock::local_day ()); - o.u_dates.push_back (date (not_a_date_time)); - - // Boost seems to handle 64 bit std::time_t incorrectly. - // Insert 32 bit minimum and maximum UNIX time values for now. - // - // o.u_dates.push_back (date (max_date_time)); - // o.u_dates.push_back (date (min_date_time)); - // - o.u_dates.push_back (date (2038, 1, 19)); - o.u_dates.push_back (date (1901, 12, 14)); - - o.u_times.push_back (second_clock::local_time ()); - o.u_times.push_back (not_a_date_time); - o.u_times.push_back (ptime (date (1930, 1, 1), time_duration (0, 0, 0))); - - o.s_durations.push_back (time_duration (123, 4, 5)); - o.s_durations.push_back (time_duration (-12, 3, 4)); - o.s_durations.push_back (not_a_date_time); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - - { - // Test invalid date mappings. - // - object sv1, sv2; - sv1.dates.push_back (date (neg_infin)); - sv2.dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid ptime mappings. - // - object sv1, sv2; - sv1.times.push_back (neg_infin); - sv2.times.push_back (pos_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid time_duration mappings. - // - object or1, sv1, sv2; - or1.durations.push_back (time_duration (0, 0, -1)); - sv1.durations.push_back (pos_infin); - sv2.durations.push_back (neg_infin); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, db)); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - { - // Test invalid UNIX date mappings. - // - object sv1, sv2; - sv1.u_dates.push_back (date (neg_infin)); - sv2.u_dates.push_back (date (pos_infin)); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid UNIX times mappings. - // - { - object sv1, sv2; - sv1.u_times.push_back (pos_infin); - sv2.u_times.push_back (neg_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - - // Test invalid "seconds" duration mappings. - // - { - object sv1, sv2; - sv1.s_durations.push_back (pos_infin); - sv2.s_durations.push_back (neg_infin); - - transaction t (db->begin ()); - assert (test_invalid_special_value (sv1, db)); - assert (test_invalid_special_value (sv2, db)); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_invalid_special_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::special_value&) - { - } - - return true; -} - -bool -test_out_of_range_value (object& x, auto_ptr& db) -{ - try - { - db->persist (x); - return false; - } - catch (const odb::boost::date_time::value_out_of_range&) - { - } - - return true; -} diff --git a/boost/sqlite/date-time/test.hxx b/boost/sqlite/date-time/test.hxx deleted file mode 100644 index 924ce27..0000000 --- a/boost/sqlite/date-time/test.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : boost/sqlite/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include - -#pragma db object -struct object -{ - object () - { - } - - bool - operator== (const object& x) const - { - return - id == x.id && - dates == x.dates && - times == x.times && - durations == x.durations && - u_dates == x.u_dates && - u_times == x.u_times && - s_durations == x.s_durations; - } - - #pragma db id auto - unsigned long id; - - std::vector dates; - std::vector times; - std::vector durations; - - // Dates as UNIX time. - // - #pragma db value_type("INTEGER") - std::vector u_dates; - - // Times as UNIX time. - // - #pragma db value_type("INTEGER") - std::vector u_times; - - // Durations as seconds. - // - #pragma db value_type("INTEGER") - std::vector s_durations; -}; - -#endif // TEST_HXX diff --git a/boost/sqlite/template/driver.cxx b/boost/sqlite/template/driver.cxx deleted file mode 100644 index 3e51eef..0000000 --- a/boost/sqlite/template/driver.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : boost/sqlite/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/boost/sqlite/template/template-vc10.vcxproj b/boost/sqlite/template/template-vc10.vcxproj deleted file mode 100644 index f94df08..0000000 --- a/boost/sqlite/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/sqlite/template/template-vc10.vcxproj.filters b/boost/sqlite/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/sqlite/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/sqlite/template/template-vc11.vcxproj b/boost/sqlite/template/template-vc11.vcxproj deleted file mode 100644 index 1c1a279..0000000 --- a/boost/sqlite/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/sqlite/template/template-vc11.vcxproj.filters b/boost/sqlite/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/sqlite/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/sqlite/template/template-vc12.vcxproj b/boost/sqlite/template/template-vc12.vcxproj deleted file mode 100644 index 034b16c..0000000 --- a/boost/sqlite/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/boost/sqlite/template/template-vc12.vcxproj.filters b/boost/sqlite/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/boost/sqlite/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/boost/sqlite/template/template-vc8.vcproj b/boost/sqlite/template/template-vc8.vcproj deleted file mode 100644 index df92637..0000000 --- a/boost/sqlite/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/sqlite/template/template-vc9.vcproj b/boost/sqlite/template/template-vc9.vcproj deleted file mode 100644 index 32fb152..0000000 --- a/boost/sqlite/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/boost/sqlite/template/test.hxx b/boost/sqlite/template/test.hxx deleted file mode 100644 index b9daed6..0000000 --- a/boost/sqlite/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : boost/sqlite/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index 4a730a3..0000000 --- a/build/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -config.build -root/ -bootstrap/ diff --git a/build/bootstrap.build b/build/bootstrap.build deleted file mode 100644 index 2fb5824..0000000 --- a/build/bootstrap.build +++ /dev/null @@ -1,9 +0,0 @@ -# file : build/bootstrap.build -# license : GNU GPL v2; see accompanying LICENSE file - -project = odb-tests - -using version -using config -using dist -using test diff --git a/build/export.build b/build/export.build deleted file mode 100644 index 3c073d3..0000000 --- a/build/export.build +++ /dev/null @@ -1,9 +0,0 @@ -# file : build/export.build -# license : GNU GPL v2; see accompanying LICENSE file - -$out_root/ -{ - include libcommon/ -} - -export $out_root/libcommon/$import.target diff --git a/build/root.build b/build/root.build deleted file mode 100644 index 5336399..0000000 --- a/build/root.build +++ /dev/null @@ -1,270 +0,0 @@ -# file : build/root.build -# license : GNU GPL v2; see accompanying LICENSE file - -cxx.std = latest - -using cxx - -hxx{*}: extension = hxx -ixx{*}: extension = ixx -txx{*}: extension = txx -cxx{*}: extension = cxx - -# List of the identifiers of the databases to compile and run the tests -# against. The valid identifiers are mysql, sqlite, pgsql, oracle, and mssql. -# -# @@ TODO: change to string_set once available. -# -config [strings] config.odb_tests.database - -assert ($defined(config.odb_tests.database) && \ - $size($config.odb_tests.database) > 0) \ -'at least one database must be configured via config.odb_tests.database variable' - -databases = $config.odb_tests.database - -mysql = false -sqlite = false -pgsql = false -oracle = false -mssql = false - -for db: $databases -{ - switch $db - { - case 'mysql' - mysql = true - - case 'sqlite' - sqlite = true - - case 'pgsql' - pgsql = true - - case 'oracle' - oracle = true - - case 'mssql' - mssql = true - - default - fail "invalid database '$db' specified in config.odb_tests.database value" - } -} - -# If true, then build and run the test drivers in the dynamic multi-database -# mode. -# -config [bool] config.odb_tests.multi_database ?= ($size($databases) > 1) -multi = $config.odb_tests.multi_database - -assert ($multi || $size($databases) == 1) \ -'only one database can be configured if config.odb_tests.multi_database value is false' - -# Database connections. -# - -# PostgreSQL -# -# The database user. Note that the named user must be allowed to connect to -# the database server without specifying credentials. -# -config [string] config.odb_tests.pgsql.user ?= 'odb_test' - -# The database name. Note that it WILL BE MODIFIED by the tests. -# -config [string] config.odb_tests.pgsql.database ?= 'odb_test' - -# The database host. Leaving this variable undefined results in using -# Unix-domain sockets. Machines without Unix-domain sockets will connect to -# localhost. -# -config [string] config.odb_tests.pgsql.host - -# The database port or the socket file name extension for Unix-domain -# connections. -# -config [string] config.odb_tests.pgsql.port - -# If true, then assume that libodb-pgsql supports the bulk operations. -# -# Note: config.odb_tests.pgsql.bulk_default is reflected from manifest. -# -config [bool] config.odb_tests.pgsql.bulk_default ?= false -config [bool] config.odb_tests.pgsql.bulk ?= ($cxx.target.class != 'windows' && \ - $config.odb_tests.pgsql.bulk_default) -pgsql_bulk = $config.odb_tests.pgsql.bulk - -# MySQL -# -# The database user. -# -config [string] config.odb_tests.mysql.user ?= 'odb_test' - -# The database password. -# -config [string] config.odb_tests.mysql.passwd - -# The database name. Note that it WILL BE MODIFIED by the tests. -# -config [string] config.odb_tests.mysql.database ?= 'odb_test' - -# The database host. -# -config [string] config.odb_tests.mysql.host - -# The database port. -# -config [uint64] config.odb_tests.mysql.port - -# The database socket path. -# -config [path] config.odb_tests.mysql.socket - -define sql: file -sql{*}: extension = sql - -define xml: file -xml{*}: extension = xml - -if ($build.mode != 'skeleton') -{ - if ($cxx.target.system == 'win32-msvc') - cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS - - switch $cxx.class - { - case 'gcc' - { - cxx.coptions += -Wno-unknown-pragmas - } - case 'msvc' - { - cxx.coptions += /wd4068 /wd4251 /wd4275 /wd4800 - } - } - - # @@ BUILD2 Clang issues the following warnings while compile the - # odb-generated headers: - # - # In file included from odb-tests/common/view/olv/test1-odb-sqlite.cxx:10: - # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: warning: instantiation of variable 'odb::query_columns>::id' required here, but no definition is available [-Wundefined-var-template] - # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, - # | ^ - # odb-tests/common/view/olv/test1-odb.hxx:91:21: note: forward declaration of template entity is here - # 91 | static id_type_ id; - # | ^ - # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: note: add an explicit instantiation declaration to suppress this warning if 'odb::query_columns>::id' is explicitly instantiated in another translation unit - # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, - # - # Note: -Wno-undefined-var-template is temporarily added to suppress them. - # - if ($cxx.id.type == 'clang') - cxx.coptions += -Wno-undefined-var-template - - # Import odb that we are testing. - # - import! [metadata] odb = odb%exe{odb} - - # Import the mysql client for creating the database schemas, etc. - # - if $mysql - { - import! mysql_client = mysql%exe{mysql} - testscript{*}: mysql_client = $mysql_client - } - - # Import the psql client for creating the database schemas, etc. - # - if $pgsql - { - import! pgsql_client = psql%exe{psql} - testscript{*}: pgsql_client = $pgsql_client - } - - # Note that we need ((-.+)?) instead of just (-.+)? because we use this - # capture as a back-reference in the pattern. - # - [rule_name=odb_compile] \ - : hxx{~'/\1/'} libue{~'/.+-meta/'} $odb - {{ - pops = $cxx.lib_poptions($<[1]) - depdb hash $pops - - hp = $path($>[0]) - bn = $base($leaf($hp)) - db = $regex.replace($bn, '.+-odb(-(.+))?', '\2') - - if ($db == '') # *-odb.?xx target group? - db = ($multi ? 'common' : $databases[0]) - end - - # If the external SQL schema file will be generated, then add it as a - # dynamic target group member. - # - # @@ BUILD2 Probably we should add support for --generate-dep ODB compiler - # option. Then presumably this will be take care of automatically. - # - # We assume that the '--generate-schema' and '--schema-format' strings - # will never appear as standalone option values. - # - if ($db != 'common' && $regex.find_match($odb_options, '--generate-schema')) - schema_format = ($db == 'sqlite' ? 'embedded' : 'sql') - - for o: $odb_options - if ($o == '--schema-format') - schema_format = [null] # Indicate that the schema format comes next. - elif ($schema_format == [null]) - schema_format = $o - end - end - else - schema_format = '' - end - - t = ($schema_format == 'sql' \ - ? $directory($hp)/$regex.replace($bn, '(.+)-odb(-.+)?', '\1\2').sql \ - : '') - - depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ - -- echo "$t" - - $odb --std c++11 \ - ($multi ? --multi-database dynamic : ) \ - --database $db \ - --output-dir $out_base \ - $odb_options \ - "-I$src_base" \ - $pops \ - $path($<[0]) - }} - - # Every exe{} in this project is by default a test. - # - exe{*}: test = true - - # Specify the test target for cross-testing. - # - test.target = $cxx.target -} - -# The helper targets which can be used as prerequisites of test drivers -# which require either a specific database client or multiple clients for -# all the enabled databases. -# -alias{mysql-client}: $mysql_client: -{ - include = $mysql - clean = false -} - -alias{pgsql-client}: $pgsql_client: -{ - include = $pgsql - clean = false -} - -alias{database-client}: alias{mysql-client pgsql-client} diff --git a/buildfile b/buildfile deleted file mode 100644 index 2acd9fc..0000000 --- a/buildfile +++ /dev/null @@ -1,10 +0,0 @@ -# file : buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -./: libcommon/ common/ doc{README.md} legal{GPLv2 LICENSE} manifest - -./: mysql/: include = ($mysql && !$multi) -./: sqlite/: include = ($sqlite && !$multi) -./: pgsql/: include = ($pgsql && !$multi) - -./: testscript{*}: include = adhoc diff --git a/common/access/buildfile b/common/access/buildfile deleted file mode 100644 index f1264d9..0000000 --- a/common/access/buildfile +++ /dev/null @@ -1,45 +0,0 @@ -# file : common/access/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix access_ \ - --generate-schema \ - --accessor-regex '#(.+)#Get\u\1#' \ - --modifier-regex '#(.+)#Set\u\1#' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -# @@ BUILD2: Eventually we should be able to mark it as test.input once -# this is supported for testscript tests. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/access/driver.cxx b/common/access/driver.cxx deleted file mode 100644 index b40e73c..0000000 --- a/common/access/driver.cxx +++ /dev/null @@ -1,262 +0,0 @@ -// file : common/access/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test accessor/modifier expressions. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic accessor/modifier functionality. - // - { - using namespace test1; - - object o (1, 623, 723); - o.i1 () = 123; - o.i2 (223); - o.i3 () = 323; - o.i4 () = 423; - o.set_i5 (523); - o.s1 ("1bc"); - memcpy (o.b1 (), "123456789012345", 16); - o.b2 ("123456789012345"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id ())); - t.commit (); - - assert (o == *p); - } - } - - // Test composite accessor/modifier functionality. - // - { - using namespace test2; - - object o (1); - - o.v1 () = value (1123, 1234); - o.v2 (value (2123, 2234)); - o.v3_i1 (3123); - o.v3_i2 (3223); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id ())); - t.commit (); - - assert (o == *p); - } - } - - // Test object pointer accessor/modifier functionality. - // - { - using namespace test3; - - object2 o (1); - o.p1 ().reset (new object1 (1)); - o.p2 (object1_ptr (new object1 (2))); - - { - transaction t (db->begin ()); - const object1_ptr& ptr (o.p1 ()); - db->persist (ptr); - db->persist (o.p2 ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id ())); - t.commit (); - - assert (p->p1 ()->id () == o.p1 ()->id () && - p->p2 ()->id () == o.p2 ()->id ()); - } - } - - // Test container accessor/modifier functionality. - // - { - using namespace test4; - - object o (1); - o.c1 ().push_back (1123); - o.c1 ().push_back (1124); - o.c1 ().push_back (1125); - - { - std::vector v; - v.push_back (2123); - v.push_back (2124); - v.push_back (2125); - o.c2 (v); - } - - o.v1 ().c1 ().push_back (1123); - o.v1 ().c1 ().push_back (1124); - o.v1 ().c1 ().push_back (1125); - - { - std::vector v; - v.push_back (2123); - v.push_back (2124); - v.push_back (2125); - o.v1 ().c2 (v); - } - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id ())); - t.commit (); - - assert (o == *p); - } - } - - // Test id accessor/modifier functionality. - // - { - using namespace test5; - - object1 o1; - object2 o2; - object3 o3; - object4 o4; - o4.id (uuid ("\x60\x1D\x17\xF0-\x60\x05-\x47\x23-\x95\x37-" - "\xC1\xF8\x94\x41\x2B\xEC")); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (o4); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id ())); - unique_ptr p2 (db->load (o2.id ())); - unique_ptr p3 (db->load (o3.id_)); - unique_ptr p4 (db->load (o4.id ())); - t.commit (); - } - } - - // Test version accessor/modifier functionality. - // - { - using namespace test6; - - object1 o1 (1); - object2 o2; - object3 o3 (1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - - assert (o1.version () == 1); - assert (o2.version () == 1); - assert (o3.version_ == 1); - } - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - db->update (o3); - t.commit (); - - assert (o1.version () == 2); - assert (o2.version () == 2); - assert (o3.version_ == 2); - } - } - - // Test basic accessor/modifier functionality. - // - { - using namespace test7; - - object o (1); - o.i1 () = 123; - o.set_i2 (223); - o.setI3 (323); - o.seti4 (423); - o.i5 () = 523; - o.i6 () = 623; - o.SetI7 (723); - memcpy (o.b1 (), "123456789012345", 16); - o.b2 ("123456789012345"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id_)); - t.commit (); - - assert (o == *p); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/access/test.hxx b/common/access/test.hxx deleted file mode 100644 index 3a3424d..0000000 --- a/common/access/test.hxx +++ /dev/null @@ -1,592 +0,0 @@ -// file : common/access/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::memcpy, std::memcmp, std::memset -#include // std::unique_ptr -#include // std::move - -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_MYSQL) -# define BINARY16_TYPE "BINARY(16)" -# elif defined(ODB_DATABASE_SQLITE) -# define BINARY16_TYPE "BLOB" -# elif defined(ODB_DATABASE_PGSQL) -# define BINARY16_TYPE "BYTEA" -# elif defined(ODB_DATABASE_ORACLE) -# define BINARY16_TYPE "RAW(16)" -# elif defined(ODB_DATABASE_MSSQL) -# define BINARY16_TYPE "BINARY(16)" -# elif defined(ODB_DATABASE_COMMON) -# define BINARY16_TYPE "" -# else -# error unknown database -# endif -#endif - -// Test basic accessor/modifier functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object - struct object - { - object (): i6_ (0), i7_ (0) {} - object (unsigned long id, int i6, int i7): id_ (id), i6_ (i6), i7_ (i7) {} - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id access(id) - unsigned long id_; - - public: - int i1 () const {return i1_;} - int& i1 () {return i1_;} - private: - #pragma db access(i1) - int i1_; - - public: - int i2 () const {return i2_;} - void i2 (int i2) {i2_ = i2;} - private: - #pragma db access(i2) - int i2_; - - // Prefer reference modifier. - // - public: - int i3 () const {return i3_;} - int& i3 () {return i3_;} - void i3 (int i3); - private: - #pragma db access(i3) - int i3_; - - // Prefer reference modifier (reverse function order). - // - public: - int i4 () const {return i4_;} - void i4 (int i4); - int& i4 () {return i4_;} - private: - #pragma db access(i4) - int i4_; - - public: - int get_i5 () const {return i5_;} - void set_i5 (int i5) {i5_ = i5;} - private: - #pragma db get(get_i5) set(set_i5) - int i5_; - - // Const member via reference. - // - public: - const int& i6 () const {return i6_;} - private: - #pragma db get(i6) set(const_cast (this.i6 ())) - const int i6_; - - // Const member via modifier. - // - public: - int i7 () const {return i7_;} - void i7 (int i7) const {const_cast (i7_) = i7;} - private: - #pragma db access(i7) - const int i7_; - - public: - const char* s1 () const {return s1_.c_str ();} - void s1 (const char* s1) {s1_ = s1;} - //std::string s1 () const {return s1_;} - //void s1 (std::string s1) {s1_ = s1;} - private: - #pragma db get(s1) set(s1((?).c_str ())) - //#pragma db access(s1) - std::string s1_; - - // Array member via ref. - // - public: - const char* b1 () const {return b1_;} - char* b1 () {return b1_;} - private: - #pragma db type(BINARY16_TYPE) access(b1) - char b1_[16]; - - // Array member via modifier. - // - public: - const char* b2 () const {return b2_;} - void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} - private: - #pragma db type(BINARY16_TYPE) access(b2) - char b2_[16]; - - public: - bool operator== (const object& o) const - { - return id_ == o.id_ && - i1_ == o.i1_ && - i2_ == o.i2_ && - i3_ == o.i3_ && - i4_ == o.i4_ && - i5_ == o.i5_ && - i6_ == o.i6_ && - i7_ == o.i7_ && - s1_ == o.s1_ && - std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && - std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; - } - }; -} - -// Test composite accessor/modifier functionality. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db value - struct value - { - value () {} - value (int i1, int i2): i1_ (i1), i2_ (i2) {} - - bool operator== (const value& v) const - { - return i1_ == v.i1_ && i2_ == v.i2_; - } - - public: - int i1 () const {return i1_;} - int& i1 () {return i1_;} - private: - #pragma db access(i1) - int i1_; - - public: - int i2 () const {return i2_;} - void i2 (int i2) {i2_ = i2;} - private: - #pragma db access(i2) - int i2_; - }; - - #pragma db object - struct object - { - object () {} - object (unsigned long id): id_ (id) {} - - bool operator== (const object& o) const - { - return id_ == o.id_ && - v1_ == o.v1_ && - v2_ == o.v2_ && - v3_ == o.v3_; - } - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id access(id) - unsigned long id_; - - public: - const value& v1 () const {return v1_;} - value& v1 () {return v1_;} - private: - #pragma db access(v1) - value v1_; - - public: - const value& v2 () const {return v2_;} - void v2 (const value& v2) {v2_ = v2;} - private: - #pragma db access(v2) - value v2_; - - public: - int v3_i1 () const {return v3_.i1 ();} - int v3_i2 () const {return v3_.i2 ();} - void v3_i1 (int i1) {v3_.i1 () = i1;} - void v3_i2 (int i2) {v3_.i2 (i2);} - private: - #pragma db get(test2::value (this.v3_i1 (), this.v3_i2 ())) \ - set(this.v3_i1 ((?).i1 ()); this.v3_i2 ((?).i2 ())) - value v3_; - }; -} - -// Test object pointer accessor/modifier functionality. -// -#pragma db namespace table("t3_") -namespace test3 -{ - struct object1; - - typedef std::unique_ptr object1_ptr; - - #pragma db object pointer(object1_ptr) - struct object1 - { - object1 () {} - object1 (unsigned long id): id_ (id) {} - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id access(id) - unsigned long id_; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (unsigned long id): id_ (id) {} - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id access(id) - unsigned long id_; - - public: - const object1_ptr& p1 () const {return p1_;} - object1_ptr& p1 () {return p1_;} - private: - #pragma db access(p1) - object1_ptr p1_; - - public: - const object1_ptr& p2 () const {return p2_;} - - void p2 (object1_ptr p2) {p2_ = std::move (p2);} - - private: - #pragma db get(p2) set(p2 (std::move (?))) - - object1_ptr p2_; - }; -} - -// Test container accessor/modifier functionality. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db value - struct value - { - value (): c3_ (3, 999) {} - value (int v): c1_ (3, v), c2_ (3, v + 1), c3_ (3, v + 2) {} - - bool operator== (const value& v) const - { - return c1_ == v.c1_ && c2_ == v.c2_ && c3_ == v.c3_; - } - - public: - const std::vector& c1 () const {return c1_;} - std::vector& c1 () {return c1_;} - private: - #pragma db access(c1) - std::vector c1_; - - public: - const std::vector& c2 () const {return c2_;} - void c2 (const std::vector& c2) {c2_ = c2;} - private: - #pragma db access(c2) - std::vector c2_; - - public: - const std::vector c3_; - }; - - #pragma db object - struct object - { - object () {} - object (unsigned long id): id_ (id), c3_ (3, 3123), v2_ (2123) {} - - bool operator== (const object& o) const - { - return id_ == o.id_ && - c1_ == o.c1_ && - c2_ == o.c2_ && - c3_ == o.c3_ && - v1_ == o.v1_ && - v2_ == o.v2_; - } - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id access(id) - unsigned long id_; - - public: - const std::vector& c1 () const {return c1_;} - std::vector& c1 () {return c1_;} - private: - #pragma db access(c1) - std::vector c1_; - - public: - const std::vector& c2 () const {return c2_;} - void c2 (const std::vector& c2) {c2_ = c2;} - private: - #pragma db access(c2) - std::vector c2_; - - public: - const std::vector& c3 () const {return c3_;} - private: - #pragma db get(c3) set(const_cast&> (this.c3 ())) - const std::vector c3_; - - public: - const value& v1 () const {return v1_;} - value& v1 () {return v1_;} - private: - #pragma db access(v1) - value v1_; - - public: - const value v2_; - }; -} - -// Test id accessor/modifier functionality. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object - struct object1 - { - object1 (): id_ (0) {} - - public: - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id auto access(id) - unsigned long id_; - }; - - #pragma db object - struct object2 - { - object2 (): id_ (0) {} - - public: - unsigned long id () const {return id_;} - unsigned long& id () {return id_;} - private: - #pragma db id auto access(id) - unsigned long id_; - }; - - #pragma db object - struct object3 - { - object3 (): id_ (0) {} - - #pragma db id auto - const unsigned long id_; - }; - - #pragma db value - struct uuid - { - uuid () {std::memset (data_, 0, sizeof (data_));} - explicit uuid (const char* d) {data (d);} - - public: - const char* data () const {return data_;} - void data (const char* d) {std::memcpy (data_, d, sizeof (data_));} - private: - #pragma db type(BINARY16_TYPE) column("") access(data) - char data_[16]; - }; - - #pragma db object - struct object4 - { - public: - const uuid& id () const {return id_;} - void id (const uuid& id) {id_ = id;} - private: - #pragma db id access(id) - uuid id_; - }; -} - -// Test version accessor/modifier functionality. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object optimistic - struct object1 - { - object1 (unsigned long id = 0): id_ (id), version_ (0) {} - - #pragma db id - unsigned long id_; - - public: - unsigned long version () const {return version_;} - void version (unsigned long version) {version_ = version;} - private: - #pragma db version access(version) - unsigned long version_; - }; - - #pragma db object optimistic - struct object2 - { - object2 (): version_ (0) {} - - #pragma db id auto - unsigned long id_; - - public: - unsigned long version () const {return version_;} - unsigned long& version () {return version_;} - private: - #pragma db version access(version) - unsigned long version_; - }; - - #pragma db object optimistic - struct object3 - { - object3 (unsigned long id = 0): id_ (id), version_ (0) {} - - #pragma db id - unsigned long id_; - - #pragma db version - const unsigned long version_; - }; -} - -// Test automatic discovery of accessor/modifier functions. -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object - struct object - { - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - public: - int i1 () const {return i1_;} - int& i1 () {return i1_;} - private: - int i1_; - - public: - const int& get_i2 () const {return i2_;} - void set_i2 (int i2) {i2_ = i2;} - private: - int i2_; - - public: - const int& getI3 () const {return i3_;} - void setI3 (const int& i3) {i3_ = i3;} - private: - int i3_; - - public: - int geti4 () const {return i4;} - int seti4 (int v) {int r (i4); i4 = v; return r;} - private: - int i4; - - // Prefer reference modifier. - // - public: - int i5 () const {return i5_;} - int& i5 () {return i5_;} - void i5 (int i5); - private: - int i5_; - - // Prefer reference modifier (reverse function order). - // - public: - int i6 () const {return i6_;} - void i6 (int i6); - int& i6 () {return i6_;} - private: - int i6_; - - // Custom accessor/modifier regex. - // - public: - int GetI7 () const {return i7_;} - void SetI7 (int i7) {i7_ = i7;} - private: - int i7_; - - // Array member via ref. - // - public: - const char* b1 () const {return b1_;} - char* b1 () {return b1_;} - private: - #pragma db type(BINARY16_TYPE) - char b1_[16]; - - // Array member via modifier. - // - public: - const char* b2 () const {return b2_;} - void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} - private: - #pragma db type(BINARY16_TYPE) - char b2_[16]; - - public: - bool operator== (const object& o) const - { - return id_ == o.id_ && - i1_ == o.i1_ && - i2_ == o.i2_ && - i3_ == o.i3_ && - i4 == o.i4 && - i5_ == o.i5_ && - i6_ == o.i6_ && - i7_ == o.i7_ && - std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && - std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; - } - }; -} - -#endif // TEST_HXX diff --git a/common/access/testscript b/common/access/testscript deleted file mode 100644 index 04f0ec0..0000000 --- a/common/access/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/access/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/as/buildfile b/common/as/buildfile deleted file mode 100644 index dcdc961..0000000 --- a/common/as/buildfile +++ /dev/null @@ -1,49 +0,0 @@ -# file : common/as/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix as_ \ - --generate-schema \ - --generate-query \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# @@ BUILD@ Temporarily suppress the following warning: -# -# test-odb.cxx(6234): warning C4244: 'argument': conversion from 'id_type::value_type' to 'test5::version_type::value_type', possible loss of data -# -if ($cxx.class == 'msvc') - cxx.coptions += /wd4244 - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/as/driver.cxx b/common/as/driver.cxx deleted file mode 100644 index 578eb23..0000000 --- a/common/as/driver.cxx +++ /dev/null @@ -1,348 +0,0 @@ -// file : common/as/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test C++ type mapping (#pragma map type as ...). -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic type mapping functionality. - // - { - using namespace test1; - - object o1 (true, green, 123, 234); - o1.m[false] = 123; - o1.v.push_back (o1.ip); - o1.cv.push_back (red); - o1.cv.push_back (green); - - object o2 (false, blue, 234, 456); - o2.m[true] = 234; - o2.v.push_back (o2.ip); - o2.cv.push_back (green); - o2.cv.push_back (blue); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o1.b = false; - o1.c = blue; - o1.ip.first++; - o1.ip.second--; - o1.m[false]++; - o1.m[true] = 234; - o1.v.back () = o1.ip; - o1.cv.modify_front () = green; - o1.cv.push_back (red); - - o2.b = true; - o2.c = red; - o2.ip.first--; - o2.ip.second++; - o2.m[true]--; - o2.m[false] = 345; - o2.v.push_back (o2.ip); - o2.cv.pop_back (); - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - - // Test wrapped simple type mapping. - // - { - using namespace test2; - - object o1; - o1.v.push_back (null_bool ()); - o1.v.push_back (false); - - object o2; - o2.b = true; - o2.v.push_back (true); - o2.v.push_back (null_bool ()); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o1.b = false; - o1.v[0] = true; - o1.v[1].reset (); - - o2.b.reset (); - o2.v.push_back (false); - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - - // Test wrapped composite type mapping. - // - { - using namespace test3; - - object o1; - o1.ip = intp (0, 0); // NULL - o1.npv.push_back (o1.np); - o1.ipv.push_back (o1.ip); - - object o2; - o2.np = intp (123, 234); - o1.ip = intp (234, 123); - o2.npv.push_back (o2.np); - o2.ipv.push_back (o2.ip); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o1.np = o1.npv[0] = intp (234, 456); - o1.ip = o1.ipv.modify_at (0) = intp (456, 234); - - o2.np.reset (); - o2.npv[0].reset (); - o2.ip = o2.ipv.modify_at (0) = intp (0, 0); // NULL - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - - // Test id type mapping. - // - { - using namespace test4; - - object o1 (123); - o1.v.push_back (1); - o1.v.push_back (2); - o1.v.push_back (3); - - object o2 (234); - o2.v.push_back (3); - o2.v.push_back (2); - o2.v.push_back (1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o1.i++; - o1.v.pop_back (); - o1.v.modify_front ()++; - - o2.i--; - o2.v.clear (); - o2.v.push_back (4); - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - - // Test version type mapping. - // - { - using namespace test5; - - object o1 (100, 123); - object o2 (200, 234); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - - assert (*p1 == o1); - assert (*p2 == o2); - - p1->i--; - p2->i++; - - db->update (*p1); - db->update (*p2); - - t.commit (); - } - - { - transaction t (db->begin ()); - - for (;;) - { - o1.i++; - o2.i--; - - try - { - - db->update (o1); - db->update (o2); - break; - } - catch (const odb::object_changed&) - { - db->reload (o1); - db->reload (o2); - } - } - - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/as/test.hxx b/common/as/test.hxx deleted file mode 100644 index 963abeb..0000000 --- a/common/as/test.hxx +++ /dev/null @@ -1,270 +0,0 @@ -// file : common/as/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include // pair - -#include -#include -#include - -// Test basic type mapping functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - enum color {red, green, blue}; - - inline const char* - color_to_string (color c) - { - return c == red ? "RED" : (c == green ? "GREEN" : "BLUE"); - } - - inline color - string_to_color (const std::string& s) - { - return s == "RED" ? red : (s == "GREEN" ? green : blue); - } - - #pragma db map type(color) as(std::string) \ - to(test1::color_to_string (?)) \ - from(test1::string_to_color (?)) - - typedef std::pair intp; - - #pragma db value - struct comp - { - comp () {} - comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} - - int n1; - int n2; - }; - - #pragma db map type(intp) as(comp) \ - to(test1::comp ((?).first, (?).second)) \ - from(test1::intp ((?).n1, (?).n2)) - - #pragma db object - struct object - { - // Class-scope mapping. - // - #pragma db map type(bool) as(std::string) \ - to((?) ? "true" : "false") \ - from((?) == "true") - - #pragma db id auto - unsigned long id; - - bool b; - color c; - intp ip; - - std::map m; - std::vector v; - odb::vector cv; - - object () {} - object (bool b_, color c_, int n1, int n2): b (b_), c (c_), ip (n1, n2) {} - }; - - inline bool - operator== (const object& x, const object y) - { - return - x.b == y.b && - x.c == y.c && - x.ip == y.ip && - x.m == y.m && - x.v == y.v && - x.cv == y.cv; - } -} - -// Test wrapped simple type mapping. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db map type(bool) as(std::string) \ - to((?) ? "true" : "false") \ - from((?) == "true") - - typedef odb::nullable null_bool; - typedef odb::nullable null_string; - - /* - #pragma db map type(null_bool) as(null_string) \ - to((?) \ - ? test2::null_string (*(?) ? "true" : "false") \ - : test2::null_string ()) \ - from((?) \ - ? test2::null_bool (*(?) == "true") \ - : test2::null_bool ()) - */ - - #pragma db map type(null_bool) as(std::string) \ - to((?) ? (*(?) ? "true" : "false") : "null") \ - from((?) != "null" \ - ? test2::null_bool ((?) == "true") \ - : test2::null_bool ()) - - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - odb::nullable b; - std::vector > v; - }; - - inline bool - operator== (const object& x, const object y) - { - return x.b == y.b && x.v == y.v; - } -} - -// Test wrapped simple type mapping. -// -#pragma db namespace table("t3_") -namespace test3 -{ - typedef std::pair intp; - - #pragma db value - struct comp - { - comp () {} - comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} - - int n1; - int n2; - }; - - typedef odb::nullable null_intp; - typedef odb::nullable null_comp; - - #pragma db map type(null_intp) as(null_comp) \ - to((?) \ - ? test3::null_comp (test3::comp ((?)->first, (?)->second)) \ - : test3::null_comp ()) \ - from((?) \ - ? test3::null_intp (test3::intp ((?)->n1, (?)->n2)) \ - : test3::null_intp ()) - - // Map int pair with both members equal 0 to NULL comp. - // - #pragma db map type(intp) as(null_comp) \ - to((?).first != 0 || (?).second != 0 \ - ? test3::null_comp (test3::comp ((?).first, (?).second)) \ - : test3::null_comp ()) \ - from((?) \ - ? test3::intp (test3::intp ((?)->n1, (?)->n2)) \ - : test3::intp (0, 0)) - - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - odb::nullable np; - intp ip; - - std::vector > npv; - odb::vector ipv; - }; - - inline bool - operator== (const object& x, const object y) - { - return x.np == y.np && x.ip == y.ip && x.npv == y.npv && x.ipv == y.ipv; - } -} - -// Test id type mapping. -// -struct id_type -{ - typedef unsigned long value_type; - value_type value; - - id_type (value_type v = 0): value (v) {} - operator value_type () const {return value;} -}; - -#pragma db map type(id_type) as(id_type::value_type) - -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object - struct object - { - #pragma db id auto - id_type id; - - int i; - odb::vector v; - - object () {} - object (int i_): i (i_) {} - }; - - inline bool - operator== (const object& x, const object y) - { - return x.id == y.id && x.i == y.i && x.v == y.v; - } -} - -// Test version type mapping. -// -#pragma db namespace table("t5_") -namespace test5 -{ - struct version_type - { - typedef unsigned short value_type; - value_type value; - - version_type (value_type v = 0): value (v) {} - operator value_type () const {return value;} - version_type& operator++ () {value++; return *this;} - }; - - #pragma db map type(version_type) as(id_type::value_type) - - #pragma db object optimistic - struct object - { - #pragma db id - id_type id; - - #pragma db version - version_type v; - - int i; - - object () {} - object (id_type id_, int i_): id (id_), i (i_) {} - }; - - inline bool - operator== (const object& x, const object y) - { - return x.id == y.id && x.v == y.v && x.i == y.i; - } -} - -#endif // TEST_HXX diff --git a/common/as/testscript b/common/as/testscript deleted file mode 100644 index 12d9753..0000000 --- a/common/as/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/as/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/blob/buildfile b/common/blob/buildfile deleted file mode 100644 index cc6d164..0000000 --- a/common/blob/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/blob/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix blob_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/blob/driver.cxx b/common/blob/driver.cxx deleted file mode 100644 index 269f415..0000000 --- a/common/blob/driver.cxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : common/blob/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test BLOB mapping. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - const char data[] = - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" - "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" - "cccccccccccccccccccccccccccccccccccccccccccccccc" - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" - "dddddddddddddddddddddddddddddddddddddddddddddddd" - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" - "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" - "ffffffffffffffffffffffffffffffffffffffffffffffff"; - - const unsigned char* udata = reinterpret_cast (data); - - object o (1); - o.vc.assign (data, data + sizeof (data)); - o.vuc.assign (udata, udata + sizeof (data)); - memcpy (o.c, data, sizeof (data)); - memcpy (o.uc, udata, sizeof (data)); - memcpy (o.a.data (), data, sizeof (data)); - memcpy (o.ua.data (), udata, sizeof (data)); - o.cont.push_back (1); - o.cont.push_back (2); - o.cont.push_back (3); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/blob/test.hxx b/common/blob/test.hxx deleted file mode 100644 index 9602ca2..0000000 --- a/common/blob/test.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// file : common/blob/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::memcmp - -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -//# define BLOB_TYPE "VARBINARY(1024)" -# define BLOB_TYPE "VARBINARY(max)" -# else -//# define BLOB_TYPE "RAW(1024)" -# define BLOB_TYPE "BLOB" -# endif -#endif - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db type(BLOB_TYPE) - std::vector vc; - - #pragma db type(BLOB_TYPE) - std::vector vuc; - - #pragma db type(BLOB_TYPE) - char c[1024]; - - #pragma db type(BLOB_TYPE) - unsigned char uc[1024]; - - #pragma db type(BLOB_TYPE) - std::array a; - - #pragma db type(BLOB_TYPE) - std::array ua; - - // Make sure we can still use std::vector and std::array - // as containers. - // - std::vector cont; -}; - -inline bool -operator== (const object& x, const object& y) -{ - return x.id_ == y.id_ - && x.vc == y.vc - && x.vuc == y.vuc - && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 - && std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 - && x.a == y.a - && x.ua == y.ua - && x.cont == y.cont; -} - -#endif // TEST_HXX diff --git a/common/blob/testscript b/common/blob/testscript deleted file mode 100644 index 4fb9955..0000000 --- a/common/blob/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/blob/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/buildfile b/common/buildfile deleted file mode 100644 index cb9c748..0000000 --- a/common/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : common/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -./: {*/ -bulk/} - -./: bulk/: include = (!$pgsql || $pgsql_bulk || $size($databases) != 1) diff --git a/common/bulk/buildfile b/common/bulk/buildfile deleted file mode 100644 index 417eb22..0000000 --- a/common/bulk/buildfile +++ /dev/null @@ -1,49 +0,0 @@ -# file : common/bulk/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert (!$pgsql || $pgsql_bulk || $size($databases) != 1) \ -"bulk operations are disabled for pgsql which is specified as single database" - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases -{ - if ($db != 'pgsql' || $pgsql_bulk) - import libs += libodb-$db%lib{odb-$db} -} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: \ - include = ($multi && ($db != 'pgsql' || $pgsql_bulk)) - - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix bulk_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx deleted file mode 100644 index 23b49ad..0000000 --- a/common/bulk/driver.cxx +++ /dev/null @@ -1,1203 +0,0 @@ -// file : common/bulk/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test bulk database operations. -// - -#include // std::unique_ptr -#include -#include -#include - -#include -#include - -#include - -#include // DATABASE_* -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -// Sun CC with non-standard STL does not have iterator_traits in which -// case we assume iterator is just a pointer. -// -template ::value_type -#else - typename T = typename odb::details::meta::remove_pointer::result -#endif - > -struct element_traits; - -template -struct element_traits -{ - typedef T type; - typedef T* pointer; - typedef std::unique_ptr unique_ptr; - - static T& ref (T& x) {return x;} - static T* ptr (T* p) {return p;} -}; - -template -struct element_traits -{ - typedef T type; - typedef T* pointer; - typedef std::unique_ptr unique_ptr; - - static T& ref (T* p) {return *p;} - static T* ptr (T* p) {return p;} -}; - -template -struct element_traits > -{ - typedef T type; - typedef std::unique_ptr pointer; - typedef std::unique_ptr unique_ptr; - - static T& ref (const unique_ptr& p) {return *p;} - static T* ptr (const unique_ptr& p) {return p.get ();} -}; - -template -void -persist (const unique_ptr& db, I b, I e, bool cont = true) -{ - typedef element_traits traits; - typedef typename traits::type type; - typedef typename traits::unique_ptr unique_ptr; - - { - transaction t (db->begin ()); - db->persist (b, e, cont); - t.commit (); - } - - // Verify we can load the objects via their ids. - // - { - transaction t (db->begin ()); - - for (I i (b); i != e; ++i) - { - type& x (traits::ref (*i)); - unique_ptr p (db->load (x.id)); - assert (p->n == x.n && p->s == x.s); - } - - t.commit (); - } -} - -template -void -try_persist (const unique_ptr& db, I b, I e, bool cont = true) -{ - try - { - persist (db, b, e, cont); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } -} - -template -void -update (const unique_ptr& db, I b, I e, - bool modify = true, bool cont = true) -{ - typedef element_traits traits; - typedef typename traits::type type; - typedef typename traits::unique_ptr unique_ptr; - - if (modify) - { - for (I i (b); i != e; ++i) - { - type& x (traits::ref (*i)); - x.n++; - x.s[0]++; - } - } - - { - transaction t (db->begin ()); - db->update (b, e, cont); - t.commit (); - } - - // Verify changes. - // - { - transaction t (db->begin ()); - - for (I i (b); i != e; ++i) - { - type& x (traits::ref (*i)); - unique_ptr p (db->load (x.id)); - assert (p->n == x.n && p->s == x.s); - } - - t.commit (); - } -} - -template -void -try_update (const unique_ptr& db, I b, I e, bool cont = true) -{ - try - { - update (db, b, e, false, cont); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } -} - -template -void -erase (const unique_ptr& db, I b, I e) -{ - typedef element_traits traits; - typedef typename traits::type type; - - { - transaction t (db->begin ()); - db->erase (b, e); - t.commit (); - } - - // Verify the objects are gone. - // - { - transaction t (db->begin ()); - - for (I i (b); i != e; ++i) - { - type& x (traits::ref (*i)); - typename traits::pointer p (db->find (x.id)); - assert (traits::ptr (p) == 0); - } - - t.commit (); - } -} - -template -void -erase_id (const unique_ptr& db, I b, I e, bool cont = true) -{ - typedef element_traits traits; - typedef T type; - - { - transaction t (db->begin ()); - db->erase (b, e, cont); - t.commit (); - } - - // Verify the objects are gone. - // - { - transaction t (db->begin ()); - - for (I i (b); i != e; ++i) - assert (traits::ptr (db->find (*i)) == 0); - - t.commit (); - } -} - -template -void -try_erase (const unique_ptr& db, const A& a, bool cont = true) -{ - try - { - erase_id (db, a, a + sizeof (a) / sizeof (a[0]), cont); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } -} - - -template -void -test (const unique_ptr& db, I b, I e) -{ - persist (db, b, e); - update (db, b, e); - erase (db, b, e); -} - -template -vector -fill (std::size_t count) -{ - vector r; - - unsigned int n (1); - std::string s ("a"); - - for (size_t i (0); i != count; ++i) - { - r.push_back (T (n, s)); - n++; - s[0] = (s[0] == 'z' ? 'a' : s[0] + 1); - } - - return r; -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - -#if !defined(MULTI_DATABASE) && \ - (defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) || \ - defined(DATABASE_PGSQL)) - - // Test database class API with various forms of containers - // and elements (test #6 is a copy). - // - { - using namespace test1; - - { - object a[2]; - a[0] = object (1, "a"); - a[1] = object (2, "b"); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - test (db, v.begin (), v.end ()); - } - - { - object o1 (1, "a"); - object o2 (2, "b"); - object* a[2] = {&o1, &o2}; - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - - { - object o1 (1, "a"); - object o2 (2, "b"); - vector v; - v.push_back (&o1); - v.push_back (&o2); - test (db, v.begin (), v.end ()); - } - - { - vector> v; - v.push_back (unique_ptr (new unique_object (1, "a"))); - v.push_back (unique_ptr (new unique_object (2, "b"))); - test (db, v.begin (), v.end ()); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - persist (db, v.begin (), v.end ()); - - unsigned long id[2] = {v[0].id, v[1].id}; - erase_id (db, id, id + sizeof (id) / sizeof (id[0])); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - persist (db, v.begin (), v.end ()); - - vector id; - id.push_back (v[0].id); - id.push_back (v[1].id); - erase_id (db, id.begin (), id.end ()); - } - } - - // Test various batch sizes. - // - { - using namespace test1; - - { - vector v; // 0 - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (1)); // 1 - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (2)); // batch - 1 - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (3)); // batch - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (4)); // batch + 1 - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (5)); // 2 * batch - 1 - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (6)); // 2 * batch - test (db, v.begin (), v.end ()); - } - - { - vector v (fill (100)); // 100 - test (db, v.begin (), v.end ()); - } - } - - // Test object with manually assigned id. - // - { - using namespace test2; - - { - vector v; - v.push_back (object ("1", 1, "a")); - v.push_back (object ("2", 2, "b")); - test (db, v.begin (), v.end ()); - } - - { - typedef unique_ptr unique_ptr; - - vector v; - v.push_back (unique_ptr (new unique_object ("1", 1, "a"))); - v.push_back (unique_ptr (new unique_object ("2", 2, "b"))); - test (db, v.begin (), v.end ()); - } - - // Test const objects. - // - - { - const object a[1]; - const object* e (a + sizeof (a) / sizeof (a[0])); - - transaction t (db->begin ()); - db->persist (a, e); - db->erase (a, e); - t.commit (); - } - - { - object o1 ("1", 1, "a"); - object o2 ("2", 2, "b"); - - vector v; - v.push_back (&o1); - v.push_back (&o2); - - transaction t (db->begin ()); - db->persist (v.begin (), v.end ()); - db->erase (v.begin (), v.end ()); - t.commit (); - } - } - - // Test failure. - // - { - using namespace test3; - - vector v; - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (9, 9)); - v.push_back (object (10, 10)); - v.push_back (object (11, 11)); - - persist (db, v.begin (), v.end ()); - - // persist - // - { - { - vector v; // 1 - v.push_back (object (6, 6)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // batch + 1 - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (9, 9)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 x batch - 1 - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (9, 9)); - v.push_back (object (10, 10)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 x batch - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (9, 9)); - v.push_back (object (10, 10)); - v.push_back (object (11, 11)); - try_persist (db, v.begin (), v.end ()); - } - - // Mixture of success and failure. - // - - { - vector v; // 1 - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 1 - v.push_back (object (6, 6)); - v.push_back (object (0, 0)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (6, 6)); - v.push_back (object (0, 0)); - v.push_back (object (7, 7)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (0, 0)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (0, 0)); - v.push_back (object (8, 8)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (0, 0)); - try_persist (db, v.begin (), v.end ()); - } - - { - vector v; // mixture - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - v.push_back (object (1, 1)); - v.push_back (object (7, 7)); - v.push_back (object (2, 2)); - v.push_back (object (8, 8)); - v.push_back (object (3, 3)); - try_persist (db, v.begin (), v.end ()); - } - - // Test stopping after failure. - // - { - vector v; // batch - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (6, 6)); - v.push_back (object (2, 2)); - v.push_back (object (3, 3)); - try_persist (db, v.begin (), v.end (), false); - } - } - - // update - // - { - { - vector v; // 1 - v.push_back (object (0, 0)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (2, 2)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // batch + 1 - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (2, 2)); - v.push_back (object (3, 3)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 x batch - 1 - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (2, 2)); - v.push_back (object (3, 3)); - v.push_back (object (4, 4)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 x batch - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (2, 2)); - v.push_back (object (3, 3)); - v.push_back (object (4, 4)); - v.push_back (object (5, 5)); - try_update (db, v.begin (), v.end ()); - } - - // Mixture of success and failure. - // - - { - vector v; // 1 - v.push_back (object (6, 6)); - v.push_back (object (0, 0)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 1 - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (6, 6)); - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - v.push_back (object (1, 1)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // 2 - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (6, 6)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (6, 6)); - v.push_back (object (2, 2)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // batch - v.push_back (object (0, 0)); - v.push_back (object (1, 1)); - v.push_back (object (2, 2)); - v.push_back (object (6, 6)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // mixture - v.push_back (object (0, 0)); - v.push_back (object (6, 6)); - v.push_back (object (2, 2)); - v.push_back (object (7, 7)); - v.push_back (object (3, 3)); - v.push_back (object (8, 8)); - v.push_back (object (4, 4)); - try_update (db, v.begin (), v.end ()); - } - - { - vector v; // mixture - v.push_back (object (0, 0)); - v.push_back (object (2, 2)); - v.push_back (object (3, 3)); - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (8, 8)); - v.push_back (object (4, 4)); - try_update (db, v.begin (), v.end ()); - } - - // Test stopping after failure. - // - { - vector v; // batch - v.push_back (object (6, 6)); - v.push_back (object (7, 7)); - v.push_back (object (0, 0)); - v.push_back (object (8, 8)); - v.push_back (object (9, 9)); - try_update (db, v.begin (), v.end (), false); - } - - // Test a database exception (unique constraint violation) - // - try - { - v[0].n++; - v[2].n++; - - update (db, v.begin (), v.begin () + 3, false); - assert (false); - } - catch (const multiple_exceptions& e) - { -#ifndef DATABASE_PGSQL - assert (e.attempted () == 3 && e.failed () == 2); - assert (e[0] != 0 && e[1] == 0 && e[2] != 0); -#else - // In PosgreSQL no further statements are attempted after the first - // failure. - // - assert (e.attempted () == 1 && e.failed () == 1); - assert (e[0] != 0); -#endif - } - } - - // erase - // - { - { - unsigned long a[] = {0}; // 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1}; // 2 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2}; // batch - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2, 3}; // batch + 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2, 3, 4}; // 2 x batch - 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2, 3, 4, 5}; // 2 x batch - try_erase (db, a); - } - - // Mixture of success and failure. - // - - { - unsigned long a[] = {6, 0}; // 2 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 6}; // 2 - try_erase (db, a); - } - - { - unsigned long a[] = {6, 0, 1}; // batch - try_erase (db, a); - } - - { - unsigned long a[] = {0, 6, 1}; // batch - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 6}; // batch - try_erase (db, a); - } - - { - unsigned long a[] = {6, 0, 1, 2}; // batch + 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 6, 1, 2}; // batch + 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 6, 2}; // batch + 1 - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2, 6}; // batch + 1 - try_erase (db, a); - } - - { - unsigned long a[] = {6, 0, 7, 1, 8, 2, 9, 3}; // mixture - try_erase (db, a); - } - - { - unsigned long a[] = {0, 1, 2, 6, 7, 8, 3, 4, 5, 9}; // mixture - try_erase (db, a); - } - - // Test stopping after failure. - // - { - unsigned long a[] = {6, 7, 0, 8, 9}; - try_erase (db, a, false); - } - } - - erase (db, v.begin (), v.end ()); - } - - // Test a large batch. - // - { - using namespace test4; - - vector v (fill (5000)); - test (db, v.begin (), v.end ()); - } - - // Test object without id. - // - { - using namespace test5; - - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - - { - transaction t (db->begin ()); - db->persist (v.begin (), v.end ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ("ORDER BY" + query::n)); - result::iterator i (r.begin ()); - - assert (i != r.end () && i->n == 1 && i->s == "a"); - assert (++i != r.end () && i->n == 2 && i->s == "b"); - assert (++i == r.end ()); - - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase_query (); - t.commit (); - } - } - - // Test API with persistent class template instantiations (copy of - // test #1). - { - using namespace test6; - - // Make sure we can still call the non-bulk API. - // - { - object o (0, "z"); - transaction t (db->begin ()); - db->persist (o); - db->update (o); - db->reload (o); - db->erase (o); - t.commit (); - } - - - // The rest is a copy of test #1. - // - { - object a[2]; - a[0] = object (1, "a"); - a[1] = object (2, "b"); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - test (db, v.begin (), v.end ()); - } - - { - object o1 (1, "a"); - object o2 (2, "b"); - object* a[2] = {&o1, &o2}; - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - - { - object o1 (1, "a"); - object o2 (2, "b"); - vector v; - v.push_back (&o1); - v.push_back (&o2); - test (db, v.begin (), v.end ()); - } - - { - vector> v; - v.push_back (unique_ptr (new unique_object (1, "a"))); - v.push_back (unique_ptr (new unique_object (2, "b"))); - test (db, v.begin (), v.end ()); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - persist (db, v.begin (), v.end ()); - - unsigned long id[2] = {v[0].id, v[1].id}; - erase_id (db, id, id + sizeof (id) / sizeof (id[0])); - } - - { - vector v; - v.push_back (object (1, "a")); - v.push_back (object (2, "b")); - persist (db, v.begin (), v.end ()); - - vector id; - id.push_back (v[0].id); - id.push_back (v[1].id); - erase_id (db, id.begin (), id.end ()); - } - } - - // Test optimistic concurrency. - // - { - using namespace test7; - - std::vector v (fill (4)); - - // persist - // - { - transaction t (db->begin ()); - db->persist (v.begin (), v.end ()); - t.commit (); - - assert (v[0].v != 0 && - v[1].v != 0 && - v[2].v != 0 && - v[3].v != 0); - } - - // update - // - { - std::vector c (v); - - transaction t (db->begin ()); - db->update (v.begin (), v.end ()); - t.commit (); - - assert (v[0].v > c[0].v && - v[1].v > c[1].v && - v[2].v > c[2].v && - v[3].v > c[3].v); - } - - { - object o2 (v[1]); - object o4 (v[3]); - - o2.n++; - o4.n++; - - transaction t (db->begin ()); - db->update (o2); - db->update (o4); - t.commit (); - } - - try - { - // Some updates may succeed spoiling the version for erase tests. - // - std::vector c (v); - - transaction t (db->begin ()); - db->update (c.begin (), c.end ()); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } - - // erase - // - try - { - transaction t (db->begin ()); - db->erase (v.begin (), v.end ()); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } - - { - transaction t (db->begin ()); - db->reload (v[1]); - db->reload (v[3]); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (v.begin (), v.end ()); - t.commit (); - } - } - - // Test SQL Server optimistic concurrency with ROWVERSION. - // -#ifdef DATABASE_MSSQL - { - using namespace test8; - - std::vector v (fill (4)); - - v[0].id = 1; - v[1].id = 2; - v[2].id = 3; - v[3].id = 4; - - - // persist - // - { - transaction t (db->begin ()); - db->persist (v.begin (), v.end ()); - t.commit (); - - assert (v[0].v != 0 && - v[1].v != 0 && - v[2].v != 0 && - v[3].v != 0); - - //cerr << v[0].v << endl - // << v[1].v << endl - // << v[2].v << endl - // << v[3].v << endl; - } - - // update - // - - /* - { - std::vector c (v); - - transaction t (db->begin ()); - db->update (v.begin (), v.end ()); - t.commit (); - - assert (v[0].v > c[0].v && - v[1].v > c[1].v && - v[2].v > c[2].v && - v[3].v > c[3].v); - } - */ - - { - object o2 (v[1]); - object o4 (v[3]); - - o2.n++; - o4.n++; - - transaction t (db->begin ()); - db->update (o2); - db->update (o4); - t.commit (); - } - - /* - try - { - transaction t (db->begin ()); - db->update (v.begin (), v.end ()); - assert (false); - } - catch (const multiple_exceptions& e) - { - cout << e.what () << endl << endl; - } - */ - - // erase - // - try - { - transaction t (db->begin ()); - db->erase (v.begin (), v.end ()); - assert (false); - } - catch (const multiple_exceptions& e) - { - assert (e.attempted () == 4 && e.failed () == 4); - } - - { - transaction t (db->begin ()); - db->reload (v[1]); - db->reload (v[3]); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (v.begin (), v.end ()); - t.commit (); - } - } -#endif - -#endif - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx deleted file mode 100644 index 71755f2..0000000 --- a/common/bulk/test.hxx +++ /dev/null @@ -1,211 +0,0 @@ -// file : common/bulk/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include // std::unique_ptr - -#include - -// Test basic functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object bulk(3) session - struct object - { - object (unsigned int n_ = 0, std::string s_ = "") - : id (0), n (n_), s (s_) {} - - #pragma db id auto - unsigned long id; - - unsigned int n; - - #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. - std::string s; - }; - - #pragma db object bulk(3) pointer(std::unique_ptr) - struct unique_object - { - unique_object (unsigned int n_ = 0, std::string s_ = "") - : id (0), n (n_), s (s_) {} - - #pragma db id auto - unsigned long id; - - unsigned int n; - std::string s; - }; -} - -// Test object with manually assigned id. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object bulk(3) session - struct object - { - // Can't use empty id because of Oracle. - // - object (std::string id_ = "!", unsigned int n_ = 0, std::string s_ = "") - : id (id_), n (n_), s (s_) {} - - #pragma db id - std::string id; - - unsigned int n; - std::string s; - }; - -#pragma db object bulk(3) pointer(std::unique_ptr) - struct unique_object - { - unique_object (std::string id_ = "", - unsigned int n_ = 0, - std::string s_ = "") - : id (id_), n (n_), s (s_) {} - - #pragma db id - std::string id; - - unsigned int n; - std::string s; - }; -} - -// Test failure. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object bulk(3) - struct object - { - object (unsigned long id_ = 0, unsigned int n_ = 0) - : id (id_), n (n_), s ("abc") {} - - #pragma db id - unsigned long id; - - #pragma db unique - unsigned int n; - std::string s; - }; -} - -// Test a large batch. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object bulk(3000) - struct object - { - object (unsigned int n_ = 0, std::string s_ = "") - : id (0), n (n_), s (s_) {} - - #pragma db id auto - unsigned long id; - - unsigned int n; - - #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. - std::string s; - }; -} - -// Test object without id. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object no_id bulk(3) - struct object - { - object (unsigned int n_ = 0, std::string s_ = ""): n (n_), s (s_) {} - - unsigned int n; - std::string s; - }; -} - -// Test API with persistent class template instantiations. -// -#pragma db namespace table("t6_") -namespace test6 -{ - template - struct object_template - { - object_template (unsigned int n_ = 0, std::string s_ = "") - : id (0), n (n_), s (s_) {} - - unsigned long id; - unsigned int n; - std::string s; - }; - - typedef object_template<1> object; - - #pragma db object(object) bulk(3) - #pragma db member(object::id) id auto - - typedef object_template<3> unique_object; - - #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) - #pragma db member(unique_object::id) id auto -} - -// Test optimistic concurrency. -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object optimistic bulk(3) - struct object - { - object (unsigned int n_ = 0, std::string s_ = "") - : id (0), v (0), n (n_), s (s_) {} - - #pragma db id auto - unsigned long long id; - - #pragma db version - unsigned long long v; - - unsigned int n; - std::string s; - }; -} - -// Test SQL Server optimistic concurrency with ROWVERSION. -// -#if defined(ODB_DATABASE_MSSQL) || defined(DATABASE_MSSQL) -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object optimistic bulk(3) - struct object - { - object (unsigned int n_ = 0, std::string s_ = "") - : id (0), v (0), n (n_), s (s_) {} - - #pragma db id - unsigned long long id; - - #pragma db version type("ROWVERSION") - unsigned long long v; - - unsigned int n; - std::string s; - }; -} -#endif - -#endif // TEST_HXX diff --git a/common/bulk/testscript b/common/bulk/testscript deleted file mode 100644 index e7567c9..0000000 --- a/common/bulk/testscript +++ /dev/null @@ -1,503 +0,0 @@ -# file : common/bulk/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -+cat <=output - multiple exceptions, 1 element attempted, 1 failed: - [0] object already persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0] object already persistent - [1] object already persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0] object already persistent - [1] object already persistent - [2] object already persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0] object already persistent - [1] object already persistent - [2] object already persistent - [3] object already persistent - - multiple exceptions, 5 elements attempted, 5 failed: - [0] object already persistent - [1] object already persistent - [2] object already persistent - [3] object already persistent - [4] object already persistent - - multiple exceptions, 6 elements attempted, 6 failed: - [0] object already persistent - [1] object already persistent - [2] object already persistent - [3] object already persistent - [4] object already persistent - [5] object already persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [1] object already persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [0] object already persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [1] object already persistent - [2] object already persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object already persistent - [2] object already persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object already persistent - [1] object already persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object already persistent - [1] object already persistent - [3] object already persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object already persistent - [1] object already persistent - [2] object already persistent - - multiple exceptions, 7 elements attempted, 3 failed: - [1] object already persistent - [3] object already persistent - [5] object already persistent - - multiple exceptions, 3 elements attempted, 1 failed: - [2] object already persistent - - multiple exceptions, 1 element attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 5 elements attempted, 5 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - - multiple exceptions, 6 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - [5] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0-1] (some) object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0-1] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 7 elements attempted, 7 failed: - [0-5] (some) object not persistent - [6] object not persistent - - multiple exceptions, 7 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [6] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 1 element attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 5 elements attempted, 5 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - - multiple exceptions, 6 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - [5] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0-1] (some) object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0-1] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 8 elements attempted, 8 failed: - [0-7] (some) object not persistent - - multiple exceptions, 10 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [6] object not persistent - [7] object not persistent - [8] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0-2] (some) object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object changed concurrently - [3] object changed concurrently - - multiple exceptions, 4 elements attempted, 4 failed: - [0-2] (some) object changed concurrently - [3] object changed concurrently - - EOI - -+cat <=pgsql-output - multiple exceptions, 1 element attempted, 1 failed: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [1] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 2 elements attempted, 1 failed, fatal: - [1] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 1 element attempted, 1 failed, fatal: - [0] object already persistent - - multiple exceptions, 2 elements attempted, 1 failed, fatal: - [1] object already persistent - - multiple exceptions, 3 elements attempted, 1 failed: - [2] object already persistent - - multiple exceptions, 1 element attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 5 elements attempted, 5 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - - multiple exceptions, 6 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - [5] object not persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [1] object not persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [1] object not persistent - [2] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object not persistent - [2] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 7 elements attempted, 4 failed: - [0] object not persistent - [2] object not persistent - [4] object not persistent - [6] object not persistent - - multiple exceptions, 7 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [6] object not persistent - - multiple exceptions, 3 elements attempted, 1 failed: - [2] object not persistent - - multiple exceptions, 1 element attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 2 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 3 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 4 elements attempted, 4 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 5 elements attempted, 5 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - - multiple exceptions, 6 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [3] object not persistent - [4] object not persistent - [5] object not persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [1] object not persistent - - multiple exceptions, 2 elements attempted, 1 failed: - [0] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [1] object not persistent - [2] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object not persistent - [2] object not persistent - - multiple exceptions, 3 elements attempted, 2 failed: - [0] object not persistent - [1] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [1] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [2] object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [3] object not persistent - - multiple exceptions, 4 elements attempted, 3 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - - multiple exceptions, 8 elements attempted, 4 failed: - [1] object not persistent - [3] object not persistent - [5] object not persistent - [7] object not persistent - - multiple exceptions, 10 elements attempted, 6 failed: - [0] object not persistent - [1] object not persistent - [2] object not persistent - [6] object not persistent - [7] object not persistent - [8] object not persistent - - multiple exceptions, 3 elements attempted, 1 failed: - [2] object not persistent - - multiple exceptions, 4 elements attempted, 2 failed: - [1] object changed concurrently - [3] object changed concurrently - - multiple exceptions, 4 elements attempted, 2 failed: - [1] object changed concurrently - [3] object changed concurrently - - EOI - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if ($pgsql && $pgsql_bulk) -{ - .include ../../pgsql.testscript - - $create_schema; - - # Query the PostgreSQL server version and only run the test if it is 7.4 or - # above. - # - $pgsql_client_cmd --tuples-only -c 'SELECT VERSION()' | \ - sed -n -e 's/.*PostgreSQL (\d+\.\d+).*/\1/p' | \ - set version [string]; - - if ("$version" == "") - exit "unable to obtain PostgreSQL server version" - end; - - sed -n -e 's/(.+)\..+/\1/p' <"$version" | set major_version [uint64]; - sed -n -e 's/.+\.(.+)/\1/p' <"$version" | set minor_version [uint64]; - - if (($major_version == 7 && minor_version >= 4) || $major_version > 7) - if $multi - $* # Noop. - else - $* >>>../pgsql-output - end - end -} diff --git a/common/callback/buildfile b/common/callback/buildfile deleted file mode 100644 index 2ecc3b8..0000000 --- a/common/callback/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/callback/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix callback_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx deleted file mode 100644 index 80513c6..0000000 --- a/common/callback/driver.cxx +++ /dev/null @@ -1,184 +0,0 @@ -// file : common/callback/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test database operation callbacks. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -const char* events[] = -{ - "pre_persist", - "post_persist", - "pre_load", - "post_load", - "pre_update", - "post_update", - "pre_erase", - "post_erase" -}; - -void object:: -db_callback (callback_event e, database& db) -{ - cout << " " << events[e] << " " << id_ << endl; - - // Test custom recursive loading. - // - if (e == callback_event::post_load && ref != 0) - { - robj = db.load (ref); - cout << " " << id_ << ' ' << ref << ' ' << robj->id_ << endl; - } -} - -void object:: -db_callback (callback_event e, database&) const -{ - cout << " " << events[e] << " " << id_ << " const" << endl; -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Persist. - // - cout << "persist" << endl; - { - object o1 (1, 1); - object const o2 (2, 2); - transaction t (db->begin ()); - db->persist (o1); - db->persist (&o2); - t.commit (); - } - cout << "***" << endl; - - // Load. - // - cout << "load" << endl; - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - object o2; - db->load (2, o2); - t.commit (); - } - cout << "***" << endl; - - // Query. - // - cout << "query" << endl; - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ((query::id < 3) + "ORDER BY" + query::id)); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->id_ > 3) // Load. - break; - } - - t.commit (); - } - cout << "***" << endl; - - // Update. - // - cout << "update" << endl; - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - unique_ptr o2 (db->load (2)); - o1->data++; - o2->data++; - db->update (o1.get ()); - db->update (static_cast (*o2)); - t.commit (); - } - cout << "***" << endl; - - // Erase. - // - cout << "erase" << endl; - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - unique_ptr o2 (db->load (2)); - db->erase (static_cast (o1.get ())); - db->erase (*o2); - t.commit (); - } - cout << "***" << endl; - - // Delayed (recursive) load. - // - cout << "delayed load" << endl; - { - { - object o1 (1, 1); - object o2 (2, 2); - object o3 (3, 3); - object o4 (4, 4); - - o1.pobj = &o2; - o1.ref = 4; - - o2.pobj = &o3; - o2.ref = 4; - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (o4); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - object* o2 (o1->pobj); - - cout << o1->id_ << ' ' << o1->ref << ' ' << o1->robj->id_ << endl; - cout << o2->id_ << ' ' << o2->ref << ' ' << o2->robj->id_ << endl; - - delete o1->robj; - delete o2->robj; - - delete o2->pobj; - delete o2; - t.commit (); - } - } - cout << "***" << endl; - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/callback/test.hxx b/common/callback/test.hxx deleted file mode 100644 index bd30907..0000000 --- a/common/callback/test.hxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : common/callback/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object callback(db_callback) -struct object -{ - object (unsigned long id, unsigned long d) - : id_ (id), data (d), pobj (0), robj (0), ref (0) - { - } - - object () - : id_ (0), pobj (0), robj (0) - { - } - - #pragma db id - unsigned long id_; - - unsigned long data; - - object* pobj; - - // Test custom recursive loading. - // - #pragma db transient - object* robj; - unsigned long ref; // Unless 0, reference to another object. - - void - db_callback (odb::callback_event, odb::database&); - - void - db_callback (odb::callback_event, odb::database&) const; -}; - -#endif // TEST_HXX diff --git a/common/callback/testscript b/common/callback/testscript deleted file mode 100644 index c7d03ee..0000000 --- a/common/callback/testscript +++ /dev/null @@ -1,100 +0,0 @@ -# file : common/callback/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -+cat <=output - persist - pre_persist 1 const - post_persist 1 const - pre_persist 2 const - post_persist 2 const - *** - load - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - *** - query - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - *** - update - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - pre_update 1 const - post_update 1 const - pre_update 2 const - post_update 2 const - *** - erase - pre_load 0 - post_load 1 - pre_load 0 - post_load 2 - pre_erase 1 const - post_erase 1 const - pre_erase 2 const - post_erase 2 const - *** - delayed load - pre_persist 1 const - post_persist 1 const - pre_persist 2 const - post_persist 2 const - pre_persist 3 const - post_persist 3 const - pre_persist 4 const - post_persist 4 const - pre_load 0 - pre_load 0 - pre_load 0 - post_load 3 - post_load 2 - pre_load 0 - post_load 4 - 2 4 4 - post_load 1 - pre_load 0 - post_load 4 - 1 4 4 - 1 4 4 - 2 4 4 - *** - EOI - -test.redirects += >>>../output - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/changelog/.gitignore b/common/changelog/.gitignore deleted file mode 100644 index 5352a2b..0000000 --- a/common/changelog/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Generate ODB options file. -# -odb.options diff --git a/common/changelog/add-column-mssql-diff.xml b/common/changelog/add-column-mssql-diff.xml deleted file mode 100644 index 4f9ba09..0000000 --- a/common/changelog/add-column-mssql-diff.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - -
- - - - -
- - diff --git a/common/changelog/add-column-mssql-patch.xml b/common/changelog/add-column-mssql-patch.xml deleted file mode 100644 index 4f396d9..0000000 --- a/common/changelog/add-column-mssql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-mysql-diff.xml b/common/changelog/add-column-mysql-diff.xml deleted file mode 100644 index 992306d..0000000 --- a/common/changelog/add-column-mysql-diff.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-mysql-patch.xml b/common/changelog/add-column-mysql-patch.xml deleted file mode 100644 index 14f3f01..0000000 --- a/common/changelog/add-column-mysql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-oracle-diff.xml b/common/changelog/add-column-oracle-diff.xml deleted file mode 100644 index fa1dac6..0000000 --- a/common/changelog/add-column-oracle-diff.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-oracle-patch.xml b/common/changelog/add-column-oracle-patch.xml deleted file mode 100644 index 38fb8d6..0000000 --- a/common/changelog/add-column-oracle-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-pgsql-diff.xml b/common/changelog/add-column-pgsql-diff.xml deleted file mode 100644 index 9524d9d..0000000 --- a/common/changelog/add-column-pgsql-diff.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-pgsql-patch.xml b/common/changelog/add-column-pgsql-patch.xml deleted file mode 100644 index 7f7d9a0..0000000 --- a/common/changelog/add-column-pgsql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-sqlite-diff.xml b/common/changelog/add-column-sqlite-diff.xml deleted file mode 100644 index b59cc72..0000000 --- a/common/changelog/add-column-sqlite-diff.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column-sqlite-patch.xml b/common/changelog/add-column-sqlite-patch.xml deleted file mode 100644 index fbe4428..0000000 --- a/common/changelog/add-column-sqlite-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-column.hxx b/common/changelog/add-column.hxx deleted file mode 100644 index 54eab42..0000000 --- a/common/changelog/add-column.hxx +++ /dev/null @@ -1,20 +0,0 @@ -// file : common/changelog/add-column.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ADD_COLUMN_HXX -#define ADD_COLUMN_HXX - -#pragma db model version(BVER, CVER, open) - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER > 1 - int num; -#endif -}; - -#endif // ADD_COLUMN_HXX diff --git a/common/changelog/add-foreign-key-diff.xml b/common/changelog/add-foreign-key-diff.xml deleted file mode 100644 index d4f29ad..0000000 --- a/common/changelog/add-foreign-key-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-mssql-diff.xml b/common/changelog/add-foreign-key-mssql-diff.xml deleted file mode 100644 index 76ebce3..0000000 --- a/common/changelog/add-foreign-key-mssql-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-mssql-patch.xml b/common/changelog/add-foreign-key-mssql-patch.xml deleted file mode 100644 index 6d75709..0000000 --- a/common/changelog/add-foreign-key-mssql-patch.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-mysql-diff.xml b/common/changelog/add-foreign-key-mysql-diff.xml deleted file mode 100644 index acdfd5b..0000000 --- a/common/changelog/add-foreign-key-mysql-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-mysql-patch.xml b/common/changelog/add-foreign-key-mysql-patch.xml deleted file mode 100644 index adc9081..0000000 --- a/common/changelog/add-foreign-key-mysql-patch.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-oracle-diff.xml b/common/changelog/add-foreign-key-oracle-diff.xml deleted file mode 100644 index 6bd8bc3..0000000 --- a/common/changelog/add-foreign-key-oracle-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-oracle-patch.xml b/common/changelog/add-foreign-key-oracle-patch.xml deleted file mode 100644 index 7aa01ea..0000000 --- a/common/changelog/add-foreign-key-oracle-patch.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-pgsql-diff.xml b/common/changelog/add-foreign-key-pgsql-diff.xml deleted file mode 100644 index 793b009..0000000 --- a/common/changelog/add-foreign-key-pgsql-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-pgsql-patch.xml b/common/changelog/add-foreign-key-pgsql-patch.xml deleted file mode 100644 index a256831..0000000 --- a/common/changelog/add-foreign-key-pgsql-patch.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-sqlite-diff.xml b/common/changelog/add-foreign-key-sqlite-diff.xml deleted file mode 100644 index 1510470..0000000 --- a/common/changelog/add-foreign-key-sqlite-diff.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key-sqlite-patch.xml b/common/changelog/add-foreign-key-sqlite-patch.xml deleted file mode 100644 index 1c2d0ea..0000000 --- a/common/changelog/add-foreign-key-sqlite-patch.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/add-foreign-key.hxx b/common/changelog/add-foreign-key.hxx deleted file mode 100644 index 2a43eea..0000000 --- a/common/changelog/add-foreign-key.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : common/changelog/add-foreign-key.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ADD_FOREIGN_KEY_HXX -#define ADD_FOREIGN_KEY_HXX - -#pragma db model version(BVER, CVER, open) - -struct object1; - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER > 1 - object1* o1; -#endif -}; - -#pragma db object -struct object1 -{ - #pragma db id - int id; -}; - -#endif // ADD_FOREIGN_KEY_HXX diff --git a/common/changelog/add-index-mssql-diff.xml b/common/changelog/add-index-mssql-diff.xml deleted file mode 100644 index 58c623f..0000000 --- a/common/changelog/add-index-mssql-diff.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-mssql-patch.xml b/common/changelog/add-index-mssql-patch.xml deleted file mode 100644 index 2b10e65..0000000 --- a/common/changelog/add-index-mssql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-mysql-diff.xml b/common/changelog/add-index-mysql-diff.xml deleted file mode 100644 index a54a7e3..0000000 --- a/common/changelog/add-index-mysql-diff.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-mysql-patch.xml b/common/changelog/add-index-mysql-patch.xml deleted file mode 100644 index a2454b8..0000000 --- a/common/changelog/add-index-mysql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-oracle-diff.xml b/common/changelog/add-index-oracle-diff.xml deleted file mode 100644 index 80f8ecc..0000000 --- a/common/changelog/add-index-oracle-diff.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-oracle-patch.xml b/common/changelog/add-index-oracle-patch.xml deleted file mode 100644 index a9bafea..0000000 --- a/common/changelog/add-index-oracle-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-pgsql-diff.xml b/common/changelog/add-index-pgsql-diff.xml deleted file mode 100644 index 3988643..0000000 --- a/common/changelog/add-index-pgsql-diff.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-pgsql-patch.xml b/common/changelog/add-index-pgsql-patch.xml deleted file mode 100644 index e9c564c..0000000 --- a/common/changelog/add-index-pgsql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-sqlite-diff.xml b/common/changelog/add-index-sqlite-diff.xml deleted file mode 100644 index c1f7fdc..0000000 --- a/common/changelog/add-index-sqlite-diff.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index-sqlite-patch.xml b/common/changelog/add-index-sqlite-patch.xml deleted file mode 100644 index b9512e0..0000000 --- a/common/changelog/add-index-sqlite-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-index.hxx b/common/changelog/add-index.hxx deleted file mode 100644 index 645cee2..0000000 --- a/common/changelog/add-index.hxx +++ /dev/null @@ -1,24 +0,0 @@ -// file : common/changelog/add-index.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ADD_INDEX_HXX -#define ADD_INDEX_HXX - -#pragma db model version(BVER, CVER, open) - -#pragma db object -struct object -{ - #pragma db id auto - int id; - - int x; - -#if CVER > 1 - int y; - #pragma db index ("xy_i") unique member(x) member(y, "DESC") -#endif - -}; - -#endif // ADD_INDEX_HXX diff --git a/common/changelog/add-table-mssql-diff.xml b/common/changelog/add-table-mssql-diff.xml deleted file mode 100644 index 8bf0e30..0000000 --- a/common/changelog/add-table-mssql-diff.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-mssql-patch.xml b/common/changelog/add-table-mssql-patch.xml deleted file mode 100644 index 9dd41f3..0000000 --- a/common/changelog/add-table-mssql-patch.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-mysql-diff.xml b/common/changelog/add-table-mysql-diff.xml deleted file mode 100644 index 57f741b..0000000 --- a/common/changelog/add-table-mysql-diff.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-mysql-patch.xml b/common/changelog/add-table-mysql-patch.xml deleted file mode 100644 index 0db1e9f..0000000 --- a/common/changelog/add-table-mysql-patch.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-oracle-diff.xml b/common/changelog/add-table-oracle-diff.xml deleted file mode 100644 index 70ec7c6..0000000 --- a/common/changelog/add-table-oracle-diff.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-oracle-patch.xml b/common/changelog/add-table-oracle-patch.xml deleted file mode 100644 index 969c2e0..0000000 --- a/common/changelog/add-table-oracle-patch.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-pgsql-diff.xml b/common/changelog/add-table-pgsql-diff.xml deleted file mode 100644 index 9b48062..0000000 --- a/common/changelog/add-table-pgsql-diff.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-pgsql-patch.xml b/common/changelog/add-table-pgsql-patch.xml deleted file mode 100644 index b04a933..0000000 --- a/common/changelog/add-table-pgsql-patch.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-sqlite-diff.xml b/common/changelog/add-table-sqlite-diff.xml deleted file mode 100644 index 573bc69..0000000 --- a/common/changelog/add-table-sqlite-diff.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table-sqlite-patch.xml b/common/changelog/add-table-sqlite-patch.xml deleted file mode 100644 index 3506410..0000000 --- a/common/changelog/add-table-sqlite-patch.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/add-table.hxx b/common/changelog/add-table.hxx deleted file mode 100644 index a22e206..0000000 --- a/common/changelog/add-table.hxx +++ /dev/null @@ -1,34 +0,0 @@ -// file : common/changelog/add-table.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ADD_TABLE_HXX -#define ADD_TABLE_HXX - -#include - -#pragma db model version(BVER, CVER, open) - -struct object1; - -#if CVER > 1 -#pragma db object -struct object -{ - #pragma db id auto - int id; - int num; - - std::vector nums; - object1* o1; -}; -#endif - -#pragma db object -struct object1 -{ - #pragma db id - int id; - int num; -}; - -#endif // ADD_TABLE_HXX diff --git a/common/changelog/alter-column-mssql-diff.xml b/common/changelog/alter-column-mssql-diff.xml deleted file mode 100644 index 6c1fb6a..0000000 --- a/common/changelog/alter-column-mssql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-mssql-patch.xml b/common/changelog/alter-column-mssql-patch.xml deleted file mode 100644 index 15db347..0000000 --- a/common/changelog/alter-column-mssql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-mysql-diff.xml b/common/changelog/alter-column-mysql-diff.xml deleted file mode 100644 index 39ad6ef..0000000 --- a/common/changelog/alter-column-mysql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-mysql-patch.xml b/common/changelog/alter-column-mysql-patch.xml deleted file mode 100644 index 0131466..0000000 --- a/common/changelog/alter-column-mysql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-oracle-diff.xml b/common/changelog/alter-column-oracle-diff.xml deleted file mode 100644 index d41d333..0000000 --- a/common/changelog/alter-column-oracle-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-oracle-patch.xml b/common/changelog/alter-column-oracle-patch.xml deleted file mode 100644 index 0e0794d..0000000 --- a/common/changelog/alter-column-oracle-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-pgsql-diff.xml b/common/changelog/alter-column-pgsql-diff.xml deleted file mode 100644 index fd97fa0..0000000 --- a/common/changelog/alter-column-pgsql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-pgsql-patch.xml b/common/changelog/alter-column-pgsql-patch.xml deleted file mode 100644 index dade1a3..0000000 --- a/common/changelog/alter-column-pgsql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-sqlite-diff.xml b/common/changelog/alter-column-sqlite-diff.xml deleted file mode 100644 index 7ecea06..0000000 --- a/common/changelog/alter-column-sqlite-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column-sqlite-patch.xml b/common/changelog/alter-column-sqlite-patch.xml deleted file mode 100644 index de2762e..0000000 --- a/common/changelog/alter-column-sqlite-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/alter-column.hxx b/common/changelog/alter-column.hxx deleted file mode 100644 index 02f091d..0000000 --- a/common/changelog/alter-column.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : common/changelog/alter-column.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ALTER_COLUMN_HXX -#define ALTER_COLUMN_HXX - -#pragma db model version(BVER, CVER, open) - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER > 1 - #pragma db null -#endif - int num; -}; - -#endif // ALTER_COLUMN_HXX diff --git a/common/changelog/buildfile b/common/changelog/buildfile deleted file mode 100644 index 04e0685..0000000 --- a/common/changelog/buildfile +++ /dev/null @@ -1,30 +0,0 @@ -# file : common/changelog/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -./: file{odb.options} xml{*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the below ad hoc recipe. -# -libue{test-meta}: $libodb - -file{odb.options}: libue{test-meta} -{{ - pops = $cxx.lib_poptions($<[0]) - depdb hash $pops - - f = $path($>[0]) - rm -f $f - - for o: $pops - echo $o >+$f - end -}} - -# Testscript's run-time prerequisites. -# -testscript@./: test = $odb - -./: $odb: clean = false diff --git a/common/changelog/drop-column-mssql-diff.xml b/common/changelog/drop-column-mssql-diff.xml deleted file mode 100644 index f2bab96..0000000 --- a/common/changelog/drop-column-mssql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-mssql-patch.xml b/common/changelog/drop-column-mssql-patch.xml deleted file mode 100644 index 32402a3..0000000 --- a/common/changelog/drop-column-mssql-patch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-mysql-diff.xml b/common/changelog/drop-column-mysql-diff.xml deleted file mode 100644 index 2bb321d..0000000 --- a/common/changelog/drop-column-mysql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-mysql-patch.xml b/common/changelog/drop-column-mysql-patch.xml deleted file mode 100644 index 6572ebe..0000000 --- a/common/changelog/drop-column-mysql-patch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-oracle-diff.xml b/common/changelog/drop-column-oracle-diff.xml deleted file mode 100644 index e920a12..0000000 --- a/common/changelog/drop-column-oracle-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-oracle-patch.xml b/common/changelog/drop-column-oracle-patch.xml deleted file mode 100644 index b113664..0000000 --- a/common/changelog/drop-column-oracle-patch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-pgsql-diff.xml b/common/changelog/drop-column-pgsql-diff.xml deleted file mode 100644 index d2e91ba..0000000 --- a/common/changelog/drop-column-pgsql-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-pgsql-patch.xml b/common/changelog/drop-column-pgsql-patch.xml deleted file mode 100644 index 06cc73d..0000000 --- a/common/changelog/drop-column-pgsql-patch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-sqlite-diff.xml b/common/changelog/drop-column-sqlite-diff.xml deleted file mode 100644 index 1c9d138..0000000 --- a/common/changelog/drop-column-sqlite-diff.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column-sqlite-patch.xml b/common/changelog/drop-column-sqlite-patch.xml deleted file mode 100644 index 6887530..0000000 --- a/common/changelog/drop-column-sqlite-patch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-column.hxx b/common/changelog/drop-column.hxx deleted file mode 100644 index 3de237d..0000000 --- a/common/changelog/drop-column.hxx +++ /dev/null @@ -1,20 +0,0 @@ -// file : common/changelog/drop-column.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef DROP_COLUMN_HXX -#define DROP_COLUMN_HXX - -#pragma db model version(BVER, CVER, open) - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER == 1 - int num; -#endif -}; - -#endif // DROP_COLUMN_HXX diff --git a/common/changelog/drop-foreign-key-mssql-diff.xml b/common/changelog/drop-foreign-key-mssql-diff.xml deleted file mode 100644 index da3ce73..0000000 --- a/common/changelog/drop-foreign-key-mssql-diff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-mssql-patch.xml b/common/changelog/drop-foreign-key-mssql-patch.xml deleted file mode 100644 index cd1a372..0000000 --- a/common/changelog/drop-foreign-key-mssql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-mysql-diff.xml b/common/changelog/drop-foreign-key-mysql-diff.xml deleted file mode 100644 index aa179f2..0000000 --- a/common/changelog/drop-foreign-key-mysql-diff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-mysql-patch.xml b/common/changelog/drop-foreign-key-mysql-patch.xml deleted file mode 100644 index 67f026e..0000000 --- a/common/changelog/drop-foreign-key-mysql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-oracle-diff.xml b/common/changelog/drop-foreign-key-oracle-diff.xml deleted file mode 100644 index aa407d3..0000000 --- a/common/changelog/drop-foreign-key-oracle-diff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-oracle-patch.xml b/common/changelog/drop-foreign-key-oracle-patch.xml deleted file mode 100644 index 56253f0..0000000 --- a/common/changelog/drop-foreign-key-oracle-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-pgsql-diff.xml b/common/changelog/drop-foreign-key-pgsql-diff.xml deleted file mode 100644 index 9a6259a..0000000 --- a/common/changelog/drop-foreign-key-pgsql-diff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-pgsql-patch.xml b/common/changelog/drop-foreign-key-pgsql-patch.xml deleted file mode 100644 index df024b4..0000000 --- a/common/changelog/drop-foreign-key-pgsql-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-sqlite-diff.xml b/common/changelog/drop-foreign-key-sqlite-diff.xml deleted file mode 100644 index 6f9f994..0000000 --- a/common/changelog/drop-foreign-key-sqlite-diff.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key-sqlite-patch.xml b/common/changelog/drop-foreign-key-sqlite-patch.xml deleted file mode 100644 index 6e63218..0000000 --- a/common/changelog/drop-foreign-key-sqlite-patch.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -
- - - - - -
-
-
diff --git a/common/changelog/drop-foreign-key.hxx b/common/changelog/drop-foreign-key.hxx deleted file mode 100644 index ba3005f..0000000 --- a/common/changelog/drop-foreign-key.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : common/changelog/drop-foreign-key.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef DROP_FOREIGN_KEY_HXX -#define DROP_FOREIGN_KEY_HXX - -#pragma db model version(BVER, CVER, open) - -struct object1; - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER == 1 - object1* o1; -#endif -}; - -#pragma db object -struct object1 -{ - #pragma db id - int id; -}; - -#endif // DROP_FOREIGN_KEY_HXX diff --git a/common/changelog/drop-index-mssql-diff.xml b/common/changelog/drop-index-mssql-diff.xml deleted file mode 100644 index ac95db5..0000000 --- a/common/changelog/drop-index-mssql-diff.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-mssql-patch.xml b/common/changelog/drop-index-mssql-patch.xml deleted file mode 100644 index 4f396d9..0000000 --- a/common/changelog/drop-index-mssql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-mysql-diff.xml b/common/changelog/drop-index-mysql-diff.xml deleted file mode 100644 index f8c95ef..0000000 --- a/common/changelog/drop-index-mysql-diff.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-mysql-patch.xml b/common/changelog/drop-index-mysql-patch.xml deleted file mode 100644 index 14f3f01..0000000 --- a/common/changelog/drop-index-mysql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-oracle-diff.xml b/common/changelog/drop-index-oracle-diff.xml deleted file mode 100644 index d174802..0000000 --- a/common/changelog/drop-index-oracle-diff.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-oracle-patch.xml b/common/changelog/drop-index-oracle-patch.xml deleted file mode 100644 index 38fb8d6..0000000 --- a/common/changelog/drop-index-oracle-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-pgsql-diff.xml b/common/changelog/drop-index-pgsql-diff.xml deleted file mode 100644 index 375a3d8..0000000 --- a/common/changelog/drop-index-pgsql-diff.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-pgsql-patch.xml b/common/changelog/drop-index-pgsql-patch.xml deleted file mode 100644 index 7f7d9a0..0000000 --- a/common/changelog/drop-index-pgsql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-sqlite-diff.xml b/common/changelog/drop-index-sqlite-diff.xml deleted file mode 100644 index bf54f9d..0000000 --- a/common/changelog/drop-index-sqlite-diff.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index-sqlite-patch.xml b/common/changelog/drop-index-sqlite-patch.xml deleted file mode 100644 index fbe4428..0000000 --- a/common/changelog/drop-index-sqlite-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-index.hxx b/common/changelog/drop-index.hxx deleted file mode 100644 index 08fecba..0000000 --- a/common/changelog/drop-index.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : common/changelog/drop-index.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef DROP_INDEX_HXX -#define DROP_INDEX_HXX - -#pragma db model version(BVER, CVER, open) - -#pragma db object -struct object -{ - #pragma db id auto - int id; - -#if CVER == 1 - #pragma db index -#endif - int num; -}; - -#endif // DROP_INDEX_HXX diff --git a/common/changelog/drop-table-mssql-diff.xml b/common/changelog/drop-table-mssql-diff.xml deleted file mode 100644 index 399d8bc..0000000 --- a/common/changelog/drop-table-mssql-diff.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - -
-
-
diff --git a/common/changelog/drop-table-mssql-patch.xml b/common/changelog/drop-table-mssql-patch.xml deleted file mode 100644 index c5dda75..0000000 --- a/common/changelog/drop-table-mssql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-table-mysql-diff.xml b/common/changelog/drop-table-mysql-diff.xml deleted file mode 100644 index 3ccd553..0000000 --- a/common/changelog/drop-table-mysql-diff.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - -
-
-
diff --git a/common/changelog/drop-table-mysql-patch.xml b/common/changelog/drop-table-mysql-patch.xml deleted file mode 100644 index 250bd20..0000000 --- a/common/changelog/drop-table-mysql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-table-oracle-diff.xml b/common/changelog/drop-table-oracle-diff.xml deleted file mode 100644 index 589d64b..0000000 --- a/common/changelog/drop-table-oracle-diff.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - -
-
-
diff --git a/common/changelog/drop-table-oracle-patch.xml b/common/changelog/drop-table-oracle-patch.xml deleted file mode 100644 index 5f222dc..0000000 --- a/common/changelog/drop-table-oracle-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-table-pgsql-diff.xml b/common/changelog/drop-table-pgsql-diff.xml deleted file mode 100644 index 168ec46..0000000 --- a/common/changelog/drop-table-pgsql-diff.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - -
-
-
diff --git a/common/changelog/drop-table-pgsql-patch.xml b/common/changelog/drop-table-pgsql-patch.xml deleted file mode 100644 index ebb7000..0000000 --- a/common/changelog/drop-table-pgsql-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-table-sqlite-diff.xml b/common/changelog/drop-table-sqlite-diff.xml deleted file mode 100644 index 6a258c4..0000000 --- a/common/changelog/drop-table-sqlite-diff.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - -
-
-
diff --git a/common/changelog/drop-table-sqlite-patch.xml b/common/changelog/drop-table-sqlite-patch.xml deleted file mode 100644 index 45c6f00..0000000 --- a/common/changelog/drop-table-sqlite-patch.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - -
-
-
diff --git a/common/changelog/drop-table.hxx b/common/changelog/drop-table.hxx deleted file mode 100644 index 2919e52..0000000 --- a/common/changelog/drop-table.hxx +++ /dev/null @@ -1,34 +0,0 @@ -// file : common/changelog/drop-table.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef DROP_TABLE_HXX -#define DROP_TABLE_HXX - -#include - -#pragma db model version(BVER, CVER, open) - -struct object1; - -#if CVER == 1 -#pragma db object -struct object -{ - #pragma db id auto - int id; - int num; - - std::vector nums; - object1* o1; -}; -#endif - -#pragma db object -struct object1 -{ - #pragma db id - int id; - int num; -}; - -#endif // DROP_TABLE_HXX diff --git a/common/changelog/model-mssql-diff.xml b/common/changelog/model-mssql-diff.xml deleted file mode 120000 index e1f812d..0000000 --- a/common/changelog/model-mssql-diff.xml +++ /dev/null @@ -1 +0,0 @@ -model-mssql.xml \ No newline at end of file diff --git a/common/changelog/model-mssql-patch.xml b/common/changelog/model-mssql-patch.xml deleted file mode 120000 index e1f812d..0000000 --- a/common/changelog/model-mssql-patch.xml +++ /dev/null @@ -1 +0,0 @@ -model-mssql.xml \ No newline at end of file diff --git a/common/changelog/model-mssql.xml b/common/changelog/model-mssql.xml deleted file mode 100644 index 509a210..0000000 --- a/common/changelog/model-mssql.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
diff --git a/common/changelog/model-mysql-diff.xml b/common/changelog/model-mysql-diff.xml deleted file mode 120000 index 9100280..0000000 --- a/common/changelog/model-mysql-diff.xml +++ /dev/null @@ -1 +0,0 @@ -model-mysql.xml \ No newline at end of file diff --git a/common/changelog/model-mysql-patch.xml b/common/changelog/model-mysql-patch.xml deleted file mode 120000 index 9100280..0000000 --- a/common/changelog/model-mysql-patch.xml +++ /dev/null @@ -1 +0,0 @@ -model-mysql.xml \ No newline at end of file diff --git a/common/changelog/model-mysql.xml b/common/changelog/model-mysql.xml deleted file mode 100644 index ffbcf8d..0000000 --- a/common/changelog/model-mysql.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
diff --git a/common/changelog/model-oracle-diff.xml b/common/changelog/model-oracle-diff.xml deleted file mode 120000 index 36e4479..0000000 --- a/common/changelog/model-oracle-diff.xml +++ /dev/null @@ -1 +0,0 @@ -model-oracle.xml \ No newline at end of file diff --git a/common/changelog/model-oracle-patch.xml b/common/changelog/model-oracle-patch.xml deleted file mode 120000 index 36e4479..0000000 --- a/common/changelog/model-oracle-patch.xml +++ /dev/null @@ -1 +0,0 @@ -model-oracle.xml \ No newline at end of file diff --git a/common/changelog/model-oracle.xml b/common/changelog/model-oracle.xml deleted file mode 100644 index 1824690..0000000 --- a/common/changelog/model-oracle.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
diff --git a/common/changelog/model-pgsql-diff.xml b/common/changelog/model-pgsql-diff.xml deleted file mode 120000 index b39ce26..0000000 --- a/common/changelog/model-pgsql-diff.xml +++ /dev/null @@ -1 +0,0 @@ -model-pgsql.xml \ No newline at end of file diff --git a/common/changelog/model-pgsql-patch.xml b/common/changelog/model-pgsql-patch.xml deleted file mode 120000 index b39ce26..0000000 --- a/common/changelog/model-pgsql-patch.xml +++ /dev/null @@ -1 +0,0 @@ -model-pgsql.xml \ No newline at end of file diff --git a/common/changelog/model-pgsql.xml b/common/changelog/model-pgsql.xml deleted file mode 100644 index 13aee6b..0000000 --- a/common/changelog/model-pgsql.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
diff --git a/common/changelog/model-sqlite-diff.xml b/common/changelog/model-sqlite-diff.xml deleted file mode 120000 index 3454f51..0000000 --- a/common/changelog/model-sqlite-diff.xml +++ /dev/null @@ -1 +0,0 @@ -model-sqlite.xml \ No newline at end of file diff --git a/common/changelog/model-sqlite-patch.xml b/common/changelog/model-sqlite-patch.xml deleted file mode 120000 index 3454f51..0000000 --- a/common/changelog/model-sqlite-patch.xml +++ /dev/null @@ -1 +0,0 @@ -model-sqlite.xml \ No newline at end of file diff --git a/common/changelog/model-sqlite.xml b/common/changelog/model-sqlite.xml deleted file mode 100644 index d0199ed..0000000 --- a/common/changelog/model-sqlite.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - -
-
-
diff --git a/common/changelog/model.hxx b/common/changelog/model.hxx deleted file mode 100644 index aa8891a..0000000 --- a/common/changelog/model.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : common/changelog/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_HXX -#define MODEL_HXX - -#include - -#pragma db model version(1, 1, open) - -#pragma db value -struct value -{ - int x; - int y; -}; - -struct object1; - -#pragma db object -struct object -{ - #pragma db id auto - int id; - - #pragma db null default(0) options("DUMMY=1") - int num; - - #pragma db index unique member(num, "DESC") method("BTREE") options("DUMMY=1") - - #pragma db index - value v; // Multi-column. - - std::vector nums; - object1* o1; -}; - -#pragma db object -struct object1 -{ - #pragma db id - value id; // Multi-column. - int num; -}; - -#endif // MODEL_HXX diff --git a/common/changelog/testscript b/common/changelog/testscript deleted file mode 100644 index 9368938..0000000 --- a/common/changelog/testscript +++ /dev/null @@ -1,66 +0,0 @@ -# file : common/changelog/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -headers = [paths] $path_search($src_base/*.hxx) - -odb_options = --generate-schema-only \ - --schema-format sql \ - --suppress-migration \ - --options-file $out_base/odb.options - -: mysql -: -if $mysql -{ - odb_options += --database 'mysql' --changelog-dir $~ - - for h: $headers - n = $base($leaf($h)) - - $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql - - $* $odb_options -DBVER=1 -DCVER=2 $h - diff $src_base/$n-mysql-diff.xml $(n).xml - - $* $odb_options -DBVER=2 -DCVER=3 $h - diff $src_base/$n-mysql-patch.xml $(n).xml - end -} - -: sqlite -: -if $sqlite -{ - odb_options += --database 'sqlite' --changelog-dir $~ - - for h: $headers - n = $base($leaf($h)) - - $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql - - $* $odb_options -DBVER=1 -DCVER=2 $h - diff $src_base/$n-sqlite-diff.xml $(n).xml - - $* $odb_options -DBVER=2 -DCVER=3 $h - diff $src_base/$n-sqlite-patch.xml $(n).xml - end -} - -: pgsql -: -if $pgsql -{ - odb_options += --database 'pgsql' --changelog-dir $~ - - for h: $headers - n = $base($leaf($h)) - - $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql - - $* $odb_options -DBVER=1 -DCVER=2 $h - diff $src_base/$n-pgsql-diff.xml $(n).xml - - $* $odb_options -DBVER=2 -DCVER=3 $h - diff $src_base/$n-pgsql-patch.xml $(n).xml - end -} diff --git a/common/circular/multiple/.gitignore b/common/circular/multiple/.gitignore deleted file mode 100644 index 5d39d39..0000000 --- a/common/circular/multiple/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# ODB-generated files. -# -test1-odb.?xx -test1-odb-*.?xx -test2-odb.?xx -test2-odb-*.?xx diff --git a/common/circular/multiple/buildfile b/common/circular/multiple/buildfile deleted file mode 100644 index b060cb5..0000000 --- a/common/circular/multiple/buildfile +++ /dev/null @@ -1,49 +0,0 @@ -# file : common/circular/multiple/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test1 test2 - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix circular_m_ \ - --generate-schema \ - --generate-query \ - --schema-format embedded - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/circular/multiple/driver.cxx b/common/circular/multiple/driver.cxx deleted file mode 100644 index 4887ac2..0000000 --- a/common/circular/multiple/driver.cxx +++ /dev/null @@ -1,69 +0,0 @@ -// file : common/circular/multiple/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test cases of circular dependencies between persistent classes, multiple -// files version. -// - -#include // std::unique_ptr -#include - -#include -#include -#include -#include - -#include - -#include "test1.hxx" -#include "test2.hxx" - -#include "test2-odb.hxx" -#include "test1-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv, false)); - - // Create the database schema. - // - { - connection_ptr c (db->connection ()); - - // Temporarily disable foreign key constraints for MySQL and SQLite. - // For these databases this is the only way to drop circularly- - // dependant tables. - // - if (db->id () == odb::id_mysql) - c->execute ("SET FOREIGN_KEY_CHECKS=0"); - else if (db->id () == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=OFF"); - - transaction t (c->begin ()); - schema_catalog::create_schema (*db); - t.commit (); - - if (db->id () == odb::id_mysql) - c->execute ("SET FOREIGN_KEY_CHECKS=1"); - else if (db->id () == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=ON"); - } - - query bq (query::d->id != 0); - query dq (query::b->id != 0); - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/circular/multiple/test1.hxx b/common/circular/multiple/test1.hxx deleted file mode 100644 index 36df963..0000000 --- a/common/circular/multiple/test1.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : common/circular/multiple/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#include - -#pragma db object -struct derived; - -#pragma db object polymorphic -struct base -{ - virtual ~base () {} - - #pragma db id - unsigned long id_; - - derived* d_; -}; - -#ifdef ODB_COMPILER -# include "test2.hxx" -#endif - -#endif // TEST1_HXX diff --git a/common/circular/multiple/test2.hxx b/common/circular/multiple/test2.hxx deleted file mode 100644 index 49e9ed2..0000000 --- a/common/circular/multiple/test2.hxx +++ /dev/null @@ -1,17 +0,0 @@ -// file : common/circular/multiple/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include - -#include "test1.hxx" - -#pragma db object -struct derived: base -{ - base* b_; -}; - -#endif // TEST2_HXX diff --git a/common/circular/multiple/testscript b/common/circular/multiple/testscript deleted file mode 100644 index 6a05dc6..0000000 --- a/common/circular/multiple/testscript +++ /dev/null @@ -1,31 +0,0 @@ -# file : common/circular/multiple/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $* -} diff --git a/common/circular/single/buildfile b/common/circular/single/buildfile deleted file mode 100644 index 740ce91..0000000 --- a/common/circular/single/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/circular/single/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix circular_s_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/circular/single/driver.cxx b/common/circular/single/driver.cxx deleted file mode 100644 index 9bcb135..0000000 --- a/common/circular/single/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : common/circular/single/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test cases of circular dependencies between persistent classes, single -// file version. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - query bq (query::d->id != 0); - query dq (query::b->id != 0); - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/circular/single/test.hxx b/common/circular/single/test.hxx deleted file mode 100644 index 7f95dea..0000000 --- a/common/circular/single/test.hxx +++ /dev/null @@ -1,28 +0,0 @@ -// file : common/circular/single/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -struct derived; - -#pragma db object polymorphic -struct base -{ - virtual ~base () {} - - #pragma db id - unsigned long id_; - - derived* d_; -}; - -#pragma db object -struct derived: base -{ - base* b_; -}; - -#endif // TEST_HXX diff --git a/common/circular/single/testscript b/common/circular/single/testscript deleted file mode 100644 index b870306..0000000 --- a/common/circular/single/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/circular/single/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/composite/buildfile b/common/composite/buildfile deleted file mode 100644 index 0a60638..0000000 --- a/common/composite/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/composite/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_comp_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/composite/driver.cxx b/common/composite/driver.cxx deleted file mode 100644 index 06b24b2..0000000 --- a/common/composite/driver.cxx +++ /dev/null @@ -1,229 +0,0 @@ -// file : common/composite/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test composite value types. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -#undef NDEBUG -#include - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic composite functionality. - // - for (unsigned short i (0); i < 2; ++i) - { - using namespace test1; - - person p (1); - p.name_.first = "Joe"; - p.name_.last = "Dirt"; - p.name_.title = "Mr"; - p.name_.alias.first = "Anthony"; - p.name_.alias.last = "Clean"; - p.name_.nick = "Squeaky"; - p.name_.flags.nick = true; - p.name_.flags.alias = false; - p.age_ = 32; - - // persist - // - { - transaction t (db->begin ()); - db->persist (p); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (1)); - t.commit (); - - assert (p == *p1); - } - - p.name_.title = "Mrs"; - p.name_.alias.first = "Anthonia"; - p.name_.flags.nick = false; - p.name_.flags.alias = true; - - // update - // - { - transaction t (db->begin ()); - db->update (p); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (1)); - t.commit (); - - assert (p == *p1); - } - - typedef odb::query query; - typedef odb::result result; - - // query - // - { - transaction t (db->begin ()); - - result r (db->query (query::name.first == "Joe")); - - assert (!r.empty ()); - assert (*r.begin () == p); - assert (size (r) == 1); - - t.commit (); - } - - // query - // - { - transaction t (db->begin ()); - - result r (db->query (query::name.flags.alias)); - - assert (!r.empty ()); - assert (*r.begin () == p); - assert (size (r) == 1); - - t.commit (); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase (1); - t.commit (); - } - } - - // Test composite class template instantiation. - // - { - using namespace test2; - - object o (1); - - o.comp_.num = 123; - o.comp_.str = "abc"; - o.comp_.vec.push_back (int_str_pair (123, "abc")); - o.comp_.vec.push_back (int_str_pair (234, "bcd")); - o.comp_.vec.push_back (int_str_pair (345, "cde")); - - o.pair_.first = 123; - o.pair_.second = "abc"; - - o.vec_.push_back (int_str_pair (123, "abc")); - o.vec_.push_back (int_str_pair (234, "bcd")); - o.vec_.push_back (int_str_pair (345, "cde")); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - - // Test empty column name. - // - { - using namespace test3; - - object o (1); - o.c_.str = "abc"; - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - - // Test composite definition inside object. - { - using namespace test4; - - object o (1); - o.str ("abc"); - o.x (123); - o.y (234); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/composite/test.hxx b/common/composite/test.hxx deleted file mode 100644 index 13b2025..0000000 --- a/common/composite/test.hxx +++ /dev/null @@ -1,250 +0,0 @@ -// file : common/composite/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::pair - -#include - -// Test basic composite functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db value - struct name - { - std::string first; - std::string last; - }; - - #pragma db value - struct name_title - { - std::string title; - }; - - #pragma db value - struct name_title_ex: name_title - { - // Test value types without data members. - }; - - #pragma db value - struct name_flags - { - bool nick; - bool alias; - }; - - #pragma db value - struct name_ex: name, name_title_ex - { - name alias; - std::string nick; - - #pragma db column("show_") - name_flags flags; - }; - - #pragma db object - struct person - { - person () {} - person (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db column("") - name_ex name_; - - unsigned short age_; - }; - - inline bool - operator== (const person& x, const person& y) - { - return x.id_ == y.id_ && - x.name_.first == y.name_.first&& - x.name_.last == y.name_.last && - x.name_.title == y.name_.title && - x.name_.alias.first == y.name_.alias.first && - x.name_.alias.last == y.name_.alias.last && - x.name_.nick == y.name_.nick && - x.name_.flags.nick == y.name_.flags.nick && - x.name_.flags.alias == y.name_.flags.alias && - x.age_ == y.age_; - } -} - -// Test composite class template instantiation. -// -#pragma db namespace table("t2_") -namespace test2 -{ - template - struct comp - { - I num; - S str; - std::vector > vec; - }; - - template - inline bool - operator== (const comp& x, const comp& y) - { - return x.num == y.num && x.str == y.str && x.vec == y.vec; - } - - typedef std::pair int_str_pair; - #pragma db value(int_str_pair) - - // Make sure we use the name that was specified in the pragma. - // -#ifdef ODB_COMPILER - typedef comp int_str_comp1; -#endif - - typedef comp int_str_comp; - #pragma db value(int_str_comp) - - #pragma db object - struct object - { - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - comp comp_; - std::pair pair_; - std::vector vec_; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id_ == y.id_ && - x.comp_ == y.comp_ && - x.pair_ == y.pair_ && - x.vec_ == y.vec_; - } -} - -// Test empty column name. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db value - struct comp - { - #pragma db column("") - std::string str; - }; - - #pragma db object - struct object - { - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - comp c_; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id_ == y.id_ && x.c_.str == y.c_.str; - } -} - -// Test composite definition inside object. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - unsigned long id () const {return id_;} - - void str (const std::string& s) {c_.str = s;} - const std::string& str () const {return c_.str;} - - void x (int i) {p_.first = i;} - int x () const {return p_.first;} - - void y (int i) {p_.second = i;} - int y () const {return p_.second;} - - private: - friend class odb::access; - - #pragma db id - unsigned long id_; - - #pragma db value - struct comp - { - std::string str; - }; - - comp c_; - - typedef std::pair int_pair; - #pragma db value(int_pair) - - int_pair p_; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id () == y.id () && x.str () == y.str () && - x.x () == y.x () && x.y () == y.y (); - } -} - -// Test composite name clashes in query columns (compilation test) -// -#pragma db namespace table("t5_") -namespace test5 -{ - // Class-member conflict. - // - #pragma db value - struct value {int value_;}; - - // Class-class conflict. - // - #pragma db value - struct inner {int value;}; - - #pragma db value - struct outer {inner value;}; - - #pragma db object - struct object - { - #pragma db id - int id; - - outer value; - test5::value v; - }; -} - -#endif // TEST_HXX diff --git a/common/composite/testscript b/common/composite/testscript deleted file mode 100644 index 0747507..0000000 --- a/common/composite/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/composite/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/const-member/buildfile b/common/const-member/buildfile deleted file mode 100644 index 868f7fd..0000000 --- a/common/const-member/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/const-member/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix constm_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/const-member/driver.cxx b/common/const-member/driver.cxx deleted file mode 100644 index 0c71dfa..0000000 --- a/common/const-member/driver.cxx +++ /dev/null @@ -1,119 +0,0 @@ -// file : common/const-member/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test const data members. The readonly test tests that const -// members are automatically treated as read-only. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Const ids. - // - { - const_id o (1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, o); - t.commit (); - assert (o.id == 1); - } - } - - { - { - const_auto_id o; - transaction t (db->begin ()); - db->persist (o); - t.commit (); - assert (o.id == 1); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - t.commit (); - assert (o->id == 1); - } - } - - // Container. - // - { - container o (1, 1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - t.commit (); - - assert (o->ccom.vec.size () == 1 && o->ccom.vec[0] == 1 && - o->ccom.cvec.size () == 1 && o->ccom.cvec[0] == 1 && - o->cvec.size () == 1 && o->cvec[0] == 1); - } - } - - // Wrapper. - // - { - wrapper o (1, "abc", 1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - t.commit (); - - assert (*o->str == "abc" && - o->com->str == "abc" && o->com->num == 1 && - o->com->vec.size () == 1 && o->com->vec[0] == 1 && - o->vec->size () == 1 && (*o->vec)[0] == 1); - } - } - - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/const-member/test.hxx b/common/const-member/test.hxx deleted file mode 100644 index ab75c55..0000000 --- a/common/const-member/test.hxx +++ /dev/null @@ -1,109 +0,0 @@ -// file : common/const-member/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::auto_ptr - -#include - -// Const ids. -// -#pragma db object -struct const_id -{ - const_id (unsigned long i): id (i) {} - const_id (): id (0) {} - - #pragma db id - const unsigned long id; -}; - -#pragma db object -struct const_auto_id -{ - const_auto_id (): id (0) {} - - #pragma db id auto - const unsigned long id; -}; - -// Container. -// -#pragma db value -struct container_value -{ - container_value (unsigned long x) - { - vec.push_back (x); - const_cast&> (cvec).push_back (x); - } - - container_value () {} - - std::vector vec; - const std::vector cvec; -}; - -#pragma db object -struct container -{ - container (unsigned long i, unsigned long x) - : id (i), ccom (x) - { - const_cast&> (cvec).push_back (x); - } - - container () {} - - #pragma db id - unsigned long id; - - const container_value ccom; - const std::vector cvec; -}; - -// Wrapper. -// -#pragma db value -struct wrapped_value -{ - wrapped_value (const std::string& s, unsigned long n) - : str (s), num (n) - { - vec.push_back (n); - } - - wrapped_value () {} - - const std::string str; - unsigned long num; - std::vector vec; -}; - -#pragma db object -struct wrapper -{ - wrapper (unsigned long i, const std::string& s, unsigned long n) - : id (i), - str (new std::string (s)), - com (new wrapped_value (s, n)), - vec (new std::vector) - { - const_cast&> (*vec).push_back (n); - } - - wrapper () {} - - #pragma db id - unsigned long id; - - const std::unique_ptr str; - const std::unique_ptr com; - const std::unique_ptr> vec; -}; - -#endif // TEST_HXX diff --git a/common/const-member/testscript b/common/const-member/testscript deleted file mode 100644 index c81d856..0000000 --- a/common/const-member/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/const-member/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/const-object/buildfile b/common/const-object/buildfile deleted file mode 100644 index 853c831..0000000 --- a/common/const-object/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/const-object/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix consto_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx deleted file mode 100644 index 7ef48ee..0000000 --- a/common/const-object/driver.cxx +++ /dev/null @@ -1,216 +0,0 @@ -// file : common/const-object/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test database operations with const objects. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - aggr a (1); - aggr ca_ (2); // o1 and o2 are NULL - const aggr& ca (ca_); - - obj1* o1 (new obj1 (1)); - obj1* co1_ (new obj1 (2)); - const obj1* co1 (co1_); - a.o1 = co1; - - unique_ptr o2 (new obj2 (1)); - obj2* co2_ (new obj2 (2)); - a.o2.reset (co2_); - unique_ptr& co2 (a.o2); - - // persist via references - // - { - transaction t (db->begin ()); - db->persist (*o1); - db->persist (*co1); - db->persist (*o2); - db->persist (*co2); - db->persist (a); - db->persist (ca); - t.commit (); - } - - // persist via pointers - // - o1->id += 2; - co1_->id += 2; - o2->id += 2; - co2_->id += 2; - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (co1); - db->persist (o2); - db->persist (co2); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - - unique_ptr a (db->load (1)); - unique_ptr ca (db->load (2)); - - t.commit (); - - assert (a->o1->id == 2); - assert (a->o2->id == 2); - - assert (ca->o1 == 0); - assert (ca->o2.get () == 0); - } - - // update via references - // - { - transaction t (db->begin ()); - db->update (*o1); - db->update (*co1); - db->update (*o2); - db->update (*co2); - db->update (a); - db->update (ca); - t.commit (); - } - - // update via pointers - // - { - transaction t (db->begin ()); - db->update (o1); - db->update (co1); - db->update (o2); - db->update (co2); - t.commit (); - } - - // query - // - typedef odb::query query1; - typedef odb::query query2; - - typedef odb::result result1; - typedef odb::result result2; - - { - transaction t (db->begin ()); - result1 r1 (db->query (query1::id < 3)); - // odb::result ur (r1); // error - size_t n1 (0); - - for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) - { - // i->f (); // error - i->cf (); - // obj1* p (i.load ()); // error - const obj1* p (i.load ()); - obj1 o (0); - i.load (o); - assert (p->id == o.id); - delete p; - n1++; - } - - assert (n1 == 2); - - result2 r2 (db->query (query2::id < 3)); - size_t n2 (0); - - for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) - { - // i->f (); // error - i->cf (); - //unique_ptr p (i.load ()); // error - unique_ptr p (i.load ()); - obj2 o (0); - i.load (o); - assert (p->id == o.id); - n2++; - } - - assert (n2 == 2); - - t.commit (); - } - - // erase via references - // - { - transaction t (db->begin ()); - db->erase (*o1); - db->erase (*co1); - db->erase (*o2); - db->erase (*co2); - db->erase (a); - db->erase (ca); - t.commit (); - } - - // erase via pointers - // - o1->id -= 2; - co1_->id -= 2; - o2->id -= 2; - co2_->id -= 2; - - { - transaction t (db->begin ()); - db->erase (o1); - db->erase (co1); - db->erase (o2); - db->erase (co2); - t.commit (); - } - - // Test session and const/non-const object handling - // - { - session s; - transaction t (db->begin ()); - - obj1 o1 (1); - const obj1& co1 (o1); - db->persist (co1); - - assert (db->load (1) == &o1); - - t.commit (); - } - - delete o1; - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx deleted file mode 100644 index 4e66231..0000000 --- a/common/const-object/test.hxx +++ /dev/null @@ -1,51 +0,0 @@ -// file : common/const-object/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object pointer (obj1*) session -struct obj1 -{ - obj1 () {} - obj1 (int i): id (i) {} - - #pragma db id - int id; - - void f () {} - void cf () const {} -}; - -#pragma db object pointer (std::unique_ptr) -struct obj2 -{ - obj2 () {} - obj2 (int i): id (i) {} - - #pragma db id - int id; - - void f () {} - void cf () const {} -}; - -#pragma db object -struct aggr -{ - aggr (int i): id (i), o1 (0) {} - aggr (): o1 (0) {} - ~aggr () {delete o1;} - - #pragma db id - int id; - - const obj1* o1; - - std::unique_ptr o2; -}; - -#endif // TEST_HXX diff --git a/common/const-object/testscript b/common/const-object/testscript deleted file mode 100644 index 3885e96..0000000 --- a/common/const-object/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/const-object/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/container/basics/buildfile b/common/container/basics/buildfile deleted file mode 100644 index f83444e..0000000 --- a/common/container/basics/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/container/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_cont_bs_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx deleted file mode 100644 index 14e1984..0000000 --- a/common/container/basics/driver.cxx +++ /dev/null @@ -1,523 +0,0 @@ -// file : common/container/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test basic container persistence. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - empty.num = 0; - empty.str = ""; - - // array - // - empty.na[0] = 123; - empty.na[1] = 234; - empty.na[2] = 345; - - empty.sa[0] = "aaa"; - empty.sa[1] = "bbbb"; - empty.sa[2] = "ccccc"; - - empty.ca[0] = comp (123, "aaa"); - empty.ca[1] = comp (234, "bbbb"); - empty.ca[2] = comp (345, "ccccc"); - - - // - // med - // - - med.num = 999; - med.str = "xxx"; - - // vector - // - med.nv.push_back (123); - med.nv.push_back (234); - - med.sv.push_back ("aaa"); - med.sv.push_back ("bbbb"); - - med.cv.push_back (comp (123, "aaa")); - med.cv.push_back (comp (234, "bbbb")); - - med.uv.push_back (123); - med.uv.push_back (234); - - // list - // - med.sl.push_back ("aaa"); - med.sl.push_back ("bbbb"); - - // deque - // - med.nd.push_back (123); - med.nd.push_back (234); - - // set - // - med.ns.insert (123); - med.ns.insert (234); - - med.ss.insert ("aaa"); - med.ss.insert ("bbbb"); - - med.cs.insert (comp (123, "aaa")); - med.cs.insert (comp (234, "bbbb")); - - // map - // - med.nsm[123] = "aaa"; - med.nsm[234] = "bbbb"; - - med.snm["aaa"] = 123; - med.snm["bbbb"] = 234; - - med.ncm[123] = comp (123, "aaa"); - med.ncm[234] = comp (234, "bbbb"); - - med.csm[comp (123, "aaa")] = "aaa"; - med.csm[comp (234, "bbbb")] = "bbbb"; - - // array - // - med.na[0] = 123; - med.na[1] = 234; - med.na[2] = 345; - - med.sa[0] = "aaa"; - med.sa[1] = "bbbb"; - med.sa[2] = "ccccc"; - - med.ca[0] = comp (123, "aaa"); - med.ca[1] = comp (234, "bbbb"); - med.ca[2] = comp (345, "ccccc"); - - // forward_list - // - med.nfl.push_front (234); - med.nfl.push_front (123); - - med.sfl.push_front ("bbbb"); - med.sfl.push_front ("aaa"); - - med.cfl.push_front (comp (234, "bbbb")); - med.cfl.push_front (comp (123, "aaa")); - - // unordered_set - // - med.nus.insert (123); - med.nus.insert (234); - - med.sus.insert ("aaa"); - med.sus.insert ("bbbb"); - - med.cus.insert (comp (123, "aaa")); - med.cus.insert (comp (234, "bbbb")); - - // unordered_map - // - med.nsum[123] = "aaa"; - med.nsum[234] = "bbbb"; - - med.snum["aaa"] = 123; - med.snum["bbbb"] = 234; - - med.ncum[123] = comp (123, "aaa"); - med.ncum[234] = comp (234, "bbbb"); - - med.csum[comp (123, "aaa")] = "aaa"; - med.csum[comp (234, "bbbb")] = "bbbb"; - - // - // full - // - - full.num = 9999; - full.str = "xxxx"; - - // vector - // - full.nv.push_back (1234); - full.nv.push_back (2345); - full.nv.push_back (3456); - - full.sv.push_back ("aaaa"); - full.sv.push_back ("bbbbb"); - full.sv.push_back ("cccccc"); - - full.cv.push_back (comp (1234, "aaaa")); - full.cv.push_back (comp (2345, "bbbbb")); - full.cv.push_back (comp (3456, "cccccc")); - - full.uv.push_back (1234); - full.uv.push_back (2345); - full.uv.push_back (3456); - - // list - // - full.sl.push_back ("aaaa"); - full.sl.push_back ("bbbbb"); - full.sl.push_back ("cccccc"); - - // deque - // - full.nd.push_back (1234); - full.nd.push_back (2345); - full.nd.push_back (3456); - - // set - // - full.ns.insert (1234); - full.ns.insert (2345); - full.ns.insert (3456); - - full.ss.insert ("aaaa"); - full.ss.insert ("bbbbb"); - full.ss.insert ("cccccc"); - - full.cs.insert (comp (1234, "aaaa")); - full.cs.insert (comp (2345, "bbbbb")); - full.cs.insert (comp (3456, "cccccc")); - - // map - // - full.nsm[1234] = "aaaa"; - full.nsm[2345] = "bbbbb"; - full.nsm[3456] = "cccccc"; - - full.snm["aaaa"] = 1234; - full.snm["bbbbb"] = 2345; - full.snm["cccccc"] = 3456; - - full.ncm[1234] = comp (1234, "aaaa"); - full.ncm[2345] = comp (2345, "bbbbb"); - full.ncm[3456] = comp (3456, "cccccc"); - - full.csm[comp (1234, "aaaa")] = "aaaa"; - full.csm[comp (2345, "bbbbb")] = "bbbbb"; - full.csm[comp (3456, "cccccc")] = "cccccc"; - - // array - // - full.na[0] = 123; - full.na[1] = 234; - full.na[2] = 345; - - full.sa[0] = "aaa"; - full.sa[1] = "bbbb"; - full.sa[2] = "ccccc"; - - full.ca[0] = comp (123, "aaa"); - full.ca[1] = comp (234, "bbbb"); - full.ca[2] = comp (345, "ccccc"); - - // forward_list - // - full.nfl.push_front (345); - full.nfl.push_front (234); - full.nfl.push_front (123); - - full.sfl.push_front ("ccccc"); - full.sfl.push_front ("bbbb"); - full.sfl.push_front ("aaa"); - - full.cfl.push_front (comp (345, "ccccc")); - full.cfl.push_front (comp (234, "bbbb")); - full.cfl.push_front (comp (123, "aaa")); - - // unordered_set - // - full.nus.insert (1234); - full.nus.insert (2345); - full.nus.insert (3456); - - full.sus.insert ("aaaa"); - full.sus.insert ("bbbbb"); - full.sus.insert ("cccccc"); - - full.cus.insert (comp (1234, "aaaa")); - full.cus.insert (comp (2345, "bbbbb")); - full.cus.insert (comp (3456, "cccccc")); - - // unordered_map - // - full.nsum[1234] = "aaaa"; - full.nsum[2345] = "bbbbb"; - full.nsum[3456] = "cccccc"; - - full.snum["aaaa"] = 1234; - full.snum["bbbbb"] = 2345; - full.snum["cccccc"] = 3456; - - full.ncum[1234] = comp (1234, "aaaa"); - full.ncum[2345] = comp (2345, "bbbbb"); - full.ncum[3456] = comp (3456, "cccccc"); - - full.csum[comp (1234, "aaaa")] = "aaaa"; - full.csum[comp (2345, "bbbbb")] = "bbbbb"; - full.csum[comp (3456, "cccccc")] = "cccccc"; - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr e (db->load ("empty")); - unique_ptr m (db->load ("medium")); - unique_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // - // empty - // - - empty.num = 99; - empty.str = "xx"; - - empty.nv.push_back (12); - empty.sv.push_back ("aa"); - empty.cv.push_back (comp (12, "aa")); - empty.uv.push_back (12); - empty.sl.push_back ("aa"); - empty.nd.push_back (12); - - empty.ns.insert (12); - empty.ss.insert ("aa"); - empty.cs.insert (comp (12, "aa")); - - empty.nsm[12] = "aa"; - empty.snm["aa"] = 12; - empty.ncm[12] = comp (12, "aa"); - empty.csm[comp (12, "aa")] = "aa"; - - empty.nfl.push_front (12); - empty.sfl.push_front ("aa"); - empty.cfl.push_front (comp (12, "aa")); - - empty.nus.insert (12); - empty.sus.insert ("aa"); - empty.cus.insert (comp (12, "aa")); - - empty.nsum[12] = "aa"; - empty.snum["aa"] = 12; - empty.ncum[12] = comp (12, "aa"); - empty.csum[comp (12, "aa")] = "aa"; - - // - // med - // - - med.num = 0; - med.str = ""; - - med.nv.clear (); - med.sv.clear (); - med.cv.clear (); - med.uv.clear (); - - med.sl.clear (); - - med.nd.clear (); - - med.ns.clear (); - med.ss.clear (); - med.cs.clear (); - - med.nsm.clear (); - med.snm.clear (); - med.ncm.clear (); - med.csm.clear (); - - med.nfl.clear (); - med.sfl.clear (); - med.cfl.clear (); - - med.nus.clear (); - med.sus.clear (); - med.cus.clear (); - - med.nsum.clear (); - med.snum.clear (); - med.ncum.clear (); - med.csum.clear (); - - // - // full - // - - full.num++; - full.str += "x"; - - // vector - // - full.nv.back ()++; - full.nv.push_back (4567); - - full.sv.back () += "c"; - full.sv.push_back ("ddddddd"); - - full.cv.back ().num++; - full.cv.back ().str += "c"; - full.cv.push_back (comp (4567, "ddddddd")); - - full.uv.back ()++; - full.uv.push_back (4567); - - // list - // - full.sl.back () += "c"; - full.sl.push_back ("ddddddd"); - - // deque - // - full.nd.push_front (456); - - // set - // - full.ns.insert (4567); - full.ss.insert ("ddddddd"); - full.cs.insert (comp (4567, "ddddddd")); - - // map - // - full.nsm[3456] += 'c'; - full.nsm[4567] = "ddddddd"; - - full.snm["cccccc"]++; - full.snm["ddddddd"] = 4567; - - full.ncm[3456].num++; - full.ncm[3456].str += 'c'; - full.ncm[4567] = comp (4567, "ddddddd"); - - full.csm[comp (3456, "cccccc")] += "c"; - full.csm[comp (4567, "ddddddd")] = "ddddddd"; - - // array - // - full.na[0]++; - full.sa[0] += 'a'; - full.ca[0].num++; - full.ca[0].str += 'a'; - - // forward_list - // - full.nfl.front ()++; - full.nfl.push_front (4567); - - full.sfl.front () += 'a'; - full.sfl.push_front ("ddddddd"); - - full.cfl.front ().num++; - full.cfl.front ().str += 'a'; - full.cfl.push_front (comp (4567, "ddddddd")); - - // unordered_set - // - full.nus.insert (4567); - full.sus.insert ("ddddddd1"); // 1 is to preserve order in VC++ 10. - full.cus.insert (comp (4567, "ddddddd1")); - - // unordered_map - // - full.nsum[3456] += 'c'; - full.nsum[4567] = "ddddddd"; - - full.snum["cccccc"]++; - full.snum["ddddddd1"] = 4567; - - full.ncum[3456].num++; - full.ncum[3456].str += 'c'; - full.ncum[4567] = comp (4567, "ddddddd"); - - full.csum[comp (3456, "cccccc")] += "c"; - full.csum[comp (4567, "ddddddd1")] = "ddddddd"; - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr e (db->load ("empty")); - unique_ptr m (db->load ("medium")); - unique_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx deleted file mode 100644 index e8e329e..0000000 --- a/common/container/basics/test.hxx +++ /dev/null @@ -1,245 +0,0 @@ -// file : common/container/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const std::string& s) : num (n), str (s) {} - - #pragma db column("number") - int num = 0; - std::string str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -inline bool -operator!= (const comp& x, const comp& y) -{ - return !(x == y); -} - -inline bool -operator< (const comp& x, const comp& y) -{ - return x.num != y.num ? x.num < y.num : x.str < y.str; -} - -typedef std::list str_list; -typedef std::deque num_deque; - -typedef std::vector num_vector; -typedef std::vector str_vector; - -typedef std::set num_set; -typedef std::set str_set; -typedef std::set comp_set; - -typedef std::map num_str_map; -typedef std::map str_num_map; -typedef std::map num_comp_map; -typedef std::map comp_str_map; - -struct comp_hash -{ - std::size_t - operator() (const comp& x) const {return nh (x.num) + sh (x.str);} - - std::hash nh; - std::hash sh; -}; - -typedef std::array num_array; -typedef std::array str_array; -typedef std::array comp_array; - -typedef std::forward_list num_flist; -typedef std::forward_list str_flist; -typedef std::forward_list comp_flist; - -typedef std::unordered_set num_uset; -typedef std::unordered_set str_uset; -typedef std::unordered_set comp_uset; - -typedef std::unordered_map num_str_umap; -typedef std::unordered_map str_num_umap; -typedef std::unordered_map num_comp_umap; -typedef std::unordered_map comp_str_umap; - -#pragma db value -struct cont_comp1 -{ - // This composite value does not have any columns. - // - num_vector sv; // Have the name "conflic" with the one in the object. -}; - -#pragma db value -struct cont_comp2 -{ - cont_comp2 (): num (777), str ("ggg") {} - - int num; - str_list sl; - std::string str; -}; - -#pragma db object -struct object -{ - object (): nv (comp1_.sv), sl (comp2_.sl) {} - object (const std::string& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} - - #pragma db id - std::string id_; - - int num; - - cont_comp1 comp1_; - cont_comp2 comp2_; - - // vector - // - #pragma db transient - num_vector& nv; - - #pragma db table("object_strings") id_column ("obj_id") - str_vector sv; - - #pragma db value_column("") - std::vector cv; - - #pragma db unordered - num_vector uv; - - // list - // - #pragma db transient - str_list& sl; - - // deque - // - num_deque nd; - - // set - // - num_set ns; - str_set ss; - comp_set cs; - - // map - // - num_str_map nsm; - str_num_map snm; - num_comp_map ncm; - comp_str_map csm; - - // array - // - num_array na; - str_array sa; - comp_array ca; - - // forward_list - // - num_flist nfl; - str_flist sfl; - comp_flist cfl; - - // unordered_set - // - num_uset nus; - str_uset sus; - comp_uset cus; - - // unordered_map - // - num_str_umap nsum; - str_num_umap snum; - num_comp_umap ncum; - comp_str_umap csum; - - std::string str; -}; - -inline bool -operator== (const object& x, const object& y) -{ - if (x.uv.size () != y.uv.size ()) - return false; - - int xs (0), ys (0); - - for (num_vector::size_type i (0); i < x.uv.size (); ++i) - { - xs += x.uv[i]; - ys += y.uv[i]; - } - - return - x.id_ == y.id_ && - x.num == y.num && - - x.comp2_.num == y.comp2_.num && - x.comp2_.str == y.comp2_.str && - - x.nv == y.nv && - x.sv == y.sv && - x.cv == y.cv && - xs == ys && - - x.sl == y.sl && - - x.nd == y.nd && - - x.ns == y.ns && - x.ss == y.ss && - x.cs == y.cs && - - x.nsm == y.nsm && - x.snm == y.snm && - x.ncm == y.ncm && - x.csm == y.csm && - - x.na == y.na && - x.sa == y.sa && - x.ca == y.ca && - - x.nfl == y.nfl && - x.sfl == y.sfl && - x.cfl == y.cfl && - - x.nus == y.nus && - x.sus == y.sus && - x.cus == y.cus && - - x.nsum == y.nsum && - x.snum == y.snum && - x.ncum == y.ncum && - x.csum == y.csum && - - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/common/container/basics/testscript b/common/container/basics/testscript deleted file mode 100644 index ea99498..0000000 --- a/common/container/basics/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/container/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/container/change-tracking/buildfile b/common/container/change-tracking/buildfile deleted file mode 100644 index 1dda818..0000000 --- a/common/container/change-tracking/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/container/change-tracking/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_cont_changet_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx deleted file mode 100644 index 4894ed9..0000000 --- a/common/container/change-tracking/driver.cxx +++ /dev/null @@ -1,729 +0,0 @@ -// file : common/container/change-tracking/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test change-tracking containers. -// - -#include // std::unique_ptr -#include // std::move -#include - -#include -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct counting_tracer: odb::tracer -{ - void - reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} - - virtual void - execute (odb::connection&, const char* stmt) - { - string p (stmt, 6); - if (p == "UPDATE") - u++; - else if (p == "INSERT") - i++; - else if (p == "DELETE") - d++; - else if (p == "SELECT") - s++; - t++; - } - - size_t u, i, d, s, t; -}; - -static counting_tracer tr; - -// Compilation test: instantiate all the functions. In C++11 mode only -// do this if we have a fairly conforming compiler that implements the -// complete std::vector interface. -// - -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC -#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 -struct item {}; -template class odb::vector; -template class odb::vector_iterator, - std::vector::iterator>; -template class odb::vector_iterator, - std::vector::reverse_iterator>; -#endif -#endif - -void -f (const std::vector&) {} - -int -main (int argc, char* argv[]) -{ - try - { - // Test extended interface. - // - { - typedef odb::vector vector; - - vector ov; - std::vector sv; - f (ov); // Implicit conversion to std::vector. - vector ov1 (sv); // Initialization from std::vector. - ov = sv; // Assignement from std::vector. - - // Container comparison. - // - if (ov != ov1 || - ov != sv || - sv != ov1) - ov.clear (); - - // Iterator comparison/conversion. - // - vector::const_iterator i (ov.begin ()); - if (i != ov.end ()) - i = ov.end (); - - // Things are just really borken in Sun CC, no matter which STL - // you use. - // -#ifndef __SUNPRO_CC - vector::const_reverse_iterator j (ov.rbegin ()); - if (j != ov.rend ()) - j = ov.rend (); -#endif - } - - unique_ptr db (create_database (argc, argv)); - - // Test traits logic. - // - { - object o ("1"); - o.i = 123; - o.s.push_back ("a"); - - assert (!o.s._tracking ()); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - assert (o.s._tracking ()); - - // load - // - { - transaction t (db->begin ()); - unique_ptr p (db->load ("1")); - assert (p->s._tracking ()); - t.commit (); - } - - // update - // - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - assert (o.s._tracking ()); - - // erase - // - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - - assert (!o.s._tracking ()); - } - - // Test change tracking. - // - object o ("1"); - o.i = 123; - o.s.push_back ("a"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // push_back/pop_back - // - { - o.s.push_back ("b"); // insert - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.pop_back (); - o.s.push_back ("c"); // update - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.pop_back (); - for (int i (0); i != 1024; ++i) - o.s.push_back ("x"); // realloc - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.i == 1023 && tr.t == 1025); - assert (*db->load ("1") == o); - t.commit (); - } - - { - for (int i (0); i != 1024; ++i) - o.s.pop_back (); // delete - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.push_back ("b"); - o.s.pop_back (); // no-op - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.t == 1); - assert (*db->load ("1") == o); - t.commit (); - } - - // insert - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.begin (), "a1"); // insert front - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.i == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.begin () + 1, "a2"); // insert middle - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.i == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.end (), "b1"); // insert back - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // erase - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - o.s.push_back ("d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.begin ()); // erase front - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 4 && tr.d == 1 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.begin () + 1); // erase middle - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.d == 1 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.end () - 1); // erase back - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // modify - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - o.s.push_back ("d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.modify (1) += 'b'; - o.s.modify_at (2) += 'c'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.modify_front () += 'a'; - o.s.modify_back () += 'd'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.begin ().modify () += 'a'; -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC - o.s.rbegin ().modify () += 'c'; -#endif - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC - assert (tr.u == 3 && tr.t == 3); -#else - assert (tr.u == 2 && tr.t == 2); -#endif - assert (*db->load ("1") == o); - t.commit (); - } - -#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC - { - (o.s.rbegin () + 1).modify (1) += 'a'; - (o.s.rbegin () + 1).modify (-1) += 'c'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } -#endif - - { - o.s.mbegin (); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 5 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - // clear - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.clear (); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // assign - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.assign (4, "x"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 4 && tr.i == 1 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - // resize - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.pop_back (); - o.s.resize (4, "x"); // expand - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.i == 1 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.push_back ("y"); - o.s.resize (3); // shrink - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // Transaction rollback. - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - { - o.s.push_back ("d"); - - transaction t (db->begin ()); - db->update (o); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Armed copy. - // - { - unique_ptr c; - - { - o.s.pop_back (); - - transaction t (db->begin ()); - db->update (o); - c.reset (new object (o)); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Armed swap. - // - { - object c (o); - - { - o.s.push_back ("d"); - - transaction t (db->begin ()); - db->update (o); - assert (o.s._tracking () && !c.s._tracking ()); - c.s.swap (o.s); - assert (!o.s._tracking () && c.s._tracking ()); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Armed move. - // - { - unique_ptr c; - - { - o.s.pop_back (); - - transaction t (db->begin ()); - db->update (o); - assert (o.s._tracking ()); - c.reset (new object (std::move (o))); - assert (!o.s._tracking () && c->s._tracking ()); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Test mixing "smart" and "dumb" container (specifically, erase(obj)). - // - { - mix_object o (1); - o.ov.assign (3, 123); - o.sv.assign (3, 123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test using change tracking container as inverse member. - // - { - inv_object1 o1; - inv_object2 o2; - o1.o2 = &o2; - - { - transaction t (db->begin ()); - db->persist (o2); - db->persist (o1); - t.commit (); - } - - assert (!o2.o1._tracking ()); - - { - session s; - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id_)); - unique_ptr p2 (db->load (o2.id_)); - assert (p2->o1[0] == p1.get ()); - assert (!p2->o1._tracking ()); - t.commit (); - } - } - - // Test read-only values. - { - ro_object o (1); - o.v.push_back (ro_value (1, 1)); - o.v.push_back (ro_value (2, 2)); - o.v.push_back (ro_value (3, 3)); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.v.erase (o.v.begin ()); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (db->load (1)->v == o.v); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx deleted file mode 100644 index 8e06f4a..0000000 --- a/common/container/change-tracking/test.hxx +++ /dev/null @@ -1,106 +0,0 @@ -// file : common/container/change-tracking/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include // std::move - -#include -#include - -#pragma db object pointer(std::unique_ptr) -struct object -{ - object () {} - object (const std::string& id): id_ (id) {} - - object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} - object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} - - #pragma db id - std::string id_; - - unsigned int i; - - odb::vector s; - - inline bool - operator== (const object& o) const {return id_ == o.id_ && i == o.i && s == o.s;} -}; - -// Test mixing "smart" and "dumb" container (specifically, erase(obj)). -// -#pragma db object -struct mix_object -{ - mix_object () {} - mix_object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector ov; - std::vector sv; -}; - -// Test using change tracking container as inverse member. -// -struct inv_object2; - -#pragma db object session -struct inv_object1 -{ - #pragma db id auto - unsigned long id_; - - inv_object2* o2; -}; - -#pragma db object session -struct inv_object2 -{ - #pragma db id auto - unsigned long id_; - - #pragma db inverse(o2) - odb::vector o1; -}; - -// Test read-only values (we still need to include them in the UPDATE -// statement). -// -#pragma db value -struct ro_value -{ - ro_value (int i_ = 0, int j_ = 0): i (i_), j (j_) {} - - #pragma db readonly - int i; - - #pragma db readonly - int j; -}; - -inline bool -operator== (const ro_value& x, const ro_value& y) -{ - return x.i == y.i && x.j == y.j; -} - -#pragma db object -struct ro_object -{ - ro_object () {} - ro_object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector v; -}; - -#endif // TEST_HXX diff --git a/common/container/change-tracking/testscript b/common/container/change-tracking/testscript deleted file mode 100644 index 2169869..0000000 --- a/common/container/change-tracking/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/container/change-tracking/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/ctor/buildfile b/common/ctor/buildfile deleted file mode 100644 index a9892bc..0000000 --- a/common/ctor/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/ctor/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix ctor_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/ctor/driver.cxx b/common/ctor/driver.cxx deleted file mode 100644 index c9b445d..0000000 --- a/common/ctor/driver.cxx +++ /dev/null @@ -1,79 +0,0 @@ -// file : common/ctor/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test support for persistent objects without default constructors. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - typedef odb::query query; - typedef odb::result result; - - unique_ptr db (create_database (argc, argv)); - - person p1 ("John", "Doe", 30); - person p2 ("Jane", "Doe", 29); - person p3 ("Joe", "Dirt", 31); - - { - transaction t (db->begin ()); - - db->persist (p1); - db->persist (p2); - db->persist (p3); - - t.commit (); - } - - { - person p ("", "", 0); - - transaction t (db->begin ()); - - db->load (p1.id_, p); - - assert (p.first_ == p1.first_); - assert (p.last_ == p1.last_); - assert (p.age_ == p1.age_); - - result r (db->query (query::age < 30)); - - assert (!r.empty ()); - - result::iterator i (r.begin ()); - i.load (p); - assert (p.first_ == "Jane"); - assert (p.last_ == "Doe"); - assert (p.age_ == 29); - - assert (size (r) == 1); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/ctor/test.hxx b/common/ctor/test.hxx deleted file mode 100644 index 2a2becd..0000000 --- a/common/ctor/test.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : common/ctor/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct person -{ - person (const std::string& first, - const std::string& last, - unsigned short age) - : first_ (first), last_ (last), age_ (age) - { - } - - #pragma db id auto - unsigned long id_; - - std::string first_; - std::string last_; - unsigned short age_; -}; - -#endif // TEST_HXX diff --git a/common/ctor/testscript b/common/ctor/testscript deleted file mode 100644 index 8946ddb..0000000 --- a/common/ctor/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/ctor/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/default/buildfile b/common/default/buildfile deleted file mode 100644 index e25bd08..0000000 --- a/common/default/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/default/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix default_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/default/driver.cxx b/common/default/driver.cxx deleted file mode 100644 index 2d3ef01..0000000 --- a/common/default/driver.cxx +++ /dev/null @@ -1,81 +0,0 @@ -// file : common/default/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test default values. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Insert an object using an ad-hoc SQL statement. This way - // we get all the default values. - // - { - transaction t (db->begin ()); - - if (db->id () != odb::id_oracle) - db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); - else - db->execute ("INSERT INTO \"default_object\" (\"obj_id\") VALUES (1)"); - - t.commit (); - } - - // Now load the object and check all the values. - // - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - t.commit (); - - assert (o->b); - assert (o->pi == 1234); - assert (o->ni == -1234); - assert (o->zi == 0); - assert (o->pf == 1.234); - assert (o->nf == -1.234); - assert (o->zf == 0.0); - assert (o->sf == 1.123e+10); - assert (o->str == "Someone's string"); - assert (o->e == green); - } - - // Check the NULL default value using a query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::null.is_null ())); - assert (!r.empty ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/default/test.hxx b/common/default/test.hxx deleted file mode 100644 index 7f35ed4..0000000 --- a/common/default/test.hxx +++ /dev/null @@ -1,67 +0,0 @@ -// file : common/default/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -enum color {red, green, blue}; - -#pragma db value(unsigned long) default(0) - -#pragma db object -struct object -{ - #pragma db id - unsigned long obj_id; - - // NULL. - // - #pragma db null default(null) - unsigned long null; - - // Boolean. - // - #pragma db default(true) - bool b; - - // Integers. - // - #pragma db default(1234) - unsigned long pi; - - #pragma db default(-1234) - long ni; - - // 0 default taken from the type. - unsigned long zi; - - // Floats. - // - #pragma db default(1.234) - double pf; - - #pragma db default(-1.234) - double nf; - - #pragma db default(0.0) - double zf; - - #pragma db default(1.123e+10) - double sf; - - // Strings. MySQL doesn't support default values on TEXT - // columns, so make the type VARCHAR. - // - #pragma db type("VARCHAR(64)") default("Someone's string") - std::string str; - - // Enums. - // - #pragma db default(green) - color e; -}; - -#endif // TEST_HXX diff --git a/common/default/testscript b/common/default/testscript deleted file mode 100644 index f29cef4..0000000 --- a/common/default/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/default/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/definition/.gitignore b/common/definition/.gitignore deleted file mode 100644 index 5838670..0000000 --- a/common/definition/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# ODB-generated files. -# -time-mapping-odb.?xx -time-mapping-odb-*.?xx -time-mapping.sql -time-mapping-*.sql diff --git a/common/definition/buildfile b/common/definition/buildfile deleted file mode 100644 index 09ad1db..0000000 --- a/common/definition/buildfile +++ /dev/null @@ -1,52 +0,0 @@ -# file : common/definition/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test time-mapping - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix definition_ \ - --generate-schema - -<{hxx ixx cxx}{time-mapping-odb}>: odb_options = - -for db: $databases - {hxx ixx cxx}{time-mapping-odb-$db}: odb_options = - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/definition/driver.cxx b/common/definition/driver.cxx deleted file mode 100644 index 223eeaf..0000000 --- a/common/definition/driver.cxx +++ /dev/null @@ -1,56 +0,0 @@ -// file : common/definition/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test overriding composite value definition point. This is primarily -// useful to make composite values out of third-party types. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - object o; - o.time.tv_sec = 1; - o.time.tv_usec = 1000; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (p->time.tv_sec == o.time.tv_sec && - p->time.tv_usec == o.time.tv_usec); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/definition/test.hxx b/common/definition/test.hxx deleted file mode 100644 index 38fc02a..0000000 --- a/common/definition/test.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : common/definition/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#ifdef _WIN32 -# include // timeval -#else -# include // timeval -#endif - -#include - -#include "time-mapping.hxx" - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id; - - timeval time; -}; - -#endif // TEST_HXX diff --git a/common/definition/testscript b/common/definition/testscript deleted file mode 100644 index c9dea6d..0000000 --- a/common/definition/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/definition/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/definition/time-mapping.hxx b/common/definition/time-mapping.hxx deleted file mode 100644 index 469cfb7..0000000 --- a/common/definition/time-mapping.hxx +++ /dev/null @@ -1,17 +0,0 @@ -// file : common/definition/time-mapping.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TIME_MAPPING_HXX -#define TIME_MAPPING_HXX - -#ifdef _WIN32 -# include // timeval -#else -# include // timeval -#endif - -#pragma db value(timeval) definition -#pragma db member(timeval::tv_sec) column("sec") -#pragma db member(timeval::tv_usec) column("usec") - -#endif // TIME_MAPPING_HXX diff --git a/common/enum/buildfile b/common/enum/buildfile deleted file mode 100644 index eb3a29a..0000000 --- a/common/enum/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/enum/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix enum_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/enum/driver.cxx b/common/enum/driver.cxx deleted file mode 100644 index ed3eb59..0000000 --- a/common/enum/driver.cxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : common/enum/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test automatic C++ enum mapping. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - typedef odb::query query; - typedef odb::result result; - - unique_ptr db (create_database (argc, argv)); - - object o; - o.color_ = green; - o.taste_ = object::sweet; - o.position_ = object::left; - - o.gender_ = object::gender::female; - o.scale_ = object::scale::ten; - o.yesno_ = object::yesno::yes; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (o.id_)); - t.commit (); - - assert (o == *o1); - } - - { - transaction t (db->begin ()); - - result r1 (db->query (query::color == blue)); - result r2 (db->query (query::taste == object::sweet)); - result r3 (db->query (query::position == object::left)); - - assert (r1.empty ()); - assert (!r2.empty ()); - assert (!r3.empty ()); - - result r4 (db->query (query::gender == object::gender::female)); - result r5 (db->query (query::scale == object::scale::ten)); - result r6 (db->query (query::yesno == object::yesno::yes)); - - assert (!r4.empty ()); - assert (!r5.empty ()); - assert (!r6.empty ()); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/enum/test.hxx b/common/enum/test.hxx deleted file mode 100644 index a279112..0000000 --- a/common/enum/test.hxx +++ /dev/null @@ -1,47 +0,0 @@ -// file : common/enum/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -enum color {red, green, blue}; - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id_; - - color color_; - enum taste {bitter, sweet, sour}; - taste taste_; - - enum position {left = -1, center = 0, right = 1}; - position position_; - - - enum class gender {male, female}; - enum class scale: unsigned char {one = 1, ten = 10, hundred = 100}; - enum class yesno: bool {no, yes}; - - gender gender_; - scale scale_; - yesno yesno_; -}; - -inline bool -operator == (const object& x, const object& y) -{ - return - x.id_ == y.id_ - && x.color_ == y.color_ - && x.taste_ == y.taste_ - && x.position_ == y.position_ - && x.gender_ == y.gender_ - && x.scale_ == y.scale_ - && x.yesno_ == y.yesno_; -} - -#endif // TEST_HXX diff --git a/common/enum/testscript b/common/enum/testscript deleted file mode 100644 index d2ca28c..0000000 --- a/common/enum/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/enum/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/erase-query/buildfile b/common/erase-query/buildfile deleted file mode 100644 index d833b6e..0000000 --- a/common/erase-query/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/erase-query/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix erase_query_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx deleted file mode 100644 index 6c11957..0000000 --- a/common/erase-query/driver.cxx +++ /dev/null @@ -1,181 +0,0 @@ -// file : common/erase-query/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test query-based erase. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -void -persist (database& db) -{ - object o1 (1); - object o2 (2); - object o3 (3); - object o4 (4); - - transaction t (db.begin ()); - db.persist (o1); - db.persist (o2); - db.persist (o3); - db.persist (o4); - t.commit (); -} - -int -main (int argc, char* argv[]) -{ - try - { - typedef odb::query query; - - unique_ptr db (create_database (argc, argv)); - - // erase_query() - // - persist (*db); - - { - transaction t (db->begin ()); - assert (db->erase_query () == 4); - t.commit (); - } - - // erase_query(const char*) - // - persist (*db); - - { - transaction t (db->begin ()); - - if (db->id () != odb::id_oracle) - assert (db->erase_query ( - "erase_query_object.id < 3") == 2); - else - assert (db->erase_query ( - "\"erase_query_object\".\"id\" < 3") == 2); - - db->erase_query (); - t.commit (); - } - - // erase_query(query) - // - persist (*db); - - { - transaction t (db->begin ()); - assert (db->erase_query (query::id == 2 || query::id == 4) == 2); - db->erase_query (); - t.commit (); - } - - // Test predicates involving object pointers (DELETE JOIN). - // - /* - { - object o11 (1); - object o12 (2); - object o13 (3); - object2 o2; - - o11.o2 = &o2; - o2.num = 123; - - o12.o1 = &o13; - o13.num = 123; - - transaction t (db->begin ()); - db->persist (o2); - db->persist (o13); - db->persist (o12); - db->persist (o11); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (db->erase_query (query::o1::num == 123) == 1); - assert (db->erase_query (query::o2::num == 123) == 1); - db->erase_query (); - t.commit (); - } - */ - - // For now we can only do column-based tests, like is_null(). - // - { - object o11 (1); - object o12 (2); - object o13 (3); - object2 o2; - - o12.o2 = &o2; - - transaction t (db->begin ()); - db->persist (o2); - db->persist (o13); - db->persist (o12); - db->persist (o11); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (db->erase_query (query::o2.is_null ()) == 2); - db->erase_query (); - t.commit (); - } - - // Make sure container data is deleted. - // - { - object o (1); - o.v.push_back (1); - o.v.push_back (2); - o.v.push_back (3); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (db->erase_query () == 1); - t.commit (); - } - - { - transaction t (db->begin ()); - - if (db->id () != odb::id_oracle) - assert (db->execute ("SELECT * FROM erase_query_object_v " - "WHERE object_id = 1") == 0); - else - assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " - "WHERE \"object_id\" = 1") == 0); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/erase-query/test.hxx b/common/erase-query/test.hxx deleted file mode 100644 index 9e73f12..0000000 --- a/common/erase-query/test.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : common/erase-query/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -struct object2; - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id), o1 (0), o2 (0) - { - } - - object () - : o1 (0), o2 (0) - { - } - - #pragma db id - unsigned long id_; - - std::vector v; - - int num; - - object* o1; - object2* o2; -}; - -#pragma db object -struct object2 -{ - #pragma db id auto - unsigned long id_; - - int num; -}; - -#endif // TEST_HXX diff --git a/common/erase-query/testscript b/common/erase-query/testscript deleted file mode 100644 index 90862ab..0000000 --- a/common/erase-query/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/erase-query/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/id/auto/buildfile b/common/id/auto/buildfile deleted file mode 100644 index c340200..0000000 --- a/common/id/auto/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/id/auto/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_id_auto_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/auto/driver.cxx b/common/id/auto/driver.cxx deleted file mode 100644 index d294e69..0000000 --- a/common/id/auto/driver.cxx +++ /dev/null @@ -1,96 +0,0 @@ -// file : common/id/auto/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test automatic id assignment. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // object - // - { - unsigned long id1, id2, id3; - { - object o1 ("one"); - object o2 ("two"); - object o3 ("three"); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - - id1 = o1.id_; - id2 = o2.id_; - id3 = o3.id_; - - assert (id1 != id2); - assert (id1 != id3); - assert (id2 != id3); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (id1)); - unique_ptr o2 (db->load (id2)); - unique_ptr o3 (db->load (id3)); - t.commit (); - - assert (o1->id_ == id1 && o1->str_ == "one"); - assert (o2->id_ == id2 && o2->str_ == "two"); - assert (o3->id_ == id3 && o3->str_ == "three"); - } - } - - // auto_only - // - { - unsigned short id; - { - auto_only o; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - id = o.id_; - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (id)); - t.commit (); - - assert (o->id_ == id); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/id/auto/test.hxx b/common/id/auto/test.hxx deleted file mode 100644 index 233c79f..0000000 --- a/common/id/auto/test.hxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : common/id/auto/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - object (const std::string& str) - : id_ (1), str_ (str) - { - } - - #pragma db auto id - unsigned long id_; - std::string str_; - -private: - object () - { - } - - friend class odb::access; -}; - -// Test the case where the object has just the auto id. -// -#pragma db object -struct auto_only -{ - #pragma db auto id pgsql:type("BIGINT") - unsigned short id_; -}; - -#endif // TEST_HXX diff --git a/common/id/auto/testscript b/common/id/auto/testscript deleted file mode 100644 index bb2a3a4..0000000 --- a/common/id/auto/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/id/auto/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/id/composite/buildfile b/common/id/composite/buildfile deleted file mode 100644 index 4bc9f9a..0000000 --- a/common/id/composite/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/id/composite/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_id_comp_ \ - --generate-schema \ - --generate-query \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/composite/driver.cxx b/common/id/composite/driver.cxx deleted file mode 100644 index 3d66101..0000000 --- a/common/id/composite/driver.cxx +++ /dev/null @@ -1,731 +0,0 @@ -// file : common/id/composite/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test composite object ids. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test 1. - // - { - using namespace test1; - - object o1 (scomp ("aaa", "bbb", "ccc"), 123); - o1.vec.push_back (scomp ("xxx", "xxx", "xxx")); - o1.vec.push_back (scomp ("yyy", "yyy", "yyy")); - - object o2 (scomp ("aaa", "bbb", "ccd"), 234); - o2.vec.push_back (scomp ("zzz", "", "zzz")); - - object o3 (scomp ("baa", "bbb", "ccc"), 345); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - unique_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p3 == o3); - } - - // Update. - // - { - transaction t (db->begin ()); - unique_ptr p (db->load (o1.id)); - p->num++; - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o1.id)); - t.commit (); - - assert (p->num == o1.num + 1); - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (o1.id); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->find (o1.id)); - assert (p.get () == 0); - t.commit (); - } - } - - // Test 2. - // - { - using namespace test2; - - object2 o2 (ncomp (2, 0, 1)); - o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); - - object3 o3 (ncomp (3, 0, 1)); - o3.o1.push_back (new object1 (scomp ("o1", "o3", "aaa"))); - o3.o1.push_back (new object1 (scomp ("o1", "o3", "bbb"))); - - object4 o4 (ncomp (4, 0, 1)); - o4.c.o2 = new object2 (ncomp (2, 4, 1)); - o4.c.o2->o1 = new object1 (scomp ("o1", "o2", "ccc")); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1); - db->persist (o2); - db->persist (o3.o1[0]); - db->persist (o3.o1[1]); - db->persist (o3); - db->persist (o4.c.o2->o1); - db->persist (o4.c.o2); - db->persist (o4); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - unique_ptr p3 (db->load (o3.id)); - unique_ptr p4 (db->load (o4.id)); - t.commit (); - - assert (p2->o1->id == o2.o1->id); - assert (p3->o1.size () == o3.o1.size ()); - assert (p3->o1[0]->id == o3.o1[0]->id); - assert (p3->o1[1]->id == o3.o1[1]->id); - assert (p4->c.o2->id == o4.c.o2->id); - assert (p4->c.o2->o1->id == o4.c.o2->o1->id); - } - - // Update. - // - { - scomp id2, id3; - - { - transaction t (db->begin ()); - - unique_ptr p2 (db->load (o2.id)); - delete p2->o1; - p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); - id2 = db->persist (p2->o1); - db->update (*p2); - - unique_ptr p3 (db->load (o3.id)); - delete p3->o1.back (); - p3->o1.pop_back (); - p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); - id3 = db->persist (p3->o1.back ()); - db->update (*p3); - - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - unique_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2->o1->id == id2); - assert (p3->o1.back ()->id == id3); - } - } - - // Query. - // - { - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result r (db->query (query::o1->id.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.id); - assert (++i == r.end ()); - } - - { - // As id (dual interface). - // - result r (db->query (query::o1.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.id); - assert (++i == r.end ()); - } - - t.commit (); - } - - // Second level composite object pointer. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::c.o2->o1.str3 == "ccc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o4.id); - assert (++i == r.end ()); - - t.commit (); - } - } - - // View. - // - { - transaction t (db->begin ()); - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query (query::object2::id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - } - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query ((query::object3::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "ccc"); - assert (++i == r.end ()); - } - - { - typedef odb::query query; - typedef odb::result result; - - result r (db->query (query::object4::id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num4 == 1 && i->num2 == 1 && i->str == "ccc"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // Test 3. - // - { - using namespace test3; - - object2 o2 (ncomp (2, 0, 1)); - o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); - o2.o1->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1->o2->id == o2.id); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - session s; - - result r (db->query (query::o2->id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.o1->id); - - i->o2->o1 = 0; - delete i->o2; - - assert (++i == r.end ()); - } - - t.commit (); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object1::id.str2 == "o2")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 4. - // - { - using namespace test4; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2 = &o2; - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - assert (p2->o1[0]->o2->id == o2.id); - assert (p2->o1[1]->o2->id == o2.id); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - session s; - - result r (db->query (query::o2->id.num2 == 0)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id == o2.o1[0]->id); - i->o2->o1.clear (); - - assert (++i != r.end ()); - assert (i->id == o2.o1[1]->id); - - i->o2->o1.clear (); - delete i->o2; - - assert (++i == r.end ()); - } - - t.commit (); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object1::id.str3 == "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 5. - // - { - using namespace test5; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2 = &o2; - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2 = &o2; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - - assert (p2->o1[0]->id == o2.o1[0]->id); - assert (p2->o1[0]->o2->id == o2.id); - - assert (p2->o1[1]->id == o2.o1[1]->id); - assert (p2->o1[1]->o2->id == o2.id); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ((query::object2::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 6. - // - { - using namespace test6; - - object2 o2 (ncomp (2, 0, 1)); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); - o2.o1.back ()->o2.push_back (&o2); - - o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); - o2.o1.back ()->o2.push_back (&o2); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2.o1[0]); - db->persist (o2.o1[1]); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p2->o1.size () == 2); - - assert (p2->o1[0]->id == o2.o1[0]->id); - assert (p2->o1[0]->o2[0]->id == o2.id); - - assert (p2->o1[1]->id == o2.o1[1]->id); - assert (p2->o1[1]->o2[0]->id == o2.id); - } - - // View. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ((query::object2::id.num2 == 0) + - "ORDER BY" + query::object1::id.str3)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - assert (++i != r.end ()); - assert (i->num == 1 && i->str == "bbb"); - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test 7. - // - { - using namespace test7; - - object o (scomp ("aaa", "bbb", "ccc"), 123); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (*p == o); - } - - // Update. - // - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - p->num++; - db->update (*p); - - try - { - db->update (o); - assert (false); - } - catch (const object_changed&) - { - } - - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (p->num == o.num + 1); - } - - // Erase. - // - { - transaction t (db->begin ()); - - try - { - db->update (o); - assert (false); - } - catch (const object_changed&) - { - } - - t.commit (); - } - } - - // Test 8. - // - { - using namespace test8; - - object2 o2a, o2b; - object3 o3; - - o2b.o1 = new object1 (scomp ("222", "aaa", "bbb"), 123); - o3.o1.push_back (0); - o3.o1.push_back (new object1 (scomp ("333", "aaa", "bbb"), 234)); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o2a); - db->persist (o2b); - db->persist (o2b.o1); - db->persist (o3); - db->persist (o3.o1[1]); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p2a (db->load (o2a.id)); - unique_ptr p2b (db->load (o2b.id)); - unique_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2a->o1 == 0); - assert (p2b->o1 != 0 && *p2b->o1 == *o2b.o1); - assert (p3->o1[0] == 0); - assert (p3->o1[1] != 0 && *p3->o1[1] == *o3.o1[1]); - } - - // Update. - // - { - object1* o1 (o3.o1[1]); - - o3.o1.clear (); - o3.o1.push_back (o2b.o1); - o3.o1.push_back (0); - - o2a.o1 = o1; - o2b.o1 = 0; - - transaction t (db->begin ()); - db->update (o2a); - db->update (o2b); - db->update (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p2a (db->load (o2a.id)); - unique_ptr p2b (db->load (o2b.id)); - unique_ptr p3 (db->load (o3.id)); - t.commit (); - - assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); - assert (p2b->o1 == 0); - assert (p3->o1[0] != 0 && *p3->o1[0] == *o3.o1[0]); - assert (p3->o1[1] == 0); - } - } - - // Test 9. - { - using namespace test9; - - object o (123, "abc"); - o.v.push_back (123); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - result r (db->query ()); - result::iterator i (r.begin ()); - assert (i != r.end () && o == *i && ++i == r.end ()); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/id/composite/test.hxx b/common/id/composite/test.hxx deleted file mode 100644 index 70856a6..0000000 --- a/common/id/composite/test.hxx +++ /dev/null @@ -1,519 +0,0 @@ -// file : common/id/composite/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db value -struct scomp -{ - scomp () {} - scomp (const std::string& s1, const std::string& s2, const std::string& s3) - : str1 (s1), str2 (s2), str3 (s3) - { - } - - std::string str1; - std::string str2; - std::string str3; -}; - -inline bool -operator== (const scomp& x, const scomp& y) -{ - return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; -} - -inline bool -operator< (const scomp& x, const scomp& y) -{ - return x.str1 < y.str1 || - (x.str1 == y.str1 && x.str2 < y.str2) || - (x.str1 == y.str1 && x.str2 == y.str2 && x.str3 < y.str3); -} - -#pragma db value -struct ncomp -{ - ncomp () {} - ncomp (unsigned short n1, unsigned short n2, unsigned short n3) - : num1 (n1), num2 (n2), num3 (n3) - { - } - - unsigned short num1; - unsigned short num2; - unsigned short num3; -}; - -inline bool -operator== (const ncomp& x, const ncomp& y) -{ - return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; -} - -inline bool -operator< (const ncomp& x, const ncomp& y) -{ - return x.num1 < y.num1 || - (x.num1 == y.num1 && x.num2 < y.num2) || - (x.num1 == y.num1 && x.num2 == y.num2 && x.num3 < y.num3); -} - -// Test object with composite id, container. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object - struct object - { - object () {} - object (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - unsigned long num; - std::vector vec; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id == y.id && x.num == y.num && x.vec == y.vec; - } -} - -// Test to-one and to-many relationships with composite id as well as -// queries and views. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - }; - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - object2 (const ncomp& i): id (i), o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id - ncomp id; - - object1* o1; - }; - - #pragma db object - struct object3 - { - object3 () {} - object3 (const ncomp& i): id (i) {} - - ~object3 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - std::vector o1; - }; - - // Test second-level query pointer test as well as pointers in - // composite types. - // - #pragma db value - struct comp - { - comp (): o2 (0) {} - ~comp () {delete o2;} - - object2* o2; - }; - - #pragma db object - struct object4 - { - object4 () {} - object4 (const ncomp& i): id (i) {} - - #pragma db id - ncomp id; - - comp c; - }; - - #pragma db view object(object2) object(object1) - struct view2 - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; - - #pragma db view object(object3) object(object1) - struct view3 - { - #pragma db column (object3::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; - - #pragma db view object(object4) object(object2) object(object1) - struct view4 - { - #pragma db column (object4::id.num3) - unsigned short num4; - - #pragma db column (object2::id.num3) - unsigned short num2; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test one-to-one(i) relationship with composite id. -// -#pragma db namespace table("t3_") -namespace test3 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - #pragma db inverse(o1) - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - object2 (const ncomp& i): id (i), o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id - ncomp id; - - object1* o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test many-to-one(i) relationship with composite id. -// -#pragma db namespace table("t4_") -namespace test4 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - #pragma db inverse(o1) - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test one-to-many(i) relationship with composite id. -// -#pragma db namespace table("t5_") -namespace test5 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - object2* o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - #pragma db inverse(o2) - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test many-to-many(i) relationship with composite id. -// -#pragma db namespace table("t6_") -namespace test6 -{ - struct object2; - - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i): id (i) {} - - #pragma db id - scomp id; - - std::vector o2; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const ncomp& i): id (i) {} - - ~object2 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id - ncomp id; - - #pragma db inverse(o2) - std::vector o1; - }; - - #pragma db view object(object2) object(object1) - struct view - { - #pragma db column (object2::id.num3) - unsigned short num; - - #pragma db column (object1::id.str3) - std::string str; - }; -} - -// Test object with composite id and version (optimistic concurrency). -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object optimistic - struct object - { - object () {} - object (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - #pragma db version - unsigned long ver; - - unsigned long num; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.id == y.id && x.ver == y.ver && x.num == y.num; - } -} - -// Test composite NULL pointers. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object - struct object1 - { - object1 () {} - object1 (const scomp& i, unsigned long n): id (i), num (n) {} - - #pragma db id - scomp id; - - unsigned long num; - }; - - inline bool - operator== (const object1& x, const object1& y) - { - return x.id == y.id && x.num == y.num; - } - - #pragma db object - struct object2 - { - object2 (): o1 (0) {} - ~object2 () {delete o1;} - - #pragma db id auto - unsigned long id; - - object1* o1; - }; - - #pragma db object - struct object3 - { - ~object3 () - { - for (std::vector::iterator i (o1.begin ()); - i != o1.end (); ++i) - delete *i; - } - - #pragma db id auto - unsigned long id; - - std::vector o1; - }; -} - -// Test composite id definition inside object. -// -#pragma db namespace table("t9_") -namespace test9 -{ - #pragma db object - struct object - { - object (unsigned long n = 0, const std::string& s = "") - { - id_.num = n; - id_.str = s; - } - - unsigned long num () const {return id_.num;} - const std::string& str () const {return id_.str;} - - std::vector v; - - private: - friend class odb::access; - - #pragma db value - struct comp - { - unsigned long num; - std::string str; - - bool - operator< (const comp& x) const - { - return num < x.num || (num == x.num && str < x.str); - } - }; - - #pragma db id - comp id_; - }; - - inline bool - operator== (const object& x, const object& y) - { - return x.num () == y.num () && x.str () == y.str () && x.v == y.v; - } -} - - -#endif // TEST_HXX diff --git a/common/id/composite/testscript b/common/id/composite/testscript deleted file mode 100644 index f87d4bc..0000000 --- a/common/id/composite/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/id/composite/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/id/nested/buildfile b/common/id/nested/buildfile deleted file mode 100644 index 777cb65..0000000 --- a/common/id/nested/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/nested/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_id_nested_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/id/nested/driver.cxx b/common/id/nested/driver.cxx deleted file mode 100644 index 92a80f6..0000000 --- a/common/id/nested/driver.cxx +++ /dev/null @@ -1,266 +0,0 @@ -// file : common/id/nested/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test nested ids. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct failed {}; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - - // Simple nested id. - // - { - using namespace test1; - - object o1 (1, "a", 3); - o1.v.push_back (123); - - object o2 (4, "b", 6); - o2.v.push_back (234); - - object1 o (new object (10, "abc", 11)); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o.p); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p == o); - } - - o1.z++; - o1.v.pop_back (); - o1.v.push_back (234); - - o2.z--; - o2.v.back ()++; - o2.v.push_back (123); - - delete o.p; - o.p = new object (20, "xyz", 11); - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - db->persist (o.p); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p == o); - } - } - - // Composite nested id. - // - { - using namespace test2; - - object o1 (1, 2, "a", 123); - o1.v.push_back (123); - - object o2 (1, 3, "b", 234); - o2.v.push_back (234); - - object1 o (new object (2, 2, "abc", 123)); - o.p->v.push_back (345); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o.p); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.c)); - unique_ptr p2 (db->load (o2.id.c)); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p == o); - } - - o1.z++; - o1.v.pop_back (); - o1.v.push_back (234); - - o2.z--; - o2.v.modify_back ()++; - o2.v.push_back (123); - - delete o.p; - o.p = new object (2, 3, "xyz", 234); - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - db->persist (o.p); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.c)); - unique_ptr p2 (db->load (o2.id.c)); - unique_ptr p (db->load (o.id)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - assert (*p == o); - } - } - - // Custom/by-value access. - // - { - using namespace test3; - - object o1 (1, "a", 3); - object o2 (4, "b", 6); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o1.z++; - o2.z--; - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - - // Polymorphic. - // - { - using namespace test4; - - base o1 (1, "a"); - object o2 (2, "b", 1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - - o2.z--; - - { - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id.y)); - unique_ptr p2 (db->load (o2.id.y)); - t.commit (); - - assert (*p1 == o1); - assert (*p2 == o2); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/id/nested/test.hxx b/common/id/nested/test.hxx deleted file mode 100644 index 06ee6b8..0000000 --- a/common/id/nested/test.hxx +++ /dev/null @@ -1,217 +0,0 @@ -// file : common/id/nested/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include -#include - -// Simple nested id. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db value - struct comp - { - int x; - std::string y; - }; - - #pragma db object - struct object - { - #pragma db id(y) - comp id; - - int z; - std::vector v; - - object () {} - object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} - }; - - inline bool - operator== (object a, object b) - { - return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z && a.v == b.v; - } - - #pragma db object - struct object1 - { - #pragma db id auto - int id; - - object* p; - - object1 (object* p_ = 0): p (p_) {} - ~object1 () {delete p;} - }; - - inline bool - operator== (const object1& a, const object1& b) - { - return a.id == b.id && *a.p == *b.p; - } -} - -// Composite nested id. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db value - struct comp1 - { - int x; - int y; - }; - - #pragma db value - struct comp2 - { - comp1 c; - std::string s; - }; - - #pragma db object - struct object - { - #pragma db id(c) - comp2 id; - - int z; - odb::vector v; - - object () {} - object (int x, int y, std::string s, int z_) - : z (z_) {id.c.x = x; id.c.y = y; id.s = s;} - }; - - inline bool - operator== (object a, object b) - { - return a.id.c.x == b.id.c.x && a.id.c.y == b.id.c.y && - a.id.s == b.id.s && a.z == b.z && a.v == b.v; - } - - #pragma db object - struct object1 - { - #pragma db id auto - int id; - - object* p; - - object1 (object* p_ = 0): p (p_) {} - ~object1 () {delete p;} - }; - - inline bool - operator== (const object1& a, const object1& b) - { - return a.id == b.id && *a.p == *b.p; - } - - // Multiple levels of nesting, just a compile test. - // - #pragma db object - struct object2 - { - #pragma db id(c.x) - comp2 id; - - int z; - }; -} - -// Custom/by-value access. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db value - struct comp - { - int x; - - std::string get_y () const {return y;} - void set_y (std::string v) {y = v;} - - #pragma db get(get_y) set(set_y) - std::string y; - }; - - #pragma db object - struct object - { - comp get_id () const {return id;} - void set_id (comp v) {id = v;} - - #pragma db id(y) get(get_id) set(set_id) - comp id; - - int z; - - object () {} - object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} - }; - - inline bool - operator== (object a, object b) - { - return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; - } -} - -// Polymorphic. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db value - struct comp - { - int x; - std::string y; - }; - - #pragma db object polymorphic - struct base - { - #pragma db id(y) - comp id; - - virtual ~base () {} - base () {} - base (int x, std::string y) {id.x = x; id.y = y;} - }; - - inline bool - operator== (const base& a, const base& b) - { - return a.id.x == b.id.x && a.id.y == b.id.y; - } - - #pragma db object - struct object: base - { - int z; - - object () {} - object (int x, std::string y, int z_): base (x, y), z (z_) {} - }; - - inline bool - operator== (const object& a, const object& b) - { - return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; - } -} - -#endif // TEST_HXX diff --git a/common/id/nested/testscript b/common/id/nested/testscript deleted file mode 100644 index 89e8d7a..0000000 --- a/common/id/nested/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/nested/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/include/.gitignore b/common/include/.gitignore deleted file mode 100644 index d52f166..0000000 --- a/common/include/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# ODB-generated files. -# -obj1-odb.?xx -obj1-odb-*.?xx -obj2-odb.?xx -obj2-odb-*.?xx -obj3-odb.?xx -obj3-odb-*.?xx - -test1-odb.?xx -test1-odb-*.?xx -test2-odb.?xx -test2-odb-*.?xx -test3-odb.?xx -test3-odb-*.?xx -test4-odb.?xx -test4-odb-*.?xx diff --git a/common/include/buildfile b/common/include/buildfile deleted file mode 100644 index 6db878c..0000000 --- a/common/include/buildfile +++ /dev/null @@ -1,51 +0,0 @@ -# file : common/include/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = obj1 obj2 obj3 test1 test2 test3 test4 - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). Also see driver.cxx for the details on -# the -I options usage. -# -odb_options = --table-prefix include_ \ - "-I$out_base" \ - "-I$src_base/.." \ - "-I$src_base/../.." - -cxx.poptions =+ "-I$out_base" "-I$src_base" \ - "-I$out_base/../.." "-I$src_base/../.." - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/include/driver.cxx b/common/include/driver.cxx deleted file mode 100644 index 561746a..0000000 --- a/common/include/driver.cxx +++ /dev/null @@ -1,42 +0,0 @@ -// file : common/include/driver.cxx -// 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 "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" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main () -{ -} diff --git a/common/include/obj1.hxx b/common/include/obj1.hxx deleted file mode 100644 index 33ae0d6..0000000 --- a/common/include/obj1.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : common/include/obj1.hxx -// 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 deleted file mode 100644 index 2f20f58..0000000 --- a/common/include/obj2.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : common/include/obj2.hxx -// 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 deleted file mode 100644 index 432145b..0000000 --- a/common/include/obj3.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : common/include/obj3.hxx -// 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 deleted file mode 100644 index 6e949e2..0000000 --- a/common/include/objs1.hxx +++ /dev/null @@ -1,13 +0,0 @@ -// file : common/include/objs1.hxx -// 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 deleted file mode 100644 index 4f8133b..0000000 --- a/common/include/objs2.hxx +++ /dev/null @@ -1,13 +0,0 @@ -// file : common/include/objs2.hxx -// 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 deleted file mode 100644 index 2f7aaff..0000000 --- a/common/include/objs3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : common/include/objs3.hxx -// 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 deleted file mode 100644 index d766fe6..0000000 --- a/common/include/objs4.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : common/include/objs1.hxx -// 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/test1.hxx b/common/include/test1.hxx deleted file mode 100644 index 1914ddb..0000000 --- a/common/include/test1.hxx +++ /dev/null @@ -1,16 +0,0 @@ -// file : common/include/test1.hxx -// 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 deleted file mode 100644 index 6017ac4..0000000 --- a/common/include/test2.hxx +++ /dev/null @@ -1,15 +0,0 @@ -// file : common/include/test2.hxx -// 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 deleted file mode 100644 index e55ecdb..0000000 --- a/common/include/test3.hxx +++ /dev/null @@ -1,12 +0,0 @@ -// file : common/include/test3.hxx -// 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 deleted file mode 100644 index b58e679..0000000 --- a/common/include/test4.hxx +++ /dev/null @@ -1,12 +0,0 @@ -// file : common/include/test3.hxx -// 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/include/testscript b/common/include/testscript deleted file mode 100644 index 089f7a1..0000000 --- a/common/include/testscript +++ /dev/null @@ -1,31 +0,0 @@ -# file : common/include/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* &!odb-test.db -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $* -} diff --git a/common/index/buildfile b/common/index/buildfile deleted file mode 100644 index 535bd26..0000000 --- a/common/index/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/index/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix index_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/index/driver.cxx b/common/index/driver.cxx deleted file mode 100644 index 7a22a7c..0000000 --- a/common/index/driver.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : common/index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test index creation with db pragma index. See also database-specific -// tests. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - // This is just a schema creation test. - // - unique_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/index/test.hxx b/common/index/test.hxx deleted file mode 100644 index f27783f..0000000 --- a/common/index/test.hxx +++ /dev/null @@ -1,142 +0,0 @@ -// file : common/index/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -// Test basic functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object - struct object - { - #pragma db id auto - unsigned long id_; - - #pragma db index - int i1; - - #pragma db unique - int i2; - - #pragma db unique index - int i3; - - int i4; - #pragma db index unique member(i4) - - int i5; - #pragma db index type("UNIQUE") member(i5) - - int i6; - #pragma db index("object_i6_index") member(i6) - - int i7; - int i8; - int i9; - - int i10; - #pragma db index member(i10, "ASC") - }; - - #pragma db index(object) member(i7) - #pragma db index(object::"object_i8_index") member(i8) -} - -#pragma db index(test1::object::"object_i9_index") member(i9) - -// Test composite indexes. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db value - struct nested - { - int x; - int y; - }; - - #pragma db value - struct comp - { - int x; - int y; - nested n; - }; - - #pragma db object - struct object - { - #pragma db id auto - unsigned long id_; - - int i1a; - int i1b; - #pragma db index("object_i1_i") member(i1a) member(i1b) - - int i2a; - int i2b; - #pragma db index("object_i2_i") members(i2a, i2b) - - #pragma db index - comp c1; - - #pragma db index column("") - comp c2; - - comp c3; - #pragma db index member(c3.x) - #pragma db index member(c3.y) - - comp c4; - #pragma db index("object_c4_i") members(c4.x, c4.y, c4.n.x) - - comp c5; - int i5; - #pragma db index("object_ci5_i") member(c5) member(i5) - }; -} - -// Test container indexes. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db value - struct id - { - int x; - int y; - }; - - #pragma db value - struct comp - { - int x; - std::vector v; - }; - - #pragma db object - struct object - { - #pragma db id - id id_; - - std::vector v; - #pragma db index unique member(v.id) - #pragma db index("object_v_index_index") member(v.index) - - comp c; - #pragma db index("object_c_v_id_index") member(c.v.id) - #pragma db index unique member(c.v.index) - }; -} - -#endif // TEST_HXX diff --git a/common/index/testscript b/common/index/testscript deleted file mode 100644 index cbce341..0000000 --- a/common/index/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/index/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/inheritance/polymorphism/.gitignore b/common/inheritance/polymorphism/.gitignore deleted file mode 100644 index f183a6f..0000000 --- a/common/inheritance/polymorphism/.gitignore +++ /dev/null @@ -1,76 +0,0 @@ -# ODB-generated files. -# -test1-odb.?xx -test1-odb-*.?xx -test1.sql -test1-*.sql - -test2-odb.?xx -test2-odb-*.?xx -test2.sql -test2-*.sql - -test3-odb.?xx -test3-odb-*.?xx -test3.sql -test3-*.sql - -test4-odb.?xx -test4-odb-*.?xx -test4.sql -test4-*.sql - -test5-odb.?xx -test5-odb-*.?xx -test5.sql -test5-*.sql - -test6-odb.?xx -test6-odb-*.?xx -test6.sql -test6-*.sql - -test7-odb.?xx -test7-odb-*.?xx -test7.sql -test7-*.sql - -test8-odb.?xx -test8-odb-*.?xx -test8.sql -test8-*.sql - -test9-odb.?xx -test9-odb-*.?xx -test9.sql -test9-*.sql - -test10-odb.?xx -test10-odb-*.?xx -test10.sql -test10-*.sql - -test11-odb.?xx -test11-odb-*.?xx -test11.sql -test11-*.sql - -test12-odb.?xx -test12-odb-*.?xx -test12.sql -test12-*.sql - -test13-odb.?xx -test13-odb-*.?xx -test13.sql -test13-*.sql - -test14-odb.?xx -test14-odb-*.?xx -test14.sql -test14-*.sql - -test15-odb.?xx -test15-odb-*.?xx -test15.sql -test15-*.sql diff --git a/common/inheritance/polymorphism/buildfile b/common/inheritance/polymorphism/buildfile deleted file mode 100644 index 846eb12..0000000 --- a/common/inheritance/polymorphism/buildfile +++ /dev/null @@ -1,52 +0,0 @@ -# file : common/inheritance/polymorphism/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \ - test12 test13 test14 test15 - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix inhrt_p_ \ - --generate-schema \ - --generate-query \ - --generate-prepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc - -testscript@./: schemas = $hs diff --git a/common/inheritance/polymorphism/driver.cxx b/common/inheritance/polymorphism/driver.cxx deleted file mode 100644 index 12f4666..0000000 --- a/common/inheritance/polymorphism/driver.cxx +++ /dev/null @@ -1,2093 +0,0 @@ -// file : common/inheritance/polymorphism/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test polymorphic object inheritance. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test1.hxx" -#include "test2.hxx" -#include "test3.hxx" -#include "test4.hxx" -#include "test5.hxx" -#include "test6.hxx" -#include "test7.hxx" -#include "test8.hxx" -#include "test9.hxx" -#include "test10.hxx" -#include "test11.hxx" -#include "test12.hxx" -#include "test13.hxx" -#include "test14.hxx" -#include "test15.hxx" - -#include "test1-odb.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" -#include "test4-odb.hxx" -#include "test5-odb.hxx" -#include "test6-odb.hxx" -#include "test7-odb.hxx" -#include "test8-odb.hxx" -#include "test9-odb.hxx" -#include "test10-odb.hxx" -#include "test11-odb.hxx" -#include "test12-odb.hxx" -#include "test13-odb.hxx" -#include "test14-odb.hxx" -#include "test15-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -const char* events[] = -{ - "pre_persist", - "post_persist", - "pre_load", - "post_load", - "pre_update", - "post_update", - "pre_erase", - "post_erase" -}; - -namespace test6 -{ - void base:: - db_callback (callback_event e, database&) - { - cout << "base " << events[e] << " " << id << endl; - } - - void base:: - db_callback (callback_event e, database&) const - { - cout << "base " << events[e] << " " << id << " const" << endl; - } - - void derived:: - db_callback (callback_event e, database&) const - { - cout << "derived " << events[e] << " " << id << " const" << endl; - } -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test 1: basic polymorphism functionality. - // - { - using namespace test1; - - root r (1, 1); - base b (2, 2, "bbb"); - derived d (3, 3, "ddd"); - - r.strs.push_back ("a"); - r.strs.push_back ("aa"); - r.strs.push_back ("aaa"); - - b.nums.push_back (21); - b.nums.push_back (22); - b.nums.push_back (23); - b.strs.push_back ("b"); - b.strs.push_back ("bb"); - b.strs.push_back ("bbb"); - - d.nums.push_back (31); - d.nums.push_back (32); - d.nums.push_back (33); - d.strs.push_back ("d"); - d.strs.push_back ("dd"); - d.strs.push_back ("ddd"); - - { - transaction t (db->begin ()); - - // Static persist. - // - db->persist (r); - db->persist (b); - - // Dynamic persist. - // - root& r (d); - db->persist (r); - - t.commit (); - } - - // Static load. - // - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pr == r); - assert (*pb == b); - assert (*pd == d); - } - - // Dynamic load. - // - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd1 (db->load (d.id)); - unique_ptr pd2 (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd1 == d); - assert (*pd2 == d); - } - - // Invalid load. - // - { - transaction t (db->begin ()); - - try - { - unique_ptr p (db->load (r.id)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - unique_ptr p (db->load (b.id)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Static load into existing instance. - // - { - transaction t (db->begin ()); - root r1; - db->load (r.id, r1); - base b1; - db->load (b.id, b1); - derived d1; - db->load (d.id, d1); - t.commit (); - - assert (r1 == r); - assert (b1 == b); - assert (d1 == d); - } - - // Dynamic load into existing instance. - // - { - transaction t (db->begin ()); - base b1; - db->load (b.id, static_cast (b1)); - derived d1; - db->load (d.id, static_cast (d1)); - t.commit (); - - assert (b1 == b); - assert (d1 == d); - } - - // Invalid load into existing instance. - // - { - transaction t (db->begin ()); - - try - { - base b; - db->load (r.id, static_cast (b)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - derived d; - db->load (b.id, static_cast (d)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Slicing load. - // - { - transaction t (db->begin ()); - root b1; - db->load (b.id, b1); - base d1; - db->load (d.id, d1); - t.commit (); - - assert (b1 == static_cast (b)); - assert (d1 == static_cast (d)); - } - - // Static reload. - // - { - transaction t (db->begin ()); - root r1; - r1.id = r.id; - db->reload (r1); - base b1; - b1.id = b.id; - db->reload (b1); - derived d1; - d1.id = d.id; - db->reload (d1); - t.commit (); - - assert (r1 == r); - assert (b1 == b); - assert (d1 == d); - } - - // Dynamic reload. - // - { - transaction t (db->begin ()); - base b1; - b1.id = b.id; - db->reload (static_cast (b1)); - derived d1; - d1.id = d.id; - db->reload (static_cast (d1)); - t.commit (); - - assert (b1 == b); - assert (d1 == d); - } - - // Invalid reload. - // - { - transaction t (db->begin ()); - - try - { - base b; - b.id = r.id; - db->reload (static_cast (b)); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - derived d; - d.id = b.id; - db->reload (static_cast (d)); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Slicing reload. - // - { - transaction t (db->begin ()); - root b1; - b1.id = b.id; - db->reload (b1); - base d1; - d1.id = d.id; - db->reload (d1); - t.commit (); - - assert (b1 == static_cast (b)); - assert (d1 == static_cast (d)); - } - - // Query. - // - { - typedef odb::query root_query; - typedef odb::result root_result; - - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // Test loading via root. - // - { - root_result qr (db->query ("ORDER BY" + root_query::id)); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == r); - assert (++i != e && *i == b); - assert (++i != e && *i == d); - assert (++i == e); - } - - // Test loading via base. - // - { - base_result qr (db->query ("ORDER BY" + base_query::id)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == b); - assert (++i != e && *i == d); - assert (++i == e); - } - - // Test loading via derived. - // - { - derived_result qr (db->query ()); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - // Test loading into an existing instance. - // - { - root_result qr (db->query ()); - - unsigned short mask (0); - - for (root_result::iterator i (qr.begin ()); i != qr.end (); ++i) - { - string ds (i.discriminator ()); - - if (ds == "test1::root") - { - root r1; - i.load (r1); - assert (r1 == r); - mask |= 1; - } - else if (ds == "test1::base") - { - base b1; - i.load (b1); - assert (b1 == b); - mask |= 2; - } - else if (ds == "test1::derived") - { - derived d1; - i.load (d1); - assert (d1 == d); - mask |= 4; - } - else - assert (false); - } - - assert (mask == 7); - } - - // Test query conditions with columns from multiple tables. - // - { - base_result qr ( - db->query ( - base_query::num == 3 && base_query::str == "ddd")); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - // Test discriminator access. - // - { - base_result qr (db->query (base_query::id == 3)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i.discriminator () == "test1::derived"); - assert (++i == e); - } - - // Test loading of an object from the same hierarchy during - // query result iteration (tests image copying via change - // callbacks in some databases). - // - { - base_result qr (db->query ()); - - unsigned short mask (0); - - for (base_result::iterator i (qr.begin ()); i != qr.end (); ++i) - { - string ds (i.discriminator ()); - - if (ds == "test1::base") - { - unique_ptr d1 (db->load (d.id)); - assert (*d1 == d); - assert (*i == b); - mask |= 1; - } - else if (ds == "test1::derived") - { - unique_ptr b1 (db->load (b.id)); - assert (*b1 == b); - assert (*i == d); - mask |= 2; - } - } - - assert (mask == 3); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::query root_query; - typedef odb::result root_result; - - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // root - // - { - root_result qr (db->query ("ORDER BY" + root_query::id)); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->typeid_ == "test1::root" && i->num == r.num); - assert (++i != e && i->typeid_ == "test1::base" && i->num == b.num); - assert (++i != e && i->typeid_ == "test1::derived" && i->num == d.num); - assert (++i == e); - } - - // base - // - { - base_result qr (db->query ("ORDER BY" + base_query::id)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->id == b.id && i->num == b.num && i->str == b.str); - assert (++i != e && - i->id == d.id && i->num == d.num && i->str == d.str); - assert (++i == e); - } - - // derived - // - { - derived_result qr (db->query ()); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->num == d.num && i->str == d.str && - i->dnum == d.dnum && i->dstr == d.dstr); - assert (++i == e); - } - - t.commit (); - } - - // Update. - // - r.num++; - r.strs.push_back ("aaaa"); - - b.num++; - b.str += "b"; - b.nums.push_back (24); - b.strs.push_back ("bbbb"); - - d.num++; - d.str += "d"; - d.dnum++; - d.dstr += "d"; - d.nums.push_back (34); - d.strs.push_back ("dddd"); - - { - transaction t (db->begin ()); - - // Static update. - // - db->update (r); - db->update (b); - - // Dynamic update. - // - root& r (d); - db->update (r); - - t.commit (); - } - - // Verify update. - // - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pr == r); - assert (*pb == b); - assert (*pd == d); - } - - // Invalid erase via id. - // - { - transaction t (db->begin ()); - - try - { - db->erase (r.id); - assert (false); - } - catch (const object_not_persistent&) {} - - try - { - db->erase (b.id); - assert (false); - } - catch (const object_not_persistent&) {} - - t.commit (); - } - - // Static erase via id. - // - { - transaction t (db->begin ()); - db->erase (r.id); - db->erase (b.id); - t.commit (); - } - - // Dynamic erase via id. - // - { - transaction t (db->begin ()); - db->erase (d.id); - t.commit (); - } - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Static erase via object. - // - { - transaction t (db->begin ()); - db->erase (r); - db->erase (b); - t.commit (); - } - - // Dynamic erase via object. - // - { - const root& r (d); - transaction t (db->begin ()); - db->erase (r); - t.commit (); - } - } - - // Test 2: inverse object pointers in polymorhic bases. - // - { - using namespace test2; - - derived d (1, "d", 1); - root_pointer rp (&d); - base_pointer bp (&d); - - { - transaction t (db->begin ()); - db->persist (rp); - db->persist (bp); - - d.rp.reset (*db, &rp); - d.bp.reset (*db, &bp); - - db->persist (d); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - unique_ptr pb (db->load (d.id)); - unique_ptr pr (db->load (d.id)); - t.commit (); - - assert (pd->rp.object_id () == rp.id && - pd->bp.object_id () == bp.id); - - derived* p (dynamic_cast (pb.get ())); - assert (p != 0 && - p->rp.object_id () == rp.id && - p->bp.object_id () == bp.id); - - p = dynamic_cast (pr.get ()); - assert (p != 0 && - p->rp.object_id () == rp.id && - p->bp.object_id () == bp.id); - } - - // Query. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - transaction t (db->begin ()); - - // Test query conditions with columns in pointed-to objects from - // multiple tables. - // - { - base_result qr ( - db->query ( - base_query::rp->id == rp.id && - base_query::bp->id == bp.id)); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i.discriminator () == "test2::derived"); - assert (++i == e); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::result root_result; - typedef odb::result base_result; - - transaction t (db->begin ()); - - // root - // - { - root_result qr (db->query ()); - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->rp_id == rp.id && i->r_id == d.id); - assert (++i == e); - } - - // base - // - { - base_result qr (db->query ()); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->bp_id == bp.id && i->b_id == d.id && i->str == d.str); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 3: delayed loading. - // - { - using namespace test3; - - base b1 (21, 21); - base b2 (22, 22); - base b3 (23, 23); - - derived d1 (31, 31, "d"); - derived d2 (32, 32, "dd"); - derived d3 (33, 33, "ddd"); - - b1.rptr = new root (1); - b2.rptr = new base (2, 2); - b3.rptr = new derived (3, 3, "b3"); - - d1.rptr = new root (4); - d2.rptr = new base (5, 5); - d3.rptr = new derived (6, 6, "d3"); - - d2.bptr = new base (7, 7); - d3.bptr = new derived (8, 8, "d3b"); - - { - transaction t (db->begin ()); - db->persist (b1); - db->persist (b2); - db->persist (b3); - - db->persist (d1); - db->persist (d2); - db->persist (d3); - - db->persist (b1.rptr); - db->persist (b2.rptr); - db->persist (b3.rptr); - - db->persist (d1.rptr); - db->persist (d2.rptr); - db->persist (d3.rptr); - - db->persist (d2.bptr); - db->persist (d3.bptr); - - t.commit (); - } - - { - transaction t (db->begin ()); - - { - unique_ptr p1 (db->load (b1.id)); - unique_ptr p2 (db->load (b2.id)); - unique_ptr p3 (db->load (b3.id)); - assert (*p1 == b1); - assert (*p2 == b2); - assert (*p3 == b3); - } - - { - unique_ptr p1 (db->load (d1.id)); - unique_ptr p2 (db->load (d2.id)); - unique_ptr p3 (db->load (d3.id)); - assert (*p1 == d1); - assert (*p2 == d2); - assert (*p3 == d3); - } - - t.commit (); - } - - // Query. - // - { - typedef odb::query derived_query; - typedef odb::result derived_result; - - transaction t (db->begin ()); - - // Test query conditions with columns in pointed-to objects from - // multiple tables. - // - { - derived_result qr ( - db->query ( - derived_query::rptr->id == 6 && - derived_query::bptr->id == 8 && - derived_query::bptr->num == 8)); - - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d3); - assert (++i == e); - } - - t.commit (); - } - - // Views. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::query derived_query; - typedef odb::result derived_result; - - typedef odb::query root_query; - typedef odb::result root_result; - - transaction t (db->begin ()); - - // base - // - { - base_result qr ( - db->query ( - base_query::base::num == b2.num && - base_query::base::id == b2.id && - base_query::r::id == b2.rptr->id)); - - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->b_id == b2.id && - i->r_id == b2.rptr->id && - i->num == b2.num); - assert (++i == e); - } - - // derived - // - { - derived_result qr ( - db->query ( - derived_query::d::str == d3.str && - derived_query::d::num == d3.num && - derived_query::b::num == d3.bptr->num && - derived_query::d::id == d3.id && - derived_query::b::id == d3.bptr->id && - derived_query::r::id == d3.rptr->id)); - - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->d_id == d3.id && - i->b_id == d3.bptr->id && - i->r_id == d3.rptr->id && - i->d_num == d3.num && - i->b_num == d3.bptr->num && - i->str == d3.str); - assert (++i == e); - } - - // root - // - { - root_result qr ( - db->query ( - root_query::r::id.in (b2.rptr->id, d2.rptr->id))); - - root_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && - i->r_id == d2.rptr->id && - i->d_id == d2.id && - i->str == d2.str); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 4: views. - // - { - using namespace test4; - - base1 b1 (21, 1); - - root2 r2 (11, 0); - base2 b2 (21, 1, "abc"); - - { - transaction t (db->begin ()); - db->persist (b1); - db->persist (r2); - db->persist (b2); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result qr ( - db->query ( - query::base1::num == b1.num)); - - result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->str == "abc"); - assert (++i == e); - } - - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - - { - result qr (db->query ()); - result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->min_num == 1); - assert (++i == e); - } - - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - - { - result qr (db->query ()); - result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && i->str == "abc"); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 5: polymorphism and optimistic concurrency. - // - { - using namespace test5; - - root r (1, 1); - base b (2, 2, "bbb"); - derived d (3, 3, "ddd"); - - r.strs.push_back ("a"); - r.strs.push_back ("aa"); - r.strs.push_back ("aaa"); - - b.nums.push_back (21); - b.nums.push_back (22); - b.nums.push_back (23); - b.strs.push_back ("b"); - b.strs.push_back ("bb"); - b.strs.push_back ("bbb"); - - d.nums.push_back (31); - d.nums.push_back (32); - d.nums.push_back (33); - d.strs.push_back ("d"); - d.strs.push_back ("dd"); - d.strs.push_back ("ddd"); - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Update. - // - { - transaction t (db->begin ()); - - // Root. - // - { - unique_ptr p (db->load (r.id)); - - r.num++; - r.strs.push_back ("aaaa"); - db->update (r); - - p->num--; - p->strs.pop_back (); - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (r == *p); - } - - // Base. - // - { - unique_ptr p (db->load (b.id)); - - b.num++; - b.str += "b"; - b.strs.push_back ("bbbb"); - b.nums.push_back (24); - db->update (b); - - p->num--; - p->str += "B"; - p->strs.pop_back (); - p->nums.pop_back (); - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (b == *p); - } - - // Derived. - // - { - unique_ptr p (db->load (d.id)); // Via root. - - d.num++; - d.str += "d"; - d.strs.push_back ("dddd"); - d.nums.push_back (24); - d.dnum++; - d.dstr += "d"; - db->update (d); - - derived& d1 (static_cast (*p)); - d1.num--; - d1.str += "D"; - d1.strs.pop_back (); - d1.nums.pop_back (); - d1.dnum--; - d1.dstr += "D"; - try - { - db->update (p); - assert (false); - } - catch (const odb::object_changed&) {} - - // Make sure the object is intact. - // - db->reload (p); - assert (d == *p); - } - - t.commit (); - } - - // Reload. - // - { - transaction t (db->begin ()); - - // Make sure reload doesn't modify the object if the versions - // match. - // - derived d1 (d); - d1.num++; - d1.str += "d"; - d1.strs.push_back ("dddd"); - d1.nums.push_back (24); - d1.dnum++; - d1.dstr += "d"; - derived d2 (d1); - - db->reload (d1); - assert (d1 == d2); - - t.commit (); - } - - // Erase. - // - { - transaction t (db->begin ()); - - // Root. - // - { - unique_ptr p (db->load (r.id)); - - r.num++; - r.strs.push_back ("aaaaa"); - db->update (r); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Base. - // - { - unique_ptr p (db->load (b.id)); - - b.num++; - b.str += "b"; - b.strs.push_back ("bbbb"); - b.nums.push_back (24); - db->update (b); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Derived. - // - { - unique_ptr p (db->load (d.id)); // Via root. - - d.num++; - d.str += "d"; - d.strs.push_back ("dddd"); - d.nums.push_back (24); - d.dnum++; - d.dstr += "d"; - db->update (d); - - try - { - db->erase (p); - assert (false); - } - catch (const odb::object_changed&) {} - - db->reload (p); - db->erase (p); - } - - // Try to update non-existent object. - // - { - try - { - db->update (d); - assert (false); - } - catch (const odb::object_changed&) {} - } - - // Try to erase non-existent object. - // - { - try - { - db->erase (d); - assert (false); - } - catch (const odb::object_changed&) {} - } - - t.commit (); - } - } - - // Test 6: polymorphism and callbacks. - // - { - using namespace test6; - - base b (1, 1, "bbb"); - - unique_ptr d (new derived (2, 2, "ddd")); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d->id)); - - db->load (b.id, *pb); - db->load (d->id, *pd); - - db->reload (*pb); - db->reload (*pd); - - t.commit (); - } - - // Update. - // - { - b.num++; - d->num++; - - transaction t (db->begin ()); - db->update (b); - db->update (d); - t.commit (); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ("ORDER BY" + query::id)); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - *i; - - t.commit (); - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (b); - db->erase (d); - t.commit (); - } - - // Recursive (delayed) loading. - // - { - derived d (3, 3, "dddd"); - d.ptr.reset (new derived (4, 4, "ddddd")); - - { - transaction t (db->begin ()); - db->persist (d); - db->persist (d.ptr); - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr p (db->load (d.id)); - t.commit (); - } - } - } - - // Test 7: polymorphism and object cache (session). - // - { - using namespace test7; - - shared_ptr r (new root (1, 1)); - shared_ptr b (new base (2, 2, "b")); - shared_ptr d (new derived (3, 3, "d")); - - // Persist. - // - { - session s; - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - assert (db->load (r->id) == r); - assert (db->load (b->id) == b); - assert (db->load (d->id) == d); - } - - // Load. - // - { - session s; - - transaction t (db->begin ()); - shared_ptr r1 (db->load (r->id)); - shared_ptr b1 (db->load (b->id)); - shared_ptr d1 (db->load (d->id)); - t.commit (); - - assert (db->load (r->id) == r1); - assert (db->load (b->id) == b1); - assert (db->load (d->id) == d1); - - assert (!db->find (b->id)); - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - session s; - - transaction t (db->begin ()); - shared_ptr r1 (db->load (r->id)); - shared_ptr b1 (db->load (b->id)); - shared_ptr d1 (db->load (d->id)); - t.commit (); - - { - transaction t (db->begin ()); - - result r (db->query ("ORDER BY" + query::id)); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && i.load () == r1); - assert (++i != e && i.load () == b1); - assert (++i != e && i.load () == d1); - assert (++i == e); - - t.commit (); - } - } - - // Erase. - // - { - session s; - - { - transaction t (db->begin ()); - db->load (r->id); - db->load (b->id); - db->load (d->id); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (r); - db->erase (b); - db->erase (d); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (!db->find (r->id)); - assert (!db->find (b->id)); - assert (!db->find (d->id)); - t.commit (); - } - } - } - - // Test 8: polymorphism and abstract bases. - // - { - using namespace test8; - - base b (1, 1, "b"); - interm i (2, 2, "i", true); - derived1 d1 (3, 3, "d1", true); - derived2 d2 (4, 4, "d2", false); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d1)); - db->persist (static_cast (d2)); - - try - { - db->persist (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->persist (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - // Load. - // - { - base vb; - interm vi; - derived1 vd1; - derived2 vd2; - - transaction t (db->begin ()); - - // load (id) - // - unique_ptr pb (db->load (b.id)); - unique_ptr pd1 (db->load (d1.id)); - unique_ptr pd2 (db->load (d2.id)); - - assert (*pb == b); - assert (*pd1 == d1); - assert (*pd2 == d2); - - // load (id, obj) - // - db->load (b.id, static_cast (vb)); - db->load (d1.id, static_cast (vd1)); - db->load (d2.id, static_cast (vd2)); - - assert (vb == b); - assert (vd1 == d1); - assert (vd2 == d2); - - try - { - db->load (i.id, static_cast (vi)); - assert (false); - } - catch (const odb::no_type_info&) {} - - // reload (obj) - // - vb.num = 0; - vd1.num = 0; - vd2.num = 0; - - db->reload (static_cast (vb)); - db->reload (static_cast (vd1)); - db->reload (static_cast (vd2)); - - assert (vb == b); - assert (vd1 == d1); - assert (vd2 == d2); - - try - { - db->reload (static_cast (vi)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - // Update. - // - { - b.num++; - b.str += 'b'; - d1.num++; - d1.str += "d1"; - d2.num++; - d2.str += "d1"; - - { - transaction t (db->begin ()); - db->update (static_cast (b)); - db->update (d1); - db->update (static_cast (d2)); - - try - { - db->update (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->update (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd1 (db->load (d1.id)); - unique_ptr pd2 (db->load (d2.id)); - - t.commit (); - - assert (*pb == b); - assert (*pd1 == d1); - assert (*pd2 == d2); - } - } - - // Erase. - // - { - transaction t (db->begin ()); - db->erase (b); - db->erase (d1.id); - db->erase (static_cast (d2)); - - try - { - db->erase (i); - assert (false); - } - catch (const odb::abstract_class&) {} - - try - { - db->erase (static_cast (i)); - assert (false); - } - catch (const odb::no_type_info&) {} - - t.commit (); - } - } - - // Test 9: polymorphism and readonly classes. - // - { - using namespace test9; - - ro_root ro_r (1, 1); - rw_base rw_b (2, 2, "b"); - ro_derived ro_d (3, 3, "d"); - - rw_root rw_r (1, 1); - ro_base ro_b (2, 2, "b"); - rw_derived rw_d (3, 3, "d"); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (ro_r); - db->persist (rw_b); - db->persist (ro_d); - - db->persist (rw_r); - db->persist (ro_b); - db->persist (rw_d); - t.commit (); - } - - // Update. - // - { - ro_root ro_r1 (ro_r); - rw_base rw_b1 (rw_b); - ro_derived ro_d1 (ro_d); - - ro_base ro_b1 (ro_b); - rw_derived rw_d1 (rw_d); - - ro_r1.num++; - ro_r1.strs.push_back ("b"); - - rw_b1.num++; - rw_b1.strs.push_back ("b"); - rw_b1.str += "b"; - rw_b1.nums.push_back (2); - rw_b.str += "b"; - rw_b.nums.push_back (2); - - ro_d1.num++; - ro_d1.strs.push_back ("d"); - ro_d1.str += "d"; - ro_d1.nums.push_back (3); - ro_d1.dnum++; - ro_d1.dstr += "d"; - - rw_r.num++; - rw_r.strs.push_back ("b"); - - ro_b1.num++; - ro_b1.strs.push_back ("b"); - ro_b1.str += "b"; - ro_b1.nums.push_back (2); - - rw_d1.num++; - rw_d1.strs.push_back ("d"); - rw_d1.str += "d"; - rw_d1.nums.push_back (3); - rw_d1.dnum++; - rw_d1.dstr += "d"; - rw_d.dnum++; - rw_d.dstr += "d"; - - { - // These should be no-ops. - // - db->update (ro_r1); - db->update (static_cast (ro_d1)); - db->update (ro_b1); - - transaction t (db->begin ()); - db->update (static_cast (rw_b1)); - db->update (rw_r); - db->update (static_cast (rw_d1)); - t.commit (); - } - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr p_ro_r (db->load (ro_r.id)); - unique_ptr p_rw_b (db->load (rw_b.id)); - unique_ptr p_ro_d (db->load (ro_d.id)); - - unique_ptr p_rw_r (db->load (rw_r.id)); - unique_ptr p_ro_b (db->load (ro_b.id)); - unique_ptr p_rw_d (db->load (rw_d.id)); - - t.commit (); - - assert (*p_ro_r == ro_r); - assert (*p_rw_b == rw_b); - assert (*p_ro_d == ro_d); - - assert (*p_rw_r == rw_r); - assert (*p_ro_b == ro_b); - assert (*p_rw_d == rw_d); - } - } - - // Test 10: empty polymorphic classes. - // - { - using namespace test10; - - base b (1, 1); - derived d (2, 2); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Update. - // - { - b.num++; - d.num++; - - transaction t (db->begin ()); - db->update (static_cast (b)); - db->update (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - } - - // Test 11: reuse and polymorphic inheritance. - // - { - using namespace test11; - - base b (1, 1, "b"); - derived d (2, 2, "d"); - - b.strs.push_back ("b"); - b.nums.push_back (1); - - d.strs.push_back ("d"); - d.nums.push_back (1); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Update. - // - { - b.num++; - b.str += "b"; - b.strs.push_back ("bb"); - b.nums.push_back (2); - - d.num++; - d.str += "d"; - d.strs.push_back ("dd"); - d.nums.push_back (2); - d.dnum++; - d.dstr += "d"; - - transaction t (db->begin ()); - db->update (b); - db->update (d); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - - // Query. - // - { - typedef odb::query base_query; - typedef odb::result base_result; - - typedef odb::query derived_query; - typedef odb::result derived_result; - - transaction t (db->begin ()); - - { - base_result qr (db->query (base_query::num == 2)); - base_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == b); - assert (++i == e); - } - - { - derived_result qr (db->query (derived_query::num == 3)); - derived_result::iterator i (qr.begin ()), e (qr.end ()); - - assert (i != e && *i == d); - assert (++i == e); - } - - t.commit (); - } - } - - // Test 12: polymorphic objects with auto id. - // - { - using namespace test12; - - base b (1); - derived d (2); - - unsigned long id1, id2; - - // Persist. - // - { - transaction t (db->begin ()); - id1 = db->persist (b); - id2 = db->persist (static_cast (d)); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (id1)); - unique_ptr pd (db->load (id2)); - - t.commit (); - - assert (*pb == b); - assert (*pd == d); - } - } - - // Test 13: polymorphic derived without any non-container data members - // (which results in an empty SELECT statement). - // - { - using namespace test13; - - base b; - b.nums.push_back (123); - derived d; - d.nums.push_back (123); - d.strs.push_back ("abc"); - - base1 b1; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - db->persist (b1); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pbr (db->load (b.id)); - unique_ptr pdr (db->load (d.id)); - unique_ptr pdb (db->load (d.id)); - unique_ptr pb1r (db->load (b1.id)); - t.commit (); - - base& rb (static_cast (*pbr)); - derived& rd1 (static_cast (*pdr)); - derived& rd2 (static_cast (*pdb)); - base1 rb1 (static_cast (*pb1r)); - - assert (rb.id == b.id && rb.nums == b.nums); - assert (rd1.id == d.id && rd1.nums == rd1.nums && - rd1.strs == rd1.strs); - assert (rd2.id == d.id && rd2.nums == rd2.nums && - rd2.strs == rd2.strs); - assert (rb1.id == b1.id); - } - } - - // Test 14: inverse pointer in polymorphic base. - // - { - using namespace test14; - - derived d; - d.num = 123; - - d.o1 = new object1; - d.o2 = new object2; - d.o3.push_back (new object3); - d.o4.push_back (new object4); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (d.o1); - db->persist (d.o2); - db->persist (d.o3[0]); - db->persist (d.o4[0]); - db->persist (d); - t.commit (); - } - - // Load. - // - { - session s; - - transaction t (db->begin ()); - object1* p1 (db->load (d.o1->id)); - object2* p2 (db->load (d.o2->id)); - object3* p3 (db->load (d.o3[0]->id)); - object4* p4 (db->load (d.o4[0]->id)); - t.commit (); - - assert (p1->d->num == d.num); - assert (p2->d[0]->num == d.num); - assert (p3->d[0]->num == d.num); - assert (p4->d->num == d.num); - delete p1->d; - } - - // Query. - // - { - typedef odb::query query; - typedef odb::result result; - - session s; - transaction t (db->begin ()); - - result r (db->query (query::d->num == d.num)); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && i->d->num == d.num); - delete i.load ()->d; - assert (++i == e); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - session s; - transaction t (db->begin ()); - - result r (db->query (query::d->num == d.num)); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && i->d->num == d.num); - delete i.load ()->d; - assert (++i == e); - t.commit (); - } - } - - // Test 15: LOB/long data and polymorphism. - // - { - using namespace test15; - - const char data[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B"; - - derived d; - d.blob.assign (data, data + sizeof (data)); - - // Persist. - // - { - transaction t (db->begin ()); - base* b (&d); - db->persist (b); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - - unique_ptr pb (db->load (d.id)); - t.commit (); - - derived* pd (dynamic_cast (pb.get ())); - assert (pd != 0 && pd->blob == d.blob); - } - - // Query. - // - { - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ()); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e); - - derived* pd (dynamic_cast (&*i)); - assert (pd != 0 && pd->blob == d.blob); - - assert (++i == e); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/inheritance/polymorphism/test1.hxx b/common/inheritance/polymorphism/test1.hxx deleted file mode 100644 index 7f598de..0000000 --- a/common/inheritance/polymorphism/test1.hxx +++ /dev/null @@ -1,115 +0,0 @@ -// file : common/inheritance/polymorphism/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#include -#include -#include - -#include - -// Test basic polymorphism functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id column("object_id") - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // Views. - // - #pragma db view object(root) - struct root_view - { - //#pragma db column(root::typeid_) - std::string typeid_; // @@ tmp - - unsigned long num; - }; - - #pragma db view object(base = b) - struct base_view - { - unsigned long id; - unsigned long num; - std::string str; - }; - - #pragma db view object(derived) - struct derived_view - { - unsigned long num; - std::string str; - unsigned long dnum; - std::string dstr; - }; -} - -#endif // TEST1_HXX diff --git a/common/inheritance/polymorphism/test10.hxx b/common/inheritance/polymorphism/test10.hxx deleted file mode 100644 index 63673a1..0000000 --- a/common/inheritance/polymorphism/test10.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : common/inheritance/polymorphism/test10.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST10_HXX -#define TEST10_HXX - -#include - -#include - -// Test empty polymorphic classes. -// -#pragma db namespace table("t10_") -namespace test10 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n): root (i), num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n): base (i, n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -#endif // TEST10_HXX diff --git a/common/inheritance/polymorphism/test11.hxx b/common/inheritance/polymorphism/test11.hxx deleted file mode 100644 index 2d38a6c..0000000 --- a/common/inheritance/polymorphism/test11.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : common/inheritance/polymorphism/test11.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST11_HXX -#define TEST11_HXX - -#include -#include -#include - -#include - -// Test mixing reuse and polymorphic inheritance. -// -#pragma db namespace table("t11_") -namespace test11 -{ - #pragma db object abstract - struct root - { - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - }; - - #pragma db object polymorphic - struct base: root - { - virtual ~base () {} - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (base)) - return false; - - return id == b.id && num == b.num && strs == b.strs && - str == b.str && nums == b.nums; - } - }; - - inline bool - operator== (const base& x, const base& y) {return x.compare (y);} - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const base& b, bool tc = true) const - { - if (tc && typeid (b) != typeid (derived)) - return false; - - const derived& d (static_cast (b)); - return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST11_HXX diff --git a/common/inheritance/polymorphism/test12.hxx b/common/inheritance/polymorphism/test12.hxx deleted file mode 100644 index 85000ac..0000000 --- a/common/inheritance/polymorphism/test12.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// file : common/inheritance/polymorphism/test12.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST12_HXX -#define TEST12_HXX - -#include - -#include - -// Test polymorphic classes with private auto id. -// -#pragma db namespace table("t12_") -namespace test12 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id_ == r.id_; - } - - unsigned long id () const {return id_;} - void id (unsigned long id) {id_ = id;} - private: - #pragma db id auto access(id) - unsigned long id_; - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long n): num (n) {} - - unsigned long num; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && num == b.num; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long n): base (n) {} - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - return base::compare (r, false); - } - }; -} - -#endif // TEST12_HXX diff --git a/common/inheritance/polymorphism/test13.hxx b/common/inheritance/polymorphism/test13.hxx deleted file mode 100644 index 3240a9a..0000000 --- a/common/inheritance/polymorphism/test13.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : common/inheritance/polymorphism/test13.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST13_HXX -#define TEST13_HXX - -#include -#include - -#include - -// Test polymorphic derived without any non-container data members (which -// results in an empty SELECT statement). -// -#pragma db namespace table("t13_") -namespace test13 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - - #pragma db id auto - unsigned long id; - }; - - #pragma db object - struct base: root - { - std::vector nums; - }; - - #pragma db object - struct derived: base - { - std::vector strs; - }; - - #pragma db object - struct base1: root - { - // Nothing. - }; -} - -#endif // TEST13_HXX diff --git a/common/inheritance/polymorphism/test14.hxx b/common/inheritance/polymorphism/test14.hxx deleted file mode 100644 index 1050861..0000000 --- a/common/inheritance/polymorphism/test14.hxx +++ /dev/null @@ -1,99 +0,0 @@ -// file : common/inheritance/polymorphism/test14.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST14_HXX -#define TEST14_HXX - -#include - -#include - -// Test inverse pointer in polymorphic base. -// -#pragma db namespace table("t14_") -namespace test14 -{ - struct object1; - struct object2; - struct object3; - struct object4; - - #pragma db object polymorphic session - struct base - { - virtual ~base (); - - #pragma db id auto - unsigned long id; - - object1* o1; - object2* o2; - std::vector o3; - std::vector o4; - }; - - #pragma db object - struct derived: base - { - unsigned long num; - }; - - // one-to-one(i) - // - #pragma db object session - struct object1 - { - #pragma db id auto - unsigned long id; - - #pragma db inverse(o1) - derived* d; - }; - - // one-to-many(i) - // - #pragma db object session - struct object2 - { - #pragma db id auto - unsigned long id; - - #pragma db inverse(o2) - std::vector d; - }; - - // many-to-many(i) - // - #pragma db object session - struct object3 - { - #pragma db id auto - unsigned long id; - - #pragma db inverse(o3) - std::vector d; - }; - - // many-to-one(i) - // - #pragma db object session - struct object4 - { - #pragma db id auto - unsigned long id; - - #pragma db inverse(o4) - derived* d; - }; - - inline base:: - ~base () - { - delete o1; - delete o2; - delete o3[0]; - delete o4[0]; - } -} - -#endif // TEST14_HXX diff --git a/common/inheritance/polymorphism/test15.hxx b/common/inheritance/polymorphism/test15.hxx deleted file mode 100644 index 5799ace..0000000 --- a/common/inheritance/polymorphism/test15.hxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : common/inheritance/polymorphism/test15.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST15_HXX -#define TEST15_HXX - -#include - -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -# define BLOB_TYPE "VARBINARY(max)" -# else -# define BLOB_TYPE "BLOB" -# endif -#endif - - -// Test LOB/long data and polymorphism. -// -#pragma db namespace table("t15_") -namespace test15 -{ - #pragma db object polymorphic - struct base - { - virtual ~base () {} - - #pragma db id auto - unsigned long id; - }; - - #pragma db object - struct derived: base - { - #pragma db type(BLOB_TYPE) - std::vector blob; - }; -} - -#endif // TEST15_HXX diff --git a/common/inheritance/polymorphism/test2.hxx b/common/inheritance/polymorphism/test2.hxx deleted file mode 100644 index 9890e02..0000000 --- a/common/inheritance/polymorphism/test2.hxx +++ /dev/null @@ -1,105 +0,0 @@ -// file : common/inheritance/polymorphism/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include -#include - -#include -#include - -// Test inverse object pointers in polymorhic bases. -// -#pragma db namespace table("t2_") -namespace test2 -{ - struct root; - - #pragma db object - struct root_pointer - { - root_pointer (root* r = 0): p (r) {} - - #pragma db id auto - unsigned long id; - - root* p; - }; - - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(p) - odb::lazy_ptr rp; - }; - - struct base; - - #pragma db object - struct base_pointer - { - base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} - - #pragma db id auto - unsigned long id; - - std::vector vp; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, const std::string& s): root (i), str (s) {} - - std::string str; - - #pragma db inverse(vp) - odb::lazy_ptr bp; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, const std::string& s, unsigned long n) - : base (i, s), num (n) {} - - unsigned long num; - }; - - // Views. - // - #pragma db view object(root_pointer = rp) object(root) - struct root_view - { - #pragma db column(rp::id) - unsigned long rp_id; - - #pragma db column(root::id) - unsigned long r_id; - }; - - #pragma db view object(base_pointer) object(base = b) - struct base_view - { - #pragma db column(base_pointer::id) - unsigned long bp_id; - - #pragma db column(b::id) - unsigned long b_id; - - std::string str; - }; -} - -#endif // TEST2_HXX diff --git a/common/inheritance/polymorphism/test3.hxx b/common/inheritance/polymorphism/test3.hxx deleted file mode 100644 index fd68f24..0000000 --- a/common/inheritance/polymorphism/test3.hxx +++ /dev/null @@ -1,146 +0,0 @@ -// file : common/inheritance/polymorphism/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#include -#include - -#include - -// Test delayed loading. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - virtual ~base () {delete rptr;} - base (): rptr (0) {} - base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} - - unsigned long num; - root* rptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return - root::compare (r, false) && - num == b.num && - ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); - } - }; - - #pragma db object - struct derived: base - { - virtual ~derived () {delete bptr;} - derived (): bptr (0) {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n), str (s), bptr (0) {} - - std::string str; - base* bptr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return - base::compare (r, false) && - str == d.str && - ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); - } - }; - - // Views. - // - #pragma db view object(base) object(root = r) - struct base_view - { - #pragma db column(base::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - unsigned long num; - }; - - #pragma db view \ - object(derived = d) \ - object(base = b) \ - object(root = r: d::rptr) - struct derived_view - { - #pragma db column(d::id) - unsigned long d_id; - - #pragma db column(b::id) - unsigned long b_id; - - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::num) - unsigned long d_num; - - #pragma db column(b::num) - unsigned long b_num; - - std::string str; - }; - - // This is an example of a pathological case, where the right-hand-side - // of the join condition comes from one of the bases. As a result, we - // join the base table first, which means we will get both bases and - // derived objects instead of just derived. - // - //#pragma db view object(root = r) object(derived = d) - #pragma db view object(derived = d) object(root = r) - struct root_view - { - #pragma db column(r::id) - unsigned long r_id; - - #pragma db column(d::id) - unsigned long d_id; - - std::string str; - }; -} - -#endif // TEST3_HXX diff --git a/common/inheritance/polymorphism/test4.hxx b/common/inheritance/polymorphism/test4.hxx deleted file mode 100644 index 148c53c..0000000 --- a/common/inheritance/polymorphism/test4.hxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : common/inheritance/polymorphism/test4.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST4_HXX -#define TEST4_HXX - -#include - -#include - -// Test views. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object polymorphic - struct root1 - { - virtual ~root1 () {} - root1 () {} - root1 (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - }; - - #pragma db object - struct base1: root1 - { - base1 () {} - base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} - - unsigned long num; - }; - - #pragma db object polymorphic - struct root2 - { - virtual ~root2 () {} - root2 () {} - root2 (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base2: root2 - { - base2 () {} - base2 (unsigned long i, unsigned long n, const std::string& s) - : root2 (i, n), str (s) {} - - std::string str; - }; - - // Test custom join condition. - // - #pragma db view object(base2) object(base1: base2::num == base1::num) - struct view1 - { - std::string str; - }; - - #pragma db view object(base2) - struct view2 - { - #pragma db column("min(" + base2::num + ")") - unsigned long min_num; - }; - - // Test custom join condition that uses object id. It cannot come - // from the base since the base table hasn't been join'ed yet. - // - #pragma db view object(base1) object(base2: base2::id == base1::id) - struct view3 - { - std::string str; - }; -} - -#endif // TEST4_HXX diff --git a/common/inheritance/polymorphism/test5.hxx b/common/inheritance/polymorphism/test5.hxx deleted file mode 100644 index 172e7e8..0000000 --- a/common/inheritance/polymorphism/test5.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// file : common/inheritance/polymorphism/test5.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST5_HXX -#define TEST5_HXX - -#include -#include -#include -#include - -#include - -// Test polymorphism and optimistic concurrency. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object polymorphic optimistic pointer(std::unique_ptr) - struct root - { - virtual ~root () {} - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - #pragma db version - unsigned long version; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && version == r.version && - num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived)) - return false; - - const derived& d (static_cast (r)); - return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST5_HXX diff --git a/common/inheritance/polymorphism/test6.hxx b/common/inheritance/polymorphism/test6.hxx deleted file mode 100644 index b0f9a16..0000000 --- a/common/inheritance/polymorphism/test6.hxx +++ /dev/null @@ -1,64 +0,0 @@ -// file : common/inheritance/polymorphism/test6.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST6_HXX -#define TEST6_HXX - -#include -#include - -#include -#include - -// Test polymorphism and callbacks. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object polymorphic pointer(std::unique_ptr) - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object callback(db_callback) - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - - void - db_callback (odb::callback_event, odb::database&); - - void - db_callback (odb::callback_event, odb::database&) const; - }; - - #pragma db object callback(db_callback) - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - std::unique_ptr ptr; - - void - db_callback (odb::callback_event, odb::database&) const; - }; -} - -#endif // TEST6_HXX diff --git a/common/inheritance/polymorphism/test7.hxx b/common/inheritance/polymorphism/test7.hxx deleted file mode 100644 index 60da98e..0000000 --- a/common/inheritance/polymorphism/test7.hxx +++ /dev/null @@ -1,54 +0,0 @@ -// file : common/inheritance/polymorphism/test7.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST7_HXX -#define TEST7_HXX - -#include -#include - -#include - -// Test polymorphism and object cache (session). -// -#pragma db namespace table("t7_") -namespace test7 -{ - using std::shared_ptr; - - #pragma db object polymorphic pointer(shared_ptr) session - struct root - { - virtual ~root () {} - root (): id (0) {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - }; - - #pragma db object - struct derived: base - { - derived () {} - derived (unsigned long i, unsigned long n, const std::string& s) - : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - }; -} - -#endif // TEST7_HXX diff --git a/common/inheritance/polymorphism/test8.hxx b/common/inheritance/polymorphism/test8.hxx deleted file mode 100644 index 84b6688..0000000 --- a/common/inheritance/polymorphism/test8.hxx +++ /dev/null @@ -1,129 +0,0 @@ -// file : common/inheritance/polymorphism/test8.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST8_HXX -#define TEST8_HXX - -#include -#include -#include - -#include - -// Test polymorphism and abstract bases. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object polymorphic - struct root - { - virtual ~root () = 0; // Auto-abstract. - root () {} - root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline root:: - ~root () {} - - inline bool - operator== (const root& x, const root& y) {return x.compare (y);} - - #pragma db object - struct base: root - { - base () {} - base (unsigned long i, unsigned long n, const std::string& s) - : root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (base)) - return false; - - const base& b (static_cast (r)); - return root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object abstract - struct interm: base - { - interm () {} - interm (unsigned long i, unsigned long n, const std::string& s, bool b) - : base (i, n, s), bln (b) {} - - bool bln; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (interm)) - return false; - - const interm& i (static_cast (r)); - return base::compare (r, false) && bln == i.bln; - } - }; - - #pragma db object - struct derived1: interm - { - derived1 () {} - derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dnum (n + 1) {} - - unsigned long dnum; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived1)) - return false; - - const derived1& d (static_cast (r)); - return interm::compare (r, false) && dnum == d.dnum; - } - }; - - #pragma db object - struct derived2: interm - { - derived2 () {} - derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) - : interm (i, n, s, b), dstr (s + 'd') {} - - std::string dstr; - - virtual bool - compare (const root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (derived2)) - return false; - - const derived2& d (static_cast (r)); - return interm::compare (r, false) && dstr == d.dstr; - } - }; -} - -#endif // TEST8_HXX diff --git a/common/inheritance/polymorphism/test9.hxx b/common/inheritance/polymorphism/test9.hxx deleted file mode 100644 index cdc97ae..0000000 --- a/common/inheritance/polymorphism/test9.hxx +++ /dev/null @@ -1,161 +0,0 @@ -// file : common/inheritance/polymorphism/test9.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST9_HXX -#define TEST9_HXX - -#include -#include -#include - -#include - -// Test polymorphism and readonly classes. -// -#pragma db namespace table("t9_") -namespace test9 -{ - // - // ro_root, rw_base, ro_derived - // - #pragma db object polymorphic readonly - struct ro_root - { - virtual ~ro_root () {} - ro_root () {} - ro_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} - - #pragma db object - struct rw_base: ro_root - { - rw_base () {} - rw_base (unsigned long i, unsigned long n, const std::string& s) - : ro_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_base)) - return false; - - const rw_base& b (static_cast (r)); - return ro_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object readonly - struct ro_derived: rw_base - { - ro_derived () {} - ro_derived (unsigned long i, unsigned long n, const std::string& s) - : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const ro_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_derived)) - return false; - - const ro_derived& d (static_cast (r)); - return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; - - // - // rw_root, ro_base, rw_derived - // - #pragma db object polymorphic - struct rw_root - { - virtual ~rw_root () {} - rw_root () {} - rw_root (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - std::vector strs; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_root)) - return false; - - return id == r.id && num == r.num && strs == r.strs; - } - }; - - inline bool - operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} - - #pragma db object readonly - struct ro_base: rw_root - { - ro_base () {} - ro_base (unsigned long i, unsigned long n, const std::string& s) - : rw_root (i, n), str (s) {} - - std::string str; - std::vector nums; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (ro_base)) - return false; - - const ro_base& b (static_cast (r)); - return rw_root::compare (r, false) && str == b.str && nums == b.nums; - } - }; - - #pragma db object - struct rw_derived: ro_base - { - rw_derived () {} - rw_derived (unsigned long i, unsigned long n, const std::string& s) - : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} - - unsigned long dnum; - std::string dstr; - - virtual bool - compare (const rw_root& r, bool tc = true) const - { - if (tc && typeid (r) != typeid (rw_derived)) - return false; - - const rw_derived& d (static_cast (r)); - return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; - } - }; -} - -#endif // TEST9_HXX diff --git a/common/inheritance/polymorphism/testscript b/common/inheritance/polymorphism/testscript deleted file mode 100644 index 89e5726..0000000 --- a/common/inheritance/polymorphism/testscript +++ /dev/null @@ -1,80 +0,0 @@ -# file : common/inheritance/polymorphism/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -+cat <=output - base pre_persist 1 const - base post_persist 1 const - derived pre_persist 2 const - derived post_persist 2 const - base pre_load 0 - base post_load 1 - derived pre_load 0 const - derived post_load 2 const - base pre_load 1 - base post_load 1 - derived pre_load 2 const - derived post_load 2 const - base pre_load 1 - base post_load 1 - derived pre_load 2 const - derived post_load 2 const - base pre_update 1 const - base post_update 1 const - derived pre_update 2 const - derived post_update 2 const - base pre_load 0 - base post_load 1 - derived pre_load 0 const - derived post_load 2 const - base pre_erase 1 const - base post_erase 1 const - derived pre_erase 2 const - derived post_erase 2 const - derived pre_persist 3 const - derived post_persist 3 const - derived pre_persist 4 const - derived post_persist 4 const - derived pre_load 0 const - derived pre_load 0 const - derived post_load 4 const - derived post_load 3 const - EOI - -test.redirects += >>>../output - -: mysql -: -if $mysql -{ - .include ../../../mysql-schema.testscript - - for s: $schemas - cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd - end; - - $* ($multi ? 'mysql' : ) $mysql_options -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql-schema.testscript - - for s: $schemas - $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql - end; - - $* ($multi ? 'pgsql' : ) $pgsql_options -} diff --git a/common/inheritance/reuse/buildfile b/common/inheritance/reuse/buildfile deleted file mode 100644 index b82439a..0000000 --- a/common/inheritance/reuse/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/inheritance/reuse/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix inhrt_r_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/inheritance/reuse/driver.cxx b/common/inheritance/reuse/driver.cxx deleted file mode 100644 index e6122bb..0000000 --- a/common/inheritance/reuse/driver.cxx +++ /dev/null @@ -1,237 +0,0 @@ -// file : common/inheritance/reuse/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test reuse object inheritance. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - base b; - b.comp_.bools.push_back (true); - b.comp_.obools.push_back (true); - b.comp_.num = 10; - b.comp_.str = "comp bbb"; - b.comp_.nums.push_back (101); - b.comp_.nums.push_back (102); - b.comp_.onums.push_back (101); - b.comp_.onums.push_back (102); - b.num_ = 0; - b.str_ = "bbb"; - b.strs_.push_back ("bbb one"); - b.strs_.push_back ("bbb two"); - b.ostrs_.push_back ("bbb one"); - b.ostrs_.push_back ("bbb two"); - - object1 o1; - o1.comp_.bools.push_back (false); - o1.comp_.obools.push_back (false); - o1.comp_.num = 11; - o1.comp_.str = "comp o1o1o1"; - o1.comp_.nums.push_back (111); - o1.comp_.nums.push_back (112); - o1.comp_.onums.push_back (111); - o1.comp_.onums.push_back (112); - static_cast (o1).num_ = 1; - o1.num1_ = 21; - o1.str_ = "base o1o1o1"; - o1.strs_.push_back ("base o1o1o1 one"); - o1.strs_.push_back ("base o1o1o1 two"); - o1.ostrs_.push_back ("base o1o1o1 one"); - o1.ostrs_.push_back ("base o1o1o1 two"); - - object2 o2; - o2.comp_.bools.push_back (true); - o2.comp_.bools.push_back (false); - o2.comp_.obools.push_back (true); - o2.comp_.obools.push_back (false); - o2.comp_.num = 12; - o2.comp_.str = "comp o2o2o2"; - o2.comp_.nums.push_back (121); - o2.comp_.nums.push_back (122); - o2.comp_.onums.push_back (121); - o2.comp_.onums.push_back (122); - o2.num_ = 2; - static_cast (o2).str_ = "base o2o2o2"; - o2.str_ = "o2o2o2"; - o2.strs_.push_back ("base o2o2o2 one"); - o2.strs_.push_back ("base o2o2o2 two"); - o2.ostrs_.push_back ("base o2o2o2 one"); - o2.ostrs_.push_back ("base o2o2o2 two"); - - object3 o3; - o3.comp_.bools.push_back (false); - o3.comp_.bools.push_back (false); - o3.comp_.obools.push_back (false); - o3.comp_.obools.push_back (false); - o3.comp_.num = 13; - o3.comp_.str = "comp o3o3o3"; - o3.comp_.nums.push_back (131); - o3.comp_.nums.push_back (132); - o3.comp_.onums.push_back (131); - o3.comp_.onums.push_back (132); - o3.num_ = 3; - o3.str_ = "base o3o3o3"; - o3.strs_.push_back ("base o3o3o3 one"); - o3.strs_.push_back ("base o3o3o3 two"); - o3.ostrs_.push_back ("base o3o3o3 one"); - o3.ostrs_.push_back ("base o3o3o3 two"); - - reference r; - r.o1_ = &o1; - - empty_object e; - e.comp_.bools.push_back (true); - e.comp_.bools.push_back (true); - e.comp_.obools.push_back (true); - e.comp_.obools.push_back (true); - e.comp_.num = 14; - e.comp_.str = "comp eee"; - e.comp_.nums.push_back (141); - e.comp_.nums.push_back (142); - e.comp_.onums.push_back (141); - e.comp_.onums.push_back (142); - e.num_ = 4; - e.str_ = "base eee"; - e.strs_.push_back ("base eee one"); - e.strs_.push_back ("base eee two"); - e.ostrs_.push_back ("base eee one"); - e.ostrs_.push_back ("base eee two"); - - // persist - // - { - transaction t (db->begin ()); - db->persist (b); - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (r); - db->persist (e); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr lb (db->load (b.id_)); - unique_ptr lo1 (db->load (o1.id_)); - unique_ptr lo2 (db->load (o2.id_)); - unique_ptr lo3 (db->load (o3.id_)); - unique_ptr le (db->load (e.id_)); - unique_ptr lr (db->load (r.id_)); - t.commit (); - - assert (b == *lb); - assert (o1 == *lo1); - assert (o2 == *lo2); - assert (o3 == *lo3); - assert (lr->o1_->id_ == r.o1_->id_); - assert (e == *le); - - delete lr->o1_; - } - - // update - // - { - transaction t (db->begin ()); - db->update (b); - db->update (o1); - db->update (o2); - db->update (o3); - db->update (r); - db->update (e); - t.commit (); - } - - // query - // - { - typedef odb::query b_query; - typedef odb::query o1_query; - typedef odb::query o2_query; - typedef odb::query r_query; - - typedef odb::result r_result; - - transaction t (db->begin ()); - - assert (!db->query (b_query::comp.num == 10).empty ()); - assert (!db->query (o1_query::num1 == 21).empty ()); - assert (!db->query (o2_query::num == 2).empty ()); - - // Query condition with hidden members. - // - assert ( - !db->query (o2_query::base::str == "base o2o2o2").empty ()); - - // Query condition with referenced composite member in base class. - // - { - r_result r (db->query (r_query::o1->comp.num == 11)); - assert (!r.empty ()); - delete r.begin ()->o1_; - } - - t.commit (); - } - - // views - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::num == o2.num_)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); - assert (++i == r.end ()); - - t.commit (); - } - - // erase - // - { - transaction t (db->begin ()); - db->erase (b); - db->erase (o1); - db->erase (o2); - db->erase (o3); - db->erase (r); - db->erase (e); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/inheritance/reuse/test.hxx b/common/inheritance/reuse/test.hxx deleted file mode 100644 index 48f474f..0000000 --- a/common/inheritance/reuse/test.hxx +++ /dev/null @@ -1,163 +0,0 @@ -// file : common/inheritance/reuse/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include -#include - -#pragma db value -struct comp_base -{ - std::vector bools; - odb::vector obools; - - bool - operator== (const comp_base& y) const - { - return bools == y.bools && obools == y.obools; - } -}; - -#pragma db value -struct comp: comp_base -{ - unsigned int num; - std::string str; - - std::vector nums; - odb::vector onums; - - bool - operator== (const comp& y) const - { - return - static_cast (*this) == y && - num == y.num && - str == y.str && - nums == y.nums && - onums == y.onums; - } -}; - -#pragma db object abstract -struct abstract_base -{ - comp comp_; - - unsigned int num_; - std::string str_; - - std::vector strs_; - odb::vector ostrs_; - - bool - operator== (const abstract_base& y) const - { - return - comp_ == y.comp_ && - num_ == y.num_ && - str_ == y.str_ && - strs_ == y.strs_ && - ostrs_ == y.ostrs_; - } -}; - -#pragma db object -struct base: abstract_base -{ - #pragma db id auto - unsigned long id_; - - bool - operator== (const base& y) const - { - return id_ == y.id_ && static_cast (*this) == y; - } -}; - -#pragma db object -struct object1: base -{ - unsigned int num1_; - - bool - operator== (const object1& y) const - { - return static_cast (*this) == y && num1_ == y.num1_; - } -}; - -#pragma db object -struct object2: base -{ - #pragma db column("derived_str") - std::string str_; - - bool - operator== (const object2& y) const - { - return static_cast (*this) == y && str_ == y.str_; - } -}; - -// Reference to derived object. -// -#pragma db object -struct reference -{ - #pragma db id auto - unsigned long id_; - - object1* o1_; -}; - -// Multiple inheritance. -// -#pragma db object abstract -struct id_base -{ - #pragma db id auto - unsigned long id_; - - bool - operator== (const id_base& y) const - { - return id_ == y.id_; - } -}; - -#pragma db object -struct object3: abstract_base, id_base -{ - bool - operator== (const object3& y) const - { - return - static_cast (*this) == y && - static_cast (*this) == y; - } -}; - -// Empty derived object. -// -#pragma db object -struct empty_object: base -{ -}; - -// View based on the derived object. -// -#pragma db view object(object2) -struct object2_view -{ - unsigned int num; // from abstract_base - unsigned long id; // from base - std::string str; // from object2, hides one from abstract_base -}; - -#endif // TEST_HXX diff --git a/common/inheritance/reuse/testscript b/common/inheritance/reuse/testscript deleted file mode 100644 index 995b3f5..0000000 --- a/common/inheritance/reuse/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/inheritance/reuse/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/inheritance/transient/buildfile b/common/inheritance/transient/buildfile deleted file mode 100644 index 1961abc..0000000 --- a/common/inheritance/transient/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/inheritance/transient/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix inhrt_t_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/inheritance/transient/driver.cxx b/common/inheritance/transient/driver.cxx deleted file mode 100644 index 1caae6c..0000000 --- a/common/inheritance/transient/driver.cxx +++ /dev/null @@ -1,80 +0,0 @@ -// file : common/inheritance/transient/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transient inheritance of objects, composite value types, and views. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - object o; - o.num = 1; - o.str = "abc"; - o.strs.push_back ("abc 1"); - o.strs.push_back ("abc 2"); - o.c.num = 11; - o.c.str = "comp abc"; - o.c.nums.push_back (111); - o.c.nums.push_back (112); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id_)); - t.commit (); - - assert (*p == o); - } - - // view - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::id == o.id_)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->num == o.num && i->str == o.str); - assert (++i == r.end ()); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/inheritance/transient/test.hxx b/common/inheritance/transient/test.hxx deleted file mode 100644 index 394ee8f..0000000 --- a/common/inheritance/transient/test.hxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : common/inheritance/transient/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -struct object; - -struct base -{ - int n; - std::vector v; - object* p; -}; - -#pragma db value -struct comp: base -{ - unsigned int num; - std::string str; - std::vector nums; - - bool - operator== (const comp& y) const - { - return num == y.num && str == y.str && nums == y.nums; - } -}; - -#pragma db object -struct object: base -{ - #pragma db id auto - unsigned int id_; - - unsigned int num; - std::string str; - std::vector strs; - comp c; - - bool - operator== (const object& y) const - { - return num == y.num && str == y.str && strs == y.strs && c == y.c; - } -}; - -#pragma db view object(object) -struct view: base -{ - unsigned int num; - std::string str; -}; - -#endif // TEST_HXX diff --git a/common/inheritance/transient/testscript b/common/inheritance/transient/testscript deleted file mode 100644 index bce91de..0000000 --- a/common/inheritance/transient/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/inheritance/transient/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/inverse/buildfile b/common/inverse/buildfile deleted file mode 100644 index 63fa1cb..0000000 --- a/common/inverse/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/inverse/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_inverse_ \ - --generate-schema \ - --generate-query \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/inverse/driver.cxx b/common/inverse/driver.cxx deleted file mode 100644 index 842438e..0000000 --- a/common/inverse/driver.cxx +++ /dev/null @@ -1,502 +0,0 @@ -// file : common/inverse/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test bidirectional relationships with inverse sides. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test raw pointers. - // - { - using namespace test1; - - obj1_ptr o1_1 (new obj1); - obj1_ptr o1_2 (new obj1); - obj2_ptr o2 (new obj2); - obj3_ptr o3_1 (new obj3); - obj3_ptr o3_2 (new obj3); - obj4_ptr o4_1 (new obj4); - obj4_ptr o4_2 (new obj4); - obj5_ptr o5_1 (new obj5); - obj5_ptr o5_2 (new obj5); - obj5_ptr o5_3 (new obj5); - obj5_ptr o5_4 (new obj5); - - o1_1->id = "obj1 1"; - o1_1->o2 = o2; - o1_1->o3.insert (o3_1); - o1_1->o3.insert (o3_2); - o1_1->o4 = o4_1; - o1_1->o5.insert (o5_1); - o1_1->o5.insert (o5_2); - - o1_2->id = "obj1 2"; - o1_2->o2 = 0; - o1_2->o3.clear (); - o1_2->o4 = o4_2; - o1_2->o5.insert (o5_3); - o1_2->o5.insert (o5_4); - - o2->str = "obj2"; - o2->o1 = o1_1; - - o3_1->str = "obj3 1"; - o3_1->o1 = o1_1; - - o3_2->str = "obj3 2"; - o3_2->o1 = o1_1; - - o4_1->str = "obj4 1"; - o4_1->o1.insert (o1_1); - - o4_2->str = "obj4 2"; - o4_2->o1.insert (o1_2); - - o5_1->str = "obj5 1"; - o5_1->o1.insert (o1_1); - - o5_2->str = "obj5 2"; - o5_2->o1.insert (o1_1); - - o5_3->str = "obj5 3"; - o5_3->o1.insert (o1_2); - - o5_4->str = "obj5 4"; - o5_4->o1.insert (o1_2); - - // persist - // - { - transaction t (db->begin ()); - - // objN come before obj1 to get object id assigned. - // - db->persist (o5_1); - db->persist (o5_2); - db->persist (o5_3); - db->persist (o5_4); - db->persist (o4_1); - db->persist (o4_2); - db->persist (o3_1); - db->persist (o3_2); - db->persist (o2); - db->persist (o1_1); - db->persist (o1_2); - - t.commit (); - } - - // load - // - { - session s; - transaction t (db->begin ()); - obj2_ptr x2 (db->load (o2->id)); - obj3_ptr x3_1 (db->load (o3_1->id)); - obj3_ptr x3_2 (db->load (o3_2->id)); - obj4_ptr x4_1 (db->load (o4_1->id)); - obj4_ptr x4_2 (db->load (o4_2->id)); - obj5_ptr x5_1 (db->load (o5_1->id)); - obj5_ptr x5_2 (db->load (o5_2->id)); - obj5_ptr x5_3 (db->load (o5_3->id)); - obj5_ptr x5_4 (db->load (o5_4->id)); - t.commit (); - - assert (x2->str == o2->str); - assert (x2->o1->id == o1_1->id); - assert (x2->o1->o2 == x2); - - assert (x3_1->str == o3_1->str); - assert (x3_2->str == o3_2->str); - assert (x3_1->o1 == x3_2->o1); - assert (x3_1->o1->id == o1_1->id); - assert (x3_1->o1->o3.find (x3_1) != x3_1->o1->o3.end ()); - assert (x3_1->o1->o3.find (x3_2) != x3_1->o1->o3.end ()); - - assert (x4_1->str == o4_1->str); - assert (x4_2->str == o4_2->str); - assert ((*x4_1->o1.begin ())->id == o1_1->id); - assert ((*x4_2->o1.begin ())->id == o1_2->id); - assert ((*x4_1->o1.begin ())->o4 == x4_1); - assert ((*x4_2->o1.begin ())->o4 == x4_2); - - assert (x5_1->str == o5_1->str); - assert (x5_2->str == o5_2->str); - assert ((*x5_1->o1.begin ())->id == o1_1->id); - assert ((*x5_2->o1.begin ())->id == o1_1->id); - assert ((*x5_3->o1.begin ())->id == o1_2->id); - assert ((*x5_4->o1.begin ())->id == o1_2->id); - assert ((*x5_1->o1.begin ())->o5.find (x5_1) != - (*x5_1->o1.begin ())->o5.end ()); - assert ((*x5_2->o1.begin ())->o5.find (x5_2) != - (*x5_2->o1.begin ())->o5.end ()); - assert ((*x5_3->o1.begin ())->o5.find (x5_3) != - (*x5_3->o1.begin ())->o5.end ()); - assert ((*x5_4->o1.begin ())->o5.find (x5_4) != - (*x5_4->o1.begin ())->o5.end ()); - - delete *x4_1->o1.begin (); - delete *x4_2->o1.begin (); - } - - // query - // - { - // one(i)-to-one - // - typedef odb::query query; - typedef odb::result result; - - session s; - transaction t (db->begin ()); - - result r (db->query (query::o1->id == "obj1 1")); - assert (!r.empty ()); - assert (r.begin ()->id == o2->id); - assert (r.begin ()->o1->id == o1_1->id); - assert (size (r) == 1); - - t.commit (); - } - - { - // one(i)-to-many - // - typedef odb::query query; - typedef odb::result result; - - session s; - transaction t (db->begin ()); - - result r (db->query (query::o1->id == "obj1 1")); - size_t n (0); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - assert (i->id == o3_1->id || i->id == o3_2->id); - assert (i->o1->id == o1_1->id); - n++; - } - - assert (n == 2); - - t.commit (); - } - - delete o1_1; - delete o1_2; - } - - // Test shared_ptr/weak_ptr. - // - { - using namespace test2; - - obj1_ptr o1_1 (new obj1); - obj1_ptr o1_2 (new obj1); - obj2_ptr o2 (new obj2); - obj3_ptr o3_1 (new obj3); - obj3_ptr o3_2 (new obj3); - obj4_ptr o4 (new obj4); - obj5_ptr o5_1 (new obj5); - obj5_ptr o5_2 (new obj5); - - o1_1->id = "obj1 1"; - o1_1->o2 = o2; - o1_1->o3.push_back (o3_1); - o1_1->o3.push_back (o3_2); - o1_1->o4 = o4; - o1_1->o5.push_back (o5_1); - o1_1->o5.push_back (o5_2); - - o1_2->id = "obj1 2"; - o1_2->o2 = obj2_ptr (); - o1_2->o3.clear (); - o1_2->o4 = o4; - o1_2->o5.push_back (o5_1); - - o2->str = "obj2"; - o2->o1 = o1_1; - - o3_1->str = "obj3 1"; - o3_1->o1 = o1_1; - - o3_2->str = "obj3 3"; - o3_2->o1 = o1_1; - - o4->str = "obj4"; - o4->o1.push_back (o1_1); - o4->o1.push_back (o1_2); - - o5_1->str = "obj5 1"; - o5_1->o1.push_back (o1_1); - o5_1->o1.push_back (o1_2); - - o5_2->str = "obj5 2"; - o5_2->o1.push_back (o1_1); - - // persist - // - { - transaction t (db->begin ()); - - // objN come before obj1 to get object id assigned. - // - db->persist (o5_1); - db->persist (o5_2); - db->persist (o4); - db->persist (o3_1); - db->persist (o3_2); - db->persist (o2); - db->persist (o1_1); - db->persist (o1_2); - - t.commit (); - } - - // load - // - { - session s; - transaction t (db->begin ()); - obj2_ptr x2 (db->load (o2->id)); - obj3_ptr x3_1 (db->load (o3_1->id)); - obj3_ptr x3_2 (db->load (o3_2->id)); - obj4_ptr x4 (db->load (o4->id)); - obj5_ptr x5_1 (db->load (o5_1->id)); - obj5_ptr x5_2 (db->load (o5_2->id)); - t.commit (); - - assert (x2->str == o2->str); - assert (x2->o1.lock ()->id == o1_1->id); - assert (x2->o1.lock ()->o2 == x2); - - assert (x3_1->str == o3_1->str); - assert (x3_2->str == o3_2->str); - assert (x3_1->o1.lock () == x3_2->o1.lock ()); - assert (x3_1->o1.lock ()->id == o1_1->id); - assert (x3_1->o1.lock ()->o3[0] == x3_1); - assert (x3_1->o1.lock ()->o3[1] == x3_2); - - { - assert (x4->str == o4->str); - - obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); - - assert (t1->id == o1_1->id || t2->id == o1_1->id); - assert (t1->id == o1_2->id || t2->id == o1_2->id); - } - - { - assert (x5_1->str == o5_1->str); - assert (x5_2->str == o5_2->str); - - obj1_ptr t1 (x5_1->o1[0].lock ()), t2 (x5_1->o1[1].lock ()), - t3 (x5_2->o1[0].lock ()); - - assert (t1->id == o1_1->id || t2->id == o1_1->id); - assert (t1->id == o1_2->id || t2->id == o1_2->id); - assert (t3->id == o1_1->id); - } - } - } - - // Test inverse based on points_to. - // - { - using namespace test3; - - { - obj1 o1 (1, 2); - o1.o2 = new obj2; - - { - transaction t (db->begin ()); - - o1.o2->o1 = db->persist (o1); - db->persist (o1.o2); - - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr p (db->load (o1.id)); - assert (p->o2->id == o1.o2->id); - - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - - unique_ptr p (db->query_one (query::o2->o1.i == o1.id.i && - query::o2->o1.j == o1.id.j)); - assert (p->o2->id == o1.o2->id); - - t.commit (); - } - } - - { - obj3 o3; - o3.o4.push_back (new obj4); - o3.o4.push_back (new obj4); - - { - transaction t (db->begin ()); - - o3.o4[0]->o3 = o3.o4[1]->o3 = db->persist (o3); - db->persist (o3.o4[0]); - db->persist (o3.o4[1]); - - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr p (db->load (o3.id)); - assert (p->o4[0]->id == o3.o4[0]->id); - assert (p->o4[1]->id == o3.o4[1]->id); - - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - - unique_ptr p (db->query_one (query::id == o3.id)); - assert (p->o4[0]->id == o3.o4[0]->id); - assert (p->o4[1]->id == o3.o4[1]->id); - - t.commit (); - } - } - } - - // Test inverse with nested data members. - // - { - using namespace test4; - - { - obj1 o1; - o1.o2 = new obj2; - - { - transaction t (db->begin ()); - - o1.o2->id.i = db->persist (o1); - o1.o2->id.j = 123; - db->persist (o1.o2); - - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr p (db->load (o1.id)); - assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); - - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - - unique_ptr p (db->query_one ( - query::o2->id.i == o1.o2->id.i && - query::o2->id.j == o1.o2->id.j)); - assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); - - t.commit (); - } - } - - { - obj3 o3; - o3.o4.push_back (new obj4); - o3.o4.push_back (new obj4); - - { - transaction t (db->begin ()); - - o3.o4[0]->id.i = o3.o4[1]->id.i = db->persist (o3); - o3.o4[0]->id.j = 123; - o3.o4[1]->id.j = 234; - db->persist (o3.o4[0]); - db->persist (o3.o4[1]); - - t.commit (); - } - - { - transaction t (db->begin ()); - - unique_ptr p (db->load (o3.id)); - assert (p->o4[0]->id.i == o3.o4[0]->id.i && - p->o4[0]->id.j == o3.o4[0]->id.j); - - assert (p->o4[1]->id.i == o3.o4[1]->id.i && - p->o4[1]->id.j == o3.o4[1]->id.j); - - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - - unique_ptr p (db->query_one (query::id == o3.id)); - - assert (p->o4[0]->id.i == o3.o4[0]->id.i && - p->o4[0]->id.j == o3.o4[0]->id.j); - - assert (p->o4[1]->id.i == o3.o4[1]->id.i && - p->o4[1]->id.j == o3.o4[1]->id.j); - - t.commit (); - } - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx deleted file mode 100644 index a7b8678..0000000 --- a/common/inverse/test.hxx +++ /dev/null @@ -1,391 +0,0 @@ -// file : common/inverse/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include - -#include - -// Test raw pointers. -// -#pragma db namespace table("t1_") -namespace test1 -{ - struct obj1; - struct obj2; - struct obj3; - struct obj4; - struct obj5; - - typedef obj1* obj1_ptr; - typedef obj2* obj2_ptr; - typedef obj3* obj3_ptr; - typedef obj4* obj4_ptr; - typedef obj5* obj5_ptr; - - typedef std::set obj1_ptr_set; - typedef std::set obj3_ptr_set; - typedef std::set obj5_ptr_set; - - #pragma db object - struct obj1 - { - obj1 (): o2 (0), o4 (0) {} - ~obj1 (); - - #pragma db id - std::string id; - - obj2_ptr o2; - - #pragma db id_column("obj1_id") value_column("obj3_id") - obj3_ptr_set o3; - - obj4_ptr o4; - - obj5_ptr_set o5; - }; - - #pragma db object - struct obj2 - { - #pragma db id auto - int id; - - // one-to-one - // - #pragma db inverse(o2) - obj1_ptr o1; - - std::string str; - }; - - #pragma db object - struct obj3 - { - std::string str; - - // one(i)-to-many - // - #pragma db inverse (o3) - obj1_ptr o1; - - #pragma db id auto - int id; - }; - - #pragma db object - struct obj4 - { - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-one - // - #pragma db inverse (o4) - obj1_ptr_set o1; - }; - - #pragma db object - struct obj5 - { - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-many - // - #pragma db inverse (o5) - obj1_ptr_set o1; - }; - - inline obj1:: - ~obj1 () - { - delete o2; - for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) - delete *i; - delete o4; - for (obj5_ptr_set::iterator i (o5.begin ()); i != o5.end (); ++i) - delete *i; - } -} - -// Test shared_ptr/weak_ptr. -// -#pragma db namespace table("t2_") -namespace test2 -{ - using std::shared_ptr; - using std::weak_ptr; - - struct obj1; - struct obj2; - struct obj3; - struct obj4; - struct obj5; - - typedef shared_ptr obj1_ptr; - typedef shared_ptr obj2_ptr; - typedef shared_ptr obj3_ptr; - typedef shared_ptr obj4_ptr; - typedef shared_ptr obj5_ptr; - - typedef weak_ptr obj1_wptr; - - typedef std::vector obj1_wptr_vec; - typedef std::vector obj3_ptr_vec; - typedef std::vector obj5_ptr_vec; - - #pragma db object pointer(obj1_ptr) - struct obj1 - { - #pragma db id - std::string id; - - obj2_ptr o2; - - #pragma db id_column("obj1_id") value_column("obj3_id") - obj3_ptr_vec o3; - - obj4_ptr o4; - obj5_ptr_vec o5; - }; - - #pragma db object pointer(obj2_ptr) - struct obj2 - { - #pragma db id auto - int id; - - std::string str; - - // one(i)-to-one - // - #pragma db inverse(o2) - obj1_wptr o1; - }; - - #pragma db object pointer(obj3_ptr) - struct obj3 - { - #pragma db id auto - int id; - - std::string str; - - // one(i)-to-many - // - #pragma db inverse (o3) - obj1_wptr o1; - }; - - #pragma db object pointer(obj4_ptr) - struct obj4 - { - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-one - // - #pragma db inverse (o4) - obj1_wptr_vec o1; - }; - - #pragma db object pointer(obj5_ptr) - struct obj5 - { - #pragma db id auto - int id; - - std::string str; - - // many(i)-to-many - // - #pragma db inverse (o5) - obj1_wptr_vec o1; - }; -} - -// Test inverse based on points_to. -// -#pragma db namespace table("t3_") -namespace test3 -{ - // Inverse pointer. - // - #pragma db value - struct comp - { - int i; - int j; - }; - - inline bool - operator< (comp x, comp y) {return x.i < y.i || (x.i == y.i && x.j < y.j);} - - struct obj2; - - #pragma db object - struct obj1 - { - #pragma db id - comp id; - - #pragma db inverse(o1) - obj2* o2; - - obj1 (int i = 0, int j = 0): o2 (0) {id.i = i; id.j = j;} - ~obj1 (); - }; - - #pragma db object - struct obj2 - { - #pragma db id auto - int id; - - #pragma db points_to(obj1) - comp o1; - -#ifndef ODB_DATABASE_MYSQL - #pragma db member(o1) on_delete(cascade) -#endif - }; - - inline obj1:: - ~obj1 () {delete o2;} - - // Inverse container of pointers. - // - struct obj4; - - #pragma db object - struct obj3 - { - #pragma db id auto - int id; - - #pragma db inverse(o3) - std::vector o4; - - ~obj3 (); - }; - - #pragma db object - struct obj4 - { - #pragma db id auto - int id; - - #pragma db points_to(obj3) - int o3; - }; - - inline obj3:: - ~obj3 () - { - for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) - delete *i; - } -}; - -// Test inverse with nested data members. -// -#pragma db namespace table("t4_") -namespace test4 -{ - // Inverse pointer. - // - struct obj1; - struct obj2; - - #pragma db value - struct obj2_id - { - #pragma db points_to(obj1) - int i; - int j; - }; - - inline bool - operator< (obj2_id x, obj2_id y) - {return x.i < y.i || (x.i == y.i && x.j < y.j);} - - #pragma db object - struct obj1 - { - #pragma db id auto - int id; - - #pragma db inverse(id.i) - obj2* o2; - - obj1 (): o2 (0) {} - ~obj1 (); - }; - - #pragma db object - struct obj2 - { - #pragma db id - obj2_id id; - }; - - inline obj1:: - ~obj1 () {delete o2;} - - // Inverse container of pointers. - // - struct obj3; - struct obj4; - - #pragma db value - struct obj4_id - { - #pragma db points_to(obj3) - int i; - int j; - }; - - inline bool - operator< (obj4_id x, obj4_id y) - {return x.i < y.i || (x.i == y.i && x.j < y.j);} - - #pragma db object - struct obj3 - { - #pragma db id auto - int id; - - #pragma db inverse(id.i) - std::vector o4; - - ~obj3 (); - }; - - #pragma db object - struct obj4 - { - #pragma db id - obj4_id id; - }; - - inline obj3:: - ~obj3 () - { - for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) - delete *i; - } -}; -#endif // TEST_HXX diff --git a/common/inverse/testscript b/common/inverse/testscript deleted file mode 100644 index c2a4e3e..0000000 --- a/common/inverse/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/inverse/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/lazy-ptr/buildfile b/common/lazy-ptr/buildfile deleted file mode 100644 index d495d2f..0000000 --- a/common/lazy-ptr/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/lazy-ptr/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix lazy_ptr_ \ - --generate-schema \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/lazy-ptr/driver.cxx b/common/lazy-ptr/driver.cxx deleted file mode 100644 index 9a3b324..0000000 --- a/common/lazy-ptr/driver.cxx +++ /dev/null @@ -1,360 +0,0 @@ -// file : common/lazy-ptr/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test lazy object pointers. -// - -#include // std::unique_ptr -#include // std::move -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -namespace test2 -{ - cont::cont (unsigned long i) - : id (i) - { - } - - obj_ptr - create (unsigned int id) - { - obj_ptr r (new obj (id)); - return r; - } - - lazy_obj_ptr - create (database& db, unsigned int id) - { - lazy_obj_ptr r (db, id); - return r; - } -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Raw. - // - { - using namespace test1; - - // persist - // - obj* o1 (new obj (1)); - - { - transaction t (db->begin ()); - db->persist (o1); - t.commit (); - } - - unique_ptr c1 (new cont (1)); - unique_ptr c2 (new cont (2)); - - lazy_ptr lo1 (*db, 1); - obj* o2 (new obj (2)); - - obj* o3 (new obj (3)); - obj* o4 (new obj (4)); - - c1->o.push_back (lo1); - c1->o.push_back (o2); - c2->o.push_back (o3); - c2->o.push_back (o4); - - // Test pointer comparison. - // - assert (lazy_ptr () == lazy_ptr ()); - assert (lazy_ptr (o1) != lazy_ptr ()); - assert (lo1 != lazy_ptr ()); - assert (lazy_ptr (o1) == lazy_ptr (o1)); - assert (lo1 == lazy_ptr (*db, o1)); - assert (lo1 != lazy_ptr (*db, o2)); - - delete o1; - - { - transaction t (db->begin ()); - - db->persist (o2); - db->persist (o3); - db->persist (o4); - - db->persist (*c1); - db->persist (*c2); - - t.commit (); - } - - // load - // - { - session s; - transaction t (db->begin ()); - unique_ptr c (db->load (1)); - obj* o (db->load (1)); - - // Not loaded. - // - assert (c->o.size () == 2); - assert (!c->o[0].loaded ()); - assert (!c->o[1].loaded ()); - - assert (!o->c.loaded ()); - - // Correct object ids. - // - assert (c->o[0].object_id () == o->id); - assert (o->c.object_id () == c->id); - - // Load. - // - cont* cl (o->c.load ()); - obj* ol (c->o[0].load ()); - - assert (cl == c.get ()); - assert (ol == o); - - // Test unload/reload. - // - o->c.unload (); - assert (!o->c.loaded ()); - o->c.load (); - assert (o->c.loaded ()); - - t.commit (); - } - } - - // std::unique_ptr - // - { - using namespace test2; - - // persist - // - { - obj_ptr o1 (new obj (1)); - transaction t (db->begin ()); - db->persist (*o1); - t.commit (); - } - - cont_ptr c1 (new cont (1)); - cont_ptr c2 (new cont (2)); - - lazy_obj_ptr lo1 = create (*db, 1); - lo1 = create (*db, 1); - - c1->o = std::move (lo1); - c2->o = create (2); - - { - transaction t (db->begin ()); - - db->persist (*c2->o); - - db->persist (*c1); - db->persist (*c2); - - t.commit (); - } - - // load - // - { - session s; - transaction t (db->begin ()); - cont_ptr c (db->load (1)); - obj* o (db->load (1)); - - // Not loaded. - // - assert (!c->o.loaded ()); - assert (!o->c.loaded ()); - - // Correct object ids. - // - assert (c->o.object_id () == o->id); - assert (o->c.object_id () == c->id); - - // Load. - // - cont* cl (o->c.load ()); - const obj_ptr& ol (c->o.load ()); - - assert (cl == c.get ()); - assert (ol.get () == o); - - t.commit (); - } - - // unload/reload - // - { - // No session. - transaction t (db->begin ()); - cont_ptr c (db->load (1)); - - assert (!c->o.loaded ()); - c->o.load (); - assert (c->o.loaded ()); - c->o.unload (); - assert (!c->o.loaded ()); - c->o.load (); - assert (c->o.loaded ()); - - t.commit (); - } - } - - // Shared pointer from C++11 or TR1. - // - { - using namespace test3; - - // persist - // - shared_ptr c1 (new cont (1)); - - { - transaction t (db->begin ()); - db->persist (c1); - t.commit (); - } - - lazy_shared_ptr lc1 (*db, 1); - shared_ptr c2 (new cont (2)); - - shared_ptr o1 (new obj (1)); - shared_ptr o2 (new obj (2)); - - shared_ptr o3 (new obj (3)); - shared_ptr o4 (new obj (4)); - - o1->c = lc1; - o2->c = lc1; - o3->c = c2; - o4->c = c2; - - // Test pointer comparison. - // - assert (lazy_shared_ptr () == lazy_shared_ptr ()); - assert (lazy_shared_ptr (c1) != lazy_shared_ptr ()); - assert (lc1 != lazy_shared_ptr ()); - assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); - assert (lc1 == lazy_shared_ptr (*db, c1)); - assert (lc1 != lazy_shared_ptr (*db, c2)); - - // Test move constructors. - // - { - lazy_shared_ptr tmp (*db, 1); - lazy_shared_ptr l (std::move (tmp)); - assert (lc1 == l); - } - - { - shared_ptr tmp (c1); - lazy_shared_ptr l (*db, std::move (tmp)); - assert (lc1 == l); - } - - { - transaction t (db->begin ()); - - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (o4); - - db->persist (c2); - - t.commit (); - } - - // load - // - { - session s; - transaction t (db->begin ()); - shared_ptr c (db->load (1)); - shared_ptr o (db->load (1)); - - // Not loaded. - // - assert (c->o.size () == 2); - assert (!c->o[0].loaded ()); - assert (!c->o[1].loaded ()); - - assert (!o->c.loaded ()); - - // Correct object ids. - // - assert (c->o[0].object_id () == o->id); - assert (o->c.object_id () == c->id); - - // Load. - // - shared_ptr cl (o->c.load ()); - shared_ptr ol (c->o[0].load ()); - - assert (cl == c); - assert (ol == o); - - t.commit (); - } - - // Test lazy weak locking and reloading. - // - { - // No session. - transaction t (db->begin ()); - shared_ptr c (db->load (1)); - - // Lock. - // - assert (!c->o[1].loaded ()); - lazy_shared_ptr l (c->o[1].lock ()); - assert (!l.loaded ()); - assert (l.object_id () == c->o[1].object_id ()); - - // Reload. - // - assert (!c->o[1].loaded ()); - shared_ptr ol (c->o[1].load ()); - assert (c->o[1].loaded ()); - ol.reset (); - assert (!c->o[1].loaded ()); - ol = c->o[1].load (); - assert (c->o[1].loaded ()); - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx deleted file mode 100644 index f946029..0000000 --- a/common/lazy-ptr/test.hxx +++ /dev/null @@ -1,147 +0,0 @@ -// file : common/lazy-ptr/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include - -#include -#include - -// Raw pointer. -// -#pragma db namespace table("t1_") -namespace test1 -{ - using odb::lazy_ptr; - class obj; - - #pragma db object - class cont - { - public: - cont () {} - cont (unsigned long i): id (i) {} - ~cont (); - - #pragma db id - unsigned long id; - - typedef std::vector > obj_list; - - #pragma db value_not_null - obj_list o; - }; - - #pragma db object - class obj - { - public: - obj () {} - obj (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(o) not_null - lazy_ptr c; // weak - }; - - inline cont:: - ~cont () - { - for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) - if (obj* p = i->get ()) - delete p; - } -} - -// std::auto_ptr/std::unique_ptr -// -#pragma db namespace table("t2_") -namespace test2 -{ - using odb::lazy_ptr; - - class obj; - class cont; - - typedef std::unique_ptr obj_ptr; - typedef std::unique_ptr cont_ptr; - typedef odb::lazy_unique_ptr lazy_obj_ptr; - - #pragma db object - class cont - { - public: - cont () = default; - cont (unsigned long id); - - #pragma db id - unsigned long id; - - #pragma db not_null - lazy_obj_ptr o; - }; - - #pragma db object - class obj - { - public: - obj () = default; - obj (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(o) not_null - lazy_ptr c; // weak - }; -} - -// shared_ptr -// -#pragma db namespace table("t3_") -namespace test3 -{ - using std::shared_ptr; - using odb::lazy_shared_ptr; - using odb::lazy_weak_ptr; - - class obj; - - #pragma db object pointer(shared_ptr) - class cont - { - public: - cont () {} - cont (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - typedef std::vector > obj_list; - - #pragma db inverse(c) value_not_null - obj_list o; - }; - - #pragma db object pointer(shared_ptr) - class obj - { - public: - obj () {} - obj (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db not_null - lazy_shared_ptr c; - }; -} - -#endif // TEST_HXX diff --git a/common/lazy-ptr/testscript b/common/lazy-ptr/testscript deleted file mode 100644 index 736fa4c..0000000 --- a/common/lazy-ptr/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/lazy-ptr/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/lifecycle/buildfile b/common/lifecycle/buildfile deleted file mode 100644 index b5b2b00..0000000 --- a/common/lifecycle/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/lifecycle/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix lifecycle_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx deleted file mode 100644 index a01d5bd..0000000 --- a/common/lifecycle/driver.cxx +++ /dev/null @@ -1,248 +0,0 @@ -// file : common/lifecycle/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object state transistions. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_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 - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - assert (false); - t.commit (); - } - catch (const object_not_persistent&) - { - } - - // Persistent. - // - { - object o (1); - o.str_ = "value 1"; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - try - { - transaction t (db->begin ()); - db->persist (o); - assert (false); - t.commit (); - } - catch (const object_already_persistent&) - { - } - } - - // Find. - // - { - transaction t (db->begin ()); - - unique_ptr o1 (db->find (1)); - assert (o1.get () != 0 && o1->str_ == "value 1"); - - unique_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 ()); - unique_ptr o (db->load (1)); - assert (o->str_ == "value 1"); - t.commit (); - - try - { - transaction t (db->begin ()); - unique_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. - // - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - 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&) - { - } - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - assert (o->str_ == "value 2"); - t.commit (); - } - - // Update of unmodified object. - // - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - db->update (*o); - t.commit (); - } - - // Transient. - // - { - transaction t (db->begin ()); - unique_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 - { - transaction t (db->begin ()); - unique_ptr o (db->load (1)); - assert (false); - t.commit (); - } - catch (const object_not_persistent&) - { - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx deleted file mode 100644 index 8d260d2..0000000 --- a/common/lifecycle/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : common/lifecycle/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; - std::string str_; -}; - -#endif // TEST_HXX diff --git a/common/lifecycle/testscript b/common/lifecycle/testscript deleted file mode 100644 index 0337bba..0000000 --- a/common/lifecycle/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/lifecycle/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/no-id/buildfile b/common/no-id/buildfile deleted file mode 100644 index 1a64401..0000000 --- a/common/no-id/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/no-id/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix no_id_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/no-id/driver.cxx b/common/no-id/driver.cxx deleted file mode 100644 index eee69a5..0000000 --- a/common/no-id/driver.cxx +++ /dev/null @@ -1,102 +0,0 @@ -// file : common/no-id/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test persistent classes without id. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - object o1 (1, "aaa"); - object o2 (2, "bbb"); - object o3 (3, "ccc"); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o2); // Ok, since there is no id. - db->persist (o3); - t.commit (); - } - - // Compile errors. - // - { - //db->load (1); - //db->find (1); - //db->update (o1); - //db->erase (1); - } - - typedef odb::query query; - typedef odb::result result; - - // Query. - // - { - transaction t (db->begin ()); - - { - result r (db->query ()); - assert (size (r) == 4); - } - - { - result r (db->query (query::str == "aaa")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->num == 1 && i->str == "aaa"); - object o; - i.load (o); - //i.id (); // Compile-time error. - assert (o.num == 1 && o.str == "aaa"); - assert (++i == r.end ()); - } - - { - result r (db->query (query::num < 3)); - assert (size (r) == 3); - } - - t.commit (); - } - - // Erase (query). - // - { - transaction t (db->begin ()); - assert (db->erase_query (query::num == 2) == 2); - assert (db->erase_query () == 2); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/no-id/test.hxx b/common/no-id/test.hxx deleted file mode 100644 index c5b5c65..0000000 --- a/common/no-id/test.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : common/no-id/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object no_id -struct object -{ - object () {} - object (unsigned long n, const std::string& s): num (n), str (s) {} - - unsigned long num; - std::string str; -}; - -#endif // TEST_HXX diff --git a/common/no-id/testscript b/common/no-id/testscript deleted file mode 100644 index 5ec57ee..0000000 --- a/common/no-id/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/no-id/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/object/buildfile b/common/object/buildfile deleted file mode 100644 index cb56aee..0000000 --- a/common/object/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/object/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix object_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/object/driver.cxx b/common/object/driver.cxx deleted file mode 100644 index 1c29417..0000000 --- a/common/object/driver.cxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : common/object/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test persistent classes. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test persistent class template instantiation. - // - { - using namespace test1; - - pair_object po; - po.second = "abc"; - - derived d; - d.x = "abc"; - d.n = 123; - - // persist - // - { - transaction t (db->begin ()); - db->persist (po); - db->persist (d); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - unique_ptr po1 (db->load (po.first)); - unique_ptr d1 (db->load (d.id)); - t.commit (); - - assert (po == *po1); - - assert (d.x == d1->x); - assert (d.n == d1->n); - } - - // Test the API confusion. - // - { - transaction t (db->begin ()); - db->update (po); - db->reload (po); - db->erase (po); - - db->query (); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/object/test.hxx b/common/object/test.hxx deleted file mode 100644 index 87bac91..0000000 --- a/common/object/test.hxx +++ /dev/null @@ -1,49 +0,0 @@ -// file : common/object/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include // std::pair - -#include - -// Test persistent class template instantiation. -// -#pragma db namespace table("t1_") -namespace test1 -{ - typedef std::pair pair_object; - #pragma db object(pair_object) - #pragma db member(pair_object::first) id auto - - #pragma db object abstract - struct base_data - { - #pragma db id auto - unsigned long id; - }; - - template - struct base: base_data - { - T x; - }; - - typedef base base_derived; - #pragma db object(base_derived) abstract - - #pragma db object - struct derived: base_derived - { - int n; - }; - - // Test instantiation in order to "see" id, etc. - // - typedef base int_base; - #pragma db object(int_base) -} - -#endif // TEST_HXX diff --git a/common/object/testscript b/common/object/testscript deleted file mode 100644 index 6982409..0000000 --- a/common/object/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/object/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/optimistic/buildfile b/common/optimistic/buildfile deleted file mode 100644 index 06af705..0000000 --- a/common/optimistic/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/optimistic/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_optimistic_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/optimistic/driver.cxx b/common/optimistic/driver.cxx deleted file mode 100644 index 6dfec6e..0000000 --- a/common/optimistic/driver.cxx +++ /dev/null @@ -1,300 +0,0 @@ -// file : common/optimistic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test optimistic concurrency support. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -unsigned long -version (const unique_ptr& db, unsigned long id) -{ - typedef odb::query query; - typedef odb::result result; - - result r (db->query (query::id == id)); - return r.empty () ? 0 : r.begin ()->ver; -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - object o (1); - o.num = 123; - o.str = "abc"; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Verify initial version in the instance and database. - // - assert (o.ver == 1); - { - transaction t (db->begin ()); - assert (version (db, 1) == 1); - t.commit (); - } - - object c (o); - o.num++; - o.str += 'd'; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - // Verify updated version in the instance and database. - // - assert (o.ver == 2); - { - transaction t (db->begin ()); - assert (version (db, 1) == 2); - t.commit (); - } - - // Verify the data has been updated. - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); - } - - // Try to update using outdated object. - // - c.num--; - c.str += 'z'; - - { - transaction t (db->begin ()); - - try - { - db->update (c); - assert (false); - } - catch (const object_changed&) {} - - // Verify the data hasn't changed. - // - unique_ptr o1 (db->load (1)); - assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); - - // Reload the object. - // - db->reload (c); - assert (c.ver == 2 && c.num == 124); - - // Check that we don't reload an object that is up-to-date. - // - c.num--; - db->reload (c); - assert (c.ver == 2 && c.num == 123); - - t.commit (); - } - - // Try to delete using an outdated object. - // - { - transaction t (db->begin ()); - - try - { - db->update (o); - db->erase (c); - assert (false); - } - catch (const object_changed&) {} - - t.commit (); - } - - // Try to delete using an up-to-date object. - // - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - - // Try to update deleted object. - // - { - transaction t (db->begin ()); - - try - { - db->update (o); - assert (false); - } - catch (const object_not_persistent&) - { - assert (false); - } - catch (const object_changed&) {} - - t.commit (); - } - - // Optimistic delete of objects with container requires - // extra logic. Test it here. - // - { - container o ("abc"); - o.nums.push_back (1); - o.nums.push_back (2); - o.nums.push_back (3); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - container c (o); - o.nums.pop_back (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - // Try to delete using an outdated object. - // - { - transaction t (db->begin ()); - - try - { - db->erase (c); - assert (false); - } - catch (const object_changed&) {} - - // Verify the container data hasn't changed. - // - unique_ptr o1 (db->load ("abc")); - assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); - - t.commit (); - } - - // Try to delete using an up-to-date object. - // - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test optimistic class inheritance. This is a shortened version - // of the object test. - // - { - derived o; - o.num = 123; - o.str = "abc"; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - derived c (o); - o.num++; - o.str += 'd'; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - // Try to update using outdated object. - // - c.num--; - c.str += 'z'; - - { - transaction t (db->begin ()); - - try - { - db->update (c); - assert (false); - } - catch (const object_changed&) {} - - // Reload the object. - // - db->reload (c); - assert (c.ver == 2 && c.num == 124); - - t.commit (); - } - - // Try to delete using an outdated object. - // - { - transaction t (db->begin ()); - - try - { - db->update (o); - db->erase (c); - assert (false); - } - catch (const object_changed&) {} - - t.commit (); - } - - // Try to delete using an up-to-date object. - // - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/optimistic/test.hxx b/common/optimistic/test.hxx deleted file mode 100644 index fcefa3d..0000000 --- a/common/optimistic/test.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : common/optimistic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db object optimistic -struct object -{ - object (): ver (123) {} - object (unsigned long id): id_ (id), ver (123) {} - - #pragma db id - unsigned long id_; - - #pragma db version - unsigned long ver; - - unsigned int num; - std::string str; -}; - -#pragma db view object(object) -struct object_version -{ - unsigned long ver; -}; - -// Optimistic class with a container. -// -#pragma db object optimistic -struct container -{ - container (): ver (123) {} - container (const std::string& id): id_ (id), ver (123) {} - - #pragma db id - std::string id_; - - #pragma db version - unsigned long ver; - - std::vector nums; -}; - -// Optimistic class inheritance. -// -#pragma db object abstract optimistic -struct base -{ - base (): ver (123) {} - - #pragma db id auto - unsigned long id_; - - #pragma db version - const unsigned long ver; - - std::string str; - - #pragma db readonly - std::string ro; -}; - -#pragma db object -struct derived: base -{ - unsigned int num; -}; - -#endif // TEST_HXX diff --git a/common/optimistic/testscript b/common/optimistic/testscript deleted file mode 100644 index 9ebafb2..0000000 --- a/common/optimistic/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/optimistic/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/pragma/buildfile b/common/pragma/buildfile deleted file mode 100644 index a2eeaa0..0000000 --- a/common/pragma/buildfile +++ /dev/null @@ -1,39 +0,0 @@ -# file : common/pragma/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pragma_ - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/pragma/driver.cxx b/common/pragma/driver.cxx deleted file mode 100644 index a9cc6e0..0000000 --- a/common/pragma/driver.cxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : common/pragma/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test #pragma db parsing. -// - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main () -{ -} diff --git a/common/pragma/test.hxx b/common/pragma/test.hxx deleted file mode 100644 index 6877e73..0000000 --- a/common/pragma/test.hxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : common/template/test.hxx -// 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/testscript b/common/pragma/testscript deleted file mode 100644 index 089f7a1..0000000 --- a/common/pragma/testscript +++ /dev/null @@ -1,31 +0,0 @@ -# file : common/include/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* &!odb-test.db -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $* -} diff --git a/common/prepared/buildfile b/common/prepared/buildfile deleted file mode 100644 index 4006a4f..0000000 --- a/common/prepared/buildfile +++ /dev/null @@ -1,43 +0,0 @@ -# file : common/prepared/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix prepared_ \ - --generate-schema \ - --generate-query \ - --generate-prepared \ - --omit-unprepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx deleted file mode 100644 index 44df651..0000000 --- a/common/prepared/driver.cxx +++ /dev/null @@ -1,444 +0,0 @@ -// file : common/prepared/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test prepared query functionality. -// - -#include // std::unique_ptr -#include // std::move -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct params -{ - unsigned short age; - std::string name; -}; - -static void -query_factory (const char* name, connection& c) -{ - typedef odb::query query; - - unique_ptr p (new params); - prepared_query pq ( - c.prepare_query ( - name, - query::age > query::_ref (p->age) && - query::name != query::_ref (p->name))); - c.cache_query (pq, move (p)); -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - { - person p1 ("John First", 91); - person p2 ("John Second", 81); - person p3 ("John Third", 71); - person p4 ("John Fourth", 61); - person p5 ("John Fifth", 51); - - transaction t (db->begin ()); - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - db->persist (p5); - t.commit (); - } - - typedef odb::query query; - typedef odb::prepared_query prep_query; - typedef odb::result result; - - // Uncached query in the same transaction. - // - { - transaction t (db->begin ()); - - unsigned short age (90); - prep_query pq ( - db->prepare_query ( - "person-age-query", - query::age > query::_ref (age))); - - for (unsigned short i (1); i < 6; ++i, age -= 10) - { - result r (pq.execute ()); - assert (size (r) == i); - } - - age = 90; - result r (pq.execute ()); - result::iterator i (r.begin ()); - assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); - assert (++i == r.end ()); - - t.commit (); - } - - // Uncached query in multiple transaction. - // - { - connection_ptr c (db->connection ()); - - unsigned short age (90); - prep_query pq ( - c->prepare_query ( - "person-age-query", - query::age > query::_ref (age))); - - for (unsigned short i (1); i < 6; ++i, age -= 10) - { - transaction t (c->begin ()); - - result r (pq.execute ()); - assert (size (r) == i); - - t.commit (); - } - - transaction t (c->begin ()); - - age = 90; - result r (pq.execute ()); - result::iterator i (r.begin ()); - assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); - assert (++i == r.end ()); - - t.commit (); - } - - // Cached query without parameters. - // - { - for (unsigned short i (1); i < 6; ++i) - { - transaction t (db->begin ()); - - prep_query pq (db->lookup_query ("person-val-age-query")); - - if (!pq) - { - assert (i == 1); - pq = db->prepare_query ( - "person-val-age-query", - query::age > 90); - db->cache_query (pq); - } - else if (i == 2) - { - try - { - db->cache_query (pq); - assert (false); - } - catch (const odb::prepared_already_cached&) - { - } - } - - result r (pq.execute ()); - assert (size (r) == 1); - - t.commit (); - } - } - - // Cached query with parameters. - // - { - for (unsigned short i (1); i < 6; ++i) - { - transaction t (db->begin ()); - - unsigned short* age; - prep_query pq (db->lookup_query ("person-ref-age-query", age)); - - if (!pq) - { - assert (i == 1); - - unique_ptr p (new unsigned short); - age = p.get (); - pq = db->prepare_query ( - "person-ref-age-query", - query::age > query::_ref (*age)); - - db->cache_query (pq, move (p)); - } - else if (i == 2) - { - // Object type mismatch. - // - try - { - db->lookup_query ("person-ref-age-query", age); - assert (false); - } - catch (const odb::prepared_type_mismatch&) - { - } - - // Parameters type mismatch. - // - try - { - int* age; - db->lookup_query ("person-ref-age-query", age); - assert (false); - } - catch (const odb::prepared_type_mismatch&) - { - } - } - - *age = 100 - i * 10; - result r (pq.execute ()); - assert (size (r) == i); - - t.commit (); - } - } - - // Cached query with factory. - // - { - db->query_factory ("person-params-query", &query_factory); - - for (unsigned int i (1); i < 6; ++i) - { - transaction t (db->begin ()); - - params* p; - prep_query pq (db->lookup_query ("person-params-query", p)); - assert (pq); - - p->age = 100 - i * 10; - p->name = "John First"; - result r (pq.execute ()); - assert (size (r) == i - 1); - - t.commit (); - } - - db->query_factory ("person-params-query", - database::query_factory_ptr ()); - } - - // Cached query with wildcard factory. - // - { - db->query_factory ("", &query_factory); - - for (unsigned int i (1); i < 6; ++i) - { - transaction t (db->begin ()); - - params* p; - prep_query pq (db->lookup_query ("person-params-query-1", p)); - assert (pq); - - p->age = 100 - i * 10; - p->name = "John First"; - result r (pq.execute ()); - assert (size (r) == i - 1); - - t.commit (); - } - - db->query_factory ("", database::query_factory_ptr ()); - } - - // Cached query with lambda factory. - // - { - db->query_factory ( - "person-params-query-2", - [] (const char* name, connection& c) - { - typedef odb::query query; - - unique_ptr p (new params); - prepared_query pq ( - c.prepare_query ( - name, - query::age > query::_ref (p->age) && - query::name != query::_ref (p->name))); - c.cache_query (pq, move (p)); - }); - - for (unsigned int i (1); i < 6; ++i) - { - transaction t (db->begin ()); - - params* p; - prep_query pq (db->lookup_query ("person-params-query-2", p)); - assert (pq); - - p->age = 100 - i * 10; - p->name = "John First"; - result r (pq.execute ()); - assert (size (r) == i - 1); - - t.commit (); - } - - db->query_factory ("person-params-query-2", - database::query_factory_ptr ()); - } - - // Cached query with lambda factory using closure. Forces nonoptimized - // representation of std::function. - // - { - const std::string person_name ("John First"); - - db->query_factory ( - "person-params-query-3", - [person_name] (const char* name, connection& c) - { - typedef odb::query query; - - prepared_query pq ( - c.prepare_query ( - name, - query::age > 50 && query::name != person_name)); - c.cache_query (pq); - }); - - { - transaction t (db->begin ()); - - prep_query pq (db->lookup_query ("person-params-query-3")); - assert (pq); - - result r (pq.execute ()); - assert (size (r) == 4); - - t.commit (); - } - - db->query_factory ("person-params-query-3", nullptr); - } - - // View prepared query. - // - { - typedef odb::query query; - typedef odb::prepared_query prep_query; - typedef odb::result result; - - transaction t (db->begin ()); - - unsigned short age (90); - prep_query pq ( - db->prepare_query ( - "person-view-age-query", - query::age > query::_ref (age))); - - for (unsigned short i (1); i < 6; ++i, age -= 10) - { - result r (pq.execute ()); - assert (size (r) == i); - } - - age = 90; - result r (pq.execute ()); - result::iterator i (r.begin ()); - assert (i != r.end () && i->name == "John First" && i->age == 91); - assert (++i == r.end ()); - - t.commit (); - } - - // By-ref parameter image growth. - // - { - transaction t (db->begin ()); - - string name; - prep_query pq ( - db->prepare_query ( - "person-name-query", - query::name != query::_ref (name))); - - { - name = "John First"; - result r (pq.execute ()); - assert (size (r) == 4); - } - - { - name.assign (2048, 'x'); - result r (pq.execute ()); - assert (size (r) == 5); - } - - t.commit (); - } - - // Test execute_one() and execute_value(). - // - { - transaction t (db->begin ()); - - person p ("John Doe", 23); - db->persist (p); - - prep_query pq1 ( - db->prepare_query ("query-1", query::id == p.id_)); - prep_query pq0 ( - db->prepare_query ("query-0", query::id == p.id_ + 1)); - - { - unique_ptr p (pq1.execute_one ()); - assert (p.get () != 0 && p->name_ == "John Doe"); - } - - { - unique_ptr p (pq0.execute_one ()); - assert (p.get () == 0); - } - - { - person p; - assert (pq1.execute_one (p) && p.name_ == "John Doe"); - } - - { - person p ("", 0); - assert (!pq0.execute_one (p) && - p.id_ == 0 && p.name_.empty () && p.age_ == 0); - } - - { - person p (pq1.execute_value ()); - assert (p.name_ == "John Doe"); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/prepared/test.hxx b/common/prepared/test.hxx deleted file mode 100644 index db16e67..0000000 --- a/common/prepared/test.hxx +++ /dev/null @@ -1,32 +0,0 @@ -// file : common/prepared/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct person -{ - person (): id_ (0) {} - person (const std::string& name, unsigned short age) - : id_ (0), name_ (name), age_ (age) {} - - #pragma db id auto - unsigned long id_; - - std::string name_; - unsigned short age_; -}; - -#pragma db view object(person) -struct person_view -{ - std::string name; - unsigned short age; -}; - -#endif // TEST_HXX diff --git a/common/prepared/testscript b/common/prepared/testscript deleted file mode 100644 index 3530c5b..0000000 --- a/common/prepared/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/prepared/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/query/array/buildfile b/common/query/array/buildfile deleted file mode 100644 index 3beb6d0..0000000 --- a/common/query/array/buildfile +++ /dev/null @@ -1,43 +0,0 @@ -# file : common/query/array/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_query_array_ \ - --generate-schema \ - --generate-query \ - --generate-prepared \ - --sql-name-case oracle:upper - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx deleted file mode 100644 index 9327751..0000000 --- a/common/query/array/driver.cxx +++ /dev/null @@ -1,220 +0,0 @@ -// file : common/query/array/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test query support for C arrays. -// - -#include -#include // std::unique_ptr -#include // std::memcpy -#include - -#include -#include - -#include // DATABASE_* -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -#ifndef MULTI_DATABASE -# if defined(DATABASE_MYSQL) -const odb::mysql::database_type_id bt = odb::mysql::id_blob; -# elif defined(DATABASE_SQLITE) -const odb::sqlite::database_type_id bt = odb::sqlite::id_blob; -# elif defined(DATABASE_PGSQL) -const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; -# elif defined(DATABASE_ORACLE) -const odb::oracle::database_type_id bt = odb::oracle::id_raw; -# elif defined(DATABASE_MSSQL) -const odb::mssql::database_type_id bt = odb::mssql::id_binary; -# else -# error unknown database -# endif -#endif - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - typedef odb::query query; - - const char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}; - - // - // - { - object o1 (1, "abc", buf); - object o2 (2, "bcd", buf); - object o3 (3, "cde", buf); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - - // string - // -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == "abc")) == 1); - assert (size (db->query (query::s == query::_val ("bcd"))) == 1); - assert (size (db->query ("s = " + query::_val ("bcd"))) == 1); - assert (size (db->query ("s = " + query::_ref ("bcd"))) == 1); -#endif - - { - char a[] = "bcd"; - char* ra = a; -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == a)) == 1); - assert (size (db->query (query::s == query::_val (a))) == 1); -#endif - assert (size (db->query (query::s == query::_ref (ra))) == 1); -#ifndef MULTI_DATABASE - assert (size (db->query ("s = " + query::_val (a))) == 1); - assert (size (db->query ("s = " + query::_ref (a))) == 1); -#endif - } - - { - const char a[] = "bcd"; - const char* ra = a; -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == a)) == 1); - assert (size (db->query (query::s == query::_val (a))) == 1); -#endif - assert (size (db->query (query::s == query::_ref (ra))) == 1); -#ifndef MULTI_DATABASE - assert (size (db->query ("s = " + query::_val (a))) == 1); - assert (size (db->query ("s = " + query::_ref (a))) == 1); -#endif - } - - { - const char* p = "cde"; -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == p)) == 1); - assert (size (db->query (query::s == query::_val (p))) == 1); -#endif - assert (size (db->query (query::s == query::_ref (p))) == 1); -#ifndef MULTI_DATABASE - assert (size (db->query ("s = " + query::_val (p))) == 1); - assert (size (db->query ("s = " + query::_ref (p))) == 1); -#endif - } - - { - char a[] = "cde"; - char* p = a; -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == p)) == 1); - assert (size (db->query (query::s == query::_val (p))) == 1); -#endif - assert (size (db->query (query::s == query::_ref (p))) == 1); -#ifndef MULTI_DATABASE - assert (size (db->query ("s = " + query::_val (p))) == 1); - assert (size (db->query ("s = " + query::_ref (p))) == 1); -#endif - } - -#ifndef MULTI_DATABASE - string s ("abc"); - //assert (size (db->query (query::s == s)) == 1); - assert (size (db->query (query::s == s.c_str ())) == 1); - //assert (size (db->query (query::s == query::_val (s))) == 1); - assert (size (db->query (query::s == query::_val (s.c_str ()))) == 1); - - assert (size (db->query ("s = " + query::_val (s))) == 1); - assert (size (db->query ("s = " + query::_ref (s))) == 1); -#endif - - // @@ BUILD2 Ends up with the following warning, but strangely only in the - // multi-database mode: - // - // In file included from odb/odb-tests/common/query/array/test-odb.hxx:31, - // from odb/odb-tests/common/query/array/driver.cxx:20: - // odb/libodb/odb/query-dynamic.hxx: In instantiation of ‘odb::query_base odb::query_column::operator==(const odb::query_column&) const [with T2 = char [17]; T = char [17]]’: - // odb/odb-tests/common/query/array/driver.cxx:144:7: required from here - // odb/libodb/odb/query-dynamic.hxx:895:43: error: comparison between two arrays is deprecated in C++20 [-Werror=array-compare] - // 895 | (void) (sizeof (type_instance () == type_instance ())); - // | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ - // odb/libodb/odb/query-dynamic.hxx:895:43: note: use unary ‘+’ which decays operands to pointers or ‘&‘indirect_ref’ not supported by dump_decl[0] == &‘indirect_ref’ not supported by dump_decl[0]’ to compare the addresses - // - // Looks like compile-time assertion. Doesn't make much sense for - // arrays since compares pointers to objects rather than objects. - // Should we somehow suppress the assertion for arrays or similar? - // - // Note: temporarily ifndef-ed. - // -#ifndef MULTI_DATABASE - assert (size (db->query (query::s == query::s1)) == 3); -#endif - - // std::array - // - array a; - memcpy (a.data (), "abc", 4); // VC++ strcpy deprecation. - -#ifndef MULTI_DATABASE - assert (size (db->query (query::a == a)) == 1); - assert (size (db->query (query::a == query::_val (a))) == 1); -#endif - assert (size (db->query (query::a == query::_ref (a))) == 1); -#ifndef MULTI_DATABASE - assert (size (db->query ("a = " + query::_val (a))) == 1); - assert (size (db->query ("a = " + query::_ref (a))) == 1); -#endif - - // char - // - assert (size (db->query (query::c == 'a')) == 1); - - char c ('b'); - assert (size (db->query (query::c == query::_val (c))) == 1); - assert (size (db->query (query::c == query::_ref (c))) == 1); - -#ifndef MULTI_DATABASE - assert (size (db->query ("c = " + query::_val ('c'))) == 1); - assert (size (db->query ("c = " + query::_ref (c))) == 1); -#endif - - assert (size (db->query (query::c == query::c1)) == 3); - - // buffer - // -#ifndef MULTI_DATABASE - assert (size (db->query (query::b == buf)) == 3); - assert (size (db->query (query::b == query::_val (buf))) == 3); -#endif - - assert (size (db->query (query::b == query::_ref (buf))) == 3); - -#ifndef MULTI_DATABASE - assert (size (db->query ("b = " + query::_val (buf))) == 3); - assert (size (db->query ("b = " + query::_ref (buf))) == 3); -#endif - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/query/array/test.hxx b/common/query/array/test.hxx deleted file mode 100644 index f0d5f3b..0000000 --- a/common/query/array/test.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : common/query/array/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include // std::memcpy, std::strlen - -#include - -#pragma db object -struct object -{ - object () {} - object (unsigned long id, const char* s, const char* b) - : id_ (id) - { - std::memcpy (s_, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - std::memcpy (s1_, s, std::strlen (s) + 1); - std::memcpy (a_.data (), s, std::strlen (s) + 1); - c_ = c1_ = *s; - std::memcpy (b_, b, sizeof (b_)); - } - - #pragma db id - unsigned long id_; - - char s_[17]; - char s1_[17]; - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_MYSQL) || \ - defined(ODB_DATABASE_PGSQL) || \ - defined(ODB_DATABASE_ORACLE) || \ - defined(ODB_DATABASE_MSSQL) -# pragma db type("VARCHAR(16)") -# elif defined(ODB_DATABASE_SQLITE) -# pragma db type("TEXT") -# elif defined(ODB_DATABASE_COMMON) -# pragma db type("DYMMU") // Necessary to make it a value. -# else -# error unknown database -# endif -#endif - std::array a_; - - char c_; - char c1_; - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_MYSQL) -# pragma db type("BINARY(16)") -# elif defined(ODB_DATABASE_SQLITE) -# pragma db type("BLOB") -# elif defined(ODB_DATABASE_PGSQL) -# pragma db type("BYTEA") -# elif defined(ODB_DATABASE_ORACLE) -# pragma db type("RAW(16)") -# elif defined(ODB_DATABASE_MSSQL) -# pragma db type("BINARY(16)") -# elif defined(ODB_DATABASE_COMMON) -# else -# error unknown database -# endif -#endif - char b_[16]; -}; - -#endif // TEST_HXX diff --git a/common/query/array/testscript b/common/query/array/testscript deleted file mode 100644 index 631ae24..0000000 --- a/common/query/array/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/query/array/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/query/basics/buildfile b/common/query/basics/buildfile deleted file mode 100644 index e38e6fe..0000000 --- a/common/query/basics/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/query/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_query_basics_ \ - --generate-schema \ - --generate-query \ - --generate-prepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/basics/driver.cxx b/common/query/basics/driver.cxx deleted file mode 100644 index 73b81d2..0000000 --- a/common/query/basics/driver.cxx +++ /dev/null @@ -1,668 +0,0 @@ -// file : common/query/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test basic query support. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include // DATABASE_XXX -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -void -print (result& r) -{ - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - unique_ptr o (i.load ()); - cout << *o << endl; - } - cout << endl; -} - -const char* names[] = { "John", "Jane", "Joe" }; -const char** names_end = names + sizeof (names)/sizeof (names[0]); - -const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; - -int -main (int argc, char* argv[]) -{ - buffer - key1 (key_data[0], key_data[0] + 3), - key2 (key_data[1], key_data[1] + 3), - key3 (key_data[2], key_data[2] + 3); - - try - { - unique_ptr db (create_database (argc, argv)); - odb::database_id db_id (db->id ()); - - typedef odb::query query; - typedef odb::result result; - - // - // - { - person p1 (1, "John", "Doe", 30, true, key1); - person p2 (2, "Jane", "Doe", 29, true, key2); - person p3 (3, "Joe", "Dirt", 31, false, key3); - p3.middle_name_.reset (new string ("Squeaky")); - person p4 (4, "Johansen", "Johansen", 32, false); - p4.middle_name_.reset (new string ("J")); - - transaction t (db->begin ()); - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - t.commit (); - } - - // - // Native queries. - // - - // Compilation tests. - // -#ifndef MULTI_DATABASE - if (false) - { - string name; - unsigned short age; - - db->query ("age = " + query::_ref (age)); - db->query ("age = " + query::_val (age)); - - query age_q (query::_ref (age) + " = age"); - query name_q ("first = " + query::_val (name)); - query q (age_q + "AND" + name_q); - - db->query (q); - db->query (age_q + "OR" + - name_q + "OR" + - "age < " + query::_ref (age)); - - query q1 (query::_val (name)); - q1 += " = first"; - } -#endif - - // Select-all query. - // - cout << "test 001" << endl; - { - transaction t (db->begin ()); - result r (db->query ()); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - person p; - i.load (p); - cout << p << endl; - } - - t.commit (); - } - - // Select-all query with order by. - // - cout << "test 002" << endl; - { - transaction t (db->begin ()); - result r (db->query ("ORDER BY" + query::age)); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - person& p (*i); - - cout << p.first_name_; - - if (i->middle_name_.get () != 0) - cout << ' ' << *i->middle_name_; - - cout << ' ' << i->last_name_ << ' ' << i->age_ << - (i->married_ ? " married" : " single") << endl; - } - cout << endl; - - t.commit (); - } - - // String query. - // - cout << "test 003" << endl; - { - transaction t (db->begin ()); - - result r; - if (db_id != odb::id_oracle) - r = db->query ("age >= 30 AND last = 'Doe'"); - else - r = db->query ("\"age\" >= 30 AND \"last\" = 'Doe'"); - - print (r); - t.commit (); - } - - // Value binding. - // - cout << "test 004" << endl; - { - transaction t (db->begin ()); - - const char* name = "Doe"; - -#if defined(MULTI_DATABASE) - result r ( - db->query ( - query::age >= query::_val (30) && - query::last_name == query::_val (name))); - -#elif defined(DATABASE_ORACLE) - result r ( - db->query ( - "\"age\" >= " + query::_val (30) + "AND" + - "\"last\" = " + query::_val (name))); -#else - result r ( - db->query ( - "age >= " + query::_val (30) + "AND" + - "last = " + query::_val (name))); -#endif - - print (r); - t.commit (); - } - - // Reference binding. - // - cout << "test 005" << endl; - { - transaction t (db->begin ()); - - string name; - unsigned short age; - -#if defined(MULTI_DATABASE) - query q (query::age >= query::_ref (age) && - query::last_name == query::_ref (name)); -#elif defined(DATABASE_ORACLE) - query q ("\"age\" >= " + query::_ref (age) + "AND" + - "\"last\" = " + query::_ref (name)); -#else - query q ("age >= " + query::_ref (age) + "AND" + - "last = " + query::_ref (name)); -#endif - - name = "Doe"; - age = 30; - result r (db->query (q)); - print (r); - - name = "Dirt"; - age = 31; - r = db->query (q); - print (r); - - t.commit (); - } - - // - // Language-embedded queries. - // - - // Compilation tests. - // - if (false) - { - string name; - unsigned short age; - - // Column operators. - // - query q1 (query::married); - db->query (query::married); - db->query (query::married == true); - - //db->query (query::age); - - db->query (query::age == 30); - db->query (query::age == age); - db->query (query::age == query::_val (30)); - db->query (query::age == query::_val (age)); - db->query (query::age == query::_ref (age)); - //db->query (query::age == "123"); - //db->query ("123" == query::age); - //db->query (query::age == query::_val ("123")); - //db->query (query::age == query::_ref (name)); - db->query (query::last_name == "Doe"); - db->query (query::last_name == name); -#ifndef MULTI_DATABASE - db->query (query::last_name == query::_val ("Doe")); -#endif - db->query (query::last_name == query::_val (name)); - db->query (query::last_name == query::_ref (name)); - //db->query (query::last_name == 30); - //db->query (query::last_name == query::_val (30)); - //db->query (query::last_name == query::_ref (age)); - - db->query (query::last_name.is_null ()); - db->query (query::last_name.is_not_null ()); - - db->query (query::first_name == query::last_name); - - db->query (query::first_name.in ("John", "Jane")); - db->query (query::first_name.in_range (names, names_end)); - - db->query (query::first_name.like ("J%")); - db->query (query::first_name.like ("J%!%", "!")); - - // Query operators. - // - db->query (query::age == 30 && query::last_name == "Doe"); - db->query (query::age == 30 || query::last_name == "Doe"); - db->query (!(query::age == 30 || query::last_name == "Doe")); - db->query ((query::last_name == "Doe") + "ORDER BY age"); - } - - // Test is_null/is_not_null. - // - cout << "test 006" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::middle_name.is_null ())); - print (r); - r = db->query (query::middle_name.is_not_null ()); - print (r); - t.commit (); - } - - // Test boolean columns. - // - cout << "test 007" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::married)); - print (r); - r = db->query (!query::married); - print (r); - t.commit (); - } - - // Test implicit by-value, explicit by-value, and by-reference. - // - cout << "test 008" << endl; - { - string name ("Dirt"); - - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe")); - print (r); - r = db->query (query::last_name == query::_val (name)); - print (r); - query q (query::last_name == query::_ref (name)); - name = "Doe"; - r = db->query (q); - print (r); - t.commit (); - } - - // Test column operators (==, !=, <, >, <=, >=). - // - cout << "test 009" << endl; - { - transaction t (db->begin ()); - - // == - // - result r (db->query (query::last_name == "Doe")); - print (r); - - // != - // - r = db->query (query::last_name != "Doe"); - print (r); - - // < - // - r = db->query (query::age < 31); - print (r); - - // > - // - r = db->query (query::age > 30); - print (r); - - // <= - // - r = db->query (query::age <= 30); - print (r); - - // >= - // - r = db->query (query::age >= 31); - print (r); - - t.commit (); - } - - // Test query operators (&&, ||, (), !, +). - // - cout << "test 010" << endl; - { - transaction t (db->begin ()); - - // && - // - result r (db->query ( - query::last_name == "Doe" && query::age == 29)); - print (r); - - // || - // - r = db->query (query::last_name == "Doe" || query::age == 31); - print (r); - - // () - // - r = db->query ( - (query::last_name != "Doe" || query::age == 29) && query::married); - print (r); - - // != - // - r = db->query (!(query::last_name == "Doe")); - print (r); - - // + - // - r = db->query ((query::last_name == "Doe") + - "ORDER BY" + query::age); - print (r); - - t.commit (); - } - - // Test in/in_range. - // - cout << "test 011" << endl; - { - transaction t (db->begin ()); - - result r (db->query (query::first_name.in ("John", "Jane"))); - print (r); - - r = db->query (query::first_name.in_range (names, names_end)); - print (r); - - // Empty range. - // - r = db->query (query::last_name == "Doe" && - query::first_name.in_range (names, names)); - assert (r.empty ()); - - t.commit (); - } - - // Test column-to-column comparison. - // - cout << "test 012" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::first_name == query::last_name)); - print (r); - t.commit (); - } - - // Test value_traits::value_type != value_traits::query_type. - // - cout << "test 013" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::middle_name == "Squeaky")); - print (r); - t.commit (); - } - - // Test that loading of the same object type during iteration does - // not invalidate the result. - // - cout << "test 014" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - ++i; - assert (i != r.end ()); - - { - unique_ptr joe (db->load (3)); - } - - { - person p (5, "Peter", "Peterson", 70, false, key3); - db->persist (p); - db->erase (p); - } - - // SQL Server does not support re-loading of an object with long data - // from a query result. - // - if (db_id != odb::id_mssql) - assert (i->last_name_ == "Doe"); // Actual load. - - // Overwrite object image again. - // - unique_ptr joe (db->load (3)); - person p; - i.load (p); - assert (p.last_name_ == "Doe"); - - t.commit (); - } - - // Test uncached result. - // - cout << "test 015" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Doe", false)); - print (r); - t.commit (); - } - - // Test BLOB column operations. - // - cout << "test 016" << endl; - { - transaction t (db->begin ()); - - result r; - result::iterator i; - - // == - // - - // Oracle does not support LOB comparisons. - // -#if defined(MULTI_DATABASE) || !defined(DATABASE_ORACLE) - if (db_id != odb::id_oracle) - { - r = db->query (query::public_key == key2); - - i = r.begin (); - assert (i != r.end ()); - - assert (*i->public_key_ == key2); - assert (++i == r.end ()); - } -#endif - - // is_null - // - r = db->query (query::public_key.is_null ()); - - i = r.begin (); - assert (i != r.end ()); - - assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen"); - assert (++i == r.end ()); - - // is_not_null - // - r = db->query (query::public_key.is_not_null ()); - - i = r.begin (); - assert (i != r.end ()); - - assert (i->first_name_ == "John" && i->last_name_ == "Doe"); - assert (++i != r.end ()); - - assert (i->first_name_ == "Jane" && i->last_name_ == "Doe"); - assert (++i != r.end ()); - - assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt"); - assert (++i == r.end ()); - - t.commit (); - } - - // Test iterator::id(). - // - cout << "test 017" << endl; - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "Dirt")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i.id () == 3); - - t.commit (); - } - - // Test empty result set. - // - cout << "test 018" << endl; - { - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.begin () == r.end ()); - t.commit (); - } - } - - // Test size() validity at the beginning/middle/end of result set. - // - cout << "test 019" << endl; - if (db_id != odb::id_sqlite && - db_id != odb::id_oracle && - db_id != odb::id_mssql) - { - { - transaction t (db->begin ()); - result r (db->query ()); - assert (r.size () == 4); - result::iterator i (r.begin ()); - assert (r.size () == 4); - ++i; - ++i; - ++i; - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (false)); - result::iterator i (r.begin ()); - ++i; - ++i; - r.cache (); // Cache in the middle. - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - ++i; - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (false)); - result::iterator i (r.begin ()); - ++i; - ++i; - ++i; - r.cache (); // Cache at the end. - assert (r.size () == 4); - } - - { - transaction t (db->begin ()); - result r (db->query (query::last_name == "None")); - assert (r.size () == 0); - for (result::iterator i (r.begin ()); i != r.end (); ++i) ; - assert (r.size () == 0); - } - } - - // Test like. - // - cout << "test 020" << endl; - { - transaction t (db->begin ()); - - result r (db->query (query::first_name.like ("Jo%"))); - print (r); - - r = db->query (!query::first_name.like ("Jo%")); - print (r); - - r = db->query (query::first_name.like ("Jo!%", "!")); - print (r); - - // In Oracle one can only escape special characters (% and _). - // - string v; - if (db_id != odb::id_oracle) - v = "!Ja%"; - else - v = "Ja%"; - - r = db->query (query::first_name.like (query::_ref (v), "!")); - print (r); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/query/basics/test.hxx b/common/query/basics/test.hxx deleted file mode 100644 index 239f6d6..0000000 --- a/common/query/basics/test.hxx +++ /dev/null @@ -1,117 +0,0 @@ -// file : common/query/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include - -#include -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -# define BLOB_TYPE "VARBINARY(max)" -# else -# define BLOB_TYPE "BLOB" -# endif -#endif - -typedef std::vector buffer; -typedef odb::nullable nullable_buffer; - -#pragma db object -struct person -{ - person (unsigned long id, - const std::string& fn, - const std::string& ln, - unsigned short age, - bool married, - const nullable_buffer& public_key = nullable_buffer ()) - : id_ (id), - first_name_ (fn), - last_name_ (ln), - age_ (age), - married_ (married), - public_key_ (public_key) - { - } - - person () - { - } - - #pragma db id - unsigned long id_; - - #pragma db column ("first") - std::string first_name_; - - #pragma db column ("middle") null - std::unique_ptr middle_name_; - - #pragma db column ("last") - std::string last_name_; - - unsigned short age_; - bool married_; - - #pragma db column ("key") type(BLOB_TYPE) null - nullable_buffer public_key_; -}; - -inline std::ostream& -operator<< (std::ostream& os, const person& p) -{ - os << p.first_name_; - - if (p.middle_name_.get () != 0) - os << ' ' << *p.middle_name_; - - os << ' ' << p.last_name_ << ' ' << p.age_ << - (p.married_ ? " married" : " single"); - - return os; -} - -// Test member name conflicts (compilation-only test). -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object - struct object - { - #pragma db id - int id; - }; - - #pragma db value - struct value - { - object* m_object; - }; - - #pragma db value - struct bar - { - value m_value; - }; - - #pragma db object - struct foo - { - #pragma db id - int id; - - bar m_value; - }; -} - -#endif // TEST_HXX diff --git a/common/query/basics/testscript b/common/query/basics/testscript deleted file mode 100644 index 9086b66..0000000 --- a/common/query/basics/testscript +++ /dev/null @@ -1,150 +0,0 @@ -# file : common/query/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -+cat <=output - test 001 - John Doe 30 married - Jane Doe 29 married - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - test 002 - Jane Doe 29 married - John Doe 30 married - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - test 003 - John Doe 30 married - - test 004 - John Doe 30 married - - test 005 - John Doe 30 married - - Joe Squeaky Dirt 31 single - - test 006 - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - test 007 - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - test 008 - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - - John Doe 30 married - Jane Doe 29 married - - test 009 - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - John Doe 30 married - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - test 010 - Jane Doe 29 married - - John Doe 30 married - Jane Doe 29 married - Joe Squeaky Dirt 31 single - - Jane Doe 29 married - - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - Jane Doe 29 married - John Doe 30 married - - test 011 - John Doe 30 married - Jane Doe 29 married - - John Doe 30 married - Jane Doe 29 married - Joe Squeaky Dirt 31 single - - test 012 - Johansen J Johansen 32 single - - test 013 - Joe Squeaky Dirt 31 single - - test 014 - test 015 - John Doe 30 married - Jane Doe 29 married - - test 016 - test 017 - test 018 - test 019 - test 020 - John Doe 30 married - Joe Squeaky Dirt 31 single - Johansen J Johansen 32 single - - Jane Doe 29 married - - - Jane Doe 29 married - - EOI - -test.redirects += >>>../output - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/query/one/buildfile b/common/query/one/buildfile deleted file mode 100644 index 76a36b0..0000000 --- a/common/query/one/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/query/one/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_query_one_ \ - --generate-schema \ - --generate-query \ - --generate-prepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/query/one/driver.cxx b/common/query/one/driver.cxx deleted file mode 100644 index 4c3dcdc..0000000 --- a/common/query/one/driver.cxx +++ /dev/null @@ -1,205 +0,0 @@ -// file : common/query/one/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test query one support. -// -// We assume that other tests in common/query/ exercise a variety of -// different kinds of queries. Here we are concerned with what is -// specific to query_one() and query_value(). -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - odb::database_id db_id (db->id ()); - - transaction t (db->begin ()); - - // query_one() - // - { - unique_ptr o (db->query_one ()); - assert (o.get () == 0); - } - - { - object o (4); - assert (!db->query_one (o) && o.id_ == 4 && o.str_.empty ()); - } - - /* - { - object o (db->query_value ()); - assert (false); - } - */ - - object o (1); - o.str_ = "value 1"; - db->persist (o); - - { - unique_ptr o (db->query_one ()); - assert (o.get () != 0 && o->str_ == "value 1"); - } - - { - object o; - assert (db->query_one (o) && o.str_ == "value 1"); - } - - { - object o (db->query_value ()); - assert (o.str_ == "value 1"); - } - - // query_one(const char*) - // - const char* q1_c (db_id == odb::id_oracle ? "\"id\" = 1" : "id = 1"); - const char* q0_c (db_id == odb::id_oracle ? "\"id\" = 2" : "id = 2"); - - { - unique_ptr o (db->query_one (q1_c)); - assert (o.get () != 0 && o->str_ == "value 1"); - } - - { - unique_ptr o (db->query_one (q0_c)); - assert (o.get () == 0); - } - - { - object o; - assert (db->query_one (q1_c, o) && o.str_ == "value 1"); - } - - { - object o (4); - assert (!db->query_one (q0_c, o) && - o.id_ == 4 && o.str_.empty ()); - } - - { - object o (db->query_value (q1_c)); - assert (o.str_ == "value 1"); - } - - // query_one(std::string) - // - string q1_s (q1_c); - string q0_s (q0_c); - - { - unique_ptr o (db->query_one (q1_s)); - assert (o.get () != 0 && o->str_ == "value 1"); - } - - { - unique_ptr o (db->query_one (q0_s)); - assert (o.get () == 0); - } - - { - object o; - assert (db->query_one (q1_s, o) && o.str_ == "value 1"); - } - - { - object o (4); - assert (!db->query_one (q0_s, o) && - o.id_ == 4 && o.str_.empty ()); - } - - { - object o (db->query_value (q1_s)); - assert (o.str_ == "value 1"); - } - - // query_one(odb::query) - // - typedef odb::query query; - - query q1 (query::id == 1); - query q0 (query::id == 2); - - { - unique_ptr o (db->query_one (q1)); - assert (o.get () != 0 && o->str_ == "value 1"); - } - - { - unique_ptr o (db->query_one (q0)); - assert (o.get () == 0); - } - - { - object o; - assert (db->query_one (q1, o) && o.str_ == "value 1"); - } - - { - object o (4); - assert (!db->query_one (q0, o) && o.id_ == 4 && o.str_.empty ()); - } - - { - object o (db->query_value (q1)); - assert (o.str_ == "value 1"); - } - - // Assertion on more than one element. - // - { - object o (2); - o.str_ = "value 2"; - db->persist (o); - } - - /* - { - unique_ptr o (db->query_one ()); - assert (false); - } - */ - - /* - { - object o; - db->query_one (o); - assert (false); - } - */ - - /* - { - object o (db->query_value ()); - assert (false); - } - */ - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx deleted file mode 100644 index 3008063..0000000 --- a/common/query/one/test.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : common/query/one/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; - std::string str_; -}; - -#endif // TEST_HXX diff --git a/common/query/one/testscript b/common/query/one/testscript deleted file mode 100644 index 963a206..0000000 --- a/common/query/one/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/query/one/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/readonly/buildfile b/common/readonly/buildfile deleted file mode 100644 index 2d83cf1..0000000 --- a/common/readonly/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/readonly/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix readonly_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx deleted file mode 100644 index b207627..0000000 --- a/common/readonly/driver.cxx +++ /dev/null @@ -1,324 +0,0 @@ -// file : common/readonly/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test readonly members/objects. Also test that const members are -// treated as readonly. For other const member tests, see the const- -// member test. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include // DATABASE_* -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Simple. - // - { - simple o (1, 1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.ro++; - const_cast (o.co)++; - o.rw++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, o); - t.commit (); - } - - assert (o.ro == 1 && o.co == 1 && o.rw == 2); - } - - // Pointer. - // - { - pointer p (1, new pointer (2)); - unique_ptr p1 (new pointer (3)); - - { - transaction t (db->begin ()); - db->persist (p); - db->persist (p.ro); - db->persist (*p1); - t.commit (); - } - - delete p.ro; - p.ro = p1.release (); - const_cast (p.co) = p.ro; - p.rw = p.ro; - - { - transaction t (db->begin ()); - db->update (p); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (1)); - t.commit (); - - assert (p->ro->id == 2 && p->co->id == 2 && p->rw->id == 3); - } - } - - // Composite. - // - { - composite o (1, 1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.ro.v++; - o.ro.ro++; - const_cast (o.ro.co)++; - o.ro.rw++; - - value& co (const_cast (o.co)); - co.v++; - co.ro++; - const_cast (co.co)++; - co.rw++; - - o.rw.v++; - o.rw.ro++; - const_cast (o.rw.co)++; - o.rw.rw++; - - o.v.v++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, o); - t.commit (); - } - - assert (o.ro.v == 1 && - o.ro.ro == 1 && - o.ro.co == 1 && - o.ro.rw == 1 && - - o.co.v == 1 && - o.co.ro == 1 && - o.co.co == 1 && - o.co.rw == 1 && - - o.rw.v == 1 && - o.rw.ro == 1 && - o.rw.co == 1 && - o.rw.rw == 2 && - - o.v.v == 1); - } - - // Container. - // - { - typedef vector ulongs; - - container o (1); - - o.ro.push_back (1); - o.ro.push_back (2); - - ulongs& co (const_cast (o.co)); - co.push_back (1); - co.push_back (2); - - o.rw.push_back (1); - o.rw.push_back (2); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.ro[0]++; - o.ro.pop_back (); - - co[0]++; - co.pop_back (); - - o.rw[0]++; - o.rw.pop_back (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, o); - t.commit (); - } - - assert (o.ro.size () == 2 && o.ro[0] == 1 && o.ro[1] == 2 && - o.co.size () == 2 && o.co[0] == 1 && o.co[1] == 2 && - o.rw.size () == 1 && o.rw[0] == 2); - } - - // Readonly object. - // - { -#ifndef MULTI_DATABASE - typedef odb::object_traits_impl so_traits; - typedef odb::object_traits_impl ro_traits; - typedef odb::object_traits_impl rw_traits; - - assert (so_traits::column_count == - so_traits::id_column_count + so_traits::readonly_column_count); - - assert (ro_traits::column_count == - ro_traits::id_column_count + ro_traits::readonly_column_count); - - assert (rw_traits::column_count != - rw_traits::id_column_count + rw_traits::readonly_column_count); -#endif - - simple_object so (1, 1); - ro_object ro_o (1, 1); - rw_object rw_o (1, 1); - - ro_o.cr.push_back (1); - ro_o.cr.push_back (2); - - rw_o.cr.push_back (1); - rw_o.cr.push_back (2); - - { - transaction t (db->begin ()); - db->persist (so); - db->persist (ro_o); - db->persist (rw_o); - t.commit (); - } - - rw_o.sv++; - rw_o.rw_sv++; - - { - transaction t (db->begin ()); - //db->update (so); // Compile error. - //db->update (ro_o); // Compile error. - db->update (rw_o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, so); - db->load (1, ro_o); - db->load (1, rw_o); - t.commit (); - } - - assert (rw_o.sv == 1 && rw_o.rw_sv == 2); - } - - // Readonly object. - // - { - wrapper o (1, 1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - *o.pl = 2; - *o.cpl = 2; - o.pcl.reset (new unsigned long (2)); - const_cast (*o.cpcl) = 2; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->load (1, o); - t.commit (); - } - - assert (*o.pl == 2 && *o.cpl == 2 && *o.pcl == 2 && *o.cpcl == 1); - } - - // Readonly object with auto id. - // - { - ro_auto o1 (1); - ro_auto o2 (2); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p1->num == o1.num); - assert (p2->num == o2.num); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/readonly/test.hxx b/common/readonly/test.hxx deleted file mode 100644 index 45797b6..0000000 --- a/common/readonly/test.hxx +++ /dev/null @@ -1,225 +0,0 @@ -// file : common/readonly/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include // std::unique_ptr - -#include - -// Simple readonly object. -// -#pragma db object -struct simple -{ - simple (unsigned long i, unsigned long x) - : id (i), ro (x), co (x), rw (x) - { - } - - simple (): co (0) {} - - #pragma db id - unsigned long id; - - #pragma db readonly - unsigned long ro; - - const unsigned long co; - - unsigned long rw; -}; - -// Readonly pointer. -// -#pragma db object -struct pointer -{ - pointer (unsigned long i, pointer* p = 0): id (i), ro (p), co (p), rw (p) {} - pointer (): ro (0), co (0), rw (0) {} - - ~pointer () - { - delete ro; - - if (co != ro) - delete co; - - if (rw != ro && rw != co) - delete rw; - } - - #pragma db id - unsigned long id; - - #pragma db readonly - pointer* ro; - - pointer* const co; - - pointer* rw; -}; - -// Composite readonly value as well as simple readonly value inside -// a composite. -// -#pragma db value readonly -struct ro_value -{ - ro_value () {} - ro_value (unsigned long x): v (x) {} - - unsigned long v; -}; - -#pragma db value -struct value: ro_value -{ - value (): co (0) {} - value (unsigned long x): ro_value (x), ro (x), co (x), rw (x) {} - - #pragma db readonly - unsigned long ro; - - const unsigned long co; - - unsigned long rw; -}; - -#pragma db object -struct composite -{ - composite (unsigned long i, unsigned long x) - : id (i), ro (x), co (x), rw (x), v (x) - { - } - - composite () {} - - #pragma db id - unsigned long id; - - #pragma db readonly - value ro; - - const value co; - - value rw; - ro_value v; -}; - -// Readonly container. -// -#pragma db object -struct container -{ - container (unsigned long i): id (i) {} - container () {} - - #pragma db id - unsigned long id; - - #pragma db readonly - std::vector ro; - - const std::vector co; - - std::vector rw; -}; - -// Readonly object. -// -#pragma db object readonly -struct simple_object -{ - simple_object (unsigned long i, unsigned long x): id (i), sv (x) {} - simple_object () {} - - #pragma db id - unsigned long id; - - unsigned long sv; -}; - -#pragma db object -struct object -{ - object (unsigned long i, unsigned long x): id (i), sv (x) {} - object () {} - - #pragma db id - unsigned long id; - - unsigned long sv; -}; - -#pragma db object readonly -struct ro_object: object -{ - ro_object (unsigned long i, unsigned long x) - : object (i, x), cv (x) - { - } - - ro_object () {} - - value cv; - std::vector cr; -}; - -#pragma db object -struct rw_object: ro_object -{ - rw_object (unsigned long i, unsigned long x) - : ro_object (i, x), rw_sv (x) - { - } - - rw_object () {} - - unsigned long rw_sv; -}; - -// Readonly wrappers. Here we make sure that only const wrappers with -// const wrapped types are automatically treated as readonly. -// -#pragma db object -struct wrapper -{ - wrapper (unsigned long i, unsigned long x) - : id (i), - pl (new unsigned long (x)), - cpl (new unsigned long (x)), - pcl (new unsigned long (x)), - cpcl (new unsigned long (x)) - { - } - - wrapper () {} - - #pragma db id - unsigned long id; - - std::unique_ptr pl; - const std::unique_ptr cpl; - std::unique_ptr pcl; - const std::unique_ptr cpcl; -}; - -// Readonly object with auto id. -// -#pragma db object readonly -struct ro_auto -{ - ro_auto (unsigned long n): num (n) {} - ro_auto () {} - - #pragma db id auto - unsigned long id; - - unsigned long num; -}; - -#endif // TEST_HXX diff --git a/common/readonly/testscript b/common/readonly/testscript deleted file mode 100644 index c798201..0000000 --- a/common/readonly/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/readonly/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/relationship/basics/buildfile b/common/relationship/basics/buildfile deleted file mode 100644 index d7bbb7e..0000000 --- a/common/relationship/basics/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/relationship/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_rel_basics_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/basics/driver.cxx b/common/relationship/basics/driver.cxx deleted file mode 100644 index e27c127..0000000 --- a/common/relationship/basics/driver.cxx +++ /dev/null @@ -1,150 +0,0 @@ -// file : common/relationship/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object relationships. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - aggr a ("aggr"); - a.o1 = new obj1 ("o1", "obj1"); - a.o2.reset (new obj2 ("obj2")); - - a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); - a.v2.push_back (0); - a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); - - a.o3.reset (new obj3 ("obj3")); - - a.c.num = 123; - a.c.o3.reset (new obj3 ("c")); - - a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); - a.cv.push_back (comp (235, obj3_ptr ())); - a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); - - a.v1.push_back (new obj1 ("v1 0", "v1 0")); - a.v1.push_back (0); - a.v1.push_back (new obj1 ("v1 2", "v1 2")); - - // Set cannot contain NULL pointers. - // - a.s1.insert (new obj1 ("s1 0", "s1 0")); - a.s1.insert (new obj1 ("s1 2", "s1 2")); - - a.m1[0] = new obj1 ("m1 0", "m1 0"); - a.m1[1] = 0; - a.m1[2] = new obj1 ("m1 2", "m1 2"); - - // persist - // - { - transaction t (db->begin ()); - db->persist (a.o1); - db->persist (a.o2); - - for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) - if (*i) - db->persist (*i); - - db->persist (a.o3); - - db->persist (a.c.o3); - - for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) - if (i->o3) - db->persist (i->o3); - - for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) - if (*i) - db->persist (*i); - - for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) - if (*i) - db->persist (*i); - - for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) - if (i->second) - db->persist (i->second); - - db->persist (a); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - unique_ptr a1 (db->load (a.id)); - t.commit (); - - assert (*a1 == a); - } - - // query - // - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query (query::o1->str == "obj1")); - assert (!r.empty ()); - assert (r.begin ()->o1->id == a.o1->id); - assert (size (r) == 1); - - t.commit (); - } - - // Test NULL pointer. - // - delete a.o1; - a.o1 = 0; - a.o2.reset (); - a.o3.reset (); - - { - transaction t (db->begin ()); - db->update (a); - t.commit (); - } - - // load & compare - // - { - transaction t (db->begin ()); - unique_ptr a1 (db->load (a.id)); - t.commit (); - - assert (*a1 == a); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/relationship/basics/test.hxx b/common/relationship/basics/test.hxx deleted file mode 100644 index 8a2742e..0000000 --- a/common/relationship/basics/test.hxx +++ /dev/null @@ -1,260 +0,0 @@ -// file : common/relationship/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include -#include - -#include - -// Raw pointer. -// -#pragma db object pointer(obj1*) -struct obj1 -{ - obj1 () {} - obj1 (const std::string& i, const std::string& s): id (i), str (s) {} - - #pragma db id - std::string id; - std::string str; -}; - -inline bool -operator== (const obj1& x, const obj1& y) -{ - return x.id == y.id && x.str == y.str; -} - -// vector -// -typedef std::vector obj1_vec; - -inline bool -operator== (const obj1_vec& x, const obj1_vec& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_vec::size_type i (0); i < x.size (); ++i) - if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) - return false; - - return true; -} - -// set -// -struct obj1_cmp -{ - bool - operator() (obj1* x, obj1* y) const - { - return (!x || !y) ? x < y : x->id < y->id; - } -}; - -typedef std::set obj1_set; - -inline bool -operator== (const obj1_set& x, const obj1_set& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_set::const_iterator i (x.begin ()); i != x.end (); ++i) - { - obj1_set::const_iterator j (y.find (*i)); - - if (j == y.end ()) - return false; - - obj1* x (*i); - obj1* y (*j); - - if (!(x ? (y && *x == *y) : !y)) - return false; - } - - return true; -} - -// map -// -typedef std::map obj1_map; - -inline bool -operator== (const obj1_map& x, const obj1_map& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj1_map::const_iterator i (x.begin ()); i != x.end (); ++i) - { - obj1_map::const_iterator j (y.find (i->first)); - - if (j == y.end ()) - return false; - - obj1* x (i->second); - obj1* y (j->second); - - if (!(x ? (y && *x == *y) : !y)) - return false; - } - - return true; -} - -// auto_ptr/unique_ptr -// -struct obj2; - -typedef std::unique_ptr obj2_ptr; - -#pragma db object pointer(obj2_ptr) -struct obj2 -{ - obj2 () {} - obj2 (const std::string& s): str (s) {} - - #pragma db id auto - unsigned long id; - - std::string str; -}; - -inline bool -operator== (const obj2& x, const obj2& y) -{ - return x.id == y.id && x.str == y.str; -} - -typedef std::vector obj2_vec; - -inline bool -operator== (const obj2_vec& x, const obj2_vec& y) -{ - if (x.size () != y.size ()) - return false; - - for (obj2_vec::size_type i (0); i < x.size (); ++i) - if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) - return false; - - return true; -} - -// shared_ptr -// -struct obj3; - -typedef std::shared_ptr obj3_ptr; - -#pragma db object pointer(obj3_ptr) -struct obj3 -{ - obj3 () {} - obj3 (const std::string& s): str (s) {} - - #pragma db id auto - unsigned long id; - - std::string str; -}; - -inline bool -operator== (const obj3& x, const obj3& y) -{ - return x.id == y.id && x.str == y.str; -} - -// composite -// -#pragma db value -struct comp -{ - comp () {} - comp (int n, obj3_ptr o): num (n), o3 (o) {} - - int num; - obj3_ptr o3; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && - (x.o3 ? (y.o3 && *x.o3 == *y.o3) : !y.o3); -} - -typedef std::vector comp_vec; - -// -// -#pragma db object -struct aggr -{ - aggr (): o1 (0) {} - aggr (const std::string& s): o1 (0), str (s) {} - - ~aggr () - { - delete o1; - - for (obj1_vec::iterator i (v1.begin ()); i != v1.end (); ++i) - delete *i; - - for (obj1_set::iterator i (s1.begin ()); i != s1.end (); ++i) - delete *i; - - for (obj1_map::iterator i (m1.begin ()); i != m1.end (); ++i) - delete i->second; - } - - #pragma db id auto - unsigned long id; - - obj1* o1; - - obj2_ptr o2; // std::auto_ptr or std::unique_ptr - obj2_vec v2; - - obj3_ptr o3; - comp c; - comp_vec cv; - - obj1_vec v1; - obj1_set s1; - obj1_map m1; - - std::string str; - -private: - aggr (const aggr&); - aggr& operator= (const aggr&); -}; - -inline bool -operator== (const aggr& x, const aggr& y) -{ - return - x.id == y.id && - (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && - (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && - x.v2 == y.v2 && - (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && - x.c == y.c && - x.cv == y.cv && - x.v1 == y.v1 && - x.s1 == y.s1 && - x.m1 == y.m1 && - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/common/relationship/basics/testscript b/common/relationship/basics/testscript deleted file mode 100644 index b498bfa..0000000 --- a/common/relationship/basics/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/relationship/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/relationship/on-delete/buildfile b/common/relationship/on-delete/buildfile deleted file mode 100644 index 965a2eb..0000000 --- a/common/relationship/on-delete/buildfile +++ /dev/null @@ -1,43 +0,0 @@ -# file : common/relationship/on-delete/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_rel_on_d_ \ - --generate-schema \ - --fkeys-deferrable-mode mysql:not_deferrable \ - --fkeys-deferrable-mode mssql:not_deferrable - - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/on-delete/driver.cxx b/common/relationship/on-delete/driver.cxx deleted file mode 100644 index eec57cf..0000000 --- a/common/relationship/on-delete/driver.cxx +++ /dev/null @@ -1,82 +0,0 @@ -// file : common/relationship/on-delete/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test ON DELETE functionality. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - object o; - - cascade c; - c.p = &o; - - cascade_cont cc; - cc.p.push_back (&o); - - set_null n; - n.p = &o; - - set_null_cont nc; - nc.p.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (c); - db->persist (cc); - db->persist (n); - db->persist (nc); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - - { - transaction t (db->begin ()); - assert (db->find (c.id) == 0); - - unique_ptr pcc (db->load (cc.id)); - assert (pcc->p.empty ()); - - unique_ptr pn (db->load (n.id)); - assert (pn->p == 0); - - unique_ptr pnc (db->load (nc.id)); - assert (pnc->p.size () == 1 && pnc->p[0] == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx deleted file mode 100644 index 841acd9..0000000 --- a/common/relationship/on-delete/test.hxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : common/relationship/on-delete/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id; -}; - -#pragma db object -struct cascade -{ - #pragma db id auto - unsigned long id; - - #pragma db on_delete(cascade) - object* p; -}; - -#pragma db object -struct cascade_cont -{ - #pragma db id auto - unsigned long id; - - #pragma db on_delete(cascade) - std::vector p; -}; - -#pragma db object -struct set_null -{ - #pragma db id auto - unsigned long id; - - #pragma db on_delete(set_null) - object* p; -}; - -#pragma db object -struct set_null_cont -{ - #pragma db id auto - unsigned long id; - - #pragma db on_delete(set_null) - std::vector p; -}; - -#endif // TEST_HXX diff --git a/common/relationship/on-delete/testscript b/common/relationship/on-delete/testscript deleted file mode 100644 index 8288ebc..0000000 --- a/common/relationship/on-delete/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/relationship/on-delete/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/relationship/query/buildfile b/common/relationship/query/buildfile deleted file mode 100644 index b70edc4..0000000 --- a/common/relationship/query/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/relationship/query/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_rel_query_ \ - --generate-schema \ - --generate-query \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/relationship/query/driver.cxx b/common/relationship/query/driver.cxx deleted file mode 100644 index 20d5370..0000000 --- a/common/relationship/query/driver.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// file : common/relationship-query/query/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test relationship queries. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // - // - { - shared_ptr ca (new country ("CA", "Canada")); - shared_ptr za (new country ("ZA", "South Africa")); - shared_ptr us (new country ("US", "United States")); - shared_ptr se (new country ("SE", "Sweden")); - - shared_ptr st (new employer ("Simple Tech, Inc", ca)); - shared_ptr ct (new employer ("Complex Tech, Inc", us)); - - // person - // - shared_ptr p1 ( - new person (1, "John", "Doe", 30, ca, true, za)); - - shared_ptr p2 ( - new person (2, "Jane", "Doe", 29, za, false, us)); - p2->husband = p1; - - shared_ptr p3 ( - new person (3, "Joe", "Dirt", 31, us, true, us)); - - shared_ptr p4 ( - new person (4, "Johan", "Johansen", 32, se, false, ca)); - - // employee - // - shared_ptr e1 ( - new employee (1, "John", "Doe", 30, ca, true, za, st)); - - shared_ptr e2 ( - new employee (2, "Jane", "Doe", 29, za, false, us, ct)); - e2->husband = p1; - - shared_ptr e3 ( - new employee (3, "Joe", "Dirt", 31, us, true, us, st)); - - shared_ptr e4 ( - new employee (4, "Johan", "Johansen", 32, se, false, ca, ct)); - - transaction t (db->begin ()); - db->persist (ca); - db->persist (za); - db->persist (us); - db->persist (se); - - db->persist (st); - db->persist (ct); - - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - - db->persist (e1); - db->persist (e2); - db->persist (e3); - db->persist (e4); - t.commit (); - } - - typedef odb::query p_query; - typedef odb::result p_result; - - typedef odb::query e_query; - typedef odb::result e_result; - - // Make sure we have an independent JOIN for each relationship. - // - { - session s; - transaction t (db->begin ()); - - p_result pr (db->query ( - p_query::residence.location->code == "ZA")); - assert (size (pr) == 1); - - e_result er (db->query ( - e_query::residence.location->code == "ZA")); - assert (size (er) == 1); - - t.commit (); - } - - // Test Self-JOIN. - // - { - session s; - transaction t (db->begin ()); - - p_result pr (db->query (p_query::husband->last_name == "Doe")); - assert (size (pr) == 1); - - e_result er (db->query (e_query::husband->last_name == "Doe")); - assert (size (er) == 1); - - t.commit (); - } - - // Test query conditions from both base and derived. - // - { - session s; - transaction t (db->begin ()); - - e_result r ( - db->query ( - e_query::employed_by->name == "Simple Tech, Inc" && - e_query::nationality->code == "US")); - - assert (size (r) == 1); - - t.commit (); - } - - // Test second-level pointers. - // - { - session s; - transaction t (db->begin ()); - - p_result r ( - db->query ( - p_query::husband->residence.location == "CA")); - - assert (size (r) == 1); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/relationship/query/test.hxx b/common/relationship/query/test.hxx deleted file mode 100644 index c6e2d6d..0000000 --- a/common/relationship/query/test.hxx +++ /dev/null @@ -1,140 +0,0 @@ -// file : common/relationship-query/query/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -using std::shared_ptr; - -struct country; - -#pragma db value -struct residence_info -{ - residence_info (bool p, shared_ptr l) - : permanent (p), location (l) - { - } - - residence_info () - { - } - - bool permanent; - - #pragma db not_null - shared_ptr location; -}; - -#pragma db object pointer(shared_ptr) -struct person -{ - person (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - shared_ptr r, - bool p, - shared_ptr n) - : id (i), - first_name (fn), - last_name (ln), - age (a), - residence (p, r), - nationality (n) - { - } - - person () - { - } - - #pragma db id - unsigned long id; - - #pragma db column ("first") - std::string first_name; - - #pragma db column ("last") - std::string last_name; - - unsigned short age; - - residence_info residence; - - #pragma db not_null - shared_ptr nationality; - - shared_ptr husband; // Self-join. -}; - -struct employer; - -#pragma db object pointer(shared_ptr) -struct employee: person -{ - employee (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - shared_ptr r, - bool p, - shared_ptr n, - shared_ptr e) - : person (i, fn, ln, a, r, p, n), - employed_by (e) - { - } - - employee () - { - } - - shared_ptr employed_by; -}; - -#pragma db object pointer(shared_ptr) -struct employer -{ - employer (const std::string& n, shared_ptr nat) - : name (n), nationality (nat) - { - } - - employer () - { - } - - #pragma db id - std::string name; - - // The same member name and type as in person (test JOIN alias). - // - #pragma db not_null - shared_ptr nationality; -}; - -#pragma db object pointer(shared_ptr) -struct country -{ - country (const std::string& c, const std::string& n) - : code (c), name (n) - { - } - - country () - { - } - - #pragma db id - std::string code; // ISO 2-letter country code. - - std::string name; -}; - -#endif // TEST_HXX diff --git a/common/relationship/query/testscript b/common/relationship/query/testscript deleted file mode 100644 index d5ad419..0000000 --- a/common/relationship/query/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/relationship/query/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/schema/embedded/basics/buildfile b/common/schema/embedded/basics/buildfile deleted file mode 100644 index 0cfe85e..0000000 --- a/common/schema/embedded/basics/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/schema/embedded/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix schema_embd_bscs_ \ - --generate-schema \ - --schema-format embedded \ - --schema-name test - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/common/schema/embedded/basics/driver.cxx b/common/schema/embedded/basics/driver.cxx deleted file mode 100644 index 7ba2bce..0000000 --- a/common/schema/embedded/basics/driver.cxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : common/schema/embedded/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test basic embedded schema functionality. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv, false)); - - // Create the database schema. - // - { - connection_ptr c (db->connection ()); - - // Temporarily disable foreign key constraints for SQLite. - // - if (db->id () == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=OFF"); - - assert (schema_catalog::exists (*db, "test")); - assert (!schema_catalog::exists (*db, "test1")); - assert (!schema_catalog::exists (*db, "")); - - transaction t (c->begin ()); - schema_catalog::create_schema (*db, "test"); - t.commit (); - - if (db->id () == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=ON"); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/schema/embedded/basics/test.hxx b/common/schema/embedded/basics/test.hxx deleted file mode 100644 index 43331f9..0000000 --- a/common/schema/embedded/basics/test.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// file : common/schema/embedded/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db object -struct object -{ - #pragma db auto id - unsigned long id; - - std::string str; - - std::vector nums; -}; - -#endif // TEST_HXX diff --git a/common/schema/embedded/basics/testscript b/common/schema/embedded/basics/testscript deleted file mode 100644 index 24448c0..0000000 --- a/common/schema/embedded/basics/testscript +++ /dev/null @@ -1,31 +0,0 @@ -# file : common/schema/embedded/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../../pgsql.testscript - - $* -} diff --git a/common/schema/embedded/order/.gitignore b/common/schema/embedded/order/.gitignore deleted file mode 100644 index 5d39d39..0000000 --- a/common/schema/embedded/order/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# ODB-generated files. -# -test1-odb.?xx -test1-odb-*.?xx -test2-odb.?xx -test2-odb-*.?xx diff --git a/common/schema/embedded/order/buildfile b/common/schema/embedded/order/buildfile deleted file mode 100644 index 57ad7dd..0000000 --- a/common/schema/embedded/order/buildfile +++ /dev/null @@ -1,48 +0,0 @@ -# file : common/schema/embedded/order/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test1 test2 - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix schema_embd_ordr_ \ - --generate-schema \ - --schema-format embedded - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/common/schema/embedded/order/driver.cxx b/common/schema/embedded/order/driver.cxx deleted file mode 100644 index fde5e96..0000000 --- a/common/schema/embedded/order/driver.cxx +++ /dev/null @@ -1,65 +0,0 @@ -// file : common/schema/embedded/order/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test statement execution order in embedded schemas. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test1.hxx" -#include "test2.hxx" - -#include "test1-odb.hxx" -#include "test2-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv, false)); - odb::database_id db_id (db->id ()); - - // Create the database schema. - // - { - connection_ptr c (db->connection ()); - - // Temporarily disable foreign key constraints for MySQL and SQLite. - // For MySQL we can actually create the tables in any order. It is - // dropping them that's the problem (there is no IF EXISTS). - // - if (db_id == odb::id_mysql) - c->execute ("SET FOREIGN_KEY_CHECKS=0"); - else if (db_id == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=OFF"); - - transaction t (c->begin ()); - schema_catalog::create_schema (*db); - t.commit (); - - if (db_id == odb::id_mysql) - c->execute ("SET FOREIGN_KEY_CHECKS=1"); - else if (db_id == odb::id_sqlite) - c->execute ("PRAGMA foreign_keys=ON"); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/schema/embedded/order/test1.hxx b/common/schema/embedded/order/test1.hxx deleted file mode 100644 index b35074b..0000000 --- a/common/schema/embedded/order/test1.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// file : common/schema/embedded/order/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#include - -#include - -#pragma db object polymorphic -struct base -{ - virtual - ~base () {} - - #pragma db auto id - unsigned long id; - - std::string str; -}; - -#endif // TEST1_HXX diff --git a/common/schema/embedded/order/test2.hxx b/common/schema/embedded/order/test2.hxx deleted file mode 100644 index b4e6d20..0000000 --- a/common/schema/embedded/order/test2.hxx +++ /dev/null @@ -1,17 +0,0 @@ -// file : common/schema/embedded/order/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include - -#include "test1.hxx" - -#pragma db object -struct derived: base -{ - int num; -}; - -#endif // TEST2_HXX diff --git a/common/schema/embedded/order/testscript b/common/schema/embedded/order/testscript deleted file mode 100644 index 6dfe58c..0000000 --- a/common/schema/embedded/order/testscript +++ /dev/null @@ -1,31 +0,0 @@ -# file : common/schema/embedded/order/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../../pgsql.testscript - - $* -} diff --git a/common/schema/namespace/buildfile b/common/schema/namespace/buildfile deleted file mode 100644 index fa496d7..0000000 --- a/common/schema/namespace/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/schema/namespace/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix schema_ns_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/schema/namespace/driver.cxx b/common/schema/namespace/driver.cxx deleted file mode 100644 index 25515f2..0000000 --- a/common/schema/namespace/driver.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// file : common/schema/namespace/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test database schemas (aka database namespaces). -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test database schema (aka database namespace). - // - using ns::object2; - - object2 o2; - o2.id = "aaa"; - o2.nums.push_back (1); - o2.nums.push_back (2); - o2.nums.push_back (3); - o2.obj1 = new object1; - o2.obj1->str = "aaa"; - - { - transaction t (db->begin ()); - db->persist (o2.obj1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p2 (db->load ("aaa")); - t.commit (); - - assert (o2 == *p2); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - { - result r (db->query (query::id == "aaa")); - assert (size (r) == 1); - } - - { - result r (db->query (query::obj1->str == "aaa")); - assert (size (r) == 1); - } - - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query (query::object2::id == "aaa")); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->id2 == "aaa" && i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ()); - - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->str == "aaa"); - assert (++i == r.end ()); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/schema/namespace/test.hxx b/common/schema/namespace/test.hxx deleted file mode 100644 index 0b1844a..0000000 --- a/common/schema/namespace/test.hxx +++ /dev/null @@ -1,158 +0,0 @@ -// file : common/schema/namespace/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Table names. -// -#pragma db object table("TABLE_EXPLICIT") -struct table_explicit -{ - #pragma db id - unsigned long id_; -}; - -#pragma db object -struct table_implicit -{ - #pragma db id - unsigned long id_; -}; - -// Column names. -// -#pragma db object -struct column -{ - #pragma db id - int m1; - - #pragma db column("foo") - int m2; - - int m_m3; - int _m4; - int m5_; - int m_; - int m__; -}; - -// Column types. -// -#pragma db object -struct type -{ - #pragma db id - std::string id; - - // Test default C++ to DB type mapping. - // - bool b; - char c; - signed char sc; - unsigned char uc; - short s; - unsigned short us; - int i; - unsigned int ui; - long l; - unsigned long ul; - long long ll; - unsigned long long ull; - float f; - double d; - std::string str; - - #pragma db type("INTEGER") - bool m1; - - #pragma db transient - char* m2; -}; - -// Test database schema (aka database namespace). -// -#ifdef ODB_COMPILER -#if defined (ODB_DATABASE_MYSQL) -//# define DB_SCHEMA "odb_test" -# define DB_SCHEMA "" -#elif defined (ODB_DATABASE_SQLITE) -# define DB_SCHEMA "main" -#elif defined (ODB_DATABASE_PGSQL) -# define DB_SCHEMA "public" -#elif defined (ODB_DATABASE_ORACLE) -//# define DB_SCHEMA "ODB_TEST" -# define DB_SCHEMA "" -#elif defined(ODB_DATABASE_MSSQL) -# define DB_SCHEMA "dbo" -#elif defined(ODB_DATABASE_COMMON) -# define DB_SCHEMA "dummy" -#else -# error unknown database -#endif -#endif - -namespace ns {typedef int my_int;} // Original. - -#pragma db object table(DB_SCHEMA."object_1") -struct object1 -{ - #pragma db id auto - unsigned long id; - - #pragma db column("str") - std::string str; -}; - -inline bool -operator== (const object1& x, const object1& y) -{ - return x.id == y.id && x.str == y.str; -} - -#pragma db namespace schema(DB_SCHEMA) -namespace ns // Extension. -{ - #pragma db object - struct object2 - { - object2 (): obj1 (0) {} - ~object2 () {delete obj1;} - - #pragma db id - std::string id; - - std::vector nums; - object1* obj1; - }; - - inline bool - operator== (const object2& x, const object2& y) - { - return x.id == y.id && x.nums == y.nums && *x.obj1 == *y.obj1; - } -} - -#pragma db view object(object1) object(ns::object2) -struct object_view -{ - #pragma db column(ns::object2::id) - std::string id2; - - std::string str; -}; - -#pragma db view table(DB_SCHEMA."schema_ns_object_1") -struct table_view -{ - #pragma db column(DB_SCHEMA."schema_ns_object_1"."str") - std::string str; -}; - -#endif // TEST_HXX diff --git a/common/schema/namespace/testscript b/common/schema/namespace/testscript deleted file mode 100644 index 0fabe6e..0000000 --- a/common/schema/namespace/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/schema/namespace/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/section/basics/buildfile b/common/section/basics/buildfile deleted file mode 100644 index 5ccdd6b..0000000 --- a/common/section/basics/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/section/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_section_b_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx deleted file mode 100644 index 53783a3..0000000 --- a/common/section/basics/driver.cxx +++ /dev/null @@ -1,1735 +0,0 @@ -// file : common/section/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object section basics. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct failed {}; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test lazy-loaded, always updating section. - // - { - using namespace test1; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // We can also update just the section. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n != o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // Test updating unloaded section. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - o.s.unload (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - t.commit (); - } - - // Test reloading of loaded/unloaded sections. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - o.s.unload (); - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - db->reload (o); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - db->load (o, o.s); - t.commit (); - } - - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - db->reload (o); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - typedef odb::query query; - typedef odb::result result; - - // Make sure we can access section members in queries. - // - { - transaction t (db->begin ()); - - result r (db->query (query::ss == o.ss)); - result::iterator i (r.begin ()); - - assert (i != r.end () && !i->s.loaded ()); - - db->load (*i, i->s); - assert (i->n == o.n && - i->sn == o.sn && i->ss == o.ss && i->sv == o.sv); - - assert (++i == r.end ()); - - t.commit (); - } - - // Make sure we can load/update sections without messing up the - // loaded object's image. - // - { - transaction t (db->begin ()); - - result r (db->query (query::ss == o.ss)); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - - object o1; - i.load (o1); - db->load (o1, o1.s); - assert (o1.n == o.n && - o1.sn == o.sn && o1.ss == o.ss && o1.sv == o.sv); - - o.sn++; - o.ss += 'd'; - o.sv[0]++; - db->update (o, o.s); - - object o2; - i.load (o2); - db->load (o2, o2.s); - assert (o2.n == o1.n && - o2.sn == o.sn && o2.ss == o.ss && o2.sv == o.sv); - - assert (++i == r.end ()); - - t.commit (); - } - } - - // Test lazy-loaded, change-updated section. - // - { - using namespace test2; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update but don't mark as changed. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - t.commit (); - } - - // Mark as changed. - // - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - assert (!o.s.changed ()); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // We can also update just the section manually. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o, o.s); - assert (!o.s.changed ()); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n != o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - } - - // Test lazy-loaded, manually-updated section. - // - { - using namespace test3; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update the object only. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - t.commit (); - } - - // Update both the object and section. - // - o.n++; - - { - transaction t (db->begin ()); - db->update (o); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // We can also update just the section. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n != o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // Test detection of unloaded section update. - // - try - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->update (*p, p->s); - assert (false); - } - catch (const section_not_loaded&) - { - } - } - - // Test eager-loaded, change-updated section. - // - { - using namespace test4; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update but don't mark as changed. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - t.commit (); - } - - // Mark as changed. - // - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - assert (!o.s.changed ()); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - } - - // Test eager-loaded, manually-updated section. - // - { - using namespace test5; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update the object only. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - t.commit (); - } - - // Update both the object and section. - // - o.n++; - - { - transaction t (db->begin ()); - db->update (o); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // We can also update just the section. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - assert (p->n != o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - } - - // Test value-only and container-only section. Also multiple sections - // in an object. - // - { - using namespace test6; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s1.loaded ()); - assert (o.s2.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s1.loaded ()); - assert (!p->s2.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - - db->load (*p, p->s1); - assert (p->s1.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv != o.sv); - - db->load (*p, p->s2); - assert (p->s2.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s1); - db->load (*p, p->s2); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - - // We can also update just the section. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o, o.s1); - db->update (o, o.s2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s1); - db->load (*p, p->s2); - assert (p->n != o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - t.commit (); - } - } - - // Test value-only and container-only section. Also multiple sections - // in an object. - // - { - using namespace test7; - - object o (123, "abc", true); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s1.loaded ()); - assert (o.s2.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s1.loaded ()); - assert (!p->s2.loaded ()); - assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && - p->sn2 != o.sn2 && p->ss2 != o.ss2 && p->sb2 != o.sb2); - - db->load (*p, p->s1); - db->load (*p, p->s2); - assert (p->s1.loaded ()); - assert (p->s2.loaded ()); - assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && - p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); - - - t.commit (); - } - - // Update. - // - o.sn1++; - o.sn2++; - o.ss1 += 'd'; - o.ss2 += 'd'; - o.sb2 = !o.sb2; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s1); - db->load (*p, p->s2); - assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && - p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); - t.commit (); - } - - // Manual update of just the section. - // - o.sn1++; - o.sn2++; - o.ss1 += 'd'; - o.ss2 += 'd'; - o.sb2 = !o.sb2; - - { - transaction t (db->begin ()); - db->update (o, o.s2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s1); - db->load (*p, p->s2); - assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && - p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); - t.commit (); - } - } - - // Test readonly and inverse section members. - // - { - using namespace test8; - - object1 o1 (new object (123, "abc")); - object& o (*o1.p); - o.sp = &o1; - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (o1); - t.commit (); - - assert (o.s.loaded ()); - } - - { - session s; - - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - object* p (p1->p); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sp == 0); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sp->id == o.sp->id); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.ss += 'd'; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - session s; - - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - object* p (p1->p); - - db->load (*p, p->s); - assert (p->n == o.n && - p->sn != o.sn && p->ss == o.ss && p->sp->id == o.sp->id); - - t.commit (); - } - } - - // Test object without any columns to load or update. - // - { - using namespace test9; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (o.id == o.id && - p->sn != o.sn && p->ss != o.ss); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (o.id == o.id && - p->sn == o.sn && p->ss == o.ss); - - t.commit (); - } - - // Update object. - // - o.sn++; - o.ss += 'd'; - - { - transaction t (db->begin ()); - db->update (o); // No-op. - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (o.id == o.id && - p->sn != o.sn && p->ss != o.ss); - t.commit (); - } - - // Update section. - // - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (o.id == o.id && - p->sn == o.sn && p->ss == o.ss); - t.commit (); - } - } - - // Test section without any columns or containers to update. - // - { - using namespace test10; - - object o (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && p->sn != o.sn); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && p->sn == o.sn); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - - { - transaction t (db->begin ()); - db->update (o); - //db->update (o, o.s); // Error. - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && p->sn != o.sn); - t.commit (); - } - } - - // Test section with composite member. - // - { - using namespace test11; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->sc.s != o.sc.s && p->sc.v != o.sc.v); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.sc.s += 'd'; - o.sc.v[0]++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && - p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); - t.commit (); - } - } - - // Test change state restoration on transaction rollback. - // - { - using namespace test12; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - // Update. - // - o.n++; - o.sn++; - o.ss += 'd'; - o.s.change (); - - try - { - transaction t (db->begin ()); - db->update (o); - assert (!o.s.changed ()); - throw failed (); - } - catch (const failed&) - { - assert (o.s.changed ()); - } - - // Retry. Also test the object destruction before transaction - // termination case. - // - { - transaction t (db->begin ()); - { - object c (o); - db->update (c); - assert (!c.s.changed ()); - } - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); - t.commit (); - } - } - - // Test section accessor/modifier. - // - { - using namespace test13; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s ().loaded ()); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s ().loaded ()); - assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss); - - db->load (*p, p->rw_s ()); - - assert (p->s ().loaded ()); - assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.ss += 'd'; - - { - transaction t (db->begin ()); - db->update (o); - db->update (o, o.s ()); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->rw_s ()); - assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); - t.commit (); - } - - // Test detection of section copy. - // - try - { - transaction t (db->begin ()); - section c (o.s ()); - db->update (o, c); - assert (false); - } - catch (const section_not_in_object&) - { - } - } - - // Test LOB in section streaming, column re-ordering. - // - { - using namespace test14; - - object o (1, 123, "\x01\x02\x03\x04\x05"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && p->sn != o.sn && p->sb != o.sb); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); - - t.commit (); - } - - // Update. - // - o.n++; - o.sn++; - o.sb.push_back ('\x06'); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); - t.commit (); - } - - // We can also update just the section. - // - o.n++; - o.sn++; - o.sb.push_back ('\x07'); - - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->n != o.n && p->sn == o.sn && p->sb == o.sb); - t.commit (); - } - } - - // Test sections and optimistic concurrency. - // - { - using namespace test15; - - object o (123, "abc"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->n == o.n && - p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->n == o.n && - p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); - - t.commit (); - } - - // Update object. - // - object o1 (o); - o1.n++; - o1.sn++; - o1.ss += 'd'; - o1.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->update (o1); - assert (o.v != o1.v); - - try - { - db->load (*p, p->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - assert (!p->s.loaded ()); - db->load (*p, p->s); - - assert (p->n == o1.n && - p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.n == o1.n && - o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); - t.commit (); - } - - // Update section. - // - o1.sn++; - o1.ss += 'd'; - o1.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->update (o1, o1.s); - assert (o.v != o1.v); - - // Double-check object version was updated. - // - { - unique_ptr p1 (db->load (o.id)); - assert (o1.v == p1->v); - } - - try - { - db->load (*p, p->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - assert (!p->s.loaded ()); - db->load (*p, p->s); - - assert (p->n == o1.n && - p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.n == o1.n && - o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); - t.commit (); - } - - // Update changed section. - // - o1.sn++; - o1.ss += 'd'; - o1.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o1, o1.s); - - try - { - db->update (o, o.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (o); - db->update (o, o.s); - } - - t.commit (); - } - } - - // Test container-only sections and optimistic concurrency. - // - { - using namespace test16; - - object o (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->sv == o.sv); - - t.commit (); - } - - // Update object. - // - object o1 (o); - o1.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->update (o1); - assert (o.v != o1.v); - - try - { - db->load (*p, p->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - assert (!p->s.loaded ()); - db->load (*p, p->s); - - assert (p->sv == o1.sv); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.sv == o1.sv); - t.commit (); - } - - // Update section. - // - o1.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->update (o1, o1.s); - assert (o.v != o1.v); - - // Double-check object version was updated. - // - { - unique_ptr p1 (db->load (o.id)); - assert (o1.v == p1->v); - } - - try - { - db->load (*p, p->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - assert (!p->s.loaded ()); - db->load (*p, p->s); - - assert (p->sv == o1.sv); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.sv == o1.sv); - t.commit (); - } - - // Update changed section. - // - o1.sv[0]++; - - { - transaction t (db->begin ()); - db->update (o1, o1.s); - - try - { - db->update (o, o.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (o); - db->update (o, o.s); - } - - t.commit (); - } - } - - // Test reuse-inheritance, sections, and optimistic concurrency. - // - { - using namespace test17; - - object o (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s1.loaded ()); - assert (o.s2.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s1.loaded ()); - assert (!p->s2.loaded ()); - assert (p->s1n != o.s1n && p->s2v != o.s2v); - - db->load (*p, p->s1); - db->load (*p, p->s2); - - assert (p->s1.loaded ()); - assert (p->s2.loaded ()); - assert (p->s1n == o.s1n && p->s2v == o.s2v); - - t.commit (); - } - - object o1 (o); - - // Update object. - // - for (unsigned short s (1); s < 3; ++s) - { - o1.s1n++; - o1.s2v[0]++; - - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->update (o1); - assert (o.v != o1.v); - - try - { - switch (s) - { - case 1: db->load (*p, p->s1); break; - case 2: db->load (*p, p->s2); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - - assert (!p->s1.loaded ()); - assert (!p->s2.loaded ()); - - db->load (*p, p->s1); - db->load (*p, p->s2); - - assert (p->s1n == o1.s1n && p->s2v == o1.s2v); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.s1n == o1.s1n && o.s2v == o1.s2v); - t.commit (); - } - - // Update section. - // - for (unsigned short s (1); s < 3; ++s) - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - switch (s) - { - case 1: - o1.s1n++; - db->update (o1, o1.s1); - assert (o.v != o1.v); - break; - case 2: - o1.s2v[0]++; - db->update (o1, o1.s2); - assert (o.v != o1.v); - break; - default: break; - } - - try - { - switch (s) - { - case 1: db->load (*p, p->s1); break; - case 2: db->load (*p, p->s2); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (*p); - - assert (!p->s1.loaded ()); - assert (!p->s2.loaded ()); - - db->load (*p, p->s1); - db->load (*p, p->s2); - - assert (p->s1n == o1.s1n && p->s2v == o1.s2v); - } - - db->reload (o); - assert (o.v == o1.v); - assert (o.s1n == o1.s1n && o.s2v == o1.s2v); - t.commit (); - } - - // Update changed section. - // - for (unsigned short s (1); s < 3; ++s) - { - transaction t (db->begin ()); - - switch (s) - { - case 1: - o1.s1n++; - db->update (o1, o1.s1); - break; - case 2: - o1.s2v[0]++; - db->update (o1, o1.s2); - break; - default: break; - } - - try - { - switch (s) - { - case 1: db->update (o, o.s1); break; - case 2: db->update (o, o.s2); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (o); - - switch (s) - { - case 1: db->update (o, o.s1); break; - case 2: db->update (o, o.s2); break; - default: break; - } - } - - db->reload (o1); - - t.commit (); - } - } - - // Test change-updated section and change-tracking container. - // - { - using namespace test18; - - object o (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - - assert (o.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - assert (!p->s.loaded ()); - assert (p->sn != o.sn && p->sv != o.sv); - - db->load (*p, p->s); - - assert (p->s.loaded ()); - assert (p->sn == o.sn && p->sv == o.sv); - - t.commit (); - } - - // Update but don't mark as changed. - // - o.sn++; - o.sv.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); // Automatically marked as changed. - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->sn == o.sn && p->sv == o.sv); - t.commit (); - } - - // Test updating just the section manually. - // - o.sn++; - o.sv.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o, o.s); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - db->load (*p, p->s); - assert (p->sn == o.sn && p->sv == o.sv); - t.commit (); - } - } - - // Regression: BLOB in a value type used as a map value that is in a - // section. - // - { - using namespace test19; - - object o; - o.m[1].b.assign (560, 'x'); // Size greater than the default image. - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - // Hold "old" connection to force a new set of statements/image - // buffers. - // - connection_ptr c (db->connection ()); - - transaction t (db->begin ()); - unique_ptr p (db->load (o.id)); - - db->load (*p, p->s); - assert (p->m[1].b == o.m[1].b); - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/section/basics/test.hxx b/common/section/basics/test.hxx deleted file mode 100644 index 702ef8b..0000000 --- a/common/section/basics/test.hxx +++ /dev/null @@ -1,628 +0,0 @@ -// file : common/section/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include -#include -#include - -#ifdef ODB_COMPILER -# if defined(ODB_DATABASE_PGSQL) -# define BLOB_TYPE "BYTEA" -# elif defined(ODB_DATABASE_MSSQL) -# define BLOB_TYPE "VARBINARY(max)" -# else -# define BLOB_TYPE "BLOB" -# endif -#endif - -// Test lazy-loaded, always-updated section. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) - int sn; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test lazy-loaded, change-updated section. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - int sn; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test lazy-loaded, manually-updated section. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(manual) - odb::section s; - - #pragma db section(s) - int sn; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test eager-loaded, change-updated section. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db section(s) - int sn; - - #pragma db update(change) - odb::section s; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test eager-loaded, manually-updated section. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db section(s) - int sn; - - #pragma db update(manual) - odb::section s; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test value-only and container-only section. Also multiple sections -// in an object. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : n (n_), sn (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - int n; - - #pragma db load(lazy) - odb::section s1; - - #pragma db load(lazy) - odb::section s2; - - #pragma db section(s1) - int sn; - - #pragma db section(s1) - std::string ss; - - #pragma db section(s2) - std::vector sv; - }; -} - -// Test sections and reuse inheritance. -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object abstract - struct base - { - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) - odb::section s1; // Empty section. - - #pragma db load(lazy) - odb::section s2; - - #pragma db section(s2) - int sn2; - }; - - #pragma db object abstract - struct interm: base - { - // Section s1 is still empty. - - #pragma db section(s2) - std::string ss2; - }; - - #pragma db object - struct derived: interm - { - #pragma db section(s1) - int sn1; - }; - - #pragma db object - struct object: derived - { - object (int n = 999, const std::string& s = "xxx", bool b = false) - { - sn1 = sn2 = n; - ss1 = ss2 = s; - sb2 = b; - } - - #pragma db section(s1) - std::string ss1; - - #pragma db section(s2) - bool sb2; - }; -} - -// Test readonly and inverse section members. -// -#pragma db namespace table("t8_") -namespace test8 -{ - struct object1; - - #pragma db object session - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx", object1* p_ = 0) - : n (n_), sn (n_), ss (s_), sp (p_) {} - - #pragma db id auto - unsigned long id; - - int n; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) readonly - int sn; - - #pragma db section(s) - std::string ss; - - #pragma db inverse(p) section(s) - object1* sp; - }; - - #pragma db object session - struct object1 - { - object1 (object* p_ = 0): p (p_) {} - ~object1 () {delete p;} - - #pragma db id auto - unsigned long id; - - object* p; - }; -} - -// Test object without any columns to load or update. -// -#pragma db namespace table("t9_") -namespace test9 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx"): sn (n_), ss (s_) {} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(manual) - odb::section s; - - #pragma db section(s) - int sn; - - #pragma db section(s) - std::string ss; - }; -} - -// Test section without any columns or containers to update. -// -#pragma db namespace table("t10_") -namespace test10 -{ - #pragma db object - struct object - { - object (int n_ = 999): n (n_), sn (n_) {} - - #pragma db id auto - unsigned long id; - - int n; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) readonly - int sn; - }; -} - -// Test section with composite member. -// -#pragma db namespace table("t11_") -namespace test11 -{ - #pragma db value - struct comp - { - comp (int n_, const std::string& s_): s (s_) {v.push_back (n_);} - - std::string s; - std::vector v; - }; - - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : n (n_), sn (n_), sc (n_, s_) {} - - #pragma db id auto - unsigned long id; - - int n; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) - int sn; - - #pragma db section(s) - comp sc; - }; -} - -// Test change state restoration on transaction rollback. -// -#pragma db namespace table("t12_") -namespace test12 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - int sn; - - int n; - - #pragma db section(s) - std::string ss; - }; -} - -// Test section accessor/modifier. -// -#pragma db namespace table("t13_") -namespace test13 -{ - #pragma db object - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : n (n_), sn (n_), ss (s_) {} - - #pragma db id auto - unsigned long id; - - int n; - - #pragma db section(s_) - int sn; - - #pragma db section(s_) - std::string ss; - - public: - const odb::section& - s () const {return s_;} - - odb::section& - rw_s () {return s_;} - - private: - #pragma db load(lazy) update(manual) - odb::section s_; - }; -} - -// Test LOB in section streaming, column re-ordering. -// -#pragma db namespace table("t14_") -namespace test14 -{ - #pragma db object - struct object - { - object (unsigned long id_ = 0, int n_ = 999, const std::string& s_ = "xxx") - : id (id_), sb (s_.begin (), s_.end ()), sn (n_), n (n_) {} - - #pragma db id - unsigned long id; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) type(BLOB_TYPE) - std::vector sb; // Comes before sn. - - #pragma db section(s) - int sn; - - int n; - }; -} - -// Test sections and optimistic concurrency. -// -#pragma db namespace table("t15_") -namespace test15 -{ - #pragma db object optimistic - struct object - { - object (int n_ = 999, const std::string& s_ = "xxx") - : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} - - #pragma db id auto - unsigned long id; - - #pragma db version mssql:type("ROWVERSION") - unsigned long long v; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) - int sn; - - int n; - - #pragma db section(s) - std::string ss; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test container-only sections and optimistic concurrency. -// -#pragma db namespace table("t16_") -namespace test16 -{ - #pragma db object optimistic - struct object - { - object (int n = 999) {sv.push_back (n);} - - #pragma db id auto - unsigned long id; - - #pragma db version // mssql:type("ROWVERSION") - unsigned long long v; - - #pragma db load(lazy) - odb::section s; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test reuse-inheritance, sections, and optimistic concurrency. -// -#pragma db namespace table("t17_") -namespace test17 -{ - #pragma db object optimistic sectionable abstract - struct root - { - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - }; - - #pragma db object - struct base: root - { - }; - - #pragma db object - struct object: base - { - object (int n = 999): s1n (n) {s2v.push_back (n);} - - #pragma db load(lazy) - odb::section s1; - - #pragma db section(s1) - int s1n; - - #pragma db load(lazy) - odb::section s2; - - #pragma db section(s2) - std::vector s2v; - }; -} - -// Test change-updated section and change-tracking container. -// -#pragma db namespace table("t18_") -namespace test18 -{ - #pragma db object - struct object - { - object (int n = 999): sn (n) {sv.push_back (n);} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - int sn; - - #pragma db section(s) - odb::vector sv; - }; -} - -// Regression: BLOB in a value type used as a map value that is in a section. -// -#include -#include - -#pragma db namespace table("t19_") -namespace test19 -{ - #pragma db value - struct value - { - #pragma db type(BLOB_TYPE) - std::vector b; - }; - - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) update(always) - odb::section s; - - #pragma db section(s) - std::map m; - }; -} - -#endif // TEST_HXX diff --git a/common/section/basics/testscript b/common/section/basics/testscript deleted file mode 100644 index c0c6617..0000000 --- a/common/section/basics/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/section/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/section/polymorphism/buildfile b/common/section/polymorphism/buildfile deleted file mode 100644 index b9a7514..0000000 --- a/common/section/polymorphism/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/section/polymorphism/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_section_p_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/section/polymorphism/driver.cxx b/common/section/polymorphism/driver.cxx deleted file mode 100644 index c15d317..0000000 --- a/common/section/polymorphism/driver.cxx +++ /dev/null @@ -1,1807 +0,0 @@ -// file : common/section/polymorphism/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test sections in polymorphic objects. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct failed {}; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic polymorphic section functionality. - // - { - using namespace test1; - - base b (123, "abc"); - derived d (234, "bcd", true); - - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - - assert (b.rs1.loaded ()); - assert (b.rs2.loaded ()); - assert (b.rs3.loaded ()); - assert (b.rs4.loaded ()); - assert (b.bs1.loaded ()); - - assert (d.rs1.loaded ()); - assert (d.rs2.loaded ()); - assert (d.rs3.loaded ()); - assert (d.rs4.loaded ()); - assert (d.bs1.loaded ()); - assert (d.ds1.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - assert (!pb->rs1.loaded ()); - assert (!pb->rs2.loaded ()); - assert (!pb->rs3.loaded ()); - assert (!pb->rs4.loaded ()); - assert (!pb->bs1.loaded ()); - - assert (!pd->rs1.loaded ()); - assert (!pd->rs2.loaded ()); - assert (!pd->rs3.loaded ()); - assert (!pd->rs4.loaded ()); - assert (!pd->bs1.loaded ()); - assert (!pd->ds1.loaded ()); - - assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && - pb->rs2n != b.rs2n && pb->rs2v != b.rs2v && - pb->rs3v != b.rs3v && - pb->rs4n != b.rs4n && - pb->bs1n != b.bs1n); - - assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && - pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && - pd->rs2n != d.rs2n && pd->rs2v != d.rs2v && - pd->rs3v != d.rs3v && pd->rs3n != d.rs3n && - pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && - pd->bs1n != d.bs1n && pd->bs1s != d.bs1s && - pd->ds1n != d.ds1n); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); - - root* pr (pd.get ()); - db->load (*pr, pr->rs1); // Via base. - db->load (*pd, pd->rs2); - db->load (*pr, pr->rs3); // Via base. - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - try - { - db->load (*pr, pd->bs1); // Object-section association is static. - assert (false); - } - catch (const section_not_in_object&) {} - - assert (pb->rs1.loaded ()); - assert (pb->rs2.loaded ()); - assert (pb->rs3.loaded ()); - assert (pb->rs4.loaded ()); - assert (pb->bs1.loaded ()); - - assert (pd->rs1.loaded ()); - assert (pd->rs2.loaded ()); - assert (pd->rs3.loaded ()); - assert (pd->rs4.loaded ()); - assert (pd->bs1.loaded ()); - assert (pd->ds1.loaded ()); - - assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && - pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && - pb->rs3v == b.rs3v && - pb->rs4n == b.rs4n && - pb->bs1n == b.bs1n); - - assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && - pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && - pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && - pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && - pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && - pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && - pd->ds1n == d.ds1n); - t.commit (); - } - - // Update object. - // - b.rs1n++; - b.rs1s += 'd'; - b.rs1.change (); - b.rs2n++; - b.rs2v[0]++; - b.rs3v[0]++; - b.rs4n++; - b.bs1n++; - - d.rs1n++; - d.rs1s += 'e'; - d.rs1b = !d.rs1b; - d.rs1v[0]++; - d.rs1.change (); - d.rs2n++; - d.rs2v[0]++; - d.rs3v[0]++; - d.rs3n++; - d.rs4n++; - d.rs4s += 'e'; - d.bs1n++; - d.bs1s += 'e'; - d.ds1n++; - - { - transaction t (db->begin ()); - db->update (b); - db->update (d); - t.commit (); - - assert (!b.rs1.changed ()); - assert (!d.rs1.changed ()); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); - - db->load (*pd, pd->rs1); - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && - pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && - pb->rs3v == b.rs3v && - pb->rs4n == b.rs4n && - pb->bs1n == b.bs1n); - - assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && - pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && - pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && - pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && - pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && - pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && - pd->ds1n == d.ds1n); - t.commit (); - } - - // Update section. - // - b.rs1n++; - b.rs1s += 'd'; - b.rs2n++; - b.rs2v[0]++; - b.rs3v[0]++; - b.rs4n++; - b.bs1n++; - - d.rs1n++; - d.rs1s += 'e'; - d.rs1b = !d.rs1b; - d.rs1v[0]++; - d.rs2n++; - d.rs2v[0]++; - d.rs3v[0]++; - d.rs3n++; - d.rs4n++; - d.rs4s += 'e'; - d.bs1n++; - d.bs1s += 'e'; - d.ds1n++; - - { - transaction t (db->begin ()); - db->update (b, b.rs1); - db->update (b, b.rs2); - db->update (b, b.rs3); - db->update (b, b.rs4); - db->update (b, b.bs1); - - db->update (d, d.rs1); - db->update (d, d.rs2); - db->update (d, d.rs3); - db->update (d, d.rs4); - db->update (d, d.bs1); - db->update (d, d.ds1); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); - - db->load (*pd, pd->rs1); - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && - pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && - pb->rs3v == b.rs3v && - pb->rs4n == b.rs4n && - pb->bs1n == b.bs1n); - - assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && - pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && - pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && - pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && - pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && - pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && - pd->ds1n == d.ds1n); - t.commit (); - } - - // Reload. - // - b.rs1n++; - b.rs1s += 'd'; - b.rs1.change (); - b.rs2n++; - b.rs2v[0]++; - b.rs3v[0]++; - b.rs4n++; - b.bs1n++; - - d.rs1n++; - d.rs1s += 'e'; - d.rs1b = !d.rs1b; - d.rs1v[0]++; - d.rs1.change (); - d.rs2n++; - d.rs2v[0]++; - d.rs3v[0]++; - d.rs3n++; - d.rs4n++; - d.rs4s += 'e'; - d.bs1n++; - d.bs1s += 'e'; - d.ds1n++; - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); - - db->load (*pd, pd->rs1); - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - db->update (b); - db->update (d); - - db->reload (*pb); - db->reload (*pd); - - assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && - pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && - pb->rs3v == b.rs3v && - pb->rs4n == b.rs4n && - pb->bs1n == b.bs1n); - - assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && - pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && - pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && - pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && - pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && - pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && - pd->ds1n == d.ds1n); - - t.commit (); - } - } - - // Test empty section and override "gap". - // - { - using namespace test2; - - derived d (234); - - { - transaction t (db->begin ()); - db->persist (d); - t.commit (); - - assert (d.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - assert (!pd->s.loaded ()); - assert (pd->sn != d.sn && pd->sv != d.sv); - - root* pr (pd.get ()); - db->load (*pr, pr->s); // Via root. - - assert (pd->s.loaded ()); - assert (pd->sn == d.sn && pd->sv == d.sv); - t.commit (); - } - - // Update object. - // - d.sn++; - d.sv[0]++; - - { - transaction t (db->begin ()); - root* pr (&d); - db->update (pr); // Via root. - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - base* pb (pd.get ()); - db->load (*pb, pb->s); // Via base. - - assert (pd->sn == d.sn && pd->sv == d.sv); - t.commit (); - } - - // Update section. - // - d.sn++; - d.sv[0]++; - - { - transaction t (db->begin ()); - root* pr (&d); - db->update (*pr, pr->s); // Via root. - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->load (*pd, pd->s); - - assert (pd->sn == d.sn && pd->sv == d.sv); - t.commit (); - } - - // Reload. - // - d.sn++; - d.sv[0]++; - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->load (*pd, pd->s); - - db->update (d); - - root* pr (pd.get ()); - db->reload (*pr); - - assert (pd->sn == d.sn && pd->sv == d.sv); - t.commit (); - } - } - - // Test value-only/container-only base/override combinations. - // - { - using namespace test3; - - root r (123); - base b (234); - derived d (345, "abc"); - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - - assert (r.s1.loaded ()); - assert (r.s2.loaded ()); - assert (r.s3.loaded ()); - assert (r.s4.loaded ()); - - assert (b.s1.loaded ()); - assert (b.s2.loaded ()); - assert (b.s3.loaded ()); - assert (b.s4.loaded ()); - - assert (d.s1.loaded ()); - assert (d.s2.loaded ()); - assert (d.s3.loaded ()); - assert (d.s4.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - assert (!pr->s1.loaded ()); - assert (!pr->s2.loaded ()); - assert (!pr->s3.loaded ()); - assert (!pr->s4.loaded ()); - - assert (!pb->s1.loaded ()); - assert (!pb->s2.loaded ()); - assert (!pb->s3.loaded ()); - assert (!pb->s4.loaded ()); - - assert (!pd->s1.loaded ()); - assert (!pd->s2.loaded ()); - assert (!pd->s3.loaded ()); - assert (!pd->s4.loaded ()); - - assert (pr->s1n != r.s1n && - pr->s2n != r.s2n && - pr->s3v != r.s3v && - pr->s4nv != r.s4nv); - - assert (pb->s1n != b.s1n && - pb->s2n != b.s2n && - pb->s3v != b.s3v && - pb->s4nv != b.s4nv); - - assert (pd->s1n != d.s1n && pd->s1s != d.s1s && - pd->s2n != d.s2n && pd->s2v != d.s2v && - pd->s3v != d.s3v && pd->s3n != d.s3n && - pd->s4nv != d.s4nv && pd->s4sv != d.s4sv); - - db->load (*pr, pr->s1); - db->load (*pr, pr->s2); - db->load (*pr, pr->s3); - db->load (*pr, pr->s4); - - db->load (*pb, pb->s1); - db->load (*pb, pb->s2); - db->load (*pb, pb->s3); - db->load (*pb, pb->s4); - - root* pdr (pd.get ()); - db->load (*pdr, pdr->s1); - db->load (*pdr, pdr->s2); - db->load (*pdr, pdr->s3); - db->load (*pdr, pdr->s4); - - assert (pr->s1.loaded ()); - assert (pr->s2.loaded ()); - assert (pr->s3.loaded ()); - assert (pr->s4.loaded ()); - - assert (pb->s1.loaded ()); - assert (pb->s2.loaded ()); - assert (pb->s3.loaded ()); - assert (pb->s4.loaded ()); - - assert (pd->s1.loaded ()); - assert (pd->s2.loaded ()); - assert (pd->s3.loaded ()); - assert (pd->s4.loaded ()); - - assert (pr->s1n == r.s1n && - pr->s2n == r.s2n && - pr->s3v == r.s3v && - pr->s4nv == r.s4nv); - - assert (pb->s1n == b.s1n && - pb->s2n == b.s2n && - pb->s3v == b.s3v && - pb->s4nv == b.s4nv); - - assert (pd->s1n == d.s1n && pd->s1s == d.s1s && - pd->s2n == d.s2n && pd->s2v == d.s2v && - pd->s3v == d.s3v && pd->s3n == d.s3n && - pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); - t.commit (); - } - - // Update object. - // - r.s1n++; - r.s2n++; - r.s3v[0]++; - r.s4nv[0]++; - - b.s1n++; - b.s2n++; - b.s3v[0]++; - b.s4nv[0]++; - - d.s1n++; - d.s1s += 'd'; - d.s2n++; - d.s2v[0]++; - d.s3v[0]++; - d.s3n++; - d.s4nv[0]++; - d.s4sv[0] += 'd'; - - { - transaction t (db->begin ()); - db->update (r); - db->update (b); - db->update (d); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pr, pr->s1); - db->load (*pr, pr->s2); - db->load (*pr, pr->s3); - db->load (*pr, pr->s4); - - db->load (*pb, pb->s1); - db->load (*pb, pb->s2); - db->load (*pb, pb->s3); - db->load (*pb, pb->s4); - - db->load (*pd, pd->s1); - db->load (*pd, pd->s2); - db->load (*pd, pd->s3); - db->load (*pd, pd->s4); - - assert (pr->s1n == r.s1n && - pr->s2n == r.s2n && - pr->s3v == r.s3v && - pr->s4nv == r.s4nv); - - assert (pb->s1n == b.s1n && - pb->s2n == b.s2n && - pb->s3v == b.s3v && - pb->s4nv == b.s4nv); - - assert (pd->s1n == d.s1n && pd->s1s == d.s1s && - pd->s2n == d.s2n && pd->s2v == d.s2v && - pd->s3v == d.s3v && pd->s3n == d.s3n && - pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); - t.commit (); - } - - // Update section. - // - r.s1n++; - r.s2n++; - r.s3v[0]++; - r.s4nv[0]++; - - b.s1n++; - b.s2n++; - b.s3v[0]++; - b.s4nv[0]++; - - d.s1n++; - d.s1s += 'd'; - d.s2n++; - d.s2v[0]++; - d.s3v[0]++; - d.s3n++; - d.s4nv[0]++; - d.s4sv[0] += 'd'; - - { - transaction t (db->begin ()); - db->update (r, r.s1); - db->update (r, r.s2); - db->update (r, r.s3); - db->update (r, r.s4); - - db->update (b, b.s1); - db->update (b, b.s2); - db->update (b, b.s3); - db->update (b, b.s4); - - root& rr (d); - db->update (rr, rr.s1); - db->update (rr, rr.s2); - db->update (rr, rr.s3); - db->update (rr, rr.s4); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pr, pr->s1); - db->load (*pr, pr->s2); - db->load (*pr, pr->s3); - db->load (*pr, pr->s4); - - db->load (*pb, pb->s1); - db->load (*pb, pb->s2); - db->load (*pb, pb->s3); - db->load (*pb, pb->s4); - - db->load (*pd, pd->s1); - db->load (*pd, pd->s2); - db->load (*pd, pd->s3); - db->load (*pd, pd->s4); - - assert (pr->s1n == r.s1n && - pr->s2n == r.s2n && - pr->s3v == r.s3v && - pr->s4nv == r.s4nv); - - assert (pb->s1n == b.s1n && - pb->s2n == b.s2n && - pb->s3v == b.s3v && - pb->s4nv == b.s4nv); - - assert (pd->s1n == d.s1n && pd->s1s == d.s1s && - pd->s2n == d.s2n && pd->s2v == d.s2v && - pd->s3v == d.s3v && pd->s3n == d.s3n && - pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); - t.commit (); - } - - // Reload. - // - r.s1n++; - r.s2n++; - r.s3v[0]++; - r.s4nv[0]++; - - b.s1n++; - b.s2n++; - b.s3v[0]++; - b.s4nv[0]++; - - d.s1n++; - d.s1s += 'd'; - d.s2n++; - d.s2v[0]++; - d.s3v[0]++; - d.s3n++; - d.s4nv[0]++; - d.s4sv[0] += 'd'; - - { - transaction t (db->begin ()); - unique_ptr pr (db->load (r.id)); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->load (*pr, pr->s1); - db->load (*pr, pr->s2); - db->load (*pr, pr->s3); - db->load (*pr, pr->s4); - - db->load (*pb, pb->s1); - db->load (*pb, pb->s2); - db->load (*pb, pb->s3); - db->load (*pb, pb->s4); - - db->load (*pd, pd->s1); - db->load (*pd, pd->s2); - db->load (*pd, pd->s3); - db->load (*pd, pd->s4); - - db->update (r); - db->update (b); - db->update (d); - - db->reload (*pr); - db->reload (*pb); - db->reload (*pd); - - assert (pr->s1n == r.s1n && - pr->s2n == r.s2n && - pr->s3v == r.s3v && - pr->s4nv == r.s4nv); - - assert (pb->s1n == b.s1n && - pb->s2n == b.s2n && - pb->s3v == b.s3v && - pb->s4nv == b.s4nv); - - assert (pd->s1n == d.s1n && pd->s1s == d.s1s && - pd->s2n == d.s2n && pd->s2v == d.s2v && - pd->s3v == d.s3v && pd->s3n == d.s3n && - pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); - t.commit (); - } - } - - // Test basic polymorphic optimistic section functionality. - // - { - using namespace test4; - - base b (123, "abc"); - derived d (234, "bcd", true); - - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - - assert (b.rs1.loaded ()); - assert (b.rs2.loaded ()); - assert (b.rs3.loaded ()); - assert (b.rs4.loaded ()); - assert (b.bs1.loaded ()); - - assert (d.rs1.loaded ()); - assert (d.rs2.loaded ()); - assert (d.rs3.loaded ()); - assert (d.rs4.loaded ()); - assert (d.bs1.loaded ()); - assert (d.ds1.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - assert (!pb->rs1.loaded ()); - assert (!pb->rs2.loaded ()); - assert (!pb->rs3.loaded ()); - assert (!pb->rs4.loaded ()); - assert (!pb->bs1.loaded ()); - - assert (!pd->rs1.loaded ()); - assert (!pd->rs2.loaded ()); - assert (!pd->rs3.loaded ()); - assert (!pd->rs4.loaded ()); - assert (!pd->bs1.loaded ()); - assert (!pd->ds1.loaded ()); - - assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && - pb->rs2n != b.rs2n && - pb->rs3n != b.rs3n && - pb->rs4n != b.rs4n && pb->rs4s != b.rs4s); - - assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && - pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && - pd->rs2n != d.rs2n && - pd->rs3n != d.rs3n && pd->rs3s != d.rs3s && - pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && - pd->rs4v != d.rs4v && - pd->bs1n != d.bs1n && - pd->ds1v != d.ds1v); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); // No-op. - - root* pr (pd.get ()); - db->load (*pr, pr->rs1); // Via base. - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pr, pr->rs4); // Via base. - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - assert (pb->rs1.loaded ()); - assert (pb->rs2.loaded ()); - assert (pb->rs3.loaded ()); - assert (pb->rs4.loaded ()); - assert (pb->bs1.loaded ()); - - assert (pd->rs1.loaded ()); - assert (pd->rs2.loaded ()); - assert (pd->rs3.loaded ()); - assert (pd->rs4.loaded ()); - assert (pd->bs1.loaded ()); - assert (pd->ds1.loaded ()); - - assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && - pb->rs2n == b.rs2n && - pb->rs3n == b.rs3n && - pb->rs4n == b.rs4n && pb->rs4s == b.rs4s); - - assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && - pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && - pd->rs2n == d.rs2n && - pd->rs3n == d.rs3n && pd->rs3s == d.rs3s && - pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && - pd->rs4v == d.rs4v && - pd->bs1n == d.bs1n && - pd->ds1v == d.ds1v); - t.commit (); - } - - base b1 (b); - derived d1 (d); - - // Update object. - // - for (unsigned short s (1); s < 7; ++s) - { - b1.rs1n++; - b1.rs1s += 'd'; - b1.rs1.change (); - b1.rs4s += 'd'; - - d1.rs1n++; - d1.rs1s += 'e'; - d1.rs1b = !d.rs1b; - d1.rs1v[0]++; - d1.rs1.change (); - d1.rs4s += 'e'; - d1.rs4v[0]++; - d1.bs1n++; - d1.ds1v[0]++; - - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - db->update (b1); - db->update (d1); - - assert (!b1.rs1.changed ()); - assert (!d1.rs1.changed ()); - - assert (b.v != b1.v); - assert (d.v != d1.v); - - try - { - bool a (false); - switch (s) - { - case 1: db->load (*pb, pb->rs1); break; - case 2: db->load (*pb, pb->rs2); break; - case 3: db->load (*pb, pb->rs3); break; - case 4: db->load (*pb, pb->rs4); break; - case 5: - case 6: a = true; break; // No-op. - default: break; - } - assert (a); - } - catch (const object_changed&) - { - db->reload (*pb); - - assert (!pb->rs1.loaded ()); - assert (!pb->rs2.loaded ()); - assert (!pb->rs3.loaded ()); - assert (!pb->rs3.loaded ()); - assert (!pb->bs1.loaded ()); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); // No-op. - - assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && - pb->rs2n == b1.rs2n && - pb->rs3n == b1.rs3n && - pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); - } - - try - { - switch (s) - { - case 1: db->load (*pd, pd->rs1); break; - case 2: db->load (*pd, pd->rs2); break; - case 3: db->load (*pd, pd->rs3); break; - case 4: db->load (*pd, pd->rs4); break; - case 5: db->load (*pd, pd->bs1); break; - case 6: db->load (*pd, pd->ds1); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - - assert (!pd->rs1.loaded ()); - assert (!pd->rs2.loaded ()); - assert (!pd->rs3.loaded ()); - assert (!pd->rs4.loaded ()); - assert (!pd->bs1.loaded ()); - assert (!pd->ds1.loaded ()); - - db->load (*pd, pd->rs1); - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && - pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && - pd->rs2n == d1.rs2n && - pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && - pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && - pd->rs4v == d1.rs4v && - pd->bs1n == d1.bs1n && - pd->ds1v == d1.ds1v); - } - - db->reload (b); - db->reload (d); - - assert (b.v == b1.v); - assert (d.v == d1.v); - - assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && - b.rs2n == b1.rs2n && - b.rs3n == b1.rs3n && - b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); - - assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && - d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && - d.rs2n == d1.rs2n && - d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && - d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && - d.rs4v == d1.rs4v && - d.bs1n == d1.bs1n && - d.ds1v == d1.ds1v); - - t.commit (); - } - - // Update section. - // - for (unsigned short s (1); s < 7; ++s) - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - switch (s) - { - case 1: - b1.rs1n++; - b1.rs1s += 'd'; - - d1.rs1n++; - d1.rs1s += 'e'; - d1.rs1b = !d.rs1b; - d1.rs1v[0]++; - - db->update (b1, b1.rs1); - db->update (d1, d1.rs1); - - assert (b.v != b1.v); - assert (d.v != d1.v); - break; - case 2: - db->update (b1, b1.rs2); // No-op. - db->update (d1, d1.rs2); // No-op. - - assert (b.v == b1.v); - assert (d.v == d1.v); - continue; // Object hasn't changed. - case 3: - db->update (b1, b1.rs3); // No-op. - db->update (d1, d1.rs3); // No-op. - - assert (b.v == b1.v); - assert (d.v == d1.v); - continue; // Object hasn't changed. - case 4: - b1.rs4s += 'd'; - - d1.rs4s += 'e'; - d1.rs4v[0]++; - - db->update (b1, b1.rs4); - db->update (d1, d1.rs4); - - assert (b.v != b1.v); - assert (d.v != d1.v); - break; - case 5: - d1.bs1n++; - - db->update (b1, b1.bs1); // No-op. - db->update (d1, d1.bs1); - - assert (b.v == b1.v); - assert (d.v != d1.v); - break; - case 6: - d1.ds1v[0]++; - - db->update (d1, d1.ds1); - - assert (d.v != d1.v); - break; - default: break; - } - - try - { - bool a (false); - switch (s) - { - case 1: db->load (*pb, pb->rs1); break; - case 4: db->load (*pb, pb->rs4); break; - case 5: - case 6: a = true; break; // No-op. - default: break; - } - assert (a); - } - catch (const object_changed&) - { - db->reload (*pb); - - assert (!pb->rs1.loaded ()); - assert (!pb->rs2.loaded ()); - assert (!pb->rs3.loaded ()); - assert (!pb->rs4.loaded ()); - assert (!pb->bs1.loaded ()); - - db->load (*pb, pb->rs1); - db->load (*pb, pb->rs2); - db->load (*pb, pb->rs3); - db->load (*pb, pb->rs4); - db->load (*pb, pb->bs1); // No-op. - - assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && - pb->rs2n == b1.rs2n && - pb->rs3n == b1.rs3n && - pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); - } - - try - { - switch (s) - { - case 1: db->load (*pd, pd->rs1); break; - case 4: db->load (*pd, pd->rs4); break; - case 5: db->load (*pd, pd->bs1); break; - case 6: db->load (*pd, pd->ds1); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - - assert (!pd->rs1.loaded ()); - assert (!pd->rs2.loaded ()); - assert (!pd->rs3.loaded ()); - assert (!pd->rs4.loaded ()); - assert (!pd->bs1.loaded ()); - assert (!pd->ds1.loaded ()); - - db->load (*pd, pd->rs1); - db->load (*pd, pd->rs2); - db->load (*pd, pd->rs3); - db->load (*pd, pd->rs4); - db->load (*pd, pd->bs1); - db->load (*pd, pd->ds1); - - assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && - pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && - pd->rs2n == d1.rs2n && - pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && - pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && - pd->rs4v == d1.rs4v && - pd->bs1n == d1.bs1n && - pd->ds1v == d1.ds1v); - } - - db->reload (b); - db->reload (d); - - assert (b.v == b1.v); - assert (d.v == d1.v); - - assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && - b.rs2n == b1.rs2n && - b.rs3n == b1.rs3n && - b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); - - assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && - d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && - d.rs2n == d1.rs2n && - d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && - d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && - d.rs4v == d1.rs4v && - d.bs1n == d1.bs1n && - d.ds1v == d1.ds1v); - - t.commit (); - } - - // Update changed section. - // - for (unsigned short s (1); s < 7; ++s) - { - if (s == 2 || s == 3) // Readonly sections. - continue; - - transaction t (db->begin ()); - - switch (s) - { - case 1: - b1.rs1n++; - b1.rs1s += 'd'; - - d1.rs1n++; - d1.rs1s += 'e'; - d1.rs1b = !d.rs1b; - d1.rs1v[0]++; - - db->update (b1, b1.rs1); - db->update (d1, d1.rs1); - break; - case 4: - b1.rs4s += 'd'; - - d1.rs4s += 'e'; - d1.rs4v[0]++; - - db->update (b1, b1.rs4); - db->update (d1, d1.rs4); - break; - case 5: - d1.bs1n++; - - db->update (b1, b1.bs1); // No-op. - db->update (d1, d1.bs1); - break; - case 6: - d1.ds1v[0]++; - - db->update (d1, d1.bs1); - break; - default: break; - } - - try - { - bool a (false); - switch (s) - { - case 1: db->update (b, b.rs1); break; - case 4: db->update (b, b.rs4); break; - case 5: - case 6: a = true; break; // No-op. - default: break; - } - assert (a); - } - catch (const object_changed&) - { - db->reload (b); - - switch (s) - { - case 1: db->update (b, b.rs1); break; - case 4: db->update (b, b.rs4); break; - default: break; - } - } - - try - { - switch (s) - { - case 1: db->update (d, d.rs1); break; - case 4: db->update (d, d.rs4); break; - case 5: db->update (d, d.bs1); break; - case 6: db->update (d, d.ds1); break; - default: break; - } - assert (false); - } - catch (const object_changed&) - { - db->reload (d); - - switch (s) - { - case 1: db->update (d, d.rs1); break; - case 4: db->update (d, d.rs4); break; - case 5: db->update (d, d.bs1); break; - case 6: db->update (d, d.ds1); break; - default: break; - } - } - - db->reload (b1); - db->reload (d1); - - t.commit (); - } - } - - // Test polymorphic optimistic readonly/empty to readwrite section - // override. - // - { - using namespace test5; - - base b; - derived d (123); - - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - - assert (b.s.loaded ()); - assert (d.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - assert (!pb->s.loaded ()); - assert (!pd->s.loaded ()); - assert (pd->sn != d.sn); - - db->load (*pb, pb->s); // No-op. - db->load (*pd, pd->s); - - assert (pb->s.loaded ()); - assert (pd->s.loaded ()); - - assert (pd->sn == d.sn); - - t.commit (); - } - - // Update object. - // - base b1 (b); - derived d1 (d); - d1.sn++; - d1.s.change (); - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (d1); - - assert (!d1.s.changed ()); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update section. - // - d1.sn++; - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (b1, b1.s); // No-op. - db->update (d1, d1.s); - - assert (b.v == b1.v); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update changed section. - // - d1.sn++; - - { - transaction t (db->begin ()); - db->update (d1, d1.s); - - try - { - db->update (d, d.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (d); - db->update (d, d.s); - } - - t.commit (); - } - } - - // Test polymorphic optimistic readonly/empty to readwrite section - // override, eager-loaded case. - // - { - using namespace test6; - - derived d (123); - - { - transaction t (db->begin ()); - db->persist (d); - t.commit (); - - assert (d.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - assert (pd->s.loaded ()); - assert (pd->sn == d.sn); - - t.commit (); - } - - // Update object. - // - derived d1 (d); - d1.sn++; - d1.s.change (); - - { - transaction t (db->begin ()); - - db->update (d1); - - assert (!d1.s.changed ()); - assert (d.v != d1.v); - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update section. - // - d1.sn++; - - { - transaction t (db->begin ()); - - db->update (d1, d1.s); - assert (d.v != d1.v); - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update changed section. - // - d1.sn++; - - { - transaction t (db->begin ()); - db->update (d1, d1.s); - - try - { - db->update (d, d.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (d); - db->update (d, d.s); - } - - t.commit (); - } - } - - // Test polymorphic optimistic section added in derived. - // - { - using namespace test7; - - base b; - derived d (123); - - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d); - t.commit (); - - assert (b.s.loaded ()); - assert (d.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pb (db->load (b.id)); - unique_ptr pd (db->load (d.id)); - - assert (!pb->s.loaded ()); - assert (!pd->s.loaded ()); - assert (pd->sn != d.sn); - - db->load (*pb, pb->s); // No-op. - db->load (*pd, pd->s); - - assert (pb->s.loaded ()); - assert (pd->s.loaded ()); - - assert (pd->sn == d.sn); - - t.commit (); - } - - // Update object. - // - base b1 (b); - derived d1 (d); - d1.sn++; - d1.s.change (); - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (d1); - - assert (!d1.s.changed ()); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update section. - // - d1.sn++; - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (b1, b1.s); // No-op. - db->update (d1, d1.s); - - assert (b.v == b1.v); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update changed section. - // - d1.sn++; - - { - transaction t (db->begin ()); - db->update (d1, d1.s); - - try - { - db->update (d, d.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (d); - db->update (d, d.s); - } - - t.commit (); - } - } - - // Test reuse/polymorphic inheritance and optimistic mix. - // - { - using namespace test8; - - derived d (123); - - { - transaction t (db->begin ()); - db->persist (d); - t.commit (); - - assert (d.s.loaded ()); - } - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - assert (!pd->s.loaded ()); - assert (pd->sn != d.sn); - - db->load (*pd, pd->s); - - assert (pd->s.loaded ()); - assert (pd->sn == d.sn); - - t.commit (); - } - - // Update object. - // - derived d1 (d); - d1.sn++; - d1.s.change (); - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (d1); - - assert (!d1.s.changed ()); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update section. - // - d1.sn++; - - { - transaction t (db->begin ()); - unique_ptr pd (db->load (d.id)); - - db->update (d1, d1.s); - assert (d.v != d1.v); - - try - { - db->load (*pd, pd->s); - assert (false); - } - catch (const object_changed&) - { - db->reload (*pd); - assert (!pd->s.loaded ()); - db->load (*pd, pd->s); - - assert (pd->sn == d1.sn); - } - - db->reload (d); - assert (d.v == d1.v); - assert (d.sn == d1.sn); - t.commit (); - } - - // Update changed section. - // - d1.sn++; - - { - transaction t (db->begin ()); - db->update (d1, d1.s); - - try - { - db->update (d, d.s); - assert (false); - } - catch (const object_changed&) - { - db->reload (d); - db->update (d, d.s); - } - - t.commit (); - } - } - - // Test reuse/polymorphic inheritance and optimistic mix. - // - { - using namespace test9; - using std::shared_ptr; - - unsigned long long id; - - { - container c (123); - - c.e1.push_back (shared_ptr (new element (11))); - c.e1.push_back (shared_ptr (new element (12))); - - c.e2.push_back (shared_ptr (new element (21))); - c.e2.push_back (shared_ptr (new element (22))); - - transaction t (db->begin ()); - - db->persist (c.e1[0]); - db->persist (c.e1[1]); - db->persist (c.e2[0]); - db->persist (c.e2[1]); - - id = db->persist (c); - - t.commit (); - } - - { - transaction t (db->begin ()); - - shared_ptr c (db->load (id)); - - assert (c->n == 123); - db->load (*c, c->s); - assert (c->e1.size () == 2 && c->e1[0]->n == 11 && c->e1[1]->n == 12); - assert (c->e2.size () == 2 && c->e2[0]->n == 21 && c->e2[1]->n == 22); - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/section/polymorphism/test.hxx b/common/section/polymorphism/test.hxx deleted file mode 100644 index 6d524bd..0000000 --- a/common/section/polymorphism/test.hxx +++ /dev/null @@ -1,542 +0,0 @@ -// file : common/section/polymorphism/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include - -#include -#include - -// Test basic polymorphic section functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db object polymorphic abstract - struct root - { - root (int n): rs1n (n), rs2n (n), rs4n (n) {rs2v.push_back (n);} - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - // rs1: override in base and derived - // - #pragma db load(lazy) update(change) - odb::section rs1; - - #pragma db section(rs1) - int rs1n; - - // rs2: no override - // - #pragma db load(lazy) - odb::section rs2; - - #pragma db section(rs2) - int rs2n; - - #pragma db section(rs2) - std::vector rs2v; - - // rs3: empty - // - #pragma db load(lazy) - odb::section rs3; - - // rs4: override "gap" - // - #pragma db load(lazy) - odb::section rs4; - - #pragma db section(rs4) - int rs4n; - }; - - #pragma db object - struct base: root - { - base (int n = 999, const std::string& s = "xxx") - : root (n), rs1s (s), bs1n (n) {rs3v.push_back (n);} - - // rs1 - // - #pragma db section(rs1) - std::string rs1s; - - // rs3 - // - #pragma db section(rs3) - std::vector rs3v; - - // bs1: override in derived - // - #pragma db load(lazy) - odb::section bs1; - - #pragma db section(bs1) - int bs1n; - }; - - #pragma db object - struct derived: base - { - derived (int n = 999, const std::string& s = "xxx", bool b = false) - : base (n, s), rs1b (b), rs3n (n), rs4s (s), bs1s (s), ds1n (n) - {rs1v.push_back (n);} - - // rs1 - // - #pragma db section(rs1) - bool rs1b; - - #pragma db section(rs1) - std::vector rs1v; - - // rs3 - // - #pragma db section(rs3) - int rs3n; - - // rs4 - // - #pragma db section(rs4) - std::string rs4s; - - // bs1 - // - #pragma db section(bs1) - std::string bs1s; - - // ds1: no override - // - #pragma db load(lazy) - odb::section ds1; - - #pragma db section(ds1) - int ds1n; - }; -} - -// Test empty section and override "gap". -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object polymorphic abstract - struct root - { - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - #pragma db load(lazy) - odb::section s; - }; - - #pragma db object abstract - struct base: root - { - // The "gap". - }; - - #pragma db object - struct derived: base - { - derived (int n = 999): sn (n) {sv.push_back (n);} - - #pragma db section(s) - int sn; - - #pragma db section(s) - std::vector sv; - }; -} - -// Test value-only/container-only base/override combinations. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db object polymorphic - struct root - { - root (int n = 999) - : s1n (n), s2n (n) {s3v.push_back (n); s4nv.push_back (n);} - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - // value/value - // - #pragma db load(lazy) - odb::section s1; - - #pragma db section(s1) - int s1n; - - // value/container - // - #pragma db load(lazy) - odb::section s2; - - #pragma db section(s2) - int s2n; - - // container/value - // - #pragma db load(lazy) - odb::section s3; - - #pragma db section(s3) - std::vector s3v; - - // container/container - // - #pragma db load(lazy) - odb::section s4; - - #pragma db section(s4) - std::vector s4nv; - }; - - #pragma db object - struct base: root - { - base (int n = 999): root (n) {} - - // The "gap". - }; - - #pragma db object - struct derived: base - { - derived (int n = 999, const std::string& s = "xxx") - : base (n), s1s (s), s3n (n) {s2v.push_back (n); s4sv.push_back (s);} - - #pragma db section(s1) - std::string s1s; - - #pragma db section(s2) - std::vector s2v; - - #pragma db section(s3) - int s3n; - - #pragma db section(s4) - std::vector s4sv; - }; -} - -// Test basic polymorphic optimistic section functionality. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object polymorphic optimistic abstract sectionable - struct root - { - root (int n): rs1n (n), rs2n (n), rs3n (n), rs4n (n) {} - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - - // rs1: readwrite, override - // - #pragma db load(lazy) update(change) - odb::section rs1; - - #pragma db section(rs1) - int rs1n; - - // rs2: readonly, no override - // - #pragma db load(lazy) - odb::section rs2; - - #pragma db section(rs2) - const int rs2n; - - // rs3: readonly, readonly override - // - #pragma db load(lazy) - odb::section rs3; - - #pragma db section(rs3) - const int rs3n; - - // rs4: readonly, readwrite override - // - #pragma db load(lazy) - odb::section rs4; - - #pragma db section(rs4) - const int rs4n; - }; - - #pragma db object - struct base: root - { - base (int n = 999, const std::string& s = "xxx") - : root (n), rs1s (s), rs4s (s) {} - - // rs1 - // - #pragma db section(rs1) - std::string rs1s; - - // rs4 - // - #pragma db section(rs4) - std::string rs4s; - - // bs2: empty, readwrite override - // - #pragma db load(lazy) - odb::section bs1; - }; - - #pragma db object - struct derived: base - { - derived (int n = 999, const std::string& s = "xxx", bool b = false) - : base (n, s), rs1b (b), rs3s (s), bs1n (n) - { - rs1v.push_back (n); - rs4v.push_back (n); - ds1v.push_back (n); - } - - // rs1 - // - #pragma db section(rs1) - bool rs1b; - - #pragma db section(rs1) - std::vector rs1v; - - // rs3 - // - #pragma db section(rs3) - const std::string rs3s; - - // rs4 - // - #pragma db section(rs4) - std::vector rs4v; - - // bs1 - // - #pragma db section(bs1) - int bs1n; - - // ds1: readwrite - // - #pragma db load(lazy) - odb::section ds1; - - #pragma db section(ds1) - std::vector ds1v; - }; -} - -// Test polymorphic optimistic readonly/empty to readwrite section override. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db object polymorphic optimistic abstract - struct root - { - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - - #pragma db load(lazy) update(change) - odb::section s; - }; - - #pragma db object - struct base: root - { - // The "gap". - }; - - #pragma db object - struct derived: base - { - derived (int n = 999): sn (n) {} - - #pragma db section(s) - int sn; - }; -} - -// Test polymorphic optimistic readonly/empty to readwrite section override, -// eager-loaded case. -// -#pragma db namespace table("t6_") -namespace test6 -{ - #pragma db object polymorphic optimistic abstract - struct root - { - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - - #pragma db update(change) - odb::section s; - }; - - #pragma db object abstract - struct base: root - { - // The "gap". - }; - - #pragma db object - struct derived: base - { - derived (int n = 999): sn (n) {} - - #pragma db section(s) - int sn; - }; -} - -// Test polymorphic optimistic section added in derived. -// -#pragma db namespace table("t7_") -namespace test7 -{ - #pragma db object polymorphic optimistic sectionable - struct root - { - virtual ~root () {} - - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - }; - - #pragma db object - struct base: root - { - #pragma db load(lazy) update(change) - odb::section s; - }; - - #pragma db object - struct derived: base - { - derived (int n = 999): sn (n) {} - - #pragma db section(s) - int sn; - }; -} - -// Test reuse/polymorphic inheritance and optimistic mix. -// -#pragma db namespace table("t8_") -namespace test8 -{ - #pragma db object optimistic sectionable abstract - struct root - { - #pragma db id auto - unsigned long id; - - #pragma db version - unsigned long long v; - }; - - #pragma db object polymorphic sectionable - struct base: root - { - virtual ~base () {} - }; - - #pragma db object - struct derived: base - { - derived (int n = 999): sn (n) {} - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - int sn; - }; -} - -// Test id overwrite regression. -// -// The key here is the setup: the object that contains the containers in a -// section and the pointers to objects stored in those containers. And these -// objects derive polymorphically from the same base (and thus shared the id -// bindind). -// -#pragma db namespace table("t9_") -namespace test9 -{ - #pragma db object polymorphic pointer(std::shared_ptr) - struct base - { - virtual ~base () {} - - #pragma db id auto - unsigned long id; - }; - - #pragma db object - struct element: base - { - element (int n_ = 0): n (n_) {} - - int n; - }; - - typedef std::vector> elements; - - #pragma db object - struct container: base - { - container (int n_ = 0): n (n_) {} - - int n; - - #pragma db load(lazy) update(always) - odb::section s; - - #pragma db section(s) - elements e1; - - #pragma db section(s) - elements e2; - }; -} - -#endif // TEST_HXX diff --git a/common/section/polymorphism/testscript b/common/section/polymorphism/testscript deleted file mode 100644 index f2cd536..0000000 --- a/common/section/polymorphism/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/section/polymorphism/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/session/cache/buildfile b/common/session/cache/buildfile deleted file mode 100644 index 6d5b0bc..0000000 --- a/common/session/cache/buildfile +++ /dev/null @@ -1,41 +0,0 @@ -# file : common/session/cache/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix session_cache_ \ - --generate-schema \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/session/cache/driver.cxx b/common/session/cache/driver.cxx deleted file mode 100644 index 4b4ea12..0000000 --- a/common/session/cache/driver.cxx +++ /dev/null @@ -1,83 +0,0 @@ -// file : common/session/cache/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test session object cache. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test the session_required exception. - // - { - using namespace test1; - - shared_ptr o1a (new obj1 (1)); - shared_ptr o1b (new obj1 (2)); - shared_ptr o2 (new obj2 (1)); - - o1a->o2 = o2; - o1b->o2 = o2; - - o2->o1.push_back (o1a); - o2->o1.push_back (o1b); - - { - transaction t (db->begin ()); - db->persist (o1a); - db->persist (o1b); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - - try - { - shared_ptr o1 (db->load (1)); - assert (false); - } - catch (const session_required&) - { - } - - t.commit (); - } - - { - session s; - transaction t (db->begin ()); - shared_ptr o1 (db->load (1)); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/session/cache/test.hxx b/common/session/cache/test.hxx deleted file mode 100644 index d2b1b2b..0000000 --- a/common/session/cache/test.hxx +++ /dev/null @@ -1,50 +0,0 @@ -// file : common/session/cache/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Test the session_required exception. -// -#pragma db namespace table("t1_") -namespace test1 -{ - using std::shared_ptr; - using std::weak_ptr; - - #pragma db namespace(test1) pointer(shared_ptr) - - struct obj2; - - #pragma db object - struct obj1 - { - obj1 () {} - obj1 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - shared_ptr o2; - }; - - #pragma db object - struct obj2 - { - obj2 () {} - obj2 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db inverse (o2) - std::vector< weak_ptr > o1; - }; -} - -#endif // TEST_HXX diff --git a/common/session/cache/testscript b/common/session/cache/testscript deleted file mode 100644 index 6d013eb..0000000 --- a/common/session/cache/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/session/cache/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/session/custom/buildfile b/common/session/custom/buildfile deleted file mode 100644 index 1b64de1..0000000 --- a/common/session/custom/buildfile +++ /dev/null @@ -1,43 +0,0 @@ -# file : common/session/custom/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx txx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix session_custom_ \ - --generate-schema \ - --generate-session \ - --session-type ::session \ - --hxx-prologue '#include "session.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx deleted file mode 100644 index 3056fd6..0000000 --- a/common/session/custom/driver.cxx +++ /dev/null @@ -1,231 +0,0 @@ -// file : common/session/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom session (C++11 only). -// - -#include -#include // std::size_t -#include - -#include -#include -#include -#include -#include // ODB_CXX11_* - -#include - -#include "session.hxx" - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; - -using odb::database; -using odb::transaction; - -struct counting_tracer: odb::tracer -{ - virtual void - execute (odb::connection&, const char*) {count++;} - size_t count; -}; - -static counting_tracer tracer; - -struct failed {}; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Simple Tech Ltd. - // - { - shared_ptr er (new employer ("Simple Tech Ltd", "ST")); - - shared_ptr john (new employee ("John", "Doe", er)); - shared_ptr jane (new employee ("Jane", "Doe", er)); - - transaction t (db->begin ()); - - db->persist (er); - db->persist (john); - db->persist (jane); - - t.commit (); - } - - // Complex Systems Inc. - // - { - shared_ptr er (new employer ("Complex Systems Inc", "CS")); - - shared_ptr john (new employee ("John", "Smith", er)); - shared_ptr jane (new employee ("Jane", "Smith", er)); - - transaction t (db->begin ()); - - db->persist (er); - db->persist (john); - db->persist (jane); - - t.commit (); - } - - { - session s; - shared_ptr st, cs; - shared_ptr ste, cse; - - { - transaction t (db->begin ()); - - st = db->load ("Simple Tech Ltd"); -#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT - ste = db->load (st->employees ()[0].object_id ()); -#else - ste = db->load (st->employees ()[0].object_id ()); -#endif - - // Test object cache. - // - shared_ptr e (st->employees ()[0].load ()); - assert (ste->employer () == st); - assert (ste == e); - - t.commit (); - } - - { - transaction t (db->begin ()); - - cs = db->load ("Complex Systems Inc"); -#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT - cse = db->load (cs->employees ()[0].object_id ()); -#else - cse = db->load (cs->employees ()[0].object_id ()); -#endif - cs->employees ()[0].load (); - - t.commit (); - } - - cs->symbol ("CSI"); - - // Swap employees. - // - ste->employer (cs); - cse->employer (st); - st->employees ()[0] = cse; - cs->employees ()[0] = ste; - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 3); - t.commit (); - } - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 0); - t.commit (); - } - - cs->symbol ("COMP"); - st->symbol ("SMPL"); - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 2); - t.commit (); - } - - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 0); - t.commit (); - } - - // Explicit update. - // - cs->symbol ("CS"); - st->symbol ("ST"); - - { - transaction t (db->begin ()); - db->update (cs); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 1); - t.commit (); - } - - // Rollback after update. - // - cs->symbol ("CSI"); - - try - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 1); - throw failed (); - t.commit (); - } - catch (const failed&) - { - transaction t (db->begin ()); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 1); - t.commit (); - } - } - - // Test session destruction before transaction is commited. - // - { - transaction t (db->begin ()); - { - session s; - shared_ptr st (db->load ("Simple Tech Ltd")); - st->symbol ("STL"); - tracer.count = 0; - t.tracer (tracer); - s.flush (*db); - assert (tracer.count == 1); - } - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/session/custom/session.cxx b/common/session/custom/session.cxx deleted file mode 100644 index 1a08c79..0000000 --- a/common/session/custom/session.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : common/session/custom/session.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include - -#include "session.hxx" - -session* session::current; - -session:: -session () - : tran_ (0) -{ - assert (current == 0); - current = this; -} - -session:: -~session () -{ - // Unregister from transaction. - // - if (tran_ != 0) - tran_->callback_unregister (this); - - assert (current == this); - current = 0; -} - -void session:: -flush (odb::database& db) -{ - bool flushed (false); - - for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) - { - bool r (i->second->flush (db)); - flushed = flushed || r; - } - - // If we flushed anything, then register the post-commit/rollback callback. - // - if (flushed) - { - tran_ = &odb::transaction::current (); - tran_->callback_register ( - &mark, this, odb::transaction::event_all, 0, &tran_); - } -} - -void session:: -mark (unsigned short event, void* key, unsigned long long) -{ - session& s (*static_cast (key)); - for (type_map::iterator i (s.map_.begin ()), e (s.map_.end ()); i != e; ++i) - i->second->mark (event); -} diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx deleted file mode 100644 index 2d2f597..0000000 --- a/common/session/custom/session.hxx +++ /dev/null @@ -1,191 +0,0 @@ -// file : common/session/custom/session.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef SESSION_HXX -#define SESSION_HXX - -#include -#include -#include - -#include -#include - -#include // odb::object_traits -#include // odb::details::type_info_comparator - -// This custom session implementation assumes we are working with -// one database at a time. -// -class session -{ -public: - session (); - ~session (); - -private: - session (const session&); - session& operator= (const session&); - - // Session for the current thread. This can be implemented in pretty - // much any way that makes sense to the application. It can be a global - // session as we have here. In multi-threaded applications we could use - // TLS instead. - // -public: - static session* current; - - // Change tracking interface. - // -public: - // Call flush() within a transaction to apply the changes to the - // database. - // - void - flush (odb::database&); - -private: - struct object_map_base - { - virtual - ~object_map_base () {} - - // Return true if we flushed anything. - // - virtual bool - flush (odb::database&) = 0; - - virtual void - mark (unsigned short event) = 0; - }; - - enum object_state - { - tracking, // Tracking any modifications by storing the original copy. - changed, // Known to be changed. - flushed // Flushed but not yet committed/rolled back. - }; - - template - struct object_data - { - typedef typename odb::object_traits::pointer_type pointer_type; - - explicit - object_data (pointer_type o): obj (o), state (tracking) {} - - pointer_type obj; - pointer_type orig; - object_state state; - }; - - template - struct object_map: object_map_base, - std::map::id_type, - object_data > - { - virtual bool - flush (odb::database&); - - virtual void - mark (unsigned short event); - }; - - // Object cache interface. - // -public: - static bool - _has_cache () {return current != 0;} - - template - struct cache_position - { - typedef object_map map; - typedef typename map::iterator iterator; - - cache_position (): map_ (0) {} - cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} - - cache_position (const cache_position& p) - : map_ (p.map_) - { - // It might not be ok to use an uninitialized iterator. - // - if (p.map_ != 0) - pos_ = p.pos_; - } - - cache_position& - operator= (const cache_position& p) - { - // It might not be ok to use an uninitialized iterator on the rhs. - // - if (p.map_ != 0) - pos_ = p.pos_; - map_ = p.map_; - return *this; - } - - map* map_; - iterator pos_; - }; - - // Cache management. - // - template - static cache_position - _cache_insert (odb::database&, - const typename odb::object_traits::id_type&, - const typename odb::object_traits::pointer_type&); - - template - static typename odb::object_traits::pointer_type - _cache_find (odb::database&, const typename odb::object_traits::id_type&); - - template - static void - _cache_erase (const cache_position& p) - { - if (p.map_ != 0) - p.map_->erase (p.pos_); - } - - // Notifications. - // - template - static void - _cache_persist (const cache_position& p) - { - _cache_load (p); - } - - template - static void - _cache_load (const cache_position&); - - template - static void - _cache_update (odb::database&, const T&); - - template - static void - _cache_erase (odb::database&, - const typename odb::object_traits::id_type&); - -private: - // Post-commit/rollback callback. - // - static void - mark (unsigned short event, void* key, unsigned long long); - -private: - typedef std::map, - odb::details::type_info_comparator> type_map; - type_map map_; - odb::transaction* tran_; -}; - -#include "session.txx" - -#endif // SESSION_HXX diff --git a/common/session/custom/session.txx b/common/session/custom/session.txx deleted file mode 100644 index 65ab933..0000000 --- a/common/session/custom/session.txx +++ /dev/null @@ -1,159 +0,0 @@ -// file : common/session/custom/session.txx -// license : GNU GPL v2; see accompanying LICENSE file - -#include - -template -typename session::cache_position session:: -_cache_insert (odb::database&, - const typename odb::object_traits::id_type& id, - const typename odb::object_traits::pointer_type& obj) -{ - if (current == 0) - return cache_position (); // No session, return empty position. - - std::shared_ptr& pm (current->map_[&typeid (T)]); - - if (!pm) - pm.reset (new object_map); - - object_map& m (static_cast&> (*pm)); - - typename object_map::value_type vt (id, object_data (obj)); - std::pair::iterator, bool> r (m.insert (vt)); - - // We shall never try to re-insert the same object into the cache. - // - assert (r.second); - - return cache_position (m, r.first); -} - -template -typename odb::object_traits::pointer_type session:: -_cache_find (odb::database&, const typename odb::object_traits::id_type& id) -{ - typedef typename odb::object_traits::pointer_type pointer_type; - - if (current == 0) - return pointer_type (); // No session, return NULL pointer. - - type_map::const_iterator ti (current->map_.find (&typeid (T))); - - if (ti == current->map_.end ()) - return pointer_type (); - - const object_map& m (static_cast&> (*ti->second)); - typename object_map::const_iterator oi (m.find (id)); - - if (oi == m.end ()) - return pointer_type (); - - return oi->second.obj; -} - -template -void session:: -_cache_load (const cache_position& p) -{ - typedef typename odb::object_traits::pointer_type pointer_type; - - if (p.map_ == 0) - return; // Empty position. - - // Make a copy for change tracking. If our object model had a - // polymorphic hierarchy, then we would have had to use a - // virtual function-based mechanism (e.g., clone()) instead of - // the copy constructor since for a polymorphic hierarchy all - // the derived objects are stored as pointers to the root object. - // - p.pos_->second.orig = pointer_type (new T (*p.pos_->second.obj)); -} - -template -void session:: -_cache_update (odb::database&, const T& obj) -{ - typedef odb::object_traits object_traits; - typedef typename object_traits::pointer_type pointer_type; - - if (current == 0) - return; // No session. - - // User explicitly updated the object by calling database::update(). - // Change the state to flushed and reset the original copy (we are - // still tracking changes after the update). - // - type_map::iterator ti (current->map_.find (&typeid (T))); - - if (ti == current->map_.end ()) - return; // This object is not in the session. - - object_map& m (static_cast&> (*ti->second)); - typename object_map::iterator oi (m.find (object_traits::id (obj))); - - if (oi == m.end ()) - return; // This object is not in the session. - - object_data& d (oi->second); - d.orig = pointer_type (new T (*d.obj)); - d.state = flushed; -} - -template -void session:: -_cache_erase (odb::database&, - const typename odb::object_traits::id_type& id) -{ - if (current == 0) - return; // No session. - - type_map::iterator ti (current->map_.find (&typeid (T))); - - if (ti == current->map_.end ()) - return; - - object_map& m (static_cast&> (*ti->second)); - typename object_map::iterator oi (m.find (id)); - - if (oi == m.end ()) - return; - - m.erase (oi); - - if (m.empty ()) - current->map_.erase (ti); -} - -template -bool session::object_map:: -flush (odb::database& db) -{ - bool r (false); - for (typename object_map::iterator i (this->begin ()), e (this->end ()); - i != e; ++i) - { - object_data& d (i->second); - - if (d.state == changed || d.obj->changed (*d.orig)) - db.update (d.obj); // State changed by the update() notification. - - r = r || d.state == flushed; - } - - return r; -} - -template -void session::object_map:: -mark (unsigned short event) -{ - for (typename object_map::iterator i (this->begin ()), e (this->end ()); - i != e; ++i) - { - object_data& d (i->second); - - if (d.state == flushed) - d.state = event == odb::transaction::event_commit ? tracking : changed; - } -} diff --git a/common/session/custom/test.hxx b/common/session/custom/test.hxx deleted file mode 100644 index 3f2703f..0000000 --- a/common/session/custom/test.hxx +++ /dev/null @@ -1,118 +0,0 @@ -// file : common/session/custom/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include - -#include -#include - -class employee; - -#pragma db object pointer(std::shared_ptr) session -class employer -{ -public: - employer (const std::string& name, const std::string& symbol) - : name_ (name), symbol_ (symbol) {} - - const std::string& - name () const {return name_;} - - const std::string& - symbol () const {return symbol_;} - - void - symbol (const std::string& symbol) {symbol_ = symbol;} - - // Employees of this employer. - // - typedef std::vector> employees_type; - - const employees_type& - employees () const {return employees_;} - - employees_type& - employees () {return employees_;} - - // Change tracking. - // -public: - bool - changed (const employer& orig) const - { - // Note that we don't need to track object ids, inverse pointers, nor - // readonly/const data members. - // - return symbol_ != orig.symbol_; - } - -private: - friend class odb::access; - employer () {} - - #pragma db id - std::string name_; - - std::string symbol_; - - #pragma db value_not_null inverse(employer_) - employees_type employees_; -}; - -#pragma db object pointer(std::shared_ptr) session -class employee -{ -public: - typedef ::employer employer_type; - - employee (const std::string& first, - const std::string& last, - std::shared_ptr employer) - : first_ (first), last_ (last), employer_ (employer) {} - - // Name. - // - const std::string& - first () const {return first_;} - - const std::string& - last () const {return last_;} - - // Employer. - // - std::shared_ptr - employer () const {return employer_;} - - void - employer (std::shared_ptr e) {employer_ = e;} - - // Change tracking. - // -public: - bool - changed (const employee& orig) const - { - return first_ != orig.first_ || last_ != orig.last_ || - employer_ != orig.employer_; - } - -private: - friend class odb::access; - employee () {} - - #pragma db id auto - unsigned long id_; - - std::string first_; - std::string last_; - - #pragma db not_null - std::shared_ptr employer_; -}; - -#endif // TEST_HXX diff --git a/common/session/custom/testscript b/common/session/custom/testscript deleted file mode 100644 index 39c281d..0000000 --- a/common/session/custom/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/session/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/statement/processing/buildfile b/common/statement/processing/buildfile deleted file mode 100644 index 97124e8..0000000 --- a/common/statement/processing/buildfile +++ /dev/null @@ -1,8 +0,0 @@ -# file : common/statement/processing/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libs = libodb%lib{odb} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/common/statement/processing/driver.cxx b/common/statement/processing/driver.cxx deleted file mode 100644 index 2d00107..0000000 --- a/common/statement/processing/driver.cxx +++ /dev/null @@ -1,619 +0,0 @@ -// file : common/statement/processing/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test internal statement processing machinery. -// - -#include -#include - -#include - -#undef NDEBUG -#include - -using namespace std; - -static bool -insert (const char* stmt, - const char* expected, - const void* const* bind, - size_t bind_size) -{ - string r; - odb::statement::process_insert ( - r, stmt, bind, bind_size, sizeof (void*), '$'); - return r == expected; -} - -static bool -update (const char* stmt, - const char* expected, - const void* const* bind, - size_t bind_size) -{ - string r; - odb::statement::process_update ( - r, stmt, bind, bind_size, sizeof (void*), '$'); - return r == expected; -} - -static bool -select (const char* stmt, - const char* expected, - const void* const* bind, - size_t bind_size) -{ - string r; - odb::statement::process_select ( - r, stmt, bind, bind_size, sizeof (void*), '[', ']', true); - return r == expected; -} - -int -main (int, char* argv[]) -{ - // - // INSERT - // - - // Fast path. - // - { - void* b[] = {argv, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b])\n" - "VALUES\n" - "(DEFAULT,\n$1)", - "INSERT INTO [foo] ([a], [b]) VALUES (DEFAULT, $1)", - b, 2)); - } - - // Empty via statement. - // - /* LIBODB_DEBUG_STATEMENT_PROCESSING - { - assert (insert ("INSERT INTO [foo]\n" - "DEFAULT VALUES", - "INSERT INTO [foo] DEFAULT VALUES", - 0, 0)); - } - */ - - // Empty via bind. - // - { - void* b[] = {0}; - assert (insert ("INSERT INTO [foo]\n" - "([a])\n" - "VALUES\n" - "($1)", - "INSERT INTO [foo] DEFAULT VALUES", - b, 1)); - } - - // Empty with OUTPUT. - // - { - void* b[] = {0, 0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b])\n" - "OUTPUT INSERTED.[id]\n" - "VALUES\n" - "($1,\n$2)", - "INSERT INTO [foo] OUTPUT INSERTED.[id] DEFAULT VALUES", - b, 2)); - } - - // Empty with RETURNING. - // - { - void* b[] = {0, 0, 0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\n$1,\n$2)\n" - "RETURNING [id]", - "INSERT INTO [foo] DEFAULT VALUES RETURNING [id]", - b, 3)); - } - - // Empty via bind, but not values. - // - { - void* b[] = {0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b])\n" - "VALUES\n" - "(1,\n$1)", - "INSERT INTO [foo] ([a]) VALUES (1)", - b, 1)); - } - - // Empty via bind, but not values. - // - { - void* b[] = {0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "(1,\n$1,\nDEFAULT)", - "INSERT INTO [foo] ([a], [c]) VALUES (1, DEFAULT)", - b, 1)); - } - - // First not present. - // - { - void* b[] = {0, argv, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\n$2,\n$3)", - "INSERT INTO [foo] ([b], [c]) VALUES ($2, $3)", - b, 3)); - } - - // Last not present. - // - { - void* b[] = {argv, argv, 0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\n$2,\n$3)", - "INSERT INTO [foo] ([a], [b]) VALUES ($1, $2)", - b, 3)); - } - - // Middle not present. - // - { - void* b[] = {argv, 0, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\n$2,\n$3)", - "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3)", - b, 3)); - } - - // Multiple not present. - // - { - void* b[] = {0, argv, 0, argv, 0}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c],\n[d],\n[e])\n" - "VALUES\n" - "($1,\n$2,\n$3,\n$4,\n$5)", - "INSERT INTO [foo] ([b], [d]) VALUES ($2, $4)", - b, 5)); - } - - // Not present and OUTPUT. - // - { - void* b[] = {argv, 0, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "OUTPUT INSERTED.[id]\n" - "VALUES\n" - "($1,\n$2,\n$3)", - "INSERT INTO [foo] ([a], [c]) OUTPUT INSERTED.[id] " - "VALUES ($1, $3)", - b, 3)); - } - - // Not present and RETURNING. - // - { - void* b[] = {argv, 0, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\n$2,\n$3)\n" - "RETURNING [id]", - "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3) " - "RETURNING [id]", - b, 3)); - } - - // Value expressions. - // - { - void* b[] = {argv, argv, argv}; - assert (insert ("INSERT INTO [foo]\n" - "([a],\n[b],\n[c])\n" - "VALUES\n" - "($1,\nCAST($2, TEXT),\n$3)", - "INSERT INTO [foo] ([a], [b], [c]) " - "VALUES ($1, CAST($2, TEXT), $3)", - b, 3)); - } - - // - // UPDATE - // - - // Fast path. - // - { - void* b[] = {argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "ver=ver+1,\n[a]=$1\n" - "WHERE [id]=$2", - "UPDATE [foo] SET ver=ver+1, [a]=$1 WHERE [id]=$2", - b, 2)); - } - - // Empty via bind. - // - { - void* b[] = {0, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1\n" - "WHERE [id]=$2", - "", - b, 2)); - } - - // Empty via bind, but not values. - // - { - void* b[] = {0, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "ver=ver+1,\n[a]=$1\n" - "WHERE [id]=$2", - "UPDATE [foo] SET ver=ver+1 WHERE [id]=$2", - b, 2)); - } - - // First not present. - // - { - void* b[] = {0, argv, argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3\n" - "WHERE [id]=$4", - "UPDATE [foo] SET [b]=$2, [c]=$3 WHERE [id]=$4", - b, 4)); - } - - // Last not present. - // - { - void* b[] = {argv, argv, 0, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3\n" - "WHERE [id]=$4", - "UPDATE [foo] SET [a]=$1, [b]=$2 WHERE [id]=$4", - b, 4)); - } - - // Middle not present. - // - { - void* b[] = {argv, 0, argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3\n" - "WHERE [id]=$4", - "UPDATE [foo] SET [a]=$1, [c]=$3 WHERE [id]=$4", - b, 4)); - } - - // Multiple not present. - // - { - void* b[] = {0, argv, 0, argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3,\n" - "[d]=$4\n" - "WHERE [id]=$5", - "UPDATE [foo] SET [b]=$2, [d]=$4 WHERE [id]=$5", - b, 5)); - } - - // Not present and OUTPUT. - // - { - void* b[] = {argv, 0, argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3\n" - "OUTPUT INSERTED.[ver] " - "WHERE [id]=$4", - "UPDATE [foo] SET [a]=$1, [c]=$3 OUTPUT INSERTED.[ver] " - "WHERE [id]=$4", - b, 4)); - } - - // Value expressions. - // - { - void* b[] = {argv, argv, argv, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=CAST($2, TEXT),\n" - "[c]=$3\n" - "WHERE [id]=$4", - "UPDATE [foo] SET [a]=$1, [b]=CAST($2, TEXT), [c]=$3 " - "WHERE [id]=$4", - b, 4)); - } - - // No OUTPUT/WHERE clause. - // - { - void* b[] = {argv, 0, argv}; - assert (update ("UPDATE [foo]\n" - "SET\n" - "[a]=$1,\n" - "[b]=$2,\n" - "[c]=$3", - "UPDATE [foo] SET [a]=$1, [c]=$3", - b, 4)); - } - - // - // SELECT - // - - // Empty. - // - { - void* b[] = {0, 0, 0}; - assert (select ("SELECT\n" - "[a].[x],\n" - "[t].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "", - b, 3)); - } - - // Fast path. - // - { - void* b[] = {argv, argv}; - assert (select ("SELECT\n" - "[s].[t].[x],\n" - "[a].[y]\n" - "FROM [s].[t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id]\n" - "WHERE [s].[t].[id]=$1", - "SELECT [s].[t].[x], [a].[y] FROM [s].[t] " - "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id] " - "WHERE [s].[t].[id]=$1", - b, 2)); - } - - // First not present. - // - { - void* b[] = {0, argv, argv}; - assert (select ("SELECT\n" - "[a].[x],\n" - "[t].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[y], [t].[z] FROM [t] WHERE [t].[id]=$1", - b, 3)); - } - - // Last not present. - // - { - void* b[] = {argv, argv, 0}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[t].[y],\n" - "[a].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], [t].[y] FROM [t] WHERE [t].[id]=$1", - b, 3)); - } - - // Middle not present. - // - { - void* b[] = {argv, 0, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[a].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], [t].[z] FROM [t] WHERE [t].[id]=$1", - b, 3)); - } - - // Multiple not present. - // - { - void* b[] = {0, argv, 0, argv}; - assert (select ("SELECT\n" - "[a1].[w],\n" - "[t].[x],\n" - "[a2].[y],\n" - "[a3].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a1] ON [a1].[id]=[t].[id]\n" - "LEFT JOIN [t2] AS [a2] ON [a2].[id]=[t].[id]\n" - "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], [a3].[z] FROM [t] " - "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id] " - "WHERE [t].[id]=$1", - b, 4)); - } - - // Column expression. - // - { - void* b[] = {argv, argv, 0}; - assert (select ("SELECT\n" - "[t].[x],\n" - "CAST([a].[y], TEXT),\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], CAST([a].[y], TEXT) FROM [t] " - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " - "WHERE [t].[id]=$1", - b, 3)); - } - - // No WHERE. - // - { - void* b[] = {argv, 0, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[t].[y],\n" - "[t].[z]\n" - "FROM [t]", - "SELECT [t].[x], [t].[z] FROM [t]", - b, 3)); - } - - // JOIN without WHERE. - // - { - void* b[] = {argv, 0, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[a].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]", - "SELECT [t].[x], [t].[z] FROM [t]", - b, 3)); - } - - // JOIN presence because of WHERE. - // - { - void* b[] = {argv, 0, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[a].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "WHERE [t].[id]=$1 AND [a].[id]=$2", - "SELECT [t].[x], [t].[z] FROM [t] " - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " - "WHERE [t].[id]=$1 AND [a].[id]=$2", - b, 3)); - } - - - // JOIN presence because of dependent JOIN. - // - { - void* b[] = {argv, argv, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[a_b].[y],\n" - "[t].[z]\n" - "FROM [t]\n" - "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id]\n" - "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], [a_b].[y], [t].[z] FROM [t] " - "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id] " - "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id] " - "WHERE [t].[id]=$1", - b, 3)); - } - - // JOIN without alias and with schema. - // - { - void* b[] = {argv, argv, argv}; - assert (select ("SELECT\n" - "[t].[x],\n" - "[s].[t1].[y],\n" - "[t2].[z]\n" - "FROM [t]\n" - "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id]\n" - "LEFT JOIN [t2] ON [t2].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [t].[x], [s].[t1].[y], [t2].[z] FROM [t] " - "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id] " - "LEFT JOIN [t2] ON [t2].[id]=[t].[id] " - "WHERE [t].[id]=$1", - b, 3)); - } - - // JOIN alias top-level qualifer test. - // - { - void* b[] = {argv, 0}; - assert (select ("SELECT\n" - "[s].[a].[x],\n" - "[a].[y]\n" - "FROM [s].[a]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[a].[id]\n" - "WHERE [s].[a].[id]=$1", - "SELECT [s].[a].[x] FROM [s].[a] WHERE [s].[a].[id]=$1", - b, 2)); - } - - // JOIN alias bottom-level qualifer test (FROM case). - // - { - void* b[] = {argv, 0}; - assert (select ("SELECT\n" - "[a].[t].[x],\n" - "[a].[y]\n" - "FROM [a].[t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[a].[t].[id]\n" - "WHERE [a].[t].[id]=$1", - "SELECT [a].[t].[x] FROM [a].[t] WHERE [a].[t].[id]=$1", - b, 2)); - } - - // JOIN alias bottom-level qualifer test (LEFT JOIN case). - // - { - void* b[] = {0, argv}; - assert (select ("SELECT\n" - "[a].[y],\n" - "[a].[t2].[x]\n" - "FROM [t]\n" - "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" - "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id]\n" - "WHERE [t].[id]=$1", - "SELECT [a].[t2].[x] FROM [t] " - "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id] " - "WHERE [t].[id]=$1", - b, 2)); - } -} diff --git a/common/statement/processing/testscript b/common/statement/processing/testscript deleted file mode 100644 index 2460dc6..0000000 --- a/common/statement/processing/testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : common/statement/processing/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -: basics -: -$* diff --git a/common/threads/buildfile b/common/threads/buildfile deleted file mode 100644 index 53b98ec..0000000 --- a/common/threads/buildfile +++ /dev/null @@ -1,49 +0,0 @@ -# file : common/threads/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix threads_ \ - --generate-schema \ - --generate-query \ - --generate-prepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# While we don't call any pthread_*() functions, this appears to be needed for -# some std::thread implementations (like libstdc++). Note that -# odb::details::thread inlines some std::thread API calls. -# -if ($cxx.target.class != 'windows') - cxx.libs += -pthread - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/threads/driver.cxx b/common/threads/driver.cxx deleted file mode 100644 index 1add011..0000000 --- a/common/threads/driver.cxx +++ /dev/null @@ -1,236 +0,0 @@ -// file : common/threads/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test operations in a multi-threaded environment. -// - -#include -#include // std::unique_ptr -#include // std::size_t -#include - -#include -#include - -#include -#include - -#include // DATABASE_* -#include - -#if defined(DATABASE_SQLITE) -# include -#endif - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; -namespace details = odb::details; - -const unsigned long thread_count = 24; -const unsigned long iteration_count = 30; -const unsigned long sub_iteration_count = 40; - -struct task -{ - task (database& db, unsigned long n) - : db_ (db), n_ (n) - { - } - - void* - execute () - { - try - { - for (unsigned long i (0); i < iteration_count; ++i) - { - unsigned long id ((n_ * iteration_count + i) * 3); - - object o1 (id, "first object"); - object o2 (id + 1, "second object"); - object o3 (id + 2, "third object"); - - // The following transactions may lead to deadlocks. - // - while (true) - { - try - { - transaction t (db_.begin ()); - - db_.persist (o1); - db_.persist (o2); - db_.persist (o3); - t.commit (); - break; - } - catch (const deadlock&) {} - } - - while (true) - { - try - { -#if !defined(DATABASE_SQLITE) - transaction t (db_.begin ()); -#else - // SQLite has a peculiar table locking mode (shared cache) - // which can lead to any of the transactions in this test - // deadlocking even though they shouldn't from the user's - // perspective. One way to work around this problem is to - // start a "write" transaction as such right away. - // - transaction t; - - if (db_.id () != odb::id_sqlite) - t.reset (db_.begin ()); - else - { - t.reset ( - static_cast (db_).begin_immediate ()); - } -#endif - unique_ptr o (db_.load (id)); - assert (o->str_ == "first object"); - o->str_ = "another value"; - db_.update (*o); - t.commit (); - break; - } - catch (const deadlock&) {} - } - - for (unsigned long j (0); j < sub_iteration_count; ++j) - { - typedef odb::query query; - typedef odb::prepared_query prep_query; - typedef odb::result result; - - while (true) - { - try - { - transaction t (db_.begin ()); - - prep_query pq (db_.lookup_query ("object-query")); - - if (!pq) - { - pq = db_.prepare_query ( - "object-query", query::str == "another value"); - db_.cache_query (pq); - } - - result r (pq.execute (false)); - - bool found (false); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->id_ == id) - { - found = true; - break; - } - } - assert (found); - t.commit (); - break; - } - catch (const deadlock&) {} - } - } - - while (true) - { - try - { - transaction t (db_.begin ()); - db_.erase (id); - t.commit (); - break; - } - catch (const deadlock&) {} - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return reinterpret_cast (1); - } - - return 0; - } - - static void* - execute (void* arg) - { - return static_cast (arg)->execute (); - } - - database& db_; - unsigned long n_; -}; - -bool -test (int argc, char* argv[], size_t max_connections) -{ - unique_ptr db (create_database (argc, argv, true, max_connections)); - - vector > threads; - vector > tasks; - - for (unsigned long i (0); i < thread_count; ++i) - { - details::shared_ptr t (new (details::shared) task (*db, i)); - tasks.push_back (t); - - threads.push_back ( - details::shared_ptr ( - new (details::shared) details::thread (&task::execute, t.get ()))); - } - - bool r (true); - - for (unsigned long i (0); i < thread_count; ++i) - if (threads[i]->join () != 0) - r = false; - - { - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ()); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - db->erase (i->id_); - - t.commit (); - } - - return r; -} - -int -main (int argc, char* argv[]) -{ - try - { - if (!(test (argc, argv, 0) && - test (argc, argv, thread_count - 1) && - test (argc, argv, thread_count / 2) && - test (argc, argv, thread_count / 4))) - return 1; - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/threads/test.hxx b/common/threads/test.hxx deleted file mode 100644 index 2ed6e67..0000000 --- a/common/threads/test.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : common/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - object (unsigned long id, const std::string& str) - : id_ (id), str_ (str) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#endif // TEST_HXX diff --git a/common/threads/testscript b/common/threads/testscript deleted file mode 100644 index 87e03e0..0000000 --- a/common/threads/testscript +++ /dev/null @@ -1,50 +0,0 @@ -# file : common/threads/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - # Note: this is quite slow: - # - # $ time ./driver --database ~/odb-test.db - # real 3m5.593s - # user 1m1.244s - # sys 0m26.793s - # - # $ time ./driver --database /tmp/odb-test.db - # real 0m13.909s - # user 0m16.724s - # sys 0m4.874s - # - # $ time ./driver --database "file::memory:" - # real 0m12.406s - # user 0m15.694s - # sys 0m4.207s - # - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/transaction/basics/buildfile b/common/transaction/basics/buildfile deleted file mode 100644 index f412235..0000000 --- a/common/transaction/basics/buildfile +++ /dev/null @@ -1,13 +0,0 @@ -# file : common/transaction/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libs = libodb%lib{odb} -import libs += lib{common} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/transaction/basics/driver.cxx b/common/transaction/basics/driver.cxx deleted file mode 100644 index 1833555..0000000 --- a/common/transaction/basics/driver.cxx +++ /dev/null @@ -1,151 +0,0 @@ -// file : common/transaction/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test basic transaction operations. -// - -#include -#include // std::unique_ptr -#include - -#include -#include -#include -#include -#include - -#include -#include - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct transaction_tracer: odb::tracer -{ - virtual void - execute (connection&, const char* s) - { - string str (s); - - if (str == "BEGIN") - cout << "begin transaction" << endl; - else if (str == "COMMIT") - cout << "commit transaction" << endl; - else if (str == "ROLLBACK") - cout << "rollback transaction" << endl; - } - - // Override the other version to get rid of a Sun CC warning. - // - virtual void - execute (connection& c, const statement& s) - { - execute (c, s.text ()); - } -}; - -int -main (int argc, char* argv[]) -{ - { - transaction_tracer tracer; - unique_ptr db (create_database (argc, argv, false)); - db->tracer (tracer); - - assert (!transaction::has_current ()); - - // Current and db accessors. - // - cout << "test 001" << endl; - { - transaction t (db->begin ()); - assert (&t.database () == db.get ()); - 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 (odb_db::transaction) == sizeof (transaction)); - - odb_db::transaction t (static_cast (*db).begin ()); - odb_db::transaction& r (odb_db::transaction::current ()); - assert (&t == &r); - } - - // Transaction restart. - // - cout << "test 007" << endl; - { - transaction t (db->begin ()); - t.commit (); - t.reset (db->begin ()); - t.commit (); - } - } - - // Test early connection release. - // - { - unique_ptr db (create_database (argc, argv, false, 1)); - transaction t1 (db->begin ()); - t1.commit (); - transaction t2 (db->begin ()); - t2.rollback (); - transaction t3 (db->begin ()); - t3.commit (); - } -} diff --git a/common/transaction/basics/testscript b/common/transaction/basics/testscript deleted file mode 100644 index 94c58b6..0000000 --- a/common/transaction/basics/testscript +++ /dev/null @@ -1,62 +0,0 @@ -# file : common/transaction/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -+cat <=output - 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 - test 007 - begin transaction - commit transaction - begin transaction - commit transaction - EOI - -test.redirects += >>>../output - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $* -} diff --git a/common/transaction/callback/buildfile b/common/transaction/callback/buildfile deleted file mode 100644 index 78b1b03..0000000 --- a/common/transaction/callback/buildfile +++ /dev/null @@ -1,13 +0,0 @@ -# file : common/transaction/callback/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libs = libodb%lib{odb} -import libs += lib{common} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/transaction/callback/driver.cxx b/common/transaction/callback/driver.cxx deleted file mode 100644 index d0af993..0000000 --- a/common/transaction/callback/driver.cxx +++ /dev/null @@ -1,231 +0,0 @@ -// file : common/transaction/callback/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction callbacks. -// - -#include // std::unique_ptr -#include // std::size_t -#include - -#include -#include - -#include - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -struct callback -{ - callback (unsigned short v): v_ (v), t_ (0) {} - callback (unsigned short v, transaction& t): v_ (v), t_ (0) {register_ (t);} - ~callback () {if (t_ != 0) unregister ();} - - void - register_ (transaction& t) - { - t_ = &t; - t.callback_register (&func, this, transaction::event_all, v_, &t_); - } - - void - unregister () - { - cout << " unregister callback " << v_ << endl; - t_->callback_unregister (this); - t_ = 0; - } - - void - update (unsigned short v) - { - v_ = v; - t_->callback_update (this, transaction::event_all, v_, &t_); - } - -private: - static void - func (unsigned short event, void* key, unsigned long long data) - { - callback& c (*static_cast (key)); - - const char* en; - switch (event) - { - case transaction::event_commit: - en = "commit"; - break; - case transaction::event_rollback: - en = "rollback"; - break; - default: - en = "unknown"; - } - - cout << " callback " << c.v_ << " " << en << endl; - - assert (data == c.v_); - assert (c.t_ == 0); - } - - unsigned short v_; - transaction* t_; -}; - -struct failed {}; - -static void -throw_func (unsigned short, void*, unsigned long long) -{ - throw failed (); -} - -static void -dummy_func (unsigned short, void* key, unsigned long long data) -{ - assert (reinterpret_cast (key) == data); -} - -static void -fill (transaction& t) -{ - // 20 is from odb/transaction.hxx. - // - for (size_t i (0); i < 20; ++i) - t.callback_register (&dummy_func, - reinterpret_cast (i), - transaction::event_all, - i); -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv, false)); - - // We want to test both stack and dynamic slots. - // - for (unsigned short i (1); i < 3; ++i) - { - // Test basic logic. - // - cout << "test " << i << "/001" << endl; - - // Commit callback. - // - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - t.commit (); - } - - // Rollback callback. - // - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - t.rollback (); - } - - // Rollback via exception callback. - // - { - callback c1 (1); - - try - { - transaction t (db->begin ()); - if (i == 2) fill (t); - c1.register_ (t); - throw failed (); - } - catch (const failed&) - { - } - } - - // Unregister callback at the end. - // - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - c1.unregister (); - t.callback_unregister (&c1); // Test unregistering non-registered key. - t.commit (); - } - - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - c1.unregister (); - callback c2 (2, t); - t.commit (); - } - - // Unregister callback in the middle. - // - cout << "test " << i << "/002" << endl; - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - callback c2 (2, t); - callback c3 (3, t); - c2.unregister (); - t.commit (); - } - - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - callback c2 (2, t); - callback c3 (3, t); - c2.unregister (); - callback c4 (4, t); // Using the free slot. - t.commit (); - } - - // Test a callback in the middle that throws. - // - cout << "test " << i << "/003" << endl; - try - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c1 (1, t); - t.callback_register (&throw_func, 0); - callback c2 (2, t); - t.commit (); - } - catch (const failed&) - { - } - - // Test callback_update(). - // - { - transaction t (db->begin ()); - if (i == 2) fill (t); - callback c (1, t); - c.update (2); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/transaction/callback/testscript b/common/transaction/callback/testscript deleted file mode 100644 index 7229ecd..0000000 --- a/common/transaction/callback/testscript +++ /dev/null @@ -1,72 +0,0 @@ -# file : common/transaction/callback/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -+cat <=output - test 1/001 - callback 1 commit - callback 1 rollback - callback 1 rollback - unregister callback 1 - unregister callback 1 - callback 2 commit - test 1/002 - unregister callback 2 - callback 1 commit - callback 3 commit - unregister callback 2 - callback 1 commit - callback 4 commit - callback 3 commit - test 1/003 - callback 1 commit - callback 2 commit - test 2/001 - callback 1 commit - callback 1 rollback - callback 1 rollback - unregister callback 1 - unregister callback 1 - callback 2 commit - test 2/002 - unregister callback 2 - callback 1 commit - callback 3 commit - unregister callback 2 - callback 1 commit - callback 4 commit - callback 3 commit - test 2/003 - callback 1 commit - callback 2 commit - EOI - -test.redirects += >>>../output - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $* -} diff --git a/common/types/buildfile b/common/types/buildfile deleted file mode 100644 index 95fe5b6..0000000 --- a/common/types/buildfile +++ /dev/null @@ -1,39 +0,0 @@ -# file : common/types/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix types_ - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/types/driver.cxx b/common/types/driver.cxx deleted file mode 100644 index bdc66b8..0000000 --- a/common/types/driver.cxx +++ /dev/null @@ -1,37 +0,0 @@ -// file : common/types/driver.cxx -// 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" - -#undef NDEBUG -#include - -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/test.hxx b/common/types/test.hxx deleted file mode 100644 index a99b499..0000000 --- a/common/types/test.hxx +++ /dev/null @@ -1,55 +0,0 @@ -// file : common/types/test.hxx -// 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_; // Use long long to avoid warnings. -}; - -#endif // TEST_HXX diff --git a/common/types/testscript b/common/types/testscript deleted file mode 100644 index 159972b..0000000 --- a/common/types/testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : common/types/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -: basic -: -$* diff --git a/common/view/basics/buildfile b/common/view/basics/buildfile deleted file mode 100644 index d9738a4..0000000 --- a/common/view/basics/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/view/basics/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_view_b_ \ - --generate-schema \ - --generate-query \ - --generate-prepared - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/common/view/basics/driver.cxx b/common/view/basics/driver.cxx deleted file mode 100644 index e2f611a..0000000 --- a/common/view/basics/driver.cxx +++ /dev/null @@ -1,846 +0,0 @@ -// file : common/view/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test view basics. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include -#include // DATABASE_XXX - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -template -void -view1_check (odb::result& r) -{ - typedef odb::result result; - - typename result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); - - assert (++i != r.end ()); - V v; - i.load (v); - assert (v.first == "John" && v.last == "Doe" && v.age == 30); - - assert (++i == r.end ()); -} - -template -void -view2_test (const unique_ptr& db) -{ - typedef odb::query query; - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r (db->query ()); - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31"); - else - r = db->query ("\"age\" < 31"); - - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 2); - } - - { - result r (db->query (query::age < 31)); - iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->count == 2); - } - - { - unique_ptr v (db->query_one ()); - assert (v->count == 4); - } - - { - unique_ptr v; - if (db->id () != odb::id_oracle) - v.reset (db->query_one ("age < 31")); - else - v.reset (db->query_one ("\"age\" < 31")); - assert (v->count == 2); - } - - { - unique_ptr v (db->query_one (query::age < 31)); - assert (v->count == 2); - } - - t.commit (); -} - -template -void -view4_test (const unique_ptr& db) -{ - typedef odb::query query; - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ((query::person::age > 30) + "ORDER BY age"); - else - r = db->query ((query::person::age > 30) + "ORDER BY \"age\""); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->name == "Sweden"); - - assert (++i == r.end ()); - } - - { - result r (db->query ( - (query::person::age > 30) + - "ORDER BY " + query::person::age)); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->name == "Sweden"); - - assert (++i == r.end ()); - } - - { - result r (db->query (query::residence::code == "US")); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->name == "United States"); - - assert (++i == r.end ()); - } - - t.commit (); -} - -template -void -view6_test (const unique_ptr& db, const odb::query& q) -{ - typedef odb::result result; - typedef typename result::iterator iterator; - - transaction t (db->begin ()); - - { - result r (db->query (q)); - - iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->employer == "Simple Tech, Inc"); - - assert (++i != r.end ()); - assert (i->first_name == "Joe" && i->last_name == "Dirt" && - i->employer == "Simple Tech, Inc"); - - assert (++i == r.end ()); - } - - t.commit (); -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // - // - { - country ca ("CA", "Canada"); - country za ("ZA", "South Africa"); - country us ("US", "United States"); - country se ("SE", "Sweden"); - - person p1 (1, "John", "Doe", 30, male, measures (60, 160), &ca, &ca); - person p2 (2, "Jane", "Doe", 29, female, measures (70, 170), &za, &us); - person p3 (3, "Joe", "Dirt", 31, male, measures (80, 180), &us, &za); - person p4 (4, "Johan", "Johansen", 32, male, measures (90, 190), &se, - &se); - - p2.husband = &p1; - - employer st ("Simple Tech, Inc"); - employer ct ("Complex Tech, Inc"); - - p2.previous_employer = st.name; - p3.previous_employer = ct.name; - - st.employees.push_back (&p1); - st.employees.push_back (&p3); - st.head_count = 2; - - ct.employees.push_back (&p2); - ct.employees.push_back (&p4); - ct.head_count = 2; - - transaction t (db->begin ()); - db->persist (ca); - db->persist (za); - db->persist (us); - db->persist (se); - - db->persist (p1); - db->persist (p2); - db->persist (p3); - db->persist (p4); - - db->persist (st); - db->persist (ct); - t.commit (); - } - - // view1 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - assert (size (r) == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("ORDER BY age"); - else - r = db->query ("ORDER BY \"age\""); - - assert (size (r) == 4); - } - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31 ORDER BY age"); - else - r = db->query ("\"age\" < 31 ORDER BY \"age\""); - - view1_check (r); - } - - t.commit (); - } - } - - // view1a - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query ()); - view1_check (r); - - t.commit (); - } - } - - // view1b - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query ()); - view1_check (r); - - t.commit (); - } - - // No native parameter support in dynamic multi-database mode. - // -#ifndef MULTI_DATABASE - { - typedef odb::query query; - - transaction t (db->begin ()); - -#ifndef DATABASE_ORACLE - result r (db->query ("first = " + query::_val ("Jane"))); -#else - result r (db->query ("\"first\" = " + query::_val ("Jane"))); -#endif - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first == "Jane" && i->last == "Doe"); - assert (++i == r.end ()); - - t.commit (); - } -#endif - } - - // view1c - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r; - if (db->id () != odb::id_oracle) - r = db->query ("SELECT first, last, age " - "FROM t_view_b_person " - "WHERE age < 31 ORDER BY age"); - else - r = db->query ("SELECT \"first\", \"last\", \"age\" " - "FROM \"t_view_b_person\" " - "WHERE \"age\" < 31 ORDER BY \"age\""); - view1_check (r); - - t.commit (); - } - } - - // view1d - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r; - if (db->id () != odb::id_oracle) - r = db->query ("age < 31 ORDER BY age"); - else - r = db->query ("\"age\" < 31 ORDER BY \"age\""); - - view1_check (r); - } - - t.commit (); - } - } - - // view2 - // - view2_test (db); - view2_test (db); - view2_test (db); - view2_test (db); - - // view3 - // - { - typedef odb::result result; // Test const result. - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - size_t count (0); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->last_name == "Doe") - assert (i->count == 2); - else if (i->last_name == "Dirt" || - i->last_name == "Johansen") - assert (i->count == 1); - else - assert (false); - - count++; - } - - assert (count == 3); - } - - t.commit (); - } - } - - // view3a - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::last_name == "Doe")); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && i->count == 2); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view4 - // - view4_test (db); - view4_test (db); - - // view5 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r ( - db->query ( - query::residence::name == query::nationality::name)); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->rname == "Canada" && i->rname == "Canada"); - - assert (++i != r.end ()); - assert (i->first_name == "Johan" && i->last_name == "Johansen" && - i->rname == "Sweden" && i->rname == "Sweden"); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view6 - // - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - view6_test ( - db, odb::query::employer::name == "Simple Tech, Inc"); - - // No native parameter support in dynamic multi-database mode. - // -#ifndef MULTI_DATABASE - view6_test ( -#ifndef DATABASE_ORACLE - db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); -#else - db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); -#endif -#endif - - // view7 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::person::last_name == "Doe")); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Jane" && i->last_name == "Doe" && - !i->head_count.null () && *i->head_count == 2); - - assert (++i != r.end ()); - assert (i->first_name == "John" && i->last_name == "Doe" && - i->head_count.null ()); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view8 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->wife_name == "Jane" && i->husb_name == "John"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view9 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - // Test case-insensitive clause prefix detection. - // - result r (db->query ("where" + (query::gender == female))); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->first_name == "Jane" && i->last_name == "Doe" && - i->gender == female); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view10 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ( - query::measures.weight > 60 && - query::measures.hight < 190)); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && - i->measures.weight == 70 && i->measures.hight == 170); - - assert (++i != r.end ()); - assert (i->last_name == "Dirt" && - i->measures.weight == 80 && i->measures.hight == 180); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view11 - // - { - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ()); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->last_name == "Doe" && i->hight == 170); - - assert (++i != r.end ()); - assert (i->last_name == "Dirt" && i->hight == 180); - - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view12 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query (query::last_name == "Dirt")); - - result::iterator i (r.begin ()); - - assert (i != r.end ()); - assert (i->residence == "US"); - assert (++i == r.end ()); - } - - t.commit (); - } - } - - // view13 - // - { - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - { - result r (db->query ( - (query::person::age < 32) + - "ORDER BY" + query::employer::name)); - - assert (size (r) == 2); - } - - t.commit (); - } - } - - // view14 - // - { - transaction t (db->begin ()); - assert (size (db->query ()) == 2); - t.commit (); - } - - // Test join types. - // - { - using namespace test2; - - { - obj1 o11 (1, 1); - obj1 o12 (2, 2); - - obj2 o21 (1, 1); - obj2 o22 (2, 1); - obj2 o23 (3, 3); - - transaction t (db->begin ()); - db->persist (o11); - db->persist (o12); - db->persist (o21); - db->persist (o22); - db->persist (o23); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); - result::iterator i (r.begin ()); - assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); - assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); - assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); - assert (++i == r.end ()); - t.commit (); - } - - // @@ BUILD2 Also disable for DATABASE_MYSQL and DATABASE_PGSQL (see - // vright definition for details). - // -#if !defined(DATABASE_MYSQL) && \ - !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_PGSQL) - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); - result::iterator i (r.begin ()); - assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); - assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); - assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); - assert (++i == r.end ()); - t.commit (); - } -#endif - - // @@ BUILD2 Also disable for DATABASE_PGSQL (see vfull definition for - // details). - // -#if !defined(DATABASE_MYSQL) && \ - !defined(DATABASE_SQLITE) && \ - !defined(DATABASE_PGSQL) - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); - result::iterator i (r.begin ()); - - // SQL Server orders NULL values first. Got to be different. - // -#ifdef DATABASE_MSSQL - assert ( i != r.end () && i->id1.null () && *i->id2 == 3); - assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 1); - assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); - assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); -#else - assert ( i != r.end () && *i->id1 == 1 && *i->id2 == 1); - assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); - assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); - assert (++i != r.end () && i->id1.null () && *i->id2 == 3); -#endif - assert (++i == r.end ()); - t.commit (); - } -#endif - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); - result::iterator i (r.begin ()); - assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); - assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); - assert (++i == r.end ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); - result::iterator i (r.begin ()); - assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); - assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); - assert (++i != r.end () && i->id1 == 1 && i->id2 == 3); - assert (++i != r.end () && i->id1 == 2 && i->id2 == 1); - assert (++i != r.end () && i->id1 == 2 && i->id2 == 2); - assert (++i != r.end () && i->id1 == 2 && i->id2 == 3); - assert (++i == r.end ()); - t.commit (); - } - - // Inner JOIN via relationship/container. - // - { - obj3 o31 (1, 1); - obj3 o32 (2, 2); - - obj4 o41 (1, 1); - obj4 o42 (2, 2); - o42.o3.push_back (&o32); - - transaction t (db->begin ()); - db->persist (o31); - db->persist (o32); - db->persist (o41); - db->persist (o42); - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ()); - result::iterator i (r.begin ()); - assert ( i != r.end () && i->id4 == 2); - assert (++i == r.end ()); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/view/basics/test.hxx b/common/view/basics/test.hxx deleted file mode 100644 index 130bcd4..0000000 --- a/common/view/basics/test.hxx +++ /dev/null @@ -1,640 +0,0 @@ -// file : common/view/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include // std::size_t - -#include -#include - -struct employer; - -#pragma db object -struct country -{ - country (const std::string& c, const std::string& n) - : code (c), name (n) - { - } - - country () - { - } - - #pragma db id - std::string code; // ISO 2-letter country code. - - std::string name; -}; - -enum gender_type {male, female}; - -#pragma db value -struct measures -{ - measures (unsigned short w, unsigned short h) : weight (w), hight (h) {} - measures () {} - - unsigned short weight; - unsigned short hight; -}; - -#pragma db object -struct person -{ - typedef ::measures measures_type; - - person (unsigned long i, - const std::string& fn, - const std::string& ln, - unsigned short a, - gender_type g, - const measures_type m, - country* r, - country* n) - : id (i), - first_name_ (fn), - last_name_ (ln), - age (a), - gender (g), - measures (m), - residence (r), - nationality (n), - husband (0) - { - } - - person () - { - } - - #pragma db id - unsigned long id; - - #pragma db column("first") - std::string first_name_; - - #pragma db column("last") - std::string last_name_; - - unsigned short age; - - // #pragma db type("INT") - in MySQL test type pragma copying - gender_type gender; - - measures_type measures; - - #pragma db not_null - country* residence; - - #pragma db not_null - country* nationality; - - #pragma db inverse(employees) - employer* employed_by; - - // A non-pointer relationship. - // - odb::nullable previous_employer; - - person* husband; // Self-reference. -}; - -#pragma db object -struct employer -{ - employer (const std::string& n) - : name (n) - { - } - - employer () - { - } - - #pragma db id - std::string name; - unsigned int head_count; - std::vector employees; -}; - -// -// General view with no associated objects. -// - -// Complete suffix query template. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age FROM t_view_b_person") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_b_person\"") -#endif -struct view1 -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Complete query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age " \ - "FROM t_view_b_person " \ - "WHERE age < 31 ORDER BY age") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_b_person\" " \ - "WHERE \"age\" < 31 ORDER BY \"age\"") -#endif -struct view1a -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Complete placeholder query template. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view query("SELECT first, last, age " \ - "FROM t_view_b_person " \ - "WHERE age < 31 AND (?) ORDER BY age") -#else -# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ - "FROM \"t_view_b_person\" " \ - "WHERE \"age\" < 31 AND (?) ORDER BY \"age\"") -#endif -struct view1b -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Runtime query. -// -#pragma db view //query() -struct view1c -{ - std::string first; - std::string last; - unsigned short age; -}; - -// Assembled SELECT and FROM-lists. -// -#pragma db view table("t_view_b_person") -struct view1d -{ - #pragma db column("first") - std::string first; - - #pragma db column("last") - std::string last; - - #pragma db column("age") - unsigned short age; -}; - -// -// Count view plus associated object. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person) \ - query("SELECT count(id) FROM t_view_b_person") -#else -# pragma db view object(person) \ - query("SELECT count(\"id\") FROM \"t_view_b_person\"") -#endif -struct view2 -{ - std::size_t count; -}; - -// Generated query, literal column. -// -#pragma db view object(person) -struct view2a -{ -#ifndef ODB_DATABASE_ORACLE - #pragma db column("count(id)") -#else - #pragma db column("count(\"id\")") -#endif - std::size_t count; -}; - -// Generated query, qualified literal column. -// -#pragma db view object(person) -struct view2b -{ -#ifndef ODB_DATABASE_ORACLE - #pragma db column("count(t_view_b_person.id)") -#else - #pragma db column("count(\"t_view_b_person\".\"id\")") -#endif - std::size_t count; -}; - -// Generated query, expression column. -// -#pragma db view object(person) -struct view2c -{ - #pragma db column("count(" + person::id + ")") - std::size_t count; -}; - -// -// Aggregate view plus associated object with a custom alias. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person = test) \ - query("SELECT last, count(last) " \ - "FROM t_view_b_person " \ - "GROUP BY last") -#else -# pragma db view object(person = test) \ - query("SELECT \"last\", count(\"last\") " \ - "FROM \"t_view_b_person\" " \ - "GROUP BY \"last\"") -#endif -struct view3 -{ - std::string last_name; - std::size_t count; -}; - -// Generated query with integrated query condition and placeholder. -// -#pragma db view object(person = test) \ - query((?) + "GROUP BY" + test::last_name_) -struct view3a -{ - // Automatically resolved to test::last_name_. - // - std::string last_name; - - #pragma db column("count(" + test::last_name_ + ")") - std::size_t count; -}; - -// -// JOIN view plus associated objects, some with custom aliases. -// - -// Complete suffix query. -// -#ifndef ODB_DATABASE_ORACLE -# pragma db view object(person) object(country = residence) \ - query("SELECT first, last, residence.name " \ - "FROM t_view_b_person " \ - "LEFT JOIN t_view_b_country AS residence " \ - "ON t_view_b_person.residence = residence.code") -#else -# pragma db view object(person) object(country = residence) \ - query("SELECT \"first\", \"last\", \"residence\".\"name\" " \ - "FROM \"t_view_b_person\" " \ - "LEFT JOIN \"t_view_b_country\" \"residence\" " \ - "ON \"t_view_b_person\".\"residence\" = \"residence\".\"code\"") -#endif -struct view4 -{ - std::string first_name; - std::string last_name; - std::string name; -}; - -// Generated query. -// -#pragma db view object(person) \ - object(country = residence: person::residence) -struct view4a -{ - std::string first_name; - std::string last_name; - std::string name; -}; - -// -// JOIN the same object twice. -// -#pragma db view object(person) \ - object(country = residence: person::residence) \ - object(country = nationality: person::nationality) \ - query((?) + "ORDER BY" + person::age) -struct view5 -{ - std::string first_name; - std::string last_name; - - #pragma db column(residence::name) - std::string rname; - - #pragma db column(nationality::name) - std::string nname; -}; - -// -// JOIN via one(i)-to-many relationship. -// - -// Automatic relationship discovery. -// -#pragma db view object(person) object(employer) -struct view6 -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// Manual relationship specification, left side. -// -#pragma db view object(person) object(employer: person::employed_by) -struct view6a -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// Manual relationship specification, right side. -// -#pragma db view object(person) object(employer: employer::employees) -struct view6b -{ - std::string first_name; - std::string last_name; - - #pragma db column(::employer::name) - std::string employer; -}; - -// The same using tables. -// -#if defined(ODB_DATABASE_ORACLE) -#pragma db view table("t_view_b_person" = "p") \ - table("t_view_b_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ - table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") -#elif defined(ODB_DATABASE_MSSQL) -#pragma db view table("t_view_b_person" = "p") \ - table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_b_employer" = "e": "[ee].[object_id] = e.name") -#elif defined(ODB_DATABASE_MYSQL) -#pragma db view table("t_view_b_person" = "p") \ - table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_b_employer" = "e": "`ee`.`object_id` = e.name") -#else -#pragma db view table("t_view_b_person" = "p") \ - table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ - table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = e.name") -#endif -struct view6c -{ - #pragma db column("p.first") - std::string first_name; - - #pragma db column("p.last") - std::string last_name; - - #pragma db column("e"."name") - std::string employer; -}; - -// -// JOIN via a custom condition. -// -#pragma db view object(person) \ - object(employer: person::previous_employer == employer::name)\ - query((?) + "ORDER BY" + person::age) -struct view7 -{ - std::string first_name; - std::string last_name; - - odb::nullable head_count; -}; - -// -// Self-JOIN. -// -#pragma db view object(person = wife) object(person = husb) \ - query (wife::husband.is_not_null ()) -struct view8 -{ - #pragma db column(wife::first_name_) - std::string wife_name; - - #pragma db column(husb::first_name_) - std::string husb_name; -}; - -// -// Enum mapping. -// -#pragma db view object(person) -struct view9 -{ - std::string first_name; - std::string last_name; - gender_type gender; -}; - -// -// Composite in view. -// -#pragma db view object(person) query((?) + "ORDER BY" + person::age) -struct view10 -{ - std::string last_name; - ::measures measures; -}; - -// -// Composite in object. -// -#pragma db view object(person) \ - query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ - + "ORDER BY" + person::age) -struct view11 -{ - std::string last_name; - - #pragma db column(person::measures.hight) - unsigned short hight; -}; - -// -// Extract object pointer as object id. -// -#pragma db view object(person) -struct view12 -{ - std::string residence; -}; - -// -// Test 'distinct' result modifier. -// -#pragma db view object(employer) object(person) query(distinct) -struct view13 -{ - std::string name; -}; - -// -// Test 'for_update' result modifier. -// -#pragma db view object(employer) query((?), for_update) -struct view14 -{ - std::string name; -}; - -// Test join types. -// -#pragma db namespace table("t2_") -namespace test2 -{ - #pragma db object - struct obj1 - { - obj1 (int id = 0, int n_ = 0): id1 (id), n (n_) {} - - #pragma db id - int id1; - - int n; - }; - - #pragma db object no_id - struct obj2 - { - obj2 (int id = 0, int n_ = 0): id2 (id), n (n_) {} - - #pragma db id - int id2; - - int n; - }; - - #pragma db view object(obj1 = o1) object(obj2 = o2 left: o1::n == o2::n) - struct vleft - { - int id1; - odb::nullable id2; - }; - - // @@ BUILD2 Also disable for ODB_DATABASE_MYSQL and ODB_DATABASE_PGSQL, - // otherwise we end up with the following error: - // - // test-odb-mysql.hxx:3202:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ - // 3202 | public access::view_traits< ::test2::vright > - // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // -//#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) -#if !defined(ODB_DATABASE_MYSQL) && \ - !defined(ODB_DATABASE_SQLITE) && \ - !defined(ODB_DATABASE_PGSQL) && \ - !defined(ODB_DATABASE_COMMON) - - #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) - struct vright - { - int id1; - odb::nullable id2; - }; - -#endif - - // @@ BUILD2 Also disable for ODB_DATABASE_PGSQL, otherwise we end up with the - // following error: - // - // test-odb-pgsql.hxx:3325:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ - // 3325 | public access::view_traits< ::test2::vfull > - // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // -/* -#if !defined(ODB_DATABASE_MYSQL) && \ - !defined(ODB_DATABASE_SQLITE) && \ - !defined(ODB_DATABASE_COMMON) -*/ -#if !defined(ODB_DATABASE_MYSQL) && \ - !defined(ODB_DATABASE_SQLITE) && \ - !defined(ODB_DATABASE_PGSQL) && \ - !defined(ODB_DATABASE_COMMON) - - #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) - struct vfull - { - odb::nullable id1; - odb::nullable id2; - }; - -#endif - - #pragma db view object(obj1 = o1) object(obj2 = o2 inner: o1::n == o2::n) - struct vinner - { - int id1; - int id2; - }; - - #pragma db view object(obj1 = o1) object(obj2 = o2 cross) - struct vcross - { - int id1; - int id2; - }; - - // Inner JOIN via relationship/container. - // - #pragma db object - struct obj3 - { - obj3 (int id = 0, int n_ = 0): id3 (id), n (n_) {} - - #pragma db id - int id3; - - int n; - }; - - #pragma db object no_id - struct obj4 - { - obj4 (int id = 0, int n_ = 0): id4 (id), n (n_) {} - - #pragma db id - int id4; - - int n; - std::vector o3; - }; - - #pragma db view object(obj4) object(obj3 inner) - struct vrel - { - int id4; - }; -} - -#endif // TEST_HXX diff --git a/common/view/basics/testscript b/common/view/basics/testscript deleted file mode 100644 index faa8408..0000000 --- a/common/view/basics/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/view/basics/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/view/olv/.gitignore b/common/view/olv/.gitignore deleted file mode 100644 index 2b95165..0000000 --- a/common/view/olv/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# ODB-generated files. -# -test1-odb.?xx -test1-odb-*.?xx -test1.sql -test1-*.sql - -test2-odb.?xx -test2-odb-*.?xx -test2.sql -test2-*.sql - -test3-odb.?xx -test3-odb-*.?xx -test3.sql -test3-*.sql - -test4-odb.?xx -test4-odb-*.?xx -test4.sql -test4-*.sql - -test5-odb.?xx -test5-odb-*.?xx -test5.sql -test5-*.sql - -test6-odb.?xx -test6-odb-*.?xx -test6.sql -test6-*.sql - -test7-odb.?xx -test7-odb-*.?xx -test7.sql -test7-*.sql - -test8-odb.?xx -test8-odb-*.?xx -test8.sql -test8-*.sql - -test9-odb.?xx -test9-odb-*.?xx -test9.sql -test9-*.sql diff --git a/common/view/olv/buildfile b/common/view/olv/buildfile deleted file mode 100644 index 89ecbcf..0000000 --- a/common/view/olv/buildfile +++ /dev/null @@ -1,50 +0,0 @@ -# file : common/view/olv/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -for h: $hs -{ - exe{driver}: {hxx ixx cxx}{$h-odb} - - <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} - - for db: $databases - { - exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi - <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} - } -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix t_view_olv_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../../alias{database-client}: include = adhoc - -testscript@./: schemas = $hs diff --git a/common/view/olv/driver.cxx b/common/view/olv/driver.cxx deleted file mode 100644 index c08015e..0000000 --- a/common/view/olv/driver.cxx +++ /dev/null @@ -1,654 +0,0 @@ -// file : common/view/olv/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test object loading views. -// - -#include // std::unique_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test1.hxx" -#include "test2.hxx" -#include "test3.hxx" -#include "test4.hxx" -#include "test5.hxx" -#include "test6.hxx" -#include "test7.hxx" -#include "test8.hxx" -#include "test9.hxx" - -#include "test1-odb.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" -#include "test4-odb.hxx" -#include "test5-odb.hxx" -#include "test6-odb.hxx" -#include "test7-odb.hxx" -#include "test8-odb.hxx" -#include "test9-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic object loading functionality. - // - { - using namespace test1; - - { - object1 o1a (1, 123); - object2 o2 (1, "abc"); - - transaction t (db->begin ()); - db->persist (o1a); - db->persist (o2); - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - view1 v (db->query_value (query::object1::n == 123)); - assert (v.o2->s == "abc"); - t.commit (); - } - - { - transaction t (db->begin ()); - view2 v (db->query_value ()); - assert (v.o1->n == 123 && v.o2->s == "abc"); - t.commit (); - } - - { - transaction t (db->begin ()); - view3 v (db->query_value ()); - assert (v.o1->n == 123 && v.o2->s == "abc"); - t.commit (); - } - - { - transaction t (db->begin ()); - view4 v (db->query_value ()); - assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && - v.o1->n == 123 && v.n == 123); - t.commit (); - } - - { - transaction t (db->begin ()); - view4 v (db->query_value ()); - assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && - v.o1->n == 123 && v.n == 123); - t.commit (); - } - - { - typedef odb::query query; - - object1 o1b (123, 1); - - transaction t (db->begin ()); - db->persist (o1b); - view5 v (db->query_value (query::o1b::n == 1)); - assert (v.o1a->n == 123 && v.o2->s == "abc" && v.o1b->n == 1); - t.commit (); - } - } - - // Test loading of object pointers inside objects. - // - { - using namespace test2; - - shared_ptr o1 (new object1 (123)); - shared_ptr o2 (new object2 ("abc", o1)); - - { - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - view1 v (db->query_value ()); - assert (v.o2->s == "abc" && v.o2->o1->n == 123); - t.commit (); - } - - { - // Check session interaction. - // - transaction t (db->begin ()); - session s; - shared_ptr o2a (db->load (o2->id)); - view1 v (db->query_value ()); - assert (v.o2 == o2a); - t.commit (); - } - - { - transaction t (db->begin ()); - session s; - view2 v (db->query_value ()); - assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); - t.commit (); - } - - shared_ptr o3 (new object3 (o2)); - - { - transaction t (db->begin ()); - db->persist (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - session s; - view3 v (db->query_value ()); - assert (v.o1->n == 123 && v.o3->o2->s == "abc" && - v.o3->o2->o1 == v.o1); - t.commit (); - } - - shared_ptr o1b (new object1 (234)); - shared_ptr o2b (new object2 ("bcd", o1b)); - shared_ptr o4 (new object4); - o4->o2.push_back (o2); - o4->o2.push_back (o2b); - - { - transaction t (db->begin ()); - db->persist (o1b); - db->persist (o2b); - db->persist (o4); - t.commit (); - } - - { - transaction t (db->begin ()); - view4 v (db->query_value ()); - assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && - v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - session s; - result r (db->query ("ORDER BY" + query::object1::id)); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - { - const view5& v (*i); - - assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && - v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && - v.o4->o2[0]->o1 == v.o1); - } - assert (++i != r.end ()); - { - const view5& v (*i); - - assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && - v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && - v.o4->o2[1]->o1 == v.o1); - } - assert (++i == r.end ()); - t.commit (); - } - - shared_ptr o5 (new object5 (o1b, o2)); - - { - transaction t (db->begin ()); - db->persist (o5); - t.commit (); - } - - { - transaction t (db->begin ()); - view6 v (db->query_value ()); - assert (v.o1a->n == 123 && v.o1b->n == 234); - t.commit (); - } - } - - // Test JOINs for pointed-to objects, existing and automatically added. - // - { - using namespace test3; - - shared_ptr o1 (new object1 (123)); - shared_ptr o2 (new object2 ("abc")); - - o1->o2 = o2; - o2->o1 = o1; - - { - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - view1a v (db->query_value ()); - // VC11 - assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); - t.commit (); - } - - { - transaction t (db->begin ()); - view1b v (db->query_value ()); - // VC11 - assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); - t.commit (); - } - - // Container case. - // - - shared_ptr o3 (new object3 (123)); - shared_ptr o4 (new object4 ("abc")); - - o3->o4 = o4; - o4->o3.push_back (o3); - - { - - transaction t (db->begin ()); - db->persist (o3); - db->persist (o4); - t.commit (); - } - - { - transaction t (db->begin ()); - view2a v (db->query_value ()); - // VC11 - assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); - t.commit (); - } - - { - transaction t (db->begin ()); - view2b v (db->query_value ()); - // VC11 - assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); - t.commit (); - } - } - - // Test by-value load. - // - { - using namespace test4; - - { - object1 o1 (1, 123); - object2 o2 (1, "abc", &o1); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - view1 v (db->query_value ()); - assert (v.o1.n == 123); - t.commit (); - } - - { - transaction t (db->begin ()); - view1a v (db->query_value ()); - assert (!v.o1_null && v.o1.n == 123); - t.commit (); - } - - { - transaction t (db->begin ()); - view1b v (db->query_value ()); - assert (/*v.o1_p == &v.o1 && */ v.o1.n == 123); // Copy ctor. - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ()); - result::iterator i (r.begin ()); - assert (i != r.end ()); - - object1 o1; - view1c v (o1); - i.load (v); - - assert (v.o1_p == &o1 && o1.n == 123); - - assert (++i == r.end ()); - t.commit (); - } - - { - transaction t (db->begin ()); - session s; - view2 v (db->query_value ()); - - // @@ BUILD2 As of cl 19.29.30136 (VS 2019 16.11.5) v.o2.o1 points to - // the address of o1 member of the object being returned by - // query_value() which v is a copy of, and thus the - // original assertion fails. Note that changing `view2 v` to - // `const view2& v` doesn't help. - // - //assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); - assert (v.o1.n == 123 && v.o2.s == "abc"); - t.commit (); - } - - object1 o1b (2, 234); - - { - transaction t (db->begin ()); - db->persist (o1b); - t.commit (); - } - - { - typedef odb::query query; - - transaction t (db->begin ()); - session s; - view2a v (db->query_value (query::object1::id == 2)); - assert (v.o1.n == 234 && v.o2_null); - t.commit (); - } - - shared_ptr o3 (new object3 (1, 123)); - - { - transaction t (db->begin ()); - db->persist (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - { - view3 v (db->query_value ()); - assert (v.o3_p == &v.o3 && v.o3.n == 123); // Load into value. - } - session s; // Load into cache. - shared_ptr o3a (db->load (o3->id)); - { - view3 v (db->query_value ()); - assert (v.o3_p == o3a.get ()); // Load from cache. - } - t.commit (); - } - } - - // Test NULL object pointers. - // - { - using namespace test5; - - shared_ptr o1a (new object1 (123)); - shared_ptr o1b (new object1 (234)); - shared_ptr o2 (new object2 ("abc", o1a)); - - { - transaction t (db->begin ()); - db->persist (o1a); - db->persist (o1b); - db->persist (o2); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - session s; - result r (db->query ("ORDER BY" + query::object1::id)); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - { - const view1& v (*i); - assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); - } - assert (++i != r.end ()); - { - const view1& v (*i); - assert (v.o1->n == 234 && !v.o2); - } - assert (++i == r.end ()); - t.commit (); - } - - shared_ptr o3a (new object3 (make_pair (1, 1), 123)); - shared_ptr o3b (new object3 (make_pair (2, 2), 234)); - shared_ptr o4 (new object4 ("abc", o3a)); - - { - transaction t (db->begin ()); - db->persist (o3a); - db->persist (o3b); - db->persist (o4); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - session s; - result r (db->query ("ORDER BY" + query::object3::n)); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - { - const view2& v (*i); - assert (v.o3->n == 123 && v.o4->s == "abc" && v.o4->o3 == v.o3); - } - assert (++i != r.end ()); - { - const view2& v (*i); - assert (v.o3->n == 234 && !v.o4); - } - assert (++i == r.end ()); - t.commit (); - } - } - - // Test interaction with sections. - // - { - using namespace test6; - - shared_ptr o1 (new object1 (123)); - shared_ptr o2 (new object2 ("abc", o1)); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - view1 v (db->query_value ()); - - assert (v.o1->n == 123 && v.o2->s == "abc" && - !v.o2->r.loaded () && !v.o2->o1); - - db->load (*v.o2, v.o2->r); - assert (v.o2->r.loaded () && v.o2->o1 && v.o2->o1->n == 123); - - t.commit (); - } - } - - // Test explicit conversion to smart pointer member. - // - { - using namespace test7; - - object1 o1 (123); - object2 o2 ("abc", &o1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - session s; - view1 v (db->query_value ()); - assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); - t.commit (); - } - } - - // Test loading objects without id. - // - { - using namespace test8; - - object1 o1 (123); - object2 o2 ("abc", &o1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - session s; - view1 v (db->query_value ()); - assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); - t.commit (); - } - } - - // Test loading polymorphic objects. - // - { - using namespace test9; - - root r (1); - base b (2, "a"); - derived d (3, "b", true); - - { - transaction t (db->begin ()); - db->persist (r); - db->persist (b); - db->persist (d); - t.commit (); - } - - { - transaction t (db->begin ()); - - // Load via root. - // - { - view1r r (db->query_value (query::n == 1)); - auto& o (*r.o); - assert (r.n == 1 && r.o->n == 1 && typeid (o) == typeid (root)); - } - - { - view1r r (db->query_value (query::n == 2)); - auto& o (*r.o); - assert (r.n == 2 && r.o->n == 2 && typeid (o) == typeid (base)); - base& b (dynamic_cast (*r.o)); - assert (b.s == "a"); - } - - { - view1r r (db->query_value (query::n == 3)); - auto& o (*r.o); - assert (r.n == 3 && r.o->n == 3 && typeid (o) == typeid (derived)); - derived& d (dynamic_cast (o)); - assert (d.s == "b" && d.b); - } - - // Load via base. - // - { - view1b r (db->query_value (query::n == 2)); - assert (r.s == "a" && r.n == 2 && r.o->n == 2 && b.s == "a"); - } - - { - view1b r (db->query_value (query::n == 3)); - auto& o (*r.o); - assert (r.s == "b" && r.n == 3 && r.o->n == 3 && - typeid (o) == typeid (derived)); - derived& d (dynamic_cast (o)); - assert (d.s == "b" && d.b); - } - - // Load via derived. - // - { - view1d r (db->query_value ()); - assert (r.s == "b" && r.n == 3 && - r.o->n == 3 && r.o->s == "b" && r.o->b); - } - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx deleted file mode 100644 index 0de9483..0000000 --- a/common/view/olv/test1.hxx +++ /dev/null @@ -1,116 +0,0 @@ -// file : common/view/olv/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#include -#include // unique_ptr -#include // std::move - -#include - -// Test basic object loading functionality. -// -#pragma db namespace table("t1_") pointer(std::unique_ptr) -namespace test1 -{ - #pragma db object - struct object1 - { - object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 (int id_ = 0, const char* s_ = ""): id (id_), s (s_) {} - - #pragma db id - int id; - - std::string s; - }; - - #pragma db view object(object1) object(object2: object1::id == object2::id) - struct view1 - { - // VC12 workaround (no default move constructor generation). - // - view1 () {} - view1 (view1&& x): o2 (std::move (x.o2)) {} - - std::unique_ptr o2; - }; - - #pragma db view object(object1) object(object2: object1::id == object2::id) - struct view2 - { - // VC12 workaround (no default move constructor generation). - // - view2 () {} - view2 (view2&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} - - std::unique_ptr o2; - std::unique_ptr o1; - }; - - #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) - struct view3 - { - // VC12 workaround (no default move constructor generation). - // - view3 () {} - view3 (view3&& x): o1 (std::move (x.o1)), o2 (std::move (x.o2)) {} - - std::unique_ptr o1; - std::unique_ptr o2; - }; - - #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) - struct view4 - { - // VC12 workaround (no default move constructor generation). - // - view4 () {} - view4 (view4&& x): s (std::move (x.s)), - o2 (std::move (x.o2)), - id (x.id), - o1 (std::move (x.o1)), - n (x.n) {} - - std::string s; - std::unique_ptr o2; - - #pragma db column(o1::id) - int id; - - std::unique_ptr o1; - int n; - }; - - #pragma db view \ - object(object1) \ - object(object2: object1::id == object2::id) \ - object(object1 = o1b: object1::id == o1b::n) - struct view5 - { - // VC12 workaround (no default move constructor generation). - // - view5 () {} - view5 (view5&& x): o1a (std::move (x.o1a)), - o2 (std::move (x.o2)), - o1b (std::move (x.o1b)) {} - - std::unique_ptr o1a; - std::unique_ptr o2; - std::unique_ptr o1b; - }; -} - -#endif // TEST1_HXX diff --git a/common/view/olv/test2.hxx b/common/view/olv/test2.hxx deleted file mode 100644 index a769daa..0000000 --- a/common/view/olv/test2.hxx +++ /dev/null @@ -1,122 +0,0 @@ -// file : common/view/olv/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#include -#include -#include // shared_ptr - -#include - -// Test loading of object pointers inside objects. -// -#pragma db namespace table("t2_") pointer(std::shared_ptr) session -namespace test2 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o2; - }; - - #pragma db view object(object1) object(object2) - struct view2 - { - shared_ptr o2; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object3 - { - object3 () {} - object3 (shared_ptr o2_): o2 (o2_) {} - - #pragma db id auto - int id; - - shared_ptr o2; - }; - - #pragma db view object(object1) object(object2) object(object3) - struct view3 - { - shared_ptr o3; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object4 - { - #pragma db id auto - int id; - - std::vector> o2; - }; - - #pragma db view object(object4) - struct view4 - { - shared_ptr o4; - }; - - #pragma db view object(object4) object (object2) object(object1) - struct view5 - { - shared_ptr o4; // "Unfortunate" order. - shared_ptr o1; - }; - - #pragma db object - struct object5 - { - object5 () {} - object5 (shared_ptr o1_, shared_ptr o2_) - : o1 (o1_), o2 (o2_) {} - - #pragma db id auto - int id; - - shared_ptr o1; - shared_ptr o2; - }; - - #pragma db view object(object5) object (object2) \ - object(object1 = o1a: object2::o1) \ - object(object1 = o1b: object5::o1) - struct view6 - { - shared_ptr o1a; - shared_ptr o1b; - }; -} - -#endif // TEST2_HXX diff --git a/common/view/olv/test3.hxx b/common/view/olv/test3.hxx deleted file mode 100644 index 8cf4344..0000000 --- a/common/view/olv/test3.hxx +++ /dev/null @@ -1,106 +0,0 @@ -// file : common/view/olv/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#include -#include -#include // shared_ptr - -#include -#include - -// Test JOINs for pointed-to objects, existing and automatically added. -// -#pragma db namespace table("t3_") pointer(std::shared_ptr) session -namespace test3 -{ - using std::shared_ptr; - - struct object2; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - - #pragma db inverse(o1) - odb::lazy_weak_ptr o2; - }; - - #pragma db object - struct object2 - { - object2 (const char* s_ = ""): s (s_) {} - - #pragma db id auto - int id; - - std::string s; - - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1a // Existing JOIN. - { - shared_ptr o1; - }; - - #pragma db view object(object1) - struct view1b // Automatic JOIN. - { - shared_ptr o1; - }; - - // Container case. - // - struct object4; - - #pragma db object - struct object3 - { - object3 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - - #pragma db inverse(o3) - odb::lazy_weak_ptr o4; - }; - - #pragma db object - struct object4 - { - object4 (const char* s_ = ""): s (s_) {} - - #pragma db id auto - int id; - - std::string s; - - std::vector> o3; - }; - - #pragma db view object(object3) object(object4 = o4) - struct view2a // Existing JOIN. - { - shared_ptr o3; - }; - - #pragma db view object(object3) - struct view2b // Automatic JOIN. - { - shared_ptr o3; - }; -} - -#endif // TEST3_HXX diff --git a/common/view/olv/test4.hxx b/common/view/olv/test4.hxx deleted file mode 100644 index f2af5fd..0000000 --- a/common/view/olv/test4.hxx +++ /dev/null @@ -1,151 +0,0 @@ -// file : common/view/olv/test4.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST4_HXX -#define TEST4_HXX - -#include -#include // shared_ptr - -#include - -// Test by-value load. -// -#pragma db namespace table("t4_") session -namespace test4 -{ - #pragma db object - struct object1 - { - object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 (int id_ = 0, const char* s_ = "", object1* o1_ = 0) - : id (id_), s (s_), o1 (o1_) {} - - #pragma db id - int id; - - std::string s; - object1* o1; // Shallow copy. - }; - - typedef object1* object1_ptr; - typedef object2* object2_ptr; - - #pragma db view object(object1) - struct view1 - { - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - #pragma db transient - object1 o1; - }; - - #pragma db view object(object1) transient - struct view1a - { - view1a (): o1_null (true) {} - - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) \ - set(this.o1_null = !(?)) - - object1 o1; - bool o1_null; - }; - - #pragma db view object(object1) - struct view1b - { - view1b (): o1_p (0) {} - - #pragma db transient - object1 o1; - - #pragma db get(&this.o1) set(o1_p = (?)) - object1* o1_p; - }; - - #pragma db view object(object1) - struct view1c - { - view1c (object1& o1): o1_p (&o1) {} - - object1* o1_p; - }; - - #pragma db view object(object1) object(object2) transient - struct view2 - { - #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) set() - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - object1 o1; - object2 o2; - }; - - #pragma db view object(object1) object(object2) transient - struct view2a - { - #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) \ - set(o2_null = !(?)) - #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() - - object1 o1; - object2 o2; - bool o2_null; - }; - - // Test loading into raw pointer with non-raw object pointer. - // - using std::shared_ptr; - - #pragma db object pointer(shared_ptr) - struct object3 - { - object3 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} - - #pragma db id - int id; - - int n; - }; - - #pragma db view object(object3) - struct view3 - { - // This view implements the following slightly twisted logic: if the - // object is already in the cache, then set o3_p to that. Otherwise, - // load it into the by-value instance. We can also check whether o3_p - // points to o3 to distinguish between the two outcomes. - // - - // Since we may be getting the pointer as both smart and raw, we - // need to create a bit of support code to use in the modifier - // expression. - // - void set_o3 (object3* p) {o3_p = p;} // &o3 or NULL. - void set_o3 (shared_ptr p) {o3_p = p.get ();} // From cache. - - #pragma db get(&this.o3) set(set_o3(?)) - object3* o3_p; - - #pragma db transient - object3 o3; - - // Return-by-value support (query_value()). - // - view3 (): o3_p (0) {} - view3 (const view3& x): o3_p (x.o3_p == &x.o3 ? &o3 : x.o3_p), o3 (x.o3) {} - }; -} - -#endif // TEST4_HXX diff --git a/common/view/olv/test5.hxx b/common/view/olv/test5.hxx deleted file mode 100644 index e3a671b..0000000 --- a/common/view/olv/test5.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// file : common/view/olv/test5.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST5_HXX -#define TEST5_HXX - -#include -#include // shared_ptr -#include // pair - -#include - -// Test NULL object pointers. -// -#pragma db namespace table("t5_") pointer(std::shared_ptr) session -namespace test5 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o1; - shared_ptr o2; - }; - - typedef std::pair comp_id; - #pragma db value(comp_id) - - #pragma db object - struct object3 - { - object3 (comp_id id_ = comp_id (), int n_ = 0): id (id_), n (n_) {} - - #pragma db id - comp_id id; - - int n; - }; - - #pragma db object - struct object4 - { - object4 () {} - object4 (const char* s_, shared_ptr o3_): s (s_), o3 (o3_) {} - - #pragma db id auto - int id; - - std::string s; - shared_ptr o3; - }; - - #pragma db view object(object3) object(object4) - struct view2 - { - shared_ptr o4; - shared_ptr o3; - }; -} - -#endif // TEST5_HXX diff --git a/common/view/olv/test6.hxx b/common/view/olv/test6.hxx deleted file mode 100644 index 5336fa6..0000000 --- a/common/view/olv/test6.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : common/view/olv/test6.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST6_HXX -#define TEST6_HXX - -#include -#include // shared_ptr - -#include -#include - -// Test interaction with sections. -// -#pragma db namespace table("t6_") pointer(std::shared_ptr) -namespace test6 -{ - using std::shared_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - - #pragma db load(lazy) - odb::section r; - - #pragma db section(r) - shared_ptr o1; - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - shared_ptr o1; - shared_ptr o2; - }; -} - -#endif // TEST6_HXX diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx deleted file mode 100644 index dbdc663..0000000 --- a/common/view/olv/test7.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : common/view/olv/test7.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST7_HXX -#define TEST7_HXX - -#include -#include // unique_ptr -#include // std::move - -#include - -// Test explicit conversion to smart pointer member. -// -#pragma db namespace table("t7_") pointer(*) session -namespace test7 -{ - using std::unique_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct object2 - { - object2 () {} - object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} - - #pragma db id auto - int id; - - std::string s; - object1* o1; // Shallow. - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - // VC12 workaround (no default move constructor generation). - // - view1 () {} - view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} - - unique_ptr o2; - unique_ptr o1; - }; -} - -#endif // TEST7_HXX diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx deleted file mode 100644 index 607d222..0000000 --- a/common/view/olv/test8.hxx +++ /dev/null @@ -1,54 +0,0 @@ -// file : common/view/olv/test8.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST8_HXX -#define TEST8_HXX - -#include -#include // unique_ptr -#include // std::move - -#include - -// Test loading objects without id. -// -#pragma db namespace table("t8_") pointer(*) session -namespace test8 -{ - using std::unique_ptr; - - #pragma db object - struct object1 - { - object1 (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object no_id - struct object2 - { - object2 () {} - object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} - - std::string s; - object1* o1; // Shallow. - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - // VC12 workaround (no default move constructor generation). - // - view1 () {} - view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} - - unique_ptr o2; - unique_ptr o1; - }; -} - -#endif // TEST8_HXX diff --git a/common/view/olv/test9.hxx b/common/view/olv/test9.hxx deleted file mode 100644 index b109de3..0000000 --- a/common/view/olv/test9.hxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : common/view/olv/test9.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST9_HXX -#define TEST9_HXX - -#include -#include // shared_ptr - -#include - -// Test loading polymorphic objects. -// -#pragma db namespace table("t9_") session -namespace test9 -{ - using std::shared_ptr; - - #pragma db object polymorphic pointer(shared_ptr) - struct root - { - virtual ~root () {} - root (int n_ = 0): n (n_) {} - - #pragma db id auto - int id; - - int n; - }; - - #pragma db object - struct base: root - { - base (int n_ = 0, const char* s_ = ""): root (n_), s (s_) {} - - std::string s; - }; - - #pragma db object - struct derived: base - { - derived (int n_ = 0, const char* s_ = "", bool b_ = false) - : base (n_, s_), b (b_) {} - - bool b; - }; - - // Load via root. - // - #pragma db view object(root) - struct view1r - { - shared_ptr o; - int n; - }; - - // Load via base. - // - #pragma db view object(base) - struct view1b - { - std::string s; - shared_ptr o; - int n; - }; - - // Load via derived. - // - #pragma db view object(derived) - struct view1d - { - std::string s; - shared_ptr o; - int n; - }; -} - -#endif // TEST9_HXX diff --git a/common/view/olv/testscript b/common/view/olv/testscript deleted file mode 100644 index 160426d..0000000 --- a/common/view/olv/testscript +++ /dev/null @@ -1,39 +0,0 @@ -# file : common/view/olv/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../../mysql-schema.testscript - - for s: $schemas - cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd - end; - - $* ($multi ? 'mysql' : ) $mysql_options -} - -: sqlite -: -if $sqlite -{ - .include ../../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../../pgsql-schema.testscript - - for s: $schemas - $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql - end; - - $* ($multi ? 'pgsql' : ) $pgsql_options -} diff --git a/common/virtual/buildfile b/common/virtual/buildfile deleted file mode 100644 index 96d062e..0000000 --- a/common/virtual/buildfile +++ /dev/null @@ -1,42 +0,0 @@ -# file : common/virtual/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix virtual_ \ - --generate-schema \ - --generate-query \ - --generate-session - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/virtual/driver.cxx b/common/virtual/driver.cxx deleted file mode 100644 index f96f543..0000000 --- a/common/virtual/driver.cxx +++ /dev/null @@ -1,154 +0,0 @@ -// file : common/virtual/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test virtual data members. -// - -#include // std::auto_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test basic virtual data member functionality. - // - { - using namespace test1; - - object o; - o.i (123); - o.c1.i = 123; - o.c1.s = "abc"; - o.v1.push_back ("abc"); - o.v1.push_back ("abd"); - o.v1.push_back ("abe"); - o.p1 = new object; - - { - transaction t (db->begin ()); - db->persist (*o.p1); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (o.id1.v)); - t.commit (); - - assert (o == *p); - } - } - - // Test pragma resolution to virtual data member. - // - { - using namespace test2; - - object1 o1 (1); - o1.o2 = new object2 (1); - o1.o2->o1 = &o1; - - { - transaction t (db->begin ()); - db->persist (*o1.o2); - o1.n1 = o1.o2->id; - db->persist (o1); - t.commit (); - } - - { - session s; - transaction t (db->begin ()); - unique_ptr p (db->load (o1.id)); - t.commit (); - - assert (p->o2->id == o1.o2->id); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::object2::id == o1.o2->id)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->i == o1.n1); - assert (++i == r.end ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::o2::id == o1.o2->id)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->i == o1.n1); - assert (++i == r.end ()); - t.commit (); - } - - { - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ()); - result::iterator i (r.begin ()); - assert (i != r.end () && i->i == o1.n1); - assert (++i == r.end ()); - t.commit (); - } - } - - // Use virtual data members to implement multi-member composite object id. - // - { - using namespace test3; - - person o; - o.first_ = "John"; - o.last_ = "Doe"; - - name id; - { - transaction t (db->begin ()); - id = db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p (db->load (id)); - t.commit (); - - assert (o.first_ == p->first_ && o.last_ == p->last_); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/virtual/test.hxx b/common/virtual/test.hxx deleted file mode 100644 index 2654d09..0000000 --- a/common/virtual/test.hxx +++ /dev/null @@ -1,171 +0,0 @@ -// file : common/virtual/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Test basic virtual data member functionality. -// -#pragma db namespace table("t1_") -namespace test1 -{ - #pragma db value - struct comp - { - int i; - - #pragma db transient - std::string s; - #pragma db member(s_) virtual(std::string) access(s) - - bool operator== (const comp& v) const - { - return i == v.i && s == v.s; - } - }; - - #pragma db object transient - struct object - { - object (): p1 (0) {} - ~object () {delete p1;} - - struct {unsigned long v;} id1; - - #pragma db id - #pragma db member(id) get(id1.v) virtual(unsigned long) set(id1.v) - #pragma db member(id) auto - - int i () const {return i1;} - void i (int i) {i1 = i;} - int i1; - - comp c1; - #pragma db member(c) virtual(comp) access(c1) - - typedef std::vector strings; - strings v1; - #pragma db member(v) virtual(strings) access(v1) - - typedef object* object_ptr; - object_ptr p1; - #pragma db member(p) virtual(object_ptr) access(p1) - - bool operator== (const object& o) const - { - return id1.v == o.id1.v && - i1 == o.i1 && - c1 == o.c1 && - v1 == o.v1 && - (p1 != 0 ? o.p1 != 0 && *p1 == *o.p1 : o.p1 == 0); - } - }; - - #pragma db member(object::i) virtual(int) -} - -#pragma db member(test1::object::id) column("oid") - -// Test pragma resolution to virtual data member. -// -#pragma db namespace table("t2_") -namespace test2 -{ - struct object1; - struct object2; - - typedef object1* object1_ptr; - typedef object2* object2_ptr; - - #pragma db object - struct object2 - { - object2 (unsigned long i = 0): id (i) {} - - #pragma db id - unsigned long id; - - #pragma db inverse(o) - object1_ptr o1; - }; - - #pragma db object - struct object1 - { - object1 (unsigned long i = 0): id (i), o2 (0) {} - ~object1 () {delete o2;} - - #pragma db id - unsigned long id; - - #pragma db transient - object2_ptr o2; - #pragma db member(o) virtual(object2_ptr) access(o2) - - #pragma db transient - unsigned long n1; - #pragma db member(n) virtual(unsigned long) access(n1) - #pragma db index member(n) - }; - - #pragma db view object(object1) object(object2) - struct view1 - { - #pragma db column(object1::n) - unsigned long i; - }; - - #pragma db view object(object1 = o1) object(object2 = o2: o1::n == o2::id) - struct view2 - { - #pragma db column(o1::n) - unsigned long i; - }; - - #pragma db view object(object1: object1::n != 0) - struct view3 - { - #pragma db column(test2::object1::n) - unsigned long i; - }; -} - -// Use virtual data members to implement multi-member composite object id. -// -#pragma db namespace table("t3_") -namespace test3 -{ - #pragma db value - struct name - { - name () {} - name (const std::string& f, const std::string& l) - : first (f), last(l) {} - - std::string first; - std::string last; - - bool operator< (const name& x) const - { - return first < x.first || (first == x.first && last < x.last); - } - }; - - #pragma db object transient - struct person - { - std::string first_; - std::string last_; - - #pragma db member(name) virtual(name) id \ - get(::test3::name (this.first_, this.last_)) \ - set(this.first_ = (?).first; this.last_ = (?).last) - }; -} - -#endif // TEST_HXX diff --git a/common/virtual/testscript b/common/virtual/testscript deleted file mode 100644 index 769c7f9..0000000 --- a/common/virtual/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/virtual/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/common/wrapper/buildfile b/common/wrapper/buildfile deleted file mode 100644 index 57f43f2..0000000 --- a/common/wrapper/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : common/wrapper/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import libodb = libodb%lib{odb} - -libs = - -for db: $databases - import libs += libodb-$db%lib{odb-$db} - -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -for db: $databases -{ - exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi - <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} -} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix wrapper_ \ - --generate-schema - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx deleted file mode 100644 index 9c352fc..0000000 --- a/common/wrapper/driver.cxx +++ /dev/null @@ -1,216 +0,0 @@ -// file : common/wrapper/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test wrapper machinery. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_database (argc, argv)); - - // Test 1: simple values. - // - { - using namespace test1; - - unsigned long id1, id2; - { - object1 o1; - object2 o2; - - o1.num.reset (new int (123)); - o1.nstrs.push_back (nullable_string ()); - o1.nstrs.push_back (nullable_string ("123")); - - o2.sstrs.push_back (str_sptr ()); - o2.sstrs.push_back (str_sptr (new string ("123"))); - - transaction t (db->begin ()); - id1 = db->persist (o1); - id2 = db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (id1)); - unique_ptr o2 (db->load (id2)); - t.commit (); - - assert (*o1->num == 123); - assert (o1->str.get () == 0); - assert (o1->nstr.null ()); - assert (o1->nstrs[0].null ()); - assert (o1->nstrs[1].get () == "123"); - - assert (!o2->sstr); - assert (!o2->sstrs[0]); - assert (*o2->sstrs[1] == "123"); - } - } - - // - // Composite values. - // - unsigned long id; - { - comp_object co; - - co.c1.reset (new comp1 ("123", 123)); - co.vc1.push_back (comp1 ("1", 1)); - co.vc1.push_back (comp1 ("2", 2)); - co.vc1.push_back (comp1 ("3", 3)); - - co.c2.reset (new comp2 ("123", 123)); - co.c2->strs.push_back ("1"); - co.c2->strs.push_back ("2"); - co.c2->strs.push_back ("3"); - - { - transaction t (db->begin ()); - id = db->persist (co); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (id)); - t.commit (); - - assert (*o->c1 == *co.c1); - assert (o->vc1 == co.vc1); - assert (*o->c2 == *co.c2); - } - } - - // - // Containers. - // - { - cont_object co; - - co.nums.reset (new vector); - co.nums->push_back (1); - co.nums->push_back (2); - co.nums->push_back (3); - - co.c.num = 123; - co.c.strs.reset (new vector); - co.c.strs->push_back ("1"); - co.c.strs->push_back ("2"); - co.c.strs->push_back ("3"); - - { - transaction t (db->begin ()); - id = db->persist (co); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (id)); - t.commit (); - - assert (*o->nums == *co.nums); - assert (o->c == co.c); - } - } - - // Test 5: composite NULL values. - // - { - using namespace test5; - - object o1, o2; - - o1.v.push_back (nullable ()); - - o2.p.reset (new comp (1, "a")); - o2.n = comp (2, "b"); - o2.v.push_back (comp (3, "c")); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p1->p.get () == 0); - assert (!p1->n); - assert (!p1->v[0]); - - assert (p2->p.get () != 0 && *p2->p == *o2.p); - assert (p2->n && *p2->n == *o2.n); - assert (p2->v[0] && *p2->v[0] == *o2.v[0]); - } - - // Update. - // - { - o1.p.reset (new comp (1, "a")); - o1.n = comp (2, "b"); - o1.v[0] = comp (3, "c"); - - o2.p.reset (); - o2.n.reset (); - o2.v[0].reset (); - - transaction t (db->begin ()); - db->update (o1); - db->update (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (o1.id)); - unique_ptr p2 (db->load (o2.id)); - t.commit (); - - assert (p1->p.get () != 0 && *p1->p == *o1.p); - assert (p1->n && *p1->n == *o1.n); - assert (p1->v[0] && *p1->v[0] == *o1.v[0]); - - assert (p2->p.get () == 0); - assert (!p2->n); - assert (!p2->v[0]); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx deleted file mode 100644 index 3ae4151..0000000 --- a/common/wrapper/test.hxx +++ /dev/null @@ -1,214 +0,0 @@ -// file : common/wrapper/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include // std::unique_ptr -#include - -#include -#include - -using odb::nullable; - -// Test 1: simple values. -// -#pragma db namespace table("t1_") -namespace test1 -{ - typedef nullable nullable_string; - - typedef std::unique_ptr num_uptr; - typedef std::unique_ptr str_uptr; - typedef std::shared_ptr str_sptr; - - #pragma db object table("obj1") - struct object1 - { - #pragma db id auto - unsigned long id_; - - num_uptr num; - - #pragma db null - str_uptr str; - - nullable_string nstr; - std::vector nstrs; - }; - - #pragma db object - struct object2 - { - #pragma db id auto - unsigned long id_; - - #pragma db null - str_sptr sstr; - - #pragma db value_null - std::vector sstrs; - }; -} - -// -// Composite values. -// - -#pragma db value -struct comp1 -{ - comp1 () {} - comp1 (const std::string& s, int n): str (s), num (n) {} - - std::string str; - int num; -}; - -inline bool -operator== (const comp1& x, const comp1& y) -{ - return x.str == y.str && x.num == y.num; -} - - -#pragma db value -struct comp2 -{ - comp2 () {} - comp2 (const std::string& s, int n): str (s), num (n) {} - - std::string str; - int num; - - std::vector strs; -}; - -inline bool -operator== (const comp2& x, const comp2& y) -{ - return x.str == y.str && x.num == y.num && x.strs == y.strs; -} - -struct comp3; - -typedef std::unique_ptr comp1_uptr; -typedef std::unique_ptr comp2_uptr; -typedef std::unique_ptr comp3_uptr; - -#pragma db object -struct comp_object -{ - #pragma db id auto - unsigned long id_; - - comp1_uptr c1; // Wrapped comp value. - std::vector > vc1; // Container of wrapped comp values. - comp2_uptr c2; // Container inside wrapped comp value. -}; - -// This one is just a compilation test to cover more convolute cases. -// -#pragma db value -struct comp3: comp2 -{ - comp1_uptr c1; - std::vector > vc1; -}; - -#pragma db object -struct comp_object2 -{ - #pragma db id auto - unsigned long id_; - - comp3_uptr c3; -}; - -// -// Containers. -// - -typedef std::unique_ptr> nums_uptr; -typedef std::unique_ptr> strs_uptr; - -#pragma db value -struct cont_comp -{ - int num; - strs_uptr strs; -}; - -inline bool -operator== (const cont_comp& x, const cont_comp& y) -{ - return x.num == y.num && *x.strs == *y.strs; -} - -#pragma db object -struct cont_object -{ - #pragma db id auto - unsigned long id_; - - nums_uptr nums; // Wrapped container. - cont_comp c; // Wrapped container in comp value. -}; - -// Test composite NULL values. -// -#pragma db namespace table("t5_") -namespace test5 -{ - #pragma db value - struct base - { - base () {} - base (int n): num (n) {} - - int num = 0; - }; - - inline bool - operator== (const base& x, const base& y) - { - return x.num == y.num; - } - - #pragma db value - struct comp: base - { - comp () {} - comp (int n, const std::string s): base (n), str (s), extra (n + 1) {} - - std::string str; - base extra; - - odb::nullable always_null; - }; - - inline bool - operator== (const comp& x, const comp& y) - { - return static_cast (x) == y && - x.str == y.str && x.extra == y.extra; - } - - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - #pragma db null - std::unique_ptr p; - - odb::nullable n; - - std::vector< odb::nullable > v; - }; -} - -#endif // TEST_HXX diff --git a/common/wrapper/testscript b/common/wrapper/testscript deleted file mode 100644 index 6630813..0000000 --- a/common/wrapper/testscript +++ /dev/null @@ -1,33 +0,0 @@ -# file : common/wrapper/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript - -: mysql -: -if $mysql -{ - .include ../../mysql.testscript - - $create_schema; - $* -} - -: sqlite -: -if $sqlite -{ - .include ../../sqlite.testscript - - $* -} - -: pgsql -: -if $pgsql -{ - .include ../../pgsql.testscript - - $create_schema; - $* -} diff --git a/database-options.testscript b/database-options.testscript deleted file mode 100644 index 2c0ee82..0000000 --- a/database-options.testscript +++ /dev/null @@ -1,75 +0,0 @@ -# file : database-options.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# For the enabled databases create the test driver option lists (*_options) -# for subsequent use in the tests. Also create the database-specific client -# option lists (*_client_options) and command lines (*_client_cmd) which can -# be used as a base for the data manipulation commands. -# -+if $mysql - mysql_options = --user $config.odb_tests.pgsql.user \ - --database $config.odb_tests.pgsql.database - - mysql_client_options = --user $config.odb_tests.pgsql.user \ - --database $config.odb_tests.pgsql.database - - if $defined(config.odb_tests.mysql.passwd) - mysql_options += --password $config.odb_tests.mysql.passwd - mysql_client_options += --password=$config.odb_tests.mysql.passwd - end - - if $defined(config.odb_tests.mysql.host) - mysql_options += --host $config.odb_tests.mysql.host - mysql_client_options += --host $config.odb_tests.mysql.host - end - - if $defined(config.odb_tests.mysql.port) - mysql_options += --port $config.odb_tests.mysql.port - mysql_client_options += --port $config.odb_tests.mysql.port - end - - if $defined(config.odb_tests.mysql.socket) - mysql_options += --socket $config.odb_tests.mysql.socket - mysql_client_options += --socket $config.odb_tests.mysql.socket - end - - mysql_client_cmd = $path($mysql_client) $mysql_client_options -end - -+if $sqlite - sqlite_options = --database odb-test.db - - # Note that we currently don't manipulate the data using the sqlite3 - # utility. Thus, we don't create the sqlite client option list and command - # line. - # -end - -+if $pgsql - pgsql_options = --user $config.odb_tests.pgsql.user \ - --database $config.odb_tests.pgsql.database - - pgsql_client_options = --quiet \ - --set ON_ERROR_STOP=1 \ - --username $config.odb_tests.pgsql.user \ - --dbname $config.odb_tests.pgsql.database - - if $defined(config.odb_tests.pgsql.host) - pgsql_options += --host $config.odb_tests.pgsql.host - pgsql_client_options += --host $config.odb_tests.pgsql.host - end - - if $defined(config.odb_tests.pgsql.port) - pgsql_options += --port $config.odb_tests.pgsql.port - pgsql_client_options += --port $config.odb_tests.pgsql.port - end - - pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options - - export PGOPTIONS=--client-min-messages=warning -end - -# Set the default schema file name, which can be overridden by the subsequent -# tests in their own scopes. -# -schema = test diff --git a/evolution/add-column/driver.cxx b/evolution/add-column/driver.cxx deleted file mode 100644 index d4eb396..0000000 --- a/evolution/add-column/driver.cxx +++ /dev/null @@ -1,125 +0,0 @@ -// file : evolution/add-column/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test adding a new column. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o (1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (!p->str); - assert (p->num == 999); - - // Migration. - // - p->str = "abc"; - p->num = 123; - db->update (*p); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (p->str && *p->str == "abc"); - assert (p->num == 123); - - t.commit (); - } - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/add-column/model.hxx b/evolution/add-column/model.hxx deleted file mode 100644 index 6ac9160..0000000 --- a/evolution/add-column/model.hxx +++ /dev/null @@ -1,38 +0,0 @@ -// file : evolution/add-column/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 3 - odb::nullable str; - - #pragma db default(999) - unsigned long num; -#endif - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-column/test1.hxx b/evolution/add-column/test1.hxx deleted file mode 100644 index b0d7fda..0000000 --- a/evolution/add-column/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/add-column/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/add-column/test2.hxx b/evolution/add-column/test2.hxx deleted file mode 100644 index b62530a..0000000 --- a/evolution/add-column/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-column/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/add-column/test3.hxx b/evolution/add-column/test3.hxx deleted file mode 100644 index b24dba1..0000000 --- a/evolution/add-column/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-column/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/add-foreign-key/driver.cxx b/evolution/add-foreign-key/driver.cxx deleted file mode 100644 index 177b615..0000000 --- a/evolution/add-foreign-key/driver.cxx +++ /dev/null @@ -1,173 +0,0 @@ -// file : evolution/add-foreign-key/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test adding a foreign key. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o (1); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - -#ifdef DATABASE_SQLITE - // In SQLite we can only add foreign keys inline in the column - // definition. - // - db->connection ()->execute ("PRAGMA foreign_keys=OFF"); -#endif - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Both pointers are now NULL. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (p->o1 == 0 && p->o2 == 0); - - // Migration. The foreign key constraint is not yet there. - // - p->o1 = new object1 (1); - p->o2 = new object2 (1); - db->update (*p); - - t.commit (); - } - - // Migration. Add the missing objects. - // - object1 o1 (1); - object2 o2 (1); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->o1->id_ == 1); - assert (p->o2->id_ == 1); - t.commit (); - } - - // Now the foreign key constraint is there. - // - try - { - object o (2); - o.o1 = new object1 (2); - o.o2 = new object2 (2); - - transaction t (db->begin ()); - db->persist (o); - assert (false); - } - catch (const odb::exception& ) {} - - // As well as the NOT NULL. - // -#ifndef DATABASE_SQLITE - try - { - object o (3); - o.o2 = 0; - - transaction t (db->begin ()); - db->persist (o); - assert (false); - } - catch (const odb::exception& ) {} -#endif - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/add-foreign-key/model.hxx b/evolution/add-foreign-key/model.hxx deleted file mode 100644 index f5fe26d..0000000 --- a/evolution/add-foreign-key/model.hxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : evolution/add-foreign-key/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include - -#include // DATABASE_XXX - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ -#if MODEL_VERSION == 3 - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; - - #pragma db object - struct object2 - { - object2 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; -#endif - - #pragma db object - struct object - { - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 2 - object (unsigned long id = 0): id_ (id) {} -#else - object1* o1; - - // There is no support for changing a column to NOT NULL in SQLite. - // -#ifndef ODB_DATABASE_SQLITE - #pragma db not_null -#endif - object2* o2; - - object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} - ~object () {delete o1; delete o2;} -#endif - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-foreign-key/test1.hxx b/evolution/add-foreign-key/test1.hxx deleted file mode 100644 index 05c78c3..0000000 --- a/evolution/add-foreign-key/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/add-foreign-key/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/add-foreign-key/test2.hxx b/evolution/add-foreign-key/test2.hxx deleted file mode 100644 index c57d9a1..0000000 --- a/evolution/add-foreign-key/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-foreign-key/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/add-foreign-key/test3.hxx b/evolution/add-foreign-key/test3.hxx deleted file mode 100644 index c844469..0000000 --- a/evolution/add-foreign-key/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-foreign-key/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/add-index/driver.cxx b/evolution/add-index/driver.cxx deleted file mode 100644 index 689504e..0000000 --- a/evolution/add-index/driver.cxx +++ /dev/null @@ -1,165 +0,0 @@ -// file : evolution/add-index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test adding a new index. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o0 (0); - o0.num = 123; - - object o1 (1); - o1.num = 234; - - object o2 (2); - o2.num = 234; - - // Duplicates are ok. - // - { - transaction t (db->begin ()); - db->persist (o0); - db->persist (o1); - db->persist (o2); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - object o3 (3); - o3.num = 234; - - // Duplicates are still ok but we need to remove them before the - // post migration step. - // - { - transaction t (db->begin ()); - db->persist (o3); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query ( - "ORDER BY" + query::num + "," + query::id)); - - unsigned long prev (0); - for (result::iterator i (r.begin ()); i != r.end (); ++i) - { - if (i->num == prev) - db->erase (*i); - - prev = i->num; - } - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p0 (db->load (0)); - auto_ptr p1 (db->load (1)); - - assert (p0->num == 123); - assert (p1->num == 234); - - t.commit (); - } - - try - { - object o2 (2); - o2.num = 234; - - transaction t (db->begin ()); - db->persist (o2); - assert (false); - } - catch (const odb::exception& ) {} - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/add-index/model.hxx b/evolution/add-index/model.hxx deleted file mode 100644 index fec75cc..0000000 --- a/evolution/add-index/model.hxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : evolution/add-index/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 3 - #pragma db unique -#endif - unsigned long num; - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-index/test1.hxx b/evolution/add-index/test1.hxx deleted file mode 100644 index 1be2b5b..0000000 --- a/evolution/add-index/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/add-index/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/add-index/test2.hxx b/evolution/add-index/test2.hxx deleted file mode 100644 index a0faca9..0000000 --- a/evolution/add-index/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-index/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/add-index/test3.hxx b/evolution/add-index/test3.hxx deleted file mode 100644 index aab9c86..0000000 --- a/evolution/add-index/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-index/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/add-table/driver.cxx b/evolution/add-table/driver.cxx deleted file mode 100644 index 67b0f0e..0000000 --- a/evolution/add-table/driver.cxx +++ /dev/null @@ -1,140 +0,0 @@ -// file : evolution/add-table/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test adding a new table (object, container). -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - // SQLite has broken foreign keys when it comes to DDL. - // -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=OFF"); -#endif - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=ON"); -#endif - } - - object o (1); - o.str = "abc"; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - object1 o1; - o1.nums.push_back (1); - o1.nums.push_back (2); - o1.nums.push_back (3); - - { - transaction t (db->begin ()); - o1.o = db->load (1); - db->persist (o1); - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query (query::o->str == "abc")); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && - i->o->id_ == 1 && - i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); - assert (++i == e); - - t.commit (); - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/add-table/model.hxx b/evolution/add-table/model.hxx deleted file mode 100644 index 208a156..0000000 --- a/evolution/add-table/model.hxx +++ /dev/null @@ -1,48 +0,0 @@ -// file : evolution/add-table/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include -#include - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db object - struct object1 - { - object1 (): o (0) {} - ~object1 () {delete o;} - - #pragma db id auto - unsigned long id_; - - object* o; - std::vector nums; - }; -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/add-table/test1.hxx b/evolution/add-table/test1.hxx deleted file mode 100644 index adc51a1..0000000 --- a/evolution/add-table/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/add-table/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/add-table/test2.hxx b/evolution/add-table/test2.hxx deleted file mode 100644 index ca03cef..0000000 --- a/evolution/add-table/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-table/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/add-table/test3.hxx b/evolution/add-table/test3.hxx deleted file mode 100644 index 39406a2..0000000 --- a/evolution/add-table/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/add-table/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/alter-column/driver.cxx b/evolution/alter-column/driver.cxx deleted file mode 100644 index be63f05..0000000 --- a/evolution/alter-column/driver.cxx +++ /dev/null @@ -1,160 +0,0 @@ -// file : evolution/alter-column/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test altering a column. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - - // SQLite doesn't support altering of columns. - // -#ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o (1); - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // NULL is already in effect; NOT NULL is not yet. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (!p->str); - assert (p->num && *p->num == 123); - assert (!p->num1); - - // Migration. - // - p->str = "abc"; - p->num.reset (); - p->num1 = 123; - db->update (*p); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (p->str && *p->str == "abc"); - assert (!p->num); - - t.commit (); - } - - // NOT NULL is now in effect. - // - try - { - object o2 (2); - o2.num1 = 234; // str is NULL - - transaction t (db->begin ()); - db->persist (o2); - assert (false); - } - catch (const odb::exception& ) {} - - try - { - object o3 (3); - o3.str = "bcd"; // num1 is NULL - - transaction t (db->begin ()); - db->persist (o3); - assert (false); - } - catch (const odb::exception& ) {} - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } -#endif // DATABASE_SQLITE - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/alter-column/model.hxx b/evolution/alter-column/model.hxx deleted file mode 100644 index fc6661c..0000000 --- a/evolution/alter-column/model.hxx +++ /dev/null @@ -1,56 +0,0 @@ -// file : evolution/alter-column/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include -#include - -#include // DATABASE_XXX - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - // SQLite doesn't support altering of columns. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - odb::nullable str; - - unsigned long num; -#else - // Use nullable to be able to access during migration. - // - #pragma db not_null - odb::nullable str; - - odb::nullable num; - - // Test adding NOT NULL column. It should be added NULL in pre - // and then converted to NOT NULL in post. - // - #pragma db not_null - odb::nullable num1; -#endif -#endif - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/alter-column/test1.hxx b/evolution/alter-column/test1.hxx deleted file mode 100644 index 9353558..0000000 --- a/evolution/alter-column/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/alter-column/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/alter-column/test2.hxx b/evolution/alter-column/test2.hxx deleted file mode 100644 index e2dbed3..0000000 --- a/evolution/alter-column/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/alter-column/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/alter-column/test3.hxx b/evolution/alter-column/test3.hxx deleted file mode 100644 index ac08e2f..0000000 --- a/evolution/alter-column/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/alter-column/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/combined/driver.cxx b/evolution/combined/driver.cxx deleted file mode 100644 index 88453c3..0000000 --- a/evolution/combined/driver.cxx +++ /dev/null @@ -1,157 +0,0 @@ -// file : evolution/combined/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Combined schema evolution test. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o ("1"); - o.dui = 1; - o.anui = 1; - o.dnui = 1; - o.dc = 1; - o.dt.push_back (1); - o.aui = 1; - -#ifndef DATABASE_SQLITE - o.dfk = new object1 (1); - o.acn = 1; - o.acnn.reset (); - o.afk = 1; -#endif - - { - transaction t (db->begin ()); -#ifndef DATABASE_SQLITE - db->persist (o.dfk); -#endif - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load ("1")); - - assert (p->ac1 == 999); - assert (!p->ac2); - -#ifndef DATABASE_SQLITE - assert (!p->ac3); -#endif - // Migrate. - // - p->at.push_back ("abc"); - -#ifndef DATABASE_SQLITE - p->dfk = 999; - p->ac3 = 1; - p->acn.reset (); - p->acnn = 1; -#endif - db->update (*p); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p (db->load ("1")); - - // Check post-migration. - // - assert (p->at[0] == "abc"); - -#ifndef DATABASE_SQLITE - assert (p->dfk == 999); - assert (*p->ac3 == 1); - assert (!p->acn); - assert (*p->acnn == 1); -#endif - t.commit (); - } - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/combined/model.hxx b/evolution/combined/model.hxx deleted file mode 100644 index e924943..0000000 --- a/evolution/combined/model.hxx +++ /dev/null @@ -1,174 +0,0 @@ -// file : evolution/combined/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include -#include - -#include -#include - -#include // DATABASE_XXX - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; - - #pragma db object - struct object - { - #pragma db id - std::string id_; - - // - // Pre pass 1. - // - - // Drop unique index. - // -#if MODEL_VERSION == 2 - #pragma db unique -#endif - unsigned long dui; - - // Alter table drop foreign key. Not supported by SQLite. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - object1* dfk; -#else - #pragma db null - unsigned long dfk; -#endif -#endif - - // Add table. - // -#if MODEL_VERSION == 3 - std::vector at; -#endif - - // Add column. - // -#if MODEL_VERSION == 3 - #pragma db default(999) - unsigned long ac1; - - odb::nullable ac2; - - // Initially added as NULL, converted to NOT NULL. Not supported by SQLite. - // -#ifndef DATABASE_SQLITE - #pragma db not_null - odb::nullable ac3; -#endif -#endif - - // Alter column NULL. Not supported by SQLite. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - unsigned long acn; -#else - odb::nullable acn; -#endif -#endif - - // - // Pre pass 2. - // - - // Add non-unique indexes. - // -#if MODEL_VERSION == 3 - #pragma db index -#endif - unsigned long anui; - - // - // Post pass 1. - // - - // Drop non-unique indexes. - // -#if MODEL_VERSION == 2 - #pragma db index -#endif - unsigned long dnui; - - // - // Post pass 2. - // - - // Drop table. - // -#if MODEL_VERSION == 2 - std::vector dt; -#endif - - // Drop column. Logical drop (set NULL) in SQLite. - // -#if MODEL_VERSION == 2 - unsigned long dc; -#endif - - // Alter column NOT NULL. Not supported by SQLite. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 3 - #pragma db not_null -#endif - odb::nullable acnn; -#endif - - // Alter table add foreign key. Not supported by SQLite. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - #pragma db null - unsigned long afk; -#else - object1* afk; -#endif -#endif - - // Add unique index. - // -#if MODEL_VERSION == 3 - #pragma db unique -#endif - unsigned long aui; - - public: -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - - object (std::string id = ""): id_ (id), dfk (0) {} - ~object () {delete dfk;} -#else - object (std::string id = ""): id_ (id), afk (0) {} - ~object () {delete afk;} -#endif -#else - object (std::string id = ""): id_ (id) {} -#endif - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/combined/test1.hxx b/evolution/combined/test1.hxx deleted file mode 100644 index 1a18aff..0000000 --- a/evolution/combined/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/combined/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/combined/test2.hxx b/evolution/combined/test2.hxx deleted file mode 100644 index 8eb7ac8..0000000 --- a/evolution/combined/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/combined/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/combined/test3.hxx b/evolution/combined/test3.hxx deleted file mode 100644 index 05a052f..0000000 --- a/evolution/combined/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/combined/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/data/driver.cxx b/evolution/data/driver.cxx deleted file mode 100644 index 73cc852..0000000 --- a/evolution/data/driver.cxx +++ /dev/null @@ -1,178 +0,0 @@ -// file : evolution/data/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test data migration support. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX, HAVE_CXX11 -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -void -migrate1 (database& db) -{ - using namespace v2; - using namespace v3; - - auto_ptr o1 (db.load (1)); - object2 o2 (1); - o2.num = o1->num; - db.persist (o2); -} - -void -migrate2 (database& db) -{ - using namespace v2; - using namespace v3; - - auto_ptr o1 (db.load (2)); - object2 o2 (2); - o2.num = o1->num; - db.persist (o2); -} - -static const data_migration_entry<3, 1> migrate2_entry (&migrate2); - -int -main (int argc, char* argv[]) -{ - schema_catalog::data_migration_function<3, 1> (&migrate1); - -#ifdef HAVE_CXX11 - schema_catalog::data_migration_function<3, 1> ( - [] (database& db) - { - using namespace v2; - using namespace v3; - - auto_ptr o1 (db.load (11)); - object2 o2 (11); - o2.num = o1->num; - db.persist (o2); - }); -#endif - - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - { - transaction t (db->begin ()); - - { - object1 o1 (1); - o1.num = 123; - db->persist (o1); - } - - { - object1 o1 (2); - o1.num = 123; - db->persist (o1); - } - -#ifdef HAVE_CXX11 - { - object1 o1 (11); - o1.num = 123; - db->persist (o1); - } -#endif - t.commit (); - } - break; - } - case 2: - { - { - transaction t (db->begin ()); - - if (embedded) - schema_catalog::migrate (*db); - else - schema_catalog::migrate_data (*db); - - t.commit (); - } - - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - - { - auto_ptr o2 (db->load (1)); - assert (o2->num == 123); - } - - { - auto_ptr o2 (db->load (2)); - assert (o2->num == 123); - } - -#ifdef HAVE_CXX11 - { - auto_ptr o2 (db->load (11)); - assert (o2->num == 123); - } -#endif - t.commit (); - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/data/model.hxx b/evolution/data/model.hxx deleted file mode 100644 index 680bc55..0000000 --- a/evolution/data/model.hxx +++ /dev/null @@ -1,45 +0,0 @@ -// file : evolution/data/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ -#if MODEL_VERSION == 2 - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif - -#if MODEL_VERSION == 3 - #pragma db object - struct object2 - { - object2 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/data/test1.hxx b/evolution/data/test1.hxx deleted file mode 100644 index 976ed04..0000000 --- a/evolution/data/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/data/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/data/test2.hxx b/evolution/data/test2.hxx deleted file mode 100644 index bd72940..0000000 --- a/evolution/data/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/data/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/data/test3.hxx b/evolution/data/test3.hxx deleted file mode 100644 index 0f47099..0000000 --- a/evolution/data/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/data/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/drop-column/driver.cxx b/evolution/drop-column/driver.cxx deleted file mode 100644 index 7f0c253..0000000 --- a/evolution/drop-column/driver.cxx +++ /dev/null @@ -1,126 +0,0 @@ -// file : evolution/drop-column/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test dropping a column. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o (1); - o.str = "abc"; - o.num = 123; - o.ptr = new object1 (1, 2); - - { - transaction t (db->begin ()); - db->persist (*o.ptr); - db->persist (o); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Things are still there. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (p->str == "abc"); - assert (p->num == 123); - assert (p->ptr->id.x == 1 && p->ptr->id.y == 2); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - // Now they are gone. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->ptr == 0); - db->erase (value (1, 2)); // SQLite logical delete test. - t.commit (); - } - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/drop-column/model.hxx b/evolution/drop-column/model.hxx deleted file mode 100644 index 09b63b9..0000000 --- a/evolution/drop-column/model.hxx +++ /dev/null @@ -1,59 +0,0 @@ -// file : evolution/drop-column/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db value - struct value - { - value (int x_ = 0, int y_ = 0): x (x_), y (y_) {} - int x; - int y; - }; - - #pragma db object - struct object1 - { - object1 (int x = 0, int y = 0): id (x, y) {} - - #pragma db id - value id; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id), ptr (0) {} - ~object () {delete ptr;} - - #pragma db id - unsigned long id_; - - std::string str; - unsigned long num; - object1* ptr; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) - #pragma db member(object::num) deleted(3) - #pragma db member(object::ptr) deleted(3) -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-column/test1.hxx b/evolution/drop-column/test1.hxx deleted file mode 100644 index 1efb1fa..0000000 --- a/evolution/drop-column/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/drop-column/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/drop-column/test2.hxx b/evolution/drop-column/test2.hxx deleted file mode 100644 index 2842cd3..0000000 --- a/evolution/drop-column/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-column/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/drop-column/test3.hxx b/evolution/drop-column/test3.hxx deleted file mode 100644 index d1ce616..0000000 --- a/evolution/drop-column/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-column/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/drop-foreign-key/driver.cxx b/evolution/drop-foreign-key/driver.cxx deleted file mode 100644 index f829562..0000000 --- a/evolution/drop-foreign-key/driver.cxx +++ /dev/null @@ -1,145 +0,0 @@ -// file : evolution/drop-foreign-key/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test dropping a foreign key. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - - // SQLite doesn't support dropping of foreign keys. - // -#ifndef DATABASE_SQLITE - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o (1); - o.o1 = new object (2); - o.o2 = new object (3); - - { - transaction t (db->begin ()); - db->persist (o.o1); - db->persist (o.o2); - db->persist (o); - t.commit (); - } - - // The foreign key constraint is there. - // - try - { - object o (11); - o.o1 = new object (12); - o.o2 = new object (13); - - transaction t (db->begin ()); - db->persist (o); - assert (false); - } - catch (const odb::exception& ) {} - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // The data is still there but the constraints are gone. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - assert (p->o1 == 2); - assert (p->o2 == 3); - - db->erase (p->o1); - db->erase (p->o2); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->o1 == 2); - assert (p->o2 == 3); - t.commit (); - } - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } -#endif // DATABASE_SQLITE - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/drop-foreign-key/model.hxx b/evolution/drop-foreign-key/model.hxx deleted file mode 100644 index eed8c46..0000000 --- a/evolution/drop-foreign-key/model.hxx +++ /dev/null @@ -1,50 +0,0 @@ -// file : evolution/drop-foreign-key/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include - -#include // DATABASE_XXX - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - #pragma db id - unsigned long id_; - - // SQLite doesn't support dropping of foreign keys. - // -#ifndef DATABASE_SQLITE -#if MODEL_VERSION == 2 - object* o1; - object* o2; - - object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} - ~object () {delete o1; delete o2;} -#else - #pragma db null - unsigned long o1; - - #pragma db null - unsigned long o2; - - object (unsigned long id = 0): id_ (id) {} -#endif -#endif - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-foreign-key/test1.hxx b/evolution/drop-foreign-key/test1.hxx deleted file mode 100644 index 5476796..0000000 --- a/evolution/drop-foreign-key/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/drop-foreign-key/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/drop-foreign-key/test2.hxx b/evolution/drop-foreign-key/test2.hxx deleted file mode 100644 index f091a25..0000000 --- a/evolution/drop-foreign-key/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-foreign-key/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/drop-foreign-key/test3.hxx b/evolution/drop-foreign-key/test3.hxx deleted file mode 100644 index beb8c42..0000000 --- a/evolution/drop-foreign-key/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-foreign-key/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/drop-index/driver.cxx b/evolution/drop-index/driver.cxx deleted file mode 100644 index 5ad1cd4..0000000 --- a/evolution/drop-index/driver.cxx +++ /dev/null @@ -1,154 +0,0 @@ -// file : evolution/drop-index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test dropping an index. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - object o0 (0); - o0.num = 123; - - object o1 (1); - o1.num = 234; - - object o2 (2); - o2.num = 234; - - { - transaction t (db->begin ()); - db->persist (o0); - db->persist (o1); - t.commit (); - } - - // Duplicates are not ok. - // - try - { - transaction t (db->begin ()); - db->persist (o2); - assert (false); - } - catch (const odb::exception& ) {} - - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Duplicates are now ok. - // - object o2 (2); - o2.num = 234; - - { - transaction t (db->begin ()); - db->persist (o2); - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - { - transaction t (db->begin ()); - auto_ptr p0 (db->load (0)); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - - assert (p0->num == 123); - assert (p1->num == 234); - assert (p2->num == 234); - - t.commit (); - } - - // Duplicates are still ok. - // - object o3 (3); - o3.num = 234; - - { - transaction t (db->begin ()); - db->persist (o3); - t.commit (); - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/drop-index/model.hxx b/evolution/drop-index/model.hxx deleted file mode 100644 index 5e163ca..0000000 --- a/evolution/drop-index/model.hxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : evolution/drop-index/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 2 - #pragma db unique -#endif - unsigned long num; - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-index/test1.hxx b/evolution/drop-index/test1.hxx deleted file mode 100644 index 5a279bb..0000000 --- a/evolution/drop-index/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/drop-index/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/drop-index/test2.hxx b/evolution/drop-index/test2.hxx deleted file mode 100644 index 78b89f2..0000000 --- a/evolution/drop-index/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-index/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/drop-index/test3.hxx b/evolution/drop-index/test3.hxx deleted file mode 100644 index 17b670d..0000000 --- a/evolution/drop-index/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-index/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/drop-table/driver.cxx b/evolution/drop-table/driver.cxx deleted file mode 100644 index 81cec55..0000000 --- a/evolution/drop-table/driver.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// file : evolution/drop-table/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test dropping a table (object, container). -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - { - using namespace v2; - - object1 o1; - o1.o = new object (1); - o1.o->str = "abc"; - o1.nums.push_back (1); - o1.nums.push_back (2); - o1.nums.push_back (3); - - { - transaction t (db->begin ()); - db->persist (o1.o); - db->persist (o1); - t.commit (); - } - } - - // Polymorphism test. - // - { - // We have to use v3 here because the discriminator includes - // the namespace. - // - using namespace v3; - - base b (123, "abc"); - derived d1 (234, "bcd"); - derived d2 (345, "cde"); - - { - transaction t (db->begin ()); - db->persist (b); - db->persist (d1); - db->persist (d2); - t.commit (); - } - } - - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Both object and object1 are still there so we can migrate the data. - // - typedef odb::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - result r (db->query (query::o->str == "abc")); - result::iterator i (r.begin ()), e (r.end ()); - - assert (i != e && - i->o->id_ == 1 && - i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); - assert (++i == e); - - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - - break; - } - case 3: - { - using namespace v3; - - // Only object is still there. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc"); - t.commit (); - } - - // Polymorphism test. - // - { - transaction t (db->begin ()); - assert (size (db->query ()) == 1); - assert (size (db->query ()) == 1); - t.commit (); - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/drop-table/model.hxx b/evolution/drop-table/model.hxx deleted file mode 100644 index 2c02d09..0000000 --- a/evolution/drop-table/model.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// file : evolution/drop-table/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include -#include - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str; - }; - - #pragma db object - struct object1 - { - object1 (): o (0) {} - ~object1 () {delete o;} - - #pragma db id auto - unsigned long id_; - - object* o; - std::vector nums; - }; - -#if MODEL_VERSION == 3 - #pragma db object(object1) deleted(3) -#endif - - // Make sure we also clean up base tables when dropping a - // table corresponding to the polymorphic derived object. - // - #pragma db value - struct value - { - value (unsigned long n = 0, const std::string& s = ""): num (n), str (s) {} - - unsigned long num; - std::string str; - }; - - #pragma db object polymorphic - struct root - { - root (unsigned long n = 0, const std::string& s = ""): id (n, s) {} - virtual ~root () {} - - #pragma db id - value id; - }; - - #pragma db object - struct base: root - { - base (unsigned long n = 0, const std::string& s = "") - : root (n, s), num (n) {} - - unsigned long num; - }; - - #pragma db object - struct derived: base - { - derived (unsigned long n = 0, const std::string& s = "") - : base (n, s), str (s) {} - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db object(derived) deleted(3) -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/drop-table/test1.hxx b/evolution/drop-table/test1.hxx deleted file mode 100644 index a9ec64c..0000000 --- a/evolution/drop-table/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/drop-table/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/drop-table/test2.hxx b/evolution/drop-table/test2.hxx deleted file mode 100644 index c9ec149..0000000 --- a/evolution/drop-table/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-table/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/drop-table/test3.hxx b/evolution/drop-table/test3.hxx deleted file mode 100644 index 8d3f17b..0000000 --- a/evolution/drop-table/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/drop-table/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/embedded/driver.cxx b/evolution/embedded/driver.cxx deleted file mode 100644 index 1816a5c..0000000 --- a/evolution/embedded/driver.cxx +++ /dev/null @@ -1,181 +0,0 @@ -// file : evolution/embedded/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test embedded schema migration. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#ifdef DATABASE_PGSQL -# include -#endif - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - t.commit (); - } - - // PostgreSQL cannot continue a transaction after a query failed. We - // have a workaround but only for 9.4+. - // -#ifdef DATABASE_PGSQL - { - odb::connection_ptr c (db->connection ()); - int v (static_cast (*c).server_version ()); - if (v < 90400) - assert (db->schema_version () == 0); - } -#endif - - { - transaction t (db->begin ()); - assert (db->schema_version () == 0); - - schema_catalog::create_schema (*db, "", false); - - assert (db->schema_version () == 1 && !db->schema_migration ()); - - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - assert (db->schema_version () == 2 && !db->schema_migration ()); - - { - transaction t (db->begin ()); - object1 o1 (1); - o1.num = 123; - db->persist (o1); - t.commit (); - } - break; - } - case 2: - { - using namespace v2; - using namespace v3; - - // Check version information correctness. - // - assert (schema_catalog::base_version (*db) == 1); - assert (schema_catalog::current_version (*db) == 3); - assert (schema_catalog::next_version (*db, 0) == 3); - assert (schema_catalog::next_version (*db, 1) == 2); - assert (schema_catalog::next_version (*db) == 3); - assert (schema_catalog::next_version (*db, 3) == 4); - - { - assert (db->schema_version () == 2 && !db->schema_migration ()); - - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - assert (db->schema_version () == 3 && db->schema_migration ()); - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - object2 o2 (1); - o2.num = o1->num; - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - - assert (db->schema_version () == 3 && !db->schema_migration ()); - } - break; - } - case 3: - { - using namespace v3; - - // In transaction. - // - { - transaction t (db->begin ()); - assert (db->schema_version () == 3 && !db->schema_migration ()); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr o2 (db->load (1)); - assert (o2->num == 123); - t.commit (); - } - - // Test the case where there is still no version table. - // - db->schema_version_migration (0, false); - - { - transaction t (db->begin ()); - -#ifdef DATABASE_ORACLE - db->execute ("DROP TABLE \"schema_version\""); -#else - db->execute ("DROP TABLE schema_version"); -#endif - t.commit (); - } - - assert (db->schema_version () == 0); - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/embedded/model.hxx b/evolution/embedded/model.hxx deleted file mode 100644 index f3aa7a4..0000000 --- a/evolution/embedded/model.hxx +++ /dev/null @@ -1,45 +0,0 @@ -// file : evolution/embedded/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ -#if MODEL_VERSION == 2 - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif - -#if MODEL_VERSION == 3 - #pragma db object - struct object2 - { - object2 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/embedded/test1.hxx b/evolution/embedded/test1.hxx deleted file mode 100644 index 32903a1..0000000 --- a/evolution/embedded/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/embedded/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/embedded/test2.hxx b/evolution/embedded/test2.hxx deleted file mode 100644 index fce8760..0000000 --- a/evolution/embedded/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/embedded/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/embedded/test3.hxx b/evolution/embedded/test3.hxx deleted file mode 100644 index d49ecc5..0000000 --- a/evolution/embedded/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/embedded/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/soft-add/driver.cxx b/evolution/soft-add/driver.cxx deleted file mode 100644 index c70edcb..0000000 --- a/evolution/soft-add/driver.cxx +++ /dev/null @@ -1,2219 +0,0 @@ -// file : evolution/soft-add/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test soft-add functionality. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v3; // NOTE: not v2. - - if (embedded) - { - // SQLite has broken foreign keys when it comes to DDL. - // -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=OFF"); -#endif - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=ON"); -#endif - } - - // Test basic soft-added member logic. - // - { - using namespace test2; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - o.ptr = new object1 (1); - o.ptr->ptrs.push_back (&o); - - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->str == "" && i->num == 123 && - i->vec.empty () && i->ptr == 0); - - try - { - db->query (query::str.is_null ()); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - o.ptr = new object1 (2); - o.ptr->ptrs.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - delete o.ptr; - o.ptr = 0; - - { - transaction t (db->begin ()); - db->erase (2); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test empty statement handling (INSERT, UPDATE). - // - { - using namespace test3; - - // None of the database operations should yet include the - // added members. - // - object o; - o.str = "bcd"; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); - t.commit (); - } - - o.str += 'e'; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test empty statement handling (SELECT in polymorphic loader). - // - { - using namespace test4; - - // None of the database operations should yet include the - // added members. - // - object o (1); - o.str = "abc"; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (1)); - assert (static_cast (*p).str == ""); - db->erase (o); - t.commit (); - } - } - - // Test container with soft-added value member. - // - { - using namespace test5; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.vec.push_back (value ("abc", 123)); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "" && p->vec[0].num == 123); - t.commit (); - } - - object o (2); - o.vec.push_back (value ("bcd", 234)); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 234); - t.commit (); - } - - o.vec.modify (0).str += 'e'; - o.vec.modify (0).num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test view with soft-added member. - // - { - using namespace test6; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.str = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - } - - // Test soft-added section member. - // - { - using namespace test7; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - try - { - db->load (*p, p->s); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-added members of a section. - // - { - using namespace test8; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "" && i->num == 123 && i->vec.empty ()); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // No longer automatically marked as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test basic soft-added member logic in polymorphic classes. - // - { - using namespace test9; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (static_cast (db->load (1))); - assert (p->bstr == "" && p->dstr == "" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::id == 1)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - - try - { - db->query (query::bstr == "ab"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->bstr == "" && i->dstr == "" && i->num); - - try - { - db->query (query::dstr == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "" && p->dstr == "" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "" && p->dstr == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-added section member in polymorphic classes. - // - { - using namespace test10; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - try - { - db->load (*p, p->s); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-added members of a section in polymorphic classes. - // - { - using namespace test11; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::id == 1)); - result::iterator i (r.begin ()); - db->load (*i, i->s); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - - try - { - db->query (query::bstr == "ab"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - db->load (*i, i->s); - assert (i != r.end () && - i->bstr == "" && i->dstr == "" && i->num); - - try - { - db->query (query::dstr == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "" && p->dstr == "" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "" && p->dstr == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - - // Test empty statement detection in sections. - // - base b (3); - b.bstr = "bc"; - - { - transaction t (db->begin ()); - db->persist (b); - auto_ptr p (db->load (3)); - db->load (*p, p->s); - assert (p->bstr == ""); - t.commit (); - } - - b.bstr += 'd'; - b.s.change (); - - { - transaction t (db->begin ()); - db->update (b); - auto_ptr p (db->load (3)); - db->load (*p, p->s); - assert (p->bstr == ""); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (b); - t.commit (); - } - } - - // Test soft-added member and optimistic concurrency. - // - { - using namespace test12; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.str = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - unsigned long long v (o.v_); - db->update (o); - assert (o.v_ != v); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235 && p->v_ == o.v_); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-added member in an object without id. - // - { - using namespace test13; - - typedef odb::query query; - typedef odb::result result; - - // None of the database operations should yet include the - // added members. - // - { - object o; - o.str = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - - result r (db->query (query::num == 234)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 234); - - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase_query (query::num == 234); - t.commit (); - } - } - - // Test soft-added member in an object with auto id. - // - { - using namespace test14; - - // None of the database operations should yet include the - // added members. - // - unsigned long id; - { - object o; - o.str = "abc"; - o.num = 123; - - transaction t (db->begin ()); - db->persist (o); - id = o.id; - t.commit (); - } - { - transaction t (db->begin ()); - auto_ptr p (db->load (id)); - assert (p->str == "" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} - - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o.id); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned object. - // - { - using namespace test21; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.num = 123; - o.vec.push_back (123); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->num == 123 && i->vec.empty ()); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned section. - // - { - using namespace test22; - - // None of the database operations should yet include the - // added members. - // - { - object o (1); - o.num = 123; - o.vec.push_back (123); - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->num == 123 && i->vec.empty ()); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; // No longer automatically marks as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Test basic soft-added member logic. - // - { - using namespace test2; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->str = "abc"; - p->vec.push_back (123); - delete p->ptr; - p->ptr = new object1 (1); - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123 && - p->vec[0] == 123 && p->ptr->id_ == 1); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str.is_not_null () && - query::ptr->id == 1)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->str == "abc" && i->num == 123 && - i->vec[0] == 123 && i->ptr->id_ == 1); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - o.ptr = new object1 (2); - o.ptr->ptrs.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234 && - p->vec[0] == 234 && p->ptr->id_ == 2); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - delete o.ptr; - o.ptr = 0; - - { - transaction t (db->begin ()); - db->erase (2); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235 && - p->vec[0] == 235 && p->ptr == 0); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test container with soft-added value member. - // - { - using namespace test5; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->vec.modify (0).str = "abc"; - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "abc" && p->vec[0].num == 123); - t.commit (); - } - - object o (2); - o.vec.push_back (value ("bcd", 234)); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); - t.commit (); - } - - o.vec.modify (0).str += 'e'; - o.vec.modify (0).num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test view with soft-added member. - // - { - using namespace test6; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->str = "abc"; - db->update (*p); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - } - - // Test soft-added section member. - // - { - using namespace test7; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - p->str = "abc"; - p->vec.push_back (123); - db->update (*p, p->s); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // Automatically marks section as updated. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-added members of a section. - // - { - using namespace test8; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - p->str = "abc"; - p->vec.push_back (123); - db->update (*p, p->s); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // Automatically marks section as updated. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test basic soft-added member logic in polymorphic classes. - // - { - using namespace test9; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->bstr = "ab"; - p->dstr = "abc"; - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (static_cast (db->load (1))); - assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-added section member in polymorphic classes. - // - { - using namespace test10; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - p->bstr = "ab"; - p->dstr = "abc"; - db->update (*p, p->s); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-added members of a section in polymorphic classes. - // - { - using namespace test11; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - p->bstr = "ab"; - p->dstr = "abc"; - db->update (*p, p->s); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-added member and optimistic concurrency. - // - { - using namespace test12; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->str = "abc"; - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - unsigned long long v (o.v_); - db->update (o); - assert (o.v_ != v); - auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-added member in an object without id. - // - { - using namespace test13; - - typedef odb::query query; - typedef odb::result result; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - - result r (db->query (query::str == "bcd")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "bcd" && i->num == 234); - - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase_query (query::str == "bcd"); - t.commit (); - } - } - - // Test soft-added member in an object with auto id. - // - { - using namespace test14; - - typedef odb::query query; - typedef odb::result result; - - // All the database operations should now include the added - // members. - // - unsigned long id; - { - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - i->str = "abc"; - db->update (*i); - id = i->id; - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (id)); - assert (p->str == "abc" && p->num == 123); - t.commit (); - } - - { - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "bcd" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned object. - // - { - using namespace test21; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - p->vec.push_back (123); - db->update (*p); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned section. - // - { - using namespace test22; - - // All the database operations should now include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - p->vec.push_back (123); - db->update (*p, p->s); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; // Automatically marks section as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - // Test basic soft-added member logic. - // - { - using namespace test2; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123 && - p->vec[0] == 123 && p->ptr->id_ == 1); - t.commit (); - } - } - - // Test container with soft-added value member. - // - { - using namespace test5; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "abc" && p->vec[0].num == 123); - t.commit (); - } - } - - // Test view with soft-added member. - // - { - using namespace test6; - - // All the database operations should still include the added - // members. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - } - - // Test soft-added section member. - // - { - using namespace test7; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - } - - // Test soft-added members of a section. - // - { - using namespace test8; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - } - - // Test basic soft-added member logic in polymorphic classes. - // - { - using namespace test9; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (static_cast (db->load (1))); - assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); - t.commit (); - } - } - - // Test soft-added section member in polymorphic classes. - // - { - using namespace test10; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - } - - // Test soft-added members of a section in polymorphic classes. - // - { - using namespace test11; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - } - - // Test soft-added member and optimistic concurrency. - // - { - using namespace test12; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123); - t.commit (); - } - } - - // Test soft-added member in an object without id. - // - { - using namespace test13; - - typedef odb::query query; - typedef odb::result result; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - } - - // Test soft-added member in an object with auto id. - // - { - using namespace test14; - - // All the database operations should still include the added - // members. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned object. - // - { - using namespace test21; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - } - - // Test soft-added container member in a non-versioned section. - // - { - using namespace test22; - - // All the database operations should still include the added - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/soft-add/model.hxx b/evolution/soft-add/model.hxx deleted file mode 100644 index 39d63c4..0000000 --- a/evolution/soft-add/model.hxx +++ /dev/null @@ -1,504 +0,0 @@ -// file : evolution/soft-add/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#include -#include -#include -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - // The test numbers are made to correspond to the soft-delete ones. - // - - // Test basic soft-added member logic. - // - #pragma db namespace table("t2_") - namespace test2 - { - struct object; - - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector > ptrs; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id), ptr (0) {} - ~object () {delete ptr;} - - #pragma db id - unsigned long id_; - - std::string str; - unsigned long num; - odb::vector vec; - - #pragma db inverse(ptrs) - object1* ptr; - }; - -#if MODEL_VERSION == 3 - // Make it a LOB for Oracle and long data for SQL Server. - // - #pragma db member(object::str) added(3) \ - oracle:type("CLOB") \ - mssql:type("VARCHAR(max)") - #pragma db member(object::vec) added(3) - #pragma db member(object::ptr) added(3) -#else - #pragma db member(object::str) transient - #pragma db member(object::vec) transient - #pragma db member(object::ptr) transient -#endif - } - - // Test empty statement handling (INSERT, UPDATE). - // - #pragma db namespace table("t3_") - namespace test3 - { - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) -#else - #pragma db member(object::str) transient -#endif - } - - // Test empty statement handling (SELECT in polymorphic loader). - // - #pragma db namespace table("t4_") - namespace test4 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) -#else - #pragma db member(object::str) transient -#endif - } - - // Test container with soft-added value member. - // - #pragma db namespace table("t5_") - namespace test5 - { - #pragma db value - struct value - { - value () {} - value (const std::string& s, unsigned long n): str (s), num (n) {} - - std::string str; - unsigned long num; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(value::str) added(3) -#else - #pragma db member(value::str) transient -#endif - } - - // Test view with soft-added member. - // - #pragma db namespace table("t6_") - namespace test6 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str; - unsigned long num; - }; - - #pragma db view object(object) - struct view - { - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) - #pragma db member(view::str) added(3) -#else - #pragma db member(object::str) transient - #pragma db member(view::str) transient -#endif - } - - // Test soft-added section member. - // - #pragma db namespace table("t7_") - namespace test7 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 3 - #pragma db load(lazy) update(change) added(3) - odb::section s; -#endif - - #pragma db section(s) - std::string str; - - unsigned long num; - - #pragma db section(s) - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) section(s) - #pragma db member(object::vec) section(s) -#else - #pragma db member(object::str) transient - #pragma db member(object::vec) transient -#endif - } - - // Test soft-added members of a section. - // - #pragma db namespace table("t8_") - namespace test8 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - std::string str; - - #pragma db section(s) - unsigned long num; - - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) section(s) - #pragma db member(object::vec) added(3) section(s) -#else - #pragma db member(object::str) transient - #pragma db member(object::vec) transient -#endif - } - - // Test basic soft-added member logic in polymorphic classes. - // - #pragma db namespace table("t9_") - namespace test9 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string dstr; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::bstr) added(3) - #pragma db member(object::dstr) added(3) -#else - #pragma db member(base::bstr) transient - #pragma db member(object::dstr) transient -#endif - } - - // Test soft-added section member in polymorphic classes. - // - #pragma db namespace table("t10_") - namespace test10 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#if MODEL_VERSION == 3 - #pragma db load(lazy) update(change) added(3) - odb::section s; -#endif - - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string dstr; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::bstr) section(s) - #pragma db member(object::dstr) section(s) -#else - #pragma db member(base::bstr) transient - #pragma db member(object::dstr) transient -#endif - } - - // Test soft-added members of a section in polymorphic classes. - // - #pragma db namespace table("t11_") - namespace test11 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string dstr; - - #pragma db section(s) - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::bstr) added(3) section(s) - #pragma db member(object::dstr) added(3) section(s) -#else - #pragma db member(base::bstr) transient - #pragma db member(object::dstr) transient -#endif - } - - // Test soft-added member and optimistic concurrency. - // - #pragma db namespace table("t12_") - namespace test12 - { - #pragma db object optimistic - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db version mssql:type("ROWVERSION") - unsigned long long v_; - - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) -#else - #pragma db member(object::str) transient -#endif - } - - // Test soft-added member in an object without id. - // - #pragma db namespace table("t13_") - namespace test13 - { - #pragma db object no_id - struct object - { - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) default("abc") \ - mysql:type("VARCHAR(255)") -#else - #pragma db member(object::str) transient -#endif - } - - // Test soft-added member in an object with auto id. - // - #pragma db namespace table("t14_") - namespace test14 - { - #pragma db object - struct object - { - std::string str; - unsigned long num; - - #pragma db id auto - unsigned long id; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) added(3) -#else - #pragma db member(object::str) transient -#endif - } - - // Test soft-added container member in a non-versioned object. - // - #pragma db namespace table("t21_") - namespace test21 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - unsigned long num; - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::vec) added(3) -#else - #pragma db member(object::vec) transient -#endif - } - - // Test soft-added container member in a non-versioned section. - // - #pragma db namespace table("t22_") - namespace test22 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - unsigned long num; - - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::vec) added(3) section(s) -#else - #pragma db member(object::vec) transient -#endif - } -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/soft-add/test1.hxx b/evolution/soft-add/test1.hxx deleted file mode 100644 index 461d663..0000000 --- a/evolution/soft-add/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/soft-add/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/soft-add/test2.hxx b/evolution/soft-add/test2.hxx deleted file mode 100644 index 746da4b..0000000 --- a/evolution/soft-add/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/soft-add/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/soft-add/test3.hxx b/evolution/soft-add/test3.hxx deleted file mode 100644 index f2990d0..0000000 --- a/evolution/soft-add/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/soft-add/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/soft-delete/driver.cxx b/evolution/soft-delete/driver.cxx deleted file mode 100644 index e41a70c..0000000 --- a/evolution/soft-delete/driver.cxx +++ /dev/null @@ -1,2202 +0,0 @@ -// file : evolution/soft-delete/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test soft-delete functionality. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - // SQLite has broken foreign keys when it comes to DDL. - // -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=OFF"); -#endif - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - -#ifdef DATABASE_SQLITE - db->connection ()->execute ("PRAGMA foreign_keys=ON"); -#endif - } - - // Test soft-deleted objects. - // - { - using namespace test1; - - object o (1); - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test basic soft-deleted member logic. - // - { - using namespace test2; - - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - o.ptr = new object1 (1); - o.ptr->ptrs.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - t.commit (); - } - } - - // Test container with soft-deleted value member. - // - { - using namespace test5; - - object o (1); - o.vec.push_back (value ("abc", 123)); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test view with soft-deleted member. - // - { - using namespace test6; - - object o (1); - o.str = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted section member. - // - { - using namespace test7; - - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted members of a section. - // - { - using namespace test8; - - object o (1); - o.str = "abc"; - o.num = 123; - o.vec.push_back (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test basic soft-deleted member logic in polymorphic classes. - // - { - // We have to use v3 here because the discriminator includes - // the namespace. - // - using namespace v3::test9; - - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted section member in polymorphic classes. - // - { - // We have to use v3 here because the discriminator includes - // the namespace. - // - using namespace v3::test10; - - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted members of a section in polymorphic classes. - // - { - // We have to use v3 here because the discriminator includes - // the namespace. - // - using namespace v3::test11; - - object o (1); - o.bstr = "ab"; - o.dstr = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted member and optimistic concurrency. - // - { - using namespace test12; - - object o (1); - o.str = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted member in an object without id. - // - { - using namespace test13; - - object o; - o.str = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted member in an object with auto id. - // - { - using namespace test14; - - object o; - o.str = "abc"; - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test summarily deleted composite values. - // - { - using namespace test15; - - object o (1); - o.v.reset (new value); - o.v->str = "abc"; - o.v->vec.push_back (123); - o.num = 123; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned object. - // - { - using namespace test21; - - object o (1); - o.num = 123; - o.vec.push_back (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned section. - // - { - using namespace test22; - - object o (1); - o.num = 123; - o.vec.push_back (123); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - } - - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - // Test soft-deleted objects. - // - { - using namespace test1; - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123); - t.commit (); - } - } - - // Test basic soft-deleted member logic. - // - { - using namespace test2; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123 && - p->vec[0] == 123 && p->ptr->id_ == 1); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc" && - query::ptr->id == 1)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->str == "abc" && i->num == 123 && - i->vec[0] == 123 && i->ptr->id_ == 1); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - o.ptr = new object1 (2); - o.ptr->ptrs.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234 && - p->vec[0] == 234 && p->ptr->id_ == 2); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - delete o.ptr; - o.ptr = 0; - - { - transaction t (db->begin ()); - db->erase (2); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235 && - p->vec[0] == 235 && p->ptr == 0); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test container with soft-deleted value member. - // - { - using namespace test5; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "abc" && p->vec[0].num == 123); - t.commit (); - } - - object o (2); - o.vec.push_back (value ("bcd", 234)); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); - t.commit (); - } - - o.vec.modify (0).str += 'e'; - o.vec.modify (0).num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test view with soft-deleted member. - // - { - using namespace test6; - - // All the database operations should still include the deleted - // members. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - } - - // Test soft-deleted section member. - // - { - using namespace test7; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // Automatically marks section as updated. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-deleted members of a section. - // - { - using namespace test8; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // Automatically marks section as updated. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test basic soft-deleted member logic in polymorphic classes. - // - { - using namespace test9; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (static_cast (db->load (1))); - assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-deleted section member in polymorphic classes. - // - { - using namespace test10; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-deleted members of a section in polymorphic classes. - // - { - using namespace test11; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::bstr == "ab")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - object& o (static_cast (*i)); - assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (static_cast (o)); - t.commit (); - } - } - - // Test soft-deleted member and optimistic concurrency. - // - { - using namespace test12; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "abc" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->str == "bcd" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - unsigned long long v (o.v_); - db->update (o); - assert (o.v_ != v); - auto_ptr p (db->load (2)); - assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-deleted member in an object without id. - // - { - using namespace test13; - - typedef odb::query query; - typedef odb::result result; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - - result r (db->query (query::str == "bcd")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "bcd" && i->num == 234); - - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase_query (query::str == "bcd"); - t.commit (); - } - } - - // Test soft-deleted member in an object with auto id. - // - { - using namespace test14; - - // All the database operations should still include the deleted - // members. - // - unsigned long id; - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "abc" && i->num == 123); - id = i->id; - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (id)); - assert (p->str == "abc" && p->num == 123); - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "bcd" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "bcde" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test summarily deleted composite values. - // - { - using namespace test15; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->v->str == "abc" && p->num == 123 && - p->v->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::v.str == "abc")); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->v->str == "abc" && i->num == 123 && - i->v->vec[0] == 123); - t.commit (); - } - - object o (2); - o.v.reset (new value); - o.v->str = "bcd"; - o.num = 234; - o.v->vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->v->str == "bcd" && p->num == 234 && - p->v->vec[0] == 234); - t.commit (); - } - - o.v->str += 'e'; - o.num++; - o.v->vec.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->v->str == "bcde" && p->num == 235 && - p->v->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned object. - // - { - using namespace test21; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned section. - // - { - using namespace test22; - - // All the database operations should still include the deleted - // members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->num == 123 && p->vec[0] == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->num == 123 && i->vec[0] == 123); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec[0] == 234); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; // Automatically marks section as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 235 && p->vec[0] == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - // Test soft-deleted objects. - // - { - using namespace test1; - - try - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); // No such table. - assert (false); - } - catch (const odb::exception&) {} - } - - // Test basic soft-deleted member logic. - // - { - using namespace test2; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->str == "" && i->num == 123 && - i->vec.empty () && i->ptr == 0); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - o.ptr = new object1 (2); - o.ptr->ptrs.push_back (&o); - - { - transaction t (db->begin ()); - db->persist (o); - db->persist (*o.ptr); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - delete o.ptr; - o.ptr = 0; - - { - transaction t (db->begin ()); - db->erase (2); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235 && - p->vec.empty () && p->ptr == 0); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test empty statement handling (INSERT, UPDATE). - // - { - using namespace test3; - - // Now none of the database operations should include the - // deleted member. - // - object o; - o.str = "bcd"; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); - t.commit (); - } - - o.str += 'e'; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == ""); - t.commit (); - } - } - - // Test empty statement handling (SELECT in polymorphic loader). - // - { - using namespace test4; - - // Now none of the database operations should include the - // deleted member. - // - object o (1); - o.str = "abc"; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (1)); - assert (static_cast (*p).str == ""); - t.commit (); - } - } - - // Test container with soft-deleted value member. - // - { - using namespace test5; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->vec[0].str == "" && p->vec[0].num == 123); - t.commit (); - } - - object o (2); - o.vec.push_back (value ("bcd", 234)); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 234); - t.commit (); - } - - o.vec.modify (0).str += 'e'; - o.vec.modify (0).num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->vec[0].str == "" && p->vec[0].num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test view with soft-deleted member. - // - { - using namespace test6; - - // Now none of the database operations should include the - // deleted members. - // - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - } - - // Test soft-deleted section member. - // - { - using namespace test7; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->load (*p, p->s); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#endif - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted members of a section. - // - { - using namespace test8; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->str == "" && i->num == 123 && i->vec.empty ()); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.str += 'e'; - o.num++; - o.vec.modify (0)++; // No longer automatically marked as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->str == "" && p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test basic soft-deleted member logic in polymorphic classes. - // - { - using namespace test9; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (static_cast (db->load (1))); - assert (p->bstr == "" && p->dstr == "" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::id == 1)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::bstr == "ab"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::bstr.is_null ())) == 1); -#endif - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && - i->bstr == "" && i->dstr == "" && i->num); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::dstr == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::dstr.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "" && p->dstr == "" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - assert (p->bstr == "" && p->dstr == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted section member in polymorphic classes. - // - { - using namespace test10; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->load (*p, p->s); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#endif - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted members of a section in polymorphic classes. - // - { - using namespace test11; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - object& o (static_cast (*p)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::id == 1)); - result::iterator i (r.begin ()); - db->load (*i, i->s); - assert (i != r.end ()); - object& o (static_cast (*i)); - assert (o.bstr == "" && o.dstr == "" && o.num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::bstr == "ab"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::bstr.is_null ())) == 1); -#endif - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - db->load (*i, i->s); - assert (i != r.end () && - i->bstr == "" && i->dstr == "" && i->num); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::dstr == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::dstr.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.bstr = "bc"; - o.dstr = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "" && p->dstr == "" && p->num == 234); - t.commit (); - } - - o.bstr += 'd'; - o.dstr += 'e'; - o.num++; - o.s.change (); - - { - transaction t (db->begin ()); - db->update (static_cast (o)); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->bstr == "" && p->dstr == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - - // Test empty statement detection in sections. - // - base b (3); - b.bstr = "bc"; - - { - transaction t (db->begin ()); - db->persist (b); - auto_ptr p (db->load (3)); - db->load (*p, p->s); - assert (p->bstr == ""); - t.commit (); - } - - b.bstr += 'd'; - b.s.change (); - - { - transaction t (db->begin ()); - db->update (b); - auto_ptr p (db->load (3)); - db->load (*p, p->s); - assert (p->bstr == ""); - t.commit (); - } - } - - // Test soft-deleted member and optimistic concurrency. - // - { - using namespace test12; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->str == "" && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - unsigned long long v (o.v_); - db->update (o); - assert (o.v_ != v); - auto_ptr p (db->load (2)); - assert (p->str == "" && p->num == 235 && p->v_ == o.v_); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted member in an object without id. - // - { - using namespace test13; - - typedef odb::query query; - typedef odb::result result; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - - result r (db->query (query::num == 234)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 234); - - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase_query (query::num == 234); - t.commit (); - } - } - - // Test soft-deleted member in an object with auto id. - // - { - using namespace test14; - - // Now none of the database operations should include the - // deleted members. - // - unsigned long id; - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->str == "" && i->num == 123); - id = i->id; - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::str.is_null ())) == 1); -#endif - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (id)); - assert (p->str == "" && p->num == 123); - t.commit (); - } - - object o; - o.str = "bcd"; - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "" && p->num == 234); - t.commit (); - } - - o.str += 'e'; - o.num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (o.id)); - assert (p->str == "" && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (o.id); - t.commit (); - } - } - - // Test summarily deleted composite values. - // - { - using namespace test15; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->v.get () == 0 && p->num == 123); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->v.get () == 0 && i->num == 123); - - // Logical delete in SQLite. - // -#ifndef DATABASE_SQLITE - try - { - db->query (query::v.str == "abc"); // No such column. - assert (false); - } - catch (const odb::exception&) {} -#else - assert (size (db->query (query::v.str.is_null ())) == 1); -#endif - t.commit (); - } - - object o (2); - o.num = 234; - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->v.get () == 0 && p->num == 234); - t.commit (); - } - - o.num++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->v.get () == 0 && p->num == 235); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned object. - // - { - using namespace test21; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - assert (p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->num == 123 && i->vec.empty ()); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - assert (p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - // Test soft-deleted container member in a non-versioned section. - // - { - using namespace test22; - - // Now none of the database operations should include the - // deleted members. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - db->load (*p, p->s); - assert (p->num == 123 && p->vec.empty ()); - t.commit (); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::num == 123)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - db->load (*i, i->s); - assert (i->num == 123 && i->vec.empty ()); - t.commit (); - } - - object o (2); - o.num = 234; - o.vec.push_back (234); - - { - transaction t (db->begin ()); - db->persist (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.num++; - o.vec.modify (0)++; // No longer automatically marks as changed. - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 234 && p->vec.empty ()); - t.commit (); - } - - o.s.change (); - - { - transaction t (db->begin ()); - db->update (o); - auto_ptr p (db->load (2)); - db->load (*p, p->s); - assert (p->num == 235 && p->vec.empty ()); - t.commit (); - } - - { - transaction t (db->begin ()); - db->erase (2); - t.commit (); - } - } - - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx deleted file mode 100644 index 65083dd..0000000 --- a/evolution/soft-delete/model.hxx +++ /dev/null @@ -1,518 +0,0 @@ -// file : evolution/soft-delete/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include // HAVE_CXX11 - -#include -#include // std::auto_ptr/unique_ptr - -#include -#include -#include -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ - // Test soft-deleted objects. - // - #pragma db namespace table("t1_") - namespace test1 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db object(object) deleted(3) -#endif - } - - // Test basic soft-deleted member logic. - // - #pragma db namespace table("t2_") - namespace test2 - { - struct object; - - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector > ptrs; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id), ptr (0) {} - ~object () {delete ptr;} - - #pragma db id - unsigned long id_; - - std::string str; - unsigned long num; - odb::vector vec; - - #pragma db inverse(ptrs) - object1* ptr; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) - #pragma db member(object::vec) deleted(3) - #pragma db member(object::ptr) deleted(3) -#endif - } - - // Test empty statement handling (INSERT, UPDATE). - // - #pragma db namespace table("t3_") - namespace test3 - { - #pragma db object - struct object - { - #pragma db id auto - unsigned long id; - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) -#endif - } - - // Test empty statement handling (SELECT in polymorphic loader). - // - #pragma db namespace table("t4_") - namespace test4 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string str; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) -#endif - } - - // Test container with soft-deleted value member. - // - #pragma db namespace table("t5_") - namespace test5 - { - #pragma db value - struct value - { - value () {} - value (const std::string& s, unsigned long n): str (s), num (n) {} - - std::string str; - unsigned long num; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(value::str) deleted(3) -#endif - } - - // Test view with soft-deleted member. - // - #pragma db namespace table("t6_") - namespace test6 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str; - unsigned long num; - }; - - #pragma db view object(object) - struct view - { - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) - #pragma db member(view::str) deleted(3) -#endif - } - - // Test soft-deleted section member. - // - #pragma db namespace table("t7_") - namespace test7 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - std::string str; - - unsigned long num; - - #pragma db section(s) - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::s) deleted(3) -#endif - } - - // Test soft-deleted members of a section. - // - #pragma db namespace table("t8_") - namespace test8 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - std::string str; - - #pragma db section(s) - unsigned long num; - - #pragma db section(s) - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) - #pragma db member(object::vec) deleted(3) -#endif - } - - // Test basic soft-deleted member logic in polymorphic classes. - // - #pragma db namespace table("t9_") - namespace test9 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - std::string dstr; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::bstr) deleted(3) - #pragma db member(object::dstr) deleted(3) -#endif - } - - // Test soft-deleted section member in polymorphic classes. - // - #pragma db namespace table("t10_") - namespace test10 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - #pragma db section(s) - std::string dstr; - - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::s) deleted(3) -#endif - } - - // Test soft-deleted members of a section in polymorphic classes. - // - #pragma db namespace table("t11_") - namespace test11 - { - #pragma db object polymorphic - struct base - { - virtual - ~base () {} - base (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - std::string bstr; - }; - - #pragma db object - struct object: base - { - object (unsigned long id = 0): base (id) {} - - #pragma db section(s) - std::string dstr; - - #pragma db section(s) - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(base::bstr) deleted(3) - #pragma db member(object::dstr) deleted(3) -#endif - } - - // Test soft-deleted member and optimistic concurrency. - // - #pragma db namespace table("t12_") - namespace test12 - { - #pragma db object optimistic - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db version mssql:type("ROWVERSION") - unsigned long long v_; - - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) -#endif - } - - // Test soft-deleted member in an object without id. - // - #pragma db namespace table("t13_") - namespace test13 - { - #pragma db object no_id - struct object - { - std::string str; - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) -#endif - } - - // Test soft-deleted member in an object with auto id. - // - #pragma db namespace table("t14_") - namespace test14 - { - #pragma db object - struct object - { - std::string str; - unsigned long num; - - #pragma db id auto - unsigned long id; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::str) deleted(3) -#endif - } - - // Test summarily deleted composite values. - // - #pragma db namespace table("t15_") - namespace test15 - { - #pragma db value - struct value - { - std::string str; - odb::vector vec; - }; - - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - -#ifdef HAVE_CXX11 - std::unique_ptr v; -#else - std::auto_ptr v; -#endif - unsigned long num; - }; - -#if MODEL_VERSION == 3 - #pragma db member(value::str) deleted(3) - #pragma db member(value::vec) deleted(3) -#endif - } - - // Test soft-deleted container member in a non-versioned object. - // - #pragma db namespace table("t21_") - namespace test21 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - unsigned long num; - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::vec) deleted(3) -#endif - } - - // Test soft-deleted container member in a non-versioned section. - // - #pragma db namespace table("t22_") - namespace test22 - { - #pragma db object - struct object - { - object (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db load(lazy) update(change) - odb::section s; - - #pragma db section(s) - unsigned long num; - - #pragma db section(s) - odb::vector vec; - }; - -#if MODEL_VERSION == 3 - #pragma db member(object::vec) deleted(3) -#endif - } -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/soft-delete/test1.hxx b/evolution/soft-delete/test1.hxx deleted file mode 100644 index d4df90f..0000000 --- a/evolution/soft-delete/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/soft-delete/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/soft-delete/test2.hxx b/evolution/soft-delete/test2.hxx deleted file mode 100644 index 3b2b5b4..0000000 --- a/evolution/soft-delete/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/soft-delete/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/soft-delete/test3.hxx b/evolution/soft-delete/test3.hxx deleted file mode 100644 index 5a90ab2..0000000 --- a/evolution/soft-delete/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/soft-delete/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/template/driver.cxx b/evolution/template/driver.cxx deleted file mode 100644 index b278acd..0000000 --- a/evolution/template/driver.cxx +++ /dev/null @@ -1,124 +0,0 @@ -// file : evolution/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - schema_catalog::create_schema (*db, "", false); - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - { - transaction t (db->begin ()); - dummy d (1); - db->persist (d); - t.commit (); - } - break; - } - case 2: - { - using namespace v3; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - } - break; - } - case 3: - { - using namespace v3; - - object o; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - t.commit (); - } - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/template/model.hxx b/evolution/template/model.hxx deleted file mode 100644 index 182c81f..0000000 --- a/evolution/template/model.hxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : evolution/template/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ -#if MODEL_VERSION == 3 - #pragma db object - struct object - { - #pragma db id auto - unsigned long id_; - }; -#endif - - // The presence of this object makes sure that there are no empty - // changesets and we get the complete set of migration files. - // - #pragma db object - struct dummy - { - dummy (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - }; -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/template/template-vc10.vcxproj b/evolution/template/template-vc10.vcxproj deleted file mode 100644 index c0ebe18..0000000 --- a/evolution/template/template-vc10.vcxproj +++ /dev/null @@ -1,196 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test1.hxx, -odb test1.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, -test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, -model.hxx) -__custom_build_entry__( -test2.hxx, -odb test2.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, -test1-odb.hxx;model.hxx) -__custom_build_entry__( -test3.hxx, -odb test3.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, -test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, -test2-odb.hxx;model.hxx) - - -__header_entry__(test1-odb.hxx) -__header_entry__(test1-odb.ixx) -__header_entry__(test2-odb.hxx) -__header_entry__(test2-odb.ixx) -__header_entry__(test3-odb.hxx) -__header_entry__(test3-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test1-odb.cxx) -__source_entry__(test2-odb.cxx) -__source_entry__(test3-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/evolution/template/template-vc10.vcxproj.filters b/evolution/template/template-vc10.vcxproj.filters deleted file mode 100644 index d6ac66e..0000000 --- a/evolution/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__header_filter_entry__(test1.hxx) -__header_filter_entry__(test1-odb.hxx) -__header_filter_entry__(test1-odb.ixx) -__header_filter_entry__(test2.hxx) -__header_filter_entry__(test2-odb.hxx) -__header_filter_entry__(test2-odb.ixx) -__header_filter_entry__(test3.hxx) -__header_filter_entry__(test3-odb.hxx) -__header_filter_entry__(test3-odb.ixx) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__source_filter_entry__(test1-odb.cxx) -__source_filter_entry__(test2-odb.cxx) -__source_filter_entry__(test3-odb.cxx) -__source_filter_entries__(extra_sources) - - diff --git a/evolution/template/template-vc11.vcxproj b/evolution/template/template-vc11.vcxproj deleted file mode 100644 index f51fd0c..0000000 --- a/evolution/template/template-vc11.vcxproj +++ /dev/null @@ -1,200 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test1.hxx, -odb test1.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, -test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, -model.hxx) -__custom_build_entry__( -test2.hxx, -odb test2.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, -test1-odb.hxx;model.hxx) -__custom_build_entry__( -test3.hxx, -odb test3.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, -test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, -test2-odb.hxx;model.hxx) - - -__header_entry__(test1-odb.hxx) -__header_entry__(test1-odb.ixx) -__header_entry__(test2-odb.hxx) -__header_entry__(test2-odb.ixx) -__header_entry__(test3-odb.hxx) -__header_entry__(test3-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test1-odb.cxx) -__source_entry__(test2-odb.cxx) -__source_entry__(test3-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/evolution/template/template-vc11.vcxproj.filters b/evolution/template/template-vc11.vcxproj.filters deleted file mode 100644 index d6ac66e..0000000 --- a/evolution/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__header_filter_entry__(test1.hxx) -__header_filter_entry__(test1-odb.hxx) -__header_filter_entry__(test1-odb.ixx) -__header_filter_entry__(test2.hxx) -__header_filter_entry__(test2-odb.hxx) -__header_filter_entry__(test2-odb.ixx) -__header_filter_entry__(test3.hxx) -__header_filter_entry__(test3-odb.hxx) -__header_filter_entry__(test3-odb.ixx) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__source_filter_entry__(test1-odb.cxx) -__source_filter_entry__(test2-odb.cxx) -__source_filter_entry__(test3-odb.cxx) -__source_filter_entries__(extra_sources) - - diff --git a/evolution/template/template-vc12.vcxproj b/evolution/template/template-vc12.vcxproj deleted file mode 100644 index 9562323..0000000 --- a/evolution/template/template-vc12.vcxproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test1.hxx, -odb test1.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, -test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, -model.hxx) -__custom_build_entry__( -test2.hxx, -odb test2.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, -test1-odb.hxx;model.hxx) -__custom_build_entry__( -test3.hxx, -odb test3.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, -test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, -test2-odb.hxx;model.hxx) - - -__header_entry__(test1-odb.hxx) -__header_entry__(test1-odb.ixx) -__header_entry__(test2-odb.hxx) -__header_entry__(test2-odb.ixx) -__header_entry__(test3-odb.hxx) -__header_entry__(test3-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test1-odb.cxx) -__source_entry__(test2-odb.cxx) -__source_entry__(test3-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/evolution/template/template-vc12.vcxproj.filters b/evolution/template/template-vc12.vcxproj.filters deleted file mode 100644 index d6ac66e..0000000 --- a/evolution/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,32 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__header_filter_entry__(test1.hxx) -__header_filter_entry__(test1-odb.hxx) -__header_filter_entry__(test1-odb.ixx) -__header_filter_entry__(test2.hxx) -__header_filter_entry__(test2-odb.hxx) -__header_filter_entry__(test2-odb.ixx) -__header_filter_entry__(test3.hxx) -__header_filter_entry__(test3-odb.hxx) -__header_filter_entry__(test3-odb.ixx) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__source_filter_entry__(test1-odb.cxx) -__source_filter_entry__(test2-odb.cxx) -__source_filter_entry__(test3-odb.cxx) -__source_filter_entries__(extra_sources) - - diff --git a/evolution/template/template-vc8.vcproj b/evolution/template/template-vc8.vcproj deleted file mode 100644 index d6c5f15..0000000 --- a/evolution/template/template-vc8.vcproj +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test1-odb.cxx) -__source_entry__(test2-odb.cxx) -__source_entry__(test3-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test1.hxx, -odb test1.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, -test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, -model.hxx) -__file_entry__(test1-odb.hxx) -__file_entry__(test1-odb.ixx) -__file_entry_custom_build__( -test2.hxx, -odb test2.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, -test1-odb.hxx;model.hxx) -__file_entry__(test2-odb.hxx) -__file_entry__(test2-odb.ixx) -__file_entry_custom_build__( -test3.hxx, -odb test3.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, -test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, -test2-odb.hxx;model.hxx) -__file_entry__(test3-odb.hxx) -__file_entry__(test3-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/evolution/template/template-vc9.vcproj b/evolution/template/template-vc9.vcproj deleted file mode 100644 index 9177928..0000000 --- a/evolution/template/template-vc9.vcproj +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test1-odb.cxx) -__source_entry__(test2-odb.cxx) -__source_entry__(test3-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test1.hxx, -odb test1.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, -test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, -model.hxx) -__file_entry__(test1-odb.hxx) -__file_entry__(test1-odb.ixx) -__file_entry_custom_build__( -test2.hxx, -odb test2.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, -test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, -test1-odb.hxx;model.hxx) -__file_entry__(test2-odb.hxx) -__file_entry__(test2-odb.ixx) -__file_entry_custom_build__( -test3.hxx, -odb test3.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, -test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, -test2-odb.hxx;model.hxx) -__file_entry__(test3-odb.hxx) -__file_entry__(test3-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/evolution/template/test1.hxx b/evolution/template/test1.hxx deleted file mode 100644 index 238b686..0000000 --- a/evolution/template/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/template/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/template/test2.hxx b/evolution/template/test2.hxx deleted file mode 100644 index ec982f5..0000000 --- a/evolution/template/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/template/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/template/test3.hxx b/evolution/template/test3.hxx deleted file mode 100644 index 50f3882..0000000 --- a/evolution/template/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/template/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/evolution/version/driver.cxx b/evolution/version/driver.cxx deleted file mode 100644 index 236c9b4..0000000 --- a/evolution/version/driver.cxx +++ /dev/null @@ -1,156 +0,0 @@ -// file : evolution/version/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test schema version access via the database instance. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include // DATABASE_XXX -#include - -#include "test2.hxx" -#include "test3.hxx" -#include "test2-odb.hxx" -#include "test3-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv, false)); - bool embedded (schema_catalog::exists (*db)); - - // 1 - base version - // 2 - migration - // 3 - current version - // - unsigned short pass (*argv[argc - 1] - '0'); - - switch (pass) - { - case 1: - { - using namespace v2; - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::drop_schema (*db); - - assert (db->schema_version () == 0); - - schema_catalog::create_schema (*db, "", false); - - assert (db->schema_version () == 1 && !db->schema_migration ()); - - schema_catalog::migrate_schema (*db, 2); - t.commit (); - } - - assert (db->schema_version () == 2 && !db->schema_migration ()); - - { - transaction t (db->begin ()); - object1 o1 (1); - o1.num = 123; - db->persist (o1); - t.commit (); - } - break; - } - case 2: - { - using namespace v2; - using namespace v3; - - if (embedded) - { - assert (db->schema_version () == 2 && !db->schema_migration ()); - - transaction t (db->begin ()); - schema_catalog::migrate_schema_pre (*db, 3); - t.commit (); - } - - assert (db->schema_version () == 3 && db->schema_migration ()); - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - object2 o2 (1); - o2.num = o1->num; - db->persist (o2); - t.commit (); - } - - if (embedded) - { - transaction t (db->begin ()); - schema_catalog::migrate_schema_post (*db, 3); - t.commit (); - - assert (db->schema_version () == 3 && !db->schema_migration ()); - } - break; - } - case 3: - { - using namespace v3; - - // In transaction. - // - { - transaction t (db->begin ()); - assert (db->schema_version () == 3 && !db->schema_migration ()); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr o2 (db->load (1)); - assert (o2->num == 123); - t.commit (); - } - - // Test the case where there is still no version table. - // - db->schema_version_migration (0, false); - - { - transaction t (db->begin ()); - -#ifdef DATABASE_ORACLE - db->execute ("DROP TABLE \"schema_version\""); -#else - db->execute ("DROP TABLE schema_version"); -#endif - t.commit (); - } - - assert (db->schema_version () == 0); - break; - } - default: - { - cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; - return 1; - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/evolution/version/model.hxx b/evolution/version/model.hxx deleted file mode 100644 index cdda00e..0000000 --- a/evolution/version/model.hxx +++ /dev/null @@ -1,45 +0,0 @@ -// file : evolution/version/model.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef MODEL_VERSION -# error model.hxx included directly -#endif - -#include - -#pragma db model version(1, MODEL_VERSION) - -#define MODEL_NAMESPACE_IMPL(V) v##V -#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) - -namespace MODEL_NAMESPACE(MODEL_VERSION) -{ -#if MODEL_VERSION == 2 - #pragma db object - struct object1 - { - object1 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif - -#if MODEL_VERSION == 3 - #pragma db object - struct object2 - { - object2 (unsigned long id = 0): id_ (id) {} - - #pragma db id - unsigned long id_; - - int num; - }; -#endif -} - -#undef MODEL_NAMESPACE -#undef MODEL_NAMESPACE_IMPL diff --git a/evolution/version/test1.hxx b/evolution/version/test1.hxx deleted file mode 100644 index a50e54c..0000000 --- a/evolution/version/test1.hxx +++ /dev/null @@ -1,9 +0,0 @@ -// file : evolution/version/test1.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST1_HXX -#define TEST1_HXX - -#pragma db model version(1, 1) - -#endif // TEST1_HXX diff --git a/evolution/version/test2.hxx b/evolution/version/test2.hxx deleted file mode 100644 index f7fc1b7..0000000 --- a/evolution/version/test2.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/version/test2.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST2_HXX -#define TEST2_HXX - -#define MODEL_VERSION 2 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST2_HXX diff --git a/evolution/version/test3.hxx b/evolution/version/test3.hxx deleted file mode 100644 index 364ee31..0000000 --- a/evolution/version/test3.hxx +++ /dev/null @@ -1,11 +0,0 @@ -// file : evolution/version/test3.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST3_HXX -#define TEST3_HXX - -#define MODEL_VERSION 3 -#include "model.hxx" -#undef MODEL_VERSION - -#endif // TEST3_HXX diff --git a/libcommon/.gitignore b/libcommon/.gitignore deleted file mode 100644 index a994ddc..0000000 --- a/libcommon/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Generated config header. -# -config.hxx diff --git a/libcommon/buffer.hxx b/libcommon/buffer.hxx deleted file mode 100644 index 41b7e46..0000000 --- a/libcommon/buffer.hxx +++ /dev/null @@ -1,104 +0,0 @@ -// file : libcommon/buffer.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_BUFFER_HXX -#define LIBCOMMON_BUFFER_HXX - -#include -#include // std::size_t -#include // std::{memcmp,memcpy} - -struct basic_buffer_base -{ - ~basic_buffer_base () - { - operator delete (data_); - } - - basic_buffer_base () - : data_ (0), size_ (0) - { - } - - basic_buffer_base (const void* data, std::size_t size) - : data_ (0), size_ (size) - { - data_ = operator new (size_); - std::memcpy (data_, data, size_); - } - - basic_buffer_base (const basic_buffer_base& y) - : data_ (0), size_ (0) - { - assign (y.data_, y.size_); - } - - basic_buffer_base& - operator= (const basic_buffer_base& y) - { - if (this != &y) - assign (y.data_, y.size_); - - return *this; - } - - void - assign (const void* data, std::size_t size) - { - if (size_ < size) - { - void *p (operator new (size)); - operator delete (data_); - data_ = p; - } - - std::memcpy (data_, data, size); - size_ = size; - } - - std::size_t - size () const - { - return size_; - } - - bool - operator== (const basic_buffer_base& y) const - { - return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; - } - -protected: - void* data_; - std::size_t size_; -}; - -template -struct basic_buffer: basic_buffer_base -{ - basic_buffer () - { - } - - basic_buffer (const T* data, std::size_t size) - : basic_buffer_base (data, size) - { - } - - T* - data () - { - return static_cast (data_); - } - - const T* - data () const - { - return static_cast (data_); - } -}; - -typedef basic_buffer buffer; -typedef basic_buffer ubuffer; - -#endif // LIBCOMMON_BUFFER_HXX diff --git a/libcommon/buildfile b/libcommon/buildfile deleted file mode 100644 index eb61455..0000000 --- a/libcommon/buildfile +++ /dev/null @@ -1,50 +0,0 @@ -# file : libcommon/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -import intf_libs = libodb%lib{odb} - -for db: $databases - import intf_libs += libodb-$db%lib{odb-$db} - -lib{common}: {hxx ixx txx cxx}{** -config} hxx{config} $intf_libs - -# Generated config file. -# -using autoconf - -hxx{config}: in{config} -{ - DATABASE_MYSQL = $mysql - DATABASE_SQLITE = $sqlite - DATABASE_PGSQL = $pgsql - DATABASE_ORACLE = $oracle - DATABASE_MSSQL = $mssql - MULTI_DATABASE = $multi -} - -# Build options. -# -cxx.poptions =+ "-I$out_root" "-I$src_root" - -{hbmia obja}{*}: cxx.poptions += -DLIBCOMMON_STATIC_BUILD -{hbmis objs}{*}: cxx.poptions += -DLIBCOMMON_SHARED_BUILD - -# Export options. -# -lib{common}: -{ - cxx.export.poptions = "-I$out_root" "-I$src_root" - cxx.export.libs = $intf_libs -} - -liba{common}: cxx.export.poptions += -DLIBCOMMON_STATIC -libs{common}: cxx.export.poptions += -DLIBCOMMON_SHARED - -# For pre-releases use the complete version to make sure they cannot -# be used in place of another pre-release or the final version. See -# the version module for details on the version.* variable values. -# -if $version.pre_release - lib{common}: bin.lib.version = "-$version.project_id" -else - lib{common}: bin.lib.version = "-$version.major.$version.minor" diff --git a/libcommon/common.cxx b/libcommon/common.cxx deleted file mode 100644 index b3e4cfd..0000000 --- a/libcommon/common.cxx +++ /dev/null @@ -1,355 +0,0 @@ -// file : libcommon/common.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include // std::exit -#include // std::move -#include - -#include - -#include -#include - -using namespace std; -using namespace odb::core; - - -// MySQL. -// -#if defined(DATABASE_MYSQL) - -#include -#include - -static unique_ptr -create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace mysql = odb::mysql; - - unique_ptr f; - - if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); - - return unique_ptr ( - new mysql::database (argc, argv, false, "", 0, move (f))); -} -#endif // MySQL - - -// SQLite. -// -#if defined(DATABASE_SQLITE) - -#include -#include -#include -#include -#include - -static unique_ptr -create_sqlite_database (int& argc, - char* argv[], - bool schema, - size_t max_connections) -{ - namespace sqlite = odb::sqlite; - - unique_ptr f; - - if (max_connections != 0) - f.reset (new sqlite::connection_pool_factory (max_connections)); - - unique_ptr db ( - new sqlite::database ( - argc, argv, false, - SQLITE_OPEN_READWRITE - | SQLITE_OPEN_CREATE -#ifdef SQLITE_OPEN_URI - | SQLITE_OPEN_URI -#endif - , - true, - "", - move (f))); - - // Create the database schema. Due to bugs in SQLite foreign key - // support for DDL statements, we need to temporarily disable - // foreign keys. - // - if (schema) - { - connection_ptr c (db->connection ()); - - c->execute ("PRAGMA foreign_keys=OFF"); - - transaction t (c->begin ()); - schema_catalog::create_schema (*db); - t.commit (); - - c->execute ("PRAGMA foreign_keys=ON"); - } - - return db; -} -#endif // SQLite - - -// PostgreSQL. -// -#if defined(DATABASE_PGSQL) - -#include -#include - -static unique_ptr -create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace pgsql = odb::pgsql; - - unique_ptr f; - - if (max_connections != 0) - f.reset (new pgsql::connection_pool_factory (max_connections)); - - return unique_ptr ( - new pgsql::database (argc, argv, false, "", move (f))); -} -#endif // PostgreSQL - - -// Oracle. -// -#if defined(DATABASE_ORACLE) - -#include -#include - -static unique_ptr -create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace oracle = odb::oracle; - - unique_ptr f; - - if (max_connections != 0) - f.reset (new oracle::connection_pool_factory (max_connections)); - - // Set client database character set and client national character set - // to UTF-8. - // - return unique_ptr ( - new oracle::database (argc, argv, false, 873, 873, 0, move (f))); -} -#endif // Oracle - -// SQL Server. -// -#if defined(DATABASE_MSSQL) - -#include -#include - -static unique_ptr -create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) -{ - namespace mssql = odb::mssql; - - unique_ptr f; - - if (max_connections != 0) - f.reset (new mssql::connection_pool_factory (max_connections)); - - return unique_ptr ( - new mssql::database (argc, argv, false, "", - mssql::isolation_read_committed, 0, move (f))); -} -#endif // SQL Server - -// -// -unique_ptr -create_database (int argc, - char* argv[], - bool schema, - size_t max_connections, -#if defined(MULTI_DATABASE) - odb::database_id db -#else - odb::database_id -#endif -) -{ - char** argp = argv + 1; // Position of the next argument. Assignment for VC8. - int argn (argc - 1); // Number of arguments left. - -#if defined(MULTI_DATABASE) - // Figure out which database we are creating. We may be given the - // database name as a program argument or as an id. - // - if (db == odb::id_common && argn != 0) - { - string s (*argp); - - if (s == "mysql") - db = odb::id_mysql; - else if (s == "sqlite") - db = odb::id_sqlite; - else if (s == "pgsql") - db = odb::id_pgsql; - else if (s == "oracle") - db = odb::id_oracle; - else if (s == "mssql") - db = odb::id_mssql; - - if (db != odb::id_common) - { - argp++; - argn--; - } - } - - if (db == odb::id_common) - { - cerr << "Usage: " << argv[0] << " [options]" << endl; - exit (1); - } -#endif - - if (argn != 0 && *argp == string ("--help")) - { -#if defined(MULTI_DATABASE) - cout << "Usage: " << argv[0] << " [options]" << endl; -#else - cout << "Usage: " << argv[0] << " [options]" << endl; -#endif - - cout << "Options:" << endl; - -#if defined(MULTI_DATABASE) - switch (db) - { - case odb::id_mysql: -#if defined(DATABASE_MYSQL) - odb::mysql::database::print_usage (cout); -#else - assert (false); -#endif - break; - case odb::id_sqlite: -#if defined(DATABASE_SQLITE) - odb::sqlite::database::print_usage (cout); -#else - assert (false); -#endif - break; - case odb::id_pgsql: -#if defined(DATABASE_PGSQL) - odb::pgsql::database::print_usage (cout); -#else - assert (false); -#endif - break; - case odb::id_oracle: -#if defined(DATABASE_ORACLE) - odb::oracle::database::print_usage (cout); -#else - assert (false); -#endif - break; - case odb::id_mssql: -#if defined(DATABASE_MSSQL) - odb::mssql::database::print_usage (cout); -#else - assert (false); -#endif - break; - case odb::id_common: - assert (false); - } -#elif defined(DATABASE_MYSQL) - odb::mysql::database::print_usage (cout); -#elif defined(DATABASE_SQLITE) - odb::sqlite::database::print_usage (cout); -#elif defined(DATABASE_PGSQL) - odb::pgsql::database::print_usage (cout); -#elif defined(DATABASE_ORACLE) - odb::oracle::database::print_usage (cout); -#elif defined(DATABASE_MSSQL) - odb::mssql::database::print_usage (cout); -#else -# error unknown database -#endif - - exit (0); - } - -#if defined(MULTI_DATABASE) - switch (db) - { - case odb::id_mysql: -#if defined(DATABASE_MYSQL) - return create_mysql_database (argc, argv, schema, max_connections); -#else - assert (false); - break; -#endif - case odb::id_sqlite: -#if defined(DATABASE_SQLITE) - return create_sqlite_database (argc, argv, schema, max_connections); -#else - assert (false); - break; -#endif - case odb::id_pgsql: -#if defined(DATABASE_PGSQL) - return create_pgsql_database (argc, argv, schema, max_connections); -#else - assert (false); - break; -#endif - case odb::id_oracle: -#if defined(DATABASE_ORACLE) - return create_oracle_database (argc, argv, schema, max_connections); -#else - assert (false); - break; -#endif - case odb::id_mssql: -#if defined(DATABASE_MSSQL) - return create_mssql_database (argc, argv, schema, max_connections); -#else - assert (false); - break; -#endif - case odb::id_common: - assert (false); - } - return unique_ptr (); -#elif defined(DATABASE_MYSQL) - return create_mysql_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_SQLITE) - return create_sqlite_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_PGSQL) - return create_pgsql_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_ORACLE) - return create_oracle_database (argc, argv, schema, max_connections); -#elif defined(DATABASE_MSSQL) - return create_mssql_database (argc, argv, schema, max_connections); -#else -# error unknown database -#endif -} - -bool -size_available () -{ -#if defined(MULTI_DATABASE) || \ - defined(DATABASE_SQLITE) || \ - defined(DATABASE_ORACLE) || \ - defined(DATABASE_MSSQL) - return false; -#else - return true; -#endif -} diff --git a/libcommon/common.hxx b/libcommon/common.hxx deleted file mode 100644 index 9ab978d..0000000 --- a/libcommon/common.hxx +++ /dev/null @@ -1,47 +0,0 @@ -// file : libcommon/common.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_COMMON_HXX -#define LIBCOMMON_COMMON_HXX - -#include // std::unique_ptr -#include // std::size_t - -#include -#include - -#include - -LIBCOMMON_SYMEXPORT std::unique_ptr -create_database (int argc, - char* argv[], - bool create_schema = true, - std::size_t max_connections = 0, - odb::database_id db = odb::id_common); - -template -std::unique_ptr -create_specific_database (int argc, - char* argv[], - bool create_schema = true, - std::size_t max_connections = 0) -{ - std::unique_ptr r ( - create_database (argc, argv, - create_schema, - max_connections, - T::database_id)); - - return std::unique_ptr (&dynamic_cast (*r.release ())); -} - -// This function returns an accurate result only if the result iterator -// hasn't been advanced and after the call the result is no longer valid. -// -template -std::size_t -size (odb::result); - -#include - -#endif // LIBCOMMON_COMMON_HXX diff --git a/libcommon/common.txx b/libcommon/common.txx deleted file mode 100644 index caa7481..0000000 --- a/libcommon/common.txx +++ /dev/null @@ -1,24 +0,0 @@ -// file : libcommon/common.txx -// license : GNU GPL v2; see accompanying LICENSE file - -// We have to use this helper function instead of just checking which -// database is used because the DATABASE_* macro may not be defined -// in a project that includes this header. -// -LIBCOMMON_SYMEXPORT bool -size_available (); - -template -std::size_t -size (odb::result r) -{ - if (size_available ()) - return r.size (); - else - { - std::size_t n (0); - for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) - n++; - return n; - } -} diff --git a/libcommon/concrete.hxx b/libcommon/concrete.hxx deleted file mode 100644 index e0f64a5..0000000 --- a/libcommon/concrete.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : libcommon/concrete.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_CONCRETE_HXX -#define LIBCOMMON_CONCRETE_HXX - -#include - -// Namespace alias for the concrete database namespace. -// -#if defined(MULTI_DATABASE) - -// Fallback to common interface. -// -#include -#include - -namespace odb_db = odb; - -#elif defined(DATABASE_MYSQL) - -#include -#include - -namespace odb_db = odb::mysql; - -#elif defined(DATABASE_SQLITE) - -#include -#include - -namespace odb_db = odb::sqlite; - -#elif defined(DATABASE_PGSQL) - -#include -#include - -namespace odb_db = odb::pgsql; - -#elif defined(DATABASE_ORACLE) - -#include -#include - -namespace odb_db = odb::oracle; - -#elif defined(DATABASE_MSSQL) - -#include -#include - -namespace odb_db = odb::mssql; - -#endif - -#endif // LIBCOMMON_CONCRETE_HXX diff --git a/libcommon/config.hxx.in b/libcommon/config.hxx.in deleted file mode 100644 index ff90e61..0000000 --- a/libcommon/config.hxx.in +++ /dev/null @@ -1,14 +0,0 @@ -// file : libcommon/config.hxx.in -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef LIBCOMMON_CONFIG_HXX -#define LIBCOMMON_CONFIG_HXX - -#undef DATABASE_MYSQL -#undef DATABASE_SQLITE -#undef DATABASE_PGSQL -#undef DATABASE_ORACLE -#undef DATABASE_MSSQL -#undef MULTI_DATABASE - -#endif // LIBCOMMON_CONFIG_HXX diff --git a/libcommon/export.hxx b/libcommon/export.hxx deleted file mode 100644 index 0de4565..0000000 --- a/libcommon/export.hxx +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -// Normally we don't export class templates (but do complete specializations), -// inline functions, and classes with only inline member functions. Exporting -// classes that inherit from non-exported/imported bases (e.g., std::string) -// will end up badly. The only known workarounds are to not inherit or to not -// export. Also, MinGW GCC doesn't like seeing non-exported functions being -// used before their inline definition. The workaround is to reorder code. In -// the end it's all trial and error. - -#if defined(LIBCOMMON_STATIC) // Using static. -# define LIBCOMMON_SYMEXPORT -#elif defined(LIBCOMMON_STATIC_BUILD) // Building static. -# define LIBCOMMON_SYMEXPORT -#elif defined(LIBCOMMON_SHARED) // Using shared. -# ifdef _WIN32 -# define LIBCOMMON_SYMEXPORT __declspec(dllimport) -# else -# define LIBCOMMON_SYMEXPORT -# endif -#elif defined(LIBCOMMON_SHARED_BUILD) // Building shared. -# ifdef _WIN32 -# define LIBCOMMON_SYMEXPORT __declspec(dllexport) -# else -# define LIBCOMMON_SYMEXPORT -# endif -#else -// If none of the above macros are defined, then we assume we are being used -// by some third-party build system that cannot/doesn't signal the library -// type. Note that this fallback works for both static and shared libraries -// provided the library only exports functions (in other words, no global -// exported data) and for the shared case the result will be sub-optimal -// compared to having dllimport. If, however, your library does export data, -// then you will probably want to replace the fallback with the (commented -// out) error since it won't work for the shared case. -// -# define LIBCOMMON_SYMEXPORT // Using static or shared. -//# error define LIBCOMMON_STATIC or LIBCOMMON_SHARED preprocessor macro to signal libcommon library type being linked -#endif diff --git a/manifest b/manifest deleted file mode 100644 index 858baa7..0000000 --- a/manifest +++ /dev/null @@ -1,48 +0,0 @@ -: 1 -name: odb-tests -version: 2.5.0-b.26.z -project: odb -type: tests -language: c++ -summary: ODB compiler tests -license: GPL-2.0-only -description-file: README.md -url: https://www.codesynthesis.com/products/odb/ -doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml -src-url: https://git.codesynthesis.com/cgit/odb/odb/ -email: odb-users@codesynthesis.com ; Mailing list - -# @@ BUILD2 The odb dependency can only be built with GCC. However, shouldn't -# we test that the odb-generated mappings can be compiled by other -# compilers and properly run afterwards? -# -builds: default -builds: -( +windows -gcc ) ; Requires MinGW GCC. -builds: &gcc ; Requires GCC with plugin support enabled. -builds: &gcc-5+ ; Requires GCC 5 or later. -builds: -static ; Implementation uses plugins and requires -fPIC. - -depends: * build2 >= 0.16.0 -depends: * bpkg >= 0.16.0 - -depends: * odb [2.5.0-b.26.1 2.5.0-b.27) - -depends: libodb [2.5.0-b.26.1 2.5.0-b.27) -depends: libodb-mysql [2.5.0-b.26.1 2.5.0-b.27) ? ($mysql) -depends: libodb-sqlite [2.5.0-b.26.1 2.5.0-b.27) ? ($sqlite) -depends: libodb-pgsql [2.5.0-b.26.1 2.5.0-b.27) ? ($pgsql) -depends: libodb-oracle [2.5.0-b.26.1 2.5.0-b.27) ? ($oracle) -depends: libodb-mssql [2.5.0-b.26.1 2.5.0-b.27) ? ($mssql) - -# Reflect whether libodb-pgsql is likely to support bulk operations. This is -# normally the case on POSIX platforms if libodb-pgsql is linked against libpq -# of the version 14 or above. -# -depends: libpq >= 14.0.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=true | \ - libpq >= 7.4.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=false - -# @@ TODO/LATER: use an alternative to automatically detect whether we are -# using MySQL or MariaDB? But maybe we don't need to know? - -depends: mysql >= 5.0.3 ? ($mysql) -depends: psql >= 7.4.0 ? ($pgsql) diff --git a/mssql/custom/custom.sql b/mssql/custom/custom.sql deleted file mode 100644 index 44ef512..0000000 --- a/mssql/custom/custom.sql +++ /dev/null @@ -1,42 +0,0 @@ -/* This file contains helper functions. - */ - -IF OBJECT_ID('dbo.variant_to_string', 'FN') IS NOT NULL - DROP FUNCTION dbo.variant_to_string; -GO - -IF OBJECT_ID('dbo.string_to_variant', 'FN') IS NOT NULL - DROP FUNCTION dbo.string_to_variant; -GO - -CREATE FUNCTION dbo.variant_to_string (@val SQL_VARIANT) RETURNS VARCHAR(max) -AS -BEGIN - RETURN CAST(SQL_VARIANT_PROPERTY(@val, 'BaseType') AS SYSNAME) + ' ' + - CAST(@val AS VARCHAR(max)) -END; -GO - -CREATE FUNCTION dbo.string_to_variant (@val VARCHAR(max)) RETURNS SQL_VARIANT -AS -BEGIN - DECLARE @ret SQL_VARIANT - - DECLARE @pos BIGINT - DECLARE @vtype SYSNAME - DECLARE @vtext VARCHAR(max) - - SET @pos = CHARINDEX(' ', @val) - SET @vtype = SUBSTRING(@val, 1, @pos - 1) - SET @vtext = SUBSTRING(@val, @pos + 1, LEN(@val)) - - IF @vtype = 'tinyint' SET @ret = CAST(@vtext AS TINYINT) - ELSE IF @vtype = 'smallint' SET @ret = CAST(@vtext AS SMALLINT) - ELSE IF @vtype = 'int' SET @ret = CAST(@vtext AS INT) - ELSE IF @vtype = 'bigint' SET @ret = CAST(@vtext AS BIGINT) - ELSE IF @vtype = 'char' SET @ret = CAST(@vtext AS CHAR(8000)) - ELSE IF @vtype = 'varchar' SET @ret = CAST(@vtext AS VARCHAR(8000)) - - RETURN @ret -END; -GO diff --git a/mssql/custom/driver.cxx b/mssql/custom/driver.cxx deleted file mode 100644 index bde7eb6..0000000 --- a/mssql/custom/driver.cxx +++ /dev/null @@ -1,135 +0,0 @@ -// file : mssql/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom database type mapping in SQL Server. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - object o (1); - - o.v = variant (123); - o.vv.push_back (variant (string (1024, 'a'))); - o.vv.push_back (variant (123)); - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.p = point (1.1111, 2222222222.2); - o.pv.push_back (point (1.1234, 2.2345)); - o.pv.push_back (point (3.3456, 4.4567)); - o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. -#endif - - o.xml = "AAABBBCCC"; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Query. - // - typedef mssql::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - // Variant comparison. - // - { - result r (db->query (query::v == o.v)); - assert (!r.empty ()); - } - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - // Point comparison. - // - { - result r (db->query (query::p == o.p)); - assert (!r.empty ()); - } - - // Point comparison using native query. - // - { - result r (db->query ( - query::p + ".STEquals(" + query::_val (o.p) + ") = 1")); - assert (!r.empty ()); - } - - // Access to individual members. - // - { - result r (db->query (query::p.x == o.p.x)); - assert (!r.empty ()); - } -#endif - - t.commit (); - } - - // Update. - // -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.p.x++; - o.p.y--; - o.pv[1].x--; - o.pv[1].y++; -#endif - - o.xml = "BBBCCCDDD"; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/custom/query.hxx b/mssql/custom/query.hxx deleted file mode 100644 index fc63378..0000000 --- a/mssql/custom/query.hxx +++ /dev/null @@ -1,183 +0,0 @@ -// file : mssql/custom/query.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef QUERY_HXX -#define QUERY_HXX - -#include - -#include - -#include "test.hxx" // point - -namespace odb -{ - namespace mssql - { -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - template <> - struct query_column - { - private: - const char* table_; - const char* column_; - const char* conversion_; - - unsigned short prec_; - unsigned short scale_; - - std::string x_column_; - std::string y_column_; - - // Sub-columns for individual members. - // - public: - query_column x, y; - - // is_null, is_not_null - // - public: - query_base - is_null () const - { - query_base q (table_, column_); - q += "IS NULL"; - return q; - } - - query_base - is_not_null () const - { - query_base q (table_, column_); - q += "IS NOT NULL"; - return q; - } - - // = - // - public: - query_base - equal (const point& v) const - { - return equal (val_bind (v)); - } - - query_base - equal (val_bind v) const - { - query_base q (table_, column_); - q += ".STEquals("; - q.append (v, conversion_); - q += ") = 1"; - return q; - } - - query_base - equal (ref_bind r) const - { - query_base q (table_, column_); - q += ".STEquals("; - q.append (r, conversion_); - q += ") = 1"; - return q; - } - - friend query_base - operator== (const query_column& c, const point& v) - { - return c.equal (v); - } - - friend query_base - operator== (const point& v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, val_bind v) - { - return c.equal (v); - } - - friend query_base - operator== (val_bind v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, ref_bind r) - { - return c.equal (r); - } - - friend query_base - operator== (ref_bind r, const query_column& c) - { - return c.equal (r); - } - - // Column comparison. - // - public: - query_base - operator== (const query_column& c) const - { - query_base q (table_, column_); - q += ".STEquals("; - q.append (c.table (), c.column ()); - q += ") = 1"; - return q; - } - - public: - query_column (const char* table, - const char* column, - const char* conv, - unsigned short prec = 0, - unsigned short scale = 0xFFFF) - : table_ (table), column_ (column), conversion_ (conv), - prec_ (prec), scale_ (scale), - x_column_ (std::string (column) + ".STX"), - y_column_ (std::string (column) + ".STY"), - x (table, x_column_.c_str (), 0), - y (table, y_column_.c_str (), 0) - { - } - - const char* - table () const - { - return table_; - } - - const char* - column () const - { - return column_; - } - - const char* - conversion () const - { - return conversion_; - } - - unsigned short - prec () const - { - return prec_; - } - - unsigned short - scale () const - { - return scale_; - } - }; -#endif // SQL Server > 2005 - } -} - -#endif // QUERY_HXX diff --git a/mssql/custom/test.hxx b/mssql/custom/test.hxx deleted file mode 100644 index 4b8a5d7..0000000 --- a/mssql/custom/test.hxx +++ /dev/null @@ -1,121 +0,0 @@ -// file : mssql/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Map SQL Server SQL_VARIANT type to our variant C++ class that is capable -// of storing either an integer or a string (QVariant and boost::variant -// would be natural alternatives to our own type). The SQL Server functions -// that are used in the 'to' and 'from' expressions below are defined in -// the custom.sql file. The other half of this mapping is in traits.hxx -// (value_traits). -// -#pragma db map type("SQL_VARIANT") \ - as("VARCHAR(max)") \ - to("dbo.string_to_variant((?))") \ - from("dbo.variant_to_string((?))") - -#pragma db value type("SQL_VARIANT") -struct variant -{ - variant (unsigned long v = 0): val_type (type_int), int_val (v) {} - variant (const std::string& v): val_type (type_str), str_val (v) {} - - enum {type_int, type_str} val_type; - unsigned long int_val; - std::string str_val; -}; - -inline bool -operator== (const variant& a, const variant& b) -{ - if (a.val_type != b.val_type) - return false; - - switch (a.val_type) - { - case variant::type_int: - return a.int_val == b.int_val; - case variant::type_str: - return a.str_val == b.str_val; - } - - return false; -} - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 -// Map GEOMETRY SQL Server type to the point C++ struct. The other half -// of this mapping is in traits.hxx (value_traits). -// Note that GEOMETRY is not available in SQL Server 2005. -// -#pragma db map type("GEOMETRY") \ - as("VARCHAR(256)") \ - to("GEOMETRY::STGeomFromText((?), 0)") \ - from("(?).STAsText()") - -#pragma db value type("GEOMETRY") -struct point -{ - point () {} - point (double x_, double y_): x (x_), y (y_) {} - - double x; - double y; -}; - -inline bool -operator== (const point& a, const point& b) -{ - return a.x == b.x && a.y == b.y; -} -#endif // SQL Server > 2005 - -// Map XML SQL Server type to std::string (or any other type that provides -// the value_traits specialization). Note also that -// another alternative would be to interface with the XML data type using -// VARBINARY or NVARCHAR. Here we use implicit string to/from XML conversion, -// however, CAST/CONVERT can be used instead for greater control over -// whitespace handling, etc. -// -#pragma db map type("XML *(\\(.+\\))?") as("VARCHAR(max)") - -#pragma db object -struct object -{ - object () {} - object (unsigned long id_) : id (id_) {} - - #pragma db id - unsigned long id; - - variant v; - std::vector vv; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - point p; - std::vector pv; -#endif - - #pragma db type("XML") - std::string xml; - - bool - operator== (const object& y) const - { - return id == y.id - && vv == y.vv -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && p == y.p - && pv == y.pv -#endif - && xml == y.xml; - } -}; - -#endif // TEST_HXX diff --git a/mssql/custom/traits.cxx b/mssql/custom/traits.cxx deleted file mode 100644 index 3f14ae7..0000000 --- a/mssql/custom/traits.cxx +++ /dev/null @@ -1,128 +0,0 @@ -// file : mssql/types/traits.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -#include "traits.hxx" - -using namespace std; - -namespace odb -{ - namespace mssql - { - void value_traits:: - param_callback (const void* context, - size_t*, - const void** buffer, - size_t* size, - chunk_type* chunk, - void* tmp_buf, - size_t tmp_capacity) - { - const variant& v (*static_cast (context)); - string str; - - switch (v.val_type) - { - case variant::type_int: - { - ostringstream os; - os << v.int_val; - - str = "bigint "; - str += os.str (); - break; - } - case variant::type_str: - { - str = "varchar "; - str += v.str_val; - break; - } - } - - // Here we assume that the temoprary buffer is large enough to fit - // the whole string in one go. If that were not the case, then we - // would have had to chunk it. - // - assert (tmp_capacity >= str.size ()); - memcpy (tmp_buf, str.c_str (), str.size ()); - - *buffer = tmp_buf; - *size = str.size (); - *chunk = chunk_one; - } - - void value_traits:: - result_callback (void* context, - size_t*, - void** buffer, - size_t* size, - chunk_type chunk, - size_t, - void* tmp_buf, - size_t tmp_capacity) - { - variant& v (*static_cast (context)); - - switch (chunk) - { - case chunk_null: - case chunk_one: - { - assert (false); // The value cannot be NULL or empty. - break; - } - case chunk_first: - { - // Use the variant's string value as a temporary buffer. If this - // were not possible, we could have allocated one as part of - // context. - // - v.str_val.clear (); - - *buffer = tmp_buf; - *size = tmp_capacity; - break; - } - case chunk_next: - { - v.str_val.append (static_cast (tmp_buf), *size); - - *buffer = tmp_buf; - *size = tmp_capacity; - break; - } - case chunk_last: - { - v.str_val.append (static_cast (tmp_buf), *size); - - // Figure out what we've got. - // - string::size_type p (v.str_val.find (' ')); - assert (p != string::npos); // Must have type followed by value. - string type (v.str_val, 0, p); - string text (v.str_val, p + 1, string::npos); - - if (type == "tinyint" || - type == "smallint" || - type == "int" || - type == "bigint") - { - istringstream is (text); - is >> v.int_val; - v.val_type = variant::type_int; - } - else if (type == "char" || type == "varchar") - { - v.str_val = text; - v.val_type = variant::type_str; - } - else - assert (false); // Unknown type. - - break; - } - } - } - } -} diff --git a/mssql/custom/traits.hxx b/mssql/custom/traits.hxx deleted file mode 100644 index 2bd99cb..0000000 --- a/mssql/custom/traits.hxx +++ /dev/null @@ -1,148 +0,0 @@ -// file : mssql/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // std::numeric_limits -#include -#include // std::memcpy -#include - -#include - -#include "test.hxx" // variant, point - -namespace odb -{ - namespace mssql - { - template <> - class value_traits - { - public: - typedef variant value_type; - typedef variant query_type; - typedef long_callback image_type; - - static void - set_value (variant& v, - result_callback_type& cb, - void*& context) - { - cb = &result_callback; - context = &v; - } - - static void - set_image (param_callback_type& cb, - const void*& context, - bool& is_null, - const variant& v) - { - is_null = false; - cb = ¶m_callback; - context = &v; - } - - static void - param_callback (const void* context, - std::size_t* position, - const void** buffer, - std::size_t* size, - chunk_type* chunk, - void* tmp_buffer, - std::size_t tmp_capacity); - - static void - result_callback (void* context, - std::size_t* position, - void** buffer, - std::size_t* size, - chunk_type chunk, - std::size_t size_left, - void* tmp_buffer, - std::size_t tmp_capacity); - }; - - template <> - struct type_traits - { - static const database_type_id db_type_id = id_long_string; - - struct conversion - { - static const char* to () {return "dbo.string_to_variant((?))";} - }; - }; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - template <> - class value_traits - { - public: - typedef point value_type; - typedef point query_type; - - typedef char* image_type; - - static void - set_value (point& v, - const char* b, - std::size_t n, - bool is_null) - { - if (is_null) - v = point (); - else - { - // Point format is "POINT (x y)". - // - std::istringstream is (std::string (b + 7, n - 7)); - - is >> v.x; - is >> v.y; - } - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const point& v) - { - is_null = false; - std::ostringstream os; - - // The formula for the number of decimla digits required is given in: - // - // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf - // - os.precision (std::numeric_limits::digits10); - // os.precision (2 + std::numeric_limits::digits * 301/1000); - - os << "POINT (" << v.x << ' ' << v.y << ')'; - - const std::string& s (os.str ()); - n = s.size (); - assert (n <= c); - std::memcpy (b, s.c_str (), n); - } - }; - - template <> - struct type_traits - { - static const database_type_id db_type_id = id_string; - - struct conversion - { - static const char* to () {return "GEOMETRY::STGeomFromText((?), 0)";} - }; - }; -#endif // SQL Server > 2005 - } -} - -#endif // TRAITS_HXX diff --git a/mssql/database/driver.cxx b/mssql/database/driver.cxx deleted file mode 100644 index 08ad34f..0000000 --- a/mssql/database/driver.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// file : mssql/database/driver.cxx -// license : GNU GPL; see accompanying LICENSE file - -// Test that database constructors are unambiguous (compilation only). -// - -#include -#include - -#include - -namespace mssql = odb::mssql; -using namespace mssql; - -static const char* isolation_map[] = {"1", "2", "3", "5", "4"}; - -static bool -check_isolation (connection& c, transaction_isolation i) -{ - std::string s ("SELECT 1 FROM sys.dm_exec_sessions WHERE session_id = @@SPID" - " AND transaction_isolation_level = "); - s += isolation_map[i]; - return c.execute (s) == 1; -} - -int -main (int argc, char* argv[]) -{ - // This code should not execute. - // - if (argc == 0) - { - { - database d1 ("bob", "secret", "db1", "server1"); - database d2 ("bob", "secret", "db1", "server1", "driver1"); - database d3 ("bob", "secret", "db1", "server1", "driver1", "extra"); - database d4 ("bob", "secret", "db1", "server1", "driver1", "extra", - isolation_read_uncommitted); - } - - { - database d1 ("bob", "secret", "db1", protocol_auto); - database d2 ("bob", "secret", "db1", protocol_auto, "server1"); - database d3 ("bob", "secret", "db1", protocol_auto, "server1", "inst1"); - database d4 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", - "driver1"); - database d5 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", - "driver1", "extra"); - database d6 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", - "driver1", "extra", isolation_read_uncommitted); - } - - { - database d1 ("bob", "secret", "db1", "server1", 0); - database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); - database d3 ("bob", "secret", "db1", "server1", 999, "driver1", "extra"); - database d4 ("bob", "secret", "db1", "server1", 999, "driver1", "extra", - isolation_read_uncommitted); - } - - { - database d1 ("conn1"); - database d2 ("conn1", isolation_read_uncommitted); - } - - { - database d1 (argc, argv); - database d2 (argc, argv, false); - database d3 (argc, argv, true, "extra"); - database d4 (argc, argv, false, "extra", isolation_read_uncommitted); - } - } - - // Test transaction isolation levels. - // - { - database d (argc, argv, false, "", isolation_read_uncommitted); - connection_ptr c (d.connection ()); - assert (check_isolation (*c, isolation_read_uncommitted)); - } - - { - database d (argc, argv, false, ""); - connection_ptr c (d.connection ()); - assert (check_isolation (*c, isolation_read_committed)); - } - - { - database d (argc, argv, false, "", isolation_repeatable_read); - connection_ptr c (d.connection ()); - assert (check_isolation (*c, isolation_repeatable_read)); - } - - { - database d (argc, argv, false, "", isolation_snapshot); - connection_ptr c (d.connection ()); - assert (check_isolation (*c, isolation_snapshot)); - } - - { - database d (argc, argv, false, "", isolation_serializable); - connection_ptr c (d.connection ()); - assert (check_isolation (*c, isolation_serializable)); - } -} diff --git a/mssql/native/driver.cxx b/mssql/native/driver.cxx deleted file mode 100644 index f4b4fd7..0000000 --- a/mssql/native/driver.cxx +++ /dev/null @@ -1,73 +0,0 @@ -// file : mssql/native/driver.cxx -// license : GNU GPL; see accompanying LICENSE file - -// Test native SQL execution. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - // Create the database schema. - // - { - transaction t (db->begin ()); - - db->execute ("IF OBJECT_ID('mssql_native_test', 'U') IS NOT NULL\n" - " DROP TABLE mssql_native_test"); - - db->execute ("CREATE TABLE mssql_native_test (n int)"); - - t.commit (); - } - - // Insert a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("INSERT INTO mssql_native_test (n) VALUES (1)") == 1); - - assert ( - db->execute ("INSERT INTO mssql_native_test (n) VALUES (2)") == 1); - - t.commit (); - } - - // Select a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("SELECT n FROM mssql_native_test WHERE n < 3") == 2); - - assert ( - db->execute ("SELECT n FROM mssql_native_test WHERE n > 3") == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/query/driver.cxx b/mssql/query/driver.cxx deleted file mode 100644 index 5600c81..0000000 --- a/mssql/query/driver.cxx +++ /dev/null @@ -1,188 +0,0 @@ -// file : mssql/query/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test SQL Server-specific query support aspects. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - object o1; - object o2; - object o3; - - o1.num = 1; - o1.str = "aaa"; - o1.nstr = L"aaa"; - o1.lstr.assign (1024, 'a'); - o1.lnstr.assign (1024, L'a'); - o1.smoney = 11000; - o1.money = 1.1; - - o2.num = 2; - o2.str = "bbb"; - o2.nstr = L"bbb"; - o2.lstr.assign (1024, 'b'); - o2.lnstr.assign (1024, L'b'); - o2.smoney = 22000; - o2.money = 2.2; - - o3.num = 3; - o3.str = "ccc"; - o3.nstr = L"ccc"; - o3.lstr.assign (1024, 'c'); - o3.lnstr.assign (1024, L'c'); - o3.smoney = 33000; - o3.money = 3.3; - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - typedef mssql::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - // Money and small money. - // - { - result r (db->query (query::smoney < 22000)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->smoney == 11000); - assert (++i == r.end ()); - } - - { - result r (db->query ("smoney < " + query::_val (2.1F))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->smoney == 11000); - assert (++i == r.end ()); - } - - { - result r (db->query (query::money < 2.2)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->money == 1.1); - assert (++i == r.end ()); - } - - { - result r (db->query ("money < " + query::_val (2.2))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->money == 1.1); - assert (++i == r.end ()); - } - - // Short/long string. - // - { - result r (db->query (query::str < "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->str == "aaa"); - assert (++i == r.end ()); - } - - { - result r (db->query ("str < " + query::_val ("bbb", 3))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->str == "aaa"); - assert (++i == r.end ()); - } - - { - result r (db->query (query::nstr < L"bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->nstr == L"aaa"); - assert (++i == r.end ()); - } - - { - result r (db->query (query::lstr < string (1024, 'b'))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->lstr == string (1024, 'a')); - assert (++i == r.end ()); - } - - { - string v (1024, 'b'); - result r (db->query (query::lstr < query::_ref (v))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->lstr == string (1024, 'a')); - assert (++i == r.end ()); - } - - { - result r (db->query (query::lnstr < wstring (1024, L'b'))); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->lnstr == wstring (1024, L'a')); - assert (++i == r.end ()); - } - - // Test image copying with long data. - // - { - result r (db->query (query::str < "ccc")); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - ++i; - assert (i != r.end ()); - - { - result r (db->query (query::str < "bbb")); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (i->str == "aaa"); - assert (++i == r.end ()); - } - - assert (i->str == "bbb"); // Load from copy. - assert (++i == r.end ()); - } - - t.commit (); - } - - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/query/test.hxx b/mssql/query/test.hxx deleted file mode 100644 index 85c644e..0000000 --- a/mssql/query/test.hxx +++ /dev/null @@ -1,38 +0,0 @@ -// file : mssql/query/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id_; - - unsigned int num; - - #pragma db type ("SMALLMONEY") - int smoney; - - #pragma db type ("MONEY") - double money; - - #pragma db type ("VARCHAR(256)") - std::string str; - - #pragma db type ("NVARCHAR(128)") - std::wstring nstr; - - #pragma db type ("VARCHAR(max)") - std::string lstr; - - #pragma db type ("NVARCHAR(max)") - std::wstring lnstr; -}; - -#endif // TEST_HXX diff --git a/mssql/stored-proc/driver.cxx b/mssql/stored-proc/driver.cxx deleted file mode 100644 index 2389798..0000000 --- a/mssql/stored-proc/driver.cxx +++ /dev/null @@ -1,231 +0,0 @@ -// file : mssql/stored-proc/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test SQL Server stored procedure support. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -void -create_procedure (database& db, const string& name, const string& body) -{ - transaction t (db.begin ()); - - string s (db.query_value ().name); - - db.execute ( - "IF EXISTS (" - " SELECT * FROM sysobjects" - " WHERE name = '" + name + "' AND user_name(uid) = '" + s +"')" - " DROP PROCEDURE [" + s + "].[" + name + "]"); - - db.execute ("CREATE PROCEDURE [" + s + "].[" + name + "] " + body); - - t.commit (); -} - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - object o1 (1, "a"); - object o2 (2, "b"); - object o3 (3, "c"); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - { - create_procedure ( - *db, "select_all_objects", - "AS" - " SELECT num, str FROM mssql_stored_proc_object ORDER BY id;"); - - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ()); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - cout << i->num << " " << i->str << endl; - cout << endl; - - t.commit (); - } - - { - create_procedure ( - *db, "select_objects", - "(@id INT, @n VARCHAR(512))" - "AS" - " SELECT str FROM mssql_stored_proc_object " - " WHERE [id] = @id OR [num] = @n ORDER BY id;"); - - typedef mssql::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - result r (db->query ( - query::_val (o1.id) + "," + query::_val (o2.num))); - - for (result::iterator i (r.begin ()); i != r.end (); ++i) - cout << i->str << endl; - cout << endl; - - t.commit (); - } - - { - create_procedure ( - *db, "objects_min_max", - "(@min INT = NULL OUTPUT, @max INT = NULL OUTPUT)" - "AS" - " SELECT @min = MIN(num), @max = MAX(num)" - " FROM mssql_stored_proc_object;"); - - create_procedure ( - *db, "objects_min_max_odb", - "AS" - " DECLARE @min INT, @max INT;" - " EXEC objects_min_max @min OUTPUT, @max OUTPUT;" - " SELECT @min, @max;"); - - transaction t (db->begin ()); - - objects_min_max omm (db->query_value ()); - cout << omm.num_min << " " << omm.num_max << endl - << endl; - - t.commit (); - } - - { - create_procedure ( - *db, "insert_object_id", - "(@n INT, @s VARCHAR(512))" - "AS" - " INSERT INTO mssql_stored_proc_object([num], [str])" - " VALUES(@n, @s);"); - - { - typedef mssql::query query; - - transaction t (db->begin ()); - - db->query_one ( - query::_val (4) + "," + query::_val ("d")); - - auto_ptr o (db->load (4)); - cout << o->num << " " << o->str << endl - << endl; - - t.commit (); - } - - { - typedef mssql::query query; - - transaction t (db->begin ()); - - db->query_one ( - "EXEC insert_object_id" + query::_val (5) + "," + query::_val ("e")); - - auto_ptr o (db->load (5)); - cout << o->num << " " << o->str << endl - << endl; - - t.commit (); - } - } - - { - create_procedure ( - *db, "insert_object_id", - "(@n INT, @s VARCHAR(512), @id INT = NULL OUTPUT)" - "AS" - " INSERT INTO mssql_stored_proc_object([num], [str])" - " VALUES(@n, @s);" - " SET @id = SCOPE_IDENTITY();" - " RETURN 123;"); - - typedef mssql::query query; - - { - create_procedure ( - *db, "insert_object_id_odb", - "(@n INT, @s VARCHAR(512))" - "AS" - " DECLARE @id INT;" - " DECLARE @ret INT;" - " EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" - " SELECT @ret, @id;"); - - transaction t (db->begin ()); - - insert_object_id io ( - db->query_value ( - query::_val (6) + "," + query::_val ("f"))); - - cout << io.ret << " " << io.id << endl - << endl; - - t.commit (); - } - - // An alternative implementation that produces a different - // result set configuration at the ODBC level. - // - { - create_procedure ( - *db, "insert_object_id_odb", - "(@n INT, @s VARCHAR(512))" - "AS" - " DECLARE @id INT;" - " DECLARE @ret INT;" - " DECLARE @tbl TABLE(dummy INT);" - " INSERT INTO @tbl EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" - " SELECT @ret, @id;"); - - transaction t (db->begin ()); - - insert_object_id io ( - db->query_value ( - query::_val (7) + "," + query::_val ("g"))); - - cout << io.ret << " " << io.id << endl - << endl; - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx deleted file mode 100644 index 5958ea3..0000000 --- a/mssql/stored-proc/test.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// file : mssql/stored-proc/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db view query("SELECT SCHEMA_NAME()") -struct default_schema -{ - std::string name; -}; - -#pragma db object -struct object -{ - object () {} - object (unsigned int n, std::string s): num (n), str (s) {} - - #pragma db id auto - unsigned long id; - - unsigned int num; - std::string str; -}; - -#pragma db view -struct no_result {}; - -#pragma db view query("EXEC select_all_objects") -struct select_all_objects -{ - unsigned int num; - std::string str; -}; - -#pragma db view query("EXEC select_objects (?)") -struct select_objects -{ - std::string str; -}; - -#pragma db view query("EXEC objects_min_max_odb") -struct objects_min_max -{ - unsigned int num_min; - unsigned int num_max; -}; - -#pragma db view query("EXEC insert_object_id (?)") -struct insert_object {}; - -#pragma db view query("EXEC insert_object_id_odb (?)") -struct insert_object_id -{ - unsigned int ret; - unsigned long id; -}; - -#endif // TEST_HXX diff --git a/mssql/template/driver.cxx b/mssql/template/driver.cxx deleted file mode 100644 index ded03f1..0000000 --- a/mssql/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : mssql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/template/template-vc10.vcxproj b/mssql/template/template-vc10.vcxproj deleted file mode 100644 index 5875d9b..0000000 --- a/mssql/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mssql/template/template-vc10.vcxproj.filters b/mssql/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mssql/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mssql/template/template-vc11.vcxproj b/mssql/template/template-vc11.vcxproj deleted file mode 100644 index 0bee18f..0000000 --- a/mssql/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mssql/template/template-vc11.vcxproj.filters b/mssql/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mssql/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mssql/template/template-vc12.vcxproj b/mssql/template/template-vc12.vcxproj deleted file mode 100644 index 35ffb0f..0000000 --- a/mssql/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/mssql/template/template-vc12.vcxproj.filters b/mssql/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/mssql/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/mssql/template/template-vc8.vcproj b/mssql/template/template-vc8.vcproj deleted file mode 100644 index cfd697f..0000000 --- a/mssql/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/mssql/template/template-vc9.vcproj b/mssql/template/template-vc9.vcproj deleted file mode 100644 index 72a95d9..0000000 --- a/mssql/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/mssql/template/test.hxx b/mssql/template/test.hxx deleted file mode 100644 index 0bc1f95..0000000 --- a/mssql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : mssql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx deleted file mode 100644 index d900a95..0000000 --- a/mssql/types/driver.cxx +++ /dev/null @@ -1,381 +0,0 @@ -// file : mssql/types/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test SQL Server type conversion. -// - -#include // std::auto_ptr -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace mssql = odb::mssql; -using namespace mssql; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - object o (1); - - o.bit_ = 1; - o.utint_ = 222; - o.stint_ = -123; - o.usint_ = 65000; - o.ssint_ = -12345; - o.uint_ = 4294967290U; - o.sint_ = -1234567890; - o.ubint_ = 18446744073709551610ULL; - o.sbint_ = -1234567890123456789LL; - - o.fsm_ = -214748.3648F; - o.dsm_ = 214748.3647; - o.ism_ = -2147483647 -1; - - o.dm1_ = -922337203685477.5808; - o.dm2_ = 922337203685476.3520; // 922337203685477.5807 - o.im_ = 9223372036854775807LL; - - o.f4_ = 123.123F; - o.f8_ = 123.1234567; - - o.schar_ = "short data char "; - o.svchar_ = "short data varchar"; - - o.lchar_.assign (1025, 'a'); - o.lvchar_ = "long data varchar"; // Test the short string optimization. - o.mvchar_.assign (70000, 'm'); - o.text_.assign (70000, 't'); - - o.snchar_ = L"short data nchar\x1FFF\xD7FF "; - o.snvchar_ = L"short data nvarchar \x1FFF\xD7FF"; - - o.lnchar_.assign (513, L'\x1234'); - o.lnvchar_ = L""; // Test empty string. - o.mnvchar_.assign (70000, L'\x2345'); - o.ntext_.assign (70000, L'\x4356'); - - const char sdata[] = "abc""\x00\x01""def"; - memcpy (o.sbin_, sdata, sizeof (sdata)); - o.svbin_.assign (sdata, sdata + sizeof (sdata)); - - string ldata (256 * 1024, '\x01'); - memset (o.lbin_, 2, sizeof (o.lbin_)); - o.lvbin_.assign (50, '\x03'); - o.mvbin_.assign (ldata.begin (), ldata.end ()); - o.image_.assign (ldata.begin (), ldata.end ()); - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.date_ = date_time (2011, 12, 20, 0, 0, 0, 0, 0, 0); - o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456789, 0, 0); - o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); -#endif - o.sdt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); - o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.dt2_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); - o.dto7_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); - o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); -#endif - -#ifdef _WIN32 - // 6F846D41-C89A-4E4D-B22F-56443CFA543F - o.guid_.Data1 = 0x6F846D41; - o.guid_.Data2 = 0xC89A; - o.guid_.Data3 = 0x4E4D; - memcpy (&o.guid_.Data4, "\xB2\x2F\x56\x44\x3C\xFA\x54\x3F", 8); -#endif - memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" - "\x56\x44\x3C\xFA\x54\x3F", 16); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); - o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123400000, 0, 0); -#endif - o.sdt_ = date_time (2011, 12, 20, 15, 44, 0, 0, 0, 0); - o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123000000, 0, 0); -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 0, 2, 0); -#endif - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - typedef mssql::query query; - typedef odb::result result; - - // Test UUID in queries. - // - { - char uuid[16]; - memcpy (uuid, o.uuid_, 16); - - transaction t (db->begin ()); - - { - result r (db->query (query::uuid == uuid)); - assert (size (r) == 1); - } - - { - result r (db->query (query::uuid == query::_val (uuid))); - assert (size (r) == 1); - } - - { - result r (db->query (query::uuid == query::_ref (uuid))); - assert (size (r) == 1); - } - - { - const char* d (uuid); - result r (db->query (query::uuid == d)); - assert (size (r) == 1); - } - - t.commit (); - } - - // Test short/long data in queries. - // - { - transaction t (db->begin ()); - - { - result r (db->query (query::svchar == o.svchar_)); - assert (size (r) == 1); - } - - { - result r (db->query (query::snvchar == o.snvchar_)); - assert (size (r) == 1); - } - - { - result r (db->query (query::mvchar == o.mvchar_)); - assert (size (r) == 1); - } - - { - result r (db->query (query::mnvchar == o.mnvchar_)); - assert (size (r) == 1); - } - - t.commit (); - } - } - - // Test long NULL data. - // - { - long_null o1 (1); - long_null o2 (2); - o2.str_.reset (new string); - o2.str_->assign (70000, 'x'); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - } - } - - // Test long data in containers. - // - { - long_cont o (1); - o.v.push_back (long_comp ("aaa", 123)); - o.v.push_back (long_comp (string (500, 'b'), 234)); - o.v.push_back (long_comp (string (70000, 'c'), 345)); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (1)); - t.commit (); - - assert (o == *p); - } - } - - // Test char/wchar_t arrays. - // - { - char_array o1 (1, "", L""); - char_array o2 (2, "1234567890", L"12345678\x1FFF\xD7FF"); - char_array o3 (3, "1234567890123456", L"12345678901234\x1FFF\xD7FF"); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - // SQL Server returns padded values for CHAR(N)/NCHAR(N). - // - memcpy (o1.s2, " ", 16); - o1.s3[0] = o1.c1 = ' '; - memcpy (o2.s2, "1234567890 ", 16); - - memset (o1.ls2, ' ', 1025); - memset (o2.ls2 + 10, ' ', 1025 - 10); - - memcpy (o1.ws2, L" ", 16 * sizeof (wchar_t)); - o1.ws3[0] = o1.wc1 = L' '; - memcpy (o2.ws2, L"12345678\x1FFF\xD7FF ", 16 * sizeof (wchar_t)); - - for (size_t i (0); i < 257; ++i) - o1.lws2[i] = L' '; - - for (size_t i (10); i < 257; ++i) - o2.lws2[i] = L' '; - - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - assert (o3 == *p3); - } - } - - // Test optimistic concurrency using ROWVERSION. - // - { - rowversion o (123); - o.str = "abc"; - - { - transaction t (db->begin ()); - db->persist (o); - assert (o.ver != 0); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - assert (p->ver == o.ver); - p->str += 'd'; - db->update (*p); - assert (p->ver > o.ver); - - // Double-check object version was updated. - // - { - auto_ptr p1 (db->load (o.id_)); - assert (p->ver == p1->ver); - } - - o.str += 'D'; - try - { - db->update (o); - assert (false); - } - catch (const odb::object_changed&) {} - db->reload (o); - assert (o.ver == p->ver); - o.str += 'D'; - db->update (o); - t.commit (); - } - } - - { - rowversion_auto o; - o.str = "abc"; - - { - transaction t (db->begin ()); - db->persist (o); - assert (o.ver != 0); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - assert (p->ver == o.ver); - p->str += 'd'; - db->update (*p); - assert (p->ver > o.ver); - o.str += 'D'; - try - { - db->update (o); - assert (false); - } - catch (const odb::object_changed&) {} - db->reload (o); - assert (o.ver == p->ver); - o.str += 'D'; - db->update (o); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx deleted file mode 100644 index 5d651a8..0000000 --- a/mssql/types/test.hxx +++ /dev/null @@ -1,517 +0,0 @@ -// file : mssql/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#ifdef _WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include // GUID -#elif defined(HOST_WIN32) -typedef struct _GUID -{ - unsigned int Data1; - unsigned short Data2; - unsigned short Data3; - unsigned char Data4[8]; -} GUID; -#endif - -#include // HAVE_CXX11 - -#include -#include -#include // std::auto_ptr -#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen -#include // std::wcslen, std::wcs[n]cmp - -#include - -struct date_time -{ - date_time () - { - } - - date_time (short y, - unsigned short m, - unsigned short d, - unsigned short h, - unsigned short min, - unsigned short sec, - unsigned int f, - short tzh, - short tzm) - : year (y), - month (m), - day (d), - hour (h), - minute (min), - second (sec), - fraction (f), - timezone_hour (tzh), - timezone_minute (tzm) - { - } - - bool - operator== (const date_time& y) const - { - return - year == y.year && - month == y.month && - day == y.day && - hour == y.hour && - minute == y.minute && - second == y.second && - fraction == y.fraction && - timezone_hour == y.timezone_hour && - timezone_minute == y.timezone_minute; - } - - short year; - unsigned short month; - unsigned short day; - unsigned short hour; - unsigned short minute; - unsigned short second; - unsigned int fraction; - short timezone_hour; - short timezone_minute; -}; - -#pragma db object -struct object -{ - object () {} - object (unsigned int id): id_ (id) {} - - #pragma db id - unsigned int id_; - - // Integer types. - // - #pragma db type ("BIT") - unsigned char bit_; - - #pragma db type ("TINYINT") - unsigned char utint_; - - #pragma db type ("TINYINT") - unsigned char stint_; - - #pragma db type ("SMALLINT") - unsigned short usint_; - - #pragma db type ("SMALLINT") - short ssint_; - - #pragma db type ("INT") - unsigned int uint_; - - #pragma db type ("INTEGER") - int sint_; - - #pragma db type ("BIGINT") - unsigned long long ubint_; - - #pragma db type ("BIGINT") - long long sbint_; - - // Floating/fixed point types. - // - #pragma db type ("SMALLMONEY") - float fsm_; - - #pragma db type ("SMALLMONEY") - double dsm_; - - #pragma db type ("SMALLMONEY") - int ism_; - - #pragma db type ("MONEY") - double dm1_; - - #pragma db type ("MONEY") - double dm2_; - - #pragma db type ("MONEY") - long long im_; - - #pragma db type ("REAL") - float f4_; - - #pragma db type ("FLOAT") - double f8_; - - // Strings. - // - #pragma db type ("CHAR(20)") - std::string schar_; - - #pragma db type ("VARCHAR(128)") - std::string svchar_; - - #pragma db type ("CHAR(1025)") - std::string lchar_; - - #pragma db type ("CHARACTER VARYING(8000)") - std::string lvchar_; - - #pragma db type ("VARCHAR(max)") - std::string mvchar_; - - #pragma db type ("TEXT") - std::string text_; - - // National strings. - // - #pragma db type ("NCHAR(20)") - std::wstring snchar_; - - #pragma db type ("NVARCHAR(128)") - std::wstring snvchar_; - - #pragma db type ("NCHAR(513)") - std::wstring lnchar_; - - #pragma db type ("NATIONAL CHARACTER VARYING(4000)") - std::wstring lnvchar_; - - #pragma db type ("NVARCHAR(max)") - std::wstring mnvchar_; - - #pragma db type ("NTEXT") - std::wstring ntext_; - - // Binary. - // - #pragma db type ("BINARY(9)") - unsigned char sbin_[9]; - - #pragma db type ("VARBINARY(256)") - std::vector svbin_; - - #pragma db type ("BINARY(1025)") - char lbin_[1025]; - - #pragma db type ("BINARY VARYING(8000)") - std::vector lvbin_; - - #pragma db type ("VARBINARY(max)") - std::vector mvbin_; - - #pragma db type ("IMAGE") - std::vector image_; - - // Date-time. SQL Server 2005 (9.0) only has DATETIME and SMALLDATETIME. - // -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - #pragma db type ("DATE") - date_time date_; - - #pragma db type ("TIME") - date_time time7_; - - #pragma db type ("TIME(4)") - date_time time4_; -#endif - - #pragma db type ("SMALLDATETIME") - date_time sdt_; - - #pragma db type ("DATETIME") - date_time dt_; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - #pragma db type ("DATETIME2") - date_time dt2_; - - #pragma db type ("DATETIMEOFFSET") - date_time dto7_; - - #pragma db type ("DATETIMEOFFSET(0)") - date_time dto0_; -#endif - - // Other types. - // -#if defined(_WIN32) || defined(HOST_WIN32) - //#pragma db type ("UNIQUEIDENTIFIER") - GUID guid_; -#endif - - #pragma db type ("UNIQUEIDENTIFIER") - char uuid_[16]; - - bool - operator== (const object& y) const - { - return - id_ == y.id_ && - bit_ == y.bit_ && - utint_ == y.utint_ && - stint_ == y.stint_ && - usint_ == y.usint_ && - ssint_ == y.ssint_ && - uint_ == y.uint_ && - sint_ == y.sint_ && - ubint_ == y.ubint_ && - sbint_ == y.sbint_ && - fsm_ == y.fsm_ && - dsm_ == y.dsm_ && - ism_ == y.ism_ && - dm1_ == y.dm1_ && - dm2_ == y.dm2_ && - im_ == y.im_ && - f4_ == y.f4_ && - f8_ == y.f8_ && - - schar_ == y.schar_ && - svchar_ == y.svchar_ && - lchar_ == y.lchar_ && - lvchar_ == y.lvchar_ && - mvchar_ == y.mvchar_ && - text_ == y.text_ && - - snchar_ == y.snchar_ && - snvchar_ == y.snvchar_ && - lnchar_ == y.lnchar_ && - lnvchar_ == y.lnvchar_ && - mnvchar_ == y.mnvchar_ && - ntext_ == y.ntext_ && - - std::memcmp (sbin_, y.sbin_, sizeof (sbin_)) == 0 && - svbin_ == y.svbin_ && - std::memcmp (lbin_, y.lbin_, sizeof (lbin_)) == 0 && - lvbin_ == y.lvbin_ && - mvbin_ == y.mvbin_ && - image_ == y.image_ - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && date_ == y.date_ - && time7_ == y.time7_ - && time4_ == y.time4_ -#endif - && sdt_ == y.sdt_ - && dt_ == y.dt_ -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && dt2_ == y.dt2_ - && dto7_ == y.dto7_ - && dto0_ == y.dto0_ -#endif - -#ifdef _WIN32 - && std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0 -#endif - && std::memcmp (uuid_, y.uuid_, sizeof (uuid_)) == 0; - } -}; - -// Test long NULL data. -// -#pragma db object -struct long_null -{ - long_null () {} - long_null (unsigned int id): id_ (id) {} - - #pragma db id - unsigned int id_; - - #pragma db type ("VARCHAR(max)") null -#ifdef HAVE_CXX11 - std::unique_ptr str_; -#else - std::auto_ptr str_; -#endif - - bool - operator== (const long_null& y) const - { - return - id_ == y.id_ && - ((str_.get () == 0 && y.str_.get () == 0) || *str_ == *y.str_); - } -}; - -// Test long data in containers, in particular column re-arrangement. -// -#pragma db value -struct long_comp -{ - long_comp () {} - long_comp (std::string s, unsigned int n): str (s), num (n) {} - - #pragma db type ("VARCHAR(max)") - std::string str; - - unsigned int num; - - bool - operator== (const long_comp& y) const - { - return str == y.str && num == y.num; - } -}; - -#pragma db object -struct long_cont -{ - long_cont () {} - long_cont (unsigned int id): id_ (id) {} - - #pragma db id - unsigned int id_; - - std::vector v; - - bool - operator== (const long_cont& y) const - { - return id_ == y.id_ && v == y.v; - } -}; - -// Test char/wchar_t arrays. -// -#pragma db object -struct char_array -{ - char_array () {} - char_array (unsigned long id, const char* s, const wchar_t* ws) - : id_ (id) - { - std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - std::memcpy (s2, s, std::strlen (s) + 1); - s3[0] = c1 = *s; - - std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); - std::memcpy (ws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); - ws3[0] = wc1 = *ws; - - if (std::strlen (s) == sizeof (s2)) - { - std::memset (ls1, '1', 1025); - ls1[1025] = '\0'; - std::memset (ls2, '2', 1025); - - for (std::size_t i (0); i < 257; ++i) - { - lws1[i] = L'1'; - lws2[i] = L'2'; - } - lws1[257] = L'\0'; - } - else - { - std::memcpy (ls1, s, std::strlen (s) + 1); // VC++ strcpy deprecation. - std::memcpy (ls2, s, std::strlen (s) + 1); - - std::memcpy (lws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); - std::memcpy (lws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); - } - } - - #pragma db id - unsigned long id_; - - // - // - char s1[17]; - - #pragma db type("CHAR(16)") - char s2[16]; - - char s3[1]; - char c1; - - // Long data. - // - char ls1[1026]; - - #pragma db type("CHAR(1025)") - char ls2[1025]; - - // - // - wchar_t ws1[17]; - - #pragma db type("NCHAR(16)") - wchar_t ws2[16]; - - wchar_t ws3[1]; - wchar_t wc1; - - // Long data. - // - wchar_t lws1[258]; - - #pragma db type("NCHAR(257)") - wchar_t lws2[257]; - - bool - operator== (const char_array& y) const - { - return id_ == y.id_ && - - std::strcmp (s1, y.s1) == 0 && - std::strncmp (s2, y.s2, sizeof (s2)) == 0 && - s3[0] == y.s3[0] && - c1 == y.c1 && - - std::strcmp (ls1, y.ls1) == 0 && - std::strncmp (ls2, y.ls2, sizeof (ls2)) == 0 && - - std::wcscmp (ws1, y.ws1) == 0 && - std::wcsncmp (ws2, y.ws2, sizeof (ws2) / sizeof (wchar_t)) == 0 && - ws3[0] == y.ws3[0] && - wc1 == y.wc1 && - - std::wcscmp (lws1, y.lws1) == 0 && - std::wcsncmp (lws2, y.lws2, sizeof (lws2) / sizeof (wchar_t)) == 0; - } -}; - -// Test optimistic concurrency using ROWVERSION, both with auto and -// manually-assigned ids. -// -#pragma db object optimistic -struct rowversion -{ - rowversion (unsigned int id = 0): id_ (id), ver (0) {} - - #pragma db id - unsigned int id_; - - #pragma db version type("ROWVERSION") -#ifdef _WIN32 - unsigned __int64 ver; -#else - unsigned long long ver; -#endif - - std::string str; -}; - -#pragma db object optimistic -struct rowversion_auto -{ - rowversion_auto (): ver (0) {} - - #pragma db id auto - unsigned int id_; - - #pragma db version type("ROWVERSION") -#ifdef _WIN32 - unsigned __int64 ver; -#else - unsigned long long ver; -#endif - - std::string str; -}; - -#endif // TEST_HXX diff --git a/mssql/types/traits.hxx b/mssql/types/traits.hxx deleted file mode 100644 index 5881f50..0000000 --- a/mssql/types/traits.hxx +++ /dev/null @@ -1,223 +0,0 @@ -// file : mssql/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // date, time, datetime, datetimeoffset -#include - -#include "test.hxx" // date_time - -namespace odb -{ - namespace mssql - { - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef date image_type; - - static void - set_value (date_time& v, const date& i, bool is_null) - { - if (!is_null) - { - v.year = i.year; - v.month = i.month; - v.day = i.day; - v.hour = 0; - v.minute = 0; - v.second = 0; - v.fraction = 0; - v.timezone_hour = 0; - v.timezone_minute = 0; - } - } - - static void - set_image (date& i, bool& is_null, const date_time& v) - { - is_null = false; - i.year = v.year; - i.month = v.month; - i.day = v.day; - } - }; - - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef time image_type; - - static void - set_value (date_time& v, const time& i, bool is_null) - { - if (!is_null) - { - v.year = 0; - v.month = 0; - v.day = 0; - v.hour = i.hour; - v.minute = i.minute; - v.second = i.second; - v.fraction = i.fraction; - v.timezone_hour = 0; - v.timezone_minute = 0; - } - } - - static void - set_image (time& i, unsigned short s, bool& is_null, const date_time& v) - { - const unsigned int divider[8] = - { - 1000000000, - 100000000, - 10000000, - 1000000, - 100000, - 10000, - 1000, - 100 - }; - - is_null = false; - i.hour = v.hour; - i.minute = v.minute; - i.second = v.second; - i.fraction = v.fraction - v.fraction % divider[s]; - } - }; - - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef datetime image_type; - - static void - set_value (date_time& v, const datetime& i, bool is_null) - { - if (!is_null) - { - v.year = i.year; - v.month = i.month; - v.day = i.day; - v.hour = i.hour; - v.minute = i.minute; - v.second = i.second; - v.fraction = i.fraction; - v.timezone_hour = 0; - v.timezone_minute = 0; - } - } - - static void - set_image (datetime& i, - unsigned short s, - bool& is_null, - const date_time& v) - { - const unsigned int divider[8] = - { - 1000000000, - 100000000, - 10000000, - 1000000, - 100000, - 10000, - 1000, - 100 - }; - - is_null = false; - i.year = v.year; - i.month = v.month; - i.day = v.day; - i.hour = v.hour; - i.minute = v.minute; - - // Scale value 8 indicates we are dealing with SMALLDATETIME - // which has the minutes precision. - // - if (s != 8) - { - i.second = v.second; - i.fraction = v.fraction - v.fraction % divider[s]; - } - else - { - i.second = 0; - i.fraction = 0; - } - } - }; - - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef datetimeoffset image_type; - - static void - set_value (date_time& v, const datetimeoffset& i, bool is_null) - { - if (!is_null) - { - v.year = i.year; - v.month = i.month; - v.day = i.day; - v.hour = i.hour; - v.minute = i.minute; - v.second = i.second; - v.fraction = i.fraction; - v.timezone_hour = i.timezone_hour; - v.timezone_minute = i.timezone_minute; - } - } - - static void - set_image (datetimeoffset& i, - unsigned short s, - bool& is_null, - const date_time& v) - { - const unsigned int divider[8] = - { - 1000000000, - 100000000, - 10000000, - 1000000, - 100000, - 10000, - 1000, - 100 - }; - - is_null = false; - i.year = v.year; - i.month = v.month; - i.day = v.day; - i.hour = v.hour; - i.minute = v.minute; - i.second = v.second; - i.fraction = v.fraction - v.fraction % divider[s]; - i.timezone_hour = v.timezone_hour; - i.timezone_minute = v.timezone_minute; - } - }; - } -} - -#endif // TRAITS_HXX diff --git a/mysql-schema.testscript b/mysql-schema.testscript deleted file mode 100644 index dfa7852..0000000 --- a/mysql-schema.testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : mysql-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# Create the MySQL database schema creation canned command base. -# -create_schema_cmd = [cmdline] \ - $mysql_client_cmd 2>&1 | \ - sed -e "'"'s/^mysql: \[Warning\] Using a password on the command .*//'"'" | \ - sed -n -e "'"'s/(.+)/\1/p'"'" >&2 diff --git a/mysql.testscript b/mysql.testscript deleted file mode 100644 index e218ece..0000000 --- a/mysql.testscript +++ /dev/null @@ -1,12 +0,0 @@ -# file : mysql.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# Create the MySQL database schema creation canned command and setup the test -# driver command line for the subsequent tests. -# -.include mysql-schema.testscript - -schema_file = [path] $out_base/"$schema"($multi ? '-mysql' : '').sql -create_schema = [cmdline] cat "'""$schema_file""'" | $create_schema_cmd - -test.arguments += ($multi ? 'mysql' : ) $mysql_options diff --git a/mysql/custom/buildfile b/mysql/custom/buildfile deleted file mode 100644 index 4934e7c..0000000 --- a/mysql/custom/buildfile +++ /dev/null @@ -1,37 +0,0 @@ -# file : mysql/custom/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-mysql%lib{odb-mysql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix mysql_custom_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --hxx-prologue '#include "traits.hxx"' \ - --hxx-prologue '#include "query.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/custom/driver.cxx b/mysql/custom/driver.cxx deleted file mode 100644 index 526dbdc..0000000 --- a/mysql/custom/driver.cxx +++ /dev/null @@ -1,117 +0,0 @@ -// file : mysql/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom database type mapping in MySQL. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - object o (1); - o.p = point (1.1111, 2222222222.2); - o.pv.push_back (point (1.1234, 2.2345)); - o.pv.push_back (point (3.3456, 4.4567)); - // VC just cannot roundtrip this. -#ifndef _MSC_VER - o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. -#endif - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Query. - // - typedef mysql::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - // Point comparison. - // - { - result r (db->query (query::p == o.p)); - assert (!r.empty ()); - } - - // Point comparison using native query. - // - { - result r (db->query (query::p + "=" + query::_val (o.p))); - assert (!r.empty ()); - } - - // Access to individual members. - // - { - result r (db->query (query::p.x == o.p.x)); - assert (!r.empty ()); - } - - t.commit (); - } - - // Update. - // - o.p.x++; - o.p.y--; - o.pv[1].x--; - o.pv[1].y++; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/custom/query.hxx b/mysql/custom/query.hxx deleted file mode 100644 index 2fa8f73..0000000 --- a/mysql/custom/query.hxx +++ /dev/null @@ -1,160 +0,0 @@ -// file : mysql/custom/query.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef QUERY_HXX -#define QUERY_HXX - -#include - -#include - -#include "test.hxx" // point - -namespace odb -{ - namespace mysql - { - template <> - struct query_column - { - private: - const char* table_; - const char* column_; - const char* conversion_; - - std::string x_table_; - std::string y_table_; - std::string s_column_; - - // Sub-columns for individual members. - // - public: - query_column x, y; - - // is_null, is_not_null - // - public: - query_base - is_null () const - { - query_base q (table_, column_); - q += "IS NULL"; - return q; - } - - query_base - is_not_null () const - { - query_base q (table_, column_); - q += "IS NOT NULL"; - return q; - } - - // = - // - public: - query_base - equal (const point& v) const - { - return equal (val_bind (v)); - } - - query_base - equal (val_bind v) const - { - query_base q (table_, column_); - q += "="; - q.append (v, conversion_); - return q; - } - - query_base - equal (ref_bind r) const - { - query_base q (table_, column_); - q += "="; - q.append (r, conversion_); - return q; - } - - friend query_base - operator== (const query_column& c, const point& v) - { - return c.equal (v); - } - - friend query_base - operator== (const point& v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, val_bind v) - { - return c.equal (v); - } - - friend query_base - operator== (val_bind v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, ref_bind r) - { - return c.equal (r); - } - - friend query_base - operator== (ref_bind r, const query_column& c) - { - return c.equal (r); - } - - // Column comparison. - // - public: - query_base - operator== (const query_column& c) const - { - query_base q (table_, column_); - q += "="; - q.append (c.table (), c.column ()); - return q; - } - - public: - query_column (const char* table, const char* column, const char* conv) - : table_ (table), column_ (column), conversion_ (conv), - x_table_ ("ST_X(" + std::string (table)), // @@ Not very clean. - y_table_ ("ST_Y(" + std::string (table)), - s_column_ (std::string (column) + ")"), // X & Y column suffix. - x (x_table_.c_str (), s_column_.c_str (), 0), - y (y_table_.c_str (), s_column_.c_str (), 0) - { - } - - const char* - table () const - { - return table_; - } - - const char* - column () const - { - return column_; - } - - const char* - conversion () const - { - return conversion_; - } - }; - } -} - -#endif // QUERY_HXX diff --git a/mysql/custom/test.hxx b/mysql/custom/test.hxx deleted file mode 100644 index 82cc59d..0000000 --- a/mysql/custom/test.hxx +++ /dev/null @@ -1,54 +0,0 @@ -// file : mysql/custom/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -// Map GEOMETRY MySQL type to the point C++ struct. The other half -// of this mapping is in traits.hxx (value_traits). -// -#pragma db map type("GEOMETRY") \ - as("VARCHAR(256)") \ - to("ST_GeomFromText((?))") \ - from("ST_AsText((?))") - -#pragma db value type("GEOMETRY") -struct point -{ - point () {} - point (double x_, double y_): x (x_), y (y_) {} - - double x; - double y; -}; - -inline bool -operator== (const point& a, const point& b) -{ - return a.x == b.x && a.y == b.y; -} - -#pragma db object -struct object -{ - object () {} - object (unsigned long id_) : id (id_) {} - - #pragma db id - unsigned long id; - - point p; - std::vector pv; - - bool - operator== (const object& y) const - { - return id == y.id && p == y.p && pv == y.pv; - } -}; - -#endif // TEST_HXX diff --git a/mysql/custom/testscript b/mysql/custom/testscript deleted file mode 100644 index 9bc8839..0000000 --- a/mysql/custom/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : mysql/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../mysql.testscript - -+$create_schema - -: basics -: -$* diff --git a/mysql/custom/traits.hxx b/mysql/custom/traits.hxx deleted file mode 100644 index 5386d86..0000000 --- a/mysql/custom/traits.hxx +++ /dev/null @@ -1,88 +0,0 @@ -// file : mysql/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // std::numeric_limits -#include -#include // std::memcpy - -#include - -#include "test.hxx" // point - -namespace odb -{ - namespace mysql - { - template <> - class value_traits - { - public: - typedef point value_type; - typedef point query_type; - - typedef char* image_type; - - static void - set_value (point& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = point (); - else - { - // Point format is "POINT(x y)". - // - std::istringstream is (std::string (b.data () + 6, n - 6)); - - is >> v.x; - is >> v.y; - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const point& v) - { - is_null = false; - std::ostringstream os; - - // The formula for the number of decimla digits required is given in: - // - // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf - // - os.precision (std::numeric_limits::digits10); - // os.precision (2 + std::numeric_limits::digits * 301/1000); - - os << "POINT(" << v.x << ' ' << v.y << ')'; - - const std::string& s (os.str ()); - n = s.size (); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), s.c_str (), n); - } - }; - - template <> - struct type_traits - { - static const database_type_id db_type_id = id_string; - - struct conversion - { - static const char* to () {return "ST_GeomFromText((?))";} - }; - }; - } -} - -#endif // TRAITS_HXX diff --git a/mysql/database/buildfile b/mysql/database/buildfile deleted file mode 100644 index 304034e..0000000 --- a/mysql/database/buildfile +++ /dev/null @@ -1,11 +0,0 @@ -# file : mysql/database/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-mysql%lib{odb-mysql} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/mysql/database/driver.cxx b/mysql/database/driver.cxx deleted file mode 100644 index 525ee87..0000000 --- a/mysql/database/driver.cxx +++ /dev/null @@ -1,72 +0,0 @@ -// file : mysql/database/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test that database constructors are unambiguous (compilation only). -// - -#include - -#include - -#undef NDEBUG -#include - -using std::string; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - // This code should not execute. - // - if (argc != 0) - return 0; - - { - database d1 (0, 0, 0); - database d2 ("bob", "secret", "db1"); - database d3 ("bob", "secret", "db1", "server1"); - database d4 ("bob", "secret", "db1", "server1", 999); - database d5 ("bob", "secret", "db1", "server1", 999, "sock1"); - database d6 ("bob", "secret", "db1", "server1", 999, "sock1", "charset1"); - } - - std::string u ("bob"), p ("secret"), db ("bd1"), h ("server1"), - s ("sock1"), cs ("charset1"); - - { - database d1 (u, p, db); - database d2 (u, p, db, h); - database d3 (u, p, db, h, 999); - database d4 (u, p, db, h, 999, &s); - database d5 (u, p, db, h, 999, &s, cs); - } - - { - database d1 (u, 0, db); - database d2 (u, &p, db); - database d3 (u, &p, db, h); - database d4 (u, &p, db, h, 999); - database d5 (u, &p, db, h, 999, &s); - database d6 (u, &p, db, h, 999, &s, cs); - } - - { - database d1 (u, p, db, h, 999, "socket1"); - database d2 (u, p, db, h, 999, s); - database d3 (u, p, db, h, 999, s, cs); - } - - { - database d1 (u, 0, db, h, 999, s); - database d2 (u, &p, db, h, 999, "socket1"); - database d3 (u, &p, db, h, 999, s, cs); - } - - { - database d1 (argc, argv); - database d2 (argc, argv, false); - database d3 (argc, argv, true, "charset1"); - } -} diff --git a/mysql/database/testscript b/mysql/database/testscript deleted file mode 100644 index c2ff256..0000000 --- a/mysql/database/testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : mysql/database/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -: basics -: -$* diff --git a/mysql/index/buildfile b/mysql/index/buildfile deleted file mode 100644 index 9cadce3..0000000 --- a/mysql/index/buildfile +++ /dev/null @@ -1,34 +0,0 @@ -# file : mysql/index/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-mysql%lib{odb-mysql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix mysql_index_ \ - --generate-schema \ - --default-database common - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/index/driver.cxx b/mysql/index/driver.cxx deleted file mode 100644 index 4d0b7ad..0000000 --- a/mysql/index/driver.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : mysql/index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test MySQL index creation. See also the common test. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - try - { - // This is just a schema creation test. - // - unique_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/index/test.hxx b/mysql/index/test.hxx deleted file mode 100644 index b4f6ae8..0000000 --- a/mysql/index/test.hxx +++ /dev/null @@ -1,20 +0,0 @@ -// file : mysql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id_; - - std::string s; - #pragma db index method("BTREE") member(s, "(200) DESC") -}; - -#endif // TEST_HXX diff --git a/mysql/index/testscript b/mysql/index/testscript deleted file mode 100644 index 26dfc4f..0000000 --- a/mysql/index/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : mysql/index/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../mysql.testscript - -+$create_schema - -: basics -: -$* diff --git a/mysql/native/buildfile b/mysql/native/buildfile deleted file mode 100644 index 57c3c30..0000000 --- a/mysql/native/buildfile +++ /dev/null @@ -1,16 +0,0 @@ -# file : mysql/native/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-mysql%lib{odb-mysql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/native/driver.cxx b/mysql/native/driver.cxx deleted file mode 100644 index 9b34fd2..0000000 --- a/mysql/native/driver.cxx +++ /dev/null @@ -1,75 +0,0 @@ -// file : mysql/native/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test native SQL execution. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#undef NDEBUG -#include - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - // Create the database schema. - // - { - transaction t (db->begin ()); - - db->execute ("DROP TABLE IF EXISTS mysql_native_test"); - - db->execute ("CREATE TABLE mysql_native_test (n INT PRIMARY KEY) " - "ENGINE=InnoDB"); - - t.commit (); - } - - // Insert a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("INSERT INTO mysql_native_test (n) VALUES (1)") == 1); - - assert ( - db->execute ("INSERT INTO mysql_native_test (n) VALUES (2)") == 1); - - t.commit (); - } - - // Select a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("SELECT n FROM mysql_native_test WHERE n < 3") == 2); - - assert ( - db->execute ("SELECT n FROM mysql_native_test WHERE n > 3") == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/native/testscript b/mysql/native/testscript deleted file mode 100644 index 21327ff..0000000 --- a/mysql/native/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : mysql/native/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../mysql.testscript - -: basics -: -$* diff --git a/mysql/truncation/buildfile b/mysql/truncation/buildfile deleted file mode 100644 index fbd936b..0000000 --- a/mysql/truncation/buildfile +++ /dev/null @@ -1,35 +0,0 @@ -# file : mysql/truncation/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-mysql%lib{odb-mysql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix mysql_truncation_ \ - --generate-schema \ - --default-database common \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx deleted file mode 100644 index 21084f5..0000000 --- a/mysql/truncation/driver.cxx +++ /dev/null @@ -1,192 +0,0 @@ -// file : mysql/truncation/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test insufficient buffer/truncation handling. -// - -#include // std::unique_ptr -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - // The default pre-allocated buffer is 256 bytes long. - // - string long_str (300, 'c'); // This will get the buffer to 512 - string longer_str (1025, 'b'); - - try - { - // Test basic operations. - // - { - unique_ptr db (create_specific_database (argc, argv)); - - // Run persist/load so that the initial bindings are established - // (version == 0). - // - { - object1 o (1); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (1, o); - t.commit (); - } - - { - object2 o (2); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (2, o); - t.commit (); - } - - // Store/load the long string which should trigger buffer growth. - // - { - object1 o (3); - o.str_ = long_str; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == long_str); - t.commit (); - } - - // Store/load longer string. - // - { - object1 o (3); - o.str_ = longer_str; - - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == longer_str); - t.commit (); - } - } - - // Test query. - // - { - typedef mysql::query query; - typedef odb::result result; - - unique_ptr db (create_specific_database (argc, argv)); - - // Run persist/query so that the initial bindings are established - // (version == 0). - // - { - object1 o (20); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - o.id_++; - db->persist (o); - o.id_++; - db->persist (o); - - result r (db->query (query::id == 20)); - assert (r.begin ()->id_ == 20); - t.commit (); - } - - // Test buffer growth with cached result. - // - { - object1 o; - - transaction t (db->begin ()); - - result r (db->query (query::id >= 20)); - result::iterator i (r.begin ()); - - o.id_ = i->id_; - o.str_ = long_str; - - // This forces buffer growth in the middle of result iteration. - // - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - o.id_ = i->id_; - o.str_ = longer_str; - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - t.commit (); - } - } - - // Test containers. - // - { - unique_ptr db (create_specific_database (argc, argv)); - - // Use different connections to persist and load the object. - // - connection_ptr c1 (db->connection ()); - connection_ptr c2 (db->connection ()); - - container o (1); - o.vec_.push_back (string (513, 'x')); - - { - transaction t (c1->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (c2->begin ()); - unique_ptr p (db->load (1)); - t.commit (); - - assert (p->vec_ == o.vec_); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/truncation/test.hxx b/mysql/truncation/test.hxx deleted file mode 100644 index 1883b0e..0000000 --- a/mysql/truncation/test.hxx +++ /dev/null @@ -1,48 +0,0 @@ -// file : mysql/truncation/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#pragma db object table ("test") -struct object1 -{ - object1 () {} - object1 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#pragma db object table ("test") -struct object2 -{ - object2 () {} - object2 (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#pragma db object -struct container -{ - container () {} - container (unsigned long id) : id_ (id) {} - - #pragma db id - unsigned long id_; - - std::vector vec_; -}; - -#endif // TEST_HXX diff --git a/mysql/truncation/testscript b/mysql/truncation/testscript deleted file mode 100644 index b9b6792..0000000 --- a/mysql/truncation/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : mysql/truncation/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../mysql.testscript - -+$create_schema - -: basics -: -$* diff --git a/mysql/types/buildfile b/mysql/types/buildfile deleted file mode 100644 index 112a81f..0000000 --- a/mysql/types/buildfile +++ /dev/null @@ -1,36 +0,0 @@ -# file : mysql/types/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($mysql && !$multi || $build.meta_operation == 'dist') \ -"mysql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-mysql%lib{odb-mysql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix mysql_types_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --hxx-prologue '#include "traits.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx deleted file mode 100644 index 2354b04..0000000 --- a/mysql/types/driver.cxx +++ /dev/null @@ -1,168 +0,0 @@ -// file : mysql/types/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test MySQL type conversion. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace mysql = odb::mysql; -using namespace mysql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - mysql_version v; - { - transaction t (db->begin ()); - db->query ().begin ().load (v); - t.commit (); - } - - //cerr << "MySQL " << v.major << '.' << v.minor << '.' << v.release - // << " protocol " << v.protocol << endl; - - object o (1); - - o.bool_ = true; - o.schar_ = -123; - o.uchar_ = 123; - o.short_ = -12345; - o.ushort_ = 12345; - o.mint_ = -123456; - o.umint_ = 123456; - o.int_ = -123456; - o.uint_ = 123456; - o.long_long_ = -123456; - o.ulong_long_ = 123456; - - o.float_ = 1.123F; - o.float8_ = 1.123; - o.double_ = 1.123; - o.decimal_ = "123.456"; - - o.date_ = date_time (false, 2010, 8, 29, 0, 0, 0); - o.time_ = date_time (true, 0, 0, 0, 12, 26, 59); - o.date_time_ = date_time (false, 2010, 8, 29, 12, 26, 59); - o.timestamp_ = date_time (false, 2010, 8, 29, 12, 26, 59); - o.year_ = 2010; - - // If we are running against MySQL 5.6.4 or later, add fractional - // seconds and also alter the table to allow sub-second precision. - // - if (v.major > 5 || - (v.major == 5 && (v.minor > 6 || - (v.minor == 6 && v.release >= 4)))) - { - o.time_.microseconds = 123456; - o.date_time_.microseconds = 234567; - o.timestamp_.microseconds = 345678; - - transaction t (db->begin ()); - db->execute ("ALTER TABLE `mysql_types_object`" \ - " MODIFY COLUMN `time` TIME(6)," \ - " MODIFY COLUMN `date_time` DATETIME(6)," \ - " MODIFY COLUMN `timestamp` TIMESTAMP(6)"); - t.commit (); - } - - string short_str (128, 's'); - string medium_str (250, 'm'); - string long_str (2040, 'l'); - - const char* sb (short_str.c_str ()), *se (sb + short_str.size ()); - const char* mb (medium_str.c_str ()), *me (mb + medium_str.size ()); - const char* lb (long_str.c_str ()), *le (lb + long_str.size ()); - - o.char_ = short_str; - o.binary_.assign (sb, se); - o.varchar_ = medium_str; - o.varbinary_.assign (mb, me); - o.tinytext_ = short_str; - o.tinyblob_.assign (sb, se); - o.text_ = long_str; - o.blob_.assign (lb, le); - o.mediumtext_ = long_str; - o.mediumblob_.assign (lb, le); - o.longtext_ = long_str; - o.longblob_.assign (lb, le); - - o.bit_.a = 1; - o.bit_.b = 0; - o.bit_.c = 0; - o.bit_.d = 1; - - o.enum_def_ = green; - o.enum_cst_ = blue; - o.enum_str_ = "green"; - o.set_.insert ("green"); - o.set_.insert ("red"); - o.set_.insert ("blue"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Test char array. - // - { - char_array o1 (1, ""); - char_array o2 (2, "1234567890"); - char_array o3 (3, "1234567890123456"); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (1)); - unique_ptr p2 (db->load (2)); - unique_ptr p3 (db->load (3)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - assert (o3 == *p3); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx deleted file mode 100644 index 82f7496..0000000 --- a/mysql/types/test.hxx +++ /dev/null @@ -1,328 +0,0 @@ -// file : mysql/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include // std::unique_ptr -#include // std::memcpy, std::str[n]cmp, std::strlen - -#include - -typedef std::vector buffer; - -struct date_time -{ - date_time () - { - } - - date_time (bool n, - unsigned int y, - unsigned int m, - unsigned int d, - unsigned int h, - unsigned int min, - unsigned int sec, - unsigned int msec = 0) - : negative (n), - year (y), - month (m), - day (d), - hour (h), - minute (min), - second (sec), - microseconds (msec) - { - } - - bool - operator== (const date_time& y) const - { - return - negative == y.negative && - year == y.year && - month == y.month && - day == y.day && - hour == y.hour && - minute == y.minute && - second == y.second && - microseconds == y.microseconds; - } - - bool negative; - unsigned int year; - unsigned int month; - unsigned int day; - unsigned int hour; - unsigned int minute; - unsigned int second; - unsigned int microseconds; -}; - -struct bitfield -{ - unsigned int a: 1; - unsigned int b: 1; - unsigned int c: 1; - unsigned int d: 1; -}; - -inline bool -operator== (bitfield x, bitfield y) -{ - return - x.a == y.a && - x.b == y.b && - x.c == y.c && - x.d == y.d; -} - -#pragma db value(bitfield) type ("BIT(4)") - -typedef std::set set; -typedef std::unique_ptr string_ptr; - -enum color {red, green, blue}; - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - // Integral types. - // - #pragma db type ("BOOL") - bool bool_; - - #pragma db type ("TINYINT") - signed char schar_; - - #pragma db type ("TINYINT UNSIGNED") - unsigned char uchar_; - - #pragma db type ("SMALLINT") - short short_; - - #pragma db type ("SMALLINT UNSIGNED") - unsigned short ushort_; - - #pragma db type ("MEDIUMINT") - int mint_; - - #pragma db type ("MEDIUMINT UNSIGNED") - unsigned int umint_; - - #pragma db type ("INT") - int int_; - - #pragma db type ("INT UNSIGNED") - unsigned int uint_; - - #pragma db type ("BIGINT") - long long long_long_; - - #pragma db type ("BIGINT UNSIGNED") - unsigned long long ulong_long_; - - // Float types. - // - #pragma db type ("FLOAT") - float float_; - - #pragma db type ("FLOAT(32)") - double float8_; - - #pragma db type ("DOUBLE") - double double_; - - #pragma db type ("DECIMAL(6,3)") - std::string decimal_; - - // Data-time types. - // - #pragma db type ("DATE") - date_time date_; - - #pragma db type ("TIME") - date_time time_; - - #pragma db type ("DATETIME") - date_time date_time_; - - #pragma db type ("TIMESTAMP") - date_time timestamp_; - - #pragma db type ("YEAR") - short year_; - - // String and binary types. - // - #pragma db type ("CHAR(128)") - std::string char_; - - #pragma db type ("BINARY(128)") - buffer binary_; - - #pragma db type ("VARCHAR(256)") - std::string varchar_; - - #pragma db type ("VARBINARY(256)") - buffer varbinary_; - - #pragma db type ("TINYTEXT") - std::string tinytext_; - - #pragma db type ("TINYBLOB") - buffer tinyblob_; - - #pragma db type ("TEXT") - std::string text_; - - #pragma db type ("BLOB") - buffer blob_; - - #pragma db type ("MEDIUMTEXT") - std::string mediumtext_; - - #pragma db type ("MEDIUMBLOB") - buffer mediumblob_; - - #pragma db type ("LONGTEXT") - std::string longtext_; - - #pragma db type ("LONGBLOB") - buffer longblob_; - - // Other types. - // - // #pragma db type ("BIT(4)") - assigned by #pragma db value - bitfield bit_; - - // Test ENUM representations (integer and string). - // - color enum_def_; - - // Map to a custom MySQL ENUM type. - // - #pragma db type ("ENUM('R', 'G', 'B')") - color enum_cst_; - - #pragma db type ("ENUM('red', 'green', 'blue')") - std::string enum_str_; - - #pragma db type ("SET('red', 'green', 'blue')") - set set_; - - // Test NULL value. - // - #pragma db type ("TEXT") null - string_ptr null_; - - bool - operator== (const object& y) const - { - return - id_ == y.id_ && - bool_ == y.bool_ && - schar_ == y.schar_ && - uchar_ == y.uchar_ && - short_ == y.short_ && - ushort_ == y.ushort_ && - mint_ == y.mint_ && - umint_ == y.umint_ && - int_ == y.int_ && - uint_ == y.uint_ && - long_long_ == y.long_long_ && - ulong_long_ == y.ulong_long_ && - float_ == y.float_ && - float8_ == y.float8_ && - double_ == y.double_ && - decimal_ == y.decimal_ && - date_ == y.date_ && - time_ == y.time_ && - date_time_ == y.date_time_ && - timestamp_ == y.timestamp_ && - year_ == y.year_ && - char_ == y.char_ && - binary_ == y.binary_ && - varchar_ == y.varchar_ && - varbinary_ == y.varbinary_ && - tinytext_ == y.tinytext_ && - tinyblob_ == y.tinyblob_ && - text_ == y.text_ && - blob_ == y.blob_ && - mediumtext_ == y.mediumtext_ && - mediumblob_ == y.mediumblob_ && - longtext_ == y.longtext_ && - longblob_ == y.longblob_ && - bit_ == y.bit_ && - enum_def_ == y.enum_def_ && - enum_cst_ == y.enum_cst_ && - enum_str_ == y.enum_str_ && - set_ == y.set_ && - ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); - } -}; - -// Test char array. -// -#pragma db object -struct char_array -{ - char_array () {} - char_array (unsigned long id, const char* s) - : id_ (id) - { - std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - std::memcpy (s2, s, std::strlen (s) + 1); - s3[0] = c1 = *s; - } - - #pragma db id - unsigned long id_; - - char s1[17]; - - #pragma db type("CHAR(16)") - char s2[16]; - - char s3[1]; - char c1; - - bool - operator== (const char_array& y) const - { - return id_ == y.id_ && - std::strcmp (s1, y.s1) == 0 && - std::strncmp (s2, y.s2, sizeof (s2)) == 0 && - s3[0] == y.s3[0] && - c1 == y.c1; - } -}; - -// MySQL server version view. -// -#pragma db view query( \ - "SELECT " \ - "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ - "@@protocol_version") -struct mysql_version -{ - unsigned int major; - unsigned int minor; - unsigned int release; - - unsigned int protocol; -}; - -#endif // TEST_HXX diff --git a/mysql/types/testscript b/mysql/types/testscript deleted file mode 100644 index 2962d1c..0000000 --- a/mysql/types/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : mysql/types/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../mysql.testscript - -+$create_schema - -: basics -: -$* diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx deleted file mode 100644 index d4ce200..0000000 --- a/mysql/types/traits.hxx +++ /dev/null @@ -1,198 +0,0 @@ -// file : mysql/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // std::memcpy, std::memset - -#include - -#include "test.hxx" // date_time, string_ptr - -namespace odb -{ - namespace mysql - { - template - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef MYSQL_TIME image_type; - - static void - set_value (date_time& v, const MYSQL_TIME& i, bool is_null) - { - if (!is_null) - { - v.negative = i.neg; - v.year = i.year; - v.month = i.month; - v.day = i.day; - v.hour = i.hour; - v.minute = i.minute; - v.second = i.second; - v.microseconds = static_cast (i.second_part); - } - else - v = date_time (); - } - - static void - set_image (MYSQL_TIME& i, bool& is_null, const date_time& v) - { - is_null = false; - i.neg = v.negative; - i.year = v.year; - i.month = v.month; - i.day = v.day; - i.hour = v.hour; - i.minute = v.minute; - i.second = v.second; - i.second_part = v.microseconds; - } - }; - - template <> - class value_traits - { - public: - typedef bitfield value_type; - typedef bitfield query_type; - typedef unsigned char* image_type; - - static void - set_value (bitfield& v, - const unsigned char* s, - std::size_t, - bool is_null) - { - if (!is_null) - { - v.a = *s & 1; - v.b = (*s >> 1) & 1; - v.c = (*s >> 2) & 1; - v.d = (*s >> 3) & 1; - } - else - v.a = v.b = v.c = v.d = 0; - } - - static void - set_image (unsigned char* s, - std::size_t, - std::size_t& n, - bool& is_null, - bitfield v) - { - is_null = false; - n = 1; - *s = v.a | (v.b << 1) | (v.c << 2) | (v.d << 3); - } - }; - - template <> - class value_traits - { - public: - typedef set value_type; - typedef set query_type; - typedef details::buffer image_type; - - static void - set_value (set& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.clear (); - - if (!is_null) - { - const char* s (b.data ()); - const char* e (s + n); - - while (s < e) - { - const char* p (s); - - while (p < e && *p != ',') - ++p; - - v.insert (std::string (s, p - s)); - s = p; - - if (p != e) - ++s; - } - } - } - - static void - set_image (details::buffer& buf, - std::size_t& n, - bool& is_null, - const set& v) - { - is_null = false; - n = 0; - - for (set::const_iterator b (v.begin ()), i (b); i != v.end (); ++i) - { - std::size_t m (i->size () + (i != b ? 1 : 0)); - - if (n + m > buf.capacity ()) - buf.capacity (n + m, n); - - if (i != b) - buf.data ()[n++] = ','; - - std::memcpy (buf.data () + n, i->c_str (), i->size ()); - n += i->size (); - } - } - }; - - template <> - class value_traits - { - public: - typedef string_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (string_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const string_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_HXX diff --git a/odb-tests/.gitignore b/odb-tests/.gitignore new file mode 100644 index 0000000..e3bbf5b --- /dev/null +++ b/odb-tests/.gitignore @@ -0,0 +1,41 @@ +# Compiler/linker output. +# +*.d +*.t +*.i +*.i.* +*.ii +*.ii.* +*.o +*.obj +*.gcm +*.pcm +*.ifc +*.so +*.dylib +*.dll +*.a +*.lib +*.exp +*.pdb +*.ilk +*.exe +*.exe.dlls/ +*.exe.manifest +*.pc + +# Test executables. +# +driver + +# ODB-generated files. +# +test-odb.?xx +test-odb-*.?xx +test.sql +test-*.sql + +# Testscript output directories (can be symlinks). +# +test +test-driver diff --git a/odb-tests/GPLv2 b/odb-tests/GPLv2 new file mode 100644 index 0000000..3912109 --- /dev/null +++ b/odb-tests/GPLv2 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 more 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/odb-tests/LICENSE b/odb-tests/LICENSE new file mode 100644 index 0000000..9d92da1 --- /dev/null +++ b/odb-tests/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2009-2024 Code Synthesis Tools CC. + +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. + +For more information on ODB licensing as well as for answers to +some of the common licensing questions, visit the ODB License +page: + +http://www.codesynthesis.com/products/odb/license.xhtml + +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/odb-tests/README.md b/odb-tests/README.md new file mode 100644 index 0000000..24d3bf7 --- /dev/null +++ b/odb-tests/README.md @@ -0,0 +1,4 @@ +# odb-tests - tests for ODB compiler + +This package contains tests for `odb`, object-relational mapping (ORM) +compiler for C++. diff --git a/odb-tests/boost/common/multi-index/driver.cxx b/odb-tests/boost/common/multi-index/driver.cxx new file mode 100644 index 0000000..a077008 --- /dev/null +++ b/odb-tests/boost/common/multi-index/driver.cxx @@ -0,0 +1,189 @@ +// file : boost/common/multi-index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Boost multi-index container persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + { + using namespace odb; + + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_set); + + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_ordered); + assert (odb::access::container_traits::kind == ck_set); + } + + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + // + // med + // + med.il.push_back (234); + med.il.push_back (123); + + med.iv.push_back (234); + med.iv.push_back (123); + + med.is.insert (234); + med.is.insert (123); + + med.ils.push_back (234); + med.ils.push_back (123); + + med.csv.insert (comp (234, "bcd")); + med.csv.insert (comp (123, "abc")); + + med.css.insert (comp (234, "bcd")); + med.css.insert (comp (123, "abc")); + + // + // full + // + full.il.push_back (2345); + full.il.push_back (1234); + full.il.push_back (3456); + + full.iv.push_back (2345); + full.iv.push_back (1234); + full.iv.push_back (3456); + + full.is.insert (2345); + full.is.insert (1234); + full.is.insert (3456); + + full.ils.push_back (2345); + full.ils.push_back (1234); + full.ils.push_back (3456); + + full.csv.insert (comp (234, "bcde")); + full.csv.insert (comp (123, "abcd")); + full.csv.insert (comp (234, "cdef")); + + full.css.insert (comp (234, "bcde")); + full.css.insert (comp (123, "abcd")); + full.css.insert (comp (234, "cdef")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // empty + // + empty.il.push_back (12); + empty.iv.push_back (12); + empty.is.insert (12); + empty.ils.push_back (12); + empty.csv.insert (comp (12, "ab")); + empty.css.insert (comp (12, "ab")); + + // med + // + med.il.clear (); + med.iv.clear (); + med.is.clear (); + med.ils.clear (); + med.csv.clear (); + med.css.clear (); + + // full + // + full.il.push_back (4567); + full.iv.push_back (4567); + full.is.insert (4567); + full.ils.push_back (4567); + full.csv.insert (comp (4567, "defg")); + full.css.insert (comp (4567, "defg")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/multi-index/test.hxx b/odb-tests/boost/common/multi-index/test.hxx new file mode 100644 index 0000000..22b9ea4 --- /dev/null +++ b/odb-tests/boost/common/multi-index/test.hxx @@ -0,0 +1,113 @@ +// file : boost/common/multi-index/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include + +#include + +namespace mi = boost::multi_index; + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +typedef +mi::multi_index_container< + int, + mi::indexed_by > +> int_lst; + +typedef +mi::multi_index_container< + int, + mi::indexed_by > +> int_vec; + +typedef +mi::multi_index_container< + int, + mi::indexed_by > > +> int_set; + +typedef +mi::multi_index_container< + int, + mi::indexed_by< + mi::sequenced<>, + mi::ordered_unique > + > +> int_lst_set; + +typedef +mi::multi_index_container< + comp, + mi::indexed_by< + mi::ordered_unique >, + mi::random_access<> + > +> comp_set_vec; + +typedef +mi::multi_index_container< + comp, + mi::indexed_by< + mi::ordered_unique >, + mi::ordered_unique > + > +> comp_set_set; + +#pragma db object +struct object +{ + object () {} + object (const std::string& id): id (id) {} + + #pragma db id + std::string id; + + int_lst il; + int_lst iv; + int_set is; + + int_lst_set ils; + comp_set_vec csv; + comp_set_set css; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id == y.id && + + x.il == y.il && + x.iv == y.iv && + x.is == y.is && + + x.ils == y.ils && + x.csv == y.csv && + x.css == y.css; +} + +#endif // TEST_HXX diff --git a/odb-tests/boost/common/optional/driver.cxx b/odb-tests/boost/common/optional/driver.cxx new file mode 100644 index 0000000..c2e3079 --- /dev/null +++ b/odb-tests/boost/common/optional/driver.cxx @@ -0,0 +1,74 @@ +// file : boost/common/optional/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost::optional persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + object o1 (1); + object o2 (2); + o2.str = "abc"; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + auto_ptr o2 (db->load (2)); + t.commit (); + + assert (!o1->str); + assert (o2->str && *o2->str == "abc"); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::str.is_null ())); + assert (!r.empty ()); + } + + { + result r (db->query (query::str == "abc")); + assert (!r.empty ()); + } + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/optional/test.hxx b/odb-tests/boost/common/optional/test.hxx new file mode 100644 index 0000000..65d951e --- /dev/null +++ b/odb-tests/boost/common/optional/test.hxx @@ -0,0 +1,31 @@ +// file : boost/common/optional/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + boost::optional str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/common/smart-ptr/driver.cxx b/odb-tests/boost/common/smart-ptr/driver.cxx new file mode 100644 index 0000000..4bc6366 --- /dev/null +++ b/odb-tests/boost/common/smart-ptr/driver.cxx @@ -0,0 +1,202 @@ +// file : boost/common/smart-ptr/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost smart pointers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace odb::boost; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + using boost::shared_ptr; + + try + { + auto_ptr db (create_database (argc, argv)); + + shared_ptr c1 (new cont (1)); + { + transaction t (db->begin ()); + db->persist (c1); + t.commit (); + } + + // Test comparison operators. + // + { + assert (lazy_shared_ptr () == lazy_shared_ptr ()); + assert (lazy_shared_ptr () != lazy_shared_ptr (c1)); + assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); + + lazy_shared_ptr lc1 (*db, 1); + assert (lc1 != lazy_shared_ptr ()); + assert (lc1 == lazy_shared_ptr (*db, c1)); + + shared_ptr c2 (new cont (2)); + assert (lc1 != lazy_shared_ptr (*db, c2)); + } + + // Test swap. + // + { + lazy_shared_ptr lx (*db, 1), ly; + assert (lx == lazy_shared_ptr (*db, c1)); + + swap (lx, ly); + assert (lx == lazy_shared_ptr ()); + assert (ly == lazy_shared_ptr (*db, c1)); + } + + // Test assignment from auto_ptr. + // + { + cont* p = new cont (3); + auto_ptr a (p); + lazy_shared_ptr l; + l = a; + + assert (l.get() == p); + assert (!a.get ()); + } + + shared_ptr o1 (new obj (1)); + shared_ptr o2 (new obj (2)); + shared_ptr o3 (new obj (3)); + shared_ptr o4 (new obj (4)); + shared_ptr c2 (new cont (2)); + + o1->c = c1; + o2->c = c1; + o3->c = c2; + o4->c = c2; + + // Persist. + // + { + transaction t (db->begin ()); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + db->persist (c2); + + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + + shared_ptr c (db->load (1)); + shared_ptr o (db->load (1)); + + // Ensure that lazy pointers are present but not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + assert (!o->c.loaded ()); + + // Ensure that the correct object IDs were loaded. + // + assert (c->o[0].object_id () == 1); + assert (c->o[1].object_id () == 2); + assert (o->c.object_id () == 1); + + // Load the lazy pointer targets ensuring that the loaded + // targets correspond to the cached session objects. + // + shared_ptr cl (o->c.load ()); + shared_ptr ol (c->o[0].load ()); + + assert (c->o[0].loaded ()); + assert (o->c.loaded ()); + + assert (cl == c); + assert (ol == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + // + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + lazy_shared_ptr l (c->o[1].lock ()); + assert (!l.loaded ()); + assert (l.object_id () == c->o[1].object_id ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + + shared_ptr ol (c->o[1].load ()); + assert (c->o[1].loaded ()); + + ol.reset (); + assert (!c->o[1].loaded ()); + + ol = c->o[1].load (); + assert (c->o[1].loaded ()); + + t.commit (); + } + + // + // Test shared_ptr as a value wrapper. + // + + { + obj2 o1 (1); + obj2 o2 (2); + o2.str.reset (new string ("abc")); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + shared_ptr o1 (db->load (1)); + shared_ptr o2 (db->load (2)); + t.commit (); + + assert (!o1->str); + assert (o2->str && *o2->str == "abc"); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/smart-ptr/test.hxx b/odb-tests/boost/common/smart-ptr/test.hxx new file mode 100644 index 0000000..26d7109 --- /dev/null +++ b/odb-tests/boost/common/smart-ptr/test.hxx @@ -0,0 +1,82 @@ +// file : boost/common/smart-ptr/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#include +#include + +struct obj; + +using boost::shared_ptr; +using odb::boost::lazy_shared_ptr; +using odb::boost::lazy_weak_ptr; + +#pragma db object +struct cont +{ + cont () + { + } + + cont (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) value_not_null + obj_list o; +}; + +#pragma db object +struct obj +{ + obj () + { + } + + obj (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_shared_ptr c; +}; + +// Test shared_ptr as a value wrapper. +// +#pragma db object +struct obj2 +{ + obj2 () + { + } + + obj2 (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db null + shared_ptr str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/common/template/driver.cxx b/odb-tests/boost/common/template/driver.cxx new file mode 100644 index 0000000..43e28c0 --- /dev/null +++ b/odb-tests/boost/common/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/common/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/template/template-vc10.vcxproj b/odb-tests/boost/common/template/template-vc10.vcxproj new file mode 100644 index 0000000..3c606f9 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/common/template/template-vc10.vcxproj.filters b/odb-tests/boost/common/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/common/template/template-vc11.vcxproj b/odb-tests/boost/common/template/template-vc11.vcxproj new file mode 100644 index 0000000..83d20c5 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/common/template/template-vc11.vcxproj.filters b/odb-tests/boost/common/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/common/template/template-vc12.vcxproj b/odb-tests/boost/common/template/template-vc12.vcxproj new file mode 100644 index 0000000..fd147f7 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/common/template/template-vc12.vcxproj.filters b/odb-tests/boost/common/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/common/template/template-vc8.vcproj b/odb-tests/boost/common/template/template-vc8.vcproj new file mode 100644 index 0000000..e0ac609 --- /dev/null +++ b/odb-tests/boost/common/template/template-vc8.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/common/template/template-vc9.vcproj b/odb-tests/boost/common/template/template-vc9.vcproj new file mode 100644 index 0000000..b8bf4bc --- /dev/null +++ b/odb-tests/boost/common/template/template-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/common/template/test.hxx b/odb-tests/boost/common/template/test.hxx new file mode 100644 index 0000000..1d2a5f3 --- /dev/null +++ b/odb-tests/boost/common/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/common/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/common/unordered/driver.cxx b/odb-tests/boost/common/unordered/driver.cxx new file mode 100644 index 0000000..eda5891 --- /dev/null +++ b/odb-tests/boost/common/unordered/driver.cxx @@ -0,0 +1,212 @@ +// file : boost/common/unordered/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Boost unordered containers persistence. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + // + // med + // + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + med.cms.insert (comp (123, "aaa")); + med.cms.insert (comp (234, "bbbb")); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csmm.insert ( + comp_str_multimap::value_type (comp (123, "aaa"), "aaa")); + med.csmm.insert ( + comp_str_multimap::value_type (comp (234, "bbbb"), "bbbb")); + + // + // full + // + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + full.cms.insert (comp (1234, "aaaa")); + full.cms.insert (comp (2345, "bbbbb")); + full.cms.insert (comp (3456, "cccccc")); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbbb"] = 2345; + full.snm["cccccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csmm.insert ( + comp_str_multimap::value_type (comp (1234, "aaaa"), "aaaa")); + full.csmm.insert ( + comp_str_multimap::value_type (comp (2345, "bbbbb"), "bbbbb")); + full.csmm.insert ( + comp_str_multimap::value_type (comp (3456, "cccccc"), "cccccc")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // empty + // + empty.ns.insert (12); + empty.ss.insert ("aa"); + empty.cms.insert (comp (12, "aa")); + + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csmm.insert ( + comp_str_multimap::value_type (comp (12, "aa"), "aa")); + + // med + // + med.ns.clear (); + med.ss.clear (); + med.cms.clear (); + + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csmm.clear (); + + // full + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + full.cms.insert (comp (4567, "ddddddd")); + + full.nsm[3456] += 'c'; + full.nsm[4567] = "ddddddd"; + full.snm["cccccc"]++; + full.snm["ddddddd"] = 4567; + full.ncm[3456].num++; + full.ncm[3456].str += 'c'; + full.ncm[4567] = comp (4567, "ddddddd"); + full.csmm.find (comp (3456, "cccccc"))->second += "c"; + full.csmm.insert ( + comp_str_multimap::value_type (comp (4567, "ddddddd"), "ddddddd")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/unordered/test.hxx b/odb-tests/boost/common/unordered/test.hxx new file mode 100644 index 0000000..cd77845 --- /dev/null +++ b/odb-tests/boost/common/unordered/test.hxx @@ -0,0 +1,113 @@ +// file : boost/common/unordered/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator!= (const comp& x, const comp& y) +{ + return !(x == y); +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +inline std::size_t +hash_value (const comp& x) +{ + std::size_t seed = 0; + boost::hash_combine (seed, x.num); + boost::hash_combine (seed, x.str); + return seed; +} + +using boost::unordered_set; +using boost::unordered_multiset; + +typedef unordered_set num_set; +typedef unordered_set str_set; +typedef unordered_multiset comp_multiset; + +using boost::unordered_map; +using boost::unordered_multimap; + +typedef unordered_map num_str_map; +typedef unordered_map str_num_map; +typedef unordered_map num_comp_map; +typedef unordered_multimap comp_str_multimap; + +#pragma db object +struct object +{ + object () + { + } + + object (const std::string& id) + : id (id) + { + } + + + #pragma db id + std::string id; + + // set + // + num_set ns; + str_set ss; + comp_multiset cms; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_multimap csmm; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return + x.id == y.id && + + x.ns == y.ns && + x.ss == y.ss && + x.cms == y.cms && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csmm == y.csmm; +} + +#endif // TEST_HXX diff --git a/odb-tests/boost/common/uuid/driver.cxx b/odb-tests/boost/common/uuid/driver.cxx new file mode 100644 index 0000000..aed3390 --- /dev/null +++ b/odb-tests/boost/common/uuid/driver.cxx @@ -0,0 +1,69 @@ +// file : boost/common/uuid/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Boost UUID persistence. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace boost::uuids; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.uuid_ = random_generator() (); + o.null_ = nil_uuid (); + o.zero_ = nil_uuid (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::uuid == o.uuid_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->id_ == o.id_); + assert (++i == r.end ()); + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/common/uuid/test.hxx b/odb-tests/boost/common/uuid/test.hxx new file mode 100644 index 0000000..82ed95b --- /dev/null +++ b/odb-tests/boost/common/uuid/test.hxx @@ -0,0 +1,37 @@ +// file : boost/common/uuid/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + typedef boost::uuids::uuid uuid; + + uuid uuid_; + uuid null_; + + #pragma db not_null + uuid zero_; + + bool operator== (const object& x) const + { + return id_ == x.id_ && + uuid_ == x.uuid_ && + null_ == x.null_ && + zero_ == x.zero_; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/mssql/date-time/driver.cxx b/odb-tests/boost/mssql/date-time/driver.cxx new file mode 100644 index 0000000..e97a276 --- /dev/null +++ b/odb-tests/boost/mssql/date-time/driver.cxx @@ -0,0 +1,158 @@ +// file : boost/mssql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (ptime (max_date_time)); +#endif + + // In DATETIME fractional seconds are rounded to .000, .003, or .007. + // + o.times_dt.push_back (ptime (date (2012, 1, 13), + time_duration (11, 57, 13, 7000))); + + // SMALLDATETIME doesn't have seconds (always 0). + // + o.times_sdt.push_back (ptime (date (2012, 1, 13), + time_duration (11, 57, 0, 0))); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.durations.push_back (time_duration (1, 2, 3, 123456)); + o.durations.push_back (not_a_date_time); +#endif + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + // Test invalid date mappings. + // + { + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid ptime mappings. + // + { + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid time_duration mappings. + // + { + object sv1, sv2, or1; + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + or1.durations.push_back (time_duration (50, 2, 3, 123456700)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + + try + { + db->persist (or1); + assert (false); + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + t.commit (); + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} diff --git a/odb-tests/boost/mssql/date-time/test.hxx b/odb-tests/boost/mssql/date-time/test.hxx new file mode 100644 index 0000000..ed2276b --- /dev/null +++ b/odb-tests/boost/mssql/date-time/test.hxx @@ -0,0 +1,58 @@ +// file : boost/mssql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + #pragma db id auto + unsigned long id; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + std::vector dates; + + std::vector times; +#endif + + #pragma db value_type("DATETIME") + std::vector times_dt; + + #pragma db value_type("SMALLDATETIME") + std::vector times_sdt; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + std::vector durations; +#endif + + bool + operator== (const object& x) const + { + return + id == x.id +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && dates == x.dates + && times == x.times +#endif + && times_dt == x.times_dt + && times_sdt == x.times_sdt +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && durations == x.durations +#endif + ; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/mssql/template/driver.cxx b/odb-tests/boost/mssql/template/driver.cxx new file mode 100644 index 0000000..37614c4 --- /dev/null +++ b/odb-tests/boost/mssql/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/mssql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/mssql/template/template-vc10.vcxproj b/odb-tests/boost/mssql/template/template-vc10.vcxproj new file mode 100644 index 0000000..dcb625e --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mssql/template/template-vc10.vcxproj.filters b/odb-tests/boost/mssql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mssql/template/template-vc11.vcxproj b/odb-tests/boost/mssql/template/template-vc11.vcxproj new file mode 100644 index 0000000..d5951f1 --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mssql/template/template-vc11.vcxproj.filters b/odb-tests/boost/mssql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mssql/template/template-vc12.vcxproj b/odb-tests/boost/mssql/template/template-vc12.vcxproj new file mode 100644 index 0000000..e0cb56f --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mssql/template/template-vc12.vcxproj.filters b/odb-tests/boost/mssql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mssql/template/template-vc8.vcproj b/odb-tests/boost/mssql/template/template-vc8.vcproj new file mode 100644 index 0000000..6d1c40b --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/mssql/template/template-vc9.vcproj b/odb-tests/boost/mssql/template/template-vc9.vcproj new file mode 100644 index 0000000..422fbd7 --- /dev/null +++ b/odb-tests/boost/mssql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/mssql/template/test.hxx b/odb-tests/boost/mssql/template/test.hxx new file mode 100644 index 0000000..753498f --- /dev/null +++ b/odb-tests/boost/mssql/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/mssql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/mysql/date-time/driver.cxx b/odb-tests/boost/mysql/date-time/driver.cxx new file mode 100644 index 0000000..8959f0c --- /dev/null +++ b/odb-tests/boost/mysql/date-time/driver.cxx @@ -0,0 +1,218 @@ +// file : boost/mysql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + // If we are running against MySQL 5.6.4 or later alter the tables + // to allow sub-second precision. + // + bool fs (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))); + if (fs) + { + transaction t (db->begin ()); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_durations`" \ + " MODIFY COLUMN `value` TIME(6)"); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_times`" \ + " MODIFY COLUMN `value` DATETIME(6)"); + + db->execute ("ALTER TABLE `boost_mysql_dt_object_timestamps`" \ + " MODIFY COLUMN `value` TIMESTAMP(6) NULL"); + + t.commit (); + } + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + if (fs) + o.times.push_back (microsec_clock::local_time ()); + else + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + + // MySQL prior to 5.6.4 does not support fraction seconds. Construct + // with zero fractional seconds so that comparison test does not fail + // for invalid reasons. + // + o.times.push_back ( + ptime ( + date (max_date_time), + time_duration ( + ptime (max_date_time).time_of_day ().hours (), + ptime (max_date_time).time_of_day ().minutes (), + ptime (max_date_time).time_of_day ().seconds ()))); + + if (fs) + o.timestamps.push_back (microsec_clock::local_time ()); + else + o.timestamps.push_back (second_clock::local_time ()); + o.timestamps.push_back (not_a_date_time); + + o.durations.push_back (time_duration (1, 2, 3)); + if (fs) + o.durations.back () += time_duration (microseconds (123456)); + o.durations.push_back (time_duration (-1, 2, 3)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + + { + // Test invalid ptime (DATETIME) mappings. + // + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime (TIMESTAMP) mappings. + // + object or1, or2, sv1, sv2; + or1.timestamps.push_back (min_date_time); + or2.timestamps.push_back (max_date_time); + sv1.timestamps.push_back (neg_infin); + sv2.timestamps.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_out_of_range_value (or2, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid time_duration mappings. + // + object or1, or2, sv1, sv2; + or1.durations.push_back (time_duration (850, 0, 0)); + or2.durations.push_back (time_duration (-850, 0, 0)); + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_out_of_range_value (or2, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/odb-tests/boost/mysql/date-time/test.hxx b/odb-tests/boost/mysql/date-time/test.hxx new file mode 100644 index 0000000..bf73b09 --- /dev/null +++ b/odb-tests/boost/mysql/date-time/test.hxx @@ -0,0 +1,65 @@ +// file : boost/mysql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + timestamps == x.timestamps && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + + // Make timestamp NULL-able to suppress the auto-initialization and + // auto-update characteristics of the TIMESTAMP datatype, and to + // allow NULL values. + // + #pragma db value_type ("TIMESTAMP") value_null + std::vector timestamps; + + std::vector durations; +}; + +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/mysql/template/driver.cxx b/odb-tests/boost/mysql/template/driver.cxx new file mode 100644 index 0000000..1164950 --- /dev/null +++ b/odb-tests/boost/mysql/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/mysql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/mysql/template/template-vc10.vcxproj b/odb-tests/boost/mysql/template/template-vc10.vcxproj new file mode 100644 index 0000000..3137abc --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mysql/template/template-vc10.vcxproj.filters b/odb-tests/boost/mysql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mysql/template/template-vc11.vcxproj b/odb-tests/boost/mysql/template/template-vc11.vcxproj new file mode 100644 index 0000000..bc4b5a4 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mysql/template/template-vc11.vcxproj.filters b/odb-tests/boost/mysql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mysql/template/template-vc12.vcxproj b/odb-tests/boost/mysql/template/template-vc12.vcxproj new file mode 100644 index 0000000..e7d70bc --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/mysql/template/template-vc12.vcxproj.filters b/odb-tests/boost/mysql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/mysql/template/template-vc8.vcproj b/odb-tests/boost/mysql/template/template-vc8.vcproj new file mode 100644 index 0000000..2ef0383 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/mysql/template/template-vc9.vcproj b/odb-tests/boost/mysql/template/template-vc9.vcproj new file mode 100644 index 0000000..b60c7e2 --- /dev/null +++ b/odb-tests/boost/mysql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/mysql/template/test.hxx b/odb-tests/boost/mysql/template/test.hxx new file mode 100644 index 0000000..7c97ca2 --- /dev/null +++ b/odb-tests/boost/mysql/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/mysql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/oracle/date-time/driver.cxx b/odb-tests/boost/oracle/date-time/driver.cxx new file mode 100644 index 0000000..82294c7 --- /dev/null +++ b/odb-tests/boost/oracle/date-time/driver.cxx @@ -0,0 +1,136 @@ +// file : boost/oracle/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (ptime (max_date_time)); + + o.times_d.push_back (ptime (date (2012, 6, 27), + time_duration (14, 17, 05, 0))); + o.times_d.push_back (not_a_date_time); + + o.durations.push_back (time_duration (1, 2, 3, 123456)); + o.durations.push_back (time_duration (-1, 2, 3)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + // Test invalid date mappings. + // + { + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid ptime mappings. + // + { + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid time_duration mappings. + // + { + object sv1, sv2; + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} diff --git a/odb-tests/boost/oracle/date-time/test.hxx b/odb-tests/boost/oracle/date-time/test.hxx new file mode 100644 index 0000000..5eaab88 --- /dev/null +++ b/odb-tests/boost/oracle/date-time/test.hxx @@ -0,0 +1,42 @@ +// file : boost/oracle/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + times_d == x.times_d && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + #pragma db value_type("DATE") + std::vector times_d; + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/oracle/template/driver.cxx b/odb-tests/boost/oracle/template/driver.cxx new file mode 100644 index 0000000..892b58f --- /dev/null +++ b/odb-tests/boost/oracle/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/oracle/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/oracle/template/template-vc10.vcxproj b/odb-tests/boost/oracle/template/template-vc10.vcxproj new file mode 100644 index 0000000..0c93020 --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/oracle/template/template-vc10.vcxproj.filters b/odb-tests/boost/oracle/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/oracle/template/template-vc11.vcxproj b/odb-tests/boost/oracle/template/template-vc11.vcxproj new file mode 100644 index 0000000..4df5f5b --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/oracle/template/template-vc11.vcxproj.filters b/odb-tests/boost/oracle/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/oracle/template/template-vc12.vcxproj b/odb-tests/boost/oracle/template/template-vc12.vcxproj new file mode 100644 index 0000000..0b942bc --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/oracle/template/template-vc12.vcxproj.filters b/odb-tests/boost/oracle/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/oracle/template/template-vc8.vcproj b/odb-tests/boost/oracle/template/template-vc8.vcproj new file mode 100644 index 0000000..c13f330 --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/oracle/template/template-vc9.vcproj b/odb-tests/boost/oracle/template/template-vc9.vcproj new file mode 100644 index 0000000..a3061ee --- /dev/null +++ b/odb-tests/boost/oracle/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/oracle/template/test.hxx b/odb-tests/boost/oracle/template/test.hxx new file mode 100644 index 0000000..141b6cd --- /dev/null +++ b/odb-tests/boost/oracle/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/oracle/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/pgsql/date-time/driver.cxx b/odb-tests/boost/pgsql/date-time/driver.cxx new file mode 100644 index 0000000..94fcc46 --- /dev/null +++ b/odb-tests/boost/pgsql/date-time/driver.cxx @@ -0,0 +1,157 @@ +// file : boost/pgsql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (microsec_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (pos_infin); + o.times.push_back (neg_infin); + o.times.push_back (ptime (date (max_date_time), + time_duration (16, 23, 0, 123456))); + o.times.push_back (ptime (date (min_date_time), + time_duration (3, 14, 7, 123456))); + o.times.push_back (ptime (date (1969, 12, 31), // Before PG epoch. + time_duration (23, 59, 59, 123000))); + + o.durations.push_back (time_duration (0, 0, 0)); + o.durations.push_back (time_duration (12, 3, 4, 123456)); + o.durations.push_back (time_duration (23, 59, 59, 123456)); + o.durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime mappings. + // + // object sv1, sv2; + // sv1.times.push_back (neg_infin); + // sv2.times.push_back (pos_infin); + + // transaction t (db->begin ()); + // assert (test_invalid_special_value (sv1, db)); + // assert (test_invalid_special_value (sv2, db)); + // t.commit (); + } + + { + // Test invalid time_duration mappings. + // + // object or1, sv1, sv2; + // or1.durations.push_back (time_duration (0, 0, -1)); + // sv1.durations.push_back (pos_infin); + // sv2.durations.push_back (neg_infin); + + // transaction t (db->begin ()); + // assert (test_out_of_range_value (or1, db)); + // assert (test_invalid_special_value (sv1, db)); + // assert (test_invalid_special_value (sv2, db)); + // t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/odb-tests/boost/pgsql/date-time/test.hxx b/odb-tests/boost/pgsql/date-time/test.hxx new file mode 100644 index 0000000..0b08093 --- /dev/null +++ b/odb-tests/boost/pgsql/date-time/test.hxx @@ -0,0 +1,39 @@ +// file : boost/pgsql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + durations == x.durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + std::vector durations; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/pgsql/template/driver.cxx b/odb-tests/boost/pgsql/template/driver.cxx new file mode 100644 index 0000000..ed2d8a4 --- /dev/null +++ b/odb-tests/boost/pgsql/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/pgsql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/pgsql/template/template-vc10.vcxproj b/odb-tests/boost/pgsql/template/template-vc10.vcxproj new file mode 100644 index 0000000..7bc0243 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/pgsql/template/template-vc10.vcxproj.filters b/odb-tests/boost/pgsql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/pgsql/template/template-vc11.vcxproj b/odb-tests/boost/pgsql/template/template-vc11.vcxproj new file mode 100644 index 0000000..9f8d2f0 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/pgsql/template/template-vc11.vcxproj.filters b/odb-tests/boost/pgsql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/pgsql/template/template-vc12.vcxproj b/odb-tests/boost/pgsql/template/template-vc12.vcxproj new file mode 100644 index 0000000..acbfc37 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/pgsql/template/template-vc12.vcxproj.filters b/odb-tests/boost/pgsql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/pgsql/template/template-vc8.vcproj b/odb-tests/boost/pgsql/template/template-vc8.vcproj new file mode 100644 index 0000000..65773c9 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/pgsql/template/template-vc9.vcproj b/odb-tests/boost/pgsql/template/template-vc9.vcproj new file mode 100644 index 0000000..db49496 --- /dev/null +++ b/odb-tests/boost/pgsql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/pgsql/template/test.hxx b/odb-tests/boost/pgsql/template/test.hxx new file mode 100644 index 0000000..56eda31 --- /dev/null +++ b/odb-tests/boost/pgsql/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/pgsql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/sqlite/date-time/driver.cxx b/odb-tests/boost/sqlite/date-time/driver.cxx new file mode 100644 index 0000000..97a7a0c --- /dev/null +++ b/odb-tests/boost/sqlite/date-time/driver.cxx @@ -0,0 +1,208 @@ +// file : boost/sqlite/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test boost date/time type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; + +using namespace boost::gregorian; +using namespace boost::posix_time; + +using namespace odb::core; + +bool +test_invalid_special_value (object&, auto_ptr&); + +bool +test_out_of_range_value (object&, auto_ptr&); + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Test all valid date-time mappings. + // + o.dates.push_back (day_clock::local_day ()); + o.dates.push_back (date (not_a_date_time)); + o.dates.push_back (date (max_date_time)); + o.dates.push_back (date (min_date_time)); + + o.times.push_back (second_clock::local_time ()); + o.times.push_back (not_a_date_time); + o.times.push_back (min_date_time); + o.times.push_back (max_date_time); + + o.durations.push_back (time_duration (123, 4, 5)); + o.durations.push_back (not_a_date_time); + + o.u_dates.push_back (day_clock::local_day ()); + o.u_dates.push_back (date (not_a_date_time)); + + // Boost seems to handle 64 bit std::time_t incorrectly. + // Insert 32 bit minimum and maximum UNIX time values for now. + // + // o.u_dates.push_back (date (max_date_time)); + // o.u_dates.push_back (date (min_date_time)); + // + o.u_dates.push_back (date (2038, 1, 19)); + o.u_dates.push_back (date (1901, 12, 14)); + + o.u_times.push_back (second_clock::local_time ()); + o.u_times.push_back (not_a_date_time); + o.u_times.push_back (ptime (date (1930, 1, 1), time_duration (0, 0, 0))); + + o.s_durations.push_back (time_duration (123, 4, 5)); + o.s_durations.push_back (time_duration (-12, 3, 4)); + o.s_durations.push_back (not_a_date_time); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + { + // Test invalid date mappings. + // + object sv1, sv2; + sv1.dates.push_back (date (neg_infin)); + sv2.dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid ptime mappings. + // + object sv1, sv2; + sv1.times.push_back (neg_infin); + sv2.times.push_back (pos_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid time_duration mappings. + // + object or1, sv1, sv2; + or1.durations.push_back (time_duration (0, 0, -1)); + sv1.durations.push_back (pos_infin); + sv2.durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, db)); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + { + // Test invalid UNIX date mappings. + // + object sv1, sv2; + sv1.u_dates.push_back (date (neg_infin)); + sv2.u_dates.push_back (date (pos_infin)); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid UNIX times mappings. + // + { + object sv1, sv2; + sv1.u_times.push_back (pos_infin); + sv2.u_times.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + + // Test invalid "seconds" duration mappings. + // + { + object sv1, sv2; + sv1.s_durations.push_back (pos_infin); + sv2.s_durations.push_back (neg_infin); + + transaction t (db->begin ()); + assert (test_invalid_special_value (sv1, db)); + assert (test_invalid_special_value (sv2, db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_invalid_special_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::special_value&) + { + } + + return true; +} + +bool +test_out_of_range_value (object& x, auto_ptr& db) +{ + try + { + db->persist (x); + return false; + } + catch (const odb::boost::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/odb-tests/boost/sqlite/date-time/test.hxx b/odb-tests/boost/sqlite/date-time/test.hxx new file mode 100644 index 0000000..924ce27 --- /dev/null +++ b/odb-tests/boost/sqlite/date-time/test.hxx @@ -0,0 +1,57 @@ +// file : boost/sqlite/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include + +#pragma db object +struct object +{ + object () + { + } + + bool + operator== (const object& x) const + { + return + id == x.id && + dates == x.dates && + times == x.times && + durations == x.durations && + u_dates == x.u_dates && + u_times == x.u_times && + s_durations == x.s_durations; + } + + #pragma db id auto + unsigned long id; + + std::vector dates; + std::vector times; + std::vector durations; + + // Dates as UNIX time. + // + #pragma db value_type("INTEGER") + std::vector u_dates; + + // Times as UNIX time. + // + #pragma db value_type("INTEGER") + std::vector u_times; + + // Durations as seconds. + // + #pragma db value_type("INTEGER") + std::vector s_durations; +}; + +#endif // TEST_HXX diff --git a/odb-tests/boost/sqlite/template/driver.cxx b/odb-tests/boost/sqlite/template/driver.cxx new file mode 100644 index 0000000..3e51eef --- /dev/null +++ b/odb-tests/boost/sqlite/template/driver.cxx @@ -0,0 +1,39 @@ +// file : boost/sqlite/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/boost/sqlite/template/template-vc10.vcxproj b/odb-tests/boost/sqlite/template/template-vc10.vcxproj new file mode 100644 index 0000000..f94df08 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/sqlite/template/template-vc10.vcxproj.filters b/odb-tests/boost/sqlite/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/sqlite/template/template-vc11.vcxproj b/odb-tests/boost/sqlite/template/template-vc11.vcxproj new file mode 100644 index 0000000..1c1a279 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/sqlite/template/template-vc11.vcxproj.filters b/odb-tests/boost/sqlite/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/sqlite/template/template-vc12.vcxproj b/odb-tests/boost/sqlite/template/template-vc12.vcxproj new file mode 100644 index 0000000..034b16c --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-boost-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;_SCL_SECURE_NO_WARNINGS;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-boost.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/boost/sqlite/template/template-vc12.vcxproj.filters b/odb-tests/boost/sqlite/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/boost/sqlite/template/template-vc8.vcproj b/odb-tests/boost/sqlite/template/template-vc8.vcproj new file mode 100644 index 0000000..df92637 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/sqlite/template/template-vc9.vcproj b/odb-tests/boost/sqlite/template/template-vc9.vcproj new file mode 100644 index 0000000..32fb152 --- /dev/null +++ b/odb-tests/boost/sqlite/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/boost/sqlite/template/test.hxx b/odb-tests/boost/sqlite/template/test.hxx new file mode 100644 index 0000000..b9daed6 --- /dev/null +++ b/odb-tests/boost/sqlite/template/test.hxx @@ -0,0 +1,25 @@ +// file : boost/sqlite/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/build/.gitignore b/odb-tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/odb-tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/odb-tests/build/bootstrap.build b/odb-tests/build/bootstrap.build new file mode 100644 index 0000000..2fb5824 --- /dev/null +++ b/odb-tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : build/bootstrap.build +# license : GNU GPL v2; see accompanying LICENSE file + +project = odb-tests + +using version +using config +using dist +using test diff --git a/odb-tests/build/export.build b/odb-tests/build/export.build new file mode 100644 index 0000000..3c073d3 --- /dev/null +++ b/odb-tests/build/export.build @@ -0,0 +1,9 @@ +# file : build/export.build +# license : GNU GPL v2; see accompanying LICENSE file + +$out_root/ +{ + include libcommon/ +} + +export $out_root/libcommon/$import.target diff --git a/odb-tests/build/root.build b/odb-tests/build/root.build new file mode 100644 index 0000000..5336399 --- /dev/null +++ b/odb-tests/build/root.build @@ -0,0 +1,270 @@ +# file : build/root.build +# license : GNU GPL v2; see accompanying LICENSE file + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +# List of the identifiers of the databases to compile and run the tests +# against. The valid identifiers are mysql, sqlite, pgsql, oracle, and mssql. +# +# @@ TODO: change to string_set once available. +# +config [strings] config.odb_tests.database + +assert ($defined(config.odb_tests.database) && \ + $size($config.odb_tests.database) > 0) \ +'at least one database must be configured via config.odb_tests.database variable' + +databases = $config.odb_tests.database + +mysql = false +sqlite = false +pgsql = false +oracle = false +mssql = false + +for db: $databases +{ + switch $db + { + case 'mysql' + mysql = true + + case 'sqlite' + sqlite = true + + case 'pgsql' + pgsql = true + + case 'oracle' + oracle = true + + case 'mssql' + mssql = true + + default + fail "invalid database '$db' specified in config.odb_tests.database value" + } +} + +# If true, then build and run the test drivers in the dynamic multi-database +# mode. +# +config [bool] config.odb_tests.multi_database ?= ($size($databases) > 1) +multi = $config.odb_tests.multi_database + +assert ($multi || $size($databases) == 1) \ +'only one database can be configured if config.odb_tests.multi_database value is false' + +# Database connections. +# + +# PostgreSQL +# +# The database user. Note that the named user must be allowed to connect to +# the database server without specifying credentials. +# +config [string] config.odb_tests.pgsql.user ?= 'odb_test' + +# The database name. Note that it WILL BE MODIFIED by the tests. +# +config [string] config.odb_tests.pgsql.database ?= 'odb_test' + +# The database host. Leaving this variable undefined results in using +# Unix-domain sockets. Machines without Unix-domain sockets will connect to +# localhost. +# +config [string] config.odb_tests.pgsql.host + +# The database port or the socket file name extension for Unix-domain +# connections. +# +config [string] config.odb_tests.pgsql.port + +# If true, then assume that libodb-pgsql supports the bulk operations. +# +# Note: config.odb_tests.pgsql.bulk_default is reflected from manifest. +# +config [bool] config.odb_tests.pgsql.bulk_default ?= false +config [bool] config.odb_tests.pgsql.bulk ?= ($cxx.target.class != 'windows' && \ + $config.odb_tests.pgsql.bulk_default) +pgsql_bulk = $config.odb_tests.pgsql.bulk + +# MySQL +# +# The database user. +# +config [string] config.odb_tests.mysql.user ?= 'odb_test' + +# The database password. +# +config [string] config.odb_tests.mysql.passwd + +# The database name. Note that it WILL BE MODIFIED by the tests. +# +config [string] config.odb_tests.mysql.database ?= 'odb_test' + +# The database host. +# +config [string] config.odb_tests.mysql.host + +# The database port. +# +config [uint64] config.odb_tests.mysql.port + +# The database socket path. +# +config [path] config.odb_tests.mysql.socket + +define sql: file +sql{*}: extension = sql + +define xml: file +xml{*}: extension = xml + +if ($build.mode != 'skeleton') +{ + if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + + switch $cxx.class + { + case 'gcc' + { + cxx.coptions += -Wno-unknown-pragmas + } + case 'msvc' + { + cxx.coptions += /wd4068 /wd4251 /wd4275 /wd4800 + } + } + + # @@ BUILD2 Clang issues the following warnings while compile the + # odb-generated headers: + # + # In file included from odb-tests/common/view/olv/test1-odb-sqlite.cxx:10: + # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: warning: instantiation of variable 'odb::query_columns>::id' required here, but no definition is available [-Wundefined-var-template] + # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, + # | ^ + # odb-tests/common/view/olv/test1-odb.hxx:91:21: note: forward declaration of template entity is here + # 91 | static id_type_ id; + # | ^ + # odb-tests/common/view/olv/test1-odb-sqlite.hxx:68:80: note: add an explicit instantiation declaration to suppress this warning if 'odb::query_columns>::id' is explicitly instantiated in another translation unit + # 68 | id (query_columns< ::test1::object1, id_common, typename A::common_traits >::id, + # + # Note: -Wno-undefined-var-template is temporarily added to suppress them. + # + if ($cxx.id.type == 'clang') + cxx.coptions += -Wno-undefined-var-template + + # Import odb that we are testing. + # + import! [metadata] odb = odb%exe{odb} + + # Import the mysql client for creating the database schemas, etc. + # + if $mysql + { + import! mysql_client = mysql%exe{mysql} + testscript{*}: mysql_client = $mysql_client + } + + # Import the psql client for creating the database schemas, etc. + # + if $pgsql + { + import! pgsql_client = psql%exe{psql} + testscript{*}: pgsql_client = $pgsql_client + } + + # Note that we need ((-.+)?) instead of just (-.+)? because we use this + # capture as a back-reference in the pattern. + # + [rule_name=odb_compile] \ + : hxx{~'/\1/'} libue{~'/.+-meta/'} $odb + {{ + pops = $cxx.lib_poptions($<[1]) + depdb hash $pops + + hp = $path($>[0]) + bn = $base($leaf($hp)) + db = $regex.replace($bn, '.+-odb(-(.+))?', '\2') + + if ($db == '') # *-odb.?xx target group? + db = ($multi ? 'common' : $databases[0]) + end + + # If the external SQL schema file will be generated, then add it as a + # dynamic target group member. + # + # @@ BUILD2 Probably we should add support for --generate-dep ODB compiler + # option. Then presumably this will be take care of automatically. + # + # We assume that the '--generate-schema' and '--schema-format' strings + # will never appear as standalone option values. + # + if ($db != 'common' && $regex.find_match($odb_options, '--generate-schema')) + schema_format = ($db == 'sqlite' ? 'embedded' : 'sql') + + for o: $odb_options + if ($o == '--schema-format') + schema_format = [null] # Indicate that the schema format comes next. + elif ($schema_format == [null]) + schema_format = $o + end + end + else + schema_format = '' + end + + t = ($schema_format == 'sql' \ + ? $directory($hp)/$regex.replace($bn, '(.+)-odb(-.+)?', '\1\2').sql \ + : '') + + depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ + -- echo "$t" + + $odb --std c++11 \ + ($multi ? --multi-database dynamic : ) \ + --database $db \ + --output-dir $out_base \ + $odb_options \ + "-I$src_base" \ + $pops \ + $path($<[0]) + }} + + # Every exe{} in this project is by default a test. + # + exe{*}: test = true + + # Specify the test target for cross-testing. + # + test.target = $cxx.target +} + +# The helper targets which can be used as prerequisites of test drivers +# which require either a specific database client or multiple clients for +# all the enabled databases. +# +alias{mysql-client}: $mysql_client: +{ + include = $mysql + clean = false +} + +alias{pgsql-client}: $pgsql_client: +{ + include = $pgsql + clean = false +} + +alias{database-client}: alias{mysql-client pgsql-client} diff --git a/odb-tests/buildfile b/odb-tests/buildfile new file mode 100644 index 0000000..2acd9fc --- /dev/null +++ b/odb-tests/buildfile @@ -0,0 +1,10 @@ +# file : buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: libcommon/ common/ doc{README.md} legal{GPLv2 LICENSE} manifest + +./: mysql/: include = ($mysql && !$multi) +./: sqlite/: include = ($sqlite && !$multi) +./: pgsql/: include = ($pgsql && !$multi) + +./: testscript{*}: include = adhoc diff --git a/odb-tests/common/access/buildfile b/odb-tests/common/access/buildfile new file mode 100644 index 0000000..f1264d9 --- /dev/null +++ b/odb-tests/common/access/buildfile @@ -0,0 +1,45 @@ +# file : common/access/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix access_ \ + --generate-schema \ + --accessor-regex '#(.+)#Get\u\1#' \ + --modifier-regex '#(.+)#Set\u\1#' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +# @@ BUILD2: Eventually we should be able to mark it as test.input once +# this is supported for testscript tests. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/access/driver.cxx b/odb-tests/common/access/driver.cxx new file mode 100644 index 0000000..b40e73c --- /dev/null +++ b/odb-tests/common/access/driver.cxx @@ -0,0 +1,262 @@ +// file : common/access/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test accessor/modifier expressions. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic accessor/modifier functionality. + // + { + using namespace test1; + + object o (1, 623, 723); + o.i1 () = 123; + o.i2 (223); + o.i3 () = 323; + o.i4 () = 423; + o.set_i5 (523); + o.s1 ("1bc"); + memcpy (o.b1 (), "123456789012345", 16); + o.b2 ("123456789012345"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test composite accessor/modifier functionality. + // + { + using namespace test2; + + object o (1); + + o.v1 () = value (1123, 1234); + o.v2 (value (2123, 2234)); + o.v3_i1 (3123); + o.v3_i2 (3223); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test object pointer accessor/modifier functionality. + // + { + using namespace test3; + + object2 o (1); + o.p1 ().reset (new object1 (1)); + o.p2 (object1_ptr (new object1 (2))); + + { + transaction t (db->begin ()); + const object1_ptr& ptr (o.p1 ()); + db->persist (ptr); + db->persist (o.p2 ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id ())); + t.commit (); + + assert (p->p1 ()->id () == o.p1 ()->id () && + p->p2 ()->id () == o.p2 ()->id ()); + } + } + + // Test container accessor/modifier functionality. + // + { + using namespace test4; + + object o (1); + o.c1 ().push_back (1123); + o.c1 ().push_back (1124); + o.c1 ().push_back (1125); + + { + std::vector v; + v.push_back (2123); + v.push_back (2124); + v.push_back (2125); + o.c2 (v); + } + + o.v1 ().c1 ().push_back (1123); + o.v1 ().c1 ().push_back (1124); + o.v1 ().c1 ().push_back (1125); + + { + std::vector v; + v.push_back (2123); + v.push_back (2124); + v.push_back (2125); + o.v1 ().c2 (v); + } + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id ())); + t.commit (); + + assert (o == *p); + } + } + + // Test id accessor/modifier functionality. + // + { + using namespace test5; + + object1 o1; + object2 o2; + object3 o3; + object4 o4; + o4.id (uuid ("\x60\x1D\x17\xF0-\x60\x05-\x47\x23-\x95\x37-" + "\xC1\xF8\x94\x41\x2B\xEC")); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id ())); + unique_ptr p2 (db->load (o2.id ())); + unique_ptr p3 (db->load (o3.id_)); + unique_ptr p4 (db->load (o4.id ())); + t.commit (); + } + } + + // Test version accessor/modifier functionality. + // + { + using namespace test6; + + object1 o1 (1); + object2 o2; + object3 o3 (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + assert (o1.version () == 1); + assert (o2.version () == 1); + assert (o3.version_ == 1); + } + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->update (o3); + t.commit (); + + assert (o1.version () == 2); + assert (o2.version () == 2); + assert (o3.version_ == 2); + } + } + + // Test basic accessor/modifier functionality. + // + { + using namespace test7; + + object o (1); + o.i1 () = 123; + o.set_i2 (223); + o.setI3 (323); + o.seti4 (423); + o.i5 () = 523; + o.i6 () = 623; + o.SetI7 (723); + memcpy (o.b1 (), "123456789012345", 16); + o.b2 ("123456789012345"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id_)); + t.commit (); + + assert (o == *p); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/access/test.hxx b/odb-tests/common/access/test.hxx new file mode 100644 index 0000000..3a3424d --- /dev/null +++ b/odb-tests/common/access/test.hxx @@ -0,0 +1,592 @@ +// file : common/access/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::memcpy, std::memcmp, std::memset +#include // std::unique_ptr +#include // std::move + +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) +# define BINARY16_TYPE "BINARY(16)" +# elif defined(ODB_DATABASE_SQLITE) +# define BINARY16_TYPE "BLOB" +# elif defined(ODB_DATABASE_PGSQL) +# define BINARY16_TYPE "BYTEA" +# elif defined(ODB_DATABASE_ORACLE) +# define BINARY16_TYPE "RAW(16)" +# elif defined(ODB_DATABASE_MSSQL) +# define BINARY16_TYPE "BINARY(16)" +# elif defined(ODB_DATABASE_COMMON) +# define BINARY16_TYPE "" +# else +# error unknown database +# endif +#endif + +// Test basic accessor/modifier functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object (): i6_ (0), i7_ (0) {} + object (unsigned long id, int i6, int i7): id_ (id), i6_ (i6), i7_ (i7) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + #pragma db access(i1) + int i1_; + + public: + int i2 () const {return i2_;} + void i2 (int i2) {i2_ = i2;} + private: + #pragma db access(i2) + int i2_; + + // Prefer reference modifier. + // + public: + int i3 () const {return i3_;} + int& i3 () {return i3_;} + void i3 (int i3); + private: + #pragma db access(i3) + int i3_; + + // Prefer reference modifier (reverse function order). + // + public: + int i4 () const {return i4_;} + void i4 (int i4); + int& i4 () {return i4_;} + private: + #pragma db access(i4) + int i4_; + + public: + int get_i5 () const {return i5_;} + void set_i5 (int i5) {i5_ = i5;} + private: + #pragma db get(get_i5) set(set_i5) + int i5_; + + // Const member via reference. + // + public: + const int& i6 () const {return i6_;} + private: + #pragma db get(i6) set(const_cast (this.i6 ())) + const int i6_; + + // Const member via modifier. + // + public: + int i7 () const {return i7_;} + void i7 (int i7) const {const_cast (i7_) = i7;} + private: + #pragma db access(i7) + const int i7_; + + public: + const char* s1 () const {return s1_.c_str ();} + void s1 (const char* s1) {s1_ = s1;} + //std::string s1 () const {return s1_;} + //void s1 (std::string s1) {s1_ = s1;} + private: + #pragma db get(s1) set(s1((?).c_str ())) + //#pragma db access(s1) + std::string s1_; + + // Array member via ref. + // + public: + const char* b1 () const {return b1_;} + char* b1 () {return b1_;} + private: + #pragma db type(BINARY16_TYPE) access(b1) + char b1_[16]; + + // Array member via modifier. + // + public: + const char* b2 () const {return b2_;} + void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} + private: + #pragma db type(BINARY16_TYPE) access(b2) + char b2_[16]; + + public: + bool operator== (const object& o) const + { + return id_ == o.id_ && + i1_ == o.i1_ && + i2_ == o.i2_ && + i3_ == o.i3_ && + i4_ == o.i4_ && + i5_ == o.i5_ && + i6_ == o.i6_ && + i7_ == o.i7_ && + s1_ == o.s1_ && + std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && + std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; + } + }; +} + +// Test composite accessor/modifier functionality. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct value + { + value () {} + value (int i1, int i2): i1_ (i1), i2_ (i2) {} + + bool operator== (const value& v) const + { + return i1_ == v.i1_ && i2_ == v.i2_; + } + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + #pragma db access(i1) + int i1_; + + public: + int i2 () const {return i2_;} + void i2 (int i2) {i2_ = i2;} + private: + #pragma db access(i2) + int i2_; + }; + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + bool operator== (const object& o) const + { + return id_ == o.id_ && + v1_ == o.v1_ && + v2_ == o.v2_ && + v3_ == o.v3_; + } + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const value& v1 () const {return v1_;} + value& v1 () {return v1_;} + private: + #pragma db access(v1) + value v1_; + + public: + const value& v2 () const {return v2_;} + void v2 (const value& v2) {v2_ = v2;} + private: + #pragma db access(v2) + value v2_; + + public: + int v3_i1 () const {return v3_.i1 ();} + int v3_i2 () const {return v3_.i2 ();} + void v3_i1 (int i1) {v3_.i1 () = i1;} + void v3_i2 (int i2) {v3_.i2 (i2);} + private: + #pragma db get(test2::value (this.v3_i1 (), this.v3_i2 ())) \ + set(this.v3_i1 ((?).i1 ()); this.v3_i2 ((?).i2 ())) + value v3_; + }; +} + +// Test object pointer accessor/modifier functionality. +// +#pragma db namespace table("t3_") +namespace test3 +{ + struct object1; + + typedef std::unique_ptr object1_ptr; + + #pragma db object pointer(object1_ptr) + struct object1 + { + object1 () {} + object1 (unsigned long id): id_ (id) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (unsigned long id): id_ (id) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const object1_ptr& p1 () const {return p1_;} + object1_ptr& p1 () {return p1_;} + private: + #pragma db access(p1) + object1_ptr p1_; + + public: + const object1_ptr& p2 () const {return p2_;} + + void p2 (object1_ptr p2) {p2_ = std::move (p2);} + + private: + #pragma db get(p2) set(p2 (std::move (?))) + + object1_ptr p2_; + }; +} + +// Test container accessor/modifier functionality. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db value + struct value + { + value (): c3_ (3, 999) {} + value (int v): c1_ (3, v), c2_ (3, v + 1), c3_ (3, v + 2) {} + + bool operator== (const value& v) const + { + return c1_ == v.c1_ && c2_ == v.c2_ && c3_ == v.c3_; + } + + public: + const std::vector& c1 () const {return c1_;} + std::vector& c1 () {return c1_;} + private: + #pragma db access(c1) + std::vector c1_; + + public: + const std::vector& c2 () const {return c2_;} + void c2 (const std::vector& c2) {c2_ = c2;} + private: + #pragma db access(c2) + std::vector c2_; + + public: + const std::vector c3_; + }; + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id), c3_ (3, 3123), v2_ (2123) {} + + bool operator== (const object& o) const + { + return id_ == o.id_ && + c1_ == o.c1_ && + c2_ == o.c2_ && + c3_ == o.c3_ && + v1_ == o.v1_ && + v2_ == o.v2_; + } + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id access(id) + unsigned long id_; + + public: + const std::vector& c1 () const {return c1_;} + std::vector& c1 () {return c1_;} + private: + #pragma db access(c1) + std::vector c1_; + + public: + const std::vector& c2 () const {return c2_;} + void c2 (const std::vector& c2) {c2_ = c2;} + private: + #pragma db access(c2) + std::vector c2_; + + public: + const std::vector& c3 () const {return c3_;} + private: + #pragma db get(c3) set(const_cast&> (this.c3 ())) + const std::vector c3_; + + public: + const value& v1 () const {return v1_;} + value& v1 () {return v1_;} + private: + #pragma db access(v1) + value v1_; + + public: + const value v2_; + }; +} + +// Test id accessor/modifier functionality. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object + struct object1 + { + object1 (): id_ (0) {} + + public: + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 (): id_ (0) {} + + public: + unsigned long id () const {return id_;} + unsigned long& id () {return id_;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + #pragma db object + struct object3 + { + object3 (): id_ (0) {} + + #pragma db id auto + const unsigned long id_; + }; + + #pragma db value + struct uuid + { + uuid () {std::memset (data_, 0, sizeof (data_));} + explicit uuid (const char* d) {data (d);} + + public: + const char* data () const {return data_;} + void data (const char* d) {std::memcpy (data_, d, sizeof (data_));} + private: + #pragma db type(BINARY16_TYPE) column("") access(data) + char data_[16]; + }; + + #pragma db object + struct object4 + { + public: + const uuid& id () const {return id_;} + void id (const uuid& id) {id_ = id;} + private: + #pragma db id access(id) + uuid id_; + }; +} + +// Test version accessor/modifier functionality. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object optimistic + struct object1 + { + object1 (unsigned long id = 0): id_ (id), version_ (0) {} + + #pragma db id + unsigned long id_; + + public: + unsigned long version () const {return version_;} + void version (unsigned long version) {version_ = version;} + private: + #pragma db version access(version) + unsigned long version_; + }; + + #pragma db object optimistic + struct object2 + { + object2 (): version_ (0) {} + + #pragma db id auto + unsigned long id_; + + public: + unsigned long version () const {return version_;} + unsigned long& version () {return version_;} + private: + #pragma db version access(version) + unsigned long version_; + }; + + #pragma db object optimistic + struct object3 + { + object3 (unsigned long id = 0): id_ (id), version_ (0) {} + + #pragma db id + unsigned long id_; + + #pragma db version + const unsigned long version_; + }; +} + +// Test automatic discovery of accessor/modifier functions. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + public: + int i1 () const {return i1_;} + int& i1 () {return i1_;} + private: + int i1_; + + public: + const int& get_i2 () const {return i2_;} + void set_i2 (int i2) {i2_ = i2;} + private: + int i2_; + + public: + const int& getI3 () const {return i3_;} + void setI3 (const int& i3) {i3_ = i3;} + private: + int i3_; + + public: + int geti4 () const {return i4;} + int seti4 (int v) {int r (i4); i4 = v; return r;} + private: + int i4; + + // Prefer reference modifier. + // + public: + int i5 () const {return i5_;} + int& i5 () {return i5_;} + void i5 (int i5); + private: + int i5_; + + // Prefer reference modifier (reverse function order). + // + public: + int i6 () const {return i6_;} + void i6 (int i6); + int& i6 () {return i6_;} + private: + int i6_; + + // Custom accessor/modifier regex. + // + public: + int GetI7 () const {return i7_;} + void SetI7 (int i7) {i7_ = i7;} + private: + int i7_; + + // Array member via ref. + // + public: + const char* b1 () const {return b1_;} + char* b1 () {return b1_;} + private: + #pragma db type(BINARY16_TYPE) + char b1_[16]; + + // Array member via modifier. + // + public: + const char* b2 () const {return b2_;} + void b2 (const char* b2) {std::memcpy (b2_, b2, sizeof (b2_));} + private: + #pragma db type(BINARY16_TYPE) + char b2_[16]; + + public: + bool operator== (const object& o) const + { + return id_ == o.id_ && + i1_ == o.i1_ && + i2_ == o.i2_ && + i3_ == o.i3_ && + i4 == o.i4 && + i5_ == o.i5_ && + i6_ == o.i6_ && + i7_ == o.i7_ && + std::memcmp (b1_, o.b1_, sizeof (b1_)) == 0 && + std::memcmp (b2_, o.b2_, sizeof (b2_)) == 0; + } + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/access/testscript b/odb-tests/common/access/testscript new file mode 100644 index 0000000..04f0ec0 --- /dev/null +++ b/odb-tests/common/access/testscript @@ -0,0 +1,33 @@ +# file : common/access/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/as/buildfile b/odb-tests/common/as/buildfile new file mode 100644 index 0000000..dcdc961 --- /dev/null +++ b/odb-tests/common/as/buildfile @@ -0,0 +1,49 @@ +# file : common/as/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix as_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# @@ BUILD@ Temporarily suppress the following warning: +# +# test-odb.cxx(6234): warning C4244: 'argument': conversion from 'id_type::value_type' to 'test5::version_type::value_type', possible loss of data +# +if ($cxx.class == 'msvc') + cxx.coptions += /wd4244 + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/as/driver.cxx b/odb-tests/common/as/driver.cxx new file mode 100644 index 0000000..578eb23 --- /dev/null +++ b/odb-tests/common/as/driver.cxx @@ -0,0 +1,348 @@ +// file : common/as/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test C++ type mapping (#pragma map type as ...). +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic type mapping functionality. + // + { + using namespace test1; + + object o1 (true, green, 123, 234); + o1.m[false] = 123; + o1.v.push_back (o1.ip); + o1.cv.push_back (red); + o1.cv.push_back (green); + + object o2 (false, blue, 234, 456); + o2.m[true] = 234; + o2.v.push_back (o2.ip); + o2.cv.push_back (green); + o2.cv.push_back (blue); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.b = false; + o1.c = blue; + o1.ip.first++; + o1.ip.second--; + o1.m[false]++; + o1.m[true] = 234; + o1.v.back () = o1.ip; + o1.cv.modify_front () = green; + o1.cv.push_back (red); + + o2.b = true; + o2.c = red; + o2.ip.first--; + o2.ip.second++; + o2.m[true]--; + o2.m[false] = 345; + o2.v.push_back (o2.ip); + o2.cv.pop_back (); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test wrapped simple type mapping. + // + { + using namespace test2; + + object o1; + o1.v.push_back (null_bool ()); + o1.v.push_back (false); + + object o2; + o2.b = true; + o2.v.push_back (true); + o2.v.push_back (null_bool ()); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.b = false; + o1.v[0] = true; + o1.v[1].reset (); + + o2.b.reset (); + o2.v.push_back (false); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test wrapped composite type mapping. + // + { + using namespace test3; + + object o1; + o1.ip = intp (0, 0); // NULL + o1.npv.push_back (o1.np); + o1.ipv.push_back (o1.ip); + + object o2; + o2.np = intp (123, 234); + o1.ip = intp (234, 123); + o2.npv.push_back (o2.np); + o2.ipv.push_back (o2.ip); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.np = o1.npv[0] = intp (234, 456); + o1.ip = o1.ipv.modify_at (0) = intp (456, 234); + + o2.np.reset (); + o2.npv[0].reset (); + o2.ip = o2.ipv.modify_at (0) = intp (0, 0); // NULL + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test id type mapping. + // + { + using namespace test4; + + object o1 (123); + o1.v.push_back (1); + o1.v.push_back (2); + o1.v.push_back (3); + + object o2 (234); + o2.v.push_back (3); + o2.v.push_back (2); + o2.v.push_back (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.i++; + o1.v.pop_back (); + o1.v.modify_front ()++; + + o2.i--; + o2.v.clear (); + o2.v.push_back (4); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Test version type mapping. + // + { + using namespace test5; + + object o1 (100, 123); + object o2 (200, 234); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + + assert (*p1 == o1); + assert (*p2 == o2); + + p1->i--; + p2->i++; + + db->update (*p1); + db->update (*p2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + for (;;) + { + o1.i++; + o2.i--; + + try + { + + db->update (o1); + db->update (o2); + break; + } + catch (const odb::object_changed&) + { + db->reload (o1); + db->reload (o2); + } + } + + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/as/test.hxx b/odb-tests/common/as/test.hxx new file mode 100644 index 0000000..963abeb --- /dev/null +++ b/odb-tests/common/as/test.hxx @@ -0,0 +1,270 @@ +// file : common/as/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // pair + +#include +#include +#include + +// Test basic type mapping functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + enum color {red, green, blue}; + + inline const char* + color_to_string (color c) + { + return c == red ? "RED" : (c == green ? "GREEN" : "BLUE"); + } + + inline color + string_to_color (const std::string& s) + { + return s == "RED" ? red : (s == "GREEN" ? green : blue); + } + + #pragma db map type(color) as(std::string) \ + to(test1::color_to_string (?)) \ + from(test1::string_to_color (?)) + + typedef std::pair intp; + + #pragma db value + struct comp + { + comp () {} + comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} + + int n1; + int n2; + }; + + #pragma db map type(intp) as(comp) \ + to(test1::comp ((?).first, (?).second)) \ + from(test1::intp ((?).n1, (?).n2)) + + #pragma db object + struct object + { + // Class-scope mapping. + // + #pragma db map type(bool) as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") + + #pragma db id auto + unsigned long id; + + bool b; + color c; + intp ip; + + std::map m; + std::vector v; + odb::vector cv; + + object () {} + object (bool b_, color c_, int n1, int n2): b (b_), c (c_), ip (n1, n2) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return + x.b == y.b && + x.c == y.c && + x.ip == y.ip && + x.m == y.m && + x.v == y.v && + x.cv == y.cv; + } +} + +// Test wrapped simple type mapping. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db map type(bool) as(std::string) \ + to((?) ? "true" : "false") \ + from((?) == "true") + + typedef odb::nullable null_bool; + typedef odb::nullable null_string; + + /* + #pragma db map type(null_bool) as(null_string) \ + to((?) \ + ? test2::null_string (*(?) ? "true" : "false") \ + : test2::null_string ()) \ + from((?) \ + ? test2::null_bool (*(?) == "true") \ + : test2::null_bool ()) + */ + + #pragma db map type(null_bool) as(std::string) \ + to((?) ? (*(?) ? "true" : "false") : "null") \ + from((?) != "null" \ + ? test2::null_bool ((?) == "true") \ + : test2::null_bool ()) + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + odb::nullable b; + std::vector > v; + }; + + inline bool + operator== (const object& x, const object y) + { + return x.b == y.b && x.v == y.v; + } +} + +// Test wrapped simple type mapping. +// +#pragma db namespace table("t3_") +namespace test3 +{ + typedef std::pair intp; + + #pragma db value + struct comp + { + comp () {} + comp (int n1_, int n2_): n1 (n1_), n2 (n2_) {} + + int n1; + int n2; + }; + + typedef odb::nullable null_intp; + typedef odb::nullable null_comp; + + #pragma db map type(null_intp) as(null_comp) \ + to((?) \ + ? test3::null_comp (test3::comp ((?)->first, (?)->second)) \ + : test3::null_comp ()) \ + from((?) \ + ? test3::null_intp (test3::intp ((?)->n1, (?)->n2)) \ + : test3::null_intp ()) + + // Map int pair with both members equal 0 to NULL comp. + // + #pragma db map type(intp) as(null_comp) \ + to((?).first != 0 || (?).second != 0 \ + ? test3::null_comp (test3::comp ((?).first, (?).second)) \ + : test3::null_comp ()) \ + from((?) \ + ? test3::intp (test3::intp ((?)->n1, (?)->n2)) \ + : test3::intp (0, 0)) + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + odb::nullable np; + intp ip; + + std::vector > npv; + odb::vector ipv; + }; + + inline bool + operator== (const object& x, const object y) + { + return x.np == y.np && x.ip == y.ip && x.npv == y.npv && x.ipv == y.ipv; + } +} + +// Test id type mapping. +// +struct id_type +{ + typedef unsigned long value_type; + value_type value; + + id_type (value_type v = 0): value (v) {} + operator value_type () const {return value;} +}; + +#pragma db map type(id_type) as(id_type::value_type) + +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + #pragma db id auto + id_type id; + + int i; + odb::vector v; + + object () {} + object (int i_): i (i_) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return x.id == y.id && x.i == y.i && x.v == y.v; + } +} + +// Test version type mapping. +// +#pragma db namespace table("t5_") +namespace test5 +{ + struct version_type + { + typedef unsigned short value_type; + value_type value; + + version_type (value_type v = 0): value (v) {} + operator value_type () const {return value;} + version_type& operator++ () {value++; return *this;} + }; + + #pragma db map type(version_type) as(id_type::value_type) + + #pragma db object optimistic + struct object + { + #pragma db id + id_type id; + + #pragma db version + version_type v; + + int i; + + object () {} + object (id_type id_, int i_): id (id_), i (i_) {} + }; + + inline bool + operator== (const object& x, const object y) + { + return x.id == y.id && x.v == y.v && x.i == y.i; + } +} + +#endif // TEST_HXX diff --git a/odb-tests/common/as/testscript b/odb-tests/common/as/testscript new file mode 100644 index 0000000..12d9753 --- /dev/null +++ b/odb-tests/common/as/testscript @@ -0,0 +1,33 @@ +# file : common/as/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/blob/buildfile b/odb-tests/common/blob/buildfile new file mode 100644 index 0000000..cc6d164 --- /dev/null +++ b/odb-tests/common/blob/buildfile @@ -0,0 +1,40 @@ +# file : common/blob/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix blob_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/blob/driver.cxx b/odb-tests/common/blob/driver.cxx new file mode 100644 index 0000000..269f415 --- /dev/null +++ b/odb-tests/common/blob/driver.cxx @@ -0,0 +1,76 @@ +// file : common/blob/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test BLOB mapping. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + const char data[] = + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "cccccccccccccccccccccccccccccccccccccccccccccccc" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "dddddddddddddddddddddddddddddddddddddddddddddddd" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B" + "ffffffffffffffffffffffffffffffffffffffffffffffff"; + + const unsigned char* udata = reinterpret_cast (data); + + object o (1); + o.vc.assign (data, data + sizeof (data)); + o.vuc.assign (udata, udata + sizeof (data)); + memcpy (o.c, data, sizeof (data)); + memcpy (o.uc, udata, sizeof (data)); + memcpy (o.a.data (), data, sizeof (data)); + memcpy (o.ua.data (), udata, sizeof (data)); + o.cont.push_back (1); + o.cont.push_back (2); + o.cont.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/blob/test.hxx b/odb-tests/common/blob/test.hxx new file mode 100644 index 0000000..9602ca2 --- /dev/null +++ b/odb-tests/common/blob/test.hxx @@ -0,0 +1,71 @@ +// file : common/blob/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::memcmp + +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +//# define BLOB_TYPE "VARBINARY(1024)" +# define BLOB_TYPE "VARBINARY(max)" +# else +//# define BLOB_TYPE "RAW(1024)" +# define BLOB_TYPE "BLOB" +# endif +#endif + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db type(BLOB_TYPE) + std::vector vc; + + #pragma db type(BLOB_TYPE) + std::vector vuc; + + #pragma db type(BLOB_TYPE) + char c[1024]; + + #pragma db type(BLOB_TYPE) + unsigned char uc[1024]; + + #pragma db type(BLOB_TYPE) + std::array a; + + #pragma db type(BLOB_TYPE) + std::array ua; + + // Make sure we can still use std::vector and std::array + // as containers. + // + std::vector cont; +}; + +inline bool +operator== (const object& x, const object& y) +{ + return x.id_ == y.id_ + && x.vc == y.vc + && x.vuc == y.vuc + && std::memcmp (x.c, y.c, sizeof (x.c)) == 0 + && std::memcmp (x.uc, y.uc, sizeof (x.uc)) == 0 + && x.a == y.a + && x.ua == y.ua + && x.cont == y.cont; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/blob/testscript b/odb-tests/common/blob/testscript new file mode 100644 index 0000000..4fb9955 --- /dev/null +++ b/odb-tests/common/blob/testscript @@ -0,0 +1,33 @@ +# file : common/blob/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/buildfile b/odb-tests/common/buildfile new file mode 100644 index 0000000..cb9c748 --- /dev/null +++ b/odb-tests/common/buildfile @@ -0,0 +1,6 @@ +# file : common/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -bulk/} + +./: bulk/: include = (!$pgsql || $pgsql_bulk || $size($databases) != 1) diff --git a/odb-tests/common/bulk/buildfile b/odb-tests/common/bulk/buildfile new file mode 100644 index 0000000..417eb22 --- /dev/null +++ b/odb-tests/common/bulk/buildfile @@ -0,0 +1,49 @@ +# file : common/bulk/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert (!$pgsql || $pgsql_bulk || $size($databases) != 1) \ +"bulk operations are disabled for pgsql which is specified as single database" + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases +{ + if ($db != 'pgsql' || $pgsql_bulk) + import libs += libodb-$db%lib{odb-$db} +} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: \ + include = ($multi && ($db != 'pgsql' || $pgsql_bulk)) + + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix bulk_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/bulk/driver.cxx b/odb-tests/common/bulk/driver.cxx new file mode 100644 index 0000000..23b49ad --- /dev/null +++ b/odb-tests/common/bulk/driver.cxx @@ -0,0 +1,1203 @@ +// file : common/bulk/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test bulk database operations. +// + +#include // std::unique_ptr +#include +#include +#include + +#include +#include + +#include + +#include // DATABASE_* +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +// Sun CC with non-standard STL does not have iterator_traits in which +// case we assume iterator is just a pointer. +// +template ::value_type +#else + typename T = typename odb::details::meta::remove_pointer::result +#endif + > +struct element_traits; + +template +struct element_traits +{ + typedef T type; + typedef T* pointer; + typedef std::unique_ptr unique_ptr; + + static T& ref (T& x) {return x;} + static T* ptr (T* p) {return p;} +}; + +template +struct element_traits +{ + typedef T type; + typedef T* pointer; + typedef std::unique_ptr unique_ptr; + + static T& ref (T* p) {return *p;} + static T* ptr (T* p) {return p;} +}; + +template +struct element_traits > +{ + typedef T type; + typedef std::unique_ptr pointer; + typedef std::unique_ptr unique_ptr; + + static T& ref (const unique_ptr& p) {return *p;} + static T* ptr (const unique_ptr& p) {return p.get ();} +}; + +template +void +persist (const unique_ptr& db, I b, I e, bool cont = true) +{ + typedef element_traits traits; + typedef typename traits::type type; + typedef typename traits::unique_ptr unique_ptr; + + { + transaction t (db->begin ()); + db->persist (b, e, cont); + t.commit (); + } + + // Verify we can load the objects via their ids. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + unique_ptr p (db->load (x.id)); + assert (p->n == x.n && p->s == x.s); + } + + t.commit (); + } +} + +template +void +try_persist (const unique_ptr& db, I b, I e, bool cont = true) +{ + try + { + persist (db, b, e, cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + +template +void +update (const unique_ptr& db, I b, I e, + bool modify = true, bool cont = true) +{ + typedef element_traits traits; + typedef typename traits::type type; + typedef typename traits::unique_ptr unique_ptr; + + if (modify) + { + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + x.n++; + x.s[0]++; + } + } + + { + transaction t (db->begin ()); + db->update (b, e, cont); + t.commit (); + } + + // Verify changes. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + unique_ptr p (db->load (x.id)); + assert (p->n == x.n && p->s == x.s); + } + + t.commit (); + } +} + +template +void +try_update (const unique_ptr& db, I b, I e, bool cont = true) +{ + try + { + update (db, b, e, false, cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + +template +void +erase (const unique_ptr& db, I b, I e) +{ + typedef element_traits traits; + typedef typename traits::type type; + + { + transaction t (db->begin ()); + db->erase (b, e); + t.commit (); + } + + // Verify the objects are gone. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + { + type& x (traits::ref (*i)); + typename traits::pointer p (db->find (x.id)); + assert (traits::ptr (p) == 0); + } + + t.commit (); + } +} + +template +void +erase_id (const unique_ptr& db, I b, I e, bool cont = true) +{ + typedef element_traits traits; + typedef T type; + + { + transaction t (db->begin ()); + db->erase (b, e, cont); + t.commit (); + } + + // Verify the objects are gone. + // + { + transaction t (db->begin ()); + + for (I i (b); i != e; ++i) + assert (traits::ptr (db->find (*i)) == 0); + + t.commit (); + } +} + +template +void +try_erase (const unique_ptr& db, const A& a, bool cont = true) +{ + try + { + erase_id (db, a, a + sizeof (a) / sizeof (a[0]), cont); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } +} + + +template +void +test (const unique_ptr& db, I b, I e) +{ + persist (db, b, e); + update (db, b, e); + erase (db, b, e); +} + +template +vector +fill (std::size_t count) +{ + vector r; + + unsigned int n (1); + std::string s ("a"); + + for (size_t i (0); i != count; ++i) + { + r.push_back (T (n, s)); + n++; + s[0] = (s[0] == 'z' ? 'a' : s[0] + 1); + } + + return r; +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + +#if !defined(MULTI_DATABASE) && \ + (defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) || \ + defined(DATABASE_PGSQL)) + + // Test database class API with various forms of containers + // and elements (test #6 is a copy). + // + { + using namespace test1; + + { + object a[2]; + a[0] = object (1, "a"); + a[1] = object (2, "b"); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + test (db, v.begin (), v.end ()); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + object* a[2] = {&o1, &o2}; + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + vector v; + v.push_back (&o1); + v.push_back (&o2); + test (db, v.begin (), v.end ()); + } + + { + vector> v; + v.push_back (unique_ptr (new unique_object (1, "a"))); + v.push_back (unique_ptr (new unique_object (2, "b"))); + test (db, v.begin (), v.end ()); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + unsigned long id[2] = {v[0].id, v[1].id}; + erase_id (db, id, id + sizeof (id) / sizeof (id[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + vector id; + id.push_back (v[0].id); + id.push_back (v[1].id); + erase_id (db, id.begin (), id.end ()); + } + } + + // Test various batch sizes. + // + { + using namespace test1; + + { + vector v; // 0 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (1)); // 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (2)); // batch - 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (3)); // batch + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (4)); // batch + 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (5)); // 2 * batch - 1 + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (6)); // 2 * batch + test (db, v.begin (), v.end ()); + } + + { + vector v (fill (100)); // 100 + test (db, v.begin (), v.end ()); + } + } + + // Test object with manually assigned id. + // + { + using namespace test2; + + { + vector v; + v.push_back (object ("1", 1, "a")); + v.push_back (object ("2", 2, "b")); + test (db, v.begin (), v.end ()); + } + + { + typedef unique_ptr unique_ptr; + + vector v; + v.push_back (unique_ptr (new unique_object ("1", 1, "a"))); + v.push_back (unique_ptr (new unique_object ("2", 2, "b"))); + test (db, v.begin (), v.end ()); + } + + // Test const objects. + // + + { + const object a[1]; + const object* e (a + sizeof (a) / sizeof (a[0])); + + transaction t (db->begin ()); + db->persist (a, e); + db->erase (a, e); + t.commit (); + } + + { + object o1 ("1", 1, "a"); + object o2 ("2", 2, "b"); + + vector v; + v.push_back (&o1); + v.push_back (&o2); + + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } + + // Test failure. + // + { + using namespace test3; + + vector v; + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + v.push_back (object (11, 11)); + + persist (db, v.begin (), v.end ()); + + // persist + // + { + { + vector v; // 1 + v.push_back (object (6, 6)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + 1 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch - 1 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + v.push_back (object (10, 10)); + v.push_back (object (11, 11)); + try_persist (db, v.begin (), v.end ()); + } + + // Mixture of success and failure. + // + + { + vector v; // 1 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 1 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + v.push_back (object (7, 7)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + v.push_back (object (8, 8)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (0, 0)); + try_persist (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (1, 1)); + v.push_back (object (7, 7)); + v.push_back (object (2, 2)); + v.push_back (object (8, 8)); + v.push_back (object (3, 3)); + try_persist (db, v.begin (), v.end ()); + } + + // Test stopping after failure. + // + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + try_persist (db, v.begin (), v.end (), false); + } + } + + // update + // + { + { + vector v; // 1 + v.push_back (object (0, 0)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + 1 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch - 1 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 x batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (4, 4)); + v.push_back (object (5, 5)); + try_update (db, v.begin (), v.end ()); + } + + // Mixture of success and failure. + // + + { + vector v; // 1 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 1 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (6, 6)); + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (1, 1)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // 2 + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // batch + v.push_back (object (0, 0)); + v.push_back (object (1, 1)); + v.push_back (object (2, 2)); + v.push_back (object (6, 6)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (6, 6)); + v.push_back (object (2, 2)); + v.push_back (object (7, 7)); + v.push_back (object (3, 3)); + v.push_back (object (8, 8)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + { + vector v; // mixture + v.push_back (object (0, 0)); + v.push_back (object (2, 2)); + v.push_back (object (3, 3)); + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (8, 8)); + v.push_back (object (4, 4)); + try_update (db, v.begin (), v.end ()); + } + + // Test stopping after failure. + // + { + vector v; // batch + v.push_back (object (6, 6)); + v.push_back (object (7, 7)); + v.push_back (object (0, 0)); + v.push_back (object (8, 8)); + v.push_back (object (9, 9)); + try_update (db, v.begin (), v.end (), false); + } + + // Test a database exception (unique constraint violation) + // + try + { + v[0].n++; + v[2].n++; + + update (db, v.begin (), v.begin () + 3, false); + assert (false); + } + catch (const multiple_exceptions& e) + { +#ifndef DATABASE_PGSQL + assert (e.attempted () == 3 && e.failed () == 2); + assert (e[0] != 0 && e[1] == 0 && e[2] != 0); +#else + // In PosgreSQL no further statements are attempted after the first + // failure. + // + assert (e.attempted () == 1 && e.failed () == 1); + assert (e[0] != 0); +#endif + } + } + + // erase + // + { + { + unsigned long a[] = {0}; // 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3, 4}; // 2 x batch - 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 3, 4, 5}; // 2 x batch + try_erase (db, a); + } + + // Mixture of success and failure. + // + + { + unsigned long a[] = {6, 0}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6}; // 2 + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 1}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6, 1}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 6}; // batch + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 1, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 6, 1, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 6, 2}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 6}; // batch + 1 + try_erase (db, a); + } + + { + unsigned long a[] = {6, 0, 7, 1, 8, 2, 9, 3}; // mixture + try_erase (db, a); + } + + { + unsigned long a[] = {0, 1, 2, 6, 7, 8, 3, 4, 5, 9}; // mixture + try_erase (db, a); + } + + // Test stopping after failure. + // + { + unsigned long a[] = {6, 7, 0, 8, 9}; + try_erase (db, a, false); + } + } + + erase (db, v.begin (), v.end ()); + } + + // Test a large batch. + // + { + using namespace test4; + + vector v (fill (5000)); + test (db, v.begin (), v.end ()); + } + + // Test object without id. + // + { + using namespace test5; + + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::n)); + result::iterator i (r.begin ()); + + assert (i != r.end () && i->n == 1 && i->s == "a"); + assert (++i != r.end () && i->n == 2 && i->s == "b"); + assert (++i == r.end ()); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (); + t.commit (); + } + } + + // Test API with persistent class template instantiations (copy of + // test #1). + { + using namespace test6; + + // Make sure we can still call the non-bulk API. + // + { + object o (0, "z"); + transaction t (db->begin ()); + db->persist (o); + db->update (o); + db->reload (o); + db->erase (o); + t.commit (); + } + + + // The rest is a copy of test #1. + // + { + object a[2]; + a[0] = object (1, "a"); + a[1] = object (2, "b"); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + test (db, v.begin (), v.end ()); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + object* a[2] = {&o1, &o2}; + test (db, a, a + sizeof (a) / sizeof (a[0])); + } + + { + object o1 (1, "a"); + object o2 (2, "b"); + vector v; + v.push_back (&o1); + v.push_back (&o2); + test (db, v.begin (), v.end ()); + } + + { + vector> v; + v.push_back (unique_ptr (new unique_object (1, "a"))); + v.push_back (unique_ptr (new unique_object (2, "b"))); + test (db, v.begin (), v.end ()); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + unsigned long id[2] = {v[0].id, v[1].id}; + erase_id (db, id, id + sizeof (id) / sizeof (id[0])); + } + + { + vector v; + v.push_back (object (1, "a")); + v.push_back (object (2, "b")); + persist (db, v.begin (), v.end ()); + + vector id; + id.push_back (v[0].id); + id.push_back (v[1].id); + erase_id (db, id.begin (), id.end ()); + } + } + + // Test optimistic concurrency. + // + { + using namespace test7; + + std::vector v (fill (4)); + + // persist + // + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v != 0 && + v[1].v != 0 && + v[2].v != 0 && + v[3].v != 0); + } + + // update + // + { + std::vector c (v); + + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v > c[0].v && + v[1].v > c[1].v && + v[2].v > c[2].v && + v[3].v > c[3].v); + } + + { + object o2 (v[1]); + object o4 (v[3]); + + o2.n++; + o4.n++; + + transaction t (db->begin ()); + db->update (o2); + db->update (o4); + t.commit (); + } + + try + { + // Some updates may succeed spoiling the version for erase tests. + // + std::vector c (v); + + transaction t (db->begin ()); + db->update (c.begin (), c.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + + // erase + // + try + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + + { + transaction t (db->begin ()); + db->reload (v[1]); + db->reload (v[3]); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } + + // Test SQL Server optimistic concurrency with ROWVERSION. + // +#ifdef DATABASE_MSSQL + { + using namespace test8; + + std::vector v (fill (4)); + + v[0].id = 1; + v[1].id = 2; + v[2].id = 3; + v[3].id = 4; + + + // persist + // + { + transaction t (db->begin ()); + db->persist (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v != 0 && + v[1].v != 0 && + v[2].v != 0 && + v[3].v != 0); + + //cerr << v[0].v << endl + // << v[1].v << endl + // << v[2].v << endl + // << v[3].v << endl; + } + + // update + // + + /* + { + std::vector c (v); + + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + t.commit (); + + assert (v[0].v > c[0].v && + v[1].v > c[1].v && + v[2].v > c[2].v && + v[3].v > c[3].v); + } + */ + + { + object o2 (v[1]); + object o4 (v[3]); + + o2.n++; + o4.n++; + + transaction t (db->begin ()); + db->update (o2); + db->update (o4); + t.commit (); + } + + /* + try + { + transaction t (db->begin ()); + db->update (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + cout << e.what () << endl << endl; + } + */ + + // erase + // + try + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + assert (false); + } + catch (const multiple_exceptions& e) + { + assert (e.attempted () == 4 && e.failed () == 4); + } + + { + transaction t (db->begin ()); + db->reload (v[1]); + db->reload (v[3]); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (v.begin (), v.end ()); + t.commit (); + } + } +#endif + +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/bulk/test.hxx b/odb-tests/common/bulk/test.hxx new file mode 100644 index 0000000..71755f2 --- /dev/null +++ b/odb-tests/common/bulk/test.hxx @@ -0,0 +1,211 @@ +// file : common/bulk/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::unique_ptr + +#include + +// Test basic functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object bulk(3) session + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + + #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. + std::string s; + }; + + #pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object + { + unique_object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + std::string s; + }; +} + +// Test object with manually assigned id. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object bulk(3) session + struct object + { + // Can't use empty id because of Oracle. + // + object (std::string id_ = "!", unsigned int n_ = 0, std::string s_ = "") + : id (id_), n (n_), s (s_) {} + + #pragma db id + std::string id; + + unsigned int n; + std::string s; + }; + +#pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object + { + unique_object (std::string id_ = "", + unsigned int n_ = 0, + std::string s_ = "") + : id (id_), n (n_), s (s_) {} + + #pragma db id + std::string id; + + unsigned int n; + std::string s; + }; +} + +// Test failure. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object bulk(3) + struct object + { + object (unsigned long id_ = 0, unsigned int n_ = 0) + : id (id_), n (n_), s ("abc") {} + + #pragma db id + unsigned long id; + + #pragma db unique + unsigned int n; + std::string s; + }; +} + +// Test a large batch. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object bulk(3000) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long id; + + unsigned int n; + + #pragma db oracle:type("CLOB") mssql:type("VARCHAR(max)") // Long data. + std::string s; + }; +} + +// Test object without id. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object no_id bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = ""): n (n_), s (s_) {} + + unsigned int n; + std::string s; + }; +} + +// Test API with persistent class template instantiations. +// +#pragma db namespace table("t6_") +namespace test6 +{ + template + struct object_template + { + object_template (unsigned int n_ = 0, std::string s_ = "") + : id (0), n (n_), s (s_) {} + + unsigned long id; + unsigned int n; + std::string s; + }; + + typedef object_template<1> object; + + #pragma db object(object) bulk(3) + #pragma db member(object::id) id auto + + typedef object_template<3> unique_object; + + #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) + #pragma db member(unique_object::id) id auto +} + +// Test optimistic concurrency. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object optimistic bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), v (0), n (n_), s (s_) {} + + #pragma db id auto + unsigned long long id; + + #pragma db version + unsigned long long v; + + unsigned int n; + std::string s; + }; +} + +// Test SQL Server optimistic concurrency with ROWVERSION. +// +#if defined(ODB_DATABASE_MSSQL) || defined(DATABASE_MSSQL) +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object optimistic bulk(3) + struct object + { + object (unsigned int n_ = 0, std::string s_ = "") + : id (0), v (0), n (n_), s (s_) {} + + #pragma db id + unsigned long long id; + + #pragma db version type("ROWVERSION") + unsigned long long v; + + unsigned int n; + std::string s; + }; +} +#endif + +#endif // TEST_HXX diff --git a/odb-tests/common/bulk/testscript b/odb-tests/common/bulk/testscript new file mode 100644 index 0000000..e7567c9 --- /dev/null +++ b/odb-tests/common/bulk/testscript @@ -0,0 +1,503 @@ +# file : common/bulk/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + ++cat <=output + multiple exceptions, 1 element attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object already persistent + [1] object already persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + [4] object already persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + [3] object already persistent + [4] object already persistent + [5] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object already persistent + [2] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object already persistent + [2] object already persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object already persistent + [1] object already persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [3] object already persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object already persistent + [1] object already persistent + [2] object already persistent + + multiple exceptions, 7 elements attempted, 3 failed: + [1] object already persistent + [3] object already persistent + [5] object already persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object already persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 7 elements attempted, 7 failed: + [0-5] (some) object not persistent + [6] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0-1] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 8 elements attempted, 8 failed: + [0-7] (some) object not persistent + + multiple exceptions, 10 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + [7] object not persistent + [8] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0-2] (some) object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object changed concurrently + [3] object changed concurrently + + multiple exceptions, 4 elements attempted, 4 failed: + [0-2] (some) object changed concurrently + [3] object changed concurrently + + EOI + ++cat <=pgsql-output + multiple exceptions, 1 element attempted, 1 failed: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed, fatal: + [1] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 1 element attempted, 1 failed, fatal: + [0] object already persistent + + multiple exceptions, 2 elements attempted, 1 failed, fatal: + [1] object already persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object already persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [2] object not persistent + [4] object not persistent + [6] object not persistent + + multiple exceptions, 7 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object not persistent + + multiple exceptions, 1 element attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 2 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 3 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 4 elements attempted, 4 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 5 elements attempted, 5 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + + multiple exceptions, 6 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [3] object not persistent + [4] object not persistent + [5] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [1] object not persistent + + multiple exceptions, 2 elements attempted, 1 failed: + [0] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [1] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [2] object not persistent + + multiple exceptions, 3 elements attempted, 2 failed: + [0] object not persistent + [1] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [1] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [2] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [3] object not persistent + + multiple exceptions, 4 elements attempted, 3 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + + multiple exceptions, 8 elements attempted, 4 failed: + [1] object not persistent + [3] object not persistent + [5] object not persistent + [7] object not persistent + + multiple exceptions, 10 elements attempted, 6 failed: + [0] object not persistent + [1] object not persistent + [2] object not persistent + [6] object not persistent + [7] object not persistent + [8] object not persistent + + multiple exceptions, 3 elements attempted, 1 failed: + [2] object not persistent + + multiple exceptions, 4 elements attempted, 2 failed: + [1] object changed concurrently + [3] object changed concurrently + + multiple exceptions, 4 elements attempted, 2 failed: + [1] object changed concurrently + [3] object changed concurrently + + EOI + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if ($pgsql && $pgsql_bulk) +{ + .include ../../pgsql.testscript + + $create_schema; + + # Query the PostgreSQL server version and only run the test if it is 7.4 or + # above. + # + $pgsql_client_cmd --tuples-only -c 'SELECT VERSION()' | \ + sed -n -e 's/.*PostgreSQL (\d+\.\d+).*/\1/p' | \ + set version [string]; + + if ("$version" == "") + exit "unable to obtain PostgreSQL server version" + end; + + sed -n -e 's/(.+)\..+/\1/p' <"$version" | set major_version [uint64]; + sed -n -e 's/.+\.(.+)/\1/p' <"$version" | set minor_version [uint64]; + + if (($major_version == 7 && minor_version >= 4) || $major_version > 7) + if $multi + $* # Noop. + else + $* >>>../pgsql-output + end + end +} diff --git a/odb-tests/common/callback/buildfile b/odb-tests/common/callback/buildfile new file mode 100644 index 0000000..2ecc3b8 --- /dev/null +++ b/odb-tests/common/callback/buildfile @@ -0,0 +1,41 @@ +# file : common/callback/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix callback_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/callback/driver.cxx b/odb-tests/common/callback/driver.cxx new file mode 100644 index 0000000..80513c6 --- /dev/null +++ b/odb-tests/common/callback/driver.cxx @@ -0,0 +1,184 @@ +// file : common/callback/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database operation callbacks. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +const char* events[] = +{ + "pre_persist", + "post_persist", + "pre_load", + "post_load", + "pre_update", + "post_update", + "pre_erase", + "post_erase" +}; + +void object:: +db_callback (callback_event e, database& db) +{ + cout << " " << events[e] << " " << id_ << endl; + + // Test custom recursive loading. + // + if (e == callback_event::post_load && ref != 0) + { + robj = db.load (ref); + cout << " " << id_ << ' ' << ref << ' ' << robj->id_ << endl; + } +} + +void object:: +db_callback (callback_event e, database&) const +{ + cout << " " << events[e] << " " << id_ << " const" << endl; +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Persist. + // + cout << "persist" << endl; + { + object o1 (1, 1); + object const o2 (2, 2); + transaction t (db->begin ()); + db->persist (o1); + db->persist (&o2); + t.commit (); + } + cout << "***" << endl; + + // Load. + // + cout << "load" << endl; + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + object o2; + db->load (2, o2); + t.commit (); + } + cout << "***" << endl; + + // Query. + // + cout << "query" << endl; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::id < 3) + "ORDER BY" + query::id)); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->id_ > 3) // Load. + break; + } + + t.commit (); + } + cout << "***" << endl; + + // Update. + // + cout << "update" << endl; + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + unique_ptr o2 (db->load (2)); + o1->data++; + o2->data++; + db->update (o1.get ()); + db->update (static_cast (*o2)); + t.commit (); + } + cout << "***" << endl; + + // Erase. + // + cout << "erase" << endl; + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + unique_ptr o2 (db->load (2)); + db->erase (static_cast (o1.get ())); + db->erase (*o2); + t.commit (); + } + cout << "***" << endl; + + // Delayed (recursive) load. + // + cout << "delayed load" << endl; + { + { + object o1 (1, 1); + object o2 (2, 2); + object o3 (3, 3); + object o4 (4, 4); + + o1.pobj = &o2; + o1.ref = 4; + + o2.pobj = &o3; + o2.ref = 4; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + object* o2 (o1->pobj); + + cout << o1->id_ << ' ' << o1->ref << ' ' << o1->robj->id_ << endl; + cout << o2->id_ << ' ' << o2->ref << ' ' << o2->robj->id_ << endl; + + delete o1->robj; + delete o2->robj; + + delete o2->pobj; + delete o2; + t.commit (); + } + } + cout << "***" << endl; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/callback/test.hxx b/odb-tests/common/callback/test.hxx new file mode 100644 index 0000000..bd30907 --- /dev/null +++ b/odb-tests/common/callback/test.hxx @@ -0,0 +1,43 @@ +// file : common/callback/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object callback(db_callback) +struct object +{ + object (unsigned long id, unsigned long d) + : id_ (id), data (d), pobj (0), robj (0), ref (0) + { + } + + object () + : id_ (0), pobj (0), robj (0) + { + } + + #pragma db id + unsigned long id_; + + unsigned long data; + + object* pobj; + + // Test custom recursive loading. + // + #pragma db transient + object* robj; + unsigned long ref; // Unless 0, reference to another object. + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/callback/testscript b/odb-tests/common/callback/testscript new file mode 100644 index 0000000..c7d03ee --- /dev/null +++ b/odb-tests/common/callback/testscript @@ -0,0 +1,100 @@ +# file : common/callback/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + ++cat <=output + persist + pre_persist 1 const + post_persist 1 const + pre_persist 2 const + post_persist 2 const + *** + load + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + *** + query + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + *** + update + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_update 1 const + post_update 1 const + pre_update 2 const + post_update 2 const + *** + erase + pre_load 0 + post_load 1 + pre_load 0 + post_load 2 + pre_erase 1 const + post_erase 1 const + pre_erase 2 const + post_erase 2 const + *** + delayed load + pre_persist 1 const + post_persist 1 const + pre_persist 2 const + post_persist 2 const + pre_persist 3 const + post_persist 3 const + pre_persist 4 const + post_persist 4 const + pre_load 0 + pre_load 0 + pre_load 0 + post_load 3 + post_load 2 + pre_load 0 + post_load 4 + 2 4 4 + post_load 1 + pre_load 0 + post_load 4 + 1 4 4 + 1 4 4 + 2 4 4 + *** + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/changelog/.gitignore b/odb-tests/common/changelog/.gitignore new file mode 100644 index 0000000..5352a2b --- /dev/null +++ b/odb-tests/common/changelog/.gitignore @@ -0,0 +1,3 @@ +# Generate ODB options file. +# +odb.options diff --git a/odb-tests/common/changelog/add-column-mssql-diff.xml b/odb-tests/common/changelog/add-column-mssql-diff.xml new file mode 100644 index 0000000..4f9ba09 --- /dev/null +++ b/odb-tests/common/changelog/add-column-mssql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-mssql-patch.xml b/odb-tests/common/changelog/add-column-mssql-patch.xml new file mode 100644 index 0000000..4f396d9 --- /dev/null +++ b/odb-tests/common/changelog/add-column-mssql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-mysql-diff.xml b/odb-tests/common/changelog/add-column-mysql-diff.xml new file mode 100644 index 0000000..992306d --- /dev/null +++ b/odb-tests/common/changelog/add-column-mysql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-mysql-patch.xml b/odb-tests/common/changelog/add-column-mysql-patch.xml new file mode 100644 index 0000000..14f3f01 --- /dev/null +++ b/odb-tests/common/changelog/add-column-mysql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-oracle-diff.xml b/odb-tests/common/changelog/add-column-oracle-diff.xml new file mode 100644 index 0000000..fa1dac6 --- /dev/null +++ b/odb-tests/common/changelog/add-column-oracle-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-oracle-patch.xml b/odb-tests/common/changelog/add-column-oracle-patch.xml new file mode 100644 index 0000000..38fb8d6 --- /dev/null +++ b/odb-tests/common/changelog/add-column-oracle-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-pgsql-diff.xml b/odb-tests/common/changelog/add-column-pgsql-diff.xml new file mode 100644 index 0000000..9524d9d --- /dev/null +++ b/odb-tests/common/changelog/add-column-pgsql-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-pgsql-patch.xml b/odb-tests/common/changelog/add-column-pgsql-patch.xml new file mode 100644 index 0000000..7f7d9a0 --- /dev/null +++ b/odb-tests/common/changelog/add-column-pgsql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-sqlite-diff.xml b/odb-tests/common/changelog/add-column-sqlite-diff.xml new file mode 100644 index 0000000..b59cc72 --- /dev/null +++ b/odb-tests/common/changelog/add-column-sqlite-diff.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column-sqlite-patch.xml b/odb-tests/common/changelog/add-column-sqlite-patch.xml new file mode 100644 index 0000000..fbe4428 --- /dev/null +++ b/odb-tests/common/changelog/add-column-sqlite-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-column.hxx b/odb-tests/common/changelog/add-column.hxx new file mode 100644 index 0000000..54eab42 --- /dev/null +++ b/odb-tests/common/changelog/add-column.hxx @@ -0,0 +1,20 @@ +// file : common/changelog/add-column.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_COLUMN_HXX +#define ADD_COLUMN_HXX + +#pragma db model version(BVER, CVER, open) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + int num; +#endif +}; + +#endif // ADD_COLUMN_HXX diff --git a/odb-tests/common/changelog/add-foreign-key-diff.xml b/odb-tests/common/changelog/add-foreign-key-diff.xml new file mode 100644 index 0000000..d4f29ad --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-mssql-diff.xml b/odb-tests/common/changelog/add-foreign-key-mssql-diff.xml new file mode 100644 index 0000000..76ebce3 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-mssql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-mssql-patch.xml b/odb-tests/common/changelog/add-foreign-key-mssql-patch.xml new file mode 100644 index 0000000..6d75709 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-mssql-patch.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-mysql-diff.xml b/odb-tests/common/changelog/add-foreign-key-mysql-diff.xml new file mode 100644 index 0000000..acdfd5b --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-mysql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-mysql-patch.xml b/odb-tests/common/changelog/add-foreign-key-mysql-patch.xml new file mode 100644 index 0000000..adc9081 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-mysql-patch.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-oracle-diff.xml b/odb-tests/common/changelog/add-foreign-key-oracle-diff.xml new file mode 100644 index 0000000..6bd8bc3 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-oracle-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-oracle-patch.xml b/odb-tests/common/changelog/add-foreign-key-oracle-patch.xml new file mode 100644 index 0000000..7aa01ea --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-oracle-patch.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-pgsql-diff.xml b/odb-tests/common/changelog/add-foreign-key-pgsql-diff.xml new file mode 100644 index 0000000..793b009 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-pgsql-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-pgsql-patch.xml b/odb-tests/common/changelog/add-foreign-key-pgsql-patch.xml new file mode 100644 index 0000000..a256831 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-pgsql-patch.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-sqlite-diff.xml b/odb-tests/common/changelog/add-foreign-key-sqlite-diff.xml new file mode 100644 index 0000000..1510470 --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-sqlite-diff.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key-sqlite-patch.xml b/odb-tests/common/changelog/add-foreign-key-sqlite-patch.xml new file mode 100644 index 0000000..1c2d0ea --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key-sqlite-patch.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-foreign-key.hxx b/odb-tests/common/changelog/add-foreign-key.hxx new file mode 100644 index 0000000..2a43eea --- /dev/null +++ b/odb-tests/common/changelog/add-foreign-key.hxx @@ -0,0 +1,29 @@ +// file : common/changelog/add-foreign-key.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_FOREIGN_KEY_HXX +#define ADD_FOREIGN_KEY_HXX + +#pragma db model version(BVER, CVER, open) + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + object1* o1; +#endif +}; + +#pragma db object +struct object1 +{ + #pragma db id + int id; +}; + +#endif // ADD_FOREIGN_KEY_HXX diff --git a/odb-tests/common/changelog/add-index-mssql-diff.xml b/odb-tests/common/changelog/add-index-mssql-diff.xml new file mode 100644 index 0000000..58c623f --- /dev/null +++ b/odb-tests/common/changelog/add-index-mssql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-mssql-patch.xml b/odb-tests/common/changelog/add-index-mssql-patch.xml new file mode 100644 index 0000000..2b10e65 --- /dev/null +++ b/odb-tests/common/changelog/add-index-mssql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-mysql-diff.xml b/odb-tests/common/changelog/add-index-mysql-diff.xml new file mode 100644 index 0000000..a54a7e3 --- /dev/null +++ b/odb-tests/common/changelog/add-index-mysql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-mysql-patch.xml b/odb-tests/common/changelog/add-index-mysql-patch.xml new file mode 100644 index 0000000..a2454b8 --- /dev/null +++ b/odb-tests/common/changelog/add-index-mysql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-oracle-diff.xml b/odb-tests/common/changelog/add-index-oracle-diff.xml new file mode 100644 index 0000000..80f8ecc --- /dev/null +++ b/odb-tests/common/changelog/add-index-oracle-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-oracle-patch.xml b/odb-tests/common/changelog/add-index-oracle-patch.xml new file mode 100644 index 0000000..a9bafea --- /dev/null +++ b/odb-tests/common/changelog/add-index-oracle-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-pgsql-diff.xml b/odb-tests/common/changelog/add-index-pgsql-diff.xml new file mode 100644 index 0000000..3988643 --- /dev/null +++ b/odb-tests/common/changelog/add-index-pgsql-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-pgsql-patch.xml b/odb-tests/common/changelog/add-index-pgsql-patch.xml new file mode 100644 index 0000000..e9c564c --- /dev/null +++ b/odb-tests/common/changelog/add-index-pgsql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-sqlite-diff.xml b/odb-tests/common/changelog/add-index-sqlite-diff.xml new file mode 100644 index 0000000..c1f7fdc --- /dev/null +++ b/odb-tests/common/changelog/add-index-sqlite-diff.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index-sqlite-patch.xml b/odb-tests/common/changelog/add-index-sqlite-patch.xml new file mode 100644 index 0000000..b9512e0 --- /dev/null +++ b/odb-tests/common/changelog/add-index-sqlite-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-index.hxx b/odb-tests/common/changelog/add-index.hxx new file mode 100644 index 0000000..645cee2 --- /dev/null +++ b/odb-tests/common/changelog/add-index.hxx @@ -0,0 +1,24 @@ +// file : common/changelog/add-index.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_INDEX_HXX +#define ADD_INDEX_HXX + +#pragma db model version(BVER, CVER, open) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + + int x; + +#if CVER > 1 + int y; + #pragma db index ("xy_i") unique member(x) member(y, "DESC") +#endif + +}; + +#endif // ADD_INDEX_HXX diff --git a/odb-tests/common/changelog/add-table-mssql-diff.xml b/odb-tests/common/changelog/add-table-mssql-diff.xml new file mode 100644 index 0000000..8bf0e30 --- /dev/null +++ b/odb-tests/common/changelog/add-table-mssql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-mssql-patch.xml b/odb-tests/common/changelog/add-table-mssql-patch.xml new file mode 100644 index 0000000..9dd41f3 --- /dev/null +++ b/odb-tests/common/changelog/add-table-mssql-patch.xml @@ -0,0 +1,44 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-mysql-diff.xml b/odb-tests/common/changelog/add-table-mysql-diff.xml new file mode 100644 index 0000000..57f741b --- /dev/null +++ b/odb-tests/common/changelog/add-table-mysql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-mysql-patch.xml b/odb-tests/common/changelog/add-table-mysql-patch.xml new file mode 100644 index 0000000..0db1e9f --- /dev/null +++ b/odb-tests/common/changelog/add-table-mysql-patch.xml @@ -0,0 +1,44 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-oracle-diff.xml b/odb-tests/common/changelog/add-table-oracle-diff.xml new file mode 100644 index 0000000..70ec7c6 --- /dev/null +++ b/odb-tests/common/changelog/add-table-oracle-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-oracle-patch.xml b/odb-tests/common/changelog/add-table-oracle-patch.xml new file mode 100644 index 0000000..969c2e0 --- /dev/null +++ b/odb-tests/common/changelog/add-table-oracle-patch.xml @@ -0,0 +1,44 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-pgsql-diff.xml b/odb-tests/common/changelog/add-table-pgsql-diff.xml new file mode 100644 index 0000000..9b48062 --- /dev/null +++ b/odb-tests/common/changelog/add-table-pgsql-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-pgsql-patch.xml b/odb-tests/common/changelog/add-table-pgsql-patch.xml new file mode 100644 index 0000000..b04a933 --- /dev/null +++ b/odb-tests/common/changelog/add-table-pgsql-patch.xml @@ -0,0 +1,44 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-sqlite-diff.xml b/odb-tests/common/changelog/add-table-sqlite-diff.xml new file mode 100644 index 0000000..573bc69 --- /dev/null +++ b/odb-tests/common/changelog/add-table-sqlite-diff.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table-sqlite-patch.xml b/odb-tests/common/changelog/add-table-sqlite-patch.xml new file mode 100644 index 0000000..3506410 --- /dev/null +++ b/odb-tests/common/changelog/add-table-sqlite-patch.xml @@ -0,0 +1,44 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/add-table.hxx b/odb-tests/common/changelog/add-table.hxx new file mode 100644 index 0000000..a22e206 --- /dev/null +++ b/odb-tests/common/changelog/add-table.hxx @@ -0,0 +1,34 @@ +// file : common/changelog/add-table.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ADD_TABLE_HXX +#define ADD_TABLE_HXX + +#include + +#pragma db model version(BVER, CVER, open) + +struct object1; + +#if CVER > 1 +#pragma db object +struct object +{ + #pragma db id auto + int id; + int num; + + std::vector nums; + object1* o1; +}; +#endif + +#pragma db object +struct object1 +{ + #pragma db id + int id; + int num; +}; + +#endif // ADD_TABLE_HXX diff --git a/odb-tests/common/changelog/alter-column-mssql-diff.xml b/odb-tests/common/changelog/alter-column-mssql-diff.xml new file mode 100644 index 0000000..6c1fb6a --- /dev/null +++ b/odb-tests/common/changelog/alter-column-mssql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-mssql-patch.xml b/odb-tests/common/changelog/alter-column-mssql-patch.xml new file mode 100644 index 0000000..15db347 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-mssql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-mysql-diff.xml b/odb-tests/common/changelog/alter-column-mysql-diff.xml new file mode 100644 index 0000000..39ad6ef --- /dev/null +++ b/odb-tests/common/changelog/alter-column-mysql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-mysql-patch.xml b/odb-tests/common/changelog/alter-column-mysql-patch.xml new file mode 100644 index 0000000..0131466 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-mysql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-oracle-diff.xml b/odb-tests/common/changelog/alter-column-oracle-diff.xml new file mode 100644 index 0000000..d41d333 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-oracle-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-oracle-patch.xml b/odb-tests/common/changelog/alter-column-oracle-patch.xml new file mode 100644 index 0000000..0e0794d --- /dev/null +++ b/odb-tests/common/changelog/alter-column-oracle-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-pgsql-diff.xml b/odb-tests/common/changelog/alter-column-pgsql-diff.xml new file mode 100644 index 0000000..fd97fa0 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-pgsql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-pgsql-patch.xml b/odb-tests/common/changelog/alter-column-pgsql-patch.xml new file mode 100644 index 0000000..dade1a3 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-pgsql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-sqlite-diff.xml b/odb-tests/common/changelog/alter-column-sqlite-diff.xml new file mode 100644 index 0000000..7ecea06 --- /dev/null +++ b/odb-tests/common/changelog/alter-column-sqlite-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column-sqlite-patch.xml b/odb-tests/common/changelog/alter-column-sqlite-patch.xml new file mode 100644 index 0000000..de2762e --- /dev/null +++ b/odb-tests/common/changelog/alter-column-sqlite-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/alter-column.hxx b/odb-tests/common/changelog/alter-column.hxx new file mode 100644 index 0000000..02f091d --- /dev/null +++ b/odb-tests/common/changelog/alter-column.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/alter-column.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ALTER_COLUMN_HXX +#define ALTER_COLUMN_HXX + +#pragma db model version(BVER, CVER, open) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER > 1 + #pragma db null +#endif + int num; +}; + +#endif // ALTER_COLUMN_HXX diff --git a/odb-tests/common/changelog/buildfile b/odb-tests/common/changelog/buildfile new file mode 100644 index 0000000..04e0685 --- /dev/null +++ b/odb-tests/common/changelog/buildfile @@ -0,0 +1,30 @@ +# file : common/changelog/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +./: file{odb.options} xml{*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the below ad hoc recipe. +# +libue{test-meta}: $libodb + +file{odb.options}: libue{test-meta} +{{ + pops = $cxx.lib_poptions($<[0]) + depdb hash $pops + + f = $path($>[0]) + rm -f $f + + for o: $pops + echo $o >+$f + end +}} + +# Testscript's run-time prerequisites. +# +testscript@./: test = $odb + +./: $odb: clean = false diff --git a/odb-tests/common/changelog/drop-column-mssql-diff.xml b/odb-tests/common/changelog/drop-column-mssql-diff.xml new file mode 100644 index 0000000..f2bab96 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-mssql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-mssql-patch.xml b/odb-tests/common/changelog/drop-column-mssql-patch.xml new file mode 100644 index 0000000..32402a3 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-mssql-patch.xml @@ -0,0 +1,12 @@ + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-mysql-diff.xml b/odb-tests/common/changelog/drop-column-mysql-diff.xml new file mode 100644 index 0000000..2bb321d --- /dev/null +++ b/odb-tests/common/changelog/drop-column-mysql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-mysql-patch.xml b/odb-tests/common/changelog/drop-column-mysql-patch.xml new file mode 100644 index 0000000..6572ebe --- /dev/null +++ b/odb-tests/common/changelog/drop-column-mysql-patch.xml @@ -0,0 +1,12 @@ + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-oracle-diff.xml b/odb-tests/common/changelog/drop-column-oracle-diff.xml new file mode 100644 index 0000000..e920a12 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-oracle-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-oracle-patch.xml b/odb-tests/common/changelog/drop-column-oracle-patch.xml new file mode 100644 index 0000000..b113664 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-oracle-patch.xml @@ -0,0 +1,12 @@ + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-pgsql-diff.xml b/odb-tests/common/changelog/drop-column-pgsql-diff.xml new file mode 100644 index 0000000..d2e91ba --- /dev/null +++ b/odb-tests/common/changelog/drop-column-pgsql-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-pgsql-patch.xml b/odb-tests/common/changelog/drop-column-pgsql-patch.xml new file mode 100644 index 0000000..06cc73d --- /dev/null +++ b/odb-tests/common/changelog/drop-column-pgsql-patch.xml @@ -0,0 +1,12 @@ + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-sqlite-diff.xml b/odb-tests/common/changelog/drop-column-sqlite-diff.xml new file mode 100644 index 0000000..1c9d138 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-sqlite-diff.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column-sqlite-patch.xml b/odb-tests/common/changelog/drop-column-sqlite-patch.xml new file mode 100644 index 0000000..6887530 --- /dev/null +++ b/odb-tests/common/changelog/drop-column-sqlite-patch.xml @@ -0,0 +1,12 @@ + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-column.hxx b/odb-tests/common/changelog/drop-column.hxx new file mode 100644 index 0000000..3de237d --- /dev/null +++ b/odb-tests/common/changelog/drop-column.hxx @@ -0,0 +1,20 @@ +// file : common/changelog/drop-column.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_COLUMN_HXX +#define DROP_COLUMN_HXX + +#pragma db model version(BVER, CVER, open) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + int num; +#endif +}; + +#endif // DROP_COLUMN_HXX diff --git a/odb-tests/common/changelog/drop-foreign-key-mssql-diff.xml b/odb-tests/common/changelog/drop-foreign-key-mssql-diff.xml new file mode 100644 index 0000000..da3ce73 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-mssql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-mssql-patch.xml b/odb-tests/common/changelog/drop-foreign-key-mssql-patch.xml new file mode 100644 index 0000000..cd1a372 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-mssql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-mysql-diff.xml b/odb-tests/common/changelog/drop-foreign-key-mysql-diff.xml new file mode 100644 index 0000000..aa179f2 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-mysql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-mysql-patch.xml b/odb-tests/common/changelog/drop-foreign-key-mysql-patch.xml new file mode 100644 index 0000000..67f026e --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-mysql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-oracle-diff.xml b/odb-tests/common/changelog/drop-foreign-key-oracle-diff.xml new file mode 100644 index 0000000..aa407d3 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-oracle-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-oracle-patch.xml b/odb-tests/common/changelog/drop-foreign-key-oracle-patch.xml new file mode 100644 index 0000000..56253f0 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-oracle-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-pgsql-diff.xml b/odb-tests/common/changelog/drop-foreign-key-pgsql-diff.xml new file mode 100644 index 0000000..9a6259a --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-pgsql-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-pgsql-patch.xml b/odb-tests/common/changelog/drop-foreign-key-pgsql-patch.xml new file mode 100644 index 0000000..df024b4 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-pgsql-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-sqlite-diff.xml b/odb-tests/common/changelog/drop-foreign-key-sqlite-diff.xml new file mode 100644 index 0000000..6f9f994 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-sqlite-diff.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key-sqlite-patch.xml b/odb-tests/common/changelog/drop-foreign-key-sqlite-patch.xml new file mode 100644 index 0000000..6e63218 --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key-sqlite-patch.xml @@ -0,0 +1,18 @@ + + + + + + + + + +
+ + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-foreign-key.hxx b/odb-tests/common/changelog/drop-foreign-key.hxx new file mode 100644 index 0000000..ba3005f --- /dev/null +++ b/odb-tests/common/changelog/drop-foreign-key.hxx @@ -0,0 +1,29 @@ +// file : common/changelog/drop-foreign-key.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_FOREIGN_KEY_HXX +#define DROP_FOREIGN_KEY_HXX + +#pragma db model version(BVER, CVER, open) + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + object1* o1; +#endif +}; + +#pragma db object +struct object1 +{ + #pragma db id + int id; +}; + +#endif // DROP_FOREIGN_KEY_HXX diff --git a/odb-tests/common/changelog/drop-index-mssql-diff.xml b/odb-tests/common/changelog/drop-index-mssql-diff.xml new file mode 100644 index 0000000..ac95db5 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-mssql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-mssql-patch.xml b/odb-tests/common/changelog/drop-index-mssql-patch.xml new file mode 100644 index 0000000..4f396d9 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-mssql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-mysql-diff.xml b/odb-tests/common/changelog/drop-index-mysql-diff.xml new file mode 100644 index 0000000..f8c95ef --- /dev/null +++ b/odb-tests/common/changelog/drop-index-mysql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-mysql-patch.xml b/odb-tests/common/changelog/drop-index-mysql-patch.xml new file mode 100644 index 0000000..14f3f01 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-mysql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-oracle-diff.xml b/odb-tests/common/changelog/drop-index-oracle-diff.xml new file mode 100644 index 0000000..d174802 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-oracle-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-oracle-patch.xml b/odb-tests/common/changelog/drop-index-oracle-patch.xml new file mode 100644 index 0000000..38fb8d6 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-oracle-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-pgsql-diff.xml b/odb-tests/common/changelog/drop-index-pgsql-diff.xml new file mode 100644 index 0000000..375a3d8 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-pgsql-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-pgsql-patch.xml b/odb-tests/common/changelog/drop-index-pgsql-patch.xml new file mode 100644 index 0000000..7f7d9a0 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-pgsql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-sqlite-diff.xml b/odb-tests/common/changelog/drop-index-sqlite-diff.xml new file mode 100644 index 0000000..bf54f9d --- /dev/null +++ b/odb-tests/common/changelog/drop-index-sqlite-diff.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index-sqlite-patch.xml b/odb-tests/common/changelog/drop-index-sqlite-patch.xml new file mode 100644 index 0000000..fbe4428 --- /dev/null +++ b/odb-tests/common/changelog/drop-index-sqlite-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-index.hxx b/odb-tests/common/changelog/drop-index.hxx new file mode 100644 index 0000000..08fecba --- /dev/null +++ b/odb-tests/common/changelog/drop-index.hxx @@ -0,0 +1,21 @@ +// file : common/changelog/drop-index.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_INDEX_HXX +#define DROP_INDEX_HXX + +#pragma db model version(BVER, CVER, open) + +#pragma db object +struct object +{ + #pragma db id auto + int id; + +#if CVER == 1 + #pragma db index +#endif + int num; +}; + +#endif // DROP_INDEX_HXX diff --git a/odb-tests/common/changelog/drop-table-mssql-diff.xml b/odb-tests/common/changelog/drop-table-mssql-diff.xml new file mode 100644 index 0000000..399d8bc --- /dev/null +++ b/odb-tests/common/changelog/drop-table-mssql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-mssql-patch.xml b/odb-tests/common/changelog/drop-table-mssql-patch.xml new file mode 100644 index 0000000..c5dda75 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-mssql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-mysql-diff.xml b/odb-tests/common/changelog/drop-table-mysql-diff.xml new file mode 100644 index 0000000..3ccd553 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-mysql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-mysql-patch.xml b/odb-tests/common/changelog/drop-table-mysql-patch.xml new file mode 100644 index 0000000..250bd20 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-mysql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-oracle-diff.xml b/odb-tests/common/changelog/drop-table-oracle-diff.xml new file mode 100644 index 0000000..589d64b --- /dev/null +++ b/odb-tests/common/changelog/drop-table-oracle-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-oracle-patch.xml b/odb-tests/common/changelog/drop-table-oracle-patch.xml new file mode 100644 index 0000000..5f222dc --- /dev/null +++ b/odb-tests/common/changelog/drop-table-oracle-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-pgsql-diff.xml b/odb-tests/common/changelog/drop-table-pgsql-diff.xml new file mode 100644 index 0000000..168ec46 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-pgsql-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-pgsql-patch.xml b/odb-tests/common/changelog/drop-table-pgsql-patch.xml new file mode 100644 index 0000000..ebb7000 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-pgsql-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-sqlite-diff.xml b/odb-tests/common/changelog/drop-table-sqlite-diff.xml new file mode 100644 index 0000000..6a258c4 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-sqlite-diff.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table-sqlite-patch.xml b/odb-tests/common/changelog/drop-table-sqlite-patch.xml new file mode 100644 index 0000000..45c6f00 --- /dev/null +++ b/odb-tests/common/changelog/drop-table-sqlite-patch.xml @@ -0,0 +1,13 @@ + + + + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/drop-table.hxx b/odb-tests/common/changelog/drop-table.hxx new file mode 100644 index 0000000..2919e52 --- /dev/null +++ b/odb-tests/common/changelog/drop-table.hxx @@ -0,0 +1,34 @@ +// file : common/changelog/drop-table.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef DROP_TABLE_HXX +#define DROP_TABLE_HXX + +#include + +#pragma db model version(BVER, CVER, open) + +struct object1; + +#if CVER == 1 +#pragma db object +struct object +{ + #pragma db id auto + int id; + int num; + + std::vector nums; + object1* o1; +}; +#endif + +#pragma db object +struct object1 +{ + #pragma db id + int id; + int num; +}; + +#endif // DROP_TABLE_HXX diff --git a/odb-tests/common/changelog/model-mssql-diff.xml b/odb-tests/common/changelog/model-mssql-diff.xml new file mode 120000 index 0000000..e1f812d --- /dev/null +++ b/odb-tests/common/changelog/model-mssql-diff.xml @@ -0,0 +1 @@ +model-mssql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-mssql-patch.xml b/odb-tests/common/changelog/model-mssql-patch.xml new file mode 120000 index 0000000..e1f812d --- /dev/null +++ b/odb-tests/common/changelog/model-mssql-patch.xml @@ -0,0 +1 @@ +model-mssql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-mssql.xml b/odb-tests/common/changelog/model-mssql.xml new file mode 100644 index 0000000..509a210 --- /dev/null +++ b/odb-tests/common/changelog/model-mssql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/model-mysql-diff.xml b/odb-tests/common/changelog/model-mysql-diff.xml new file mode 120000 index 0000000..9100280 --- /dev/null +++ b/odb-tests/common/changelog/model-mysql-diff.xml @@ -0,0 +1 @@ +model-mysql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-mysql-patch.xml b/odb-tests/common/changelog/model-mysql-patch.xml new file mode 120000 index 0000000..9100280 --- /dev/null +++ b/odb-tests/common/changelog/model-mysql-patch.xml @@ -0,0 +1 @@ +model-mysql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-mysql.xml b/odb-tests/common/changelog/model-mysql.xml new file mode 100644 index 0000000..ffbcf8d --- /dev/null +++ b/odb-tests/common/changelog/model-mysql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/model-oracle-diff.xml b/odb-tests/common/changelog/model-oracle-diff.xml new file mode 120000 index 0000000..36e4479 --- /dev/null +++ b/odb-tests/common/changelog/model-oracle-diff.xml @@ -0,0 +1 @@ +model-oracle.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-oracle-patch.xml b/odb-tests/common/changelog/model-oracle-patch.xml new file mode 120000 index 0000000..36e4479 --- /dev/null +++ b/odb-tests/common/changelog/model-oracle-patch.xml @@ -0,0 +1 @@ +model-oracle.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-oracle.xml b/odb-tests/common/changelog/model-oracle.xml new file mode 100644 index 0000000..1824690 --- /dev/null +++ b/odb-tests/common/changelog/model-oracle.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/model-pgsql-diff.xml b/odb-tests/common/changelog/model-pgsql-diff.xml new file mode 120000 index 0000000..b39ce26 --- /dev/null +++ b/odb-tests/common/changelog/model-pgsql-diff.xml @@ -0,0 +1 @@ +model-pgsql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-pgsql-patch.xml b/odb-tests/common/changelog/model-pgsql-patch.xml new file mode 120000 index 0000000..b39ce26 --- /dev/null +++ b/odb-tests/common/changelog/model-pgsql-patch.xml @@ -0,0 +1 @@ +model-pgsql.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-pgsql.xml b/odb-tests/common/changelog/model-pgsql.xml new file mode 100644 index 0000000..13aee6b --- /dev/null +++ b/odb-tests/common/changelog/model-pgsql.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/model-sqlite-diff.xml b/odb-tests/common/changelog/model-sqlite-diff.xml new file mode 120000 index 0000000..3454f51 --- /dev/null +++ b/odb-tests/common/changelog/model-sqlite-diff.xml @@ -0,0 +1 @@ +model-sqlite.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-sqlite-patch.xml b/odb-tests/common/changelog/model-sqlite-patch.xml new file mode 120000 index 0000000..3454f51 --- /dev/null +++ b/odb-tests/common/changelog/model-sqlite-patch.xml @@ -0,0 +1 @@ +model-sqlite.xml \ No newline at end of file diff --git a/odb-tests/common/changelog/model-sqlite.xml b/odb-tests/common/changelog/model-sqlite.xml new file mode 100644 index 0000000..d0199ed --- /dev/null +++ b/odb-tests/common/changelog/model-sqlite.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+
diff --git a/odb-tests/common/changelog/model.hxx b/odb-tests/common/changelog/model.hxx new file mode 100644 index 0000000..aa8891a --- /dev/null +++ b/odb-tests/common/changelog/model.hxx @@ -0,0 +1,46 @@ +// file : common/changelog/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_HXX +#define MODEL_HXX + +#include + +#pragma db model version(1, 1, open) + +#pragma db value +struct value +{ + int x; + int y; +}; + +struct object1; + +#pragma db object +struct object +{ + #pragma db id auto + int id; + + #pragma db null default(0) options("DUMMY=1") + int num; + + #pragma db index unique member(num, "DESC") method("BTREE") options("DUMMY=1") + + #pragma db index + value v; // Multi-column. + + std::vector nums; + object1* o1; +}; + +#pragma db object +struct object1 +{ + #pragma db id + value id; // Multi-column. + int num; +}; + +#endif // MODEL_HXX diff --git a/odb-tests/common/changelog/testscript b/odb-tests/common/changelog/testscript new file mode 100644 index 0000000..9368938 --- /dev/null +++ b/odb-tests/common/changelog/testscript @@ -0,0 +1,66 @@ +# file : common/changelog/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +headers = [paths] $path_search($src_base/*.hxx) + +odb_options = --generate-schema-only \ + --schema-format sql \ + --suppress-migration \ + --options-file $out_base/odb.options + +: mysql +: +if $mysql +{ + odb_options += --database 'mysql' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-mysql-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-mysql-patch.xml $(n).xml + end +} + +: sqlite +: +if $sqlite +{ + odb_options += --database 'sqlite' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-sqlite-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-sqlite-patch.xml $(n).xml + end +} + +: pgsql +: +if $pgsql +{ + odb_options += --database 'pgsql' --changelog-dir $~ + + for h: $headers + n = $base($leaf($h)) + + $* $odb_options -DBVER=1 -DCVER=1 --init-changelog $h &$(n).xml &$(n).sql + + $* $odb_options -DBVER=1 -DCVER=2 $h + diff $src_base/$n-pgsql-diff.xml $(n).xml + + $* $odb_options -DBVER=2 -DCVER=3 $h + diff $src_base/$n-pgsql-patch.xml $(n).xml + end +} diff --git a/odb-tests/common/circular/multiple/.gitignore b/odb-tests/common/circular/multiple/.gitignore new file mode 100644 index 0000000..5d39d39 --- /dev/null +++ b/odb-tests/common/circular/multiple/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx diff --git a/odb-tests/common/circular/multiple/buildfile b/odb-tests/common/circular/multiple/buildfile new file mode 100644 index 0000000..b060cb5 --- /dev/null +++ b/odb-tests/common/circular/multiple/buildfile @@ -0,0 +1,49 @@ +# file : common/circular/multiple/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix circular_m_ \ + --generate-schema \ + --generate-query \ + --schema-format embedded + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/circular/multiple/driver.cxx b/odb-tests/common/circular/multiple/driver.cxx new file mode 100644 index 0000000..4887ac2 --- /dev/null +++ b/odb-tests/common/circular/multiple/driver.cxx @@ -0,0 +1,69 @@ +// file : common/circular/multiple/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test cases of circular dependencies between persistent classes, multiple +// files version. +// + +#include // std::unique_ptr +#include + +#include +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" + +#include "test2-odb.hxx" +#include "test1-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for MySQL and SQLite. + // For these databases this is the only way to drop circularly- + // dependant tables. + // + if (db->id () == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); + else if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + + if (db->id () == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); + else if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); + } + + query bq (query::d->id != 0); + query dq (query::b->id != 0); + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/circular/multiple/test1.hxx b/odb-tests/common/circular/multiple/test1.hxx new file mode 100644 index 0000000..36df963 --- /dev/null +++ b/odb-tests/common/circular/multiple/test1.hxx @@ -0,0 +1,27 @@ +// file : common/circular/multiple/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include + +#pragma db object +struct derived; + +#pragma db object polymorphic +struct base +{ + virtual ~base () {} + + #pragma db id + unsigned long id_; + + derived* d_; +}; + +#ifdef ODB_COMPILER +# include "test2.hxx" +#endif + +#endif // TEST1_HXX diff --git a/odb-tests/common/circular/multiple/test2.hxx b/odb-tests/common/circular/multiple/test2.hxx new file mode 100644 index 0000000..49e9ed2 --- /dev/null +++ b/odb-tests/common/circular/multiple/test2.hxx @@ -0,0 +1,17 @@ +// file : common/circular/multiple/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include + +#include "test1.hxx" + +#pragma db object +struct derived: base +{ + base* b_; +}; + +#endif // TEST2_HXX diff --git a/odb-tests/common/circular/multiple/testscript b/odb-tests/common/circular/multiple/testscript new file mode 100644 index 0000000..6a05dc6 --- /dev/null +++ b/odb-tests/common/circular/multiple/testscript @@ -0,0 +1,31 @@ +# file : common/circular/multiple/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/circular/single/buildfile b/odb-tests/common/circular/single/buildfile new file mode 100644 index 0000000..740ce91 --- /dev/null +++ b/odb-tests/common/circular/single/buildfile @@ -0,0 +1,41 @@ +# file : common/circular/single/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix circular_s_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/circular/single/driver.cxx b/odb-tests/common/circular/single/driver.cxx new file mode 100644 index 0000000..9bcb135 --- /dev/null +++ b/odb-tests/common/circular/single/driver.cxx @@ -0,0 +1,40 @@ +// file : common/circular/single/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test cases of circular dependencies between persistent classes, single +// file version. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + query bq (query::d->id != 0); + query dq (query::b->id != 0); + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/circular/single/test.hxx b/odb-tests/common/circular/single/test.hxx new file mode 100644 index 0000000..7f95dea --- /dev/null +++ b/odb-tests/common/circular/single/test.hxx @@ -0,0 +1,28 @@ +// file : common/circular/single/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +struct derived; + +#pragma db object polymorphic +struct base +{ + virtual ~base () {} + + #pragma db id + unsigned long id_; + + derived* d_; +}; + +#pragma db object +struct derived: base +{ + base* b_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/circular/single/testscript b/odb-tests/common/circular/single/testscript new file mode 100644 index 0000000..b870306 --- /dev/null +++ b/odb-tests/common/circular/single/testscript @@ -0,0 +1,33 @@ +# file : common/circular/single/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/composite/buildfile b/odb-tests/common/composite/buildfile new file mode 100644 index 0000000..0a60638 --- /dev/null +++ b/odb-tests/common/composite/buildfile @@ -0,0 +1,41 @@ +# file : common/composite/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_comp_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/composite/driver.cxx b/odb-tests/common/composite/driver.cxx new file mode 100644 index 0000000..06b24b2 --- /dev/null +++ b/odb-tests/common/composite/driver.cxx @@ -0,0 +1,229 @@ +// file : common/composite/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test composite value types. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +#undef NDEBUG +#include + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic composite functionality. + // + for (unsigned short i (0); i < 2; ++i) + { + using namespace test1; + + person p (1); + p.name_.first = "Joe"; + p.name_.last = "Dirt"; + p.name_.title = "Mr"; + p.name_.alias.first = "Anthony"; + p.name_.alias.last = "Clean"; + p.name_.nick = "Squeaky"; + p.name_.flags.nick = true; + p.name_.flags.alias = false; + p.age_ = 32; + + // persist + // + { + transaction t (db->begin ()); + db->persist (p); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + p.name_.title = "Mrs"; + p.name_.alias.first = "Anthonia"; + p.name_.flags.nick = false; + p.name_.flags.alias = true; + + // update + // + { + transaction t (db->begin ()); + db->update (p); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (1)); + t.commit (); + + assert (p == *p1); + } + + typedef odb::query query; + typedef odb::result result; + + // query + // + { + transaction t (db->begin ()); + + result r (db->query (query::name.first == "Joe")); + + assert (!r.empty ()); + assert (*r.begin () == p); + assert (size (r) == 1); + + t.commit (); + } + + // query + // + { + transaction t (db->begin ()); + + result r (db->query (query::name.flags.alias)); + + assert (!r.empty ()); + assert (*r.begin () == p); + assert (size (r) == 1); + + t.commit (); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase (1); + t.commit (); + } + } + + // Test composite class template instantiation. + // + { + using namespace test2; + + object o (1); + + o.comp_.num = 123; + o.comp_.str = "abc"; + o.comp_.vec.push_back (int_str_pair (123, "abc")); + o.comp_.vec.push_back (int_str_pair (234, "bcd")); + o.comp_.vec.push_back (int_str_pair (345, "cde")); + + o.pair_.first = 123; + o.pair_.second = "abc"; + + o.vec_.push_back (int_str_pair (123, "abc")); + o.vec_.push_back (int_str_pair (234, "bcd")); + o.vec_.push_back (int_str_pair (345, "cde")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + + // Test empty column name. + // + { + using namespace test3; + + object o (1); + o.c_.str = "abc"; + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + + // Test composite definition inside object. + { + using namespace test4; + + object o (1); + o.str ("abc"); + o.x (123); + o.y (234); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/composite/test.hxx b/odb-tests/common/composite/test.hxx new file mode 100644 index 0000000..13b2025 --- /dev/null +++ b/odb-tests/common/composite/test.hxx @@ -0,0 +1,250 @@ +// file : common/composite/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::pair + +#include + +// Test basic composite functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db value + struct name + { + std::string first; + std::string last; + }; + + #pragma db value + struct name_title + { + std::string title; + }; + + #pragma db value + struct name_title_ex: name_title + { + // Test value types without data members. + }; + + #pragma db value + struct name_flags + { + bool nick; + bool alias; + }; + + #pragma db value + struct name_ex: name, name_title_ex + { + name alias; + std::string nick; + + #pragma db column("show_") + name_flags flags; + }; + + #pragma db object + struct person + { + person () {} + person (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db column("") + name_ex name_; + + unsigned short age_; + }; + + inline bool + operator== (const person& x, const person& y) + { + return x.id_ == y.id_ && + x.name_.first == y.name_.first&& + x.name_.last == y.name_.last && + x.name_.title == y.name_.title && + x.name_.alias.first == y.name_.alias.first && + x.name_.alias.last == y.name_.alias.last && + x.name_.nick == y.name_.nick && + x.name_.flags.nick == y.name_.flags.nick && + x.name_.flags.alias == y.name_.flags.alias && + x.age_ == y.age_; + } +} + +// Test composite class template instantiation. +// +#pragma db namespace table("t2_") +namespace test2 +{ + template + struct comp + { + I num; + S str; + std::vector > vec; + }; + + template + inline bool + operator== (const comp& x, const comp& y) + { + return x.num == y.num && x.str == y.str && x.vec == y.vec; + } + + typedef std::pair int_str_pair; + #pragma db value(int_str_pair) + + // Make sure we use the name that was specified in the pragma. + // +#ifdef ODB_COMPILER + typedef comp int_str_comp1; +#endif + + typedef comp int_str_comp; + #pragma db value(int_str_comp) + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + comp comp_; + std::pair pair_; + std::vector vec_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id_ == y.id_ && + x.comp_ == y.comp_ && + x.pair_ == y.pair_ && + x.vec_ == y.vec_; + } +} + +// Test empty column name. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct comp + { + #pragma db column("") + std::string str; + }; + + #pragma db object + struct object + { + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + comp c_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id_ == y.id_ && x.c_.str == y.c_.str; + } +} + +// Test composite definition inside object. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + unsigned long id () const {return id_;} + + void str (const std::string& s) {c_.str = s;} + const std::string& str () const {return c_.str;} + + void x (int i) {p_.first = i;} + int x () const {return p_.first;} + + void y (int i) {p_.second = i;} + int y () const {return p_.second;} + + private: + friend class odb::access; + + #pragma db id + unsigned long id_; + + #pragma db value + struct comp + { + std::string str; + }; + + comp c_; + + typedef std::pair int_pair; + #pragma db value(int_pair) + + int_pair p_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id () == y.id () && x.str () == y.str () && + x.x () == y.x () && x.y () == y.y (); + } +} + +// Test composite name clashes in query columns (compilation test) +// +#pragma db namespace table("t5_") +namespace test5 +{ + // Class-member conflict. + // + #pragma db value + struct value {int value_;}; + + // Class-class conflict. + // + #pragma db value + struct inner {int value;}; + + #pragma db value + struct outer {inner value;}; + + #pragma db object + struct object + { + #pragma db id + int id; + + outer value; + test5::value v; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/composite/testscript b/odb-tests/common/composite/testscript new file mode 100644 index 0000000..0747507 --- /dev/null +++ b/odb-tests/common/composite/testscript @@ -0,0 +1,33 @@ +# file : common/composite/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/const-member/buildfile b/odb-tests/common/const-member/buildfile new file mode 100644 index 0000000..868f7fd --- /dev/null +++ b/odb-tests/common/const-member/buildfile @@ -0,0 +1,40 @@ +# file : common/const-member/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix constm_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/const-member/driver.cxx b/odb-tests/common/const-member/driver.cxx new file mode 100644 index 0000000..0c71dfa --- /dev/null +++ b/odb-tests/common/const-member/driver.cxx @@ -0,0 +1,119 @@ +// file : common/const-member/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test const data members. The readonly test tests that const +// members are automatically treated as read-only. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Const ids. + // + { + const_id o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + assert (o.id == 1); + } + } + + { + { + const_auto_id o; + transaction t (db->begin ()); + db->persist (o); + t.commit (); + assert (o.id == 1); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + t.commit (); + assert (o->id == 1); + } + } + + // Container. + // + { + container o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + t.commit (); + + assert (o->ccom.vec.size () == 1 && o->ccom.vec[0] == 1 && + o->ccom.cvec.size () == 1 && o->ccom.cvec[0] == 1 && + o->cvec.size () == 1 && o->cvec[0] == 1); + } + } + + // Wrapper. + // + { + wrapper o (1, "abc", 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + t.commit (); + + assert (*o->str == "abc" && + o->com->str == "abc" && o->com->num == 1 && + o->com->vec.size () == 1 && o->com->vec[0] == 1 && + o->vec->size () == 1 && (*o->vec)[0] == 1); + } + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/const-member/test.hxx b/odb-tests/common/const-member/test.hxx new file mode 100644 index 0000000..ab75c55 --- /dev/null +++ b/odb-tests/common/const-member/test.hxx @@ -0,0 +1,109 @@ +// file : common/const-member/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::auto_ptr + +#include + +// Const ids. +// +#pragma db object +struct const_id +{ + const_id (unsigned long i): id (i) {} + const_id (): id (0) {} + + #pragma db id + const unsigned long id; +}; + +#pragma db object +struct const_auto_id +{ + const_auto_id (): id (0) {} + + #pragma db id auto + const unsigned long id; +}; + +// Container. +// +#pragma db value +struct container_value +{ + container_value (unsigned long x) + { + vec.push_back (x); + const_cast&> (cvec).push_back (x); + } + + container_value () {} + + std::vector vec; + const std::vector cvec; +}; + +#pragma db object +struct container +{ + container (unsigned long i, unsigned long x) + : id (i), ccom (x) + { + const_cast&> (cvec).push_back (x); + } + + container () {} + + #pragma db id + unsigned long id; + + const container_value ccom; + const std::vector cvec; +}; + +// Wrapper. +// +#pragma db value +struct wrapped_value +{ + wrapped_value (const std::string& s, unsigned long n) + : str (s), num (n) + { + vec.push_back (n); + } + + wrapped_value () {} + + const std::string str; + unsigned long num; + std::vector vec; +}; + +#pragma db object +struct wrapper +{ + wrapper (unsigned long i, const std::string& s, unsigned long n) + : id (i), + str (new std::string (s)), + com (new wrapped_value (s, n)), + vec (new std::vector) + { + const_cast&> (*vec).push_back (n); + } + + wrapper () {} + + #pragma db id + unsigned long id; + + const std::unique_ptr str; + const std::unique_ptr com; + const std::unique_ptr> vec; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/const-member/testscript b/odb-tests/common/const-member/testscript new file mode 100644 index 0000000..c81d856 --- /dev/null +++ b/odb-tests/common/const-member/testscript @@ -0,0 +1,33 @@ +# file : common/const-member/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/const-object/buildfile b/odb-tests/common/const-object/buildfile new file mode 100644 index 0000000..853c831 --- /dev/null +++ b/odb-tests/common/const-object/buildfile @@ -0,0 +1,41 @@ +# file : common/const-object/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix consto_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/const-object/driver.cxx b/odb-tests/common/const-object/driver.cxx new file mode 100644 index 0000000..7ef48ee --- /dev/null +++ b/odb-tests/common/const-object/driver.cxx @@ -0,0 +1,216 @@ +// file : common/const-object/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database operations with const objects. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + aggr a (1); + aggr ca_ (2); // o1 and o2 are NULL + const aggr& ca (ca_); + + obj1* o1 (new obj1 (1)); + obj1* co1_ (new obj1 (2)); + const obj1* co1 (co1_); + a.o1 = co1; + + unique_ptr o2 (new obj2 (1)); + obj2* co2_ (new obj2 (2)); + a.o2.reset (co2_); + unique_ptr& co2 (a.o2); + + // persist via references + // + { + transaction t (db->begin ()); + db->persist (*o1); + db->persist (*co1); + db->persist (*o2); + db->persist (*co2); + db->persist (a); + db->persist (ca); + t.commit (); + } + + // persist via pointers + // + o1->id += 2; + co1_->id += 2; + o2->id += 2; + co2_->id += 2; + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (co1); + db->persist (o2); + db->persist (co2); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + + unique_ptr a (db->load (1)); + unique_ptr ca (db->load (2)); + + t.commit (); + + assert (a->o1->id == 2); + assert (a->o2->id == 2); + + assert (ca->o1 == 0); + assert (ca->o2.get () == 0); + } + + // update via references + // + { + transaction t (db->begin ()); + db->update (*o1); + db->update (*co1); + db->update (*o2); + db->update (*co2); + db->update (a); + db->update (ca); + t.commit (); + } + + // update via pointers + // + { + transaction t (db->begin ()); + db->update (o1); + db->update (co1); + db->update (o2); + db->update (co2); + t.commit (); + } + + // query + // + typedef odb::query query1; + typedef odb::query query2; + + typedef odb::result result1; + typedef odb::result result2; + + { + transaction t (db->begin ()); + result1 r1 (db->query (query1::id < 3)); + // odb::result ur (r1); // error + size_t n1 (0); + + for (result1::iterator i (r1.begin ()); i != r1.end (); ++i) + { + // i->f (); // error + i->cf (); + // obj1* p (i.load ()); // error + const obj1* p (i.load ()); + obj1 o (0); + i.load (o); + assert (p->id == o.id); + delete p; + n1++; + } + + assert (n1 == 2); + + result2 r2 (db->query (query2::id < 3)); + size_t n2 (0); + + for (result2::iterator i (r2.begin ()); i != r2.end (); ++i) + { + // i->f (); // error + i->cf (); + //unique_ptr p (i.load ()); // error + unique_ptr p (i.load ()); + obj2 o (0); + i.load (o); + assert (p->id == o.id); + n2++; + } + + assert (n2 == 2); + + t.commit (); + } + + // erase via references + // + { + transaction t (db->begin ()); + db->erase (*o1); + db->erase (*co1); + db->erase (*o2); + db->erase (*co2); + db->erase (a); + db->erase (ca); + t.commit (); + } + + // erase via pointers + // + o1->id -= 2; + co1_->id -= 2; + o2->id -= 2; + co2_->id -= 2; + + { + transaction t (db->begin ()); + db->erase (o1); + db->erase (co1); + db->erase (o2); + db->erase (co2); + t.commit (); + } + + // Test session and const/non-const object handling + // + { + session s; + transaction t (db->begin ()); + + obj1 o1 (1); + const obj1& co1 (o1); + db->persist (co1); + + assert (db->load (1) == &o1); + + t.commit (); + } + + delete o1; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/const-object/test.hxx b/odb-tests/common/const-object/test.hxx new file mode 100644 index 0000000..4e66231 --- /dev/null +++ b/odb-tests/common/const-object/test.hxx @@ -0,0 +1,51 @@ +// file : common/const-object/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object pointer (obj1*) session +struct obj1 +{ + obj1 () {} + obj1 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object pointer (std::unique_ptr) +struct obj2 +{ + obj2 () {} + obj2 (int i): id (i) {} + + #pragma db id + int id; + + void f () {} + void cf () const {} +}; + +#pragma db object +struct aggr +{ + aggr (int i): id (i), o1 (0) {} + aggr (): o1 (0) {} + ~aggr () {delete o1;} + + #pragma db id + int id; + + const obj1* o1; + + std::unique_ptr o2; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/const-object/testscript b/odb-tests/common/const-object/testscript new file mode 100644 index 0000000..3885e96 --- /dev/null +++ b/odb-tests/common/const-object/testscript @@ -0,0 +1,33 @@ +# file : common/const-object/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/container/basics/buildfile b/odb-tests/common/container/basics/buildfile new file mode 100644 index 0000000..f83444e --- /dev/null +++ b/odb-tests/common/container/basics/buildfile @@ -0,0 +1,40 @@ +# file : common/container/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_cont_bs_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/container/basics/driver.cxx b/odb-tests/common/container/basics/driver.cxx new file mode 100644 index 0000000..14e1984 --- /dev/null +++ b/odb-tests/common/container/basics/driver.cxx @@ -0,0 +1,523 @@ +// file : common/container/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic container persistence. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + + // array + // + empty.na[0] = 123; + empty.na[1] = 234; + empty.na[2] = 345; + + empty.sa[0] = "aaa"; + empty.sa[1] = "bbbb"; + empty.sa[2] = "ccccc"; + + empty.ca[0] = comp (123, "aaa"); + empty.ca[1] = comp (234, "bbbb"); + empty.ca[2] = comp (345, "ccccc"); + + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + med.uv.push_back (123); + med.uv.push_back (234); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + // deque + // + med.nd.push_back (123); + med.nd.push_back (234); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + med.cs.insert (comp (123, "aaa")); + med.cs.insert (comp (234, "bbbb")); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + + // array + // + med.na[0] = 123; + med.na[1] = 234; + med.na[2] = 345; + + med.sa[0] = "aaa"; + med.sa[1] = "bbbb"; + med.sa[2] = "ccccc"; + + med.ca[0] = comp (123, "aaa"); + med.ca[1] = comp (234, "bbbb"); + med.ca[2] = comp (345, "ccccc"); + + // forward_list + // + med.nfl.push_front (234); + med.nfl.push_front (123); + + med.sfl.push_front ("bbbb"); + med.sfl.push_front ("aaa"); + + med.cfl.push_front (comp (234, "bbbb")); + med.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + med.nus.insert (123); + med.nus.insert (234); + + med.sus.insert ("aaa"); + med.sus.insert ("bbbb"); + + med.cus.insert (comp (123, "aaa")); + med.cus.insert (comp (234, "bbbb")); + + // unordered_map + // + med.nsum[123] = "aaa"; + med.nsum[234] = "bbbb"; + + med.snum["aaa"] = 123; + med.snum["bbbb"] = 234; + + med.ncum[123] = comp (123, "aaa"); + med.ncum[234] = comp (234, "bbbb"); + + med.csum[comp (123, "aaa")] = "aaa"; + med.csum[comp (234, "bbbb")] = "bbbb"; + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + // deque + // + full.nd.push_back (1234); + full.nd.push_back (2345); + full.nd.push_back (3456); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + full.cs.insert (comp (1234, "aaaa")); + full.cs.insert (comp (2345, "bbbbb")); + full.cs.insert (comp (3456, "cccccc")); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbbb"] = 2345; + full.snm["cccccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbbb")] = "bbbbb"; + full.csm[comp (3456, "cccccc")] = "cccccc"; + + // array + // + full.na[0] = 123; + full.na[1] = 234; + full.na[2] = 345; + + full.sa[0] = "aaa"; + full.sa[1] = "bbbb"; + full.sa[2] = "ccccc"; + + full.ca[0] = comp (123, "aaa"); + full.ca[1] = comp (234, "bbbb"); + full.ca[2] = comp (345, "ccccc"); + + // forward_list + // + full.nfl.push_front (345); + full.nfl.push_front (234); + full.nfl.push_front (123); + + full.sfl.push_front ("ccccc"); + full.sfl.push_front ("bbbb"); + full.sfl.push_front ("aaa"); + + full.cfl.push_front (comp (345, "ccccc")); + full.cfl.push_front (comp (234, "bbbb")); + full.cfl.push_front (comp (123, "aaa")); + + // unordered_set + // + full.nus.insert (1234); + full.nus.insert (2345); + full.nus.insert (3456); + + full.sus.insert ("aaaa"); + full.sus.insert ("bbbbb"); + full.sus.insert ("cccccc"); + + full.cus.insert (comp (1234, "aaaa")); + full.cus.insert (comp (2345, "bbbbb")); + full.cus.insert (comp (3456, "cccccc")); + + // unordered_map + // + full.nsum[1234] = "aaaa"; + full.nsum[2345] = "bbbbb"; + full.nsum[3456] = "cccccc"; + + full.snum["aaaa"] = 1234; + full.snum["bbbbb"] = 2345; + full.snum["cccccc"] = 3456; + + full.ncum[1234] = comp (1234, "aaaa"); + full.ncum[2345] = comp (2345, "bbbbb"); + full.ncum[3456] = comp (3456, "cccccc"); + + full.csum[comp (1234, "aaaa")] = "aaaa"; + full.csum[comp (2345, "bbbbb")] = "bbbbb"; + full.csum[comp (3456, "cccccc")] = "cccccc"; + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr e (db->load ("empty")); + unique_ptr m (db->load ("medium")); + unique_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); + empty.sl.push_back ("aa"); + empty.nd.push_back (12); + + empty.ns.insert (12); + empty.ss.insert ("aa"); + empty.cs.insert (comp (12, "aa")); + + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + + empty.nfl.push_front (12); + empty.sfl.push_front ("aa"); + empty.cfl.push_front (comp (12, "aa")); + + empty.nus.insert (12); + empty.sus.insert ("aa"); + empty.cus.insert (comp (12, "aa")); + + empty.nsum[12] = "aa"; + empty.snum["aa"] = 12; + empty.ncum[12] = comp (12, "aa"); + empty.csum[comp (12, "aa")] = "aa"; + + // + // med + // + + med.num = 0; + med.str = ""; + + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + med.uv.clear (); + + med.sl.clear (); + + med.nd.clear (); + + med.ns.clear (); + med.ss.clear (); + med.cs.clear (); + + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + + med.nfl.clear (); + med.sfl.clear (); + med.cfl.clear (); + + med.nus.clear (); + med.sus.clear (); + med.cus.clear (); + + med.nsum.clear (); + med.snum.clear (); + med.ncum.clear (); + med.csum.clear (); + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + full.uv.back ()++; + full.uv.push_back (4567); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + // deque + // + full.nd.push_front (456); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + full.cs.insert (comp (4567, "ddddddd")); + + // map + // + full.nsm[3456] += 'c'; + full.nsm[4567] = "ddddddd"; + + full.snm["cccccc"]++; + full.snm["ddddddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += 'c'; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccccc")] += "c"; + full.csm[comp (4567, "ddddddd")] = "ddddddd"; + + // array + // + full.na[0]++; + full.sa[0] += 'a'; + full.ca[0].num++; + full.ca[0].str += 'a'; + + // forward_list + // + full.nfl.front ()++; + full.nfl.push_front (4567); + + full.sfl.front () += 'a'; + full.sfl.push_front ("ddddddd"); + + full.cfl.front ().num++; + full.cfl.front ().str += 'a'; + full.cfl.push_front (comp (4567, "ddddddd")); + + // unordered_set + // + full.nus.insert (4567); + full.sus.insert ("ddddddd1"); // 1 is to preserve order in VC++ 10. + full.cus.insert (comp (4567, "ddddddd1")); + + // unordered_map + // + full.nsum[3456] += 'c'; + full.nsum[4567] = "ddddddd"; + + full.snum["cccccc"]++; + full.snum["ddddddd1"] = 4567; + + full.ncum[3456].num++; + full.ncum[3456].str += 'c'; + full.ncum[4567] = comp (4567, "ddddddd"); + + full.csum[comp (3456, "cccccc")] += "c"; + full.csum[comp (4567, "ddddddd1")] = "ddddddd"; + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr e (db->load ("empty")); + unique_ptr m (db->load ("medium")); + unique_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/container/basics/test.hxx b/odb-tests/common/container/basics/test.hxx new file mode 100644 index 0000000..e8e329e --- /dev/null +++ b/odb-tests/common/container/basics/test.hxx @@ -0,0 +1,245 @@ +// file : common/container/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const std::string& s) : num (n), str (s) {} + + #pragma db column("number") + int num = 0; + std::string str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator!= (const comp& x, const comp& y) +{ + return !(x == y); +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef std::list str_list; +typedef std::deque num_deque; + +typedef std::vector num_vector; +typedef std::vector str_vector; + +typedef std::set num_set; +typedef std::set str_set; +typedef std::set comp_set; + +typedef std::map num_str_map; +typedef std::map str_num_map; +typedef std::map num_comp_map; +typedef std::map comp_str_map; + +struct comp_hash +{ + std::size_t + operator() (const comp& x) const {return nh (x.num) + sh (x.str);} + + std::hash nh; + std::hash sh; +}; + +typedef std::array num_array; +typedef std::array str_array; +typedef std::array comp_array; + +typedef std::forward_list num_flist; +typedef std::forward_list str_flist; +typedef std::forward_list comp_flist; + +typedef std::unordered_set num_uset; +typedef std::unordered_set str_uset; +typedef std::unordered_set comp_uset; + +typedef std::unordered_map num_str_umap; +typedef std::unordered_map str_num_umap; +typedef std::unordered_map num_comp_umap; +typedef std::unordered_map comp_str_umap; + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflic" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + std::string str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const std::string& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + std::string id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + std::vector cv; + + #pragma db unordered + num_vector uv; + + // list + // + #pragma db transient + str_list& sl; + + // deque + // + num_deque nd; + + // set + // + num_set ns; + str_set ss; + comp_set cs; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + + // array + // + num_array na; + str_array sa; + comp_array ca; + + // forward_list + // + num_flist nfl; + str_flist sfl; + comp_flist cfl; + + // unordered_set + // + num_uset nus; + str_uset sus; + comp_uset cus; + + // unordered_map + // + num_str_umap nsum; + str_num_umap snum; + num_comp_umap ncum; + comp_str_umap csum; + + std::string str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + xs == ys && + + x.sl == y.sl && + + x.nd == y.nd && + + x.ns == y.ns && + x.ss == y.ss && + x.cs == y.cs && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + + x.na == y.na && + x.sa == y.sa && + x.ca == y.ca && + + x.nfl == y.nfl && + x.sfl == y.sfl && + x.cfl == y.cfl && + + x.nus == y.nus && + x.sus == y.sus && + x.cus == y.cus && + + x.nsum == y.nsum && + x.snum == y.snum && + x.ncum == y.ncum && + x.csum == y.csum && + + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/container/basics/testscript b/odb-tests/common/container/basics/testscript new file mode 100644 index 0000000..ea99498 --- /dev/null +++ b/odb-tests/common/container/basics/testscript @@ -0,0 +1,33 @@ +# file : common/container/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/container/change-tracking/buildfile b/odb-tests/common/container/change-tracking/buildfile new file mode 100644 index 0000000..1dda818 --- /dev/null +++ b/odb-tests/common/container/change-tracking/buildfile @@ -0,0 +1,40 @@ +# file : common/container/change-tracking/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_cont_changet_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/container/change-tracking/driver.cxx b/odb-tests/common/container/change-tracking/driver.cxx new file mode 100644 index 0000000..4894ed9 --- /dev/null +++ b/odb-tests/common/container/change-tracking/driver.cxx @@ -0,0 +1,729 @@ +// file : common/container/change-tracking/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test change-tracking containers. +// + +#include // std::unique_ptr +#include // std::move +#include + +#include +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct counting_tracer: odb::tracer +{ + void + reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} + + virtual void + execute (odb::connection&, const char* stmt) + { + string p (stmt, 6); + if (p == "UPDATE") + u++; + else if (p == "INSERT") + i++; + else if (p == "DELETE") + d++; + else if (p == "SELECT") + s++; + t++; + } + + size_t u, i, d, s, t; +}; + +static counting_tracer tr; + +// Compilation test: instantiate all the functions. In C++11 mode only +// do this if we have a fairly conforming compiler that implements the +// complete std::vector interface. +// + +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC +#if defined (__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7 +struct item {}; +template class odb::vector; +template class odb::vector_iterator, + std::vector::iterator>; +template class odb::vector_iterator, + std::vector::reverse_iterator>; +#endif +#endif + +void +f (const std::vector&) {} + +int +main (int argc, char* argv[]) +{ + try + { + // Test extended interface. + // + { + typedef odb::vector vector; + + vector ov; + std::vector sv; + f (ov); // Implicit conversion to std::vector. + vector ov1 (sv); // Initialization from std::vector. + ov = sv; // Assignement from std::vector. + + // Container comparison. + // + if (ov != ov1 || + ov != sv || + sv != ov1) + ov.clear (); + + // Iterator comparison/conversion. + // + vector::const_iterator i (ov.begin ()); + if (i != ov.end ()) + i = ov.end (); + + // Things are just really borken in Sun CC, no matter which STL + // you use. + // +#ifndef __SUNPRO_CC + vector::const_reverse_iterator j (ov.rbegin ()); + if (j != ov.rend ()) + j = ov.rend (); +#endif + } + + unique_ptr db (create_database (argc, argv)); + + // Test traits logic. + // + { + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + assert (!o.s._tracking ()); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // load + // + { + transaction t (db->begin ()); + unique_ptr p (db->load ("1")); + assert (p->s._tracking ()); + t.commit (); + } + + // update + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // erase + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + assert (!o.s._tracking ()); + } + + // Test change tracking. + // + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // push_back/pop_back + // + { + o.s.push_back ("b"); // insert + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.push_back ("c"); // update + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + for (int i (0); i != 1024; ++i) + o.s.push_back ("x"); // realloc + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.i == 1023 && tr.t == 1025); + assert (*db->load ("1") == o); + t.commit (); + } + + { + for (int i (0); i != 1024; ++i) + o.s.pop_back (); // delete + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("b"); + o.s.pop_back (); // no-op + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + assert (*db->load ("1") == o); + t.commit (); + } + + // insert + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin (), "a1"); // insert front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin () + 1, "a2"); // insert middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.end (), "b1"); // insert back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // erase + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin ()); // erase front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.d == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin () + 1); // erase middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.d == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.end () - 1); // erase back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // modify + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify (1) += 'b'; + o.s.modify_at (2) += 'c'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify_front () += 'a'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.begin ().modify () += 'a'; +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC + o.s.rbegin ().modify () += 'c'; +#endif + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC + assert (tr.u == 3 && tr.t == 3); +#else + assert (tr.u == 2 && tr.t == 2); +#endif + assert (*db->load ("1") == o); + t.commit (); + } + +#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC + { + (o.s.rbegin () + 1).modify (1) += 'a'; + (o.s.rbegin () + 1).modify (-1) += 'c'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } +#endif + + { + o.s.mbegin (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 5 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // clear + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.clear (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // assign + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.assign (4, "x"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.i == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // resize + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.resize (4, "x"); // expand + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.i == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("y"); + o.s.resize (3); // shrink + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // Transaction rollback. + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed copy. + // + { + unique_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + c.reset (new object (o)); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed swap. + // + { + object c (o); + + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking () && !c.s._tracking ()); + c.s.swap (o.s); + assert (!o.s._tracking () && c.s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed move. + // + { + unique_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking ()); + c.reset (new object (std::move (o))); + assert (!o.s._tracking () && c->s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Test mixing "smart" and "dumb" container (specifically, erase(obj)). + // + { + mix_object o (1); + o.ov.assign (3, 123); + o.sv.assign (3, 123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test using change tracking container as inverse member. + // + { + inv_object1 o1; + inv_object2 o2; + o1.o2 = &o2; + + { + transaction t (db->begin ()); + db->persist (o2); + db->persist (o1); + t.commit (); + } + + assert (!o2.o1._tracking ()); + + { + session s; + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id_)); + unique_ptr p2 (db->load (o2.id_)); + assert (p2->o1[0] == p1.get ()); + assert (!p2->o1._tracking ()); + t.commit (); + } + } + + // Test read-only values. + { + ro_object o (1); + o.v.push_back (ro_value (1, 1)); + o.v.push_back (ro_value (2, 2)); + o.v.push_back (ro_value (3, 3)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.v.erase (o.v.begin ()); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->load (1)->v == o.v); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/container/change-tracking/test.hxx b/odb-tests/common/container/change-tracking/test.hxx new file mode 100644 index 0000000..8e06f4a --- /dev/null +++ b/odb-tests/common/container/change-tracking/test.hxx @@ -0,0 +1,106 @@ +// file : common/container/change-tracking/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // std::move + +#include +#include + +#pragma db object pointer(std::unique_ptr) +struct object +{ + object () {} + object (const std::string& id): id_ (id) {} + + object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} + object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} + + #pragma db id + std::string id_; + + unsigned int i; + + odb::vector s; + + inline bool + operator== (const object& o) const {return id_ == o.id_ && i == o.i && s == o.s;} +}; + +// Test mixing "smart" and "dumb" container (specifically, erase(obj)). +// +#pragma db object +struct mix_object +{ + mix_object () {} + mix_object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector ov; + std::vector sv; +}; + +// Test using change tracking container as inverse member. +// +struct inv_object2; + +#pragma db object session +struct inv_object1 +{ + #pragma db id auto + unsigned long id_; + + inv_object2* o2; +}; + +#pragma db object session +struct inv_object2 +{ + #pragma db id auto + unsigned long id_; + + #pragma db inverse(o2) + odb::vector o1; +}; + +// Test read-only values (we still need to include them in the UPDATE +// statement). +// +#pragma db value +struct ro_value +{ + ro_value (int i_ = 0, int j_ = 0): i (i_), j (j_) {} + + #pragma db readonly + int i; + + #pragma db readonly + int j; +}; + +inline bool +operator== (const ro_value& x, const ro_value& y) +{ + return x.i == y.i && x.j == y.j; +} + +#pragma db object +struct ro_object +{ + ro_object () {} + ro_object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector v; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/container/change-tracking/testscript b/odb-tests/common/container/change-tracking/testscript new file mode 100644 index 0000000..2169869 --- /dev/null +++ b/odb-tests/common/container/change-tracking/testscript @@ -0,0 +1,33 @@ +# file : common/container/change-tracking/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/ctor/buildfile b/odb-tests/common/ctor/buildfile new file mode 100644 index 0000000..a9892bc --- /dev/null +++ b/odb-tests/common/ctor/buildfile @@ -0,0 +1,41 @@ +# file : common/ctor/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix ctor_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/ctor/driver.cxx b/odb-tests/common/ctor/driver.cxx new file mode 100644 index 0000000..c9b445d --- /dev/null +++ b/odb-tests/common/ctor/driver.cxx @@ -0,0 +1,79 @@ +// file : common/ctor/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test support for persistent objects without default constructors. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + typedef odb::result result; + + unique_ptr db (create_database (argc, argv)); + + person p1 ("John", "Doe", 30); + person p2 ("Jane", "Doe", 29); + person p3 ("Joe", "Dirt", 31); + + { + transaction t (db->begin ()); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + + t.commit (); + } + + { + person p ("", "", 0); + + transaction t (db->begin ()); + + db->load (p1.id_, p); + + assert (p.first_ == p1.first_); + assert (p.last_ == p1.last_); + assert (p.age_ == p1.age_); + + result r (db->query (query::age < 30)); + + assert (!r.empty ()); + + result::iterator i (r.begin ()); + i.load (p); + assert (p.first_ == "Jane"); + assert (p.last_ == "Doe"); + assert (p.age_ == 29); + + assert (size (r) == 1); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/ctor/test.hxx b/odb-tests/common/ctor/test.hxx new file mode 100644 index 0000000..2a2becd --- /dev/null +++ b/odb-tests/common/ctor/test.hxx @@ -0,0 +1,29 @@ +// file : common/ctor/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct person +{ + person (const std::string& first, + const std::string& last, + unsigned short age) + : first_ (first), last_ (last), age_ (age) + { + } + + #pragma db id auto + unsigned long id_; + + std::string first_; + std::string last_; + unsigned short age_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/ctor/testscript b/odb-tests/common/ctor/testscript new file mode 100644 index 0000000..8946ddb --- /dev/null +++ b/odb-tests/common/ctor/testscript @@ -0,0 +1,33 @@ +# file : common/ctor/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/default/buildfile b/odb-tests/common/default/buildfile new file mode 100644 index 0000000..e25bd08 --- /dev/null +++ b/odb-tests/common/default/buildfile @@ -0,0 +1,41 @@ +# file : common/default/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix default_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/default/driver.cxx b/odb-tests/common/default/driver.cxx new file mode 100644 index 0000000..2d3ef01 --- /dev/null +++ b/odb-tests/common/default/driver.cxx @@ -0,0 +1,81 @@ +// file : common/default/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test default values. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Insert an object using an ad-hoc SQL statement. This way + // we get all the default values. + // + { + transaction t (db->begin ()); + + if (db->id () != odb::id_oracle) + db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); + else + db->execute ("INSERT INTO \"default_object\" (\"obj_id\") VALUES (1)"); + + t.commit (); + } + + // Now load the object and check all the values. + // + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + t.commit (); + + assert (o->b); + assert (o->pi == 1234); + assert (o->ni == -1234); + assert (o->zi == 0); + assert (o->pf == 1.234); + assert (o->nf == -1.234); + assert (o->zf == 0.0); + assert (o->sf == 1.123e+10); + assert (o->str == "Someone's string"); + assert (o->e == green); + } + + // Check the NULL default value using a query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::null.is_null ())); + assert (!r.empty ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/default/test.hxx b/odb-tests/common/default/test.hxx new file mode 100644 index 0000000..7f35ed4 --- /dev/null +++ b/odb-tests/common/default/test.hxx @@ -0,0 +1,67 @@ +// file : common/default/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +enum color {red, green, blue}; + +#pragma db value(unsigned long) default(0) + +#pragma db object +struct object +{ + #pragma db id + unsigned long obj_id; + + // NULL. + // + #pragma db null default(null) + unsigned long null; + + // Boolean. + // + #pragma db default(true) + bool b; + + // Integers. + // + #pragma db default(1234) + unsigned long pi; + + #pragma db default(-1234) + long ni; + + // 0 default taken from the type. + unsigned long zi; + + // Floats. + // + #pragma db default(1.234) + double pf; + + #pragma db default(-1.234) + double nf; + + #pragma db default(0.0) + double zf; + + #pragma db default(1.123e+10) + double sf; + + // Strings. MySQL doesn't support default values on TEXT + // columns, so make the type VARCHAR. + // + #pragma db type("VARCHAR(64)") default("Someone's string") + std::string str; + + // Enums. + // + #pragma db default(green) + color e; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/default/testscript b/odb-tests/common/default/testscript new file mode 100644 index 0000000..f29cef4 --- /dev/null +++ b/odb-tests/common/default/testscript @@ -0,0 +1,33 @@ +# file : common/default/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/definition/.gitignore b/odb-tests/common/definition/.gitignore new file mode 100644 index 0000000..5838670 --- /dev/null +++ b/odb-tests/common/definition/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +time-mapping-odb.?xx +time-mapping-odb-*.?xx +time-mapping.sql +time-mapping-*.sql diff --git a/odb-tests/common/definition/buildfile b/odb-tests/common/definition/buildfile new file mode 100644 index 0000000..09ad1db --- /dev/null +++ b/odb-tests/common/definition/buildfile @@ -0,0 +1,52 @@ +# file : common/definition/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test time-mapping + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix definition_ \ + --generate-schema + +<{hxx ixx cxx}{time-mapping-odb}>: odb_options = + +for db: $databases + {hxx ixx cxx}{time-mapping-odb-$db}: odb_options = + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/definition/driver.cxx b/odb-tests/common/definition/driver.cxx new file mode 100644 index 0000000..223eeaf --- /dev/null +++ b/odb-tests/common/definition/driver.cxx @@ -0,0 +1,56 @@ +// file : common/definition/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test overriding composite value definition point. This is primarily +// useful to make composite values out of third-party types. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + object o; + o.time.tv_sec = 1; + o.time.tv_usec = 1000; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (p->time.tv_sec == o.time.tv_sec && + p->time.tv_usec == o.time.tv_usec); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/definition/test.hxx b/odb-tests/common/definition/test.hxx new file mode 100644 index 0000000..38fc02a --- /dev/null +++ b/odb-tests/common/definition/test.hxx @@ -0,0 +1,26 @@ +// file : common/definition/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#ifdef _WIN32 +# include // timeval +#else +# include // timeval +#endif + +#include + +#include "time-mapping.hxx" + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; + + timeval time; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/definition/testscript b/odb-tests/common/definition/testscript new file mode 100644 index 0000000..c9dea6d --- /dev/null +++ b/odb-tests/common/definition/testscript @@ -0,0 +1,33 @@ +# file : common/definition/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/definition/time-mapping.hxx b/odb-tests/common/definition/time-mapping.hxx new file mode 100644 index 0000000..469cfb7 --- /dev/null +++ b/odb-tests/common/definition/time-mapping.hxx @@ -0,0 +1,17 @@ +// file : common/definition/time-mapping.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TIME_MAPPING_HXX +#define TIME_MAPPING_HXX + +#ifdef _WIN32 +# include // timeval +#else +# include // timeval +#endif + +#pragma db value(timeval) definition +#pragma db member(timeval::tv_sec) column("sec") +#pragma db member(timeval::tv_usec) column("usec") + +#endif // TIME_MAPPING_HXX diff --git a/odb-tests/common/enum/buildfile b/odb-tests/common/enum/buildfile new file mode 100644 index 0000000..eb3a29a --- /dev/null +++ b/odb-tests/common/enum/buildfile @@ -0,0 +1,41 @@ +# file : common/enum/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix enum_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/enum/driver.cxx b/odb-tests/common/enum/driver.cxx new file mode 100644 index 0000000..ed3eb59 --- /dev/null +++ b/odb-tests/common/enum/driver.cxx @@ -0,0 +1,84 @@ +// file : common/enum/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test automatic C++ enum mapping. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + typedef odb::result result; + + unique_ptr db (create_database (argc, argv)); + + object o; + o.color_ = green; + o.taste_ = object::sweet; + o.position_ = object::left; + + o.gender_ = object::gender::female; + o.scale_ = object::scale::ten; + o.yesno_ = object::yesno::yes; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (o.id_)); + t.commit (); + + assert (o == *o1); + } + + { + transaction t (db->begin ()); + + result r1 (db->query (query::color == blue)); + result r2 (db->query (query::taste == object::sweet)); + result r3 (db->query (query::position == object::left)); + + assert (r1.empty ()); + assert (!r2.empty ()); + assert (!r3.empty ()); + + result r4 (db->query (query::gender == object::gender::female)); + result r5 (db->query (query::scale == object::scale::ten)); + result r6 (db->query (query::yesno == object::yesno::yes)); + + assert (!r4.empty ()); + assert (!r5.empty ()); + assert (!r6.empty ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/enum/test.hxx b/odb-tests/common/enum/test.hxx new file mode 100644 index 0000000..a279112 --- /dev/null +++ b/odb-tests/common/enum/test.hxx @@ -0,0 +1,47 @@ +// file : common/enum/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +enum color {red, green, blue}; + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + color color_; + enum taste {bitter, sweet, sour}; + taste taste_; + + enum position {left = -1, center = 0, right = 1}; + position position_; + + + enum class gender {male, female}; + enum class scale: unsigned char {one = 1, ten = 10, hundred = 100}; + enum class yesno: bool {no, yes}; + + gender gender_; + scale scale_; + yesno yesno_; +}; + +inline bool +operator == (const object& x, const object& y) +{ + return + x.id_ == y.id_ + && x.color_ == y.color_ + && x.taste_ == y.taste_ + && x.position_ == y.position_ + && x.gender_ == y.gender_ + && x.scale_ == y.scale_ + && x.yesno_ == y.yesno_; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/enum/testscript b/odb-tests/common/enum/testscript new file mode 100644 index 0000000..d2ca28c --- /dev/null +++ b/odb-tests/common/enum/testscript @@ -0,0 +1,33 @@ +# file : common/enum/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/erase-query/buildfile b/odb-tests/common/erase-query/buildfile new file mode 100644 index 0000000..d833b6e --- /dev/null +++ b/odb-tests/common/erase-query/buildfile @@ -0,0 +1,41 @@ +# file : common/erase-query/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix erase_query_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/erase-query/driver.cxx b/odb-tests/common/erase-query/driver.cxx new file mode 100644 index 0000000..6c11957 --- /dev/null +++ b/odb-tests/common/erase-query/driver.cxx @@ -0,0 +1,181 @@ +// file : common/erase-query/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query-based erase. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +void +persist (database& db) +{ + object o1 (1); + object o2 (2); + object o3 (3); + object o4 (4); + + transaction t (db.begin ()); + db.persist (o1); + db.persist (o2); + db.persist (o3); + db.persist (o4); + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + typedef odb::query query; + + unique_ptr db (create_database (argc, argv)); + + // erase_query() + // + persist (*db); + + { + transaction t (db->begin ()); + assert (db->erase_query () == 4); + t.commit (); + } + + // erase_query(const char*) + // + persist (*db); + + { + transaction t (db->begin ()); + + if (db->id () != odb::id_oracle) + assert (db->erase_query ( + "erase_query_object.id < 3") == 2); + else + assert (db->erase_query ( + "\"erase_query_object\".\"id\" < 3") == 2); + + db->erase_query (); + t.commit (); + } + + // erase_query(query) + // + persist (*db); + + { + transaction t (db->begin ()); + assert (db->erase_query (query::id == 2 || query::id == 4) == 2); + db->erase_query (); + t.commit (); + } + + // Test predicates involving object pointers (DELETE JOIN). + // + /* + { + object o11 (1); + object o12 (2); + object o13 (3); + object2 o2; + + o11.o2 = &o2; + o2.num = 123; + + o12.o1 = &o13; + o13.num = 123; + + transaction t (db->begin ()); + db->persist (o2); + db->persist (o13); + db->persist (o12); + db->persist (o11); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query (query::o1::num == 123) == 1); + assert (db->erase_query (query::o2::num == 123) == 1); + db->erase_query (); + t.commit (); + } + */ + + // For now we can only do column-based tests, like is_null(). + // + { + object o11 (1); + object o12 (2); + object o13 (3); + object2 o2; + + o12.o2 = &o2; + + transaction t (db->begin ()); + db->persist (o2); + db->persist (o13); + db->persist (o12); + db->persist (o11); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query (query::o2.is_null ()) == 2); + db->erase_query (); + t.commit (); + } + + // Make sure container data is deleted. + // + { + object o (1); + o.v.push_back (1); + o.v.push_back (2); + o.v.push_back (3); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query () == 1); + t.commit (); + } + + { + transaction t (db->begin ()); + + if (db->id () != odb::id_oracle) + assert (db->execute ("SELECT * FROM erase_query_object_v " + "WHERE object_id = 1") == 0); + else + assert (db->execute ("SELECT * FROM \"erase_query_object_v\" " + "WHERE \"object_id\" = 1") == 0); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/erase-query/test.hxx b/odb-tests/common/erase-query/test.hxx new file mode 100644 index 0000000..9e73f12 --- /dev/null +++ b/odb-tests/common/erase-query/test.hxx @@ -0,0 +1,46 @@ +// file : common/erase-query/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +struct object2; + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id), o1 (0), o2 (0) + { + } + + object () + : o1 (0), o2 (0) + { + } + + #pragma db id + unsigned long id_; + + std::vector v; + + int num; + + object* o1; + object2* o2; +}; + +#pragma db object +struct object2 +{ + #pragma db id auto + unsigned long id_; + + int num; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/erase-query/testscript b/odb-tests/common/erase-query/testscript new file mode 100644 index 0000000..90862ab --- /dev/null +++ b/odb-tests/common/erase-query/testscript @@ -0,0 +1,33 @@ +# file : common/erase-query/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/id/auto/buildfile b/odb-tests/common/id/auto/buildfile new file mode 100644 index 0000000..c340200 --- /dev/null +++ b/odb-tests/common/id/auto/buildfile @@ -0,0 +1,40 @@ +# file : common/id/auto/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_auto_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/id/auto/driver.cxx b/odb-tests/common/id/auto/driver.cxx new file mode 100644 index 0000000..d294e69 --- /dev/null +++ b/odb-tests/common/id/auto/driver.cxx @@ -0,0 +1,96 @@ +// file : common/id/auto/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test automatic id assignment. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // object + // + { + unsigned long id1, id2, id3; + { + object o1 ("one"); + object o2 ("two"); + object o3 ("three"); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = o1.id_; + id2 = o2.id_; + id3 = o3.id_; + + assert (id1 != id2); + assert (id1 != id3); + assert (id2 != id3); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + unique_ptr o3 (db->load (id3)); + t.commit (); + + assert (o1->id_ == id1 && o1->str_ == "one"); + assert (o2->id_ == id2 && o2->str_ == "two"); + assert (o3->id_ == id3 && o3->str_ == "three"); + } + } + + // auto_only + // + { + unsigned short id; + { + auto_only o; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + id = o.id_; + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (id)); + t.commit (); + + assert (o->id_ == id); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/id/auto/test.hxx b/odb-tests/common/id/auto/test.hxx new file mode 100644 index 0000000..233c79f --- /dev/null +++ b/odb-tests/common/id/auto/test.hxx @@ -0,0 +1,40 @@ +// file : common/id/auto/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object (const std::string& str) + : id_ (1), str_ (str) + { + } + + #pragma db auto id + unsigned long id_; + std::string str_; + +private: + object () + { + } + + friend class odb::access; +}; + +// Test the case where the object has just the auto id. +// +#pragma db object +struct auto_only +{ + #pragma db auto id pgsql:type("BIGINT") + unsigned short id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/id/auto/testscript b/odb-tests/common/id/auto/testscript new file mode 100644 index 0000000..bb2a3a4 --- /dev/null +++ b/odb-tests/common/id/auto/testscript @@ -0,0 +1,33 @@ +# file : common/id/auto/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/id/composite/buildfile b/odb-tests/common/id/composite/buildfile new file mode 100644 index 0000000..4bc9f9a --- /dev/null +++ b/odb-tests/common/id/composite/buildfile @@ -0,0 +1,42 @@ +# file : common/id/composite/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_comp_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/id/composite/driver.cxx b/odb-tests/common/id/composite/driver.cxx new file mode 100644 index 0000000..3d66101 --- /dev/null +++ b/odb-tests/common/id/composite/driver.cxx @@ -0,0 +1,731 @@ +// file : common/id/composite/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test composite object ids. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test 1. + // + { + using namespace test1; + + object o1 (scomp ("aaa", "bbb", "ccc"), 123); + o1.vec.push_back (scomp ("xxx", "xxx", "xxx")); + o1.vec.push_back (scomp ("yyy", "yyy", "yyy")); + + object o2 (scomp ("aaa", "bbb", "ccd"), 234); + o2.vec.push_back (scomp ("zzz", "", "zzz")); + + object o3 (scomp ("baa", "bbb", "ccc"), 345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p3 == o3); + } + + // Update. + // + { + transaction t (db->begin ()); + unique_ptr p (db->load (o1.id)); + p->num++; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o1.id)); + t.commit (); + + assert (p->num == o1.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (o1.id); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->find (o1.id)); + assert (p.get () == 0); + t.commit (); + } + } + + // Test 2. + // + { + using namespace test2; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + + object3 o3 (ncomp (3, 0, 1)); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "aaa"))); + o3.o1.push_back (new object1 (scomp ("o1", "o3", "bbb"))); + + object4 o4 (ncomp (4, 0, 1)); + o4.c.o2 = new object2 (ncomp (2, 4, 1)); + o4.c.o2->o1 = new object1 (scomp ("o1", "o2", "ccc")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + db->persist (o3.o1[0]); + db->persist (o3.o1[1]); + db->persist (o3); + db->persist (o4.c.o2->o1); + db->persist (o4.c.o2); + db->persist (o4); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); + unique_ptr p4 (db->load (o4.id)); + t.commit (); + + assert (p2->o1->id == o2.o1->id); + assert (p3->o1.size () == o3.o1.size ()); + assert (p3->o1[0]->id == o3.o1[0]->id); + assert (p3->o1[1]->id == o3.o1[1]->id); + assert (p4->c.o2->id == o4.c.o2->id); + assert (p4->c.o2->o1->id == o4.c.o2->o1->id); + } + + // Update. + // + { + scomp id2, id3; + + { + transaction t (db->begin ()); + + unique_ptr p2 (db->load (o2.id)); + delete p2->o1; + p2->o1 = new object1 (scomp ("o1", "o2", "bbb")); + id2 = db->persist (p2->o1); + db->update (*p2); + + unique_ptr p3 (db->load (o3.id)); + delete p3->o1.back (); + p3->o1.pop_back (); + p3->o1.push_back (new object1 (scomp ("o1", "o3", "ccc"))); + id3 = db->persist (p3->o1.back ()); + db->update (*p3); + + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + unique_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2->o1->id == id2); + assert (p3->o1.back ()->id == id3); + } + } + + // Query. + // + { + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::o1->id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + { + // As id (dual interface). + // + result r (db->query (query::o1.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.id); + assert (++i == r.end ()); + } + + t.commit (); + } + + // Second level composite object pointer. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::c.o2->o1.str3 == "ccc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o4.id); + assert (++i == r.end ()); + + t.commit (); + } + } + + // View. + // + { + transaction t (db->begin ()); + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object2::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query ((query::object3::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + { + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::object4::id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num4 == 1 && i->num2 == 1 && i->str == "ccc"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // Test 3. + // + { + using namespace test3; + + object2 o2 (ncomp (2, 0, 1)); + o2.o1 = new object1 (scomp ("o1", "o2", "aaa")); + o2.o1->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1->id); + + i->o2->o1 = 0; + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str2 == "o2")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 4. + // + { + using namespace test4; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + assert (p2->o1[0]->o2->id == o2.id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + session s; + + result r (db->query (query::o2->id.num2 == 0)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id == o2.o1[0]->id); + i->o2->o1.clear (); + + assert (++i != r.end ()); + assert (i->id == o2.o1[1]->id); + + i->o2->o1.clear (); + delete i->o2; + + assert (++i == r.end ()); + } + + t.commit (); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object1::id.str3 == "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 5. + // + { + using namespace test5; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2 = &o2; + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2 = &o2; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 6. + // + { + using namespace test6; + + object2 o2 (ncomp (2, 0, 1)); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "aaa"))); + o2.o1.back ()->o2.push_back (&o2); + + o2.o1.push_back (new object1 (scomp ("o1", "o2", "bbb"))); + o2.o1.back ()->o2.push_back (&o2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2.o1[0]); + db->persist (o2.o1[1]); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p2->o1.size () == 2); + + assert (p2->o1[0]->id == o2.o1[0]->id); + assert (p2->o1[0]->o2[0]->id == o2.id); + + assert (p2->o1[1]->id == o2.o1[1]->id); + assert (p2->o1[1]->o2[0]->id == o2.id); + } + + // View. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ((query::object2::id.num2 == 0) + + "ORDER BY" + query::object1::id.str3)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + assert (++i != r.end ()); + assert (i->num == 1 && i->str == "bbb"); + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test 7. + // + { + using namespace test7; + + object o (scomp ("aaa", "bbb", "ccc"), 123); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (*p == o); + } + + // Update. + // + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + p->num++; + db->update (*p); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (p->num == o.num + 1); + } + + // Erase. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + assert (false); + } + catch (const object_changed&) + { + } + + t.commit (); + } + } + + // Test 8. + // + { + using namespace test8; + + object2 o2a, o2b; + object3 o3; + + o2b.o1 = new object1 (scomp ("222", "aaa", "bbb"), 123); + o3.o1.push_back (0); + o3.o1.push_back (new object1 (scomp ("333", "aaa", "bbb"), 234)); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o2a); + db->persist (o2b); + db->persist (o2b.o1); + db->persist (o3); + db->persist (o3.o1[1]); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p2a (db->load (o2a.id)); + unique_ptr p2b (db->load (o2b.id)); + unique_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 == 0); + assert (p2b->o1 != 0 && *p2b->o1 == *o2b.o1); + assert (p3->o1[0] == 0); + assert (p3->o1[1] != 0 && *p3->o1[1] == *o3.o1[1]); + } + + // Update. + // + { + object1* o1 (o3.o1[1]); + + o3.o1.clear (); + o3.o1.push_back (o2b.o1); + o3.o1.push_back (0); + + o2a.o1 = o1; + o2b.o1 = 0; + + transaction t (db->begin ()); + db->update (o2a); + db->update (o2b); + db->update (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p2a (db->load (o2a.id)); + unique_ptr p2b (db->load (o2b.id)); + unique_ptr p3 (db->load (o3.id)); + t.commit (); + + assert (p2a->o1 != 0 && *p2a->o1 == *o2a.o1); + assert (p2b->o1 == 0); + assert (p3->o1[0] != 0 && *p3->o1[0] == *o3.o1[0]); + assert (p3->o1[1] == 0); + } + } + + // Test 9. + { + using namespace test9; + + object o (123, "abc"); + o.v.push_back (123); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end () && o == *i && ++i == r.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/id/composite/test.hxx b/odb-tests/common/id/composite/test.hxx new file mode 100644 index 0000000..70856a6 --- /dev/null +++ b/odb-tests/common/id/composite/test.hxx @@ -0,0 +1,519 @@ +// file : common/id/composite/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db value +struct scomp +{ + scomp () {} + scomp (const std::string& s1, const std::string& s2, const std::string& s3) + : str1 (s1), str2 (s2), str3 (s3) + { + } + + std::string str1; + std::string str2; + std::string str3; +}; + +inline bool +operator== (const scomp& x, const scomp& y) +{ + return x.str1 == y.str1 && x.str2 == y.str2 && x.str3 == y.str3; +} + +inline bool +operator< (const scomp& x, const scomp& y) +{ + return x.str1 < y.str1 || + (x.str1 == y.str1 && x.str2 < y.str2) || + (x.str1 == y.str1 && x.str2 == y.str2 && x.str3 < y.str3); +} + +#pragma db value +struct ncomp +{ + ncomp () {} + ncomp (unsigned short n1, unsigned short n2, unsigned short n3) + : num1 (n1), num2 (n2), num3 (n3) + { + } + + unsigned short num1; + unsigned short num2; + unsigned short num3; +}; + +inline bool +operator== (const ncomp& x, const ncomp& y) +{ + return x.num1 == y.num1 && x.num2 == y.num2 && x.num3 == y.num3; +} + +inline bool +operator< (const ncomp& x, const ncomp& y) +{ + return x.num1 < y.num1 || + (x.num1 == y.num1 && x.num2 < y.num2) || + (x.num1 == y.num1 && x.num2 == y.num2 && x.num3 < y.num3); +} + +// Test object with composite id, container. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object () {} + object (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + std::vector vec; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.num == y.num && x.vec == y.vec; + } +} + +// Test to-one and to-many relationships with composite id as well as +// queries and views. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + }; + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (const ncomp& i): id (i) {} + + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + // Test second-level query pointer test as well as pointers in + // composite types. + // + #pragma db value + struct comp + { + comp (): o2 (0) {} + ~comp () {delete o2;} + + object2* o2; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (const ncomp& i): id (i) {} + + #pragma db id + ncomp id; + + comp c; + }; + + #pragma db view object(object2) object(object1) + struct view2 + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object3) object(object1) + struct view3 + { + #pragma db column (object3::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; + + #pragma db view object(object4) object(object2) object(object1) + struct view4 + { + #pragma db column (object4::id.num3) + unsigned short num4; + + #pragma db column (object2::id.num3) + unsigned short num2; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-one(i) relationship with composite id. +// +#pragma db namespace table("t3_") +namespace test3 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + object2 (const ncomp& i): id (i), o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id + ncomp id; + + object1* o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-one(i) relationship with composite id. +// +#pragma db namespace table("t4_") +namespace test4 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + #pragma db inverse(o1) + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test one-to-many(i) relationship with composite id. +// +#pragma db namespace table("t5_") +namespace test5 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + object2* o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test many-to-many(i) relationship with composite id. +// +#pragma db namespace table("t6_") +namespace test6 +{ + struct object2; + + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i): id (i) {} + + #pragma db id + scomp id; + + std::vector o2; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const ncomp& i): id (i) {} + + ~object2 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id + ncomp id; + + #pragma db inverse(o2) + std::vector o1; + }; + + #pragma db view object(object2) object(object1) + struct view + { + #pragma db column (object2::id.num3) + unsigned short num; + + #pragma db column (object1::id.str3) + std::string str; + }; +} + +// Test object with composite id and version (optimistic concurrency). +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object optimistic + struct object + { + object () {} + object (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + #pragma db version + unsigned long ver; + + unsigned long num; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.id == y.id && x.ver == y.ver && x.num == y.num; + } +} + +// Test composite NULL pointers. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object + struct object1 + { + object1 () {} + object1 (const scomp& i, unsigned long n): id (i), num (n) {} + + #pragma db id + scomp id; + + unsigned long num; + }; + + inline bool + operator== (const object1& x, const object1& y) + { + return x.id == y.id && x.num == y.num; + } + + #pragma db object + struct object2 + { + object2 (): o1 (0) {} + ~object2 () {delete o1;} + + #pragma db id auto + unsigned long id; + + object1* o1; + }; + + #pragma db object + struct object3 + { + ~object3 () + { + for (std::vector::iterator i (o1.begin ()); + i != o1.end (); ++i) + delete *i; + } + + #pragma db id auto + unsigned long id; + + std::vector o1; + }; +} + +// Test composite id definition inside object. +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object + struct object + { + object (unsigned long n = 0, const std::string& s = "") + { + id_.num = n; + id_.str = s; + } + + unsigned long num () const {return id_.num;} + const std::string& str () const {return id_.str;} + + std::vector v; + + private: + friend class odb::access; + + #pragma db value + struct comp + { + unsigned long num; + std::string str; + + bool + operator< (const comp& x) const + { + return num < x.num || (num == x.num && str < x.str); + } + }; + + #pragma db id + comp id_; + }; + + inline bool + operator== (const object& x, const object& y) + { + return x.num () == y.num () && x.str () == y.str () && x.v == y.v; + } +} + + +#endif // TEST_HXX diff --git a/odb-tests/common/id/composite/testscript b/odb-tests/common/id/composite/testscript new file mode 100644 index 0000000..f87d4bc --- /dev/null +++ b/odb-tests/common/id/composite/testscript @@ -0,0 +1,33 @@ +# file : common/id/composite/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/id/nested/buildfile b/odb-tests/common/id/nested/buildfile new file mode 100644 index 0000000..777cb65 --- /dev/null +++ b/odb-tests/common/id/nested/buildfile @@ -0,0 +1,41 @@ +# file : common/nested/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_id_nested_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/id/nested/driver.cxx b/odb-tests/common/id/nested/driver.cxx new file mode 100644 index 0000000..92a80f6 --- /dev/null +++ b/odb-tests/common/id/nested/driver.cxx @@ -0,0 +1,266 @@ +// file : common/id/nested/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test nested ids. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + + // Simple nested id. + // + { + using namespace test1; + + object o1 (1, "a", 3); + o1.v.push_back (123); + + object o2 (4, "b", 6); + o2.v.push_back (234); + + object1 o (new object (10, "abc", 11)); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o.p); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + + o1.z++; + o1.v.pop_back (); + o1.v.push_back (234); + + o2.z--; + o2.v.back ()++; + o2.v.push_back (123); + + delete o.p; + o.p = new object (20, "xyz", 11); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->persist (o.p); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + } + + // Composite nested id. + // + { + using namespace test2; + + object o1 (1, 2, "a", 123); + o1.v.push_back (123); + + object o2 (1, 3, "b", 234); + o2.v.push_back (234); + + object1 o (new object (2, 2, "abc", 123)); + o.p->v.push_back (345); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o.p); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.c)); + unique_ptr p2 (db->load (o2.id.c)); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + + o1.z++; + o1.v.pop_back (); + o1.v.push_back (234); + + o2.z--; + o2.v.modify_back ()++; + o2.v.push_back (123); + + delete o.p; + o.p = new object (2, 3, "xyz", 234); + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + db->persist (o.p); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.c)); + unique_ptr p2 (db->load (o2.id.c)); + unique_ptr p (db->load (o.id)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + assert (*p == o); + } + } + + // Custom/by-value access. + // + { + using namespace test3; + + object o1 (1, "a", 3); + object o2 (4, "b", 6); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o1.z++; + o2.z--; + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + + // Polymorphic. + // + { + using namespace test4; + + base o1 (1, "a"); + object o2 (2, "b", 1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + + o2.z--; + + { + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id.y)); + unique_ptr p2 (db->load (o2.id.y)); + t.commit (); + + assert (*p1 == o1); + assert (*p2 == o2); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/id/nested/test.hxx b/odb-tests/common/id/nested/test.hxx new file mode 100644 index 0000000..06ee6b8 --- /dev/null +++ b/odb-tests/common/id/nested/test.hxx @@ -0,0 +1,217 @@ +// file : common/id/nested/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include + +// Simple nested id. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db value + struct comp + { + int x; + std::string y; + }; + + #pragma db object + struct object + { + #pragma db id(y) + comp id; + + int z; + std::vector v; + + object () {} + object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z && a.v == b.v; + } + + #pragma db object + struct object1 + { + #pragma db id auto + int id; + + object* p; + + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + }; + + inline bool + operator== (const object1& a, const object1& b) + { + return a.id == b.id && *a.p == *b.p; + } +} + +// Composite nested id. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct comp1 + { + int x; + int y; + }; + + #pragma db value + struct comp2 + { + comp1 c; + std::string s; + }; + + #pragma db object + struct object + { + #pragma db id(c) + comp2 id; + + int z; + odb::vector v; + + object () {} + object (int x, int y, std::string s, int z_) + : z (z_) {id.c.x = x; id.c.y = y; id.s = s;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.c.x == b.id.c.x && a.id.c.y == b.id.c.y && + a.id.s == b.id.s && a.z == b.z && a.v == b.v; + } + + #pragma db object + struct object1 + { + #pragma db id auto + int id; + + object* p; + + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + }; + + inline bool + operator== (const object1& a, const object1& b) + { + return a.id == b.id && *a.p == *b.p; + } + + // Multiple levels of nesting, just a compile test. + // + #pragma db object + struct object2 + { + #pragma db id(c.x) + comp2 id; + + int z; + }; +} + +// Custom/by-value access. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct comp + { + int x; + + std::string get_y () const {return y;} + void set_y (std::string v) {y = v;} + + #pragma db get(get_y) set(set_y) + std::string y; + }; + + #pragma db object + struct object + { + comp get_id () const {return id;} + void set_id (comp v) {id = v;} + + #pragma db id(y) get(get_id) set(set_id) + comp id; + + int z; + + object () {} + object (int x, std::string y, int z_): z (z_) {id.x = x; id.y = y;} + }; + + inline bool + operator== (object a, object b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; + } +} + +// Polymorphic. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db value + struct comp + { + int x; + std::string y; + }; + + #pragma db object polymorphic + struct base + { + #pragma db id(y) + comp id; + + virtual ~base () {} + base () {} + base (int x, std::string y) {id.x = x; id.y = y;} + }; + + inline bool + operator== (const base& a, const base& b) + { + return a.id.x == b.id.x && a.id.y == b.id.y; + } + + #pragma db object + struct object: base + { + int z; + + object () {} + object (int x, std::string y, int z_): base (x, y), z (z_) {} + }; + + inline bool + operator== (const object& a, const object& b) + { + return a.id.x == b.id.x && a.id.y == b.id.y && a.z == b.z; + } +} + +#endif // TEST_HXX diff --git a/odb-tests/common/id/nested/testscript b/odb-tests/common/id/nested/testscript new file mode 100644 index 0000000..89e8d7a --- /dev/null +++ b/odb-tests/common/id/nested/testscript @@ -0,0 +1,33 @@ +# file : common/nested/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/include/.gitignore b/odb-tests/common/include/.gitignore new file mode 100644 index 0000000..d52f166 --- /dev/null +++ b/odb-tests/common/include/.gitignore @@ -0,0 +1,17 @@ +# ODB-generated files. +# +obj1-odb.?xx +obj1-odb-*.?xx +obj2-odb.?xx +obj2-odb-*.?xx +obj3-odb.?xx +obj3-odb-*.?xx + +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx +test3-odb.?xx +test3-odb-*.?xx +test4-odb.?xx +test4-odb-*.?xx diff --git a/odb-tests/common/include/buildfile b/odb-tests/common/include/buildfile new file mode 100644 index 0000000..6db878c --- /dev/null +++ b/odb-tests/common/include/buildfile @@ -0,0 +1,51 @@ +# file : common/include/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = obj1 obj2 obj3 test1 test2 test3 test4 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). Also see driver.cxx for the details on +# the -I options usage. +# +odb_options = --table-prefix include_ \ + "-I$out_base" \ + "-I$src_base/.." \ + "-I$src_base/../.." + +cxx.poptions =+ "-I$out_base" "-I$src_base" \ + "-I$out_base/../.." "-I$src_base/../.." + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/include/driver.cxx b/odb-tests/common/include/driver.cxx new file mode 100644 index 0000000..561746a --- /dev/null +++ b/odb-tests/common/include/driver.cxx @@ -0,0 +1,42 @@ +// file : common/include/driver.cxx +// 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 "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" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main () +{ +} diff --git a/odb-tests/common/include/obj1.hxx b/odb-tests/common/include/obj1.hxx new file mode 100644 index 0000000..33ae0d6 --- /dev/null +++ b/odb-tests/common/include/obj1.hxx @@ -0,0 +1,25 @@ +// file : common/include/obj1.hxx +// 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/odb-tests/common/include/obj2.hxx b/odb-tests/common/include/obj2.hxx new file mode 100644 index 0000000..2f20f58 --- /dev/null +++ b/odb-tests/common/include/obj2.hxx @@ -0,0 +1,25 @@ +// file : common/include/obj2.hxx +// 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/odb-tests/common/include/obj3.hxx b/odb-tests/common/include/obj3.hxx new file mode 100644 index 0000000..432145b --- /dev/null +++ b/odb-tests/common/include/obj3.hxx @@ -0,0 +1,25 @@ +// file : common/include/obj3.hxx +// 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/odb-tests/common/include/objs1.hxx b/odb-tests/common/include/objs1.hxx new file mode 100644 index 0000000..6e949e2 --- /dev/null +++ b/odb-tests/common/include/objs1.hxx @@ -0,0 +1,13 @@ +// file : common/include/objs1.hxx +// 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/odb-tests/common/include/objs2.hxx b/odb-tests/common/include/objs2.hxx new file mode 100644 index 0000000..4f8133b --- /dev/null +++ b/odb-tests/common/include/objs2.hxx @@ -0,0 +1,13 @@ +// file : common/include/objs2.hxx +// 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/odb-tests/common/include/objs3.hxx b/odb-tests/common/include/objs3.hxx new file mode 100644 index 0000000..2f7aaff --- /dev/null +++ b/odb-tests/common/include/objs3.hxx @@ -0,0 +1,11 @@ +// file : common/include/objs3.hxx +// 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/odb-tests/common/include/objs4.hxx b/odb-tests/common/include/objs4.hxx new file mode 100644 index 0000000..d766fe6 --- /dev/null +++ b/odb-tests/common/include/objs4.hxx @@ -0,0 +1,11 @@ +// file : common/include/objs1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef OBJS4_HXX +#define OBJS4_HXX + +#include +#include +#include + +#endif // OBJS4_HXX diff --git a/odb-tests/common/include/test1.hxx b/odb-tests/common/include/test1.hxx new file mode 100644 index 0000000..1914ddb --- /dev/null +++ b/odb-tests/common/include/test1.hxx @@ -0,0 +1,16 @@ +// file : common/include/test1.hxx +// 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/odb-tests/common/include/test2.hxx b/odb-tests/common/include/test2.hxx new file mode 100644 index 0000000..6017ac4 --- /dev/null +++ b/odb-tests/common/include/test2.hxx @@ -0,0 +1,15 @@ +// file : common/include/test2.hxx +// 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/odb-tests/common/include/test3.hxx b/odb-tests/common/include/test3.hxx new file mode 100644 index 0000000..e55ecdb --- /dev/null +++ b/odb-tests/common/include/test3.hxx @@ -0,0 +1,12 @@ +// file : common/include/test3.hxx +// 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/odb-tests/common/include/test4.hxx b/odb-tests/common/include/test4.hxx new file mode 100644 index 0000000..b58e679 --- /dev/null +++ b/odb-tests/common/include/test4.hxx @@ -0,0 +1,12 @@ +// file : common/include/test3.hxx +// 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/odb-tests/common/include/testscript b/odb-tests/common/include/testscript new file mode 100644 index 0000000..089f7a1 --- /dev/null +++ b/odb-tests/common/include/testscript @@ -0,0 +1,31 @@ +# file : common/include/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* &!odb-test.db +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/index/buildfile b/odb-tests/common/index/buildfile new file mode 100644 index 0000000..535bd26 --- /dev/null +++ b/odb-tests/common/index/buildfile @@ -0,0 +1,40 @@ +# file : common/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix index_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/index/driver.cxx b/odb-tests/common/index/driver.cxx new file mode 100644 index 0000000..7a22a7c --- /dev/null +++ b/odb-tests/common/index/driver.cxx @@ -0,0 +1,44 @@ +// file : common/index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test index creation with db pragma index. See also database-specific +// tests. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + unique_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/index/test.hxx b/odb-tests/common/index/test.hxx new file mode 100644 index 0000000..f27783f --- /dev/null +++ b/odb-tests/common/index/test.hxx @@ -0,0 +1,142 @@ +// file : common/index/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Test basic functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + + #pragma db index + int i1; + + #pragma db unique + int i2; + + #pragma db unique index + int i3; + + int i4; + #pragma db index unique member(i4) + + int i5; + #pragma db index type("UNIQUE") member(i5) + + int i6; + #pragma db index("object_i6_index") member(i6) + + int i7; + int i8; + int i9; + + int i10; + #pragma db index member(i10, "ASC") + }; + + #pragma db index(object) member(i7) + #pragma db index(object::"object_i8_index") member(i8) +} + +#pragma db index(test1::object::"object_i9_index") member(i9) + +// Test composite indexes. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db value + struct nested + { + int x; + int y; + }; + + #pragma db value + struct comp + { + int x; + int y; + nested n; + }; + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + + int i1a; + int i1b; + #pragma db index("object_i1_i") member(i1a) member(i1b) + + int i2a; + int i2b; + #pragma db index("object_i2_i") members(i2a, i2b) + + #pragma db index + comp c1; + + #pragma db index column("") + comp c2; + + comp c3; + #pragma db index member(c3.x) + #pragma db index member(c3.y) + + comp c4; + #pragma db index("object_c4_i") members(c4.x, c4.y, c4.n.x) + + comp c5; + int i5; + #pragma db index("object_ci5_i") member(c5) member(i5) + }; +} + +// Test container indexes. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct id + { + int x; + int y; + }; + + #pragma db value + struct comp + { + int x; + std::vector v; + }; + + #pragma db object + struct object + { + #pragma db id + id id_; + + std::vector v; + #pragma db index unique member(v.id) + #pragma db index("object_v_index_index") member(v.index) + + comp c; + #pragma db index("object_c_v_id_index") member(c.v.id) + #pragma db index unique member(c.v.index) + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/index/testscript b/odb-tests/common/index/testscript new file mode 100644 index 0000000..cbce341 --- /dev/null +++ b/odb-tests/common/index/testscript @@ -0,0 +1,33 @@ +# file : common/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/inheritance/polymorphism/.gitignore b/odb-tests/common/inheritance/polymorphism/.gitignore new file mode 100644 index 0000000..f183a6f --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/.gitignore @@ -0,0 +1,76 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test1.sql +test1-*.sql + +test2-odb.?xx +test2-odb-*.?xx +test2.sql +test2-*.sql + +test3-odb.?xx +test3-odb-*.?xx +test3.sql +test3-*.sql + +test4-odb.?xx +test4-odb-*.?xx +test4.sql +test4-*.sql + +test5-odb.?xx +test5-odb-*.?xx +test5.sql +test5-*.sql + +test6-odb.?xx +test6-odb-*.?xx +test6.sql +test6-*.sql + +test7-odb.?xx +test7-odb-*.?xx +test7.sql +test7-*.sql + +test8-odb.?xx +test8-odb-*.?xx +test8.sql +test8-*.sql + +test9-odb.?xx +test9-odb-*.?xx +test9.sql +test9-*.sql + +test10-odb.?xx +test10-odb-*.?xx +test10.sql +test10-*.sql + +test11-odb.?xx +test11-odb-*.?xx +test11.sql +test11-*.sql + +test12-odb.?xx +test12-odb-*.?xx +test12.sql +test12-*.sql + +test13-odb.?xx +test13-odb-*.?xx +test13.sql +test13-*.sql + +test14-odb.?xx +test14-odb-*.?xx +test14.sql +test14-*.sql + +test15-odb.?xx +test15-odb-*.?xx +test15.sql +test15-*.sql diff --git a/odb-tests/common/inheritance/polymorphism/buildfile b/odb-tests/common/inheritance/polymorphism/buildfile new file mode 100644 index 0000000..846eb12 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/buildfile @@ -0,0 +1,52 @@ +# file : common/inheritance/polymorphism/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 \ + test12 test13 test14 test15 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_p_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc + +testscript@./: schemas = $hs diff --git a/odb-tests/common/inheritance/polymorphism/driver.cxx b/odb-tests/common/inheritance/polymorphism/driver.cxx new file mode 100644 index 0000000..12f4666 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/driver.cxx @@ -0,0 +1,2093 @@ +// file : common/inheritance/polymorphism/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test polymorphic object inheritance. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test3.hxx" +#include "test4.hxx" +#include "test5.hxx" +#include "test6.hxx" +#include "test7.hxx" +#include "test8.hxx" +#include "test9.hxx" +#include "test10.hxx" +#include "test11.hxx" +#include "test12.hxx" +#include "test13.hxx" +#include "test14.hxx" +#include "test15.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" +#include "test4-odb.hxx" +#include "test5-odb.hxx" +#include "test6-odb.hxx" +#include "test7-odb.hxx" +#include "test8-odb.hxx" +#include "test9-odb.hxx" +#include "test10-odb.hxx" +#include "test11-odb.hxx" +#include "test12-odb.hxx" +#include "test13-odb.hxx" +#include "test14-odb.hxx" +#include "test15-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +const char* events[] = +{ + "pre_persist", + "post_persist", + "pre_load", + "post_load", + "pre_update", + "post_update", + "pre_erase", + "post_erase" +}; + +namespace test6 +{ + void base:: + db_callback (callback_event e, database&) + { + cout << "base " << events[e] << " " << id << endl; + } + + void base:: + db_callback (callback_event e, database&) const + { + cout << "base " << events[e] << " " << id << " const" << endl; + } + + void derived:: + db_callback (callback_event e, database&) const + { + cout << "derived " << events[e] << " " << id << " const" << endl; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test 1: basic polymorphism functionality. + // + { + using namespace test1; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + + // Static persist. + // + db->persist (r); + db->persist (b); + + // Dynamic persist. + // + root& r (d); + db->persist (r); + + t.commit (); + } + + // Static load. + // + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Dynamic load. + // + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d.id)); + unique_ptr pd2 (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd1 == d); + assert (*pd2 == d); + } + + // Invalid load. + // + { + transaction t (db->begin ()); + + try + { + unique_ptr p (db->load (r.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + unique_ptr p (db->load (b.id)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static load into existing instance. + // + { + transaction t (db->begin ()); + root r1; + db->load (r.id, r1); + base b1; + db->load (b.id, b1); + derived d1; + db->load (d.id, d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic load into existing instance. + // + { + transaction t (db->begin ()); + base b1; + db->load (b.id, static_cast (b1)); + derived d1; + db->load (d.id, static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid load into existing instance. + // + { + transaction t (db->begin ()); + + try + { + base b; + db->load (r.id, static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + db->load (b.id, static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing load. + // + { + transaction t (db->begin ()); + root b1; + db->load (b.id, b1); + base d1; + db->load (d.id, d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Static reload. + // + { + transaction t (db->begin ()); + root r1; + r1.id = r.id; + db->reload (r1); + base b1; + b1.id = b.id; + db->reload (b1); + derived d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (r1 == r); + assert (b1 == b); + assert (d1 == d); + } + + // Dynamic reload. + // + { + transaction t (db->begin ()); + base b1; + b1.id = b.id; + db->reload (static_cast (b1)); + derived d1; + d1.id = d.id; + db->reload (static_cast (d1)); + t.commit (); + + assert (b1 == b); + assert (d1 == d); + } + + // Invalid reload. + // + { + transaction t (db->begin ()); + + try + { + base b; + b.id = r.id; + db->reload (static_cast (b)); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + derived d; + d.id = b.id; + db->reload (static_cast (d)); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Slicing reload. + // + { + transaction t (db->begin ()); + root b1; + b1.id = b.id; + db->reload (b1); + base d1; + d1.id = d.id; + db->reload (d1); + t.commit (); + + assert (b1 == static_cast (b)); + assert (d1 == static_cast (d)); + } + + // Query. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test loading via root. + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == r); + assert (++i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via base. + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i != e && *i == d); + assert (++i == e); + } + + // Test loading via derived. + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test loading into an existing instance. + // + { + root_result qr (db->query ()); + + unsigned short mask (0); + + for (root_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::root") + { + root r1; + i.load (r1); + assert (r1 == r); + mask |= 1; + } + else if (ds == "test1::base") + { + base b1; + i.load (b1); + assert (b1 == b); + mask |= 2; + } + else if (ds == "test1::derived") + { + derived d1; + i.load (d1); + assert (d1 == d); + mask |= 4; + } + else + assert (false); + } + + assert (mask == 7); + } + + // Test query conditions with columns from multiple tables. + // + { + base_result qr ( + db->query ( + base_query::num == 3 && base_query::str == "ddd")); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + // Test discriminator access. + // + { + base_result qr (db->query (base_query::id == 3)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test1::derived"); + assert (++i == e); + } + + // Test loading of an object from the same hierarchy during + // query result iteration (tests image copying via change + // callbacks in some databases). + // + { + base_result qr (db->query ()); + + unsigned short mask (0); + + for (base_result::iterator i (qr.begin ()); i != qr.end (); ++i) + { + string ds (i.discriminator ()); + + if (ds == "test1::base") + { + unique_ptr d1 (db->load (d.id)); + assert (*d1 == d); + assert (*i == b); + mask |= 1; + } + else if (ds == "test1::derived") + { + unique_ptr b1 (db->load (b.id)); + assert (*b1 == b); + assert (*i == d); + mask |= 2; + } + } + + assert (mask == 3); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query root_query; + typedef odb::result root_result; + + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ("ORDER BY" + root_query::id)); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->typeid_ == "test1::root" && i->num == r.num); + assert (++i != e && i->typeid_ == "test1::base" && i->num == b.num); + assert (++i != e && i->typeid_ == "test1::derived" && i->num == d.num); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ("ORDER BY" + base_query::id)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->id == b.id && i->num == b.num && i->str == b.str); + assert (++i != e && + i->id == d.id && i->num == d.num && i->str == d.str); + assert (++i == e); + } + + // derived + // + { + derived_result qr (db->query ()); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->num == d.num && i->str == d.str && + i->dnum == d.dnum && i->dstr == d.dstr); + assert (++i == e); + } + + t.commit (); + } + + // Update. + // + r.num++; + r.strs.push_back ("aaaa"); + + b.num++; + b.str += "b"; + b.nums.push_back (24); + b.strs.push_back ("bbbb"); + + d.num++; + d.str += "d"; + d.dnum++; + d.dstr += "d"; + d.nums.push_back (34); + d.strs.push_back ("dddd"); + + { + transaction t (db->begin ()); + + // Static update. + // + db->update (r); + db->update (b); + + // Dynamic update. + // + root& r (d); + db->update (r); + + t.commit (); + } + + // Verify update. + // + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pr == r); + assert (*pb == b); + assert (*pd == d); + } + + // Invalid erase via id. + // + { + transaction t (db->begin ()); + + try + { + db->erase (r.id); + assert (false); + } + catch (const object_not_persistent&) {} + + try + { + db->erase (b.id); + assert (false); + } + catch (const object_not_persistent&) {} + + t.commit (); + } + + // Static erase via id. + // + { + transaction t (db->begin ()); + db->erase (r.id); + db->erase (b.id); + t.commit (); + } + + // Dynamic erase via id. + // + { + transaction t (db->begin ()); + db->erase (d.id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Static erase via object. + // + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + t.commit (); + } + + // Dynamic erase via object. + // + { + const root& r (d); + transaction t (db->begin ()); + db->erase (r); + t.commit (); + } + } + + // Test 2: inverse object pointers in polymorhic bases. + // + { + using namespace test2; + + derived d (1, "d", 1); + root_pointer rp (&d); + base_pointer bp (&d); + + { + transaction t (db->begin ()); + db->persist (rp); + db->persist (bp); + + d.rp.reset (*db, &rp); + d.bp.reset (*db, &bp); + + db->persist (d); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + unique_ptr pb (db->load (d.id)); + unique_ptr pr (db->load (d.id)); + t.commit (); + + assert (pd->rp.object_id () == rp.id && + pd->bp.object_id () == bp.id); + + derived* p (dynamic_cast (pb.get ())); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + + p = dynamic_cast (pr.get ()); + assert (p != 0 && + p->rp.object_id () == rp.id && + p->bp.object_id () == bp.id); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + base_result qr ( + db->query ( + base_query::rp->id == rp.id && + base_query::bp->id == bp.id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i.discriminator () == "test2::derived"); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::result root_result; + typedef odb::result base_result; + + transaction t (db->begin ()); + + // root + // + { + root_result qr (db->query ()); + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->rp_id == rp.id && i->r_id == d.id); + assert (++i == e); + } + + // base + // + { + base_result qr (db->query ()); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->bp_id == bp.id && i->b_id == d.id && i->str == d.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 3: delayed loading. + // + { + using namespace test3; + + base b1 (21, 21); + base b2 (22, 22); + base b3 (23, 23); + + derived d1 (31, 31, "d"); + derived d2 (32, 32, "dd"); + derived d3 (33, 33, "ddd"); + + b1.rptr = new root (1); + b2.rptr = new base (2, 2); + b3.rptr = new derived (3, 3, "b3"); + + d1.rptr = new root (4); + d2.rptr = new base (5, 5); + d3.rptr = new derived (6, 6, "d3"); + + d2.bptr = new base (7, 7); + d3.bptr = new derived (8, 8, "d3b"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (b2); + db->persist (b3); + + db->persist (d1); + db->persist (d2); + db->persist (d3); + + db->persist (b1.rptr); + db->persist (b2.rptr); + db->persist (b3.rptr); + + db->persist (d1.rptr); + db->persist (d2.rptr); + db->persist (d3.rptr); + + db->persist (d2.bptr); + db->persist (d3.bptr); + + t.commit (); + } + + { + transaction t (db->begin ()); + + { + unique_ptr p1 (db->load (b1.id)); + unique_ptr p2 (db->load (b2.id)); + unique_ptr p3 (db->load (b3.id)); + assert (*p1 == b1); + assert (*p2 == b2); + assert (*p3 == b3); + } + + { + unique_ptr p1 (db->load (d1.id)); + unique_ptr p2 (db->load (d2.id)); + unique_ptr p3 (db->load (d3.id)); + assert (*p1 == d1); + assert (*p2 == d2); + assert (*p3 == d3); + } + + t.commit (); + } + + // Query. + // + { + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + // Test query conditions with columns in pointed-to objects from + // multiple tables. + // + { + derived_result qr ( + db->query ( + derived_query::rptr->id == 6 && + derived_query::bptr->id == 8 && + derived_query::bptr->num == 8)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d3); + assert (++i == e); + } + + t.commit (); + } + + // Views. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + typedef odb::query root_query; + typedef odb::result root_result; + + transaction t (db->begin ()); + + // base + // + { + base_result qr ( + db->query ( + base_query::base::num == b2.num && + base_query::base::id == b2.id && + base_query::r::id == b2.rptr->id)); + + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->b_id == b2.id && + i->r_id == b2.rptr->id && + i->num == b2.num); + assert (++i == e); + } + + // derived + // + { + derived_result qr ( + db->query ( + derived_query::d::str == d3.str && + derived_query::d::num == d3.num && + derived_query::b::num == d3.bptr->num && + derived_query::d::id == d3.id && + derived_query::b::id == d3.bptr->id && + derived_query::r::id == d3.rptr->id)); + + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->d_id == d3.id && + i->b_id == d3.bptr->id && + i->r_id == d3.rptr->id && + i->d_num == d3.num && + i->b_num == d3.bptr->num && + i->str == d3.str); + assert (++i == e); + } + + // root + // + { + root_result qr ( + db->query ( + root_query::r::id.in (b2.rptr->id, d2.rptr->id))); + + root_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && + i->r_id == d2.rptr->id && + i->d_id == d2.id && + i->str == d2.str); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 4: views. + // + { + using namespace test4; + + base1 b1 (21, 1); + + root2 r2 (11, 0); + base2 b2 (21, 1, "abc"); + + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (r2); + db->persist (b2); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr ( + db->query ( + query::base1::num == b1.num)); + + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->str == "abc"); + assert (++i == e); + } + + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr (db->query ()); + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->min_num == 1); + assert (++i == e); + } + + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + { + result qr (db->query ()); + result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && i->str == "abc"); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 5: polymorphism and optimistic concurrency. + // + { + using namespace test5; + + root r (1, 1); + base b (2, 2, "bbb"); + derived d (3, 3, "ddd"); + + r.strs.push_back ("a"); + r.strs.push_back ("aa"); + r.strs.push_back ("aaa"); + + b.nums.push_back (21); + b.nums.push_back (22); + b.nums.push_back (23); + b.strs.push_back ("b"); + b.strs.push_back ("bb"); + b.strs.push_back ("bbb"); + + d.nums.push_back (31); + d.nums.push_back (32); + d.nums.push_back (33); + d.strs.push_back ("d"); + d.strs.push_back ("dd"); + d.strs.push_back ("ddd"); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Update. + // + { + transaction t (db->begin ()); + + // Root. + // + { + unique_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaa"); + db->update (r); + + p->num--; + p->strs.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (r == *p); + } + + // Base. + // + { + unique_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + p->num--; + p->str += "B"; + p->strs.pop_back (); + p->nums.pop_back (); + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (b == *p); + } + + // Derived. + // + { + unique_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + derived& d1 (static_cast (*p)); + d1.num--; + d1.str += "D"; + d1.strs.pop_back (); + d1.nums.pop_back (); + d1.dnum--; + d1.dstr += "D"; + try + { + db->update (p); + assert (false); + } + catch (const odb::object_changed&) {} + + // Make sure the object is intact. + // + db->reload (p); + assert (d == *p); + } + + t.commit (); + } + + // Reload. + // + { + transaction t (db->begin ()); + + // Make sure reload doesn't modify the object if the versions + // match. + // + derived d1 (d); + d1.num++; + d1.str += "d"; + d1.strs.push_back ("dddd"); + d1.nums.push_back (24); + d1.dnum++; + d1.dstr += "d"; + derived d2 (d1); + + db->reload (d1); + assert (d1 == d2); + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + + // Root. + // + { + unique_ptr p (db->load (r.id)); + + r.num++; + r.strs.push_back ("aaaaa"); + db->update (r); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Base. + // + { + unique_ptr p (db->load (b.id)); + + b.num++; + b.str += "b"; + b.strs.push_back ("bbbb"); + b.nums.push_back (24); + db->update (b); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Derived. + // + { + unique_ptr p (db->load (d.id)); // Via root. + + d.num++; + d.str += "d"; + d.strs.push_back ("dddd"); + d.nums.push_back (24); + d.dnum++; + d.dstr += "d"; + db->update (d); + + try + { + db->erase (p); + assert (false); + } + catch (const odb::object_changed&) {} + + db->reload (p); + db->erase (p); + } + + // Try to update non-existent object. + // + { + try + { + db->update (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + // Try to erase non-existent object. + // + { + try + { + db->erase (d); + assert (false); + } + catch (const odb::object_changed&) {} + } + + t.commit (); + } + } + + // Test 6: polymorphism and callbacks. + // + { + using namespace test6; + + base b (1, 1, "bbb"); + + unique_ptr d (new derived (2, 2, "ddd")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d->id)); + + db->load (b.id, *pb); + db->load (d->id, *pd); + + db->reload (*pb); + db->reload (*pd); + + t.commit (); + } + + // Update. + // + { + b.num++; + d->num++; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + *i; + + t.commit (); + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d); + t.commit (); + } + + // Recursive (delayed) loading. + // + { + derived d (3, 3, "dddd"); + d.ptr.reset (new derived (4, 4, "ddddd")); + + { + transaction t (db->begin ()); + db->persist (d); + db->persist (d.ptr); + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr p (db->load (d.id)); + t.commit (); + } + } + } + + // Test 7: polymorphism and object cache (session). + // + { + using namespace test7; + + shared_ptr r (new root (1, 1)); + shared_ptr b (new base (2, 2, "b")); + shared_ptr d (new derived (3, 3, "d")); + + // Persist. + // + { + session s; + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + assert (db->load (r->id) == r); + assert (db->load (b->id) == b); + assert (db->load (d->id) == d); + } + + // Load. + // + { + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + assert (db->load (r->id) == r1); + assert (db->load (b->id) == b1); + assert (db->load (d->id) == d1); + + assert (!db->find (b->id)); + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + session s; + + transaction t (db->begin ()); + shared_ptr r1 (db->load (r->id)); + shared_ptr b1 (db->load (b->id)); + shared_ptr d1 (db->load (d->id)); + t.commit (); + + { + transaction t (db->begin ()); + + result r (db->query ("ORDER BY" + query::id)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i.load () == r1); + assert (++i != e && i.load () == b1); + assert (++i != e && i.load () == d1); + assert (++i == e); + + t.commit (); + } + } + + // Erase. + // + { + session s; + + { + transaction t (db->begin ()); + db->load (r->id); + db->load (b->id); + db->load (d->id); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (r); + db->erase (b); + db->erase (d); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (!db->find (r->id)); + assert (!db->find (b->id)); + assert (!db->find (d->id)); + t.commit (); + } + } + } + + // Test 8: polymorphism and abstract bases. + // + { + using namespace test8; + + base b (1, 1, "b"); + interm i (2, 2, "i", true); + derived1 d1 (3, 3, "d1", true); + derived2 d2 (4, 4, "d2", false); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d1)); + db->persist (static_cast (d2)); + + try + { + db->persist (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->persist (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Load. + // + { + base vb; + interm vi; + derived1 vd1; + derived2 vd2; + + transaction t (db->begin ()); + + // load (id) + // + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d1.id)); + unique_ptr pd2 (db->load (d2.id)); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + + // load (id, obj) + // + db->load (b.id, static_cast (vb)); + db->load (d1.id, static_cast (vd1)); + db->load (d2.id, static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->load (i.id, static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + // reload (obj) + // + vb.num = 0; + vd1.num = 0; + vd2.num = 0; + + db->reload (static_cast (vb)); + db->reload (static_cast (vd1)); + db->reload (static_cast (vd2)); + + assert (vb == b); + assert (vd1 == d1); + assert (vd2 == d2); + + try + { + db->reload (static_cast (vi)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + // Update. + // + { + b.num++; + b.str += 'b'; + d1.num++; + d1.str += "d1"; + d2.num++; + d2.str += "d1"; + + { + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d1); + db->update (static_cast (d2)); + + try + { + db->update (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->update (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd1 (db->load (d1.id)); + unique_ptr pd2 (db->load (d2.id)); + + t.commit (); + + assert (*pb == b); + assert (*pd1 == d1); + assert (*pd2 == d2); + } + } + + // Erase. + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (d1.id); + db->erase (static_cast (d2)); + + try + { + db->erase (i); + assert (false); + } + catch (const odb::abstract_class&) {} + + try + { + db->erase (static_cast (i)); + assert (false); + } + catch (const odb::no_type_info&) {} + + t.commit (); + } + } + + // Test 9: polymorphism and readonly classes. + // + { + using namespace test9; + + ro_root ro_r (1, 1); + rw_base rw_b (2, 2, "b"); + ro_derived ro_d (3, 3, "d"); + + rw_root rw_r (1, 1); + ro_base ro_b (2, 2, "b"); + rw_derived rw_d (3, 3, "d"); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (ro_r); + db->persist (rw_b); + db->persist (ro_d); + + db->persist (rw_r); + db->persist (ro_b); + db->persist (rw_d); + t.commit (); + } + + // Update. + // + { + ro_root ro_r1 (ro_r); + rw_base rw_b1 (rw_b); + ro_derived ro_d1 (ro_d); + + ro_base ro_b1 (ro_b); + rw_derived rw_d1 (rw_d); + + ro_r1.num++; + ro_r1.strs.push_back ("b"); + + rw_b1.num++; + rw_b1.strs.push_back ("b"); + rw_b1.str += "b"; + rw_b1.nums.push_back (2); + rw_b.str += "b"; + rw_b.nums.push_back (2); + + ro_d1.num++; + ro_d1.strs.push_back ("d"); + ro_d1.str += "d"; + ro_d1.nums.push_back (3); + ro_d1.dnum++; + ro_d1.dstr += "d"; + + rw_r.num++; + rw_r.strs.push_back ("b"); + + ro_b1.num++; + ro_b1.strs.push_back ("b"); + ro_b1.str += "b"; + ro_b1.nums.push_back (2); + + rw_d1.num++; + rw_d1.strs.push_back ("d"); + rw_d1.str += "d"; + rw_d1.nums.push_back (3); + rw_d1.dnum++; + rw_d1.dstr += "d"; + rw_d.dnum++; + rw_d.dstr += "d"; + + { + // These should be no-ops. + // + db->update (ro_r1); + db->update (static_cast (ro_d1)); + db->update (ro_b1); + + transaction t (db->begin ()); + db->update (static_cast (rw_b1)); + db->update (rw_r); + db->update (static_cast (rw_d1)); + t.commit (); + } + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr p_ro_r (db->load (ro_r.id)); + unique_ptr p_rw_b (db->load (rw_b.id)); + unique_ptr p_ro_d (db->load (ro_d.id)); + + unique_ptr p_rw_r (db->load (rw_r.id)); + unique_ptr p_ro_b (db->load (ro_b.id)); + unique_ptr p_rw_d (db->load (rw_d.id)); + + t.commit (); + + assert (*p_ro_r == ro_r); + assert (*p_rw_b == rw_b); + assert (*p_ro_d == ro_d); + + assert (*p_rw_r == rw_r); + assert (*p_ro_b == ro_b); + assert (*p_rw_d == rw_d); + } + } + + // Test 10: empty polymorphic classes. + // + { + using namespace test10; + + base b (1, 1); + derived d (2, 2); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + d.num++; + + transaction t (db->begin ()); + db->update (static_cast (b)); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } + + // Test 11: reuse and polymorphic inheritance. + // + { + using namespace test11; + + base b (1, 1, "b"); + derived d (2, 2, "d"); + + b.strs.push_back ("b"); + b.nums.push_back (1); + + d.strs.push_back ("d"); + d.nums.push_back (1); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Update. + // + { + b.num++; + b.str += "b"; + b.strs.push_back ("bb"); + b.nums.push_back (2); + + d.num++; + d.str += "d"; + d.strs.push_back ("dd"); + d.nums.push_back (2); + d.dnum++; + d.dstr += "d"; + + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + + // Query. + // + { + typedef odb::query base_query; + typedef odb::result base_result; + + typedef odb::query derived_query; + typedef odb::result derived_result; + + transaction t (db->begin ()); + + { + base_result qr (db->query (base_query::num == 2)); + base_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == b); + assert (++i == e); + } + + { + derived_result qr (db->query (derived_query::num == 3)); + derived_result::iterator i (qr.begin ()), e (qr.end ()); + + assert (i != e && *i == d); + assert (++i == e); + } + + t.commit (); + } + } + + // Test 12: polymorphic objects with auto id. + // + { + using namespace test12; + + base b (1); + derived d (2); + + unsigned long id1, id2; + + // Persist. + // + { + transaction t (db->begin ()); + id1 = db->persist (b); + id2 = db->persist (static_cast (d)); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (id1)); + unique_ptr pd (db->load (id2)); + + t.commit (); + + assert (*pb == b); + assert (*pd == d); + } + } + + // Test 13: polymorphic derived without any non-container data members + // (which results in an empty SELECT statement). + // + { + using namespace test13; + + base b; + b.nums.push_back (123); + derived d; + d.nums.push_back (123); + d.strs.push_back ("abc"); + + base1 b1; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + db->persist (b1); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pbr (db->load (b.id)); + unique_ptr pdr (db->load (d.id)); + unique_ptr pdb (db->load (d.id)); + unique_ptr pb1r (db->load (b1.id)); + t.commit (); + + base& rb (static_cast (*pbr)); + derived& rd1 (static_cast (*pdr)); + derived& rd2 (static_cast (*pdb)); + base1 rb1 (static_cast (*pb1r)); + + assert (rb.id == b.id && rb.nums == b.nums); + assert (rd1.id == d.id && rd1.nums == rd1.nums && + rd1.strs == rd1.strs); + assert (rd2.id == d.id && rd2.nums == rd2.nums && + rd2.strs == rd2.strs); + assert (rb1.id == b1.id); + } + } + + // Test 14: inverse pointer in polymorphic base. + // + { + using namespace test14; + + derived d; + d.num = 123; + + d.o1 = new object1; + d.o2 = new object2; + d.o3.push_back (new object3); + d.o4.push_back (new object4); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (d.o1); + db->persist (d.o2); + db->persist (d.o3[0]); + db->persist (d.o4[0]); + db->persist (d); + t.commit (); + } + + // Load. + // + { + session s; + + transaction t (db->begin ()); + object1* p1 (db->load (d.o1->id)); + object2* p2 (db->load (d.o2->id)); + object3* p3 (db->load (d.o3[0]->id)); + object4* p4 (db->load (d.o4[0]->id)); + t.commit (); + + assert (p1->d->num == d.num); + assert (p2->d[0]->num == d.num); + assert (p3->d[0]->num == d.num); + assert (p4->d->num == d.num); + delete p1->d; + } + + // Query. + // + { + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::d->num == d.num)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i->d->num == d.num); + delete i.load ()->d; + assert (++i == e); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::d->num == d.num)); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && i->d->num == d.num); + delete i.load ()->d; + assert (++i == e); + t.commit (); + } + } + + // Test 15: LOB/long data and polymorphism. + // + { + using namespace test15; + + const char data[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B"; + + derived d; + d.blob.assign (data, data + sizeof (data)); + + // Persist. + // + { + transaction t (db->begin ()); + base* b (&d); + db->persist (b); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + + unique_ptr pb (db->load (d.id)); + t.commit (); + + derived* pd (dynamic_cast (pb.get ())); + assert (pd != 0 && pd->blob == d.blob); + } + + // Query. + // + { + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e); + + derived* pd (dynamic_cast (&*i)); + assert (pd != 0 && pd->blob == d.blob); + + assert (++i == e); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/inheritance/polymorphism/test1.hxx b/odb-tests/common/inheritance/polymorphism/test1.hxx new file mode 100644 index 0000000..7f598de --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test1.hxx @@ -0,0 +1,115 @@ +// file : common/inheritance/polymorphism/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include +#include +#include + +#include + +// Test basic polymorphism functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id column("object_id") + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // Views. + // + #pragma db view object(root) + struct root_view + { + //#pragma db column(root::typeid_) + std::string typeid_; // @@ tmp + + unsigned long num; + }; + + #pragma db view object(base = b) + struct base_view + { + unsigned long id; + unsigned long num; + std::string str; + }; + + #pragma db view object(derived) + struct derived_view + { + unsigned long num; + std::string str; + unsigned long dnum; + std::string dstr; + }; +} + +#endif // TEST1_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test10.hxx b/odb-tests/common/inheritance/polymorphism/test10.hxx new file mode 100644 index 0000000..63673a1 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test10.hxx @@ -0,0 +1,78 @@ +// file : common/inheritance/polymorphism/test10.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST10_HXX +#define TEST10_HXX + +#include + +#include + +// Test empty polymorphic classes. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n): root (i), num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n): base (i, n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST10_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test11.hxx b/odb-tests/common/inheritance/polymorphism/test11.hxx new file mode 100644 index 0000000..2d38a6c --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test11.hxx @@ -0,0 +1,78 @@ +// file : common/inheritance/polymorphism/test11.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST11_HXX +#define TEST11_HXX + +#include +#include +#include + +#include + +// Test mixing reuse and polymorphic inheritance. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db object abstract + struct root + { + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + }; + + #pragma db object polymorphic + struct base: root + { + virtual ~base () {} + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (base)) + return false; + + return id == b.id && num == b.num && strs == b.strs && + str == b.str && nums == b.nums; + } + }; + + inline bool + operator== (const base& x, const base& y) {return x.compare (y);} + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const base& b, bool tc = true) const + { + if (tc && typeid (b) != typeid (derived)) + return false; + + const derived& d (static_cast (b)); + return base::compare (b, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST11_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test12.hxx b/odb-tests/common/inheritance/polymorphism/test12.hxx new file mode 100644 index 0000000..85000ac --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test12.hxx @@ -0,0 +1,79 @@ +// file : common/inheritance/polymorphism/test12.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST12_HXX +#define TEST12_HXX + +#include + +#include + +// Test polymorphic classes with private auto id. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id_ == r.id_; + } + + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long n): num (n) {} + + unsigned long num; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && num == b.num; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long n): base (n) {} + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + return base::compare (r, false); + } + }; +} + +#endif // TEST12_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test13.hxx b/odb-tests/common/inheritance/polymorphism/test13.hxx new file mode 100644 index 0000000..3240a9a --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test13.hxx @@ -0,0 +1,46 @@ +// file : common/inheritance/polymorphism/test13.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST13_HXX +#define TEST13_HXX + +#include +#include + +#include + +// Test polymorphic derived without any non-container data members (which +// results in an empty SELECT statement). +// +#pragma db namespace table("t13_") +namespace test13 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct base: root + { + std::vector nums; + }; + + #pragma db object + struct derived: base + { + std::vector strs; + }; + + #pragma db object + struct base1: root + { + // Nothing. + }; +} + +#endif // TEST13_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test14.hxx b/odb-tests/common/inheritance/polymorphism/test14.hxx new file mode 100644 index 0000000..1050861 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test14.hxx @@ -0,0 +1,99 @@ +// file : common/inheritance/polymorphism/test14.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST14_HXX +#define TEST14_HXX + +#include + +#include + +// Test inverse pointer in polymorphic base. +// +#pragma db namespace table("t14_") +namespace test14 +{ + struct object1; + struct object2; + struct object3; + struct object4; + + #pragma db object polymorphic session + struct base + { + virtual ~base (); + + #pragma db id auto + unsigned long id; + + object1* o1; + object2* o2; + std::vector o3; + std::vector o4; + }; + + #pragma db object + struct derived: base + { + unsigned long num; + }; + + // one-to-one(i) + // + #pragma db object session + struct object1 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o1) + derived* d; + }; + + // one-to-many(i) + // + #pragma db object session + struct object2 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o2) + std::vector d; + }; + + // many-to-many(i) + // + #pragma db object session + struct object3 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o3) + std::vector d; + }; + + // many-to-one(i) + // + #pragma db object session + struct object4 + { + #pragma db id auto + unsigned long id; + + #pragma db inverse(o4) + derived* d; + }; + + inline base:: + ~base () + { + delete o1; + delete o2; + delete o3[0]; + delete o4[0]; + } +} + +#endif // TEST14_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test15.hxx b/odb-tests/common/inheritance/polymorphism/test15.hxx new file mode 100644 index 0000000..5799ace --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test15.hxx @@ -0,0 +1,44 @@ +// file : common/inheritance/polymorphism/test15.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST15_HXX +#define TEST15_HXX + +#include + +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + + +// Test LOB/long data and polymorphism. +// +#pragma db namespace table("t15_") +namespace test15 +{ + #pragma db object polymorphic + struct base + { + virtual ~base () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct derived: base + { + #pragma db type(BLOB_TYPE) + std::vector blob; + }; +} + +#endif // TEST15_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test2.hxx b/odb-tests/common/inheritance/polymorphism/test2.hxx new file mode 100644 index 0000000..9890e02 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test2.hxx @@ -0,0 +1,105 @@ +// file : common/inheritance/polymorphism/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include +#include + +#include +#include + +// Test inverse object pointers in polymorhic bases. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct root; + + #pragma db object + struct root_pointer + { + root_pointer (root* r = 0): p (r) {} + + #pragma db id auto + unsigned long id; + + root* p; + }; + + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(p) + odb::lazy_ptr rp; + }; + + struct base; + + #pragma db object + struct base_pointer + { + base_pointer (base* b = 0) {if (b != 0) vp.push_back (b);} + + #pragma db id auto + unsigned long id; + + std::vector vp; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, const std::string& s): root (i), str (s) {} + + std::string str; + + #pragma db inverse(vp) + odb::lazy_ptr bp; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, const std::string& s, unsigned long n) + : base (i, s), num (n) {} + + unsigned long num; + }; + + // Views. + // + #pragma db view object(root_pointer = rp) object(root) + struct root_view + { + #pragma db column(rp::id) + unsigned long rp_id; + + #pragma db column(root::id) + unsigned long r_id; + }; + + #pragma db view object(base_pointer) object(base = b) + struct base_view + { + #pragma db column(base_pointer::id) + unsigned long bp_id; + + #pragma db column(b::id) + unsigned long b_id; + + std::string str; + }; +} + +#endif // TEST2_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test3.hxx b/odb-tests/common/inheritance/polymorphism/test3.hxx new file mode 100644 index 0000000..fd68f24 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test3.hxx @@ -0,0 +1,146 @@ +// file : common/inheritance/polymorphism/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#include +#include + +#include + +// Test delayed loading. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + virtual ~base () {delete rptr;} + base (): rptr (0) {} + base (unsigned long i, unsigned long n): root (i), num (n), rptr (0) {} + + unsigned long num; + root* rptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return + root::compare (r, false) && + num == b.num && + ((rptr == 0 && b.rptr == 0) || rptr->compare (*b.rptr)); + } + }; + + #pragma db object + struct derived: base + { + virtual ~derived () {delete bptr;} + derived (): bptr (0) {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n), str (s), bptr (0) {} + + std::string str; + base* bptr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return + base::compare (r, false) && + str == d.str && + ((bptr == 0 && d.bptr == 0) || bptr->compare (*d.bptr)); + } + }; + + // Views. + // + #pragma db view object(base) object(root = r) + struct base_view + { + #pragma db column(base::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + unsigned long num; + }; + + #pragma db view \ + object(derived = d) \ + object(base = b) \ + object(root = r: d::rptr) + struct derived_view + { + #pragma db column(d::id) + unsigned long d_id; + + #pragma db column(b::id) + unsigned long b_id; + + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::num) + unsigned long d_num; + + #pragma db column(b::num) + unsigned long b_num; + + std::string str; + }; + + // This is an example of a pathological case, where the right-hand-side + // of the join condition comes from one of the bases. As a result, we + // join the base table first, which means we will get both bases and + // derived objects instead of just derived. + // + //#pragma db view object(root = r) object(derived = d) + #pragma db view object(derived = d) object(root = r) + struct root_view + { + #pragma db column(r::id) + unsigned long r_id; + + #pragma db column(d::id) + unsigned long d_id; + + std::string str; + }; +} + +#endif // TEST3_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test4.hxx b/odb-tests/common/inheritance/polymorphism/test4.hxx new file mode 100644 index 0000000..148c53c --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test4.hxx @@ -0,0 +1,84 @@ +// file : common/inheritance/polymorphism/test4.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST4_HXX +#define TEST4_HXX + +#include + +#include + +// Test views. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic + struct root1 + { + virtual ~root1 () {} + root1 () {} + root1 (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + }; + + #pragma db object + struct base1: root1 + { + base1 () {} + base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} + + unsigned long num; + }; + + #pragma db object polymorphic + struct root2 + { + virtual ~root2 () {} + root2 () {} + root2 (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base2: root2 + { + base2 () {} + base2 (unsigned long i, unsigned long n, const std::string& s) + : root2 (i, n), str (s) {} + + std::string str; + }; + + // Test custom join condition. + // + #pragma db view object(base2) object(base1: base2::num == base1::num) + struct view1 + { + std::string str; + }; + + #pragma db view object(base2) + struct view2 + { + #pragma db column("min(" + base2::num + ")") + unsigned long min_num; + }; + + // Test custom join condition that uses object id. It cannot come + // from the base since the base table hasn't been join'ed yet. + // + #pragma db view object(base1) object(base2: base2::id == base1::id) + struct view3 + { + std::string str; + }; +} + +#endif // TEST4_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test5.hxx b/odb-tests/common/inheritance/polymorphism/test5.hxx new file mode 100644 index 0000000..172e7e8 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test5.hxx @@ -0,0 +1,92 @@ +// file : common/inheritance/polymorphism/test5.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST5_HXX +#define TEST5_HXX + +#include +#include +#include +#include + +#include + +// Test polymorphism and optimistic concurrency. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic pointer(std::unique_ptr) + struct root + { + virtual ~root () {} + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + #pragma db version + unsigned long version; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && version == r.version && + num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived)) + return false; + + const derived& d (static_cast (r)); + return base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST5_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test6.hxx b/odb-tests/common/inheritance/polymorphism/test6.hxx new file mode 100644 index 0000000..b0f9a16 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test6.hxx @@ -0,0 +1,64 @@ +// file : common/inheritance/polymorphism/test6.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST6_HXX +#define TEST6_HXX + +#include +#include + +#include +#include + +// Test polymorphism and callbacks. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic pointer(std::unique_ptr) + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object callback(db_callback) + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + + void + db_callback (odb::callback_event, odb::database&); + + void + db_callback (odb::callback_event, odb::database&) const; + }; + + #pragma db object callback(db_callback) + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + std::unique_ptr ptr; + + void + db_callback (odb::callback_event, odb::database&) const; + }; +} + +#endif // TEST6_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test7.hxx b/odb-tests/common/inheritance/polymorphism/test7.hxx new file mode 100644 index 0000000..60da98e --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test7.hxx @@ -0,0 +1,54 @@ +// file : common/inheritance/polymorphism/test7.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include +#include + +#include + +// Test polymorphism and object cache (session). +// +#pragma db namespace table("t7_") +namespace test7 +{ + using std::shared_ptr; + + #pragma db object polymorphic pointer(shared_ptr) session + struct root + { + virtual ~root () {} + root (): id (0) {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + }; + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + }; + + #pragma db object + struct derived: base + { + derived () {} + derived (unsigned long i, unsigned long n, const std::string& s) + : base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + }; +} + +#endif // TEST7_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test8.hxx b/odb-tests/common/inheritance/polymorphism/test8.hxx new file mode 100644 index 0000000..84b6688 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test8.hxx @@ -0,0 +1,129 @@ +// file : common/inheritance/polymorphism/test8.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST8_HXX +#define TEST8_HXX + +#include +#include +#include + +#include + +// Test polymorphism and abstract bases. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object polymorphic + struct root + { + virtual ~root () = 0; // Auto-abstract. + root () {} + root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline root:: + ~root () {} + + inline bool + operator== (const root& x, const root& y) {return x.compare (y);} + + #pragma db object + struct base: root + { + base () {} + base (unsigned long i, unsigned long n, const std::string& s) + : root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (base)) + return false; + + const base& b (static_cast (r)); + return root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object abstract + struct interm: base + { + interm () {} + interm (unsigned long i, unsigned long n, const std::string& s, bool b) + : base (i, n, s), bln (b) {} + + bool bln; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (interm)) + return false; + + const interm& i (static_cast (r)); + return base::compare (r, false) && bln == i.bln; + } + }; + + #pragma db object + struct derived1: interm + { + derived1 () {} + derived1 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dnum (n + 1) {} + + unsigned long dnum; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived1)) + return false; + + const derived1& d (static_cast (r)); + return interm::compare (r, false) && dnum == d.dnum; + } + }; + + #pragma db object + struct derived2: interm + { + derived2 () {} + derived2 (unsigned long i, unsigned long n, const std::string& s, bool b) + : interm (i, n, s, b), dstr (s + 'd') {} + + std::string dstr; + + virtual bool + compare (const root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (derived2)) + return false; + + const derived2& d (static_cast (r)); + return interm::compare (r, false) && dstr == d.dstr; + } + }; +} + +#endif // TEST8_HXX diff --git a/odb-tests/common/inheritance/polymorphism/test9.hxx b/odb-tests/common/inheritance/polymorphism/test9.hxx new file mode 100644 index 0000000..cdc97ae --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/test9.hxx @@ -0,0 +1,161 @@ +// file : common/inheritance/polymorphism/test9.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST9_HXX +#define TEST9_HXX + +#include +#include +#include + +#include + +// Test polymorphism and readonly classes. +// +#pragma db namespace table("t9_") +namespace test9 +{ + // + // ro_root, rw_base, ro_derived + // + #pragma db object polymorphic readonly + struct ro_root + { + virtual ~ro_root () {} + ro_root () {} + ro_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const ro_root& x, const ro_root& y) {return x.compare (y);} + + #pragma db object + struct rw_base: ro_root + { + rw_base () {} + rw_base (unsigned long i, unsigned long n, const std::string& s) + : ro_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_base)) + return false; + + const rw_base& b (static_cast (r)); + return ro_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object readonly + struct ro_derived: rw_base + { + ro_derived () {} + ro_derived (unsigned long i, unsigned long n, const std::string& s) + : rw_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const ro_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_derived)) + return false; + + const ro_derived& d (static_cast (r)); + return rw_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; + + // + // rw_root, ro_base, rw_derived + // + #pragma db object polymorphic + struct rw_root + { + virtual ~rw_root () {} + rw_root () {} + rw_root (unsigned long i, unsigned long n): id (i), num (n) {} + + #pragma db id + unsigned long id; + + unsigned long num; + std::vector strs; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_root)) + return false; + + return id == r.id && num == r.num && strs == r.strs; + } + }; + + inline bool + operator== (const rw_root& x, const rw_root& y) {return x.compare (y);} + + #pragma db object readonly + struct ro_base: rw_root + { + ro_base () {} + ro_base (unsigned long i, unsigned long n, const std::string& s) + : rw_root (i, n), str (s) {} + + std::string str; + std::vector nums; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (ro_base)) + return false; + + const ro_base& b (static_cast (r)); + return rw_root::compare (r, false) && str == b.str && nums == b.nums; + } + }; + + #pragma db object + struct rw_derived: ro_base + { + rw_derived () {} + rw_derived (unsigned long i, unsigned long n, const std::string& s) + : ro_base (i, n, s), dnum (n + 1), dstr (s + 'd') {} + + unsigned long dnum; + std::string dstr; + + virtual bool + compare (const rw_root& r, bool tc = true) const + { + if (tc && typeid (r) != typeid (rw_derived)) + return false; + + const rw_derived& d (static_cast (r)); + return ro_base::compare (r, false) && dnum == d.dnum && dstr == d.dstr; + } + }; +} + +#endif // TEST9_HXX diff --git a/odb-tests/common/inheritance/polymorphism/testscript b/odb-tests/common/inheritance/polymorphism/testscript new file mode 100644 index 0000000..89e5726 --- /dev/null +++ b/odb-tests/common/inheritance/polymorphism/testscript @@ -0,0 +1,80 @@ +# file : common/inheritance/polymorphism/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + base pre_persist 1 const + base post_persist 1 const + derived pre_persist 2 const + derived post_persist 2 const + base pre_load 0 + base post_load 1 + derived pre_load 0 const + derived post_load 2 const + base pre_load 1 + base post_load 1 + derived pre_load 2 const + derived post_load 2 const + base pre_load 1 + base post_load 1 + derived pre_load 2 const + derived post_load 2 const + base pre_update 1 const + base post_update 1 const + derived pre_update 2 const + derived post_update 2 const + base pre_load 0 + base post_load 1 + derived pre_load 0 const + derived post_load 2 const + base pre_erase 1 const + base post_erase 1 const + derived pre_erase 2 const + derived post_erase 2 const + derived pre_persist 3 const + derived post_persist 3 const + derived pre_persist 4 const + derived post_persist 4 const + derived pre_load 0 const + derived pre_load 0 const + derived post_load 4 const + derived post_load 3 const + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql-schema.testscript + + for s: $schemas + cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd + end; + + $* ($multi ? 'mysql' : ) $mysql_options +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql-schema.testscript + + for s: $schemas + $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql + end; + + $* ($multi ? 'pgsql' : ) $pgsql_options +} diff --git a/odb-tests/common/inheritance/reuse/buildfile b/odb-tests/common/inheritance/reuse/buildfile new file mode 100644 index 0000000..b82439a --- /dev/null +++ b/odb-tests/common/inheritance/reuse/buildfile @@ -0,0 +1,41 @@ +# file : common/inheritance/reuse/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_r_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/inheritance/reuse/driver.cxx b/odb-tests/common/inheritance/reuse/driver.cxx new file mode 100644 index 0000000..e6122bb --- /dev/null +++ b/odb-tests/common/inheritance/reuse/driver.cxx @@ -0,0 +1,237 @@ +// file : common/inheritance/reuse/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test reuse object inheritance. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + base b; + b.comp_.bools.push_back (true); + b.comp_.obools.push_back (true); + b.comp_.num = 10; + b.comp_.str = "comp bbb"; + b.comp_.nums.push_back (101); + b.comp_.nums.push_back (102); + b.comp_.onums.push_back (101); + b.comp_.onums.push_back (102); + b.num_ = 0; + b.str_ = "bbb"; + b.strs_.push_back ("bbb one"); + b.strs_.push_back ("bbb two"); + b.ostrs_.push_back ("bbb one"); + b.ostrs_.push_back ("bbb two"); + + object1 o1; + o1.comp_.bools.push_back (false); + o1.comp_.obools.push_back (false); + o1.comp_.num = 11; + o1.comp_.str = "comp o1o1o1"; + o1.comp_.nums.push_back (111); + o1.comp_.nums.push_back (112); + o1.comp_.onums.push_back (111); + o1.comp_.onums.push_back (112); + static_cast (o1).num_ = 1; + o1.num1_ = 21; + o1.str_ = "base o1o1o1"; + o1.strs_.push_back ("base o1o1o1 one"); + o1.strs_.push_back ("base o1o1o1 two"); + o1.ostrs_.push_back ("base o1o1o1 one"); + o1.ostrs_.push_back ("base o1o1o1 two"); + + object2 o2; + o2.comp_.bools.push_back (true); + o2.comp_.bools.push_back (false); + o2.comp_.obools.push_back (true); + o2.comp_.obools.push_back (false); + o2.comp_.num = 12; + o2.comp_.str = "comp o2o2o2"; + o2.comp_.nums.push_back (121); + o2.comp_.nums.push_back (122); + o2.comp_.onums.push_back (121); + o2.comp_.onums.push_back (122); + o2.num_ = 2; + static_cast (o2).str_ = "base o2o2o2"; + o2.str_ = "o2o2o2"; + o2.strs_.push_back ("base o2o2o2 one"); + o2.strs_.push_back ("base o2o2o2 two"); + o2.ostrs_.push_back ("base o2o2o2 one"); + o2.ostrs_.push_back ("base o2o2o2 two"); + + object3 o3; + o3.comp_.bools.push_back (false); + o3.comp_.bools.push_back (false); + o3.comp_.obools.push_back (false); + o3.comp_.obools.push_back (false); + o3.comp_.num = 13; + o3.comp_.str = "comp o3o3o3"; + o3.comp_.nums.push_back (131); + o3.comp_.nums.push_back (132); + o3.comp_.onums.push_back (131); + o3.comp_.onums.push_back (132); + o3.num_ = 3; + o3.str_ = "base o3o3o3"; + o3.strs_.push_back ("base o3o3o3 one"); + o3.strs_.push_back ("base o3o3o3 two"); + o3.ostrs_.push_back ("base o3o3o3 one"); + o3.ostrs_.push_back ("base o3o3o3 two"); + + reference r; + r.o1_ = &o1; + + empty_object e; + e.comp_.bools.push_back (true); + e.comp_.bools.push_back (true); + e.comp_.obools.push_back (true); + e.comp_.obools.push_back (true); + e.comp_.num = 14; + e.comp_.str = "comp eee"; + e.comp_.nums.push_back (141); + e.comp_.nums.push_back (142); + e.comp_.onums.push_back (141); + e.comp_.onums.push_back (142); + e.num_ = 4; + e.str_ = "base eee"; + e.strs_.push_back ("base eee one"); + e.strs_.push_back ("base eee two"); + e.ostrs_.push_back ("base eee one"); + e.ostrs_.push_back ("base eee two"); + + // persist + // + { + transaction t (db->begin ()); + db->persist (b); + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (r); + db->persist (e); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr lb (db->load (b.id_)); + unique_ptr lo1 (db->load (o1.id_)); + unique_ptr lo2 (db->load (o2.id_)); + unique_ptr lo3 (db->load (o3.id_)); + unique_ptr le (db->load (e.id_)); + unique_ptr lr (db->load (r.id_)); + t.commit (); + + assert (b == *lb); + assert (o1 == *lo1); + assert (o2 == *lo2); + assert (o3 == *lo3); + assert (lr->o1_->id_ == r.o1_->id_); + assert (e == *le); + + delete lr->o1_; + } + + // update + // + { + transaction t (db->begin ()); + db->update (b); + db->update (o1); + db->update (o2); + db->update (o3); + db->update (r); + db->update (e); + t.commit (); + } + + // query + // + { + typedef odb::query b_query; + typedef odb::query o1_query; + typedef odb::query o2_query; + typedef odb::query r_query; + + typedef odb::result r_result; + + transaction t (db->begin ()); + + assert (!db->query (b_query::comp.num == 10).empty ()); + assert (!db->query (o1_query::num1 == 21).empty ()); + assert (!db->query (o2_query::num == 2).empty ()); + + // Query condition with hidden members. + // + assert ( + !db->query (o2_query::base::str == "base o2o2o2").empty ()); + + // Query condition with referenced composite member in base class. + // + { + r_result r (db->query (r_query::o1->comp.num == 11)); + assert (!r.empty ()); + delete r.begin ()->o1_; + } + + t.commit (); + } + + // views + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::num == o2.num_)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); + assert (++i == r.end ()); + + t.commit (); + } + + // erase + // + { + transaction t (db->begin ()); + db->erase (b); + db->erase (o1); + db->erase (o2); + db->erase (o3); + db->erase (r); + db->erase (e); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/inheritance/reuse/test.hxx b/odb-tests/common/inheritance/reuse/test.hxx new file mode 100644 index 0000000..48f474f --- /dev/null +++ b/odb-tests/common/inheritance/reuse/test.hxx @@ -0,0 +1,163 @@ +// file : common/inheritance/reuse/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include + +#pragma db value +struct comp_base +{ + std::vector bools; + odb::vector obools; + + bool + operator== (const comp_base& y) const + { + return bools == y.bools && obools == y.obools; + } +}; + +#pragma db value +struct comp: comp_base +{ + unsigned int num; + std::string str; + + std::vector nums; + odb::vector onums; + + bool + operator== (const comp& y) const + { + return + static_cast (*this) == y && + num == y.num && + str == y.str && + nums == y.nums && + onums == y.onums; + } +}; + +#pragma db object abstract +struct abstract_base +{ + comp comp_; + + unsigned int num_; + std::string str_; + + std::vector strs_; + odb::vector ostrs_; + + bool + operator== (const abstract_base& y) const + { + return + comp_ == y.comp_ && + num_ == y.num_ && + str_ == y.str_ && + strs_ == y.strs_ && + ostrs_ == y.ostrs_; + } +}; + +#pragma db object +struct base: abstract_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const base& y) const + { + return id_ == y.id_ && static_cast (*this) == y; + } +}; + +#pragma db object +struct object1: base +{ + unsigned int num1_; + + bool + operator== (const object1& y) const + { + return static_cast (*this) == y && num1_ == y.num1_; + } +}; + +#pragma db object +struct object2: base +{ + #pragma db column("derived_str") + std::string str_; + + bool + operator== (const object2& y) const + { + return static_cast (*this) == y && str_ == y.str_; + } +}; + +// Reference to derived object. +// +#pragma db object +struct reference +{ + #pragma db id auto + unsigned long id_; + + object1* o1_; +}; + +// Multiple inheritance. +// +#pragma db object abstract +struct id_base +{ + #pragma db id auto + unsigned long id_; + + bool + operator== (const id_base& y) const + { + return id_ == y.id_; + } +}; + +#pragma db object +struct object3: abstract_base, id_base +{ + bool + operator== (const object3& y) const + { + return + static_cast (*this) == y && + static_cast (*this) == y; + } +}; + +// Empty derived object. +// +#pragma db object +struct empty_object: base +{ +}; + +// View based on the derived object. +// +#pragma db view object(object2) +struct object2_view +{ + unsigned int num; // from abstract_base + unsigned long id; // from base + std::string str; // from object2, hides one from abstract_base +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/inheritance/reuse/testscript b/odb-tests/common/inheritance/reuse/testscript new file mode 100644 index 0000000..995b3f5 --- /dev/null +++ b/odb-tests/common/inheritance/reuse/testscript @@ -0,0 +1,33 @@ +# file : common/inheritance/reuse/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/inheritance/transient/buildfile b/odb-tests/common/inheritance/transient/buildfile new file mode 100644 index 0000000..1961abc --- /dev/null +++ b/odb-tests/common/inheritance/transient/buildfile @@ -0,0 +1,41 @@ +# file : common/inheritance/transient/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix inhrt_t_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/inheritance/transient/driver.cxx b/odb-tests/common/inheritance/transient/driver.cxx new file mode 100644 index 0000000..1caae6c --- /dev/null +++ b/odb-tests/common/inheritance/transient/driver.cxx @@ -0,0 +1,80 @@ +// file : common/inheritance/transient/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transient inheritance of objects, composite value types, and views. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + object o; + o.num = 1; + o.str = "abc"; + o.strs.push_back ("abc 1"); + o.strs.push_back ("abc 2"); + o.c.num = 11; + o.c.str = "comp abc"; + o.c.nums.push_back (111); + o.c.nums.push_back (112); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + // view + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::id == o.id_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == o.num && i->str == o.str); + assert (++i == r.end ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/inheritance/transient/test.hxx b/odb-tests/common/inheritance/transient/test.hxx new file mode 100644 index 0000000..394ee8f --- /dev/null +++ b/odb-tests/common/inheritance/transient/test.hxx @@ -0,0 +1,60 @@ +// file : common/inheritance/transient/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +struct object; + +struct base +{ + int n; + std::vector v; + object* p; +}; + +#pragma db value +struct comp: base +{ + unsigned int num; + std::string str; + std::vector nums; + + bool + operator== (const comp& y) const + { + return num == y.num && str == y.str && nums == y.nums; + } +}; + +#pragma db object +struct object: base +{ + #pragma db id auto + unsigned int id_; + + unsigned int num; + std::string str; + std::vector strs; + comp c; + + bool + operator== (const object& y) const + { + return num == y.num && str == y.str && strs == y.strs && c == y.c; + } +}; + +#pragma db view object(object) +struct view: base +{ + unsigned int num; + std::string str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/inheritance/transient/testscript b/odb-tests/common/inheritance/transient/testscript new file mode 100644 index 0000000..bce91de --- /dev/null +++ b/odb-tests/common/inheritance/transient/testscript @@ -0,0 +1,33 @@ +# file : common/inheritance/transient/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/inverse/buildfile b/odb-tests/common/inverse/buildfile new file mode 100644 index 0000000..63fa1cb --- /dev/null +++ b/odb-tests/common/inverse/buildfile @@ -0,0 +1,42 @@ +# file : common/inverse/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_inverse_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/inverse/driver.cxx b/odb-tests/common/inverse/driver.cxx new file mode 100644 index 0000000..842438e --- /dev/null +++ b/odb-tests/common/inverse/driver.cxx @@ -0,0 +1,502 @@ +// file : common/inverse/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test bidirectional relationships with inverse sides. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test raw pointers. + // + { + using namespace test1; + + obj1_ptr o1_1 (new obj1); + obj1_ptr o1_2 (new obj1); + obj2_ptr o2 (new obj2); + obj3_ptr o3_1 (new obj3); + obj3_ptr o3_2 (new obj3); + obj4_ptr o4_1 (new obj4); + obj4_ptr o4_2 (new obj4); + obj5_ptr o5_1 (new obj5); + obj5_ptr o5_2 (new obj5); + obj5_ptr o5_3 (new obj5); + obj5_ptr o5_4 (new obj5); + + o1_1->id = "obj1 1"; + o1_1->o2 = o2; + o1_1->o3.insert (o3_1); + o1_1->o3.insert (o3_2); + o1_1->o4 = o4_1; + o1_1->o5.insert (o5_1); + o1_1->o5.insert (o5_2); + + o1_2->id = "obj1 2"; + o1_2->o2 = 0; + o1_2->o3.clear (); + o1_2->o4 = o4_2; + o1_2->o5.insert (o5_3); + o1_2->o5.insert (o5_4); + + o2->str = "obj2"; + o2->o1 = o1_1; + + o3_1->str = "obj3 1"; + o3_1->o1 = o1_1; + + o3_2->str = "obj3 2"; + o3_2->o1 = o1_1; + + o4_1->str = "obj4 1"; + o4_1->o1.insert (o1_1); + + o4_2->str = "obj4 2"; + o4_2->o1.insert (o1_2); + + o5_1->str = "obj5 1"; + o5_1->o1.insert (o1_1); + + o5_2->str = "obj5 2"; + o5_2->o1.insert (o1_1); + + o5_3->str = "obj5 3"; + o5_3->o1.insert (o1_2); + + o5_4->str = "obj5 4"; + o5_4->o1.insert (o1_2); + + // persist + // + { + transaction t (db->begin ()); + + // objN come before obj1 to get object id assigned. + // + db->persist (o5_1); + db->persist (o5_2); + db->persist (o5_3); + db->persist (o5_4); + db->persist (o4_1); + db->persist (o4_2); + db->persist (o3_1); + db->persist (o3_2); + db->persist (o2); + db->persist (o1_1); + db->persist (o1_2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + obj2_ptr x2 (db->load (o2->id)); + obj3_ptr x3_1 (db->load (o3_1->id)); + obj3_ptr x3_2 (db->load (o3_2->id)); + obj4_ptr x4_1 (db->load (o4_1->id)); + obj4_ptr x4_2 (db->load (o4_2->id)); + obj5_ptr x5_1 (db->load (o5_1->id)); + obj5_ptr x5_2 (db->load (o5_2->id)); + obj5_ptr x5_3 (db->load (o5_3->id)); + obj5_ptr x5_4 (db->load (o5_4->id)); + t.commit (); + + assert (x2->str == o2->str); + assert (x2->o1->id == o1_1->id); + assert (x2->o1->o2 == x2); + + assert (x3_1->str == o3_1->str); + assert (x3_2->str == o3_2->str); + assert (x3_1->o1 == x3_2->o1); + assert (x3_1->o1->id == o1_1->id); + assert (x3_1->o1->o3.find (x3_1) != x3_1->o1->o3.end ()); + assert (x3_1->o1->o3.find (x3_2) != x3_1->o1->o3.end ()); + + assert (x4_1->str == o4_1->str); + assert (x4_2->str == o4_2->str); + assert ((*x4_1->o1.begin ())->id == o1_1->id); + assert ((*x4_2->o1.begin ())->id == o1_2->id); + assert ((*x4_1->o1.begin ())->o4 == x4_1); + assert ((*x4_2->o1.begin ())->o4 == x4_2); + + assert (x5_1->str == o5_1->str); + assert (x5_2->str == o5_2->str); + assert ((*x5_1->o1.begin ())->id == o1_1->id); + assert ((*x5_2->o1.begin ())->id == o1_1->id); + assert ((*x5_3->o1.begin ())->id == o1_2->id); + assert ((*x5_4->o1.begin ())->id == o1_2->id); + assert ((*x5_1->o1.begin ())->o5.find (x5_1) != + (*x5_1->o1.begin ())->o5.end ()); + assert ((*x5_2->o1.begin ())->o5.find (x5_2) != + (*x5_2->o1.begin ())->o5.end ()); + assert ((*x5_3->o1.begin ())->o5.find (x5_3) != + (*x5_3->o1.begin ())->o5.end ()); + assert ((*x5_4->o1.begin ())->o5.find (x5_4) != + (*x5_4->o1.begin ())->o5.end ()); + + delete *x4_1->o1.begin (); + delete *x4_2->o1.begin (); + } + + // query + // + { + // one(i)-to-one + // + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::o1->id == "obj1 1")); + assert (!r.empty ()); + assert (r.begin ()->id == o2->id); + assert (r.begin ()->o1->id == o1_1->id); + assert (size (r) == 1); + + t.commit (); + } + + { + // one(i)-to-many + // + typedef odb::query query; + typedef odb::result result; + + session s; + transaction t (db->begin ()); + + result r (db->query (query::o1->id == "obj1 1")); + size_t n (0); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + assert (i->id == o3_1->id || i->id == o3_2->id); + assert (i->o1->id == o1_1->id); + n++; + } + + assert (n == 2); + + t.commit (); + } + + delete o1_1; + delete o1_2; + } + + // Test shared_ptr/weak_ptr. + // + { + using namespace test2; + + obj1_ptr o1_1 (new obj1); + obj1_ptr o1_2 (new obj1); + obj2_ptr o2 (new obj2); + obj3_ptr o3_1 (new obj3); + obj3_ptr o3_2 (new obj3); + obj4_ptr o4 (new obj4); + obj5_ptr o5_1 (new obj5); + obj5_ptr o5_2 (new obj5); + + o1_1->id = "obj1 1"; + o1_1->o2 = o2; + o1_1->o3.push_back (o3_1); + o1_1->o3.push_back (o3_2); + o1_1->o4 = o4; + o1_1->o5.push_back (o5_1); + o1_1->o5.push_back (o5_2); + + o1_2->id = "obj1 2"; + o1_2->o2 = obj2_ptr (); + o1_2->o3.clear (); + o1_2->o4 = o4; + o1_2->o5.push_back (o5_1); + + o2->str = "obj2"; + o2->o1 = o1_1; + + o3_1->str = "obj3 1"; + o3_1->o1 = o1_1; + + o3_2->str = "obj3 3"; + o3_2->o1 = o1_1; + + o4->str = "obj4"; + o4->o1.push_back (o1_1); + o4->o1.push_back (o1_2); + + o5_1->str = "obj5 1"; + o5_1->o1.push_back (o1_1); + o5_1->o1.push_back (o1_2); + + o5_2->str = "obj5 2"; + o5_2->o1.push_back (o1_1); + + // persist + // + { + transaction t (db->begin ()); + + // objN come before obj1 to get object id assigned. + // + db->persist (o5_1); + db->persist (o5_2); + db->persist (o4); + db->persist (o3_1); + db->persist (o3_2); + db->persist (o2); + db->persist (o1_1); + db->persist (o1_2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + obj2_ptr x2 (db->load (o2->id)); + obj3_ptr x3_1 (db->load (o3_1->id)); + obj3_ptr x3_2 (db->load (o3_2->id)); + obj4_ptr x4 (db->load (o4->id)); + obj5_ptr x5_1 (db->load (o5_1->id)); + obj5_ptr x5_2 (db->load (o5_2->id)); + t.commit (); + + assert (x2->str == o2->str); + assert (x2->o1.lock ()->id == o1_1->id); + assert (x2->o1.lock ()->o2 == x2); + + assert (x3_1->str == o3_1->str); + assert (x3_2->str == o3_2->str); + assert (x3_1->o1.lock () == x3_2->o1.lock ()); + assert (x3_1->o1.lock ()->id == o1_1->id); + assert (x3_1->o1.lock ()->o3[0] == x3_1); + assert (x3_1->o1.lock ()->o3[1] == x3_2); + + { + assert (x4->str == o4->str); + + obj1_ptr t1 (x4->o1[0].lock ()), t2 (x4->o1[1].lock ()); + + assert (t1->id == o1_1->id || t2->id == o1_1->id); + assert (t1->id == o1_2->id || t2->id == o1_2->id); + } + + { + assert (x5_1->str == o5_1->str); + assert (x5_2->str == o5_2->str); + + obj1_ptr t1 (x5_1->o1[0].lock ()), t2 (x5_1->o1[1].lock ()), + t3 (x5_2->o1[0].lock ()); + + assert (t1->id == o1_1->id || t2->id == o1_1->id); + assert (t1->id == o1_2->id || t2->id == o1_2->id); + assert (t3->id == o1_1->id); + } + } + } + + // Test inverse based on points_to. + // + { + using namespace test3; + + { + obj1 o1 (1, 2); + o1.o2 = new obj2; + + { + transaction t (db->begin ()); + + o1.o2->o1 = db->persist (o1); + db->persist (o1.o2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr p (db->load (o1.id)); + assert (p->o2->id == o1.o2->id); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + unique_ptr p (db->query_one (query::o2->o1.i == o1.id.i && + query::o2->o1.j == o1.id.j)); + assert (p->o2->id == o1.o2->id); + + t.commit (); + } + } + + { + obj3 o3; + o3.o4.push_back (new obj4); + o3.o4.push_back (new obj4); + + { + transaction t (db->begin ()); + + o3.o4[0]->o3 = o3.o4[1]->o3 = db->persist (o3); + db->persist (o3.o4[0]); + db->persist (o3.o4[1]); + + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr p (db->load (o3.id)); + assert (p->o4[0]->id == o3.o4[0]->id); + assert (p->o4[1]->id == o3.o4[1]->id); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + unique_ptr p (db->query_one (query::id == o3.id)); + assert (p->o4[0]->id == o3.o4[0]->id); + assert (p->o4[1]->id == o3.o4[1]->id); + + t.commit (); + } + } + } + + // Test inverse with nested data members. + // + { + using namespace test4; + + { + obj1 o1; + o1.o2 = new obj2; + + { + transaction t (db->begin ()); + + o1.o2->id.i = db->persist (o1); + o1.o2->id.j = 123; + db->persist (o1.o2); + + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr p (db->load (o1.id)); + assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + unique_ptr p (db->query_one ( + query::o2->id.i == o1.o2->id.i && + query::o2->id.j == o1.o2->id.j)); + assert (p->o2->id.i == o1.o2->id.i && p->o2->id.j == o1.o2->id.j); + + t.commit (); + } + } + + { + obj3 o3; + o3.o4.push_back (new obj4); + o3.o4.push_back (new obj4); + + { + transaction t (db->begin ()); + + o3.o4[0]->id.i = o3.o4[1]->id.i = db->persist (o3); + o3.o4[0]->id.j = 123; + o3.o4[1]->id.j = 234; + db->persist (o3.o4[0]); + db->persist (o3.o4[1]); + + t.commit (); + } + + { + transaction t (db->begin ()); + + unique_ptr p (db->load (o3.id)); + assert (p->o4[0]->id.i == o3.o4[0]->id.i && + p->o4[0]->id.j == o3.o4[0]->id.j); + + assert (p->o4[1]->id.i == o3.o4[1]->id.i && + p->o4[1]->id.j == o3.o4[1]->id.j); + + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + + unique_ptr p (db->query_one (query::id == o3.id)); + + assert (p->o4[0]->id.i == o3.o4[0]->id.i && + p->o4[0]->id.j == o3.o4[0]->id.j); + + assert (p->o4[1]->id.i == o3.o4[1]->id.i && + p->o4[1]->id.j == o3.o4[1]->id.j); + + t.commit (); + } + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/inverse/test.hxx b/odb-tests/common/inverse/test.hxx new file mode 100644 index 0000000..a7b8678 --- /dev/null +++ b/odb-tests/common/inverse/test.hxx @@ -0,0 +1,391 @@ +// file : common/inverse/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include + +#include + +// Test raw pointers. +// +#pragma db namespace table("t1_") +namespace test1 +{ + struct obj1; + struct obj2; + struct obj3; + struct obj4; + struct obj5; + + typedef obj1* obj1_ptr; + typedef obj2* obj2_ptr; + typedef obj3* obj3_ptr; + typedef obj4* obj4_ptr; + typedef obj5* obj5_ptr; + + typedef std::set obj1_ptr_set; + typedef std::set obj3_ptr_set; + typedef std::set obj5_ptr_set; + + #pragma db object + struct obj1 + { + obj1 (): o2 (0), o4 (0) {} + ~obj1 (); + + #pragma db id + std::string id; + + obj2_ptr o2; + + #pragma db id_column("obj1_id") value_column("obj3_id") + obj3_ptr_set o3; + + obj4_ptr o4; + + obj5_ptr_set o5; + }; + + #pragma db object + struct obj2 + { + #pragma db id auto + int id; + + // one-to-one + // + #pragma db inverse(o2) + obj1_ptr o1; + + std::string str; + }; + + #pragma db object + struct obj3 + { + std::string str; + + // one(i)-to-many + // + #pragma db inverse (o3) + obj1_ptr o1; + + #pragma db id auto + int id; + }; + + #pragma db object + struct obj4 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + obj1_ptr_set o1; + }; + + #pragma db object + struct obj5 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + obj1_ptr_set o1; + }; + + inline obj1:: + ~obj1 () + { + delete o2; + for (obj3_ptr_set::iterator i (o3.begin ()); i != o3.end (); ++i) + delete *i; + delete o4; + for (obj5_ptr_set::iterator i (o5.begin ()); i != o5.end (); ++i) + delete *i; + } +} + +// Test shared_ptr/weak_ptr. +// +#pragma db namespace table("t2_") +namespace test2 +{ + using std::shared_ptr; + using std::weak_ptr; + + struct obj1; + struct obj2; + struct obj3; + struct obj4; + struct obj5; + + typedef shared_ptr obj1_ptr; + typedef shared_ptr obj2_ptr; + typedef shared_ptr obj3_ptr; + typedef shared_ptr obj4_ptr; + typedef shared_ptr obj5_ptr; + + typedef weak_ptr obj1_wptr; + + typedef std::vector obj1_wptr_vec; + typedef std::vector obj3_ptr_vec; + typedef std::vector obj5_ptr_vec; + + #pragma db object pointer(obj1_ptr) + struct obj1 + { + #pragma db id + std::string id; + + obj2_ptr o2; + + #pragma db id_column("obj1_id") value_column("obj3_id") + obj3_ptr_vec o3; + + obj4_ptr o4; + obj5_ptr_vec o5; + }; + + #pragma db object pointer(obj2_ptr) + struct obj2 + { + #pragma db id auto + int id; + + std::string str; + + // one(i)-to-one + // + #pragma db inverse(o2) + obj1_wptr o1; + }; + + #pragma db object pointer(obj3_ptr) + struct obj3 + { + #pragma db id auto + int id; + + std::string str; + + // one(i)-to-many + // + #pragma db inverse (o3) + obj1_wptr o1; + }; + + #pragma db object pointer(obj4_ptr) + struct obj4 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-one + // + #pragma db inverse (o4) + obj1_wptr_vec o1; + }; + + #pragma db object pointer(obj5_ptr) + struct obj5 + { + #pragma db id auto + int id; + + std::string str; + + // many(i)-to-many + // + #pragma db inverse (o5) + obj1_wptr_vec o1; + }; +} + +// Test inverse based on points_to. +// +#pragma db namespace table("t3_") +namespace test3 +{ + // Inverse pointer. + // + #pragma db value + struct comp + { + int i; + int j; + }; + + inline bool + operator< (comp x, comp y) {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + struct obj2; + + #pragma db object + struct obj1 + { + #pragma db id + comp id; + + #pragma db inverse(o1) + obj2* o2; + + obj1 (int i = 0, int j = 0): o2 (0) {id.i = i; id.j = j;} + ~obj1 (); + }; + + #pragma db object + struct obj2 + { + #pragma db id auto + int id; + + #pragma db points_to(obj1) + comp o1; + +#ifndef ODB_DATABASE_MYSQL + #pragma db member(o1) on_delete(cascade) +#endif + }; + + inline obj1:: + ~obj1 () {delete o2;} + + // Inverse container of pointers. + // + struct obj4; + + #pragma db object + struct obj3 + { + #pragma db id auto + int id; + + #pragma db inverse(o3) + std::vector o4; + + ~obj3 (); + }; + + #pragma db object + struct obj4 + { + #pragma db id auto + int id; + + #pragma db points_to(obj3) + int o3; + }; + + inline obj3:: + ~obj3 () + { + for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) + delete *i; + } +}; + +// Test inverse with nested data members. +// +#pragma db namespace table("t4_") +namespace test4 +{ + // Inverse pointer. + // + struct obj1; + struct obj2; + + #pragma db value + struct obj2_id + { + #pragma db points_to(obj1) + int i; + int j; + }; + + inline bool + operator< (obj2_id x, obj2_id y) + {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + #pragma db object + struct obj1 + { + #pragma db id auto + int id; + + #pragma db inverse(id.i) + obj2* o2; + + obj1 (): o2 (0) {} + ~obj1 (); + }; + + #pragma db object + struct obj2 + { + #pragma db id + obj2_id id; + }; + + inline obj1:: + ~obj1 () {delete o2;} + + // Inverse container of pointers. + // + struct obj3; + struct obj4; + + #pragma db value + struct obj4_id + { + #pragma db points_to(obj3) + int i; + int j; + }; + + inline bool + operator< (obj4_id x, obj4_id y) + {return x.i < y.i || (x.i == y.i && x.j < y.j);} + + #pragma db object + struct obj3 + { + #pragma db id auto + int id; + + #pragma db inverse(id.i) + std::vector o4; + + ~obj3 (); + }; + + #pragma db object + struct obj4 + { + #pragma db id + obj4_id id; + }; + + inline obj3:: + ~obj3 () + { + for (std::vector::iterator i (o4.begin ()); i != o4.end (); ++i) + delete *i; + } +}; +#endif // TEST_HXX diff --git a/odb-tests/common/inverse/testscript b/odb-tests/common/inverse/testscript new file mode 100644 index 0000000..c2a4e3e --- /dev/null +++ b/odb-tests/common/inverse/testscript @@ -0,0 +1,33 @@ +# file : common/inverse/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/lazy-ptr/buildfile b/odb-tests/common/lazy-ptr/buildfile new file mode 100644 index 0000000..d495d2f --- /dev/null +++ b/odb-tests/common/lazy-ptr/buildfile @@ -0,0 +1,41 @@ +# file : common/lazy-ptr/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix lazy_ptr_ \ + --generate-schema \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/lazy-ptr/driver.cxx b/odb-tests/common/lazy-ptr/driver.cxx new file mode 100644 index 0000000..9a3b324 --- /dev/null +++ b/odb-tests/common/lazy-ptr/driver.cxx @@ -0,0 +1,360 @@ +// file : common/lazy-ptr/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test lazy object pointers. +// + +#include // std::unique_ptr +#include // std::move +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +namespace test2 +{ + cont::cont (unsigned long i) + : id (i) + { + } + + obj_ptr + create (unsigned int id) + { + obj_ptr r (new obj (id)); + return r; + } + + lazy_obj_ptr + create (database& db, unsigned int id) + { + lazy_obj_ptr r (db, id); + return r; + } +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Raw. + // + { + using namespace test1; + + // persist + // + obj* o1 (new obj (1)); + + { + transaction t (db->begin ()); + db->persist (o1); + t.commit (); + } + + unique_ptr c1 (new cont (1)); + unique_ptr c2 (new cont (2)); + + lazy_ptr lo1 (*db, 1); + obj* o2 (new obj (2)); + + obj* o3 (new obj (3)); + obj* o4 (new obj (4)); + + c1->o.push_back (lo1); + c1->o.push_back (o2); + c2->o.push_back (o3); + c2->o.push_back (o4); + + // Test pointer comparison. + // + assert (lazy_ptr () == lazy_ptr ()); + assert (lazy_ptr (o1) != lazy_ptr ()); + assert (lo1 != lazy_ptr ()); + assert (lazy_ptr (o1) == lazy_ptr (o1)); + assert (lo1 == lazy_ptr (*db, o1)); + assert (lo1 != lazy_ptr (*db, o2)); + + delete o1; + + { + transaction t (db->begin ()); + + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (*c1); + db->persist (*c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + unique_ptr c (db->load (1)); + obj* o (db->load (1)); + + // Not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + cont* cl (o->c.load ()); + obj* ol (c->o[0].load ()); + + assert (cl == c.get ()); + assert (ol == o); + + // Test unload/reload. + // + o->c.unload (); + assert (!o->c.loaded ()); + o->c.load (); + assert (o->c.loaded ()); + + t.commit (); + } + } + + // std::unique_ptr + // + { + using namespace test2; + + // persist + // + { + obj_ptr o1 (new obj (1)); + transaction t (db->begin ()); + db->persist (*o1); + t.commit (); + } + + cont_ptr c1 (new cont (1)); + cont_ptr c2 (new cont (2)); + + lazy_obj_ptr lo1 = create (*db, 1); + lo1 = create (*db, 1); + + c1->o = std::move (lo1); + c2->o = create (2); + + { + transaction t (db->begin ()); + + db->persist (*c2->o); + + db->persist (*c1); + db->persist (*c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + cont_ptr c (db->load (1)); + obj* o (db->load (1)); + + // Not loaded. + // + assert (!c->o.loaded ()); + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o.object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + cont* cl (o->c.load ()); + const obj_ptr& ol (c->o.load ()); + + assert (cl == c.get ()); + assert (ol.get () == o); + + t.commit (); + } + + // unload/reload + // + { + // No session. + transaction t (db->begin ()); + cont_ptr c (db->load (1)); + + assert (!c->o.loaded ()); + c->o.load (); + assert (c->o.loaded ()); + c->o.unload (); + assert (!c->o.loaded ()); + c->o.load (); + assert (c->o.loaded ()); + + t.commit (); + } + } + + // Shared pointer from C++11 or TR1. + // + { + using namespace test3; + + // persist + // + shared_ptr c1 (new cont (1)); + + { + transaction t (db->begin ()); + db->persist (c1); + t.commit (); + } + + lazy_shared_ptr lc1 (*db, 1); + shared_ptr c2 (new cont (2)); + + shared_ptr o1 (new obj (1)); + shared_ptr o2 (new obj (2)); + + shared_ptr o3 (new obj (3)); + shared_ptr o4 (new obj (4)); + + o1->c = lc1; + o2->c = lc1; + o3->c = c2; + o4->c = c2; + + // Test pointer comparison. + // + assert (lazy_shared_ptr () == lazy_shared_ptr ()); + assert (lazy_shared_ptr (c1) != lazy_shared_ptr ()); + assert (lc1 != lazy_shared_ptr ()); + assert (lazy_shared_ptr (c1) == lazy_shared_ptr (c1)); + assert (lc1 == lazy_shared_ptr (*db, c1)); + assert (lc1 != lazy_shared_ptr (*db, c2)); + + // Test move constructors. + // + { + lazy_shared_ptr tmp (*db, 1); + lazy_shared_ptr l (std::move (tmp)); + assert (lc1 == l); + } + + { + shared_ptr tmp (c1); + lazy_shared_ptr l (*db, std::move (tmp)); + assert (lc1 == l); + } + + { + transaction t (db->begin ()); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (c2); + + t.commit (); + } + + // load + // + { + session s; + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + shared_ptr o (db->load (1)); + + // Not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + + assert (!o->c.loaded ()); + + // Correct object ids. + // + assert (c->o[0].object_id () == o->id); + assert (o->c.object_id () == c->id); + + // Load. + // + shared_ptr cl (o->c.load ()); + shared_ptr ol (c->o[0].load ()); + + assert (cl == c); + assert (ol == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + transaction t (db->begin ()); + shared_ptr c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + lazy_shared_ptr l (c->o[1].lock ()); + assert (!l.loaded ()); + assert (l.object_id () == c->o[1].object_id ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + shared_ptr ol (c->o[1].load ()); + assert (c->o[1].loaded ()); + ol.reset (); + assert (!c->o[1].loaded ()); + ol = c->o[1].load (); + assert (c->o[1].loaded ()); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/lazy-ptr/test.hxx b/odb-tests/common/lazy-ptr/test.hxx new file mode 100644 index 0000000..f946029 --- /dev/null +++ b/odb-tests/common/lazy-ptr/test.hxx @@ -0,0 +1,147 @@ +// file : common/lazy-ptr/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include + +#include +#include + +// Raw pointer. +// +#pragma db namespace table("t1_") +namespace test1 +{ + using odb::lazy_ptr; + class obj; + + #pragma db object + class cont + { + public: + cont () {} + cont (unsigned long i): id (i) {} + ~cont (); + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db value_not_null + obj_list o; + }; + + #pragma db object + class obj + { + public: + obj () {} + obj (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) not_null + lazy_ptr c; // weak + }; + + inline cont:: + ~cont () + { + for (obj_list::iterator i (o.begin ()); i != o.end (); ++i) + if (obj* p = i->get ()) + delete p; + } +} + +// std::auto_ptr/std::unique_ptr +// +#pragma db namespace table("t2_") +namespace test2 +{ + using odb::lazy_ptr; + + class obj; + class cont; + + typedef std::unique_ptr obj_ptr; + typedef std::unique_ptr cont_ptr; + typedef odb::lazy_unique_ptr lazy_obj_ptr; + + #pragma db object + class cont + { + public: + cont () = default; + cont (unsigned long id); + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_obj_ptr o; + }; + + #pragma db object + class obj + { + public: + obj () = default; + obj (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) not_null + lazy_ptr c; // weak + }; +} + +// shared_ptr +// +#pragma db namespace table("t3_") +namespace test3 +{ + using std::shared_ptr; + using odb::lazy_shared_ptr; + using odb::lazy_weak_ptr; + + class obj; + + #pragma db object pointer(shared_ptr) + class cont + { + public: + cont () {} + cont (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) value_not_null + obj_list o; + }; + + #pragma db object pointer(shared_ptr) + class obj + { + public: + obj () {} + obj (unsigned long i): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db not_null + lazy_shared_ptr c; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/lazy-ptr/testscript b/odb-tests/common/lazy-ptr/testscript new file mode 100644 index 0000000..736fa4c --- /dev/null +++ b/odb-tests/common/lazy-ptr/testscript @@ -0,0 +1,33 @@ +# file : common/lazy-ptr/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/lifecycle/buildfile b/odb-tests/common/lifecycle/buildfile new file mode 100644 index 0000000..b5b2b00 --- /dev/null +++ b/odb-tests/common/lifecycle/buildfile @@ -0,0 +1,40 @@ +# file : common/lifecycle/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix lifecycle_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/lifecycle/driver.cxx b/odb-tests/common/lifecycle/driver.cxx new file mode 100644 index 0000000..a01d5bd --- /dev/null +++ b/odb-tests/common/lifecycle/driver.cxx @@ -0,0 +1,248 @@ +// file : common/lifecycle/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object state transistions. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_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 + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + + // Persistent. + // + { + object o (1); + o.str_ = "value 1"; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + try + { + transaction t (db->begin ()); + db->persist (o); + assert (false); + t.commit (); + } + catch (const object_already_persistent&) + { + } + } + + // Find. + // + { + transaction t (db->begin ()); + + unique_ptr o1 (db->find (1)); + assert (o1.get () != 0 && o1->str_ == "value 1"); + + unique_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 ()); + unique_ptr o (db->load (1)); + assert (o->str_ == "value 1"); + t.commit (); + + try + { + transaction t (db->begin ()); + unique_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. + // + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + 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&) + { + } + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + assert (o->str_ == "value 2"); + t.commit (); + } + + // Update of unmodified object. + // + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + db->update (*o); + t.commit (); + } + + // Transient. + // + { + transaction t (db->begin ()); + unique_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 + { + transaction t (db->begin ()); + unique_ptr o (db->load (1)); + assert (false); + t.commit (); + } + catch (const object_not_persistent&) + { + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/lifecycle/test.hxx b/odb-tests/common/lifecycle/test.hxx new file mode 100644 index 0000000..8d260d2 --- /dev/null +++ b/odb-tests/common/lifecycle/test.hxx @@ -0,0 +1,27 @@ +// file : common/lifecycle/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + std::string str_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/lifecycle/testscript b/odb-tests/common/lifecycle/testscript new file mode 100644 index 0000000..0337bba --- /dev/null +++ b/odb-tests/common/lifecycle/testscript @@ -0,0 +1,33 @@ +# file : common/lifecycle/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/no-id/buildfile b/odb-tests/common/no-id/buildfile new file mode 100644 index 0000000..1a64401 --- /dev/null +++ b/odb-tests/common/no-id/buildfile @@ -0,0 +1,41 @@ +# file : common/no-id/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix no_id_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/no-id/driver.cxx b/odb-tests/common/no-id/driver.cxx new file mode 100644 index 0000000..eee69a5 --- /dev/null +++ b/odb-tests/common/no-id/driver.cxx @@ -0,0 +1,102 @@ +// file : common/no-id/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test persistent classes without id. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + object o1 (1, "aaa"); + object o2 (2, "bbb"); + object o3 (3, "ccc"); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o2); // Ok, since there is no id. + db->persist (o3); + t.commit (); + } + + // Compile errors. + // + { + //db->load (1); + //db->find (1); + //db->update (o1); + //db->erase (1); + } + + typedef odb::query query; + typedef odb::result result; + + // Query. + // + { + transaction t (db->begin ()); + + { + result r (db->query ()); + assert (size (r) == 4); + } + + { + result r (db->query (query::str == "aaa")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->num == 1 && i->str == "aaa"); + object o; + i.load (o); + //i.id (); // Compile-time error. + assert (o.num == 1 && o.str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::num < 3)); + assert (size (r) == 3); + } + + t.commit (); + } + + // Erase (query). + // + { + transaction t (db->begin ()); + assert (db->erase_query (query::num == 2) == 2); + assert (db->erase_query () == 2); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/no-id/test.hxx b/odb-tests/common/no-id/test.hxx new file mode 100644 index 0000000..c5b5c65 --- /dev/null +++ b/odb-tests/common/no-id/test.hxx @@ -0,0 +1,21 @@ +// file : common/no-id/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object no_id +struct object +{ + object () {} + object (unsigned long n, const std::string& s): num (n), str (s) {} + + unsigned long num; + std::string str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/no-id/testscript b/odb-tests/common/no-id/testscript new file mode 100644 index 0000000..5ec57ee --- /dev/null +++ b/odb-tests/common/no-id/testscript @@ -0,0 +1,33 @@ +# file : common/no-id/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/object/buildfile b/odb-tests/common/object/buildfile new file mode 100644 index 0000000..cb56aee --- /dev/null +++ b/odb-tests/common/object/buildfile @@ -0,0 +1,41 @@ +# file : common/object/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix object_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/object/driver.cxx b/odb-tests/common/object/driver.cxx new file mode 100644 index 0000000..1c29417 --- /dev/null +++ b/odb-tests/common/object/driver.cxx @@ -0,0 +1,84 @@ +// file : common/object/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test persistent classes. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test persistent class template instantiation. + // + { + using namespace test1; + + pair_object po; + po.second = "abc"; + + derived d; + d.x = "abc"; + d.n = 123; + + // persist + // + { + transaction t (db->begin ()); + db->persist (po); + db->persist (d); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + unique_ptr po1 (db->load (po.first)); + unique_ptr d1 (db->load (d.id)); + t.commit (); + + assert (po == *po1); + + assert (d.x == d1->x); + assert (d.n == d1->n); + } + + // Test the API confusion. + // + { + transaction t (db->begin ()); + db->update (po); + db->reload (po); + db->erase (po); + + db->query (); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/object/test.hxx b/odb-tests/common/object/test.hxx new file mode 100644 index 0000000..87bac91 --- /dev/null +++ b/odb-tests/common/object/test.hxx @@ -0,0 +1,49 @@ +// file : common/object/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::pair + +#include + +// Test persistent class template instantiation. +// +#pragma db namespace table("t1_") +namespace test1 +{ + typedef std::pair pair_object; + #pragma db object(pair_object) + #pragma db member(pair_object::first) id auto + + #pragma db object abstract + struct base_data + { + #pragma db id auto + unsigned long id; + }; + + template + struct base: base_data + { + T x; + }; + + typedef base base_derived; + #pragma db object(base_derived) abstract + + #pragma db object + struct derived: base_derived + { + int n; + }; + + // Test instantiation in order to "see" id, etc. + // + typedef base int_base; + #pragma db object(int_base) +} + +#endif // TEST_HXX diff --git a/odb-tests/common/object/testscript b/odb-tests/common/object/testscript new file mode 100644 index 0000000..6982409 --- /dev/null +++ b/odb-tests/common/object/testscript @@ -0,0 +1,33 @@ +# file : common/object/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/optimistic/buildfile b/odb-tests/common/optimistic/buildfile new file mode 100644 index 0000000..06af705 --- /dev/null +++ b/odb-tests/common/optimistic/buildfile @@ -0,0 +1,41 @@ +# file : common/optimistic/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_optimistic_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/optimistic/driver.cxx b/odb-tests/common/optimistic/driver.cxx new file mode 100644 index 0000000..6dfec6e --- /dev/null +++ b/odb-tests/common/optimistic/driver.cxx @@ -0,0 +1,300 @@ +// file : common/optimistic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test optimistic concurrency support. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +unsigned long +version (const unique_ptr& db, unsigned long id) +{ + typedef odb::query query; + typedef odb::result result; + + result r (db->query (query::id == id)); + return r.empty () ? 0 : r.begin ()->ver; +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + object o (1); + o.num = 123; + o.str = "abc"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Verify initial version in the instance and database. + // + assert (o.ver == 1); + { + transaction t (db->begin ()); + assert (version (db, 1) == 1); + t.commit (); + } + + object c (o); + o.num++; + o.str += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Verify updated version in the instance and database. + // + assert (o.ver == 2); + { + transaction t (db->begin ()); + assert (version (db, 1) == 2); + t.commit (); + } + + // Verify the data has been updated. + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); + } + + // Try to update using outdated object. + // + c.num--; + c.str += 'z'; + + { + transaction t (db->begin ()); + + try + { + db->update (c); + assert (false); + } + catch (const object_changed&) {} + + // Verify the data hasn't changed. + // + unique_ptr o1 (db->load (1)); + assert (o1->ver == 2 && o1->num == 124 && o1->str == "abcd"); + + // Reload the object. + // + db->reload (c); + assert (c.ver == 2 && c.num == 124); + + // Check that we don't reload an object that is up-to-date. + // + c.num--; + db->reload (c); + assert (c.ver == 2 && c.num == 123); + + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + // Try to update deleted object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + assert (false); + } + catch (const object_not_persistent&) + { + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Optimistic delete of objects with container requires + // extra logic. Test it here. + // + { + container o ("abc"); + o.nums.push_back (1); + o.nums.push_back (2); + o.nums.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + container c (o); + o.nums.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + // Verify the container data hasn't changed. + // + unique_ptr o1 (db->load ("abc")); + assert (o1->nums.size () == 2 && o1->nums[0] == 1 && o1->nums[1] == 2); + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test optimistic class inheritance. This is a shortened version + // of the object test. + // + { + derived o; + o.num = 123; + o.str = "abc"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + derived c (o); + o.num++; + o.str += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Try to update using outdated object. + // + c.num--; + c.str += 'z'; + + { + transaction t (db->begin ()); + + try + { + db->update (c); + assert (false); + } + catch (const object_changed&) {} + + // Reload the object. + // + db->reload (c); + assert (c.ver == 2 && c.num == 124); + + t.commit (); + } + + // Try to delete using an outdated object. + // + { + transaction t (db->begin ()); + + try + { + db->update (o); + db->erase (c); + assert (false); + } + catch (const object_changed&) {} + + t.commit (); + } + + // Try to delete using an up-to-date object. + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/optimistic/test.hxx b/odb-tests/common/optimistic/test.hxx new file mode 100644 index 0000000..fcefa3d --- /dev/null +++ b/odb-tests/common/optimistic/test.hxx @@ -0,0 +1,76 @@ +// file : common/optimistic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db object optimistic +struct object +{ + object (): ver (123) {} + object (unsigned long id): id_ (id), ver (123) {} + + #pragma db id + unsigned long id_; + + #pragma db version + unsigned long ver; + + unsigned int num; + std::string str; +}; + +#pragma db view object(object) +struct object_version +{ + unsigned long ver; +}; + +// Optimistic class with a container. +// +#pragma db object optimistic +struct container +{ + container (): ver (123) {} + container (const std::string& id): id_ (id), ver (123) {} + + #pragma db id + std::string id_; + + #pragma db version + unsigned long ver; + + std::vector nums; +}; + +// Optimistic class inheritance. +// +#pragma db object abstract optimistic +struct base +{ + base (): ver (123) {} + + #pragma db id auto + unsigned long id_; + + #pragma db version + const unsigned long ver; + + std::string str; + + #pragma db readonly + std::string ro; +}; + +#pragma db object +struct derived: base +{ + unsigned int num; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/optimistic/testscript b/odb-tests/common/optimistic/testscript new file mode 100644 index 0000000..9ebafb2 --- /dev/null +++ b/odb-tests/common/optimistic/testscript @@ -0,0 +1,33 @@ +# file : common/optimistic/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/pragma/buildfile b/odb-tests/common/pragma/buildfile new file mode 100644 index 0000000..a2eeaa0 --- /dev/null +++ b/odb-tests/common/pragma/buildfile @@ -0,0 +1,39 @@ +# file : common/pragma/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pragma_ + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/pragma/driver.cxx b/odb-tests/common/pragma/driver.cxx new file mode 100644 index 0000000..a9cc6e0 --- /dev/null +++ b/odb-tests/common/pragma/driver.cxx @@ -0,0 +1,27 @@ +// file : common/pragma/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test #pragma db parsing. +// + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main () +{ +} diff --git a/odb-tests/common/pragma/test.hxx b/odb-tests/common/pragma/test.hxx new file mode 100644 index 0000000..6877e73 --- /dev/null +++ b/odb-tests/common/pragma/test.hxx @@ -0,0 +1,40 @@ +// file : common/template/test.hxx +// 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/odb-tests/common/pragma/testscript b/odb-tests/common/pragma/testscript new file mode 100644 index 0000000..089f7a1 --- /dev/null +++ b/odb-tests/common/pragma/testscript @@ -0,0 +1,31 @@ +# file : common/include/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* &!odb-test.db +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/prepared/buildfile b/odb-tests/common/prepared/buildfile new file mode 100644 index 0000000..4006a4f --- /dev/null +++ b/odb-tests/common/prepared/buildfile @@ -0,0 +1,43 @@ +# file : common/prepared/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix prepared_ \ + --generate-schema \ + --generate-query \ + --generate-prepared \ + --omit-unprepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/prepared/driver.cxx b/odb-tests/common/prepared/driver.cxx new file mode 100644 index 0000000..44df651 --- /dev/null +++ b/odb-tests/common/prepared/driver.cxx @@ -0,0 +1,444 @@ +// file : common/prepared/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test prepared query functionality. +// + +#include // std::unique_ptr +#include // std::move +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct params +{ + unsigned short age; + std::string name; +}; + +static void +query_factory (const char* name, connection& c) +{ + typedef odb::query query; + + unique_ptr p (new params); + prepared_query pq ( + c.prepare_query ( + name, + query::age > query::_ref (p->age) && + query::name != query::_ref (p->name))); + c.cache_query (pq, move (p)); +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + { + person p1 ("John First", 91); + person p2 ("John Second", 81); + person p3 ("John Third", 71); + person p4 ("John Fourth", 61); + person p5 ("John Fifth", 51); + + transaction t (db->begin ()); + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + db->persist (p5); + t.commit (); + } + + typedef odb::query query; + typedef odb::prepared_query prep_query; + typedef odb::result result; + + // Uncached query in the same transaction. + // + { + transaction t (db->begin ()); + + unsigned short age (90); + prep_query pq ( + db->prepare_query ( + "person-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + result r (pq.execute ()); + assert (size (r) == i); + } + + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); + assert (++i == r.end ()); + + t.commit (); + } + + // Uncached query in multiple transaction. + // + { + connection_ptr c (db->connection ()); + + unsigned short age (90); + prep_query pq ( + c->prepare_query ( + "person-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + transaction t (c->begin ()); + + result r (pq.execute ()); + assert (size (r) == i); + + t.commit (); + } + + transaction t (c->begin ()); + + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name_ == "John First" && i->age_ == 91); + assert (++i == r.end ()); + + t.commit (); + } + + // Cached query without parameters. + // + { + for (unsigned short i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + prep_query pq (db->lookup_query ("person-val-age-query")); + + if (!pq) + { + assert (i == 1); + pq = db->prepare_query ( + "person-val-age-query", + query::age > 90); + db->cache_query (pq); + } + else if (i == 2) + { + try + { + db->cache_query (pq); + assert (false); + } + catch (const odb::prepared_already_cached&) + { + } + } + + result r (pq.execute ()); + assert (size (r) == 1); + + t.commit (); + } + } + + // Cached query with parameters. + // + { + for (unsigned short i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + unsigned short* age; + prep_query pq (db->lookup_query ("person-ref-age-query", age)); + + if (!pq) + { + assert (i == 1); + + unique_ptr p (new unsigned short); + age = p.get (); + pq = db->prepare_query ( + "person-ref-age-query", + query::age > query::_ref (*age)); + + db->cache_query (pq, move (p)); + } + else if (i == 2) + { + // Object type mismatch. + // + try + { + db->lookup_query ("person-ref-age-query", age); + assert (false); + } + catch (const odb::prepared_type_mismatch&) + { + } + + // Parameters type mismatch. + // + try + { + int* age; + db->lookup_query ("person-ref-age-query", age); + assert (false); + } + catch (const odb::prepared_type_mismatch&) + { + } + } + + *age = 100 - i * 10; + result r (pq.execute ()); + assert (size (r) == i); + + t.commit (); + } + } + + // Cached query with factory. + // + { + db->query_factory ("person-params-query", &query_factory); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("person-params-query", + database::query_factory_ptr ()); + } + + // Cached query with wildcard factory. + // + { + db->query_factory ("", &query_factory); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query-1", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("", database::query_factory_ptr ()); + } + + // Cached query with lambda factory. + // + { + db->query_factory ( + "person-params-query-2", + [] (const char* name, connection& c) + { + typedef odb::query query; + + unique_ptr p (new params); + prepared_query pq ( + c.prepare_query ( + name, + query::age > query::_ref (p->age) && + query::name != query::_ref (p->name))); + c.cache_query (pq, move (p)); + }); + + for (unsigned int i (1); i < 6; ++i) + { + transaction t (db->begin ()); + + params* p; + prep_query pq (db->lookup_query ("person-params-query-2", p)); + assert (pq); + + p->age = 100 - i * 10; + p->name = "John First"; + result r (pq.execute ()); + assert (size (r) == i - 1); + + t.commit (); + } + + db->query_factory ("person-params-query-2", + database::query_factory_ptr ()); + } + + // Cached query with lambda factory using closure. Forces nonoptimized + // representation of std::function. + // + { + const std::string person_name ("John First"); + + db->query_factory ( + "person-params-query-3", + [person_name] (const char* name, connection& c) + { + typedef odb::query query; + + prepared_query pq ( + c.prepare_query ( + name, + query::age > 50 && query::name != person_name)); + c.cache_query (pq); + }); + + { + transaction t (db->begin ()); + + prep_query pq (db->lookup_query ("person-params-query-3")); + assert (pq); + + result r (pq.execute ()); + assert (size (r) == 4); + + t.commit (); + } + + db->query_factory ("person-params-query-3", nullptr); + } + + // View prepared query. + // + { + typedef odb::query query; + typedef odb::prepared_query prep_query; + typedef odb::result result; + + transaction t (db->begin ()); + + unsigned short age (90); + prep_query pq ( + db->prepare_query ( + "person-view-age-query", + query::age > query::_ref (age))); + + for (unsigned short i (1); i < 6; ++i, age -= 10) + { + result r (pq.execute ()); + assert (size (r) == i); + } + + age = 90; + result r (pq.execute ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->name == "John First" && i->age == 91); + assert (++i == r.end ()); + + t.commit (); + } + + // By-ref parameter image growth. + // + { + transaction t (db->begin ()); + + string name; + prep_query pq ( + db->prepare_query ( + "person-name-query", + query::name != query::_ref (name))); + + { + name = "John First"; + result r (pq.execute ()); + assert (size (r) == 4); + } + + { + name.assign (2048, 'x'); + result r (pq.execute ()); + assert (size (r) == 5); + } + + t.commit (); + } + + // Test execute_one() and execute_value(). + // + { + transaction t (db->begin ()); + + person p ("John Doe", 23); + db->persist (p); + + prep_query pq1 ( + db->prepare_query ("query-1", query::id == p.id_)); + prep_query pq0 ( + db->prepare_query ("query-0", query::id == p.id_ + 1)); + + { + unique_ptr p (pq1.execute_one ()); + assert (p.get () != 0 && p->name_ == "John Doe"); + } + + { + unique_ptr p (pq0.execute_one ()); + assert (p.get () == 0); + } + + { + person p; + assert (pq1.execute_one (p) && p.name_ == "John Doe"); + } + + { + person p ("", 0); + assert (!pq0.execute_one (p) && + p.id_ == 0 && p.name_.empty () && p.age_ == 0); + } + + { + person p (pq1.execute_value ()); + assert (p.name_ == "John Doe"); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/prepared/test.hxx b/odb-tests/common/prepared/test.hxx new file mode 100644 index 0000000..db16e67 --- /dev/null +++ b/odb-tests/common/prepared/test.hxx @@ -0,0 +1,32 @@ +// file : common/prepared/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct person +{ + person (): id_ (0) {} + person (const std::string& name, unsigned short age) + : id_ (0), name_ (name), age_ (age) {} + + #pragma db id auto + unsigned long id_; + + std::string name_; + unsigned short age_; +}; + +#pragma db view object(person) +struct person_view +{ + std::string name; + unsigned short age; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/prepared/testscript b/odb-tests/common/prepared/testscript new file mode 100644 index 0000000..3530c5b --- /dev/null +++ b/odb-tests/common/prepared/testscript @@ -0,0 +1,33 @@ +# file : common/prepared/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/query/array/buildfile b/odb-tests/common/query/array/buildfile new file mode 100644 index 0000000..3beb6d0 --- /dev/null +++ b/odb-tests/common/query/array/buildfile @@ -0,0 +1,43 @@ +# file : common/query/array/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_array_ \ + --generate-schema \ + --generate-query \ + --generate-prepared \ + --sql-name-case oracle:upper + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/query/array/driver.cxx b/odb-tests/common/query/array/driver.cxx new file mode 100644 index 0000000..9327751 --- /dev/null +++ b/odb-tests/common/query/array/driver.cxx @@ -0,0 +1,220 @@ +// file : common/query/array/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query support for C arrays. +// + +#include +#include // std::unique_ptr +#include // std::memcpy +#include + +#include +#include + +#include // DATABASE_* +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +#ifndef MULTI_DATABASE +# if defined(DATABASE_MYSQL) +const odb::mysql::database_type_id bt = odb::mysql::id_blob; +# elif defined(DATABASE_SQLITE) +const odb::sqlite::database_type_id bt = odb::sqlite::id_blob; +# elif defined(DATABASE_PGSQL) +const odb::pgsql::database_type_id bt = odb::pgsql::id_bytea; +# elif defined(DATABASE_ORACLE) +const odb::oracle::database_type_id bt = odb::oracle::id_raw; +# elif defined(DATABASE_MSSQL) +const odb::mssql::database_type_id bt = odb::mssql::id_binary; +# else +# error unknown database +# endif +#endif + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + typedef odb::query query; + + const char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}; + + // + // + { + object o1 (1, "abc", buf); + object o2 (2, "bcd", buf); + object o3 (3, "cde", buf); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + + // string + // +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == "abc")) == 1); + assert (size (db->query (query::s == query::_val ("bcd"))) == 1); + assert (size (db->query ("s = " + query::_val ("bcd"))) == 1); + assert (size (db->query ("s = " + query::_ref ("bcd"))) == 1); +#endif + + { + char a[] = "bcd"; + char* ra = a; +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == a)) == 1); + assert (size (db->query (query::s == query::_val (a))) == 1); +#endif + assert (size (db->query (query::s == query::_ref (ra))) == 1); +#ifndef MULTI_DATABASE + assert (size (db->query ("s = " + query::_val (a))) == 1); + assert (size (db->query ("s = " + query::_ref (a))) == 1); +#endif + } + + { + const char a[] = "bcd"; + const char* ra = a; +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == a)) == 1); + assert (size (db->query (query::s == query::_val (a))) == 1); +#endif + assert (size (db->query (query::s == query::_ref (ra))) == 1); +#ifndef MULTI_DATABASE + assert (size (db->query ("s = " + query::_val (a))) == 1); + assert (size (db->query ("s = " + query::_ref (a))) == 1); +#endif + } + + { + const char* p = "cde"; +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == p)) == 1); + assert (size (db->query (query::s == query::_val (p))) == 1); +#endif + assert (size (db->query (query::s == query::_ref (p))) == 1); +#ifndef MULTI_DATABASE + assert (size (db->query ("s = " + query::_val (p))) == 1); + assert (size (db->query ("s = " + query::_ref (p))) == 1); +#endif + } + + { + char a[] = "cde"; + char* p = a; +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == p)) == 1); + assert (size (db->query (query::s == query::_val (p))) == 1); +#endif + assert (size (db->query (query::s == query::_ref (p))) == 1); +#ifndef MULTI_DATABASE + assert (size (db->query ("s = " + query::_val (p))) == 1); + assert (size (db->query ("s = " + query::_ref (p))) == 1); +#endif + } + +#ifndef MULTI_DATABASE + string s ("abc"); + //assert (size (db->query (query::s == s)) == 1); + assert (size (db->query (query::s == s.c_str ())) == 1); + //assert (size (db->query (query::s == query::_val (s))) == 1); + assert (size (db->query (query::s == query::_val (s.c_str ()))) == 1); + + assert (size (db->query ("s = " + query::_val (s))) == 1); + assert (size (db->query ("s = " + query::_ref (s))) == 1); +#endif + + // @@ BUILD2 Ends up with the following warning, but strangely only in the + // multi-database mode: + // + // In file included from odb/odb-tests/common/query/array/test-odb.hxx:31, + // from odb/odb-tests/common/query/array/driver.cxx:20: + // odb/libodb/odb/query-dynamic.hxx: In instantiation of ‘odb::query_base odb::query_column::operator==(const odb::query_column&) const [with T2 = char [17]; T = char [17]]’: + // odb/odb-tests/common/query/array/driver.cxx:144:7: required from here + // odb/libodb/odb/query-dynamic.hxx:895:43: error: comparison between two arrays is deprecated in C++20 [-Werror=array-compare] + // 895 | (void) (sizeof (type_instance () == type_instance ())); + // | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ + // odb/libodb/odb/query-dynamic.hxx:895:43: note: use unary ‘+’ which decays operands to pointers or ‘&‘indirect_ref’ not supported by dump_decl[0] == &‘indirect_ref’ not supported by dump_decl[0]’ to compare the addresses + // + // Looks like compile-time assertion. Doesn't make much sense for + // arrays since compares pointers to objects rather than objects. + // Should we somehow suppress the assertion for arrays or similar? + // + // Note: temporarily ifndef-ed. + // +#ifndef MULTI_DATABASE + assert (size (db->query (query::s == query::s1)) == 3); +#endif + + // std::array + // + array a; + memcpy (a.data (), "abc", 4); // VC++ strcpy deprecation. + +#ifndef MULTI_DATABASE + assert (size (db->query (query::a == a)) == 1); + assert (size (db->query (query::a == query::_val (a))) == 1); +#endif + assert (size (db->query (query::a == query::_ref (a))) == 1); +#ifndef MULTI_DATABASE + assert (size (db->query ("a = " + query::_val (a))) == 1); + assert (size (db->query ("a = " + query::_ref (a))) == 1); +#endif + + // char + // + assert (size (db->query (query::c == 'a')) == 1); + + char c ('b'); + assert (size (db->query (query::c == query::_val (c))) == 1); + assert (size (db->query (query::c == query::_ref (c))) == 1); + +#ifndef MULTI_DATABASE + assert (size (db->query ("c = " + query::_val ('c'))) == 1); + assert (size (db->query ("c = " + query::_ref (c))) == 1); +#endif + + assert (size (db->query (query::c == query::c1)) == 3); + + // buffer + // +#ifndef MULTI_DATABASE + assert (size (db->query (query::b == buf)) == 3); + assert (size (db->query (query::b == query::_val (buf))) == 3); +#endif + + assert (size (db->query (query::b == query::_ref (buf))) == 3); + +#ifndef MULTI_DATABASE + assert (size (db->query ("b = " + query::_val (buf))) == 3); + assert (size (db->query ("b = " + query::_ref (buf))) == 3); +#endif + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/query/array/test.hxx b/odb-tests/common/query/array/test.hxx new file mode 100644 index 0000000..f0d5f3b --- /dev/null +++ b/odb-tests/common/query/array/test.hxx @@ -0,0 +1,70 @@ +// file : common/query/array/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::memcpy, std::strlen + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id, const char* s, const char* b) + : id_ (id) + { + std::memcpy (s_, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s1_, s, std::strlen (s) + 1); + std::memcpy (a_.data (), s, std::strlen (s) + 1); + c_ = c1_ = *s; + std::memcpy (b_, b, sizeof (b_)); + } + + #pragma db id + unsigned long id_; + + char s_[17]; + char s1_[17]; + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) || \ + defined(ODB_DATABASE_PGSQL) || \ + defined(ODB_DATABASE_ORACLE) || \ + defined(ODB_DATABASE_MSSQL) +# pragma db type("VARCHAR(16)") +# elif defined(ODB_DATABASE_SQLITE) +# pragma db type("TEXT") +# elif defined(ODB_DATABASE_COMMON) +# pragma db type("DYMMU") // Necessary to make it a value. +# else +# error unknown database +# endif +#endif + std::array a_; + + char c_; + char c1_; + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_MYSQL) +# pragma db type("BINARY(16)") +# elif defined(ODB_DATABASE_SQLITE) +# pragma db type("BLOB") +# elif defined(ODB_DATABASE_PGSQL) +# pragma db type("BYTEA") +# elif defined(ODB_DATABASE_ORACLE) +# pragma db type("RAW(16)") +# elif defined(ODB_DATABASE_MSSQL) +# pragma db type("BINARY(16)") +# elif defined(ODB_DATABASE_COMMON) +# else +# error unknown database +# endif +#endif + char b_[16]; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/query/array/testscript b/odb-tests/common/query/array/testscript new file mode 100644 index 0000000..631ae24 --- /dev/null +++ b/odb-tests/common/query/array/testscript @@ -0,0 +1,33 @@ +# file : common/query/array/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/query/basics/buildfile b/odb-tests/common/query/basics/buildfile new file mode 100644 index 0000000..e38e6fe --- /dev/null +++ b/odb-tests/common/query/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/query/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_basics_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/query/basics/driver.cxx b/odb-tests/common/query/basics/driver.cxx new file mode 100644 index 0000000..73b81d2 --- /dev/null +++ b/odb-tests/common/query/basics/driver.cxx @@ -0,0 +1,668 @@ +// file : common/query/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic query support. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include // DATABASE_XXX +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +void +print (result& r) +{ + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + unique_ptr o (i.load ()); + cout << *o << endl; + } + cout << endl; +} + +const char* names[] = { "John", "Jane", "Joe" }; +const char** names_end = names + sizeof (names)/sizeof (names[0]); + +const char* key_data[] = { "\x23\x03\x15", "\x13\x13\x54", "\x08\x62\x35" }; + +int +main (int argc, char* argv[]) +{ + buffer + key1 (key_data[0], key_data[0] + 3), + key2 (key_data[1], key_data[1] + 3), + key3 (key_data[2], key_data[2] + 3); + + try + { + unique_ptr db (create_database (argc, argv)); + odb::database_id db_id (db->id ()); + + typedef odb::query query; + typedef odb::result result; + + // + // + { + person p1 (1, "John", "Doe", 30, true, key1); + person p2 (2, "Jane", "Doe", 29, true, key2); + person p3 (3, "Joe", "Dirt", 31, false, key3); + p3.middle_name_.reset (new string ("Squeaky")); + person p4 (4, "Johansen", "Johansen", 32, false); + p4.middle_name_.reset (new string ("J")); + + transaction t (db->begin ()); + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + t.commit (); + } + + // + // Native queries. + // + + // Compilation tests. + // +#ifndef MULTI_DATABASE + if (false) + { + string name; + unsigned short age; + + db->query ("age = " + query::_ref (age)); + db->query ("age = " + query::_val (age)); + + query age_q (query::_ref (age) + " = age"); + query name_q ("first = " + query::_val (name)); + query q (age_q + "AND" + name_q); + + db->query (q); + db->query (age_q + "OR" + + name_q + "OR" + + "age < " + query::_ref (age)); + + query q1 (query::_val (name)); + q1 += " = first"; + } +#endif + + // Select-all query. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + result r (db->query ()); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + person p; + i.load (p); + cout << p << endl; + } + + t.commit (); + } + + // Select-all query with order by. + // + cout << "test 002" << endl; + { + transaction t (db->begin ()); + result r (db->query ("ORDER BY" + query::age)); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + person& p (*i); + + cout << p.first_name_; + + if (i->middle_name_.get () != 0) + cout << ' ' << *i->middle_name_; + + cout << ' ' << i->last_name_ << ' ' << i->age_ << + (i->married_ ? " married" : " single") << endl; + } + cout << endl; + + t.commit (); + } + + // String query. + // + cout << "test 003" << endl; + { + transaction t (db->begin ()); + + result r; + if (db_id != odb::id_oracle) + r = db->query ("age >= 30 AND last = 'Doe'"); + else + r = db->query ("\"age\" >= 30 AND \"last\" = 'Doe'"); + + print (r); + t.commit (); + } + + // Value binding. + // + cout << "test 004" << endl; + { + transaction t (db->begin ()); + + const char* name = "Doe"; + +#if defined(MULTI_DATABASE) + result r ( + db->query ( + query::age >= query::_val (30) && + query::last_name == query::_val (name))); + +#elif defined(DATABASE_ORACLE) + result r ( + db->query ( + "\"age\" >= " + query::_val (30) + "AND" + + "\"last\" = " + query::_val (name))); +#else + result r ( + db->query ( + "age >= " + query::_val (30) + "AND" + + "last = " + query::_val (name))); +#endif + + print (r); + t.commit (); + } + + // Reference binding. + // + cout << "test 005" << endl; + { + transaction t (db->begin ()); + + string name; + unsigned short age; + +#if defined(MULTI_DATABASE) + query q (query::age >= query::_ref (age) && + query::last_name == query::_ref (name)); +#elif defined(DATABASE_ORACLE) + query q ("\"age\" >= " + query::_ref (age) + "AND" + + "\"last\" = " + query::_ref (name)); +#else + query q ("age >= " + query::_ref (age) + "AND" + + "last = " + query::_ref (name)); +#endif + + name = "Doe"; + age = 30; + result r (db->query (q)); + print (r); + + name = "Dirt"; + age = 31; + r = db->query (q); + print (r); + + t.commit (); + } + + // + // Language-embedded queries. + // + + // Compilation tests. + // + if (false) + { + string name; + unsigned short age; + + // Column operators. + // + query q1 (query::married); + db->query (query::married); + db->query (query::married == true); + + //db->query (query::age); + + db->query (query::age == 30); + db->query (query::age == age); + db->query (query::age == query::_val (30)); + db->query (query::age == query::_val (age)); + db->query (query::age == query::_ref (age)); + //db->query (query::age == "123"); + //db->query ("123" == query::age); + //db->query (query::age == query::_val ("123")); + //db->query (query::age == query::_ref (name)); + db->query (query::last_name == "Doe"); + db->query (query::last_name == name); +#ifndef MULTI_DATABASE + db->query (query::last_name == query::_val ("Doe")); +#endif + db->query (query::last_name == query::_val (name)); + db->query (query::last_name == query::_ref (name)); + //db->query (query::last_name == 30); + //db->query (query::last_name == query::_val (30)); + //db->query (query::last_name == query::_ref (age)); + + db->query (query::last_name.is_null ()); + db->query (query::last_name.is_not_null ()); + + db->query (query::first_name == query::last_name); + + db->query (query::first_name.in ("John", "Jane")); + db->query (query::first_name.in_range (names, names_end)); + + db->query (query::first_name.like ("J%")); + db->query (query::first_name.like ("J%!%", "!")); + + // Query operators. + // + db->query (query::age == 30 && query::last_name == "Doe"); + db->query (query::age == 30 || query::last_name == "Doe"); + db->query (!(query::age == 30 || query::last_name == "Doe")); + db->query ((query::last_name == "Doe") + "ORDER BY age"); + } + + // Test is_null/is_not_null. + // + cout << "test 006" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::middle_name.is_null ())); + print (r); + r = db->query (query::middle_name.is_not_null ()); + print (r); + t.commit (); + } + + // Test boolean columns. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::married)); + print (r); + r = db->query (!query::married); + print (r); + t.commit (); + } + + // Test implicit by-value, explicit by-value, and by-reference. + // + cout << "test 008" << endl; + { + string name ("Dirt"); + + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + print (r); + r = db->query (query::last_name == query::_val (name)); + print (r); + query q (query::last_name == query::_ref (name)); + name = "Doe"; + r = db->query (q); + print (r); + t.commit (); + } + + // Test column operators (==, !=, <, >, <=, >=). + // + cout << "test 009" << endl; + { + transaction t (db->begin ()); + + // == + // + result r (db->query (query::last_name == "Doe")); + print (r); + + // != + // + r = db->query (query::last_name != "Doe"); + print (r); + + // < + // + r = db->query (query::age < 31); + print (r); + + // > + // + r = db->query (query::age > 30); + print (r); + + // <= + // + r = db->query (query::age <= 30); + print (r); + + // >= + // + r = db->query (query::age >= 31); + print (r); + + t.commit (); + } + + // Test query operators (&&, ||, (), !, +). + // + cout << "test 010" << endl; + { + transaction t (db->begin ()); + + // && + // + result r (db->query ( + query::last_name == "Doe" && query::age == 29)); + print (r); + + // || + // + r = db->query (query::last_name == "Doe" || query::age == 31); + print (r); + + // () + // + r = db->query ( + (query::last_name != "Doe" || query::age == 29) && query::married); + print (r); + + // != + // + r = db->query (!(query::last_name == "Doe")); + print (r); + + // + + // + r = db->query ((query::last_name == "Doe") + + "ORDER BY" + query::age); + print (r); + + t.commit (); + } + + // Test in/in_range. + // + cout << "test 011" << endl; + { + transaction t (db->begin ()); + + result r (db->query (query::first_name.in ("John", "Jane"))); + print (r); + + r = db->query (query::first_name.in_range (names, names_end)); + print (r); + + // Empty range. + // + r = db->query (query::last_name == "Doe" && + query::first_name.in_range (names, names)); + assert (r.empty ()); + + t.commit (); + } + + // Test column-to-column comparison. + // + cout << "test 012" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::first_name == query::last_name)); + print (r); + t.commit (); + } + + // Test value_traits::value_type != value_traits::query_type. + // + cout << "test 013" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::middle_name == "Squeaky")); + print (r); + t.commit (); + } + + // Test that loading of the same object type during iteration does + // not invalidate the result. + // + cout << "test 014" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + + { + unique_ptr joe (db->load (3)); + } + + { + person p (5, "Peter", "Peterson", 70, false, key3); + db->persist (p); + db->erase (p); + } + + // SQL Server does not support re-loading of an object with long data + // from a query result. + // + if (db_id != odb::id_mssql) + assert (i->last_name_ == "Doe"); // Actual load. + + // Overwrite object image again. + // + unique_ptr joe (db->load (3)); + person p; + i.load (p); + assert (p.last_name_ == "Doe"); + + t.commit (); + } + + // Test uncached result. + // + cout << "test 015" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Doe", false)); + print (r); + t.commit (); + } + + // Test BLOB column operations. + // + cout << "test 016" << endl; + { + transaction t (db->begin ()); + + result r; + result::iterator i; + + // == + // + + // Oracle does not support LOB comparisons. + // +#if defined(MULTI_DATABASE) || !defined(DATABASE_ORACLE) + if (db_id != odb::id_oracle) + { + r = db->query (query::public_key == key2); + + i = r.begin (); + assert (i != r.end ()); + + assert (*i->public_key_ == key2); + assert (++i == r.end ()); + } +#endif + + // is_null + // + r = db->query (query::public_key.is_null ()); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "Johansen" && i->last_name_ == "Johansen"); + assert (++i == r.end ()); + + // is_not_null + // + r = db->query (query::public_key.is_not_null ()); + + i = r.begin (); + assert (i != r.end ()); + + assert (i->first_name_ == "John" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Jane" && i->last_name_ == "Doe"); + assert (++i != r.end ()); + + assert (i->first_name_ == "Joe" && i->last_name_ == "Dirt"); + assert (++i == r.end ()); + + t.commit (); + } + + // Test iterator::id(). + // + cout << "test 017" << endl; + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i.id () == 3); + + t.commit (); + } + + // Test empty result set. + // + cout << "test 018" << endl; + { + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.begin () == r.end ()); + t.commit (); + } + } + + // Test size() validity at the beginning/middle/end of result set. + // + cout << "test 019" << endl; + if (db_id != odb::id_sqlite && + db_id != odb::id_oracle && + db_id != odb::id_mssql) + { + { + transaction t (db->begin ()); + result r (db->query ()); + assert (r.size () == 4); + result::iterator i (r.begin ()); + assert (r.size () == 4); + ++i; + ++i; + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + r.cache (); // Cache in the middle. + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + ++i; + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (false)); + result::iterator i (r.begin ()); + ++i; + ++i; + ++i; + r.cache (); // Cache at the end. + assert (r.size () == 4); + } + + { + transaction t (db->begin ()); + result r (db->query (query::last_name == "None")); + assert (r.size () == 0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) ; + assert (r.size () == 0); + } + } + + // Test like. + // + cout << "test 020" << endl; + { + transaction t (db->begin ()); + + result r (db->query (query::first_name.like ("Jo%"))); + print (r); + + r = db->query (!query::first_name.like ("Jo%")); + print (r); + + r = db->query (query::first_name.like ("Jo!%", "!")); + print (r); + + // In Oracle one can only escape special characters (% and _). + // + string v; + if (db_id != odb::id_oracle) + v = "!Ja%"; + else + v = "Ja%"; + + r = db->query (query::first_name.like (query::_ref (v), "!")); + print (r); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/query/basics/test.hxx b/odb-tests/common/query/basics/test.hxx new file mode 100644 index 0000000..239f6d6 --- /dev/null +++ b/odb-tests/common/query/basics/test.hxx @@ -0,0 +1,117 @@ +// file : common/query/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include + +#include +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +typedef std::vector buffer; +typedef odb::nullable nullable_buffer; + +#pragma db object +struct person +{ + person (unsigned long id, + const std::string& fn, + const std::string& ln, + unsigned short age, + bool married, + const nullable_buffer& public_key = nullable_buffer ()) + : id_ (id), + first_name_ (fn), + last_name_ (ln), + age_ (age), + married_ (married), + public_key_ (public_key) + { + } + + person () + { + } + + #pragma db id + unsigned long id_; + + #pragma db column ("first") + std::string first_name_; + + #pragma db column ("middle") null + std::unique_ptr middle_name_; + + #pragma db column ("last") + std::string last_name_; + + unsigned short age_; + bool married_; + + #pragma db column ("key") type(BLOB_TYPE) null + nullable_buffer public_key_; +}; + +inline std::ostream& +operator<< (std::ostream& os, const person& p) +{ + os << p.first_name_; + + if (p.middle_name_.get () != 0) + os << ' ' << *p.middle_name_; + + os << ' ' << p.last_name_ << ' ' << p.age_ << + (p.married_ ? " married" : " single"); + + return os; +} + +// Test member name conflicts (compilation-only test). +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object + { + #pragma db id + int id; + }; + + #pragma db value + struct value + { + object* m_object; + }; + + #pragma db value + struct bar + { + value m_value; + }; + + #pragma db object + struct foo + { + #pragma db id + int id; + + bar m_value; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/query/basics/testscript b/odb-tests/common/query/basics/testscript new file mode 100644 index 0000000..9086b66 --- /dev/null +++ b/odb-tests/common/query/basics/testscript @@ -0,0 +1,150 @@ +# file : common/query/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + test 001 + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + test 002 + Jane Doe 29 married + John Doe 30 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 003 + John Doe 30 married + + test 004 + John Doe 30 married + + test 005 + John Doe 30 married + + Joe Squeaky Dirt 31 single + + test 006 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 007 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 008 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + + John Doe 30 married + Jane Doe 29 married + + test 009 + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + John Doe 30 married + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + test 010 + Jane Doe 29 married + + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + + Jane Doe 29 married + + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + Jane Doe 29 married + John Doe 30 married + + test 011 + John Doe 30 married + Jane Doe 29 married + + John Doe 30 married + Jane Doe 29 married + Joe Squeaky Dirt 31 single + + test 012 + Johansen J Johansen 32 single + + test 013 + Joe Squeaky Dirt 31 single + + test 014 + test 015 + John Doe 30 married + Jane Doe 29 married + + test 016 + test 017 + test 018 + test 019 + test 020 + John Doe 30 married + Joe Squeaky Dirt 31 single + Johansen J Johansen 32 single + + Jane Doe 29 married + + + Jane Doe 29 married + + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/query/one/buildfile b/odb-tests/common/query/one/buildfile new file mode 100644 index 0000000..76a36b0 --- /dev/null +++ b/odb-tests/common/query/one/buildfile @@ -0,0 +1,42 @@ +# file : common/query/one/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_query_one_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/query/one/driver.cxx b/odb-tests/common/query/one/driver.cxx new file mode 100644 index 0000000..4c3dcdc --- /dev/null +++ b/odb-tests/common/query/one/driver.cxx @@ -0,0 +1,205 @@ +// file : common/query/one/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test query one support. +// +// We assume that other tests in common/query/ exercise a variety of +// different kinds of queries. Here we are concerned with what is +// specific to query_one() and query_value(). +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + odb::database_id db_id (db->id ()); + + transaction t (db->begin ()); + + // query_one() + // + { + unique_ptr o (db->query_one ()); + assert (o.get () == 0); + } + + { + object o (4); + assert (!db->query_one (o) && o.id_ == 4 && o.str_.empty ()); + } + + /* + { + object o (db->query_value ()); + assert (false); + } + */ + + object o (1); + o.str_ = "value 1"; + db->persist (o); + + { + unique_ptr o (db->query_one ()); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + object o; + assert (db->query_one (o) && o.str_ == "value 1"); + } + + { + object o (db->query_value ()); + assert (o.str_ == "value 1"); + } + + // query_one(const char*) + // + const char* q1_c (db_id == odb::id_oracle ? "\"id\" = 1" : "id = 1"); + const char* q0_c (db_id == odb::id_oracle ? "\"id\" = 2" : "id = 2"); + + { + unique_ptr o (db->query_one (q1_c)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + unique_ptr o (db->query_one (q0_c)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1_c, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0_c, o) && + o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1_c)); + assert (o.str_ == "value 1"); + } + + // query_one(std::string) + // + string q1_s (q1_c); + string q0_s (q0_c); + + { + unique_ptr o (db->query_one (q1_s)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + unique_ptr o (db->query_one (q0_s)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1_s, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0_s, o) && + o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1_s)); + assert (o.str_ == "value 1"); + } + + // query_one(odb::query) + // + typedef odb::query query; + + query q1 (query::id == 1); + query q0 (query::id == 2); + + { + unique_ptr o (db->query_one (q1)); + assert (o.get () != 0 && o->str_ == "value 1"); + } + + { + unique_ptr o (db->query_one (q0)); + assert (o.get () == 0); + } + + { + object o; + assert (db->query_one (q1, o) && o.str_ == "value 1"); + } + + { + object o (4); + assert (!db->query_one (q0, o) && o.id_ == 4 && o.str_.empty ()); + } + + { + object o (db->query_value (q1)); + assert (o.str_ == "value 1"); + } + + // Assertion on more than one element. + // + { + object o (2); + o.str_ = "value 2"; + db->persist (o); + } + + /* + { + unique_ptr o (db->query_one ()); + assert (false); + } + */ + + /* + { + object o; + db->query_one (o); + assert (false); + } + */ + + /* + { + object o (db->query_value ()); + assert (false); + } + */ + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/query/one/test.hxx b/odb-tests/common/query/one/test.hxx new file mode 100644 index 0000000..3008063 --- /dev/null +++ b/odb-tests/common/query/one/test.hxx @@ -0,0 +1,26 @@ +// file : common/query/one/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + std::string str_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/query/one/testscript b/odb-tests/common/query/one/testscript new file mode 100644 index 0000000..963a206 --- /dev/null +++ b/odb-tests/common/query/one/testscript @@ -0,0 +1,33 @@ +# file : common/query/one/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/readonly/buildfile b/odb-tests/common/readonly/buildfile new file mode 100644 index 0000000..2d83cf1 --- /dev/null +++ b/odb-tests/common/readonly/buildfile @@ -0,0 +1,40 @@ +# file : common/readonly/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix readonly_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/readonly/driver.cxx b/odb-tests/common/readonly/driver.cxx new file mode 100644 index 0000000..b207627 --- /dev/null +++ b/odb-tests/common/readonly/driver.cxx @@ -0,0 +1,324 @@ +// file : common/readonly/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test readonly members/objects. Also test that const members are +// treated as readonly. For other const member tests, see the const- +// member test. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include // DATABASE_* +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Simple. + // + { + simple o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro++; + const_cast (o.co)++; + o.rw++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro == 1 && o.co == 1 && o.rw == 2); + } + + // Pointer. + // + { + pointer p (1, new pointer (2)); + unique_ptr p1 (new pointer (3)); + + { + transaction t (db->begin ()); + db->persist (p); + db->persist (p.ro); + db->persist (*p1); + t.commit (); + } + + delete p.ro; + p.ro = p1.release (); + const_cast (p.co) = p.ro; + p.rw = p.ro; + + { + transaction t (db->begin ()); + db->update (p); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (1)); + t.commit (); + + assert (p->ro->id == 2 && p->co->id == 2 && p->rw->id == 3); + } + } + + // Composite. + // + { + composite o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro.v++; + o.ro.ro++; + const_cast (o.ro.co)++; + o.ro.rw++; + + value& co (const_cast (o.co)); + co.v++; + co.ro++; + const_cast (co.co)++; + co.rw++; + + o.rw.v++; + o.rw.ro++; + const_cast (o.rw.co)++; + o.rw.rw++; + + o.v.v++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro.v == 1 && + o.ro.ro == 1 && + o.ro.co == 1 && + o.ro.rw == 1 && + + o.co.v == 1 && + o.co.ro == 1 && + o.co.co == 1 && + o.co.rw == 1 && + + o.rw.v == 1 && + o.rw.ro == 1 && + o.rw.co == 1 && + o.rw.rw == 2 && + + o.v.v == 1); + } + + // Container. + // + { + typedef vector ulongs; + + container o (1); + + o.ro.push_back (1); + o.ro.push_back (2); + + ulongs& co (const_cast (o.co)); + co.push_back (1); + co.push_back (2); + + o.rw.push_back (1); + o.rw.push_back (2); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.ro[0]++; + o.ro.pop_back (); + + co[0]++; + co.pop_back (); + + o.rw[0]++; + o.rw.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (o.ro.size () == 2 && o.ro[0] == 1 && o.ro[1] == 2 && + o.co.size () == 2 && o.co[0] == 1 && o.co[1] == 2 && + o.rw.size () == 1 && o.rw[0] == 2); + } + + // Readonly object. + // + { +#ifndef MULTI_DATABASE + typedef odb::object_traits_impl so_traits; + typedef odb::object_traits_impl ro_traits; + typedef odb::object_traits_impl rw_traits; + + assert (so_traits::column_count == + so_traits::id_column_count + so_traits::readonly_column_count); + + assert (ro_traits::column_count == + ro_traits::id_column_count + ro_traits::readonly_column_count); + + assert (rw_traits::column_count != + rw_traits::id_column_count + rw_traits::readonly_column_count); +#endif + + simple_object so (1, 1); + ro_object ro_o (1, 1); + rw_object rw_o (1, 1); + + ro_o.cr.push_back (1); + ro_o.cr.push_back (2); + + rw_o.cr.push_back (1); + rw_o.cr.push_back (2); + + { + transaction t (db->begin ()); + db->persist (so); + db->persist (ro_o); + db->persist (rw_o); + t.commit (); + } + + rw_o.sv++; + rw_o.rw_sv++; + + { + transaction t (db->begin ()); + //db->update (so); // Compile error. + //db->update (ro_o); // Compile error. + db->update (rw_o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, so); + db->load (1, ro_o); + db->load (1, rw_o); + t.commit (); + } + + assert (rw_o.sv == 1 && rw_o.rw_sv == 2); + } + + // Readonly object. + // + { + wrapper o (1, 1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + *o.pl = 2; + *o.cpl = 2; + o.pcl.reset (new unsigned long (2)); + const_cast (*o.cpcl) = 2; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->load (1, o); + t.commit (); + } + + assert (*o.pl == 2 && *o.cpl == 2 && *o.pcl == 2 && *o.cpcl == 1); + } + + // Readonly object with auto id. + // + { + ro_auto o1 (1); + ro_auto o2 (2); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->num == o1.num); + assert (p2->num == o2.num); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/readonly/test.hxx b/odb-tests/common/readonly/test.hxx new file mode 100644 index 0000000..45797b6 --- /dev/null +++ b/odb-tests/common/readonly/test.hxx @@ -0,0 +1,225 @@ +// file : common/readonly/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::unique_ptr + +#include + +// Simple readonly object. +// +#pragma db object +struct simple +{ + simple (unsigned long i, unsigned long x) + : id (i), ro (x), co (x), rw (x) + { + } + + simple (): co (0) {} + + #pragma db id + unsigned long id; + + #pragma db readonly + unsigned long ro; + + const unsigned long co; + + unsigned long rw; +}; + +// Readonly pointer. +// +#pragma db object +struct pointer +{ + pointer (unsigned long i, pointer* p = 0): id (i), ro (p), co (p), rw (p) {} + pointer (): ro (0), co (0), rw (0) {} + + ~pointer () + { + delete ro; + + if (co != ro) + delete co; + + if (rw != ro && rw != co) + delete rw; + } + + #pragma db id + unsigned long id; + + #pragma db readonly + pointer* ro; + + pointer* const co; + + pointer* rw; +}; + +// Composite readonly value as well as simple readonly value inside +// a composite. +// +#pragma db value readonly +struct ro_value +{ + ro_value () {} + ro_value (unsigned long x): v (x) {} + + unsigned long v; +}; + +#pragma db value +struct value: ro_value +{ + value (): co (0) {} + value (unsigned long x): ro_value (x), ro (x), co (x), rw (x) {} + + #pragma db readonly + unsigned long ro; + + const unsigned long co; + + unsigned long rw; +}; + +#pragma db object +struct composite +{ + composite (unsigned long i, unsigned long x) + : id (i), ro (x), co (x), rw (x), v (x) + { + } + + composite () {} + + #pragma db id + unsigned long id; + + #pragma db readonly + value ro; + + const value co; + + value rw; + ro_value v; +}; + +// Readonly container. +// +#pragma db object +struct container +{ + container (unsigned long i): id (i) {} + container () {} + + #pragma db id + unsigned long id; + + #pragma db readonly + std::vector ro; + + const std::vector co; + + std::vector rw; +}; + +// Readonly object. +// +#pragma db object readonly +struct simple_object +{ + simple_object (unsigned long i, unsigned long x): id (i), sv (x) {} + simple_object () {} + + #pragma db id + unsigned long id; + + unsigned long sv; +}; + +#pragma db object +struct object +{ + object (unsigned long i, unsigned long x): id (i), sv (x) {} + object () {} + + #pragma db id + unsigned long id; + + unsigned long sv; +}; + +#pragma db object readonly +struct ro_object: object +{ + ro_object (unsigned long i, unsigned long x) + : object (i, x), cv (x) + { + } + + ro_object () {} + + value cv; + std::vector cr; +}; + +#pragma db object +struct rw_object: ro_object +{ + rw_object (unsigned long i, unsigned long x) + : ro_object (i, x), rw_sv (x) + { + } + + rw_object () {} + + unsigned long rw_sv; +}; + +// Readonly wrappers. Here we make sure that only const wrappers with +// const wrapped types are automatically treated as readonly. +// +#pragma db object +struct wrapper +{ + wrapper (unsigned long i, unsigned long x) + : id (i), + pl (new unsigned long (x)), + cpl (new unsigned long (x)), + pcl (new unsigned long (x)), + cpcl (new unsigned long (x)) + { + } + + wrapper () {} + + #pragma db id + unsigned long id; + + std::unique_ptr pl; + const std::unique_ptr cpl; + std::unique_ptr pcl; + const std::unique_ptr cpcl; +}; + +// Readonly object with auto id. +// +#pragma db object readonly +struct ro_auto +{ + ro_auto (unsigned long n): num (n) {} + ro_auto () {} + + #pragma db id auto + unsigned long id; + + unsigned long num; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/readonly/testscript b/odb-tests/common/readonly/testscript new file mode 100644 index 0000000..c798201 --- /dev/null +++ b/odb-tests/common/readonly/testscript @@ -0,0 +1,33 @@ +# file : common/readonly/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/relationship/basics/buildfile b/odb-tests/common/relationship/basics/buildfile new file mode 100644 index 0000000..d7bbb7e --- /dev/null +++ b/odb-tests/common/relationship/basics/buildfile @@ -0,0 +1,41 @@ +# file : common/relationship/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_basics_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/relationship/basics/driver.cxx b/odb-tests/common/relationship/basics/driver.cxx new file mode 100644 index 0000000..e27c127 --- /dev/null +++ b/odb-tests/common/relationship/basics/driver.cxx @@ -0,0 +1,150 @@ +// file : common/relationship/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object relationships. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + aggr a ("aggr"); + a.o1 = new obj1 ("o1", "obj1"); + a.o2.reset (new obj2 ("obj2")); + + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); + a.v2.push_back (0); + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); + + a.o3.reset (new obj3 ("obj3")); + + a.c.num = 123; + a.c.o3.reset (new obj3 ("c")); + + a.cv.push_back (comp (234, obj3_ptr (new obj3 ("cv 0")))); + a.cv.push_back (comp (235, obj3_ptr ())); + a.cv.push_back (comp (236, obj3_ptr (new obj3 ("cv 2")))); + + a.v1.push_back (new obj1 ("v1 0", "v1 0")); + a.v1.push_back (0); + a.v1.push_back (new obj1 ("v1 2", "v1 2")); + + // Set cannot contain NULL pointers. + // + a.s1.insert (new obj1 ("s1 0", "s1 0")); + a.s1.insert (new obj1 ("s1 2", "s1 2")); + + a.m1[0] = new obj1 ("m1 0", "m1 0"); + a.m1[1] = 0; + a.m1[2] = new obj1 ("m1 2", "m1 2"); + + // persist + // + { + transaction t (db->begin ()); + db->persist (a.o1); + db->persist (a.o2); + + for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) + if (*i) + db->persist (*i); + + db->persist (a.o3); + + db->persist (a.c.o3); + + for (comp_vec::iterator i (a.cv.begin ()); i != a.cv.end (); ++i) + if (i->o3) + db->persist (i->o3); + + for (obj1_vec::iterator i (a.v1.begin ()); i != a.v1.end (); ++i) + if (*i) + db->persist (*i); + + for (obj1_set::iterator i (a.s1.begin ()); i != a.s1.end (); ++i) + if (*i) + db->persist (*i); + + for (obj1_map::iterator i (a.m1.begin ()); i != a.m1.end (); ++i) + if (i->second) + db->persist (i->second); + + db->persist (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + unique_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + + // query + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o1->str == "obj1")); + assert (!r.empty ()); + assert (r.begin ()->o1->id == a.o1->id); + assert (size (r) == 1); + + t.commit (); + } + + // Test NULL pointer. + // + delete a.o1; + a.o1 = 0; + a.o2.reset (); + a.o3.reset (); + + { + transaction t (db->begin ()); + db->update (a); + t.commit (); + } + + // load & compare + // + { + transaction t (db->begin ()); + unique_ptr a1 (db->load (a.id)); + t.commit (); + + assert (*a1 == a); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/relationship/basics/test.hxx b/odb-tests/common/relationship/basics/test.hxx new file mode 100644 index 0000000..8a2742e --- /dev/null +++ b/odb-tests/common/relationship/basics/test.hxx @@ -0,0 +1,260 @@ +// file : common/relationship/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include + +#include + +// Raw pointer. +// +#pragma db object pointer(obj1*) +struct obj1 +{ + obj1 () {} + obj1 (const std::string& i, const std::string& s): id (i), str (s) {} + + #pragma db id + std::string id; + std::string str; +}; + +inline bool +operator== (const obj1& x, const obj1& y) +{ + return x.id == y.id && x.str == y.str; +} + +// vector +// +typedef std::vector obj1_vec; + +inline bool +operator== (const obj1_vec& x, const obj1_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} + +// set +// +struct obj1_cmp +{ + bool + operator() (obj1* x, obj1* y) const + { + return (!x || !y) ? x < y : x->id < y->id; + } +}; + +typedef std::set obj1_set; + +inline bool +operator== (const obj1_set& x, const obj1_set& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_set::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_set::const_iterator j (y.find (*i)); + + if (j == y.end ()) + return false; + + obj1* x (*i); + obj1* y (*j); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// map +// +typedef std::map obj1_map; + +inline bool +operator== (const obj1_map& x, const obj1_map& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj1_map::const_iterator i (x.begin ()); i != x.end (); ++i) + { + obj1_map::const_iterator j (y.find (i->first)); + + if (j == y.end ()) + return false; + + obj1* x (i->second); + obj1* y (j->second); + + if (!(x ? (y && *x == *y) : !y)) + return false; + } + + return true; +} + +// auto_ptr/unique_ptr +// +struct obj2; + +typedef std::unique_ptr obj2_ptr; + +#pragma db object pointer(obj2_ptr) +struct obj2 +{ + obj2 () {} + obj2 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj2& x, const obj2& y) +{ + return x.id == y.id && x.str == y.str; +} + +typedef std::vector obj2_vec; + +inline bool +operator== (const obj2_vec& x, const obj2_vec& y) +{ + if (x.size () != y.size ()) + return false; + + for (obj2_vec::size_type i (0); i < x.size (); ++i) + if (!(x[i] ? (y[i] && *x[i] == *y[i]) : !y[i])) + return false; + + return true; +} + +// shared_ptr +// +struct obj3; + +typedef std::shared_ptr obj3_ptr; + +#pragma db object pointer(obj3_ptr) +struct obj3 +{ + obj3 () {} + obj3 (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + std::string str; +}; + +inline bool +operator== (const obj3& x, const obj3& y) +{ + return x.id == y.id && x.str == y.str; +} + +// composite +// +#pragma db value +struct comp +{ + comp () {} + comp (int n, obj3_ptr o): num (n), o3 (o) {} + + int num; + obj3_ptr o3; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && + (x.o3 ? (y.o3 && *x.o3 == *y.o3) : !y.o3); +} + +typedef std::vector comp_vec; + +// +// +#pragma db object +struct aggr +{ + aggr (): o1 (0) {} + aggr (const std::string& s): o1 (0), str (s) {} + + ~aggr () + { + delete o1; + + for (obj1_vec::iterator i (v1.begin ()); i != v1.end (); ++i) + delete *i; + + for (obj1_set::iterator i (s1.begin ()); i != s1.end (); ++i) + delete *i; + + for (obj1_map::iterator i (m1.begin ()); i != m1.end (); ++i) + delete i->second; + } + + #pragma db id auto + unsigned long id; + + obj1* o1; + + obj2_ptr o2; // std::auto_ptr or std::unique_ptr + obj2_vec v2; + + obj3_ptr o3; + comp c; + comp_vec cv; + + obj1_vec v1; + obj1_set s1; + obj1_map m1; + + std::string str; + +private: + aggr (const aggr&); + aggr& operator= (const aggr&); +}; + +inline bool +operator== (const aggr& x, const aggr& y) +{ + return + x.id == y.id && + (x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) && + (x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) && + x.v2 == y.v2 && + (x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) && + x.c == y.c && + x.cv == y.cv && + x.v1 == y.v1 && + x.s1 == y.s1 && + x.m1 == y.m1 && + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/relationship/basics/testscript b/odb-tests/common/relationship/basics/testscript new file mode 100644 index 0000000..b498bfa --- /dev/null +++ b/odb-tests/common/relationship/basics/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/relationship/on-delete/buildfile b/odb-tests/common/relationship/on-delete/buildfile new file mode 100644 index 0000000..965a2eb --- /dev/null +++ b/odb-tests/common/relationship/on-delete/buildfile @@ -0,0 +1,43 @@ +# file : common/relationship/on-delete/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_on_d_ \ + --generate-schema \ + --fkeys-deferrable-mode mysql:not_deferrable \ + --fkeys-deferrable-mode mssql:not_deferrable + + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/relationship/on-delete/driver.cxx b/odb-tests/common/relationship/on-delete/driver.cxx new file mode 100644 index 0000000..eec57cf --- /dev/null +++ b/odb-tests/common/relationship/on-delete/driver.cxx @@ -0,0 +1,82 @@ +// file : common/relationship/on-delete/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test ON DELETE functionality. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + object o; + + cascade c; + c.p = &o; + + cascade_cont cc; + cc.p.push_back (&o); + + set_null n; + n.p = &o; + + set_null_cont nc; + nc.p.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (c); + db->persist (cc); + db->persist (n); + db->persist (nc); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->find (c.id) == 0); + + unique_ptr pcc (db->load (cc.id)); + assert (pcc->p.empty ()); + + unique_ptr pn (db->load (n.id)); + assert (pn->p == 0); + + unique_ptr pnc (db->load (nc.id)); + assert (pnc->p.size () == 1 && pnc->p[0] == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/relationship/on-delete/test.hxx b/odb-tests/common/relationship/on-delete/test.hxx new file mode 100644 index 0000000..841acd9 --- /dev/null +++ b/odb-tests/common/relationship/on-delete/test.hxx @@ -0,0 +1,58 @@ +// file : common/relationship/on-delete/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; +}; + +#pragma db object +struct cascade +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + object* p; +}; + +#pragma db object +struct cascade_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + std::vector p; +}; + +#pragma db object +struct set_null +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + object* p; +}; + +#pragma db object +struct set_null_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + std::vector p; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/relationship/on-delete/testscript b/odb-tests/common/relationship/on-delete/testscript new file mode 100644 index 0000000..8288ebc --- /dev/null +++ b/odb-tests/common/relationship/on-delete/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/on-delete/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/relationship/query/buildfile b/odb-tests/common/relationship/query/buildfile new file mode 100644 index 0000000..b70edc4 --- /dev/null +++ b/odb-tests/common/relationship/query/buildfile @@ -0,0 +1,42 @@ +# file : common/relationship/query/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_rel_query_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/relationship/query/driver.cxx b/odb-tests/common/relationship/query/driver.cxx new file mode 100644 index 0000000..20d5370 --- /dev/null +++ b/odb-tests/common/relationship/query/driver.cxx @@ -0,0 +1,168 @@ +// file : common/relationship-query/query/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test relationship queries. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // + // + { + shared_ptr ca (new country ("CA", "Canada")); + shared_ptr za (new country ("ZA", "South Africa")); + shared_ptr us (new country ("US", "United States")); + shared_ptr se (new country ("SE", "Sweden")); + + shared_ptr st (new employer ("Simple Tech, Inc", ca)); + shared_ptr ct (new employer ("Complex Tech, Inc", us)); + + // person + // + shared_ptr p1 ( + new person (1, "John", "Doe", 30, ca, true, za)); + + shared_ptr p2 ( + new person (2, "Jane", "Doe", 29, za, false, us)); + p2->husband = p1; + + shared_ptr p3 ( + new person (3, "Joe", "Dirt", 31, us, true, us)); + + shared_ptr p4 ( + new person (4, "Johan", "Johansen", 32, se, false, ca)); + + // employee + // + shared_ptr e1 ( + new employee (1, "John", "Doe", 30, ca, true, za, st)); + + shared_ptr e2 ( + new employee (2, "Jane", "Doe", 29, za, false, us, ct)); + e2->husband = p1; + + shared_ptr e3 ( + new employee (3, "Joe", "Dirt", 31, us, true, us, st)); + + shared_ptr e4 ( + new employee (4, "Johan", "Johansen", 32, se, false, ca, ct)); + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (st); + db->persist (ct); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + + db->persist (e1); + db->persist (e2); + db->persist (e3); + db->persist (e4); + t.commit (); + } + + typedef odb::query p_query; + typedef odb::result p_result; + + typedef odb::query e_query; + typedef odb::result e_result; + + // Make sure we have an independent JOIN for each relationship. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query ( + p_query::residence.location->code == "ZA")); + assert (size (pr) == 1); + + e_result er (db->query ( + e_query::residence.location->code == "ZA")); + assert (size (er) == 1); + + t.commit (); + } + + // Test Self-JOIN. + // + { + session s; + transaction t (db->begin ()); + + p_result pr (db->query (p_query::husband->last_name == "Doe")); + assert (size (pr) == 1); + + e_result er (db->query (e_query::husband->last_name == "Doe")); + assert (size (er) == 1); + + t.commit (); + } + + // Test query conditions from both base and derived. + // + { + session s; + transaction t (db->begin ()); + + e_result r ( + db->query ( + e_query::employed_by->name == "Simple Tech, Inc" && + e_query::nationality->code == "US")); + + assert (size (r) == 1); + + t.commit (); + } + + // Test second-level pointers. + // + { + session s; + transaction t (db->begin ()); + + p_result r ( + db->query ( + p_query::husband->residence.location == "CA")); + + assert (size (r) == 1); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/relationship/query/test.hxx b/odb-tests/common/relationship/query/test.hxx new file mode 100644 index 0000000..c6e2d6d --- /dev/null +++ b/odb-tests/common/relationship/query/test.hxx @@ -0,0 +1,140 @@ +// file : common/relationship-query/query/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +using std::shared_ptr; + +struct country; + +#pragma db value +struct residence_info +{ + residence_info (bool p, shared_ptr l) + : permanent (p), location (l) + { + } + + residence_info () + { + } + + bool permanent; + + #pragma db not_null + shared_ptr location; +}; + +#pragma db object pointer(shared_ptr) +struct person +{ + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + shared_ptr r, + bool p, + shared_ptr n) + : id (i), + first_name (fn), + last_name (ln), + age (a), + residence (p, r), + nationality (n) + { + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column ("first") + std::string first_name; + + #pragma db column ("last") + std::string last_name; + + unsigned short age; + + residence_info residence; + + #pragma db not_null + shared_ptr nationality; + + shared_ptr husband; // Self-join. +}; + +struct employer; + +#pragma db object pointer(shared_ptr) +struct employee: person +{ + employee (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + shared_ptr r, + bool p, + shared_ptr n, + shared_ptr e) + : person (i, fn, ln, a, r, p, n), + employed_by (e) + { + } + + employee () + { + } + + shared_ptr employed_by; +}; + +#pragma db object pointer(shared_ptr) +struct employer +{ + employer (const std::string& n, shared_ptr nat) + : name (n), nationality (nat) + { + } + + employer () + { + } + + #pragma db id + std::string name; + + // The same member name and type as in person (test JOIN alias). + // + #pragma db not_null + shared_ptr nationality; +}; + +#pragma db object pointer(shared_ptr) +struct country +{ + country (const std::string& c, const std::string& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/relationship/query/testscript b/odb-tests/common/relationship/query/testscript new file mode 100644 index 0000000..d5ad419 --- /dev/null +++ b/odb-tests/common/relationship/query/testscript @@ -0,0 +1,33 @@ +# file : common/relationship/query/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/schema/embedded/basics/buildfile b/odb-tests/common/schema/embedded/basics/buildfile new file mode 100644 index 0000000..0cfe85e --- /dev/null +++ b/odb-tests/common/schema/embedded/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/schema/embedded/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_embd_bscs_ \ + --generate-schema \ + --schema-format embedded \ + --schema-name test + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/schema/embedded/basics/driver.cxx b/odb-tests/common/schema/embedded/basics/driver.cxx new file mode 100644 index 0000000..7ba2bce --- /dev/null +++ b/odb-tests/common/schema/embedded/basics/driver.cxx @@ -0,0 +1,59 @@ +// file : common/schema/embedded/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic embedded schema functionality. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv, false)); + + // Create the database schema. + // + { + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for SQLite. + // + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); + + assert (schema_catalog::exists (*db, "test")); + assert (!schema_catalog::exists (*db, "test1")); + assert (!schema_catalog::exists (*db, "")); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db, "test"); + t.commit (); + + if (db->id () == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/schema/embedded/basics/test.hxx b/odb-tests/common/schema/embedded/basics/test.hxx new file mode 100644 index 0000000..43331f9 --- /dev/null +++ b/odb-tests/common/schema/embedded/basics/test.hxx @@ -0,0 +1,23 @@ +// file : common/schema/embedded/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db object +struct object +{ + #pragma db auto id + unsigned long id; + + std::string str; + + std::vector nums; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/schema/embedded/basics/testscript b/odb-tests/common/schema/embedded/basics/testscript new file mode 100644 index 0000000..24448c0 --- /dev/null +++ b/odb-tests/common/schema/embedded/basics/testscript @@ -0,0 +1,31 @@ +# file : common/schema/embedded/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/schema/embedded/order/.gitignore b/odb-tests/common/schema/embedded/order/.gitignore new file mode 100644 index 0000000..5d39d39 --- /dev/null +++ b/odb-tests/common/schema/embedded/order/.gitignore @@ -0,0 +1,6 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test2-odb.?xx +test2-odb-*.?xx diff --git a/odb-tests/common/schema/embedded/order/buildfile b/odb-tests/common/schema/embedded/order/buildfile new file mode 100644 index 0000000..57ad7dd --- /dev/null +++ b/odb-tests/common/schema/embedded/order/buildfile @@ -0,0 +1,48 @@ +# file : common/schema/embedded/order/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_embd_ordr_ \ + --generate-schema \ + --schema-format embedded + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/schema/embedded/order/driver.cxx b/odb-tests/common/schema/embedded/order/driver.cxx new file mode 100644 index 0000000..fde5e96 --- /dev/null +++ b/odb-tests/common/schema/embedded/order/driver.cxx @@ -0,0 +1,65 @@ +// file : common/schema/embedded/order/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test statement execution order in embedded schemas. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv, false)); + odb::database_id db_id (db->id ()); + + // Create the database schema. + // + { + connection_ptr c (db->connection ()); + + // Temporarily disable foreign key constraints for MySQL and SQLite. + // For MySQL we can actually create the tables in any order. It is + // dropping them that's the problem (there is no IF EXISTS). + // + if (db_id == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=0"); + else if (db_id == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + + if (db_id == odb::id_mysql) + c->execute ("SET FOREIGN_KEY_CHECKS=1"); + else if (db_id == odb::id_sqlite) + c->execute ("PRAGMA foreign_keys=ON"); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/schema/embedded/order/test1.hxx b/odb-tests/common/schema/embedded/order/test1.hxx new file mode 100644 index 0000000..b35074b --- /dev/null +++ b/odb-tests/common/schema/embedded/order/test1.hxx @@ -0,0 +1,23 @@ +// file : common/schema/embedded/order/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include + +#include + +#pragma db object polymorphic +struct base +{ + virtual + ~base () {} + + #pragma db auto id + unsigned long id; + + std::string str; +}; + +#endif // TEST1_HXX diff --git a/odb-tests/common/schema/embedded/order/test2.hxx b/odb-tests/common/schema/embedded/order/test2.hxx new file mode 100644 index 0000000..b4e6d20 --- /dev/null +++ b/odb-tests/common/schema/embedded/order/test2.hxx @@ -0,0 +1,17 @@ +// file : common/schema/embedded/order/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include + +#include "test1.hxx" + +#pragma db object +struct derived: base +{ + int num; +}; + +#endif // TEST2_HXX diff --git a/odb-tests/common/schema/embedded/order/testscript b/odb-tests/common/schema/embedded/order/testscript new file mode 100644 index 0000000..6dfe58c --- /dev/null +++ b/odb-tests/common/schema/embedded/order/testscript @@ -0,0 +1,31 @@ +# file : common/schema/embedded/order/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/schema/namespace/buildfile b/odb-tests/common/schema/namespace/buildfile new file mode 100644 index 0000000..fa496d7 --- /dev/null +++ b/odb-tests/common/schema/namespace/buildfile @@ -0,0 +1,41 @@ +# file : common/schema/namespace/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix schema_ns_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/schema/namespace/driver.cxx b/odb-tests/common/schema/namespace/driver.cxx new file mode 100644 index 0000000..25515f2 --- /dev/null +++ b/odb-tests/common/schema/namespace/driver.cxx @@ -0,0 +1,113 @@ +// file : common/schema/namespace/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test database schemas (aka database namespaces). +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test database schema (aka database namespace). + // + using ns::object2; + + object2 o2; + o2.id = "aaa"; + o2.nums.push_back (1); + o2.nums.push_back (2); + o2.nums.push_back (3); + o2.obj1 = new object1; + o2.obj1->str = "aaa"; + + { + transaction t (db->begin ()); + db->persist (o2.obj1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p2 (db->load ("aaa")); + t.commit (); + + assert (o2 == *p2); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + { + result r (db->query (query::id == "aaa")); + assert (size (r) == 1); + } + + { + result r (db->query (query::obj1->str == "aaa")); + assert (size (r) == 1); + } + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (query::object2::id == "aaa")); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->id2 == "aaa" && i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/schema/namespace/test.hxx b/odb-tests/common/schema/namespace/test.hxx new file mode 100644 index 0000000..0b1844a --- /dev/null +++ b/odb-tests/common/schema/namespace/test.hxx @@ -0,0 +1,158 @@ +// file : common/schema/namespace/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Table names. +// +#pragma db object table("TABLE_EXPLICIT") +struct table_explicit +{ + #pragma db id + unsigned long id_; +}; + +#pragma db object +struct table_implicit +{ + #pragma db id + unsigned long id_; +}; + +// Column names. +// +#pragma db object +struct column +{ + #pragma db id + int m1; + + #pragma db column("foo") + int m2; + + int m_m3; + int _m4; + int m5_; + int m_; + int m__; +}; + +// Column types. +// +#pragma db object +struct type +{ + #pragma db id + std::string id; + + // Test default C++ to DB type mapping. + // + bool b; + char c; + signed char sc; + unsigned char uc; + short s; + unsigned short us; + int i; + unsigned int ui; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + float f; + double d; + std::string str; + + #pragma db type("INTEGER") + bool m1; + + #pragma db transient + char* m2; +}; + +// Test database schema (aka database namespace). +// +#ifdef ODB_COMPILER +#if defined (ODB_DATABASE_MYSQL) +//# define DB_SCHEMA "odb_test" +# define DB_SCHEMA "" +#elif defined (ODB_DATABASE_SQLITE) +# define DB_SCHEMA "main" +#elif defined (ODB_DATABASE_PGSQL) +# define DB_SCHEMA "public" +#elif defined (ODB_DATABASE_ORACLE) +//# define DB_SCHEMA "ODB_TEST" +# define DB_SCHEMA "" +#elif defined(ODB_DATABASE_MSSQL) +# define DB_SCHEMA "dbo" +#elif defined(ODB_DATABASE_COMMON) +# define DB_SCHEMA "dummy" +#else +# error unknown database +#endif +#endif + +namespace ns {typedef int my_int;} // Original. + +#pragma db object table(DB_SCHEMA."object_1") +struct object1 +{ + #pragma db id auto + unsigned long id; + + #pragma db column("str") + std::string str; +}; + +inline bool +operator== (const object1& x, const object1& y) +{ + return x.id == y.id && x.str == y.str; +} + +#pragma db namespace schema(DB_SCHEMA) +namespace ns // Extension. +{ + #pragma db object + struct object2 + { + object2 (): obj1 (0) {} + ~object2 () {delete obj1;} + + #pragma db id + std::string id; + + std::vector nums; + object1* obj1; + }; + + inline bool + operator== (const object2& x, const object2& y) + { + return x.id == y.id && x.nums == y.nums && *x.obj1 == *y.obj1; + } +} + +#pragma db view object(object1) object(ns::object2) +struct object_view +{ + #pragma db column(ns::object2::id) + std::string id2; + + std::string str; +}; + +#pragma db view table(DB_SCHEMA."schema_ns_object_1") +struct table_view +{ + #pragma db column(DB_SCHEMA."schema_ns_object_1"."str") + std::string str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/schema/namespace/testscript b/odb-tests/common/schema/namespace/testscript new file mode 100644 index 0000000..0fabe6e --- /dev/null +++ b/odb-tests/common/schema/namespace/testscript @@ -0,0 +1,33 @@ +# file : common/schema/namespace/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/section/basics/buildfile b/odb-tests/common/section/basics/buildfile new file mode 100644 index 0000000..5ccdd6b --- /dev/null +++ b/odb-tests/common/section/basics/buildfile @@ -0,0 +1,41 @@ +# file : common/section/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_section_b_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/section/basics/driver.cxx b/odb-tests/common/section/basics/driver.cxx new file mode 100644 index 0000000..53783a3 --- /dev/null +++ b/odb-tests/common/section/basics/driver.cxx @@ -0,0 +1,1735 @@ +// file : common/section/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object section basics. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test lazy-loaded, always updating section. + // + { + using namespace test1; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // Test updating unloaded section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.unload (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Test reloading of loaded/unloaded sections. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.unload (); + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + db->reload (o); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + db->load (o, o.s); + t.commit (); + } + + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + db->reload (o); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + typedef odb::query query; + typedef odb::result result; + + // Make sure we can access section members in queries. + // + { + transaction t (db->begin ()); + + result r (db->query (query::ss == o.ss)); + result::iterator i (r.begin ()); + + assert (i != r.end () && !i->s.loaded ()); + + db->load (*i, i->s); + assert (i->n == o.n && + i->sn == o.sn && i->ss == o.ss && i->sv == o.sv); + + assert (++i == r.end ()); + + t.commit (); + } + + // Make sure we can load/update sections without messing up the + // loaded object's image. + // + { + transaction t (db->begin ()); + + result r (db->query (query::ss == o.ss)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + + object o1; + i.load (o1); + db->load (o1, o1.s); + assert (o1.n == o.n && + o1.sn == o.sn && o1.ss == o.ss && o1.sv == o.sv); + + o.sn++; + o.ss += 'd'; + o.sv[0]++; + db->update (o, o.s); + + object o2; + i.load (o2); + db->load (o2, o2.s); + assert (o2.n == o1.n && + o2.sn == o.sn && o2.ss == o.ss && o2.sv == o.sv); + + assert (++i == r.end ()); + + t.commit (); + } + } + + // Test lazy-loaded, change-updated section. + // + { + using namespace test2; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Mark as changed. + // + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section manually. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o, o.s); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test lazy-loaded, manually-updated section. + // + { + using namespace test3; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update the object only. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Update both the object and section. + // + o.n++; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // Test detection of unloaded section update. + // + try + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->update (*p, p->s); + assert (false); + } + catch (const section_not_loaded&) + { + } + } + + // Test eager-loaded, change-updated section. + // + { + using namespace test4; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Mark as changed. + // + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test eager-loaded, manually-updated section. + // + { + using namespace test5; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update the object only. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + t.commit (); + } + + // Update both the object and section. + // + o.n++; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test value-only and container-only section. Also multiple sections + // in an object. + // + { + using namespace test6; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s1); + assert (p->s1.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv != o.sv); + + db->load (*p, p->s2); + assert (p->s2.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o, o.s1); + db->update (o, o.s2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->n != o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + t.commit (); + } + } + + // Test value-only and container-only section. Also multiple sections + // in an object. + // + { + using namespace test7; + + object o (123, "abc", true); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && + p->sn2 != o.sn2 && p->ss2 != o.ss2 && p->sb2 != o.sb2); + + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->s1.loaded ()); + assert (p->s2.loaded ()); + assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + + + t.commit (); + } + + // Update. + // + o.sn1++; + o.sn2++; + o.ss1 += 'd'; + o.ss2 += 'd'; + o.sb2 = !o.sb2; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->sn1 == o.sn1 && p->ss1 == o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + t.commit (); + } + + // Manual update of just the section. + // + o.sn1++; + o.sn2++; + o.ss1 += 'd'; + o.ss2 += 'd'; + o.sb2 = !o.sb2; + + { + transaction t (db->begin ()); + db->update (o, o.s2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s1); + db->load (*p, p->s2); + assert (p->sn1 != o.sn1 && p->ss1 != o.ss1 && + p->sn2 == o.sn2 && p->ss2 == o.ss2 && p->sb2 == o.sb2); + t.commit (); + } + } + + // Test readonly and inverse section members. + // + { + using namespace test8; + + object1 o1 (new object (123, "abc")); + object& o (*o1.p); + o.sp = &o1; + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (o1); + t.commit (); + + assert (o.s.loaded ()); + } + + { + session s; + + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + object* p (p1->p); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sp == 0); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sp->id == o.sp->id); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + session s; + + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + object* p (p1->p); + + db->load (*p, p->s); + assert (p->n == o.n && + p->sn != o.sn && p->ss == o.ss && p->sp->id == o.sp->id); + + t.commit (); + } + } + + // Test object without any columns to load or update. + // + { + using namespace test9; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (o.id == o.id && + p->sn != o.sn && p->ss != o.ss); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (o.id == o.id && + p->sn == o.sn && p->ss == o.ss); + + t.commit (); + } + + // Update object. + // + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); // No-op. + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (o.id == o.id && + p->sn != o.sn && p->ss != o.ss); + t.commit (); + } + + // Update section. + // + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (o.id == o.id && + p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + } + + // Test section without any columns or containers to update. + // + { + using namespace test10; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && p->sn != o.sn); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && p->sn == o.sn); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + + { + transaction t (db->begin ()); + db->update (o); + //db->update (o, o.s); // Error. + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn != o.sn); + t.commit (); + } + } + + // Test section with composite member. + // + { + using namespace test11; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->sc.s != o.sc.s && p->sc.v != o.sc.v); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.sc.s += 'd'; + o.sc.v[0]++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && + p->sn == o.sn && p->sc.s == o.sc.s && p->sc.v == o.sc.v); + t.commit (); + } + } + + // Test change state restoration on transaction rollback. + // + { + using namespace test12; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + o.s.change (); + + try + { + transaction t (db->begin ()); + db->update (o); + assert (!o.s.changed ()); + throw failed (); + } + catch (const failed&) + { + assert (o.s.changed ()); + } + + // Retry. Also test the object destruction before transaction + // termination case. + // + { + transaction t (db->begin ()); + { + object c (o); + db->update (c); + assert (!c.s.changed ()); + } + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + } + + // Test section accessor/modifier. + // + { + using namespace test13; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s ().loaded ()); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s ().loaded ()); + assert (p->n == o.n && p->sn != o.sn && p->ss != o.ss); + + db->load (*p, p->rw_s ()); + + assert (p->s ().loaded ()); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.ss += 'd'; + + { + transaction t (db->begin ()); + db->update (o); + db->update (o, o.s ()); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->rw_s ()); + assert (p->n == o.n && p->sn == o.sn && p->ss == o.ss); + t.commit (); + } + + // Test detection of section copy. + // + try + { + transaction t (db->begin ()); + section c (o.s ()); + db->update (o, c); + assert (false); + } + catch (const section_not_in_object&) + { + } + } + + // Test LOB in section streaming, column re-ordering. + // + { + using namespace test14; + + object o (1, 123, "\x01\x02\x03\x04\x05"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && p->sn != o.sn && p->sb != o.sb); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); + + t.commit (); + } + + // Update. + // + o.n++; + o.sn++; + o.sb.push_back ('\x06'); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n == o.n && p->sn == o.sn && p->sb == o.sb); + t.commit (); + } + + // We can also update just the section. + // + o.n++; + o.sn++; + o.sb.push_back ('\x07'); + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->n != o.n && p->sn == o.sn && p->sb == o.sb); + t.commit (); + } + } + + // Test sections and optimistic concurrency. + // + { + using namespace test15; + + object o (123, "abc"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->n == o.n && + p->sn != o.sn && p->ss != o.ss && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->n == o.n && + p->sn == o.sn && p->ss == o.ss && p->sv == o.sv); + + t.commit (); + } + + // Update object. + // + object o1 (o); + o1.n++; + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->n == o1.n && + p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.n == o1.n && + o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); + t.commit (); + } + + // Update section. + // + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->update (o1, o1.s); + assert (o.v != o1.v); + + // Double-check object version was updated. + // + { + unique_ptr p1 (db->load (o.id)); + assert (o1.v == p1->v); + } + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->n == o1.n && + p->sn == o1.sn && p->ss == o1.ss && p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.n == o1.n && + o.sn == o1.sn && o.ss == o1.ss && o.sv == o1.sv); + t.commit (); + } + + // Update changed section. + // + o1.sn++; + o1.ss += 'd'; + o1.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o1, o1.s); + + try + { + db->update (o, o.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + db->update (o, o.s); + } + + t.commit (); + } + } + + // Test container-only sections and optimistic concurrency. + // + { + using namespace test16; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->sv == o.sv); + + t.commit (); + } + + // Update object. + // + object o1 (o); + o1.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.sv == o1.sv); + t.commit (); + } + + // Update section. + // + o1.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->update (o1, o1.s); + assert (o.v != o1.v); + + // Double-check object version was updated. + // + { + unique_ptr p1 (db->load (o.id)); + assert (o1.v == p1->v); + } + + try + { + db->load (*p, p->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + assert (!p->s.loaded ()); + db->load (*p, p->s); + + assert (p->sv == o1.sv); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.sv == o1.sv); + t.commit (); + } + + // Update changed section. + // + o1.sv[0]++; + + { + transaction t (db->begin ()); + db->update (o1, o1.s); + + try + { + db->update (o, o.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + db->update (o, o.s); + } + + t.commit (); + } + } + + // Test reuse-inheritance, sections, and optimistic concurrency. + // + { + using namespace test17; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s1.loaded ()); + assert (o.s2.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + assert (p->s1n != o.s1n && p->s2v != o.s2v); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1.loaded ()); + assert (p->s2.loaded ()); + assert (p->s1n == o.s1n && p->s2v == o.s2v); + + t.commit (); + } + + object o1 (o); + + // Update object. + // + for (unsigned short s (1); s < 3; ++s) + { + o1.s1n++; + o1.s2v[0]++; + + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->update (o1); + assert (o.v != o1.v); + + try + { + switch (s) + { + case 1: db->load (*p, p->s1); break; + case 2: db->load (*p, p->s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1n == o1.s1n && p->s2v == o1.s2v); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.s1n == o1.s1n && o.s2v == o1.s2v); + t.commit (); + } + + // Update section. + // + for (unsigned short s (1); s < 3; ++s) + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + switch (s) + { + case 1: + o1.s1n++; + db->update (o1, o1.s1); + assert (o.v != o1.v); + break; + case 2: + o1.s2v[0]++; + db->update (o1, o1.s2); + assert (o.v != o1.v); + break; + default: break; + } + + try + { + switch (s) + { + case 1: db->load (*p, p->s1); break; + case 2: db->load (*p, p->s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*p); + + assert (!p->s1.loaded ()); + assert (!p->s2.loaded ()); + + db->load (*p, p->s1); + db->load (*p, p->s2); + + assert (p->s1n == o1.s1n && p->s2v == o1.s2v); + } + + db->reload (o); + assert (o.v == o1.v); + assert (o.s1n == o1.s1n && o.s2v == o1.s2v); + t.commit (); + } + + // Update changed section. + // + for (unsigned short s (1); s < 3; ++s) + { + transaction t (db->begin ()); + + switch (s) + { + case 1: + o1.s1n++; + db->update (o1, o1.s1); + break; + case 2: + o1.s2v[0]++; + db->update (o1, o1.s2); + break; + default: break; + } + + try + { + switch (s) + { + case 1: db->update (o, o.s1); break; + case 2: db->update (o, o.s2); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (o); + + switch (s) + { + case 1: db->update (o, o.s1); break; + case 2: db->update (o, o.s2); break; + default: break; + } + } + + db->reload (o1); + + t.commit (); + } + } + + // Test change-updated section and change-tracking container. + // + { + using namespace test18; + + object o (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + + assert (o.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + assert (!p->s.loaded ()); + assert (p->sn != o.sn && p->sv != o.sv); + + db->load (*p, p->s); + + assert (p->s.loaded ()); + assert (p->sn == o.sn && p->sv == o.sv); + + t.commit (); + } + + // Update but don't mark as changed. + // + o.sn++; + o.sv.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); // Automatically marked as changed. + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->sn == o.sn && p->sv == o.sv); + t.commit (); + } + + // Test updating just the section manually. + // + o.sn++; + o.sv.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o, o.s); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + db->load (*p, p->s); + assert (p->sn == o.sn && p->sv == o.sv); + t.commit (); + } + } + + // Regression: BLOB in a value type used as a map value that is in a + // section. + // + { + using namespace test19; + + object o; + o.m[1].b.assign (560, 'x'); // Size greater than the default image. + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + // Hold "old" connection to force a new set of statements/image + // buffers. + // + connection_ptr c (db->connection ()); + + transaction t (db->begin ()); + unique_ptr p (db->load (o.id)); + + db->load (*p, p->s); + assert (p->m[1].b == o.m[1].b); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/section/basics/test.hxx b/odb-tests/common/section/basics/test.hxx new file mode 100644 index 0000000..702ef8b --- /dev/null +++ b/odb-tests/common/section/basics/test.hxx @@ -0,0 +1,628 @@ +// file : common/section/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include +#include +#include + +#ifdef ODB_COMPILER +# if defined(ODB_DATABASE_PGSQL) +# define BLOB_TYPE "BYTEA" +# elif defined(ODB_DATABASE_MSSQL) +# define BLOB_TYPE "VARBINARY(max)" +# else +# define BLOB_TYPE "BLOB" +# endif +#endif + +// Test lazy-loaded, always-updated section. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test lazy-loaded, change-updated section. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test lazy-loaded, manually-updated section. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(manual) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test eager-loaded, change-updated section. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db section(s) + int sn; + + #pragma db update(change) + odb::section s; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test eager-loaded, manually-updated section. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db section(s) + int sn; + + #pragma db update(manual) + odb::section s; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test value-only and container-only section. Also multiple sections +// in an object. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s1; + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s1) + int sn; + + #pragma db section(s1) + std::string ss; + + #pragma db section(s2) + std::vector sv; + }; +} + +// Test sections and reuse inheritance. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object abstract + struct base + { + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s1; // Empty section. + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + int sn2; + }; + + #pragma db object abstract + struct interm: base + { + // Section s1 is still empty. + + #pragma db section(s2) + std::string ss2; + }; + + #pragma db object + struct derived: interm + { + #pragma db section(s1) + int sn1; + }; + + #pragma db object + struct object: derived + { + object (int n = 999, const std::string& s = "xxx", bool b = false) + { + sn1 = sn2 = n; + ss1 = ss2 = s; + sb2 = b; + } + + #pragma db section(s1) + std::string ss1; + + #pragma db section(s2) + bool sb2; + }; +} + +// Test readonly and inverse section members. +// +#pragma db namespace table("t8_") +namespace test8 +{ + struct object1; + + #pragma db object session + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx", object1* p_ = 0) + : n (n_), sn (n_), ss (s_), sp (p_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) readonly + int sn; + + #pragma db section(s) + std::string ss; + + #pragma db inverse(p) section(s) + object1* sp; + }; + + #pragma db object session + struct object1 + { + object1 (object* p_ = 0): p (p_) {} + ~object1 () {delete p;} + + #pragma db id auto + unsigned long id; + + object* p; + }; +} + +// Test object without any columns to load or update. +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx"): sn (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(manual) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + std::string ss; + }; +} + +// Test section without any columns or containers to update. +// +#pragma db namespace table("t10_") +namespace test10 +{ + #pragma db object + struct object + { + object (int n_ = 999): n (n_), sn (n_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) readonly + int sn; + }; +} + +// Test section with composite member. +// +#pragma db namespace table("t11_") +namespace test11 +{ + #pragma db value + struct comp + { + comp (int n_, const std::string& s_): s (s_) {v.push_back (n_);} + + std::string s; + std::vector v; + }; + + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), sc (n_, s_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + comp sc; + }; +} + +// Test change state restoration on transaction rollback. +// +#pragma db namespace table("t12_") +namespace test12 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + }; +} + +// Test section accessor/modifier. +// +#pragma db namespace table("t13_") +namespace test13 +{ + #pragma db object + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : n (n_), sn (n_), ss (s_) {} + + #pragma db id auto + unsigned long id; + + int n; + + #pragma db section(s_) + int sn; + + #pragma db section(s_) + std::string ss; + + public: + const odb::section& + s () const {return s_;} + + odb::section& + rw_s () {return s_;} + + private: + #pragma db load(lazy) update(manual) + odb::section s_; + }; +} + +// Test LOB in section streaming, column re-ordering. +// +#pragma db namespace table("t14_") +namespace test14 +{ + #pragma db object + struct object + { + object (unsigned long id_ = 0, int n_ = 999, const std::string& s_ = "xxx") + : id (id_), sb (s_.begin (), s_.end ()), sn (n_), n (n_) {} + + #pragma db id + unsigned long id; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) type(BLOB_TYPE) + std::vector sb; // Comes before sn. + + #pragma db section(s) + int sn; + + int n; + }; +} + +// Test sections and optimistic concurrency. +// +#pragma db namespace table("t15_") +namespace test15 +{ + #pragma db object optimistic + struct object + { + object (int n_ = 999, const std::string& s_ = "xxx") + : sn (n_), n (n_), ss (s_) {sv.push_back (n_);} + + #pragma db id auto + unsigned long id; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + int sn; + + int n; + + #pragma db section(s) + std::string ss; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test container-only sections and optimistic concurrency. +// +#pragma db namespace table("t16_") +namespace test16 +{ + #pragma db object optimistic + struct object + { + object (int n = 999) {sv.push_back (n);} + + #pragma db id auto + unsigned long id; + + #pragma db version // mssql:type("ROWVERSION") + unsigned long long v; + + #pragma db load(lazy) + odb::section s; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test reuse-inheritance, sections, and optimistic concurrency. +// +#pragma db namespace table("t17_") +namespace test17 +{ + #pragma db object optimistic sectionable abstract + struct root + { + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object + struct base: root + { + }; + + #pragma db object + struct object: base + { + object (int n = 999): s1n (n) {s2v.push_back (n);} + + #pragma db load(lazy) + odb::section s1; + + #pragma db section(s1) + int s1n; + + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + std::vector s2v; + }; +} + +// Test change-updated section and change-tracking container. +// +#pragma db namespace table("t18_") +namespace test18 +{ + #pragma db object + struct object + { + object (int n = 999): sn (n) {sv.push_back (n);} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + + #pragma db section(s) + odb::vector sv; + }; +} + +// Regression: BLOB in a value type used as a map value that is in a section. +// +#include +#include + +#pragma db namespace table("t19_") +namespace test19 +{ + #pragma db value + struct value + { + #pragma db type(BLOB_TYPE) + std::vector b; + }; + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) update(always) + odb::section s; + + #pragma db section(s) + std::map m; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/section/basics/testscript b/odb-tests/common/section/basics/testscript new file mode 100644 index 0000000..c0c6617 --- /dev/null +++ b/odb-tests/common/section/basics/testscript @@ -0,0 +1,33 @@ +# file : common/section/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/section/polymorphism/buildfile b/odb-tests/common/section/polymorphism/buildfile new file mode 100644 index 0000000..b9a7514 --- /dev/null +++ b/odb-tests/common/section/polymorphism/buildfile @@ -0,0 +1,41 @@ +# file : common/section/polymorphism/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_section_p_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/section/polymorphism/driver.cxx b/odb-tests/common/section/polymorphism/driver.cxx new file mode 100644 index 0000000..c15d317 --- /dev/null +++ b/odb-tests/common/section/polymorphism/driver.cxx @@ -0,0 +1,1807 @@ +// file : common/section/polymorphism/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test sections in polymorphic objects. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic polymorphic section functionality. + // + { + using namespace test1; + + base b (123, "abc"); + derived d (234, "bcd", true); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.rs1.loaded ()); + assert (b.rs2.loaded ()); + assert (b.rs3.loaded ()); + assert (b.rs4.loaded ()); + assert (b.bs1.loaded ()); + + assert (d.rs1.loaded ()); + assert (d.rs2.loaded ()); + assert (d.rs3.loaded ()); + assert (d.rs4.loaded ()); + assert (d.bs1.loaded ()); + assert (d.ds1.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && + pb->rs2n != b.rs2n && pb->rs2v != b.rs2v && + pb->rs3v != b.rs3v && + pb->rs4n != b.rs4n && + pb->bs1n != b.bs1n); + + assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && + pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && + pd->rs2n != d.rs2n && pd->rs2v != d.rs2v && + pd->rs3v != d.rs3v && pd->rs3n != d.rs3n && + pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && + pd->bs1n != d.bs1n && pd->bs1s != d.bs1s && + pd->ds1n != d.ds1n); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + root* pr (pd.get ()); + db->load (*pr, pr->rs1); // Via base. + db->load (*pd, pd->rs2); + db->load (*pr, pr->rs3); // Via base. + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + try + { + db->load (*pr, pd->bs1); // Object-section association is static. + assert (false); + } + catch (const section_not_in_object&) {} + + assert (pb->rs1.loaded ()); + assert (pb->rs2.loaded ()); + assert (pb->rs3.loaded ()); + assert (pb->rs4.loaded ()); + assert (pb->bs1.loaded ()); + + assert (pd->rs1.loaded ()); + assert (pd->rs2.loaded ()); + assert (pd->rs3.loaded ()); + assert (pd->rs4.loaded ()); + assert (pd->bs1.loaded ()); + assert (pd->ds1.loaded ()); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Update object. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs1.change (); + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs1.change (); + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + db->update (b); + db->update (d); + t.commit (); + + assert (!b.rs1.changed ()); + assert (!d.rs1.changed ()); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Update section. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + db->update (b, b.rs1); + db->update (b, b.rs2); + db->update (b, b.rs3); + db->update (b, b.rs4); + db->update (b, b.bs1); + + db->update (d, d.rs1); + db->update (d, d.rs2); + db->update (d, d.rs3); + db->update (d, d.rs4); + db->update (d, d.bs1); + db->update (d, d.ds1); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + t.commit (); + } + + // Reload. + // + b.rs1n++; + b.rs1s += 'd'; + b.rs1.change (); + b.rs2n++; + b.rs2v[0]++; + b.rs3v[0]++; + b.rs4n++; + b.bs1n++; + + d.rs1n++; + d.rs1s += 'e'; + d.rs1b = !d.rs1b; + d.rs1v[0]++; + d.rs1.change (); + d.rs2n++; + d.rs2v[0]++; + d.rs3v[0]++; + d.rs3n++; + d.rs4n++; + d.rs4s += 'e'; + d.bs1n++; + d.bs1s += 'e'; + d.ds1n++; + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + db->update (b); + db->update (d); + + db->reload (*pb); + db->reload (*pd); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && pb->rs2v == b.rs2v && + pb->rs3v == b.rs3v && + pb->rs4n == b.rs4n && + pb->bs1n == b.bs1n); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && pd->rs2v == d.rs2v && + pd->rs3v == d.rs3v && pd->rs3n == d.rs3n && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->bs1n == d.bs1n && pd->bs1s == d.bs1s && + pd->ds1n == d.ds1n); + + t.commit (); + } + } + + // Test empty section and override "gap". + // + { + using namespace test2; + + derived d (234); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn && pd->sv != d.sv); + + root* pr (pd.get ()); + db->load (*pr, pr->s); // Via root. + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Update object. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + root* pr (&d); + db->update (pr); // Via root. + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + base* pb (pd.get ()); + db->load (*pb, pb->s); // Via base. + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Update section. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + root* pr (&d); + db->update (*pr, pr->s); // Via root. + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->load (*pd, pd->s); + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + + // Reload. + // + d.sn++; + d.sv[0]++; + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->load (*pd, pd->s); + + db->update (d); + + root* pr (pd.get ()); + db->reload (*pr); + + assert (pd->sn == d.sn && pd->sv == d.sv); + t.commit (); + } + } + + // Test value-only/container-only base/override combinations. + // + { + using namespace test3; + + root r (123); + base b (234); + derived d (345, "abc"); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + + assert (r.s1.loaded ()); + assert (r.s2.loaded ()); + assert (r.s3.loaded ()); + assert (r.s4.loaded ()); + + assert (b.s1.loaded ()); + assert (b.s2.loaded ()); + assert (b.s3.loaded ()); + assert (b.s4.loaded ()); + + assert (d.s1.loaded ()); + assert (d.s2.loaded ()); + assert (d.s3.loaded ()); + assert (d.s4.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + assert (!pr->s1.loaded ()); + assert (!pr->s2.loaded ()); + assert (!pr->s3.loaded ()); + assert (!pr->s4.loaded ()); + + assert (!pb->s1.loaded ()); + assert (!pb->s2.loaded ()); + assert (!pb->s3.loaded ()); + assert (!pb->s4.loaded ()); + + assert (!pd->s1.loaded ()); + assert (!pd->s2.loaded ()); + assert (!pd->s3.loaded ()); + assert (!pd->s4.loaded ()); + + assert (pr->s1n != r.s1n && + pr->s2n != r.s2n && + pr->s3v != r.s3v && + pr->s4nv != r.s4nv); + + assert (pb->s1n != b.s1n && + pb->s2n != b.s2n && + pb->s3v != b.s3v && + pb->s4nv != b.s4nv); + + assert (pd->s1n != d.s1n && pd->s1s != d.s1s && + pd->s2n != d.s2n && pd->s2v != d.s2v && + pd->s3v != d.s3v && pd->s3n != d.s3n && + pd->s4nv != d.s4nv && pd->s4sv != d.s4sv); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + root* pdr (pd.get ()); + db->load (*pdr, pdr->s1); + db->load (*pdr, pdr->s2); + db->load (*pdr, pdr->s3); + db->load (*pdr, pdr->s4); + + assert (pr->s1.loaded ()); + assert (pr->s2.loaded ()); + assert (pr->s3.loaded ()); + assert (pr->s4.loaded ()); + + assert (pb->s1.loaded ()); + assert (pb->s2.loaded ()); + assert (pb->s3.loaded ()); + assert (pb->s4.loaded ()); + + assert (pd->s1.loaded ()); + assert (pd->s2.loaded ()); + assert (pd->s3.loaded ()); + assert (pd->s4.loaded ()); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Update object. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + db->update (r); + db->update (b); + db->update (d); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Update section. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + db->update (r, r.s1); + db->update (r, r.s2); + db->update (r, r.s3); + db->update (r, r.s4); + + db->update (b, b.s1); + db->update (b, b.s2); + db->update (b, b.s3); + db->update (b, b.s4); + + root& rr (d); + db->update (rr, rr.s1); + db->update (rr, rr.s2); + db->update (rr, rr.s3); + db->update (rr, rr.s4); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + + // Reload. + // + r.s1n++; + r.s2n++; + r.s3v[0]++; + r.s4nv[0]++; + + b.s1n++; + b.s2n++; + b.s3v[0]++; + b.s4nv[0]++; + + d.s1n++; + d.s1s += 'd'; + d.s2n++; + d.s2v[0]++; + d.s3v[0]++; + d.s3n++; + d.s4nv[0]++; + d.s4sv[0] += 'd'; + + { + transaction t (db->begin ()); + unique_ptr pr (db->load (r.id)); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->load (*pr, pr->s1); + db->load (*pr, pr->s2); + db->load (*pr, pr->s3); + db->load (*pr, pr->s4); + + db->load (*pb, pb->s1); + db->load (*pb, pb->s2); + db->load (*pb, pb->s3); + db->load (*pb, pb->s4); + + db->load (*pd, pd->s1); + db->load (*pd, pd->s2); + db->load (*pd, pd->s3); + db->load (*pd, pd->s4); + + db->update (r); + db->update (b); + db->update (d); + + db->reload (*pr); + db->reload (*pb); + db->reload (*pd); + + assert (pr->s1n == r.s1n && + pr->s2n == r.s2n && + pr->s3v == r.s3v && + pr->s4nv == r.s4nv); + + assert (pb->s1n == b.s1n && + pb->s2n == b.s2n && + pb->s3v == b.s3v && + pb->s4nv == b.s4nv); + + assert (pd->s1n == d.s1n && pd->s1s == d.s1s && + pd->s2n == d.s2n && pd->s2v == d.s2v && + pd->s3v == d.s3v && pd->s3n == d.s3n && + pd->s4nv == d.s4nv && pd->s4sv == d.s4sv); + t.commit (); + } + } + + // Test basic polymorphic optimistic section functionality. + // + { + using namespace test4; + + base b (123, "abc"); + derived d (234, "bcd", true); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.rs1.loaded ()); + assert (b.rs2.loaded ()); + assert (b.rs3.loaded ()); + assert (b.rs4.loaded ()); + assert (b.bs1.loaded ()); + + assert (d.rs1.loaded ()); + assert (d.rs2.loaded ()); + assert (d.rs3.loaded ()); + assert (d.rs4.loaded ()); + assert (d.bs1.loaded ()); + assert (d.ds1.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + assert (pb->rs1n != b.rs1n && pb->rs1s != b.rs1s && + pb->rs2n != b.rs2n && + pb->rs3n != b.rs3n && + pb->rs4n != b.rs4n && pb->rs4s != b.rs4s); + + assert (pd->rs1n != d.rs1n && pd->rs1s != d.rs1s && + pd->rs1b != d.rs1b && pd->rs1v != d.rs1v && + pd->rs2n != d.rs2n && + pd->rs3n != d.rs3n && pd->rs3s != d.rs3s && + pd->rs4n != d.rs4n && pd->rs4s != d.rs4s && + pd->rs4v != d.rs4v && + pd->bs1n != d.bs1n && + pd->ds1v != d.ds1v); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + root* pr (pd.get ()); + db->load (*pr, pr->rs1); // Via base. + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pr, pr->rs4); // Via base. + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pb->rs1.loaded ()); + assert (pb->rs2.loaded ()); + assert (pb->rs3.loaded ()); + assert (pb->rs4.loaded ()); + assert (pb->bs1.loaded ()); + + assert (pd->rs1.loaded ()); + assert (pd->rs2.loaded ()); + assert (pd->rs3.loaded ()); + assert (pd->rs4.loaded ()); + assert (pd->bs1.loaded ()); + assert (pd->ds1.loaded ()); + + assert (pb->rs1n == b.rs1n && pb->rs1s == b.rs1s && + pb->rs2n == b.rs2n && + pb->rs3n == b.rs3n && + pb->rs4n == b.rs4n && pb->rs4s == b.rs4s); + + assert (pd->rs1n == d.rs1n && pd->rs1s == d.rs1s && + pd->rs1b == d.rs1b && pd->rs1v == d.rs1v && + pd->rs2n == d.rs2n && + pd->rs3n == d.rs3n && pd->rs3s == d.rs3s && + pd->rs4n == d.rs4n && pd->rs4s == d.rs4s && + pd->rs4v == d.rs4v && + pd->bs1n == d.bs1n && + pd->ds1v == d.ds1v); + t.commit (); + } + + base b1 (b); + derived d1 (d); + + // Update object. + // + for (unsigned short s (1); s < 7; ++s) + { + b1.rs1n++; + b1.rs1s += 'd'; + b1.rs1.change (); + b1.rs4s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + d1.rs1.change (); + d1.rs4s += 'e'; + d1.rs4v[0]++; + d1.bs1n++; + d1.ds1v[0]++; + + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + db->update (b1); + db->update (d1); + + assert (!b1.rs1.changed ()); + assert (!d1.rs1.changed ()); + + assert (b.v != b1.v); + assert (d.v != d1.v); + + try + { + bool a (false); + switch (s) + { + case 1: db->load (*pb, pb->rs1); break; + case 2: db->load (*pb, pb->rs2); break; + case 3: db->load (*pb, pb->rs3); break; + case 4: db->load (*pb, pb->rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (*pb); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->bs1.loaded ()); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && + pb->rs2n == b1.rs2n && + pb->rs3n == b1.rs3n && + pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); + } + + try + { + switch (s) + { + case 1: db->load (*pd, pd->rs1); break; + case 2: db->load (*pd, pd->rs2); break; + case 3: db->load (*pd, pd->rs3); break; + case 4: db->load (*pd, pd->rs4); break; + case 5: db->load (*pd, pd->bs1); break; + case 6: db->load (*pd, pd->ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && + pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && + pd->rs2n == d1.rs2n && + pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && + pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && + pd->rs4v == d1.rs4v && + pd->bs1n == d1.bs1n && + pd->ds1v == d1.ds1v); + } + + db->reload (b); + db->reload (d); + + assert (b.v == b1.v); + assert (d.v == d1.v); + + assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && + b.rs2n == b1.rs2n && + b.rs3n == b1.rs3n && + b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); + + assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && + d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && + d.rs2n == d1.rs2n && + d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && + d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && + d.rs4v == d1.rs4v && + d.bs1n == d1.bs1n && + d.ds1v == d1.ds1v); + + t.commit (); + } + + // Update section. + // + for (unsigned short s (1); s < 7; ++s) + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + switch (s) + { + case 1: + b1.rs1n++; + b1.rs1s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + + db->update (b1, b1.rs1); + db->update (d1, d1.rs1); + + assert (b.v != b1.v); + assert (d.v != d1.v); + break; + case 2: + db->update (b1, b1.rs2); // No-op. + db->update (d1, d1.rs2); // No-op. + + assert (b.v == b1.v); + assert (d.v == d1.v); + continue; // Object hasn't changed. + case 3: + db->update (b1, b1.rs3); // No-op. + db->update (d1, d1.rs3); // No-op. + + assert (b.v == b1.v); + assert (d.v == d1.v); + continue; // Object hasn't changed. + case 4: + b1.rs4s += 'd'; + + d1.rs4s += 'e'; + d1.rs4v[0]++; + + db->update (b1, b1.rs4); + db->update (d1, d1.rs4); + + assert (b.v != b1.v); + assert (d.v != d1.v); + break; + case 5: + d1.bs1n++; + + db->update (b1, b1.bs1); // No-op. + db->update (d1, d1.bs1); + + assert (b.v == b1.v); + assert (d.v != d1.v); + break; + case 6: + d1.ds1v[0]++; + + db->update (d1, d1.ds1); + + assert (d.v != d1.v); + break; + default: break; + } + + try + { + bool a (false); + switch (s) + { + case 1: db->load (*pb, pb->rs1); break; + case 4: db->load (*pb, pb->rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (*pb); + + assert (!pb->rs1.loaded ()); + assert (!pb->rs2.loaded ()); + assert (!pb->rs3.loaded ()); + assert (!pb->rs4.loaded ()); + assert (!pb->bs1.loaded ()); + + db->load (*pb, pb->rs1); + db->load (*pb, pb->rs2); + db->load (*pb, pb->rs3); + db->load (*pb, pb->rs4); + db->load (*pb, pb->bs1); // No-op. + + assert (pb->rs1n == b1.rs1n && pb->rs1s == b1.rs1s && + pb->rs2n == b1.rs2n && + pb->rs3n == b1.rs3n && + pb->rs4n == b1.rs4n && pb->rs4s == b1.rs4s); + } + + try + { + switch (s) + { + case 1: db->load (*pd, pd->rs1); break; + case 4: db->load (*pd, pd->rs4); break; + case 5: db->load (*pd, pd->bs1); break; + case 6: db->load (*pd, pd->ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + + assert (!pd->rs1.loaded ()); + assert (!pd->rs2.loaded ()); + assert (!pd->rs3.loaded ()); + assert (!pd->rs4.loaded ()); + assert (!pd->bs1.loaded ()); + assert (!pd->ds1.loaded ()); + + db->load (*pd, pd->rs1); + db->load (*pd, pd->rs2); + db->load (*pd, pd->rs3); + db->load (*pd, pd->rs4); + db->load (*pd, pd->bs1); + db->load (*pd, pd->ds1); + + assert (pd->rs1n == d1.rs1n && pd->rs1s == d1.rs1s && + pd->rs1b == d1.rs1b && pd->rs1v == d1.rs1v && + pd->rs2n == d1.rs2n && + pd->rs3n == d1.rs3n && pd->rs3s == d1.rs3s && + pd->rs4n == d1.rs4n && pd->rs4s == d1.rs4s && + pd->rs4v == d1.rs4v && + pd->bs1n == d1.bs1n && + pd->ds1v == d1.ds1v); + } + + db->reload (b); + db->reload (d); + + assert (b.v == b1.v); + assert (d.v == d1.v); + + assert (b.rs1n == b1.rs1n && b.rs1s == b1.rs1s && + b.rs2n == b1.rs2n && + b.rs3n == b1.rs3n && + b.rs4n == b1.rs4n && b.rs4s == b1.rs4s); + + assert (d.rs1n == d1.rs1n && d.rs1s == d1.rs1s && + d.rs1b == d1.rs1b && d.rs1v == d1.rs1v && + d.rs2n == d1.rs2n && + d.rs3n == d1.rs3n && d.rs3s == d1.rs3s && + d.rs4n == d1.rs4n && d.rs4s == d1.rs4s && + d.rs4v == d1.rs4v && + d.bs1n == d1.bs1n && + d.ds1v == d1.ds1v); + + t.commit (); + } + + // Update changed section. + // + for (unsigned short s (1); s < 7; ++s) + { + if (s == 2 || s == 3) // Readonly sections. + continue; + + transaction t (db->begin ()); + + switch (s) + { + case 1: + b1.rs1n++; + b1.rs1s += 'd'; + + d1.rs1n++; + d1.rs1s += 'e'; + d1.rs1b = !d.rs1b; + d1.rs1v[0]++; + + db->update (b1, b1.rs1); + db->update (d1, d1.rs1); + break; + case 4: + b1.rs4s += 'd'; + + d1.rs4s += 'e'; + d1.rs4v[0]++; + + db->update (b1, b1.rs4); + db->update (d1, d1.rs4); + break; + case 5: + d1.bs1n++; + + db->update (b1, b1.bs1); // No-op. + db->update (d1, d1.bs1); + break; + case 6: + d1.ds1v[0]++; + + db->update (d1, d1.bs1); + break; + default: break; + } + + try + { + bool a (false); + switch (s) + { + case 1: db->update (b, b.rs1); break; + case 4: db->update (b, b.rs4); break; + case 5: + case 6: a = true; break; // No-op. + default: break; + } + assert (a); + } + catch (const object_changed&) + { + db->reload (b); + + switch (s) + { + case 1: db->update (b, b.rs1); break; + case 4: db->update (b, b.rs4); break; + default: break; + } + } + + try + { + switch (s) + { + case 1: db->update (d, d.rs1); break; + case 4: db->update (d, d.rs4); break; + case 5: db->update (d, d.bs1); break; + case 6: db->update (d, d.ds1); break; + default: break; + } + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + + switch (s) + { + case 1: db->update (d, d.rs1); break; + case 4: db->update (d, d.rs4); break; + case 5: db->update (d, d.bs1); break; + case 6: db->update (d, d.ds1); break; + default: break; + } + } + + db->reload (b1); + db->reload (d1); + + t.commit (); + } + } + + // Test polymorphic optimistic readonly/empty to readwrite section + // override. + // + { + using namespace test5; + + base b; + derived d (123); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.s.loaded ()); + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + assert (!pb->s.loaded ()); + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pb, pb->s); // No-op. + db->load (*pd, pd->s); + + assert (pb->s.loaded ()); + assert (pd->s.loaded ()); + + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + base b1 (b); + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (b1, b1.s); // No-op. + db->update (d1, d1.s); + + assert (b.v == b1.v); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test polymorphic optimistic readonly/empty to readwrite section + // override, eager-loaded case. + // + { + using namespace test6; + + derived d (123); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + + db->update (d1, d1.s); + assert (d.v != d1.v); + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test polymorphic optimistic section added in derived. + // + { + using namespace test7; + + base b; + derived d (123); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d); + t.commit (); + + assert (b.s.loaded ()); + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pb (db->load (b.id)); + unique_ptr pd (db->load (d.id)); + + assert (!pb->s.loaded ()); + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pb, pb->s); // No-op. + db->load (*pd, pd->s); + + assert (pb->s.loaded ()); + assert (pd->s.loaded ()); + + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + base b1 (b); + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (b1, b1.s); // No-op. + db->update (d1, d1.s); + + assert (b.v == b1.v); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test reuse/polymorphic inheritance and optimistic mix. + // + { + using namespace test8; + + derived d (123); + + { + transaction t (db->begin ()); + db->persist (d); + t.commit (); + + assert (d.s.loaded ()); + } + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + assert (!pd->s.loaded ()); + assert (pd->sn != d.sn); + + db->load (*pd, pd->s); + + assert (pd->s.loaded ()); + assert (pd->sn == d.sn); + + t.commit (); + } + + // Update object. + // + derived d1 (d); + d1.sn++; + d1.s.change (); + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (d1); + + assert (!d1.s.changed ()); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update section. + // + d1.sn++; + + { + transaction t (db->begin ()); + unique_ptr pd (db->load (d.id)); + + db->update (d1, d1.s); + assert (d.v != d1.v); + + try + { + db->load (*pd, pd->s); + assert (false); + } + catch (const object_changed&) + { + db->reload (*pd); + assert (!pd->s.loaded ()); + db->load (*pd, pd->s); + + assert (pd->sn == d1.sn); + } + + db->reload (d); + assert (d.v == d1.v); + assert (d.sn == d1.sn); + t.commit (); + } + + // Update changed section. + // + d1.sn++; + + { + transaction t (db->begin ()); + db->update (d1, d1.s); + + try + { + db->update (d, d.s); + assert (false); + } + catch (const object_changed&) + { + db->reload (d); + db->update (d, d.s); + } + + t.commit (); + } + } + + // Test reuse/polymorphic inheritance and optimistic mix. + // + { + using namespace test9; + using std::shared_ptr; + + unsigned long long id; + + { + container c (123); + + c.e1.push_back (shared_ptr (new element (11))); + c.e1.push_back (shared_ptr (new element (12))); + + c.e2.push_back (shared_ptr (new element (21))); + c.e2.push_back (shared_ptr (new element (22))); + + transaction t (db->begin ()); + + db->persist (c.e1[0]); + db->persist (c.e1[1]); + db->persist (c.e2[0]); + db->persist (c.e2[1]); + + id = db->persist (c); + + t.commit (); + } + + { + transaction t (db->begin ()); + + shared_ptr c (db->load (id)); + + assert (c->n == 123); + db->load (*c, c->s); + assert (c->e1.size () == 2 && c->e1[0]->n == 11 && c->e1[1]->n == 12); + assert (c->e2.size () == 2 && c->e2[0]->n == 21 && c->e2[1]->n == 22); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/section/polymorphism/test.hxx b/odb-tests/common/section/polymorphism/test.hxx new file mode 100644 index 0000000..6d524bd --- /dev/null +++ b/odb-tests/common/section/polymorphism/test.hxx @@ -0,0 +1,542 @@ +// file : common/section/polymorphism/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include + +#include +#include + +// Test basic polymorphic section functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db object polymorphic abstract + struct root + { + root (int n): rs1n (n), rs2n (n), rs4n (n) {rs2v.push_back (n);} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + // rs1: override in base and derived + // + #pragma db load(lazy) update(change) + odb::section rs1; + + #pragma db section(rs1) + int rs1n; + + // rs2: no override + // + #pragma db load(lazy) + odb::section rs2; + + #pragma db section(rs2) + int rs2n; + + #pragma db section(rs2) + std::vector rs2v; + + // rs3: empty + // + #pragma db load(lazy) + odb::section rs3; + + // rs4: override "gap" + // + #pragma db load(lazy) + odb::section rs4; + + #pragma db section(rs4) + int rs4n; + }; + + #pragma db object + struct base: root + { + base (int n = 999, const std::string& s = "xxx") + : root (n), rs1s (s), bs1n (n) {rs3v.push_back (n);} + + // rs1 + // + #pragma db section(rs1) + std::string rs1s; + + // rs3 + // + #pragma db section(rs3) + std::vector rs3v; + + // bs1: override in derived + // + #pragma db load(lazy) + odb::section bs1; + + #pragma db section(bs1) + int bs1n; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx", bool b = false) + : base (n, s), rs1b (b), rs3n (n), rs4s (s), bs1s (s), ds1n (n) + {rs1v.push_back (n);} + + // rs1 + // + #pragma db section(rs1) + bool rs1b; + + #pragma db section(rs1) + std::vector rs1v; + + // rs3 + // + #pragma db section(rs3) + int rs3n; + + // rs4 + // + #pragma db section(rs4) + std::string rs4s; + + // bs1 + // + #pragma db section(bs1) + std::string bs1s; + + // ds1: no override + // + #pragma db load(lazy) + odb::section ds1; + + #pragma db section(ds1) + int ds1n; + }; +} + +// Test empty section and override "gap". +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object polymorphic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db load(lazy) + odb::section s; + }; + + #pragma db object abstract + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {sv.push_back (n);} + + #pragma db section(s) + int sn; + + #pragma db section(s) + std::vector sv; + }; +} + +// Test value-only/container-only base/override combinations. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db object polymorphic + struct root + { + root (int n = 999) + : s1n (n), s2n (n) {s3v.push_back (n); s4nv.push_back (n);} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + // value/value + // + #pragma db load(lazy) + odb::section s1; + + #pragma db section(s1) + int s1n; + + // value/container + // + #pragma db load(lazy) + odb::section s2; + + #pragma db section(s2) + int s2n; + + // container/value + // + #pragma db load(lazy) + odb::section s3; + + #pragma db section(s3) + std::vector s3v; + + // container/container + // + #pragma db load(lazy) + odb::section s4; + + #pragma db section(s4) + std::vector s4nv; + }; + + #pragma db object + struct base: root + { + base (int n = 999): root (n) {} + + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx") + : base (n), s1s (s), s3n (n) {s2v.push_back (n); s4sv.push_back (s);} + + #pragma db section(s1) + std::string s1s; + + #pragma db section(s2) + std::vector s2v; + + #pragma db section(s3) + int s3n; + + #pragma db section(s4) + std::vector s4sv; + }; +} + +// Test basic polymorphic optimistic section functionality. +// +#pragma db namespace table("t4_") +namespace test4 +{ + #pragma db object polymorphic optimistic abstract sectionable + struct root + { + root (int n): rs1n (n), rs2n (n), rs3n (n), rs4n (n) {} + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + // rs1: readwrite, override + // + #pragma db load(lazy) update(change) + odb::section rs1; + + #pragma db section(rs1) + int rs1n; + + // rs2: readonly, no override + // + #pragma db load(lazy) + odb::section rs2; + + #pragma db section(rs2) + const int rs2n; + + // rs3: readonly, readonly override + // + #pragma db load(lazy) + odb::section rs3; + + #pragma db section(rs3) + const int rs3n; + + // rs4: readonly, readwrite override + // + #pragma db load(lazy) + odb::section rs4; + + #pragma db section(rs4) + const int rs4n; + }; + + #pragma db object + struct base: root + { + base (int n = 999, const std::string& s = "xxx") + : root (n), rs1s (s), rs4s (s) {} + + // rs1 + // + #pragma db section(rs1) + std::string rs1s; + + // rs4 + // + #pragma db section(rs4) + std::string rs4s; + + // bs2: empty, readwrite override + // + #pragma db load(lazy) + odb::section bs1; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999, const std::string& s = "xxx", bool b = false) + : base (n, s), rs1b (b), rs3s (s), bs1n (n) + { + rs1v.push_back (n); + rs4v.push_back (n); + ds1v.push_back (n); + } + + // rs1 + // + #pragma db section(rs1) + bool rs1b; + + #pragma db section(rs1) + std::vector rs1v; + + // rs3 + // + #pragma db section(rs3) + const std::string rs3s; + + // rs4 + // + #pragma db section(rs4) + std::vector rs4v; + + // bs1 + // + #pragma db section(bs1) + int bs1n; + + // ds1: readwrite + // + #pragma db load(lazy) + odb::section ds1; + + #pragma db section(ds1) + std::vector ds1v; + }; +} + +// Test polymorphic optimistic readonly/empty to readwrite section override. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db object polymorphic optimistic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + #pragma db load(lazy) update(change) + odb::section s; + }; + + #pragma db object + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test polymorphic optimistic readonly/empty to readwrite section override, +// eager-loaded case. +// +#pragma db namespace table("t6_") +namespace test6 +{ + #pragma db object polymorphic optimistic abstract + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + + #pragma db update(change) + odb::section s; + }; + + #pragma db object abstract + struct base: root + { + // The "gap". + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test polymorphic optimistic section added in derived. +// +#pragma db namespace table("t7_") +namespace test7 +{ + #pragma db object polymorphic optimistic sectionable + struct root + { + virtual ~root () {} + + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object + struct base: root + { + #pragma db load(lazy) update(change) + odb::section s; + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db section(s) + int sn; + }; +} + +// Test reuse/polymorphic inheritance and optimistic mix. +// +#pragma db namespace table("t8_") +namespace test8 +{ + #pragma db object optimistic sectionable abstract + struct root + { + #pragma db id auto + unsigned long id; + + #pragma db version + unsigned long long v; + }; + + #pragma db object polymorphic sectionable + struct base: root + { + virtual ~base () {} + }; + + #pragma db object + struct derived: base + { + derived (int n = 999): sn (n) {} + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + int sn; + }; +} + +// Test id overwrite regression. +// +// The key here is the setup: the object that contains the containers in a +// section and the pointers to objects stored in those containers. And these +// objects derive polymorphically from the same base (and thus shared the id +// bindind). +// +#pragma db namespace table("t9_") +namespace test9 +{ + #pragma db object polymorphic pointer(std::shared_ptr) + struct base + { + virtual ~base () {} + + #pragma db id auto + unsigned long id; + }; + + #pragma db object + struct element: base + { + element (int n_ = 0): n (n_) {} + + int n; + }; + + typedef std::vector> elements; + + #pragma db object + struct container: base + { + container (int n_ = 0): n (n_) {} + + int n; + + #pragma db load(lazy) update(always) + odb::section s; + + #pragma db section(s) + elements e1; + + #pragma db section(s) + elements e2; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/section/polymorphism/testscript b/odb-tests/common/section/polymorphism/testscript new file mode 100644 index 0000000..f2cd536 --- /dev/null +++ b/odb-tests/common/section/polymorphism/testscript @@ -0,0 +1,33 @@ +# file : common/section/polymorphism/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/session/cache/buildfile b/odb-tests/common/session/cache/buildfile new file mode 100644 index 0000000..6d5b0bc --- /dev/null +++ b/odb-tests/common/session/cache/buildfile @@ -0,0 +1,41 @@ +# file : common/session/cache/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix session_cache_ \ + --generate-schema \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/session/cache/driver.cxx b/odb-tests/common/session/cache/driver.cxx new file mode 100644 index 0000000..4b4ea12 --- /dev/null +++ b/odb-tests/common/session/cache/driver.cxx @@ -0,0 +1,83 @@ +// file : common/session/cache/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test session object cache. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test the session_required exception. + // + { + using namespace test1; + + shared_ptr o1a (new obj1 (1)); + shared_ptr o1b (new obj1 (2)); + shared_ptr o2 (new obj2 (1)); + + o1a->o2 = o2; + o1b->o2 = o2; + + o2->o1.push_back (o1a); + o2->o1.push_back (o1b); + + { + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o1b); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + + try + { + shared_ptr o1 (db->load (1)); + assert (false); + } + catch (const session_required&) + { + } + + t.commit (); + } + + { + session s; + transaction t (db->begin ()); + shared_ptr o1 (db->load (1)); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/session/cache/test.hxx b/odb-tests/common/session/cache/test.hxx new file mode 100644 index 0000000..d2b1b2b --- /dev/null +++ b/odb-tests/common/session/cache/test.hxx @@ -0,0 +1,50 @@ +// file : common/session/cache/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Test the session_required exception. +// +#pragma db namespace table("t1_") +namespace test1 +{ + using std::shared_ptr; + using std::weak_ptr; + + #pragma db namespace(test1) pointer(shared_ptr) + + struct obj2; + + #pragma db object + struct obj1 + { + obj1 () {} + obj1 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + shared_ptr o2; + }; + + #pragma db object + struct obj2 + { + obj2 () {} + obj2 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db inverse (o2) + std::vector< weak_ptr > o1; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/session/cache/testscript b/odb-tests/common/session/cache/testscript new file mode 100644 index 0000000..6d013eb --- /dev/null +++ b/odb-tests/common/session/cache/testscript @@ -0,0 +1,33 @@ +# file : common/session/cache/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/session/custom/buildfile b/odb-tests/common/session/custom/buildfile new file mode 100644 index 0000000..1b64de1 --- /dev/null +++ b/odb-tests/common/session/custom/buildfile @@ -0,0 +1,43 @@ +# file : common/session/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx txx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix session_custom_ \ + --generate-schema \ + --generate-session \ + --session-type ::session \ + --hxx-prologue '#include "session.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/session/custom/driver.cxx b/odb-tests/common/session/custom/driver.cxx new file mode 100644 index 0000000..3056fd6 --- /dev/null +++ b/odb-tests/common/session/custom/driver.cxx @@ -0,0 +1,231 @@ +// file : common/session/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom session (C++11 only). +// + +#include +#include // std::size_t +#include + +#include +#include +#include +#include +#include // ODB_CXX11_* + +#include + +#include "session.hxx" + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; + +using odb::database; +using odb::transaction; + +struct counting_tracer: odb::tracer +{ + virtual void + execute (odb::connection&, const char*) {count++;} + size_t count; +}; + +static counting_tracer tracer; + +struct failed {}; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Simple Tech Ltd. + // + { + shared_ptr er (new employer ("Simple Tech Ltd", "ST")); + + shared_ptr john (new employee ("John", "Doe", er)); + shared_ptr jane (new employee ("Jane", "Doe", er)); + + transaction t (db->begin ()); + + db->persist (er); + db->persist (john); + db->persist (jane); + + t.commit (); + } + + // Complex Systems Inc. + // + { + shared_ptr er (new employer ("Complex Systems Inc", "CS")); + + shared_ptr john (new employee ("John", "Smith", er)); + shared_ptr jane (new employee ("Jane", "Smith", er)); + + transaction t (db->begin ()); + + db->persist (er); + db->persist (john); + db->persist (jane); + + t.commit (); + } + + { + session s; + shared_ptr st, cs; + shared_ptr ste, cse; + + { + transaction t (db->begin ()); + + st = db->load ("Simple Tech Ltd"); +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT + ste = db->load (st->employees ()[0].object_id ()); +#else + ste = db->load (st->employees ()[0].object_id ()); +#endif + + // Test object cache. + // + shared_ptr e (st->employees ()[0].load ()); + assert (ste->employer () == st); + assert (ste == e); + + t.commit (); + } + + { + transaction t (db->begin ()); + + cs = db->load ("Complex Systems Inc"); +#ifdef ODB_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGUMENT + cse = db->load (cs->employees ()[0].object_id ()); +#else + cse = db->load (cs->employees ()[0].object_id ()); +#endif + cs->employees ()[0].load (); + + t.commit (); + } + + cs->symbol ("CSI"); + + // Swap employees. + // + ste->employer (cs); + cse->employer (st); + st->employees ()[0] = cse; + cs->employees ()[0] = ste; + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 3); + t.commit (); + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + + cs->symbol ("COMP"); + st->symbol ("SMPL"); + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 2); + t.commit (); + } + + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 0); + t.commit (); + } + + // Explicit update. + // + cs->symbol ("CS"); + st->symbol ("ST"); + + { + transaction t (db->begin ()); + db->update (cs); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + t.commit (); + } + + // Rollback after update. + // + cs->symbol ("CSI"); + + try + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + throw failed (); + t.commit (); + } + catch (const failed&) + { + transaction t (db->begin ()); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + t.commit (); + } + } + + // Test session destruction before transaction is commited. + // + { + transaction t (db->begin ()); + { + session s; + shared_ptr st (db->load ("Simple Tech Ltd")); + st->symbol ("STL"); + tracer.count = 0; + t.tracer (tracer); + s.flush (*db); + assert (tracer.count == 1); + } + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/session/custom/session.cxx b/odb-tests/common/session/custom/session.cxx new file mode 100644 index 0000000..1a08c79 --- /dev/null +++ b/odb-tests/common/session/custom/session.cxx @@ -0,0 +1,57 @@ +// file : common/session/custom/session.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +#include "session.hxx" + +session* session::current; + +session:: +session () + : tran_ (0) +{ + assert (current == 0); + current = this; +} + +session:: +~session () +{ + // Unregister from transaction. + // + if (tran_ != 0) + tran_->callback_unregister (this); + + assert (current == this); + current = 0; +} + +void session:: +flush (odb::database& db) +{ + bool flushed (false); + + for (type_map::iterator i (map_.begin ()), e (map_.end ()); i != e; ++i) + { + bool r (i->second->flush (db)); + flushed = flushed || r; + } + + // If we flushed anything, then register the post-commit/rollback callback. + // + if (flushed) + { + tran_ = &odb::transaction::current (); + tran_->callback_register ( + &mark, this, odb::transaction::event_all, 0, &tran_); + } +} + +void session:: +mark (unsigned short event, void* key, unsigned long long) +{ + session& s (*static_cast (key)); + for (type_map::iterator i (s.map_.begin ()), e (s.map_.end ()); i != e; ++i) + i->second->mark (event); +} diff --git a/odb-tests/common/session/custom/session.hxx b/odb-tests/common/session/custom/session.hxx new file mode 100644 index 0000000..2d2f597 --- /dev/null +++ b/odb-tests/common/session/custom/session.hxx @@ -0,0 +1,191 @@ +// file : common/session/custom/session.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef SESSION_HXX +#define SESSION_HXX + +#include +#include +#include + +#include +#include + +#include // odb::object_traits +#include // odb::details::type_info_comparator + +// This custom session implementation assumes we are working with +// one database at a time. +// +class session +{ +public: + session (); + ~session (); + +private: + session (const session&); + session& operator= (const session&); + + // Session for the current thread. This can be implemented in pretty + // much any way that makes sense to the application. It can be a global + // session as we have here. In multi-threaded applications we could use + // TLS instead. + // +public: + static session* current; + + // Change tracking interface. + // +public: + // Call flush() within a transaction to apply the changes to the + // database. + // + void + flush (odb::database&); + +private: + struct object_map_base + { + virtual + ~object_map_base () {} + + // Return true if we flushed anything. + // + virtual bool + flush (odb::database&) = 0; + + virtual void + mark (unsigned short event) = 0; + }; + + enum object_state + { + tracking, // Tracking any modifications by storing the original copy. + changed, // Known to be changed. + flushed // Flushed but not yet committed/rolled back. + }; + + template + struct object_data + { + typedef typename odb::object_traits::pointer_type pointer_type; + + explicit + object_data (pointer_type o): obj (o), state (tracking) {} + + pointer_type obj; + pointer_type orig; + object_state state; + }; + + template + struct object_map: object_map_base, + std::map::id_type, + object_data > + { + virtual bool + flush (odb::database&); + + virtual void + mark (unsigned short event); + }; + + // Object cache interface. + // +public: + static bool + _has_cache () {return current != 0;} + + template + struct cache_position + { + typedef object_map map; + typedef typename map::iterator iterator; + + cache_position (): map_ (0) {} + cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + + cache_position (const cache_position& p) + : map_ (p.map_) + { + // It might not be ok to use an uninitialized iterator. + // + if (p.map_ != 0) + pos_ = p.pos_; + } + + cache_position& + operator= (const cache_position& p) + { + // It might not be ok to use an uninitialized iterator on the rhs. + // + if (p.map_ != 0) + pos_ = p.pos_; + map_ = p.map_; + return *this; + } + + map* map_; + iterator pos_; + }; + + // Cache management. + // + template + static cache_position + _cache_insert (odb::database&, + const typename odb::object_traits::id_type&, + const typename odb::object_traits::pointer_type&); + + template + static typename odb::object_traits::pointer_type + _cache_find (odb::database&, const typename odb::object_traits::id_type&); + + template + static void + _cache_erase (const cache_position& p) + { + if (p.map_ != 0) + p.map_->erase (p.pos_); + } + + // Notifications. + // + template + static void + _cache_persist (const cache_position& p) + { + _cache_load (p); + } + + template + static void + _cache_load (const cache_position&); + + template + static void + _cache_update (odb::database&, const T&); + + template + static void + _cache_erase (odb::database&, + const typename odb::object_traits::id_type&); + +private: + // Post-commit/rollback callback. + // + static void + mark (unsigned short event, void* key, unsigned long long); + +private: + typedef std::map, + odb::details::type_info_comparator> type_map; + type_map map_; + odb::transaction* tran_; +}; + +#include "session.txx" + +#endif // SESSION_HXX diff --git a/odb-tests/common/session/custom/session.txx b/odb-tests/common/session/custom/session.txx new file mode 100644 index 0000000..65ab933 --- /dev/null +++ b/odb-tests/common/session/custom/session.txx @@ -0,0 +1,159 @@ +// file : common/session/custom/session.txx +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +template +typename session::cache_position session:: +_cache_insert (odb::database&, + const typename odb::object_traits::id_type& id, + const typename odb::object_traits::pointer_type& obj) +{ + if (current == 0) + return cache_position (); // No session, return empty position. + + std::shared_ptr& pm (current->map_[&typeid (T)]); + + if (!pm) + pm.reset (new object_map); + + object_map& m (static_cast&> (*pm)); + + typename object_map::value_type vt (id, object_data (obj)); + std::pair::iterator, bool> r (m.insert (vt)); + + // We shall never try to re-insert the same object into the cache. + // + assert (r.second); + + return cache_position (m, r.first); +} + +template +typename odb::object_traits::pointer_type session:: +_cache_find (odb::database&, const typename odb::object_traits::id_type& id) +{ + typedef typename odb::object_traits::pointer_type pointer_type; + + if (current == 0) + return pointer_type (); // No session, return NULL pointer. + + type_map::const_iterator ti (current->map_.find (&typeid (T))); + + if (ti == current->map_.end ()) + return pointer_type (); + + const object_map& m (static_cast&> (*ti->second)); + typename object_map::const_iterator oi (m.find (id)); + + if (oi == m.end ()) + return pointer_type (); + + return oi->second.obj; +} + +template +void session:: +_cache_load (const cache_position& p) +{ + typedef typename odb::object_traits::pointer_type pointer_type; + + if (p.map_ == 0) + return; // Empty position. + + // Make a copy for change tracking. If our object model had a + // polymorphic hierarchy, then we would have had to use a + // virtual function-based mechanism (e.g., clone()) instead of + // the copy constructor since for a polymorphic hierarchy all + // the derived objects are stored as pointers to the root object. + // + p.pos_->second.orig = pointer_type (new T (*p.pos_->second.obj)); +} + +template +void session:: +_cache_update (odb::database&, const T& obj) +{ + typedef odb::object_traits object_traits; + typedef typename object_traits::pointer_type pointer_type; + + if (current == 0) + return; // No session. + + // User explicitly updated the object by calling database::update(). + // Change the state to flushed and reset the original copy (we are + // still tracking changes after the update). + // + type_map::iterator ti (current->map_.find (&typeid (T))); + + if (ti == current->map_.end ()) + return; // This object is not in the session. + + object_map& m (static_cast&> (*ti->second)); + typename object_map::iterator oi (m.find (object_traits::id (obj))); + + if (oi == m.end ()) + return; // This object is not in the session. + + object_data& d (oi->second); + d.orig = pointer_type (new T (*d.obj)); + d.state = flushed; +} + +template +void session:: +_cache_erase (odb::database&, + const typename odb::object_traits::id_type& id) +{ + if (current == 0) + return; // No session. + + type_map::iterator ti (current->map_.find (&typeid (T))); + + if (ti == current->map_.end ()) + return; + + object_map& m (static_cast&> (*ti->second)); + typename object_map::iterator oi (m.find (id)); + + if (oi == m.end ()) + return; + + m.erase (oi); + + if (m.empty ()) + current->map_.erase (ti); +} + +template +bool session::object_map:: +flush (odb::database& db) +{ + bool r (false); + for (typename object_map::iterator i (this->begin ()), e (this->end ()); + i != e; ++i) + { + object_data& d (i->second); + + if (d.state == changed || d.obj->changed (*d.orig)) + db.update (d.obj); // State changed by the update() notification. + + r = r || d.state == flushed; + } + + return r; +} + +template +void session::object_map:: +mark (unsigned short event) +{ + for (typename object_map::iterator i (this->begin ()), e (this->end ()); + i != e; ++i) + { + object_data& d (i->second); + + if (d.state == flushed) + d.state = event == odb::transaction::event_commit ? tracking : changed; + } +} diff --git a/odb-tests/common/session/custom/test.hxx b/odb-tests/common/session/custom/test.hxx new file mode 100644 index 0000000..3f2703f --- /dev/null +++ b/odb-tests/common/session/custom/test.hxx @@ -0,0 +1,118 @@ +// file : common/session/custom/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include + +#include +#include + +class employee; + +#pragma db object pointer(std::shared_ptr) session +class employer +{ +public: + employer (const std::string& name, const std::string& symbol) + : name_ (name), symbol_ (symbol) {} + + const std::string& + name () const {return name_;} + + const std::string& + symbol () const {return symbol_;} + + void + symbol (const std::string& symbol) {symbol_ = symbol;} + + // Employees of this employer. + // + typedef std::vector> employees_type; + + const employees_type& + employees () const {return employees_;} + + employees_type& + employees () {return employees_;} + + // Change tracking. + // +public: + bool + changed (const employer& orig) const + { + // Note that we don't need to track object ids, inverse pointers, nor + // readonly/const data members. + // + return symbol_ != orig.symbol_; + } + +private: + friend class odb::access; + employer () {} + + #pragma db id + std::string name_; + + std::string symbol_; + + #pragma db value_not_null inverse(employer_) + employees_type employees_; +}; + +#pragma db object pointer(std::shared_ptr) session +class employee +{ +public: + typedef ::employer employer_type; + + employee (const std::string& first, + const std::string& last, + std::shared_ptr employer) + : first_ (first), last_ (last), employer_ (employer) {} + + // Name. + // + const std::string& + first () const {return first_;} + + const std::string& + last () const {return last_;} + + // Employer. + // + std::shared_ptr + employer () const {return employer_;} + + void + employer (std::shared_ptr e) {employer_ = e;} + + // Change tracking. + // +public: + bool + changed (const employee& orig) const + { + return first_ != orig.first_ || last_ != orig.last_ || + employer_ != orig.employer_; + } + +private: + friend class odb::access; + employee () {} + + #pragma db id auto + unsigned long id_; + + std::string first_; + std::string last_; + + #pragma db not_null + std::shared_ptr employer_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/session/custom/testscript b/odb-tests/common/session/custom/testscript new file mode 100644 index 0000000..39c281d --- /dev/null +++ b/odb-tests/common/session/custom/testscript @@ -0,0 +1,33 @@ +# file : common/session/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/statement/processing/buildfile b/odb-tests/common/statement/processing/buildfile new file mode 100644 index 0000000..97124e8 --- /dev/null +++ b/odb-tests/common/statement/processing/buildfile @@ -0,0 +1,8 @@ +# file : common/statement/processing/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/common/statement/processing/driver.cxx b/odb-tests/common/statement/processing/driver.cxx new file mode 100644 index 0000000..2d00107 --- /dev/null +++ b/odb-tests/common/statement/processing/driver.cxx @@ -0,0 +1,619 @@ +// file : common/statement/processing/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test internal statement processing machinery. +// + +#include +#include + +#include + +#undef NDEBUG +#include + +using namespace std; + +static bool +insert (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_insert ( + r, stmt, bind, bind_size, sizeof (void*), '$'); + return r == expected; +} + +static bool +update (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_update ( + r, stmt, bind, bind_size, sizeof (void*), '$'); + return r == expected; +} + +static bool +select (const char* stmt, + const char* expected, + const void* const* bind, + size_t bind_size) +{ + string r; + odb::statement::process_select ( + r, stmt, bind, bind_size, sizeof (void*), '[', ']', true); + return r == expected; +} + +int +main (int, char* argv[]) +{ + // + // INSERT + // + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "VALUES\n" + "(DEFAULT,\n$1)", + "INSERT INTO [foo] ([a], [b]) VALUES (DEFAULT, $1)", + b, 2)); + } + + // Empty via statement. + // + /* LIBODB_DEBUG_STATEMENT_PROCESSING + { + assert (insert ("INSERT INTO [foo]\n" + "DEFAULT VALUES", + "INSERT INTO [foo] DEFAULT VALUES", + 0, 0)); + } + */ + + // Empty via bind. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a])\n" + "VALUES\n" + "($1)", + "INSERT INTO [foo] DEFAULT VALUES", + b, 1)); + } + + // Empty with OUTPUT. + // + { + void* b[] = {0, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "OUTPUT INSERTED.[id]\n" + "VALUES\n" + "($1,\n$2)", + "INSERT INTO [foo] OUTPUT INSERTED.[id] DEFAULT VALUES", + b, 2)); + } + + // Empty with RETURNING. + // + { + void* b[] = {0, 0, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$1,\n$2)\n" + "RETURNING [id]", + "INSERT INTO [foo] DEFAULT VALUES RETURNING [id]", + b, 3)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b])\n" + "VALUES\n" + "(1,\n$1)", + "INSERT INTO [foo] ([a]) VALUES (1)", + b, 1)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "(1,\n$1,\nDEFAULT)", + "INSERT INTO [foo] ([a], [c]) VALUES (1, DEFAULT)", + b, 1)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([b], [c]) VALUES ($2, $3)", + b, 3)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [b]) VALUES ($1, $2)", + b, 3)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3)", + b, 3)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv, 0}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c],\n[d],\n[e])\n" + "VALUES\n" + "($1,\n$2,\n$3,\n$4,\n$5)", + "INSERT INTO [foo] ([b], [d]) VALUES ($2, $4)", + b, 5)); + } + + // Not present and OUTPUT. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "OUTPUT INSERTED.[id]\n" + "VALUES\n" + "($1,\n$2,\n$3)", + "INSERT INTO [foo] ([a], [c]) OUTPUT INSERTED.[id] " + "VALUES ($1, $3)", + b, 3)); + } + + // Not present and RETURNING. + // + { + void* b[] = {argv, 0, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\n$2,\n$3)\n" + "RETURNING [id]", + "INSERT INTO [foo] ([a], [c]) VALUES ($1, $3) " + "RETURNING [id]", + b, 3)); + } + + // Value expressions. + // + { + void* b[] = {argv, argv, argv}; + assert (insert ("INSERT INTO [foo]\n" + "([a],\n[b],\n[c])\n" + "VALUES\n" + "($1,\nCAST($2, TEXT),\n$3)", + "INSERT INTO [foo] ([a], [b], [c]) " + "VALUES ($1, CAST($2, TEXT), $3)", + b, 3)); + } + + // + // UPDATE + // + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "ver=ver+1,\n[a]=$1\n" + "WHERE [id]=$2", + "UPDATE [foo] SET ver=ver+1, [a]=$1 WHERE [id]=$2", + b, 2)); + } + + // Empty via bind. + // + { + void* b[] = {0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1\n" + "WHERE [id]=$2", + "", + b, 2)); + } + + // Empty via bind, but not values. + // + { + void* b[] = {0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "ver=ver+1,\n[a]=$1\n" + "WHERE [id]=$2", + "UPDATE [foo] SET ver=ver+1 WHERE [id]=$2", + b, 2)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [b]=$2, [c]=$3 WHERE [id]=$4", + b, 4)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [b]=$2 WHERE [id]=$4", + b, 4)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [c]=$3 WHERE [id]=$4", + b, 4)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3,\n" + "[d]=$4\n" + "WHERE [id]=$5", + "UPDATE [foo] SET [b]=$2, [d]=$4 WHERE [id]=$5", + b, 5)); + } + + // Not present and OUTPUT. + // + { + void* b[] = {argv, 0, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3\n" + "OUTPUT INSERTED.[ver] " + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [c]=$3 OUTPUT INSERTED.[ver] " + "WHERE [id]=$4", + b, 4)); + } + + // Value expressions. + // + { + void* b[] = {argv, argv, argv, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=CAST($2, TEXT),\n" + "[c]=$3\n" + "WHERE [id]=$4", + "UPDATE [foo] SET [a]=$1, [b]=CAST($2, TEXT), [c]=$3 " + "WHERE [id]=$4", + b, 4)); + } + + // No OUTPUT/WHERE clause. + // + { + void* b[] = {argv, 0, argv}; + assert (update ("UPDATE [foo]\n" + "SET\n" + "[a]=$1,\n" + "[b]=$2,\n" + "[c]=$3", + "UPDATE [foo] SET [a]=$1, [c]=$3", + b, 4)); + } + + // + // SELECT + // + + // Empty. + // + { + void* b[] = {0, 0, 0}; + assert (select ("SELECT\n" + "[a].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "", + b, 3)); + } + + // Fast path. + // + { + void* b[] = {argv, argv}; + assert (select ("SELECT\n" + "[s].[t].[x],\n" + "[a].[y]\n" + "FROM [s].[t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id]\n" + "WHERE [s].[t].[id]=$1", + "SELECT [s].[t].[x], [a].[y] FROM [s].[t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[t].[id] " + "WHERE [s].[t].[id]=$1", + b, 2)); + } + + // First not present. + // + { + void* b[] = {0, argv, argv}; + assert (select ("SELECT\n" + "[a].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[y], [t].[z] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Last not present. + // + { + void* b[] = {argv, argv, 0}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[t].[y],\n" + "[a].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [t].[y] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Middle not present. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [t].[z] FROM [t] WHERE [t].[id]=$1", + b, 3)); + } + + // Multiple not present. + // + { + void* b[] = {0, argv, 0, argv}; + assert (select ("SELECT\n" + "[a1].[w],\n" + "[t].[x],\n" + "[a2].[y],\n" + "[a3].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a1] ON [a1].[id]=[t].[id]\n" + "LEFT JOIN [t2] AS [a2] ON [a2].[id]=[t].[id]\n" + "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [a3].[z] FROM [t] " + "LEFT JOIN [t3] AS [a3] ON [a3].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 4)); + } + + // Column expression. + // + { + void* b[] = {argv, argv, 0}; + assert (select ("SELECT\n" + "[t].[x],\n" + "CAST([a].[y], TEXT),\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], CAST([a].[y], TEXT) FROM [t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // No WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[t].[y],\n" + "[t].[z]\n" + "FROM [t]", + "SELECT [t].[x], [t].[z] FROM [t]", + b, 3)); + } + + // JOIN without WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]", + "SELECT [t].[x], [t].[z] FROM [t]", + b, 3)); + } + + // JOIN presence because of WHERE. + // + { + void* b[] = {argv, 0, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "WHERE [t].[id]=$1 AND [a].[id]=$2", + "SELECT [t].[x], [t].[z] FROM [t] " + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id] " + "WHERE [t].[id]=$1 AND [a].[id]=$2", + b, 3)); + } + + + // JOIN presence because of dependent JOIN. + // + { + void* b[] = {argv, argv, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[a_b].[y],\n" + "[t].[z]\n" + "FROM [t]\n" + "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id]\n" + "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [a_b].[y], [t].[z] FROM [t] " + "LEFT JOIN [d] AS [a_d] ON [a_d].[id]=[t].[id] " + "LEFT JOIN [b] AS [a_b] ON [a_b].[id]=[a_d].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // JOIN without alias and with schema. + // + { + void* b[] = {argv, argv, argv}; + assert (select ("SELECT\n" + "[t].[x],\n" + "[s].[t1].[y],\n" + "[t2].[z]\n" + "FROM [t]\n" + "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id]\n" + "LEFT JOIN [t2] ON [t2].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [t].[x], [s].[t1].[y], [t2].[z] FROM [t] " + "LEFT JOIN [s].[t1] ON [s].[t1].[id]=[t].[id] " + "LEFT JOIN [t2] ON [t2].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 3)); + } + + // JOIN alias top-level qualifer test. + // + { + void* b[] = {argv, 0}; + assert (select ("SELECT\n" + "[s].[a].[x],\n" + "[a].[y]\n" + "FROM [s].[a]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[s].[a].[id]\n" + "WHERE [s].[a].[id]=$1", + "SELECT [s].[a].[x] FROM [s].[a] WHERE [s].[a].[id]=$1", + b, 2)); + } + + // JOIN alias bottom-level qualifer test (FROM case). + // + { + void* b[] = {argv, 0}; + assert (select ("SELECT\n" + "[a].[t].[x],\n" + "[a].[y]\n" + "FROM [a].[t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[a].[t].[id]\n" + "WHERE [a].[t].[id]=$1", + "SELECT [a].[t].[x] FROM [a].[t] WHERE [a].[t].[id]=$1", + b, 2)); + } + + // JOIN alias bottom-level qualifer test (LEFT JOIN case). + // + { + void* b[] = {0, argv}; + assert (select ("SELECT\n" + "[a].[y],\n" + "[a].[t2].[x]\n" + "FROM [t]\n" + "LEFT JOIN [t1] AS [a] ON [a].[id]=[t].[id]\n" + "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id]\n" + "WHERE [t].[id]=$1", + "SELECT [a].[t2].[x] FROM [t] " + "LEFT JOIN [a].[t2] ON [a].[t2].[id]=[t].[id] " + "WHERE [t].[id]=$1", + b, 2)); + } +} diff --git a/odb-tests/common/statement/processing/testscript b/odb-tests/common/statement/processing/testscript new file mode 100644 index 0000000..2460dc6 --- /dev/null +++ b/odb-tests/common/statement/processing/testscript @@ -0,0 +1,6 @@ +# file : common/statement/processing/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/odb-tests/common/threads/buildfile b/odb-tests/common/threads/buildfile new file mode 100644 index 0000000..53b98ec --- /dev/null +++ b/odb-tests/common/threads/buildfile @@ -0,0 +1,49 @@ +# file : common/threads/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix threads_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# While we don't call any pthread_*() functions, this appears to be needed for +# some std::thread implementations (like libstdc++). Note that +# odb::details::thread inlines some std::thread API calls. +# +if ($cxx.target.class != 'windows') + cxx.libs += -pthread + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/threads/driver.cxx b/odb-tests/common/threads/driver.cxx new file mode 100644 index 0000000..1add011 --- /dev/null +++ b/odb-tests/common/threads/driver.cxx @@ -0,0 +1,236 @@ +// file : common/threads/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test operations in a multi-threaded environment. +// + +#include +#include // std::unique_ptr +#include // std::size_t +#include + +#include +#include + +#include +#include + +#include // DATABASE_* +#include + +#if defined(DATABASE_SQLITE) +# include +#endif + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; +namespace details = odb::details; + +const unsigned long thread_count = 24; +const unsigned long iteration_count = 30; +const unsigned long sub_iteration_count = 40; + +struct task +{ + task (database& db, unsigned long n) + : db_ (db), n_ (n) + { + } + + void* + execute () + { + try + { + for (unsigned long i (0); i < iteration_count; ++i) + { + unsigned long id ((n_ * iteration_count + i) * 3); + + object o1 (id, "first object"); + object o2 (id + 1, "second object"); + object o3 (id + 2, "third object"); + + // The following transactions may lead to deadlocks. + // + while (true) + { + try + { + transaction t (db_.begin ()); + + db_.persist (o1); + db_.persist (o2); + db_.persist (o3); + t.commit (); + break; + } + catch (const deadlock&) {} + } + + while (true) + { + try + { +#if !defined(DATABASE_SQLITE) + transaction t (db_.begin ()); +#else + // SQLite has a peculiar table locking mode (shared cache) + // which can lead to any of the transactions in this test + // deadlocking even though they shouldn't from the user's + // perspective. One way to work around this problem is to + // start a "write" transaction as such right away. + // + transaction t; + + if (db_.id () != odb::id_sqlite) + t.reset (db_.begin ()); + else + { + t.reset ( + static_cast (db_).begin_immediate ()); + } +#endif + unique_ptr o (db_.load (id)); + assert (o->str_ == "first object"); + o->str_ = "another value"; + db_.update (*o); + t.commit (); + break; + } + catch (const deadlock&) {} + } + + for (unsigned long j (0); j < sub_iteration_count; ++j) + { + typedef odb::query query; + typedef odb::prepared_query prep_query; + typedef odb::result result; + + while (true) + { + try + { + transaction t (db_.begin ()); + + prep_query pq (db_.lookup_query ("object-query")); + + if (!pq) + { + pq = db_.prepare_query ( + "object-query", query::str == "another value"); + db_.cache_query (pq); + } + + result r (pq.execute (false)); + + bool found (false); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->id_ == id) + { + found = true; + break; + } + } + assert (found); + t.commit (); + break; + } + catch (const deadlock&) {} + } + } + + while (true) + { + try + { + transaction t (db_.begin ()); + db_.erase (id); + t.commit (); + break; + } + catch (const deadlock&) {} + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return reinterpret_cast (1); + } + + return 0; + } + + static void* + execute (void* arg) + { + return static_cast (arg)->execute (); + } + + database& db_; + unsigned long n_; +}; + +bool +test (int argc, char* argv[], size_t max_connections) +{ + unique_ptr db (create_database (argc, argv, true, max_connections)); + + vector > threads; + vector > tasks; + + for (unsigned long i (0); i < thread_count; ++i) + { + details::shared_ptr t (new (details::shared) task (*db, i)); + tasks.push_back (t); + + threads.push_back ( + details::shared_ptr ( + new (details::shared) details::thread (&task::execute, t.get ()))); + } + + bool r (true); + + for (unsigned long i (0); i < thread_count; ++i) + if (threads[i]->join () != 0) + r = false; + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + db->erase (i->id_); + + t.commit (); + } + + return r; +} + +int +main (int argc, char* argv[]) +{ + try + { + if (!(test (argc, argv, 0) && + test (argc, argv, thread_count - 1) && + test (argc, argv, thread_count / 2) && + test (argc, argv, thread_count / 4))) + return 1; + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/threads/test.hxx b/odb-tests/common/threads/test.hxx new file mode 100644 index 0000000..2ed6e67 --- /dev/null +++ b/odb-tests/common/threads/test.hxx @@ -0,0 +1,29 @@ +// file : common/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object (unsigned long id, const std::string& str) + : id_ (id), str_ (str) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/threads/testscript b/odb-tests/common/threads/testscript new file mode 100644 index 0000000..87e03e0 --- /dev/null +++ b/odb-tests/common/threads/testscript @@ -0,0 +1,50 @@ +# file : common/threads/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + # Note: this is quite slow: + # + # $ time ./driver --database ~/odb-test.db + # real 3m5.593s + # user 1m1.244s + # sys 0m26.793s + # + # $ time ./driver --database /tmp/odb-test.db + # real 0m13.909s + # user 0m16.724s + # sys 0m4.874s + # + # $ time ./driver --database "file::memory:" + # real 0m12.406s + # user 0m15.694s + # sys 0m4.207s + # + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/transaction/basics/buildfile b/odb-tests/common/transaction/basics/buildfile new file mode 100644 index 0000000..f412235 --- /dev/null +++ b/odb-tests/common/transaction/basics/buildfile @@ -0,0 +1,13 @@ +# file : common/transaction/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/transaction/basics/driver.cxx b/odb-tests/common/transaction/basics/driver.cxx new file mode 100644 index 0000000..1833555 --- /dev/null +++ b/odb-tests/common/transaction/basics/driver.cxx @@ -0,0 +1,151 @@ +// file : common/transaction/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic transaction operations. +// + +#include +#include // std::unique_ptr +#include + +#include +#include +#include +#include +#include + +#include +#include + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct transaction_tracer: odb::tracer +{ + virtual void + execute (connection&, const char* s) + { + string str (s); + + if (str == "BEGIN") + cout << "begin transaction" << endl; + else if (str == "COMMIT") + cout << "commit transaction" << endl; + else if (str == "ROLLBACK") + cout << "rollback transaction" << endl; + } + + // Override the other version to get rid of a Sun CC warning. + // + virtual void + execute (connection& c, const statement& s) + { + execute (c, s.text ()); + } +}; + +int +main (int argc, char* argv[]) +{ + { + transaction_tracer tracer; + unique_ptr db (create_database (argc, argv, false)); + db->tracer (tracer); + + assert (!transaction::has_current ()); + + // Current and db accessors. + // + cout << "test 001" << endl; + { + transaction t (db->begin ()); + assert (&t.database () == db.get ()); + 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 (odb_db::transaction) == sizeof (transaction)); + + odb_db::transaction t (static_cast (*db).begin ()); + odb_db::transaction& r (odb_db::transaction::current ()); + assert (&t == &r); + } + + // Transaction restart. + // + cout << "test 007" << endl; + { + transaction t (db->begin ()); + t.commit (); + t.reset (db->begin ()); + t.commit (); + } + } + + // Test early connection release. + // + { + unique_ptr db (create_database (argc, argv, false, 1)); + transaction t1 (db->begin ()); + t1.commit (); + transaction t2 (db->begin ()); + t2.rollback (); + transaction t3 (db->begin ()); + t3.commit (); + } +} diff --git a/odb-tests/common/transaction/basics/testscript b/odb-tests/common/transaction/basics/testscript new file mode 100644 index 0000000..94c58b6 --- /dev/null +++ b/odb-tests/common/transaction/basics/testscript @@ -0,0 +1,62 @@ +# file : common/transaction/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + 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 + test 007 + begin transaction + commit transaction + begin transaction + commit transaction + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/transaction/callback/buildfile b/odb-tests/common/transaction/callback/buildfile new file mode 100644 index 0000000..78b1b03 --- /dev/null +++ b/odb-tests/common/transaction/callback/buildfile @@ -0,0 +1,13 @@ +# file : common/transaction/callback/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libs = libodb%lib{odb} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/transaction/callback/driver.cxx b/odb-tests/common/transaction/callback/driver.cxx new file mode 100644 index 0000000..d0af993 --- /dev/null +++ b/odb-tests/common/transaction/callback/driver.cxx @@ -0,0 +1,231 @@ +// file : common/transaction/callback/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transaction callbacks. +// + +#include // std::unique_ptr +#include // std::size_t +#include + +#include +#include + +#include + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +struct callback +{ + callback (unsigned short v): v_ (v), t_ (0) {} + callback (unsigned short v, transaction& t): v_ (v), t_ (0) {register_ (t);} + ~callback () {if (t_ != 0) unregister ();} + + void + register_ (transaction& t) + { + t_ = &t; + t.callback_register (&func, this, transaction::event_all, v_, &t_); + } + + void + unregister () + { + cout << " unregister callback " << v_ << endl; + t_->callback_unregister (this); + t_ = 0; + } + + void + update (unsigned short v) + { + v_ = v; + t_->callback_update (this, transaction::event_all, v_, &t_); + } + +private: + static void + func (unsigned short event, void* key, unsigned long long data) + { + callback& c (*static_cast (key)); + + const char* en; + switch (event) + { + case transaction::event_commit: + en = "commit"; + break; + case transaction::event_rollback: + en = "rollback"; + break; + default: + en = "unknown"; + } + + cout << " callback " << c.v_ << " " << en << endl; + + assert (data == c.v_); + assert (c.t_ == 0); + } + + unsigned short v_; + transaction* t_; +}; + +struct failed {}; + +static void +throw_func (unsigned short, void*, unsigned long long) +{ + throw failed (); +} + +static void +dummy_func (unsigned short, void* key, unsigned long long data) +{ + assert (reinterpret_cast (key) == data); +} + +static void +fill (transaction& t) +{ + // 20 is from odb/transaction.hxx. + // + for (size_t i (0); i < 20; ++i) + t.callback_register (&dummy_func, + reinterpret_cast (i), + transaction::event_all, + i); +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv, false)); + + // We want to test both stack and dynamic slots. + // + for (unsigned short i (1); i < 3; ++i) + { + // Test basic logic. + // + cout << "test " << i << "/001" << endl; + + // Commit callback. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.commit (); + } + + // Rollback callback. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.rollback (); + } + + // Rollback via exception callback. + // + { + callback c1 (1); + + try + { + transaction t (db->begin ()); + if (i == 2) fill (t); + c1.register_ (t); + throw failed (); + } + catch (const failed&) + { + } + } + + // Unregister callback at the end. + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + c1.unregister (); + t.callback_unregister (&c1); // Test unregistering non-registered key. + t.commit (); + } + + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + c1.unregister (); + callback c2 (2, t); + t.commit (); + } + + // Unregister callback in the middle. + // + cout << "test " << i << "/002" << endl; + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + callback c2 (2, t); + callback c3 (3, t); + c2.unregister (); + t.commit (); + } + + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + callback c2 (2, t); + callback c3 (3, t); + c2.unregister (); + callback c4 (4, t); // Using the free slot. + t.commit (); + } + + // Test a callback in the middle that throws. + // + cout << "test " << i << "/003" << endl; + try + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c1 (1, t); + t.callback_register (&throw_func, 0); + callback c2 (2, t); + t.commit (); + } + catch (const failed&) + { + } + + // Test callback_update(). + // + { + transaction t (db->begin ()); + if (i == 2) fill (t); + callback c (1, t); + c.update (2); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/transaction/callback/testscript b/odb-tests/common/transaction/callback/testscript new file mode 100644 index 0000000..7229ecd --- /dev/null +++ b/odb-tests/common/transaction/callback/testscript @@ -0,0 +1,72 @@ +# file : common/transaction/callback/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + ++cat <=output + test 1/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit + test 1/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit + test 1/003 + callback 1 commit + callback 2 commit + test 2/001 + callback 1 commit + callback 1 rollback + callback 1 rollback + unregister callback 1 + unregister callback 1 + callback 2 commit + test 2/002 + unregister callback 2 + callback 1 commit + callback 3 commit + unregister callback 2 + callback 1 commit + callback 4 commit + callback 3 commit + test 2/003 + callback 1 commit + callback 2 commit + EOI + +test.redirects += >>>../output + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $* +} diff --git a/odb-tests/common/types/buildfile b/odb-tests/common/types/buildfile new file mode 100644 index 0000000..95fe5b6 --- /dev/null +++ b/odb-tests/common/types/buildfile @@ -0,0 +1,39 @@ +# file : common/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix types_ + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/types/driver.cxx b/odb-tests/common/types/driver.cxx new file mode 100644 index 0000000..bdc66b8 --- /dev/null +++ b/odb-tests/common/types/driver.cxx @@ -0,0 +1,37 @@ +// file : common/types/driver.cxx +// 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" + +#undef NDEBUG +#include + +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/odb-tests/common/types/test.hxx b/odb-tests/common/types/test.hxx new file mode 100644 index 0000000..a99b499 --- /dev/null +++ b/odb-tests/common/types/test.hxx @@ -0,0 +1,55 @@ +// file : common/types/test.hxx +// 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_; // Use long long to avoid warnings. +}; + +#endif // TEST_HXX diff --git a/odb-tests/common/types/testscript b/odb-tests/common/types/testscript new file mode 100644 index 0000000..159972b --- /dev/null +++ b/odb-tests/common/types/testscript @@ -0,0 +1,6 @@ +# file : common/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basic +: +$* diff --git a/odb-tests/common/view/basics/buildfile b/odb-tests/common/view/basics/buildfile new file mode 100644 index 0000000..d9738a4 --- /dev/null +++ b/odb-tests/common/view/basics/buildfile @@ -0,0 +1,42 @@ +# file : common/view/basics/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_b_ \ + --generate-schema \ + --generate-query \ + --generate-prepared + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/view/basics/driver.cxx b/odb-tests/common/view/basics/driver.cxx new file mode 100644 index 0000000..e2f611a --- /dev/null +++ b/odb-tests/common/view/basics/driver.cxx @@ -0,0 +1,846 @@ +// file : common/view/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test view basics. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include +#include // DATABASE_XXX + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +template +void +view1_check (odb::result& r) +{ + typedef odb::result result; + + typename result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe" && i->age == 29); + + assert (++i != r.end ()); + V v; + i.load (v); + assert (v.first == "John" && v.last == "Doe" && v.age == 30); + + assert (++i == r.end ()); +} + +template +void +view2_test (const unique_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query ()); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31"); + else + r = db->query ("\"age\" < 31"); + + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + { + result r (db->query (query::age < 31)); + iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->count == 2); + } + + { + unique_ptr v (db->query_one ()); + assert (v->count == 4); + } + + { + unique_ptr v; + if (db->id () != odb::id_oracle) + v.reset (db->query_one ("age < 31")); + else + v.reset (db->query_one ("\"age\" < 31")); + assert (v->count == 2); + } + + { + unique_ptr v (db->query_one (query::age < 31)); + assert (v->count == 2); + } + + t.commit (); +} + +template +void +view4_test (const unique_ptr& db) +{ + typedef odb::query query; + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ((query::person::age > 30) + "ORDER BY age"); + else + r = db->query ((query::person::age > 30) + "ORDER BY \"age\""); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query ( + (query::person::age > 30) + + "ORDER BY " + query::person::age)); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->name == "Sweden"); + + assert (++i == r.end ()); + } + + { + result r (db->query (query::residence::code == "US")); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->name == "United States"); + + assert (++i == r.end ()); + } + + t.commit (); +} + +template +void +view6_test (const unique_ptr& db, const odb::query& q) +{ + typedef odb::result result; + typedef typename result::iterator iterator; + + transaction t (db->begin ()); + + { + result r (db->query (q)); + + iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->employer == "Simple Tech, Inc"); + + assert (++i != r.end ()); + assert (i->first_name == "Joe" && i->last_name == "Dirt" && + i->employer == "Simple Tech, Inc"); + + assert (++i == r.end ()); + } + + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // + // + { + country ca ("CA", "Canada"); + country za ("ZA", "South Africa"); + country us ("US", "United States"); + country se ("SE", "Sweden"); + + person p1 (1, "John", "Doe", 30, male, measures (60, 160), &ca, &ca); + person p2 (2, "Jane", "Doe", 29, female, measures (70, 170), &za, &us); + person p3 (3, "Joe", "Dirt", 31, male, measures (80, 180), &us, &za); + person p4 (4, "Johan", "Johansen", 32, male, measures (90, 190), &se, + &se); + + p2.husband = &p1; + + employer st ("Simple Tech, Inc"); + employer ct ("Complex Tech, Inc"); + + p2.previous_employer = st.name; + p3.previous_employer = ct.name; + + st.employees.push_back (&p1); + st.employees.push_back (&p3); + st.head_count = 2; + + ct.employees.push_back (&p2); + ct.employees.push_back (&p4); + ct.head_count = 2; + + transaction t (db->begin ()); + db->persist (ca); + db->persist (za); + db->persist (us); + db->persist (se); + + db->persist (p1); + db->persist (p2); + db->persist (p3); + db->persist (p4); + + db->persist (st); + db->persist (ct); + t.commit (); + } + + // view1 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + assert (size (r) == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("ORDER BY age"); + else + r = db->query ("ORDER BY \"age\""); + + assert (size (r) == 4); + } + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + + view1_check (r); + } + + t.commit (); + } + } + + // view1a + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query ()); + view1_check (r); + + t.commit (); + } + } + + // view1b + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query ()); + view1_check (r); + + t.commit (); + } + + // No native parameter support in dynamic multi-database mode. + // +#ifndef MULTI_DATABASE + { + typedef odb::query query; + + transaction t (db->begin ()); + +#ifndef DATABASE_ORACLE + result r (db->query ("first = " + query::_val ("Jane"))); +#else + result r (db->query ("\"first\" = " + query::_val ("Jane"))); +#endif + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first == "Jane" && i->last == "Doe"); + assert (++i == r.end ()); + + t.commit (); + } +#endif + } + + // view1c + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r; + if (db->id () != odb::id_oracle) + r = db->query ("SELECT first, last, age " + "FROM t_view_b_person " + "WHERE age < 31 ORDER BY age"); + else + r = db->query ("SELECT \"first\", \"last\", \"age\" " + "FROM \"t_view_b_person\" " + "WHERE \"age\" < 31 ORDER BY \"age\""); + view1_check (r); + + t.commit (); + } + } + + // view1d + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r; + if (db->id () != odb::id_oracle) + r = db->query ("age < 31 ORDER BY age"); + else + r = db->query ("\"age\" < 31 ORDER BY \"age\""); + + view1_check (r); + } + + t.commit (); + } + } + + // view2 + // + view2_test (db); + view2_test (db); + view2_test (db); + view2_test (db); + + // view3 + // + { + typedef odb::result result; // Test const result. + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + size_t count (0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->last_name == "Doe") + assert (i->count == 2); + else if (i->last_name == "Dirt" || + i->last_name == "Johansen") + assert (i->count == 1); + else + assert (false); + + count++; + } + + assert (count == 3); + } + + t.commit (); + } + } + + // view3a + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Doe")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->count == 2); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view4 + // + view4_test (db); + view4_test (db); + + // view5 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r ( + db->query ( + query::residence::name == query::nationality::name)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->rname == "Canada" && i->rname == "Canada"); + + assert (++i != r.end ()); + assert (i->first_name == "Johan" && i->last_name == "Johansen" && + i->rname == "Sweden" && i->rname == "Sweden"); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view6 + // + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + view6_test ( + db, odb::query::employer::name == "Simple Tech, Inc"); + + // No native parameter support in dynamic multi-database mode. + // +#ifndef MULTI_DATABASE + view6_test ( +#ifndef DATABASE_ORACLE + db, "e.name = " + odb::query::_val ("Simple Tech, Inc")); +#else + db, "\"e\".\"name\" = " + odb::query::_val ("Simple Tech, Inc")); +#endif +#endif + + // view7 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::person::last_name == "Doe")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + !i->head_count.null () && *i->head_count == 2); + + assert (++i != r.end ()); + assert (i->first_name == "John" && i->last_name == "Doe" && + i->head_count.null ()); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view8 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->wife_name == "Jane" && i->husb_name == "John"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view9 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + // Test case-insensitive clause prefix detection. + // + result r (db->query ("where" + (query::gender == female))); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->first_name == "Jane" && i->last_name == "Doe" && + i->gender == female); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view10 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + query::measures.weight > 60 && + query::measures.hight < 190)); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && + i->measures.weight == 70 && i->measures.hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && + i->measures.weight == 80 && i->measures.hight == 180); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view11 + // + { + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ()); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->last_name == "Doe" && i->hight == 170); + + assert (++i != r.end ()); + assert (i->last_name == "Dirt" && i->hight == 180); + + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view12 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::last_name == "Dirt")); + + result::iterator i (r.begin ()); + + assert (i != r.end ()); + assert (i->residence == "US"); + assert (++i == r.end ()); + } + + t.commit (); + } + } + + // view13 + // + { + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query ( + (query::person::age < 32) + + "ORDER BY" + query::employer::name)); + + assert (size (r) == 2); + } + + t.commit (); + } + } + + // view14 + // + { + transaction t (db->begin ()); + assert (size (db->query ()) == 2); + t.commit (); + } + + // Test join types. + // + { + using namespace test2; + + { + obj1 o11 (1, 1); + obj1 o12 (2, 2); + + obj2 o21 (1, 1); + obj2 o22 (2, 1); + obj2 o23 (3, 3); + + transaction t (db->begin ()); + db->persist (o11); + db->persist (o12); + db->persist (o21); + db->persist (o22); + db->persist (o23); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); + assert (++i == r.end ()); + t.commit (); + } + + // @@ BUILD2 Also disable for DATABASE_MYSQL and DATABASE_PGSQL (see + // vright definition for details). + // +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_PGSQL) + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2.null ()); + assert (++i == r.end ()); + t.commit (); + } +#endif + + // @@ BUILD2 Also disable for DATABASE_PGSQL (see vfull definition for + // details). + // +#if !defined(DATABASE_MYSQL) && \ + !defined(DATABASE_SQLITE) && \ + !defined(DATABASE_PGSQL) + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + + // SQL Server orders NULL values first. Got to be different. + // +#ifdef DATABASE_MSSQL + assert ( i != r.end () && i->id1.null () && *i->id2 == 3); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); +#else + assert ( i != r.end () && *i->id1 == 1 && *i->id2 == 1); + assert (++i != r.end () && *i->id1 == 1 && *i->id2 == 2); + assert (++i != r.end () && *i->id1 == 2 && i->id2.null ()); + assert (++i != r.end () && i->id1.null () && *i->id2 == 3); +#endif + assert (++i == r.end ()); + t.commit (); + } +#endif + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::o1::id1 + "," + query::o2::id2)); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id1 == 1 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 2); + assert (++i != r.end () && i->id1 == 1 && i->id2 == 3); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 1); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 2); + assert (++i != r.end () && i->id1 == 2 && i->id2 == 3); + assert (++i == r.end ()); + t.commit (); + } + + // Inner JOIN via relationship/container. + // + { + obj3 o31 (1, 1); + obj3 o32 (2, 2); + + obj4 o41 (1, 1); + obj4 o42 (2, 2); + o42.o3.push_back (&o32); + + transaction t (db->begin ()); + db->persist (o31); + db->persist (o32); + db->persist (o41); + db->persist (o42); + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert ( i != r.end () && i->id4 == 2); + assert (++i == r.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/view/basics/test.hxx b/odb-tests/common/view/basics/test.hxx new file mode 100644 index 0000000..130bcd4 --- /dev/null +++ b/odb-tests/common/view/basics/test.hxx @@ -0,0 +1,640 @@ +// file : common/view/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include // std::size_t + +#include +#include + +struct employer; + +#pragma db object +struct country +{ + country (const std::string& c, const std::string& n) + : code (c), name (n) + { + } + + country () + { + } + + #pragma db id + std::string code; // ISO 2-letter country code. + + std::string name; +}; + +enum gender_type {male, female}; + +#pragma db value +struct measures +{ + measures (unsigned short w, unsigned short h) : weight (w), hight (h) {} + measures () {} + + unsigned short weight; + unsigned short hight; +}; + +#pragma db object +struct person +{ + typedef ::measures measures_type; + + person (unsigned long i, + const std::string& fn, + const std::string& ln, + unsigned short a, + gender_type g, + const measures_type m, + country* r, + country* n) + : id (i), + first_name_ (fn), + last_name_ (ln), + age (a), + gender (g), + measures (m), + residence (r), + nationality (n), + husband (0) + { + } + + person () + { + } + + #pragma db id + unsigned long id; + + #pragma db column("first") + std::string first_name_; + + #pragma db column("last") + std::string last_name_; + + unsigned short age; + + // #pragma db type("INT") - in MySQL test type pragma copying + gender_type gender; + + measures_type measures; + + #pragma db not_null + country* residence; + + #pragma db not_null + country* nationality; + + #pragma db inverse(employees) + employer* employed_by; + + // A non-pointer relationship. + // + odb::nullable previous_employer; + + person* husband; // Self-reference. +}; + +#pragma db object +struct employer +{ + employer (const std::string& n) + : name (n) + { + } + + employer () + { + } + + #pragma db id + std::string name; + unsigned int head_count; + std::vector employees; +}; + +// +// General view with no associated objects. +// + +// Complete suffix query template. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age FROM t_view_b_person") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\"") +#endif +struct view1 +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Complete query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_b_person " \ + "WHERE age < 31 ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\" " \ + "WHERE \"age\" < 31 ORDER BY \"age\"") +#endif +struct view1a +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Complete placeholder query template. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view query("SELECT first, last, age " \ + "FROM t_view_b_person " \ + "WHERE age < 31 AND (?) ORDER BY age") +#else +# pragma db view query("SELECT \"first\", \"last\", \"age\" " \ + "FROM \"t_view_b_person\" " \ + "WHERE \"age\" < 31 AND (?) ORDER BY \"age\"") +#endif +struct view1b +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Runtime query. +// +#pragma db view //query() +struct view1c +{ + std::string first; + std::string last; + unsigned short age; +}; + +// Assembled SELECT and FROM-lists. +// +#pragma db view table("t_view_b_person") +struct view1d +{ + #pragma db column("first") + std::string first; + + #pragma db column("last") + std::string last; + + #pragma db column("age") + unsigned short age; +}; + +// +// Count view plus associated object. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person) \ + query("SELECT count(id) FROM t_view_b_person") +#else +# pragma db view object(person) \ + query("SELECT count(\"id\") FROM \"t_view_b_person\"") +#endif +struct view2 +{ + std::size_t count; +}; + +// Generated query, literal column. +// +#pragma db view object(person) +struct view2a +{ +#ifndef ODB_DATABASE_ORACLE + #pragma db column("count(id)") +#else + #pragma db column("count(\"id\")") +#endif + std::size_t count; +}; + +// Generated query, qualified literal column. +// +#pragma db view object(person) +struct view2b +{ +#ifndef ODB_DATABASE_ORACLE + #pragma db column("count(t_view_b_person.id)") +#else + #pragma db column("count(\"t_view_b_person\".\"id\")") +#endif + std::size_t count; +}; + +// Generated query, expression column. +// +#pragma db view object(person) +struct view2c +{ + #pragma db column("count(" + person::id + ")") + std::size_t count; +}; + +// +// Aggregate view plus associated object with a custom alias. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person = test) \ + query("SELECT last, count(last) " \ + "FROM t_view_b_person " \ + "GROUP BY last") +#else +# pragma db view object(person = test) \ + query("SELECT \"last\", count(\"last\") " \ + "FROM \"t_view_b_person\" " \ + "GROUP BY \"last\"") +#endif +struct view3 +{ + std::string last_name; + std::size_t count; +}; + +// Generated query with integrated query condition and placeholder. +// +#pragma db view object(person = test) \ + query((?) + "GROUP BY" + test::last_name_) +struct view3a +{ + // Automatically resolved to test::last_name_. + // + std::string last_name; + + #pragma db column("count(" + test::last_name_ + ")") + std::size_t count; +}; + +// +// JOIN view plus associated objects, some with custom aliases. +// + +// Complete suffix query. +// +#ifndef ODB_DATABASE_ORACLE +# pragma db view object(person) object(country = residence) \ + query("SELECT first, last, residence.name " \ + "FROM t_view_b_person " \ + "LEFT JOIN t_view_b_country AS residence " \ + "ON t_view_b_person.residence = residence.code") +#else +# pragma db view object(person) object(country = residence) \ + query("SELECT \"first\", \"last\", \"residence\".\"name\" " \ + "FROM \"t_view_b_person\" " \ + "LEFT JOIN \"t_view_b_country\" \"residence\" " \ + "ON \"t_view_b_person\".\"residence\" = \"residence\".\"code\"") +#endif +struct view4 +{ + std::string first_name; + std::string last_name; + std::string name; +}; + +// Generated query. +// +#pragma db view object(person) \ + object(country = residence: person::residence) +struct view4a +{ + std::string first_name; + std::string last_name; + std::string name; +}; + +// +// JOIN the same object twice. +// +#pragma db view object(person) \ + object(country = residence: person::residence) \ + object(country = nationality: person::nationality) \ + query((?) + "ORDER BY" + person::age) +struct view5 +{ + std::string first_name; + std::string last_name; + + #pragma db column(residence::name) + std::string rname; + + #pragma db column(nationality::name) + std::string nname; +}; + +// +// JOIN via one(i)-to-many relationship. +// + +// Automatic relationship discovery. +// +#pragma db view object(person) object(employer) +struct view6 +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, left side. +// +#pragma db view object(person) object(employer: person::employed_by) +struct view6a +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// Manual relationship specification, right side. +// +#pragma db view object(person) object(employer: employer::employees) +struct view6b +{ + std::string first_name; + std::string last_name; + + #pragma db column(::employer::name) + std::string employer; +}; + +// The same using tables. +// +#if defined(ODB_DATABASE_ORACLE) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "\"ee\".\"value\" = \"p\".\"id\"")\ + table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = \"e\".\"name\"") +#elif defined(ODB_DATABASE_MSSQL) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "[ee].[object_id] = e.name") +#elif defined(ODB_DATABASE_MYSQL) +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "`ee`.`object_id` = e.name") +#else +#pragma db view table("t_view_b_person" = "p") \ + table("t_view_b_employer_employees" = "ee": "ee.value = p.id") \ + table("t_view_b_employer" = "e": "\"ee\".\"object_id\" = e.name") +#endif +struct view6c +{ + #pragma db column("p.first") + std::string first_name; + + #pragma db column("p.last") + std::string last_name; + + #pragma db column("e"."name") + std::string employer; +}; + +// +// JOIN via a custom condition. +// +#pragma db view object(person) \ + object(employer: person::previous_employer == employer::name)\ + query((?) + "ORDER BY" + person::age) +struct view7 +{ + std::string first_name; + std::string last_name; + + odb::nullable head_count; +}; + +// +// Self-JOIN. +// +#pragma db view object(person = wife) object(person = husb) \ + query (wife::husband.is_not_null ()) +struct view8 +{ + #pragma db column(wife::first_name_) + std::string wife_name; + + #pragma db column(husb::first_name_) + std::string husb_name; +}; + +// +// Enum mapping. +// +#pragma db view object(person) +struct view9 +{ + std::string first_name; + std::string last_name; + gender_type gender; +}; + +// +// Composite in view. +// +#pragma db view object(person) query((?) + "ORDER BY" + person::age) +struct view10 +{ + std::string last_name; + ::measures measures; +}; + +// +// Composite in object. +// +#pragma db view object(person) \ + query((person::measures.weight > 60 && person::measures.hight < 190 && (?)) \ + + "ORDER BY" + person::age) +struct view11 +{ + std::string last_name; + + #pragma db column(person::measures.hight) + unsigned short hight; +}; + +// +// Extract object pointer as object id. +// +#pragma db view object(person) +struct view12 +{ + std::string residence; +}; + +// +// Test 'distinct' result modifier. +// +#pragma db view object(employer) object(person) query(distinct) +struct view13 +{ + std::string name; +}; + +// +// Test 'for_update' result modifier. +// +#pragma db view object(employer) query((?), for_update) +struct view14 +{ + std::string name; +}; + +// Test join types. +// +#pragma db namespace table("t2_") +namespace test2 +{ + #pragma db object + struct obj1 + { + obj1 (int id = 0, int n_ = 0): id1 (id), n (n_) {} + + #pragma db id + int id1; + + int n; + }; + + #pragma db object no_id + struct obj2 + { + obj2 (int id = 0, int n_ = 0): id2 (id), n (n_) {} + + #pragma db id + int id2; + + int n; + }; + + #pragma db view object(obj1 = o1) object(obj2 = o2 left: o1::n == o2::n) + struct vleft + { + int id1; + odb::nullable id2; + }; + + // @@ BUILD2 Also disable for ODB_DATABASE_MYSQL and ODB_DATABASE_PGSQL, + // otherwise we end up with the following error: + // + // test-odb-mysql.hxx:3202:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ + // 3202 | public access::view_traits< ::test2::vright > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +//#if !defined(ODB_DATABASE_SQLITE) && !defined(ODB_DATABASE_COMMON) +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ + !defined(ODB_DATABASE_COMMON) + + #pragma db view object(obj2 = o2) object(obj1 = o1 right: o2::n == o1::n) + struct vright + { + int id1; + odb::nullable id2; + }; + +#endif + + // @@ BUILD2 Also disable for ODB_DATABASE_PGSQL, otherwise we end up with the + // following error: + // + // test-odb-pgsql.hxx:3325:20: error: invalid use of incomplete type ‘class odb::access::view_traits’ + // 3325 | public access::view_traits< ::test2::vfull > + // | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // +/* +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_COMMON) +*/ +#if !defined(ODB_DATABASE_MYSQL) && \ + !defined(ODB_DATABASE_SQLITE) && \ + !defined(ODB_DATABASE_PGSQL) && \ + !defined(ODB_DATABASE_COMMON) + + #pragma db view object(obj1 = o1) object(obj2 = o2 full: o1::n == o2::n) + struct vfull + { + odb::nullable id1; + odb::nullable id2; + }; + +#endif + + #pragma db view object(obj1 = o1) object(obj2 = o2 inner: o1::n == o2::n) + struct vinner + { + int id1; + int id2; + }; + + #pragma db view object(obj1 = o1) object(obj2 = o2 cross) + struct vcross + { + int id1; + int id2; + }; + + // Inner JOIN via relationship/container. + // + #pragma db object + struct obj3 + { + obj3 (int id = 0, int n_ = 0): id3 (id), n (n_) {} + + #pragma db id + int id3; + + int n; + }; + + #pragma db object no_id + struct obj4 + { + obj4 (int id = 0, int n_ = 0): id4 (id), n (n_) {} + + #pragma db id + int id4; + + int n; + std::vector o3; + }; + + #pragma db view object(obj4) object(obj3 inner) + struct vrel + { + int id4; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/view/basics/testscript b/odb-tests/common/view/basics/testscript new file mode 100644 index 0000000..faa8408 --- /dev/null +++ b/odb-tests/common/view/basics/testscript @@ -0,0 +1,33 @@ +# file : common/view/basics/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/view/olv/.gitignore b/odb-tests/common/view/olv/.gitignore new file mode 100644 index 0000000..2b95165 --- /dev/null +++ b/odb-tests/common/view/olv/.gitignore @@ -0,0 +1,46 @@ +# ODB-generated files. +# +test1-odb.?xx +test1-odb-*.?xx +test1.sql +test1-*.sql + +test2-odb.?xx +test2-odb-*.?xx +test2.sql +test2-*.sql + +test3-odb.?xx +test3-odb-*.?xx +test3.sql +test3-*.sql + +test4-odb.?xx +test4-odb-*.?xx +test4.sql +test4-*.sql + +test5-odb.?xx +test5-odb-*.?xx +test5.sql +test5-*.sql + +test6-odb.?xx +test6-odb-*.?xx +test6.sql +test6-*.sql + +test7-odb.?xx +test7-odb-*.?xx +test7.sql +test7-*.sql + +test8-odb.?xx +test8-odb-*.?xx +test8.sql +test8-*.sql + +test9-odb.?xx +test9-odb-*.?xx +test9.sql +test9-*.sql diff --git a/odb-tests/common/view/olv/buildfile b/odb-tests/common/view/olv/buildfile new file mode 100644 index 0000000..89ecbcf --- /dev/null +++ b/odb-tests/common/view/olv/buildfile @@ -0,0 +1,50 @@ +# file : common/view/olv/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +hs = test1 test2 test3 test4 test5 test6 test7 test8 test9 + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +for h: $hs +{ + exe{driver}: {hxx ixx cxx}{$h-odb} + + <{hxx ixx cxx}{$h-odb}>: hxx{$h} libue{test-meta} + + for db: $databases + { + exe{driver}: {hxx ixx cxx}{$h-odb-$db}: include = $multi + <{hxx ixx cxx}{$h-odb-$db}>: hxx{$h} libue{test-meta} + } +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix t_view_olv_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../../alias{database-client}: include = adhoc + +testscript@./: schemas = $hs diff --git a/odb-tests/common/view/olv/driver.cxx b/odb-tests/common/view/olv/driver.cxx new file mode 100644 index 0000000..c08015e --- /dev/null +++ b/odb-tests/common/view/olv/driver.cxx @@ -0,0 +1,654 @@ +// file : common/view/olv/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test object loading views. +// + +#include // std::unique_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test1.hxx" +#include "test2.hxx" +#include "test3.hxx" +#include "test4.hxx" +#include "test5.hxx" +#include "test6.hxx" +#include "test7.hxx" +#include "test8.hxx" +#include "test9.hxx" + +#include "test1-odb.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" +#include "test4-odb.hxx" +#include "test5-odb.hxx" +#include "test6-odb.hxx" +#include "test7-odb.hxx" +#include "test8-odb.hxx" +#include "test9-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic object loading functionality. + // + { + using namespace test1; + + { + object1 o1a (1, 123); + object2 o2 (1, "abc"); + + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o2); + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + view1 v (db->query_value (query::object1::n == 123)); + assert (v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view2 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view3 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc"); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && + v.o1->n == 123 && v.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.s == "abc" && v.o2->s == "abc" && v.id == 1 && + v.o1->n == 123 && v.n == 123); + t.commit (); + } + + { + typedef odb::query query; + + object1 o1b (123, 1); + + transaction t (db->begin ()); + db->persist (o1b); + view5 v (db->query_value (query::o1b::n == 1)); + assert (v.o1a->n == 123 && v.o2->s == "abc" && v.o1b->n == 1); + t.commit (); + } + } + + // Test loading of object pointers inside objects. + // + { + using namespace test2; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc", o1)); + + { + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + assert (v.o2->s == "abc" && v.o2->o1->n == 123); + t.commit (); + } + + { + // Check session interaction. + // + transaction t (db->begin ()); + session s; + shared_ptr o2a (db->load (o2->id)); + view1 v (db->query_value ()); + assert (v.o2 == o2a); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view2 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); + t.commit (); + } + + shared_ptr o3 (new object3 (o2)); + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view3 v (db->query_value ()); + assert (v.o1->n == 123 && v.o3->o2->s == "abc" && + v.o3->o2->o1 == v.o1); + t.commit (); + } + + shared_ptr o1b (new object1 (234)); + shared_ptr o2b (new object2 ("bcd", o1b)); + shared_ptr o4 (new object4); + o4->o2.push_back (o2); + o4->o2.push_back (o2b); + + { + transaction t (db->begin ()); + db->persist (o1b); + db->persist (o2b); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + view4 v (db->query_value ()); + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object1::id)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + const view5& v (*i); + + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && + v.o4->o2[0]->o1 == v.o1); + } + assert (++i != r.end ()); + { + const view5& v (*i); + + assert (v.o4->o2[0]->s == "abc" && v.o4->o2[0]->o1->n == 123 && + v.o4->o2[1]->s == "bcd" && v.o4->o2[1]->o1->n == 234 && + v.o4->o2[1]->o1 == v.o1); + } + assert (++i == r.end ()); + t.commit (); + } + + shared_ptr o5 (new object5 (o1b, o2)); + + { + transaction t (db->begin ()); + db->persist (o5); + t.commit (); + } + + { + transaction t (db->begin ()); + view6 v (db->query_value ()); + assert (v.o1a->n == 123 && v.o1b->n == 234); + t.commit (); + } + } + + // Test JOINs for pointed-to objects, existing and automatically added. + // + { + using namespace test3; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc")); + + o1->o2 = o2; + o2->o1 = o1; + + { + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1a v (db->query_value ()); + // VC11 + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + t.commit (); + } + + { + transaction t (db->begin ()); + view1b v (db->query_value ()); + // VC11 + assert (v.o1->n == 123 && v.o1->o2.object_id () == o2->id); + t.commit (); + } + + // Container case. + // + + shared_ptr o3 (new object3 (123)); + shared_ptr o4 (new object4 ("abc")); + + o3->o4 = o4; + o4->o3.push_back (o3); + + { + + transaction t (db->begin ()); + db->persist (o3); + db->persist (o4); + t.commit (); + } + + { + transaction t (db->begin ()); + view2a v (db->query_value ()); + // VC11 + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + t.commit (); + } + + { + transaction t (db->begin ()); + view2b v (db->query_value ()); + // VC11 + assert (v.o3->n == 123 && v.o3->o4.object_id () == o4->id); + t.commit (); + } + } + + // Test by-value load. + // + { + using namespace test4; + + { + object1 o1 (1, 123); + object2 o2 (1, "abc", &o1); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + assert (v.o1.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view1a v (db->query_value ()); + assert (!v.o1_null && v.o1.n == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + view1b v (db->query_value ()); + assert (/*v.o1_p == &v.o1 && */ v.o1.n == 123); // Copy ctor. + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end ()); + + object1 o1; + view1c v (o1); + i.load (v); + + assert (v.o1_p == &o1 && o1.n == 123); + + assert (++i == r.end ()); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view2 v (db->query_value ()); + + // @@ BUILD2 As of cl 19.29.30136 (VS 2019 16.11.5) v.o2.o1 points to + // the address of o1 member of the object being returned by + // query_value() which v is a copy of, and thus the + // original assertion fails. Note that changing `view2 v` to + // `const view2& v` doesn't help. + // + //assert (v.o1.n == 123 && v.o2.s == "abc" && v.o2.o1 == &v.o1); + assert (v.o1.n == 123 && v.o2.s == "abc"); + t.commit (); + } + + object1 o1b (2, 234); + + { + transaction t (db->begin ()); + db->persist (o1b); + t.commit (); + } + + { + typedef odb::query query; + + transaction t (db->begin ()); + session s; + view2a v (db->query_value (query::object1::id == 2)); + assert (v.o1.n == 234 && v.o2_null); + t.commit (); + } + + shared_ptr o3 (new object3 (1, 123)); + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + { + view3 v (db->query_value ()); + assert (v.o3_p == &v.o3 && v.o3.n == 123); // Load into value. + } + session s; // Load into cache. + shared_ptr o3a (db->load (o3->id)); + { + view3 v (db->query_value ()); + assert (v.o3_p == o3a.get ()); // Load from cache. + } + t.commit (); + } + } + + // Test NULL object pointers. + // + { + using namespace test5; + + shared_ptr o1a (new object1 (123)); + shared_ptr o1b (new object1 (234)); + shared_ptr o2 (new object2 ("abc", o1a)); + + { + transaction t (db->begin ()); + db->persist (o1a); + db->persist (o1b); + db->persist (o2); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object1::id)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + const view1& v (*i); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1); + } + assert (++i != r.end ()); + { + const view1& v (*i); + assert (v.o1->n == 234 && !v.o2); + } + assert (++i == r.end ()); + t.commit (); + } + + shared_ptr o3a (new object3 (make_pair (1, 1), 123)); + shared_ptr o3b (new object3 (make_pair (2, 2), 234)); + shared_ptr o4 (new object4 ("abc", o3a)); + + { + transaction t (db->begin ()); + db->persist (o3a); + db->persist (o3b); + db->persist (o4); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + session s; + result r (db->query ("ORDER BY" + query::object3::n)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + { + const view2& v (*i); + assert (v.o3->n == 123 && v.o4->s == "abc" && v.o4->o3 == v.o3); + } + assert (++i != r.end ()); + { + const view2& v (*i); + assert (v.o3->n == 234 && !v.o4); + } + assert (++i == r.end ()); + t.commit (); + } + } + + // Test interaction with sections. + // + { + using namespace test6; + + shared_ptr o1 (new object1 (123)); + shared_ptr o2 (new object2 ("abc", o1)); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + view1 v (db->query_value ()); + + assert (v.o1->n == 123 && v.o2->s == "abc" && + !v.o2->r.loaded () && !v.o2->o1); + + db->load (*v.o2, v.o2->r); + assert (v.o2->r.loaded () && v.o2->o1 && v.o2->o1->n == 123); + + t.commit (); + } + } + + // Test explicit conversion to smart pointer member. + // + { + using namespace test7; + + object1 o1 (123); + object2 o2 ("abc", &o1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); + t.commit (); + } + } + + // Test loading objects without id. + // + { + using namespace test8; + + object1 o1 (123); + object2 o2 ("abc", &o1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + session s; + view1 v (db->query_value ()); + assert (v.o1->n == 123 && v.o2->s == "abc" && v.o2->o1 == v.o1.get ()); + t.commit (); + } + } + + // Test loading polymorphic objects. + // + { + using namespace test9; + + root r (1); + base b (2, "a"); + derived d (3, "b", true); + + { + transaction t (db->begin ()); + db->persist (r); + db->persist (b); + db->persist (d); + t.commit (); + } + + { + transaction t (db->begin ()); + + // Load via root. + // + { + view1r r (db->query_value (query::n == 1)); + auto& o (*r.o); + assert (r.n == 1 && r.o->n == 1 && typeid (o) == typeid (root)); + } + + { + view1r r (db->query_value (query::n == 2)); + auto& o (*r.o); + assert (r.n == 2 && r.o->n == 2 && typeid (o) == typeid (base)); + base& b (dynamic_cast (*r.o)); + assert (b.s == "a"); + } + + { + view1r r (db->query_value (query::n == 3)); + auto& o (*r.o); + assert (r.n == 3 && r.o->n == 3 && typeid (o) == typeid (derived)); + derived& d (dynamic_cast (o)); + assert (d.s == "b" && d.b); + } + + // Load via base. + // + { + view1b r (db->query_value (query::n == 2)); + assert (r.s == "a" && r.n == 2 && r.o->n == 2 && b.s == "a"); + } + + { + view1b r (db->query_value (query::n == 3)); + auto& o (*r.o); + assert (r.s == "b" && r.n == 3 && r.o->n == 3 && + typeid (o) == typeid (derived)); + derived& d (dynamic_cast (o)); + assert (d.s == "b" && d.b); + } + + // Load via derived. + // + { + view1d r (db->query_value ()); + assert (r.s == "b" && r.n == 3 && + r.o->n == 3 && r.o->s == "b" && r.o->b); + } + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/view/olv/test1.hxx b/odb-tests/common/view/olv/test1.hxx new file mode 100644 index 0000000..0de9483 --- /dev/null +++ b/odb-tests/common/view/olv/test1.hxx @@ -0,0 +1,116 @@ +// file : common/view/olv/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#include +#include // unique_ptr +#include // std::move + +#include + +// Test basic object loading functionality. +// +#pragma db namespace table("t1_") pointer(std::unique_ptr) +namespace test1 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = ""): id (id_), s (s_) {} + + #pragma db id + int id; + + std::string s; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view1 + { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)) {} + + std::unique_ptr o2; + }; + + #pragma db view object(object1) object(object2: object1::id == object2::id) + struct view2 + { + // VC12 workaround (no default move constructor generation). + // + view2 () {} + view2 (view2&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + + std::unique_ptr o2; + std::unique_ptr o1; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view3 + { + // VC12 workaround (no default move constructor generation). + // + view3 () {} + view3 (view3&& x): o1 (std::move (x.o1)), o2 (std::move (x.o2)) {} + + std::unique_ptr o1; + std::unique_ptr o2; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) + struct view4 + { + // VC12 workaround (no default move constructor generation). + // + view4 () {} + view4 (view4&& x): s (std::move (x.s)), + o2 (std::move (x.o2)), + id (x.id), + o1 (std::move (x.o1)), + n (x.n) {} + + std::string s; + std::unique_ptr o2; + + #pragma db column(o1::id) + int id; + + std::unique_ptr o1; + int n; + }; + + #pragma db view \ + object(object1) \ + object(object2: object1::id == object2::id) \ + object(object1 = o1b: object1::id == o1b::n) + struct view5 + { + // VC12 workaround (no default move constructor generation). + // + view5 () {} + view5 (view5&& x): o1a (std::move (x.o1a)), + o2 (std::move (x.o2)), + o1b (std::move (x.o1b)) {} + + std::unique_ptr o1a; + std::unique_ptr o2; + std::unique_ptr o1b; + }; +} + +#endif // TEST1_HXX diff --git a/odb-tests/common/view/olv/test2.hxx b/odb-tests/common/view/olv/test2.hxx new file mode 100644 index 0000000..a769daa --- /dev/null +++ b/odb-tests/common/view/olv/test2.hxx @@ -0,0 +1,122 @@ +// file : common/view/olv/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#include +#include +#include // shared_ptr + +#include + +// Test loading of object pointers inside objects. +// +#pragma db namespace table("t2_") pointer(std::shared_ptr) session +namespace test2 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) + struct view2 + { + shared_ptr o2; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object3 + { + object3 () {} + object3 (shared_ptr o2_): o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o2; + }; + + #pragma db view object(object1) object(object2) object(object3) + struct view3 + { + shared_ptr o3; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object4 + { + #pragma db id auto + int id; + + std::vector> o2; + }; + + #pragma db view object(object4) + struct view4 + { + shared_ptr o4; + }; + + #pragma db view object(object4) object (object2) object(object1) + struct view5 + { + shared_ptr o4; // "Unfortunate" order. + shared_ptr o1; + }; + + #pragma db object + struct object5 + { + object5 () {} + object5 (shared_ptr o1_, shared_ptr o2_) + : o1 (o1_), o2 (o2_) {} + + #pragma db id auto + int id; + + shared_ptr o1; + shared_ptr o2; + }; + + #pragma db view object(object5) object (object2) \ + object(object1 = o1a: object2::o1) \ + object(object1 = o1b: object5::o1) + struct view6 + { + shared_ptr o1a; + shared_ptr o1b; + }; +} + +#endif // TEST2_HXX diff --git a/odb-tests/common/view/olv/test3.hxx b/odb-tests/common/view/olv/test3.hxx new file mode 100644 index 0000000..8cf4344 --- /dev/null +++ b/odb-tests/common/view/olv/test3.hxx @@ -0,0 +1,106 @@ +// file : common/view/olv/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#include +#include +#include // shared_ptr + +#include +#include + +// Test JOINs for pointed-to objects, existing and automatically added. +// +#pragma db namespace table("t3_") pointer(std::shared_ptr) session +namespace test3 +{ + using std::shared_ptr; + + struct object2; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o1) + odb::lazy_weak_ptr o2; + }; + + #pragma db object + struct object2 + { + object2 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1a // Existing JOIN. + { + shared_ptr o1; + }; + + #pragma db view object(object1) + struct view1b // Automatic JOIN. + { + shared_ptr o1; + }; + + // Container case. + // + struct object4; + + #pragma db object + struct object3 + { + object3 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + + #pragma db inverse(o3) + odb::lazy_weak_ptr o4; + }; + + #pragma db object + struct object4 + { + object4 (const char* s_ = ""): s (s_) {} + + #pragma db id auto + int id; + + std::string s; + + std::vector> o3; + }; + + #pragma db view object(object3) object(object4 = o4) + struct view2a // Existing JOIN. + { + shared_ptr o3; + }; + + #pragma db view object(object3) + struct view2b // Automatic JOIN. + { + shared_ptr o3; + }; +} + +#endif // TEST3_HXX diff --git a/odb-tests/common/view/olv/test4.hxx b/odb-tests/common/view/olv/test4.hxx new file mode 100644 index 0000000..f2af5fd --- /dev/null +++ b/odb-tests/common/view/olv/test4.hxx @@ -0,0 +1,151 @@ +// file : common/view/olv/test4.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST4_HXX +#define TEST4_HXX + +#include +#include // shared_ptr + +#include + +// Test by-value load. +// +#pragma db namespace table("t4_") session +namespace test4 +{ + #pragma db object + struct object1 + { + object1 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 (int id_ = 0, const char* s_ = "", object1* o1_ = 0) + : id (id_), s (s_), o1 (o1_) {} + + #pragma db id + int id; + + std::string s; + object1* o1; // Shallow copy. + }; + + typedef object1* object1_ptr; + typedef object2* object2_ptr; + + #pragma db view object(object1) + struct view1 + { + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + #pragma db transient + object1 o1; + }; + + #pragma db view object(object1) transient + struct view1a + { + view1a (): o1_null (true) {} + + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) \ + set(this.o1_null = !(?)) + + object1 o1; + bool o1_null; + }; + + #pragma db view object(object1) + struct view1b + { + view1b (): o1_p (0) {} + + #pragma db transient + object1 o1; + + #pragma db get(&this.o1) set(o1_p = (?)) + object1* o1_p; + }; + + #pragma db view object(object1) + struct view1c + { + view1c (object1& o1): o1_p (&o1) {} + + object1* o1_p; + }; + + #pragma db view object(object1) object(object2) transient + struct view2 + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) set() + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + }; + + #pragma db view object(object1) object(object2) transient + struct view2a + { + #pragma db member(o2_) virtual(object2_ptr) get(&this.o2) \ + set(o2_null = !(?)) + #pragma db member(o1_) virtual(object1_ptr) get(&this.o1) set() + + object1 o1; + object2 o2; + bool o2_null; + }; + + // Test loading into raw pointer with non-raw object pointer. + // + using std::shared_ptr; + + #pragma db object pointer(shared_ptr) + struct object3 + { + object3 (int id_ = 0, int n_ = 0): id (id_), n (n_) {} + + #pragma db id + int id; + + int n; + }; + + #pragma db view object(object3) + struct view3 + { + // This view implements the following slightly twisted logic: if the + // object is already in the cache, then set o3_p to that. Otherwise, + // load it into the by-value instance. We can also check whether o3_p + // points to o3 to distinguish between the two outcomes. + // + + // Since we may be getting the pointer as both smart and raw, we + // need to create a bit of support code to use in the modifier + // expression. + // + void set_o3 (object3* p) {o3_p = p;} // &o3 or NULL. + void set_o3 (shared_ptr p) {o3_p = p.get ();} // From cache. + + #pragma db get(&this.o3) set(set_o3(?)) + object3* o3_p; + + #pragma db transient + object3 o3; + + // Return-by-value support (query_value()). + // + view3 (): o3_p (0) {} + view3 (const view3& x): o3_p (x.o3_p == &x.o3 ? &o3 : x.o3_p), o3 (x.o3) {} + }; +} + +#endif // TEST4_HXX diff --git a/odb-tests/common/view/olv/test5.hxx b/odb-tests/common/view/olv/test5.hxx new file mode 100644 index 0000000..e3a671b --- /dev/null +++ b/odb-tests/common/view/olv/test5.hxx @@ -0,0 +1,86 @@ +// file : common/view/olv/test5.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST5_HXX +#define TEST5_HXX + +#include +#include // shared_ptr +#include // pair + +#include + +// Test NULL object pointers. +// +#pragma db namespace table("t5_") pointer(std::shared_ptr) session +namespace test5 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; + + typedef std::pair comp_id; + #pragma db value(comp_id) + + #pragma db object + struct object3 + { + object3 (comp_id id_ = comp_id (), int n_ = 0): id (id_), n (n_) {} + + #pragma db id + comp_id id; + + int n; + }; + + #pragma db object + struct object4 + { + object4 () {} + object4 (const char* s_, shared_ptr o3_): s (s_), o3 (o3_) {} + + #pragma db id auto + int id; + + std::string s; + shared_ptr o3; + }; + + #pragma db view object(object3) object(object4) + struct view2 + { + shared_ptr o4; + shared_ptr o3; + }; +} + +#endif // TEST5_HXX diff --git a/odb-tests/common/view/olv/test6.hxx b/odb-tests/common/view/olv/test6.hxx new file mode 100644 index 0000000..5336fa6 --- /dev/null +++ b/odb-tests/common/view/olv/test6.hxx @@ -0,0 +1,57 @@ +// file : common/view/olv/test6.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST6_HXX +#define TEST6_HXX + +#include +#include // shared_ptr + +#include +#include + +// Test interaction with sections. +// +#pragma db namespace table("t6_") pointer(std::shared_ptr) +namespace test6 +{ + using std::shared_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, shared_ptr o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + + #pragma db load(lazy) + odb::section r; + + #pragma db section(r) + shared_ptr o1; + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + shared_ptr o1; + shared_ptr o2; + }; +} + +#endif // TEST6_HXX diff --git a/odb-tests/common/view/olv/test7.hxx b/odb-tests/common/view/olv/test7.hxx new file mode 100644 index 0000000..dbdc663 --- /dev/null +++ b/odb-tests/common/view/olv/test7.hxx @@ -0,0 +1,57 @@ +// file : common/view/olv/test7.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST7_HXX +#define TEST7_HXX + +#include +#include // unique_ptr +#include // std::move + +#include + +// Test explicit conversion to smart pointer member. +// +#pragma db namespace table("t7_") pointer(*) session +namespace test7 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + #pragma db id auto + int id; + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + + unique_ptr o2; + unique_ptr o1; + }; +} + +#endif // TEST7_HXX diff --git a/odb-tests/common/view/olv/test8.hxx b/odb-tests/common/view/olv/test8.hxx new file mode 100644 index 0000000..607d222 --- /dev/null +++ b/odb-tests/common/view/olv/test8.hxx @@ -0,0 +1,54 @@ +// file : common/view/olv/test8.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST8_HXX +#define TEST8_HXX + +#include +#include // unique_ptr +#include // std::move + +#include + +// Test loading objects without id. +// +#pragma db namespace table("t8_") pointer(*) session +namespace test8 +{ + using std::unique_ptr; + + #pragma db object + struct object1 + { + object1 (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object no_id + struct object2 + { + object2 () {} + object2 (const char* s_, object1* o1_): s (s_), o1 (o1_) {} + + std::string s; + object1* o1; // Shallow. + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + + unique_ptr o2; + unique_ptr o1; + }; +} + +#endif // TEST8_HXX diff --git a/odb-tests/common/view/olv/test9.hxx b/odb-tests/common/view/olv/test9.hxx new file mode 100644 index 0000000..b109de3 --- /dev/null +++ b/odb-tests/common/view/olv/test9.hxx @@ -0,0 +1,78 @@ +// file : common/view/olv/test9.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST9_HXX +#define TEST9_HXX + +#include +#include // shared_ptr + +#include + +// Test loading polymorphic objects. +// +#pragma db namespace table("t9_") session +namespace test9 +{ + using std::shared_ptr; + + #pragma db object polymorphic pointer(shared_ptr) + struct root + { + virtual ~root () {} + root (int n_ = 0): n (n_) {} + + #pragma db id auto + int id; + + int n; + }; + + #pragma db object + struct base: root + { + base (int n_ = 0, const char* s_ = ""): root (n_), s (s_) {} + + std::string s; + }; + + #pragma db object + struct derived: base + { + derived (int n_ = 0, const char* s_ = "", bool b_ = false) + : base (n_, s_), b (b_) {} + + bool b; + }; + + // Load via root. + // + #pragma db view object(root) + struct view1r + { + shared_ptr o; + int n; + }; + + // Load via base. + // + #pragma db view object(base) + struct view1b + { + std::string s; + shared_ptr o; + int n; + }; + + // Load via derived. + // + #pragma db view object(derived) + struct view1d + { + std::string s; + shared_ptr o; + int n; + }; +} + +#endif // TEST9_HXX diff --git a/odb-tests/common/view/olv/testscript b/odb-tests/common/view/olv/testscript new file mode 100644 index 0000000..160426d --- /dev/null +++ b/odb-tests/common/view/olv/testscript @@ -0,0 +1,39 @@ +# file : common/view/olv/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../../mysql-schema.testscript + + for s: $schemas + cat $out_base/"$s"($multi ? '-mysql' : '').sql | $create_schema_cmd + end; + + $* ($multi ? 'mysql' : ) $mysql_options +} + +: sqlite +: +if $sqlite +{ + .include ../../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../../pgsql-schema.testscript + + for s: $schemas + $create_schema_cmd -f $out_base/"$s"($multi ? '-pgsql' : '').sql + end; + + $* ($multi ? 'pgsql' : ) $pgsql_options +} diff --git a/odb-tests/common/virtual/buildfile b/odb-tests/common/virtual/buildfile new file mode 100644 index 0000000..96d062e --- /dev/null +++ b/odb-tests/common/virtual/buildfile @@ -0,0 +1,42 @@ +# file : common/virtual/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix virtual_ \ + --generate-schema \ + --generate-query \ + --generate-session + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/virtual/driver.cxx b/odb-tests/common/virtual/driver.cxx new file mode 100644 index 0000000..f96f543 --- /dev/null +++ b/odb-tests/common/virtual/driver.cxx @@ -0,0 +1,154 @@ +// file : common/virtual/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test virtual data members. +// + +#include // std::auto_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test basic virtual data member functionality. + // + { + using namespace test1; + + object o; + o.i (123); + o.c1.i = 123; + o.c1.s = "abc"; + o.v1.push_back ("abc"); + o.v1.push_back ("abd"); + o.v1.push_back ("abe"); + o.p1 = new object; + + { + transaction t (db->begin ()); + db->persist (*o.p1); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (o.id1.v)); + t.commit (); + + assert (o == *p); + } + } + + // Test pragma resolution to virtual data member. + // + { + using namespace test2; + + object1 o1 (1); + o1.o2 = new object2 (1); + o1.o2->o1 = &o1; + + { + transaction t (db->begin ()); + db->persist (*o1.o2); + o1.n1 = o1.o2->id; + db->persist (o1); + t.commit (); + } + + { + session s; + transaction t (db->begin ()); + unique_ptr p (db->load (o1.id)); + t.commit (); + + assert (p->o2->id == o1.o2->id); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::object2::id == o1.o2->id)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::o2::id == o1.o2->id)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + + { + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ()); + result::iterator i (r.begin ()); + assert (i != r.end () && i->i == o1.n1); + assert (++i == r.end ()); + t.commit (); + } + } + + // Use virtual data members to implement multi-member composite object id. + // + { + using namespace test3; + + person o; + o.first_ = "John"; + o.last_ = "Doe"; + + name id; + { + transaction t (db->begin ()); + id = db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p (db->load (id)); + t.commit (); + + assert (o.first_ == p->first_ && o.last_ == p->last_); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/virtual/test.hxx b/odb-tests/common/virtual/test.hxx new file mode 100644 index 0000000..2654d09 --- /dev/null +++ b/odb-tests/common/virtual/test.hxx @@ -0,0 +1,171 @@ +// file : common/virtual/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Test basic virtual data member functionality. +// +#pragma db namespace table("t1_") +namespace test1 +{ + #pragma db value + struct comp + { + int i; + + #pragma db transient + std::string s; + #pragma db member(s_) virtual(std::string) access(s) + + bool operator== (const comp& v) const + { + return i == v.i && s == v.s; + } + }; + + #pragma db object transient + struct object + { + object (): p1 (0) {} + ~object () {delete p1;} + + struct {unsigned long v;} id1; + + #pragma db id + #pragma db member(id) get(id1.v) virtual(unsigned long) set(id1.v) + #pragma db member(id) auto + + int i () const {return i1;} + void i (int i) {i1 = i;} + int i1; + + comp c1; + #pragma db member(c) virtual(comp) access(c1) + + typedef std::vector strings; + strings v1; + #pragma db member(v) virtual(strings) access(v1) + + typedef object* object_ptr; + object_ptr p1; + #pragma db member(p) virtual(object_ptr) access(p1) + + bool operator== (const object& o) const + { + return id1.v == o.id1.v && + i1 == o.i1 && + c1 == o.c1 && + v1 == o.v1 && + (p1 != 0 ? o.p1 != 0 && *p1 == *o.p1 : o.p1 == 0); + } + }; + + #pragma db member(object::i) virtual(int) +} + +#pragma db member(test1::object::id) column("oid") + +// Test pragma resolution to virtual data member. +// +#pragma db namespace table("t2_") +namespace test2 +{ + struct object1; + struct object2; + + typedef object1* object1_ptr; + typedef object2* object2_ptr; + + #pragma db object + struct object2 + { + object2 (unsigned long i = 0): id (i) {} + + #pragma db id + unsigned long id; + + #pragma db inverse(o) + object1_ptr o1; + }; + + #pragma db object + struct object1 + { + object1 (unsigned long i = 0): id (i), o2 (0) {} + ~object1 () {delete o2;} + + #pragma db id + unsigned long id; + + #pragma db transient + object2_ptr o2; + #pragma db member(o) virtual(object2_ptr) access(o2) + + #pragma db transient + unsigned long n1; + #pragma db member(n) virtual(unsigned long) access(n1) + #pragma db index member(n) + }; + + #pragma db view object(object1) object(object2) + struct view1 + { + #pragma db column(object1::n) + unsigned long i; + }; + + #pragma db view object(object1 = o1) object(object2 = o2: o1::n == o2::id) + struct view2 + { + #pragma db column(o1::n) + unsigned long i; + }; + + #pragma db view object(object1: object1::n != 0) + struct view3 + { + #pragma db column(test2::object1::n) + unsigned long i; + }; +} + +// Use virtual data members to implement multi-member composite object id. +// +#pragma db namespace table("t3_") +namespace test3 +{ + #pragma db value + struct name + { + name () {} + name (const std::string& f, const std::string& l) + : first (f), last(l) {} + + std::string first; + std::string last; + + bool operator< (const name& x) const + { + return first < x.first || (first == x.first && last < x.last); + } + }; + + #pragma db object transient + struct person + { + std::string first_; + std::string last_; + + #pragma db member(name) virtual(name) id \ + get(::test3::name (this.first_, this.last_)) \ + set(this.first_ = (?).first; this.last_ = (?).last) + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/virtual/testscript b/odb-tests/common/virtual/testscript new file mode 100644 index 0000000..769c7f9 --- /dev/null +++ b/odb-tests/common/virtual/testscript @@ -0,0 +1,33 @@ +# file : common/virtual/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/common/wrapper/buildfile b/odb-tests/common/wrapper/buildfile new file mode 100644 index 0000000..57f43f2 --- /dev/null +++ b/odb-tests/common/wrapper/buildfile @@ -0,0 +1,40 @@ +# file : common/wrapper/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +libs = + +for db: $databases + import libs += libodb-$db%lib{odb-$db} + +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +for db: $databases +{ + exe{driver}: {hxx ixx cxx}{test-odb-$db}: include = $multi + <{hxx ixx cxx}{test-odb-$db}>: hxx{test} libue{test-meta} +} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix wrapper_ \ + --generate-schema + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{database-client}: include = adhoc diff --git a/odb-tests/common/wrapper/driver.cxx b/odb-tests/common/wrapper/driver.cxx new file mode 100644 index 0000000..9c352fc --- /dev/null +++ b/odb-tests/common/wrapper/driver.cxx @@ -0,0 +1,216 @@ +// file : common/wrapper/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test wrapper machinery. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_database (argc, argv)); + + // Test 1: simple values. + // + { + using namespace test1; + + unsigned long id1, id2; + { + object1 o1; + object2 o2; + + o1.num.reset (new int (123)); + o1.nstrs.push_back (nullable_string ()); + o1.nstrs.push_back (nullable_string ("123")); + + o2.sstrs.push_back (str_sptr ()); + o2.sstrs.push_back (str_sptr (new string ("123"))); + + transaction t (db->begin ()); + id1 = db->persist (o1); + id2 = db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + t.commit (); + + assert (*o1->num == 123); + assert (o1->str.get () == 0); + assert (o1->nstr.null ()); + assert (o1->nstrs[0].null ()); + assert (o1->nstrs[1].get () == "123"); + + assert (!o2->sstr); + assert (!o2->sstrs[0]); + assert (*o2->sstrs[1] == "123"); + } + } + + // + // Composite values. + // + unsigned long id; + { + comp_object co; + + co.c1.reset (new comp1 ("123", 123)); + co.vc1.push_back (comp1 ("1", 1)); + co.vc1.push_back (comp1 ("2", 2)); + co.vc1.push_back (comp1 ("3", 3)); + + co.c2.reset (new comp2 ("123", 123)); + co.c2->strs.push_back ("1"); + co.c2->strs.push_back ("2"); + co.c2->strs.push_back ("3"); + + { + transaction t (db->begin ()); + id = db->persist (co); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (id)); + t.commit (); + + assert (*o->c1 == *co.c1); + assert (o->vc1 == co.vc1); + assert (*o->c2 == *co.c2); + } + } + + // + // Containers. + // + { + cont_object co; + + co.nums.reset (new vector); + co.nums->push_back (1); + co.nums->push_back (2); + co.nums->push_back (3); + + co.c.num = 123; + co.c.strs.reset (new vector); + co.c.strs->push_back ("1"); + co.c.strs->push_back ("2"); + co.c.strs->push_back ("3"); + + { + transaction t (db->begin ()); + id = db->persist (co); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (id)); + t.commit (); + + assert (*o->nums == *co.nums); + assert (o->c == co.c); + } + } + + // Test 5: composite NULL values. + // + { + using namespace test5; + + object o1, o2; + + o1.v.push_back (nullable ()); + + o2.p.reset (new comp (1, "a")); + o2.n = comp (2, "b"); + o2.v.push_back (comp (3, "c")); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->p.get () == 0); + assert (!p1->n); + assert (!p1->v[0]); + + assert (p2->p.get () != 0 && *p2->p == *o2.p); + assert (p2->n && *p2->n == *o2.n); + assert (p2->v[0] && *p2->v[0] == *o2.v[0]); + } + + // Update. + // + { + o1.p.reset (new comp (1, "a")); + o1.n = comp (2, "b"); + o1.v[0] = comp (3, "c"); + + o2.p.reset (); + o2.n.reset (); + o2.v[0].reset (); + + transaction t (db->begin ()); + db->update (o1); + db->update (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (o1.id)); + unique_ptr p2 (db->load (o2.id)); + t.commit (); + + assert (p1->p.get () != 0 && *p1->p == *o1.p); + assert (p1->n && *p1->n == *o1.n); + assert (p1->v[0] && *p1->v[0] == *o1.v[0]); + + assert (p2->p.get () == 0); + assert (!p2->n); + assert (!p2->v[0]); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/common/wrapper/test.hxx b/odb-tests/common/wrapper/test.hxx new file mode 100644 index 0000000..3ae4151 --- /dev/null +++ b/odb-tests/common/wrapper/test.hxx @@ -0,0 +1,214 @@ +// file : common/wrapper/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include // std::unique_ptr +#include + +#include +#include + +using odb::nullable; + +// Test 1: simple values. +// +#pragma db namespace table("t1_") +namespace test1 +{ + typedef nullable nullable_string; + + typedef std::unique_ptr num_uptr; + typedef std::unique_ptr str_uptr; + typedef std::shared_ptr str_sptr; + + #pragma db object table("obj1") + struct object1 + { + #pragma db id auto + unsigned long id_; + + num_uptr num; + + #pragma db null + str_uptr str; + + nullable_string nstr; + std::vector nstrs; + }; + + #pragma db object + struct object2 + { + #pragma db id auto + unsigned long id_; + + #pragma db null + str_sptr sstr; + + #pragma db value_null + std::vector sstrs; + }; +} + +// +// Composite values. +// + +#pragma db value +struct comp1 +{ + comp1 () {} + comp1 (const std::string& s, int n): str (s), num (n) {} + + std::string str; + int num; +}; + +inline bool +operator== (const comp1& x, const comp1& y) +{ + return x.str == y.str && x.num == y.num; +} + + +#pragma db value +struct comp2 +{ + comp2 () {} + comp2 (const std::string& s, int n): str (s), num (n) {} + + std::string str; + int num; + + std::vector strs; +}; + +inline bool +operator== (const comp2& x, const comp2& y) +{ + return x.str == y.str && x.num == y.num && x.strs == y.strs; +} + +struct comp3; + +typedef std::unique_ptr comp1_uptr; +typedef std::unique_ptr comp2_uptr; +typedef std::unique_ptr comp3_uptr; + +#pragma db object +struct comp_object +{ + #pragma db id auto + unsigned long id_; + + comp1_uptr c1; // Wrapped comp value. + std::vector > vc1; // Container of wrapped comp values. + comp2_uptr c2; // Container inside wrapped comp value. +}; + +// This one is just a compilation test to cover more convolute cases. +// +#pragma db value +struct comp3: comp2 +{ + comp1_uptr c1; + std::vector > vc1; +}; + +#pragma db object +struct comp_object2 +{ + #pragma db id auto + unsigned long id_; + + comp3_uptr c3; +}; + +// +// Containers. +// + +typedef std::unique_ptr> nums_uptr; +typedef std::unique_ptr> strs_uptr; + +#pragma db value +struct cont_comp +{ + int num; + strs_uptr strs; +}; + +inline bool +operator== (const cont_comp& x, const cont_comp& y) +{ + return x.num == y.num && *x.strs == *y.strs; +} + +#pragma db object +struct cont_object +{ + #pragma db id auto + unsigned long id_; + + nums_uptr nums; // Wrapped container. + cont_comp c; // Wrapped container in comp value. +}; + +// Test composite NULL values. +// +#pragma db namespace table("t5_") +namespace test5 +{ + #pragma db value + struct base + { + base () {} + base (int n): num (n) {} + + int num = 0; + }; + + inline bool + operator== (const base& x, const base& y) + { + return x.num == y.num; + } + + #pragma db value + struct comp: base + { + comp () {} + comp (int n, const std::string s): base (n), str (s), extra (n + 1) {} + + std::string str; + base extra; + + odb::nullable always_null; + }; + + inline bool + operator== (const comp& x, const comp& y) + { + return static_cast (x) == y && + x.str == y.str && x.extra == y.extra; + } + + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + #pragma db null + std::unique_ptr p; + + odb::nullable n; + + std::vector< odb::nullable > v; + }; +} + +#endif // TEST_HXX diff --git a/odb-tests/common/wrapper/testscript b/odb-tests/common/wrapper/testscript new file mode 100644 index 0000000..6630813 --- /dev/null +++ b/odb-tests/common/wrapper/testscript @@ -0,0 +1,33 @@ +# file : common/wrapper/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript + +: mysql +: +if $mysql +{ + .include ../../mysql.testscript + + $create_schema; + $* +} + +: sqlite +: +if $sqlite +{ + .include ../../sqlite.testscript + + $* +} + +: pgsql +: +if $pgsql +{ + .include ../../pgsql.testscript + + $create_schema; + $* +} diff --git a/odb-tests/database-options.testscript b/odb-tests/database-options.testscript new file mode 100644 index 0000000..2c0ee82 --- /dev/null +++ b/odb-tests/database-options.testscript @@ -0,0 +1,75 @@ +# file : database-options.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# For the enabled databases create the test driver option lists (*_options) +# for subsequent use in the tests. Also create the database-specific client +# option lists (*_client_options) and command lines (*_client_cmd) which can +# be used as a base for the data manipulation commands. +# ++if $mysql + mysql_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + mysql_client_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + if $defined(config.odb_tests.mysql.passwd) + mysql_options += --password $config.odb_tests.mysql.passwd + mysql_client_options += --password=$config.odb_tests.mysql.passwd + end + + if $defined(config.odb_tests.mysql.host) + mysql_options += --host $config.odb_tests.mysql.host + mysql_client_options += --host $config.odb_tests.mysql.host + end + + if $defined(config.odb_tests.mysql.port) + mysql_options += --port $config.odb_tests.mysql.port + mysql_client_options += --port $config.odb_tests.mysql.port + end + + if $defined(config.odb_tests.mysql.socket) + mysql_options += --socket $config.odb_tests.mysql.socket + mysql_client_options += --socket $config.odb_tests.mysql.socket + end + + mysql_client_cmd = $path($mysql_client) $mysql_client_options +end + ++if $sqlite + sqlite_options = --database odb-test.db + + # Note that we currently don't manipulate the data using the sqlite3 + # utility. Thus, we don't create the sqlite client option list and command + # line. + # +end + ++if $pgsql + pgsql_options = --user $config.odb_tests.pgsql.user \ + --database $config.odb_tests.pgsql.database + + pgsql_client_options = --quiet \ + --set ON_ERROR_STOP=1 \ + --username $config.odb_tests.pgsql.user \ + --dbname $config.odb_tests.pgsql.database + + if $defined(config.odb_tests.pgsql.host) + pgsql_options += --host $config.odb_tests.pgsql.host + pgsql_client_options += --host $config.odb_tests.pgsql.host + end + + if $defined(config.odb_tests.pgsql.port) + pgsql_options += --port $config.odb_tests.pgsql.port + pgsql_client_options += --port $config.odb_tests.pgsql.port + end + + pgsql_client_cmd = $path($pgsql_client) $pgsql_client_options + + export PGOPTIONS=--client-min-messages=warning +end + +# Set the default schema file name, which can be overridden by the subsequent +# tests in their own scopes. +# +schema = test diff --git a/odb-tests/evolution/add-column/driver.cxx b/odb-tests/evolution/add-column/driver.cxx new file mode 100644 index 0000000..d4eb396 --- /dev/null +++ b/odb-tests/evolution/add-column/driver.cxx @@ -0,0 +1,125 @@ +// file : evolution/add-column/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (!p->str); + assert (p->num == 999); + + // Migration. + // + p->str = "abc"; + p->num = 123; + db->update (*p); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str && *p->str == "abc"); + assert (p->num == 123); + + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/add-column/model.hxx b/odb-tests/evolution/add-column/model.hxx new file mode 100644 index 0000000..6ac9160 --- /dev/null +++ b/odb-tests/evolution/add-column/model.hxx @@ -0,0 +1,38 @@ +// file : evolution/add-column/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + odb::nullable str; + + #pragma db default(999) + unsigned long num; +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/add-column/test1.hxx b/odb-tests/evolution/add-column/test1.hxx new file mode 100644 index 0000000..b0d7fda --- /dev/null +++ b/odb-tests/evolution/add-column/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/add-column/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/add-column/test2.hxx b/odb-tests/evolution/add-column/test2.hxx new file mode 100644 index 0000000..b62530a --- /dev/null +++ b/odb-tests/evolution/add-column/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-column/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/add-column/test3.hxx b/odb-tests/evolution/add-column/test3.hxx new file mode 100644 index 0000000..b24dba1 --- /dev/null +++ b/odb-tests/evolution/add-column/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-column/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/add-foreign-key/driver.cxx b/odb-tests/evolution/add-foreign-key/driver.cxx new file mode 100644 index 0000000..177b615 --- /dev/null +++ b/odb-tests/evolution/add-foreign-key/driver.cxx @@ -0,0 +1,173 @@ +// file : evolution/add-foreign-key/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a foreign key. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o (1); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + +#ifdef DATABASE_SQLITE + // In SQLite we can only add foreign keys inline in the column + // definition. + // + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Both pointers are now NULL. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->o1 == 0 && p->o2 == 0); + + // Migration. The foreign key constraint is not yet there. + // + p->o1 = new object1 (1); + p->o2 = new object2 (1); + db->update (*p); + + t.commit (); + } + + // Migration. Add the missing objects. + // + object1 o1 (1); + object2 o2 (1); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->o1->id_ == 1); + assert (p->o2->id_ == 1); + t.commit (); + } + + // Now the foreign key constraint is there. + // + try + { + object o (2); + o.o1 = new object1 (2); + o.o2 = new object2 (2); + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} + + // As well as the NOT NULL. + // +#ifndef DATABASE_SQLITE + try + { + object o (3); + o.o2 = 0; + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} +#endif + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/add-foreign-key/model.hxx b/odb-tests/evolution/add-foreign-key/model.hxx new file mode 100644 index 0000000..f5fe26d --- /dev/null +++ b/odb-tests/evolution/add-foreign-key/model.hxx @@ -0,0 +1,66 @@ +// file : evolution/add-foreign-key/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include + +#include // DATABASE_XXX + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 3 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; +#endif + + #pragma db object + struct object + { + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + object (unsigned long id = 0): id_ (id) {} +#else + object1* o1; + + // There is no support for changing a column to NOT NULL in SQLite. + // +#ifndef ODB_DATABASE_SQLITE + #pragma db not_null +#endif + object2* o2; + + object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} + ~object () {delete o1; delete o2;} +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/add-foreign-key/test1.hxx b/odb-tests/evolution/add-foreign-key/test1.hxx new file mode 100644 index 0000000..05c78c3 --- /dev/null +++ b/odb-tests/evolution/add-foreign-key/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/add-foreign-key/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/add-foreign-key/test2.hxx b/odb-tests/evolution/add-foreign-key/test2.hxx new file mode 100644 index 0000000..c57d9a1 --- /dev/null +++ b/odb-tests/evolution/add-foreign-key/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-foreign-key/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/add-foreign-key/test3.hxx b/odb-tests/evolution/add-foreign-key/test3.hxx new file mode 100644 index 0000000..c844469 --- /dev/null +++ b/odb-tests/evolution/add-foreign-key/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-foreign-key/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/add-index/driver.cxx b/odb-tests/evolution/add-index/driver.cxx new file mode 100644 index 0000000..689504e --- /dev/null +++ b/odb-tests/evolution/add-index/driver.cxx @@ -0,0 +1,165 @@ +// file : evolution/add-index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new index. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o0 (0); + o0.num = 123; + + object o1 (1); + o1.num = 234; + + object o2 (2); + o2.num = 234; + + // Duplicates are ok. + // + { + transaction t (db->begin ()); + db->persist (o0); + db->persist (o1); + db->persist (o2); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + object o3 (3); + o3.num = 234; + + // Duplicates are still ok but we need to remove them before the + // post migration step. + // + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query ( + "ORDER BY" + query::num + "," + query::id)); + + unsigned long prev (0); + for (result::iterator i (r.begin ()); i != r.end (); ++i) + { + if (i->num == prev) + db->erase (*i); + + prev = i->num; + } + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p0 (db->load (0)); + auto_ptr p1 (db->load (1)); + + assert (p0->num == 123); + assert (p1->num == 234); + + t.commit (); + } + + try + { + object o2 (2); + o2.num = 234; + + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/add-index/model.hxx b/odb-tests/evolution/add-index/model.hxx new file mode 100644 index 0000000..fec75cc --- /dev/null +++ b/odb-tests/evolution/add-index/model.hxx @@ -0,0 +1,33 @@ +// file : evolution/add-index/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db unique +#endif + unsigned long num; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/add-index/test1.hxx b/odb-tests/evolution/add-index/test1.hxx new file mode 100644 index 0000000..1be2b5b --- /dev/null +++ b/odb-tests/evolution/add-index/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/add-index/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/add-index/test2.hxx b/odb-tests/evolution/add-index/test2.hxx new file mode 100644 index 0000000..a0faca9 --- /dev/null +++ b/odb-tests/evolution/add-index/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-index/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/add-index/test3.hxx b/odb-tests/evolution/add-index/test3.hxx new file mode 100644 index 0000000..aab9c86 --- /dev/null +++ b/odb-tests/evolution/add-index/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-index/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/add-table/driver.cxx b/odb-tests/evolution/add-table/driver.cxx new file mode 100644 index 0000000..67b0f0e --- /dev/null +++ b/odb-tests/evolution/add-table/driver.cxx @@ -0,0 +1,140 @@ +// file : evolution/add-table/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test adding a new table (object, container). +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif + } + + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + object1 o1; + o1.nums.push_back (1); + o1.nums.push_back (2); + o1.nums.push_back (3); + + { + transaction t (db->begin ()); + o1.o = db->load (1); + db->persist (o1); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o->str == "abc")); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && + i->o->id_ == 1 && + i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); + assert (++i == e); + + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/add-table/model.hxx b/odb-tests/evolution/add-table/model.hxx new file mode 100644 index 0000000..208a156 --- /dev/null +++ b/odb-tests/evolution/add-table/model.hxx @@ -0,0 +1,48 @@ +// file : evolution/add-table/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db object + struct object1 + { + object1 (): o (0) {} + ~object1 () {delete o;} + + #pragma db id auto + unsigned long id_; + + object* o; + std::vector nums; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/add-table/test1.hxx b/odb-tests/evolution/add-table/test1.hxx new file mode 100644 index 0000000..adc51a1 --- /dev/null +++ b/odb-tests/evolution/add-table/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/add-table/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/add-table/test2.hxx b/odb-tests/evolution/add-table/test2.hxx new file mode 100644 index 0000000..ca03cef --- /dev/null +++ b/odb-tests/evolution/add-table/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-table/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/add-table/test3.hxx b/odb-tests/evolution/add-table/test3.hxx new file mode 100644 index 0000000..39406a2 --- /dev/null +++ b/odb-tests/evolution/add-table/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/add-table/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/alter-column/driver.cxx b/odb-tests/evolution/alter-column/driver.cxx new file mode 100644 index 0000000..be63f05 --- /dev/null +++ b/odb-tests/evolution/alter-column/driver.cxx @@ -0,0 +1,160 @@ +// file : evolution/alter-column/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test altering a column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // SQLite doesn't support altering of columns. + // +#ifndef DATABASE_SQLITE + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o (1); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // NULL is already in effect; NOT NULL is not yet. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (!p->str); + assert (p->num && *p->num == 123); + assert (!p->num1); + + // Migration. + // + p->str = "abc"; + p->num.reset (); + p->num1 = 123; + db->update (*p); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str && *p->str == "abc"); + assert (!p->num); + + t.commit (); + } + + // NOT NULL is now in effect. + // + try + { + object o2 (2); + o2.num1 = 234; // str is NULL + + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + + try + { + object o3 (3); + o3.str = "bcd"; // num1 is NULL + + transaction t (db->begin ()); + db->persist (o3); + assert (false); + } + catch (const odb::exception& ) {} + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } +#endif // DATABASE_SQLITE + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/alter-column/model.hxx b/odb-tests/evolution/alter-column/model.hxx new file mode 100644 index 0000000..fc6661c --- /dev/null +++ b/odb-tests/evolution/alter-column/model.hxx @@ -0,0 +1,56 @@ +// file : evolution/alter-column/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#include // DATABASE_XXX + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + // SQLite doesn't support altering of columns. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + odb::nullable str; + + unsigned long num; +#else + // Use nullable to be able to access during migration. + // + #pragma db not_null + odb::nullable str; + + odb::nullable num; + + // Test adding NOT NULL column. It should be added NULL in pre + // and then converted to NOT NULL in post. + // + #pragma db not_null + odb::nullable num1; +#endif +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/alter-column/test1.hxx b/odb-tests/evolution/alter-column/test1.hxx new file mode 100644 index 0000000..9353558 --- /dev/null +++ b/odb-tests/evolution/alter-column/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/alter-column/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/alter-column/test2.hxx b/odb-tests/evolution/alter-column/test2.hxx new file mode 100644 index 0000000..e2dbed3 --- /dev/null +++ b/odb-tests/evolution/alter-column/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/alter-column/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/alter-column/test3.hxx b/odb-tests/evolution/alter-column/test3.hxx new file mode 100644 index 0000000..ac08e2f --- /dev/null +++ b/odb-tests/evolution/alter-column/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/alter-column/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/combined/driver.cxx b/odb-tests/evolution/combined/driver.cxx new file mode 100644 index 0000000..88453c3 --- /dev/null +++ b/odb-tests/evolution/combined/driver.cxx @@ -0,0 +1,157 @@ +// file : evolution/combined/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Combined schema evolution test. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o ("1"); + o.dui = 1; + o.anui = 1; + o.dnui = 1; + o.dc = 1; + o.dt.push_back (1); + o.aui = 1; + +#ifndef DATABASE_SQLITE + o.dfk = new object1 (1); + o.acn = 1; + o.acnn.reset (); + o.afk = 1; +#endif + + { + transaction t (db->begin ()); +#ifndef DATABASE_SQLITE + db->persist (o.dfk); +#endif + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + + assert (p->ac1 == 999); + assert (!p->ac2); + +#ifndef DATABASE_SQLITE + assert (!p->ac3); +#endif + // Migrate. + // + p->at.push_back ("abc"); + +#ifndef DATABASE_SQLITE + p->dfk = 999; + p->ac3 = 1; + p->acn.reset (); + p->acnn = 1; +#endif + db->update (*p); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load ("1")); + + // Check post-migration. + // + assert (p->at[0] == "abc"); + +#ifndef DATABASE_SQLITE + assert (p->dfk == 999); + assert (*p->ac3 == 1); + assert (!p->acn); + assert (*p->acnn == 1); +#endif + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/combined/model.hxx b/odb-tests/evolution/combined/model.hxx new file mode 100644 index 0000000..e924943 --- /dev/null +++ b/odb-tests/evolution/combined/model.hxx @@ -0,0 +1,174 @@ +// file : evolution/combined/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include +#include + +#include // DATABASE_XXX + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object + { + #pragma db id + std::string id_; + + // + // Pre pass 1. + // + + // Drop unique index. + // +#if MODEL_VERSION == 2 + #pragma db unique +#endif + unsigned long dui; + + // Alter table drop foreign key. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + object1* dfk; +#else + #pragma db null + unsigned long dfk; +#endif +#endif + + // Add table. + // +#if MODEL_VERSION == 3 + std::vector at; +#endif + + // Add column. + // +#if MODEL_VERSION == 3 + #pragma db default(999) + unsigned long ac1; + + odb::nullable ac2; + + // Initially added as NULL, converted to NOT NULL. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE + #pragma db not_null + odb::nullable ac3; +#endif +#endif + + // Alter column NULL. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + unsigned long acn; +#else + odb::nullable acn; +#endif +#endif + + // + // Pre pass 2. + // + + // Add non-unique indexes. + // +#if MODEL_VERSION == 3 + #pragma db index +#endif + unsigned long anui; + + // + // Post pass 1. + // + + // Drop non-unique indexes. + // +#if MODEL_VERSION == 2 + #pragma db index +#endif + unsigned long dnui; + + // + // Post pass 2. + // + + // Drop table. + // +#if MODEL_VERSION == 2 + std::vector dt; +#endif + + // Drop column. Logical drop (set NULL) in SQLite. + // +#if MODEL_VERSION == 2 + unsigned long dc; +#endif + + // Alter column NOT NULL. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 3 + #pragma db not_null +#endif + odb::nullable acnn; +#endif + + // Alter table add foreign key. Not supported by SQLite. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + #pragma db null + unsigned long afk; +#else + object1* afk; +#endif +#endif + + // Add unique index. + // +#if MODEL_VERSION == 3 + #pragma db unique +#endif + unsigned long aui; + + public: +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + + object (std::string id = ""): id_ (id), dfk (0) {} + ~object () {delete dfk;} +#else + object (std::string id = ""): id_ (id), afk (0) {} + ~object () {delete afk;} +#endif +#else + object (std::string id = ""): id_ (id) {} +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/combined/test1.hxx b/odb-tests/evolution/combined/test1.hxx new file mode 100644 index 0000000..1a18aff --- /dev/null +++ b/odb-tests/evolution/combined/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/combined/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/combined/test2.hxx b/odb-tests/evolution/combined/test2.hxx new file mode 100644 index 0000000..8eb7ac8 --- /dev/null +++ b/odb-tests/evolution/combined/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/combined/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/combined/test3.hxx b/odb-tests/evolution/combined/test3.hxx new file mode 100644 index 0000000..05a052f --- /dev/null +++ b/odb-tests/evolution/combined/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/combined/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/data/driver.cxx b/odb-tests/evolution/data/driver.cxx new file mode 100644 index 0000000..73cc852 --- /dev/null +++ b/odb-tests/evolution/data/driver.cxx @@ -0,0 +1,178 @@ +// file : evolution/data/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test data migration support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX, HAVE_CXX11 +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +void +migrate1 (database& db) +{ + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (1)); + object2 o2 (1); + o2.num = o1->num; + db.persist (o2); +} + +void +migrate2 (database& db) +{ + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (2)); + object2 o2 (2); + o2.num = o1->num; + db.persist (o2); +} + +static const data_migration_entry<3, 1> migrate2_entry (&migrate2); + +int +main (int argc, char* argv[]) +{ + schema_catalog::data_migration_function<3, 1> (&migrate1); + +#ifdef HAVE_CXX11 + schema_catalog::data_migration_function<3, 1> ( + [] (database& db) + { + using namespace v2; + using namespace v3; + + auto_ptr o1 (db.load (11)); + object2 o2 (11); + o2.num = o1->num; + db.persist (o2); + }); +#endif + + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + { + transaction t (db->begin ()); + + { + object1 o1 (1); + o1.num = 123; + db->persist (o1); + } + + { + object1 o1 (2); + o1.num = 123; + db->persist (o1); + } + +#ifdef HAVE_CXX11 + { + object1 o1 (11); + o1.num = 123; + db->persist (o1); + } +#endif + t.commit (); + } + break; + } + case 2: + { + { + transaction t (db->begin ()); + + if (embedded) + schema_catalog::migrate (*db); + else + schema_catalog::migrate_data (*db); + + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + + { + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + } + + { + auto_ptr o2 (db->load (2)); + assert (o2->num == 123); + } + +#ifdef HAVE_CXX11 + { + auto_ptr o2 (db->load (11)); + assert (o2->num == 123); + } +#endif + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/data/model.hxx b/odb-tests/evolution/data/model.hxx new file mode 100644 index 0000000..680bc55 --- /dev/null +++ b/odb-tests/evolution/data/model.hxx @@ -0,0 +1,45 @@ +// file : evolution/data/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/data/test1.hxx b/odb-tests/evolution/data/test1.hxx new file mode 100644 index 0000000..976ed04 --- /dev/null +++ b/odb-tests/evolution/data/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/data/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/data/test2.hxx b/odb-tests/evolution/data/test2.hxx new file mode 100644 index 0000000..bd72940 --- /dev/null +++ b/odb-tests/evolution/data/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/data/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/data/test3.hxx b/odb-tests/evolution/data/test3.hxx new file mode 100644 index 0000000..0f47099 --- /dev/null +++ b/odb-tests/evolution/data/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/data/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/drop-column/driver.cxx b/odb-tests/evolution/drop-column/driver.cxx new file mode 100644 index 0000000..7f0c253 --- /dev/null +++ b/odb-tests/evolution/drop-column/driver.cxx @@ -0,0 +1,126 @@ +// file : evolution/drop-column/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a column. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o (1); + o.str = "abc"; + o.num = 123; + o.ptr = new object1 (1, 2); + + { + transaction t (db->begin ()); + db->persist (*o.ptr); + db->persist (o); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Things are still there. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->str == "abc"); + assert (p->num == 123); + assert (p->ptr->id.x == 1 && p->ptr->id.y == 2); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Now they are gone. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->ptr == 0); + db->erase (value (1, 2)); // SQLite logical delete test. + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/drop-column/model.hxx b/odb-tests/evolution/drop-column/model.hxx new file mode 100644 index 0000000..09b63b9 --- /dev/null +++ b/odb-tests/evolution/drop-column/model.hxx @@ -0,0 +1,59 @@ +// file : evolution/drop-column/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db value + struct value + { + value (int x_ = 0, int y_ = 0): x (x_), y (y_) {} + int x; + int y; + }; + + #pragma db object + struct object1 + { + object1 (int x = 0, int y = 0): id (x, y) {} + + #pragma db id + value id; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + object1* ptr; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(object::num) deleted(3) + #pragma db member(object::ptr) deleted(3) +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/drop-column/test1.hxx b/odb-tests/evolution/drop-column/test1.hxx new file mode 100644 index 0000000..1efb1fa --- /dev/null +++ b/odb-tests/evolution/drop-column/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/drop-column/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/drop-column/test2.hxx b/odb-tests/evolution/drop-column/test2.hxx new file mode 100644 index 0000000..2842cd3 --- /dev/null +++ b/odb-tests/evolution/drop-column/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-column/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/drop-column/test3.hxx b/odb-tests/evolution/drop-column/test3.hxx new file mode 100644 index 0000000..d1ce616 --- /dev/null +++ b/odb-tests/evolution/drop-column/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-column/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/drop-foreign-key/driver.cxx b/odb-tests/evolution/drop-foreign-key/driver.cxx new file mode 100644 index 0000000..f829562 --- /dev/null +++ b/odb-tests/evolution/drop-foreign-key/driver.cxx @@ -0,0 +1,145 @@ +// file : evolution/drop-foreign-key/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a foreign key. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // SQLite doesn't support dropping of foreign keys. + // +#ifndef DATABASE_SQLITE + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o (1); + o.o1 = new object (2); + o.o2 = new object (3); + + { + transaction t (db->begin ()); + db->persist (o.o1); + db->persist (o.o2); + db->persist (o); + t.commit (); + } + + // The foreign key constraint is there. + // + try + { + object o (11); + o.o1 = new object (12); + o.o2 = new object (13); + + transaction t (db->begin ()); + db->persist (o); + assert (false); + } + catch (const odb::exception& ) {} + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // The data is still there but the constraints are gone. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + assert (p->o1 == 2); + assert (p->o2 == 3); + + db->erase (p->o1); + db->erase (p->o2); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->o1 == 2); + assert (p->o2 == 3); + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } +#endif // DATABASE_SQLITE + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/drop-foreign-key/model.hxx b/odb-tests/evolution/drop-foreign-key/model.hxx new file mode 100644 index 0000000..eed8c46 --- /dev/null +++ b/odb-tests/evolution/drop-foreign-key/model.hxx @@ -0,0 +1,50 @@ +// file : evolution/drop-foreign-key/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include + +#include // DATABASE_XXX + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + #pragma db id + unsigned long id_; + + // SQLite doesn't support dropping of foreign keys. + // +#ifndef DATABASE_SQLITE +#if MODEL_VERSION == 2 + object* o1; + object* o2; + + object (unsigned long id = 0): id_ (id), o1 (0), o2 (0) {} + ~object () {delete o1; delete o2;} +#else + #pragma db null + unsigned long o1; + + #pragma db null + unsigned long o2; + + object (unsigned long id = 0): id_ (id) {} +#endif +#endif + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/drop-foreign-key/test1.hxx b/odb-tests/evolution/drop-foreign-key/test1.hxx new file mode 100644 index 0000000..5476796 --- /dev/null +++ b/odb-tests/evolution/drop-foreign-key/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/drop-foreign-key/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/drop-foreign-key/test2.hxx b/odb-tests/evolution/drop-foreign-key/test2.hxx new file mode 100644 index 0000000..f091a25 --- /dev/null +++ b/odb-tests/evolution/drop-foreign-key/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-foreign-key/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/drop-foreign-key/test3.hxx b/odb-tests/evolution/drop-foreign-key/test3.hxx new file mode 100644 index 0000000..beb8c42 --- /dev/null +++ b/odb-tests/evolution/drop-foreign-key/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-foreign-key/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/drop-index/driver.cxx b/odb-tests/evolution/drop-index/driver.cxx new file mode 100644 index 0000000..5ad1cd4 --- /dev/null +++ b/odb-tests/evolution/drop-index/driver.cxx @@ -0,0 +1,154 @@ +// file : evolution/drop-index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping an index. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + object o0 (0); + o0.num = 123; + + object o1 (1); + o1.num = 234; + + object o2 (2); + o2.num = 234; + + { + transaction t (db->begin ()); + db->persist (o0); + db->persist (o1); + t.commit (); + } + + // Duplicates are not ok. + // + try + { + transaction t (db->begin ()); + db->persist (o2); + assert (false); + } + catch (const odb::exception& ) {} + + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Duplicates are now ok. + // + object o2 (2); + o2.num = 234; + + { + transaction t (db->begin ()); + db->persist (o2); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + { + transaction t (db->begin ()); + auto_ptr p0 (db->load (0)); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + + assert (p0->num == 123); + assert (p1->num == 234); + assert (p2->num == 234); + + t.commit (); + } + + // Duplicates are still ok. + // + object o3 (3); + o3.num = 234; + + { + transaction t (db->begin ()); + db->persist (o3); + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/drop-index/model.hxx b/odb-tests/evolution/drop-index/model.hxx new file mode 100644 index 0000000..5e163ca --- /dev/null +++ b/odb-tests/evolution/drop-index/model.hxx @@ -0,0 +1,33 @@ +// file : evolution/drop-index/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 2 + #pragma db unique +#endif + unsigned long num; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/drop-index/test1.hxx b/odb-tests/evolution/drop-index/test1.hxx new file mode 100644 index 0000000..5a279bb --- /dev/null +++ b/odb-tests/evolution/drop-index/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/drop-index/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/drop-index/test2.hxx b/odb-tests/evolution/drop-index/test2.hxx new file mode 100644 index 0000000..78b89f2 --- /dev/null +++ b/odb-tests/evolution/drop-index/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-index/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/drop-index/test3.hxx b/odb-tests/evolution/drop-index/test3.hxx new file mode 100644 index 0000000..17b670d --- /dev/null +++ b/odb-tests/evolution/drop-index/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-index/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/drop-table/driver.cxx b/odb-tests/evolution/drop-table/driver.cxx new file mode 100644 index 0000000..81cec55 --- /dev/null +++ b/odb-tests/evolution/drop-table/driver.cxx @@ -0,0 +1,168 @@ +// file : evolution/drop-table/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test dropping a table (object, container). +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + { + using namespace v2; + + object1 o1; + o1.o = new object (1); + o1.o->str = "abc"; + o1.nums.push_back (1); + o1.nums.push_back (2); + o1.nums.push_back (3); + + { + transaction t (db->begin ()); + db->persist (o1.o); + db->persist (o1); + t.commit (); + } + } + + // Polymorphism test. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3; + + base b (123, "abc"); + derived d1 (234, "bcd"); + derived d2 (345, "cde"); + + { + transaction t (db->begin ()); + db->persist (b); + db->persist (d1); + db->persist (d2); + t.commit (); + } + } + + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Both object and object1 are still there so we can migrate the data. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + result r (db->query (query::o->str == "abc")); + result::iterator i (r.begin ()), e (r.end ()); + + assert (i != e && + i->o->id_ == 1 && + i->nums[0] == 1 && i->nums[1] == 2 && i->nums[2] == 3); + assert (++i == e); + + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + + break; + } + case 3: + { + using namespace v3; + + // Only object is still there. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc"); + t.commit (); + } + + // Polymorphism test. + // + { + transaction t (db->begin ()); + assert (size (db->query ()) == 1); + assert (size (db->query ()) == 1); + t.commit (); + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/drop-table/model.hxx b/odb-tests/evolution/drop-table/model.hxx new file mode 100644 index 0000000..2c02d09 --- /dev/null +++ b/odb-tests/evolution/drop-table/model.hxx @@ -0,0 +1,94 @@ +// file : evolution/drop-table/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include +#include + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + }; + + #pragma db object + struct object1 + { + object1 (): o (0) {} + ~object1 () {delete o;} + + #pragma db id auto + unsigned long id_; + + object* o; + std::vector nums; + }; + +#if MODEL_VERSION == 3 + #pragma db object(object1) deleted(3) +#endif + + // Make sure we also clean up base tables when dropping a + // table corresponding to the polymorphic derived object. + // + #pragma db value + struct value + { + value (unsigned long n = 0, const std::string& s = ""): num (n), str (s) {} + + unsigned long num; + std::string str; + }; + + #pragma db object polymorphic + struct root + { + root (unsigned long n = 0, const std::string& s = ""): id (n, s) {} + virtual ~root () {} + + #pragma db id + value id; + }; + + #pragma db object + struct base: root + { + base (unsigned long n = 0, const std::string& s = "") + : root (n, s), num (n) {} + + unsigned long num; + }; + + #pragma db object + struct derived: base + { + derived (unsigned long n = 0, const std::string& s = "") + : base (n, s), str (s) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db object(derived) deleted(3) +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/drop-table/test1.hxx b/odb-tests/evolution/drop-table/test1.hxx new file mode 100644 index 0000000..a9ec64c --- /dev/null +++ b/odb-tests/evolution/drop-table/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/drop-table/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/drop-table/test2.hxx b/odb-tests/evolution/drop-table/test2.hxx new file mode 100644 index 0000000..c9ec149 --- /dev/null +++ b/odb-tests/evolution/drop-table/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-table/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/drop-table/test3.hxx b/odb-tests/evolution/drop-table/test3.hxx new file mode 100644 index 0000000..8d3f17b --- /dev/null +++ b/odb-tests/evolution/drop-table/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/drop-table/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/embedded/driver.cxx b/odb-tests/evolution/embedded/driver.cxx new file mode 100644 index 0000000..1816a5c --- /dev/null +++ b/odb-tests/evolution/embedded/driver.cxx @@ -0,0 +1,181 @@ +// file : evolution/embedded/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test embedded schema migration. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#ifdef DATABASE_PGSQL +# include +#endif + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + t.commit (); + } + + // PostgreSQL cannot continue a transaction after a query failed. We + // have a workaround but only for 9.4+. + // +#ifdef DATABASE_PGSQL + { + odb::connection_ptr c (db->connection ()); + int v (static_cast (*c).server_version ()); + if (v < 90400) + assert (db->schema_version () == 0); + } +#endif + + { + transaction t (db->begin ()); + assert (db->schema_version () == 0); + + schema_catalog::create_schema (*db, "", false); + + assert (db->schema_version () == 1 && !db->schema_migration ()); + + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + assert (db->schema_version () == 2 && !db->schema_migration ()); + + { + transaction t (db->begin ()); + object1 o1 (1); + o1.num = 123; + db->persist (o1); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; + using namespace v3; + + // Check version information correctness. + // + assert (schema_catalog::base_version (*db) == 1); + assert (schema_catalog::current_version (*db) == 3); + assert (schema_catalog::next_version (*db, 0) == 3); + assert (schema_catalog::next_version (*db, 1) == 2); + assert (schema_catalog::next_version (*db) == 3); + assert (schema_catalog::next_version (*db, 3) == 4); + + { + assert (db->schema_version () == 2 && !db->schema_migration ()); + + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + assert (db->schema_version () == 3 && db->schema_migration ()); + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + object2 o2 (1); + o2.num = o1->num; + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + + assert (db->schema_version () == 3 && !db->schema_migration ()); + } + break; + } + case 3: + { + using namespace v3; + + // In transaction. + // + { + transaction t (db->begin ()); + assert (db->schema_version () == 3 && !db->schema_migration ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + t.commit (); + } + + // Test the case where there is still no version table. + // + db->schema_version_migration (0, false); + + { + transaction t (db->begin ()); + +#ifdef DATABASE_ORACLE + db->execute ("DROP TABLE \"schema_version\""); +#else + db->execute ("DROP TABLE schema_version"); +#endif + t.commit (); + } + + assert (db->schema_version () == 0); + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/embedded/model.hxx b/odb-tests/evolution/embedded/model.hxx new file mode 100644 index 0000000..f3aa7a4 --- /dev/null +++ b/odb-tests/evolution/embedded/model.hxx @@ -0,0 +1,45 @@ +// file : evolution/embedded/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/embedded/test1.hxx b/odb-tests/evolution/embedded/test1.hxx new file mode 100644 index 0000000..32903a1 --- /dev/null +++ b/odb-tests/evolution/embedded/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/embedded/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/embedded/test2.hxx b/odb-tests/evolution/embedded/test2.hxx new file mode 100644 index 0000000..fce8760 --- /dev/null +++ b/odb-tests/evolution/embedded/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/embedded/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/embedded/test3.hxx b/odb-tests/evolution/embedded/test3.hxx new file mode 100644 index 0000000..d49ecc5 --- /dev/null +++ b/odb-tests/evolution/embedded/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/embedded/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/soft-add/driver.cxx b/odb-tests/evolution/soft-add/driver.cxx new file mode 100644 index 0000000..c70edcb --- /dev/null +++ b/odb-tests/evolution/soft-add/driver.cxx @@ -0,0 +1,2219 @@ +// file : evolution/soft-add/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test soft-add functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v3; // NOTE: not v2. + + if (embedded) + { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif + } + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + o.ptr = new object1 (1); + o.ptr->ptrs.push_back (&o); + + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "" && i->num == 123 && + i->vec.empty () && i->ptr == 0); + + try + { + db->query (query::str.is_null ()); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test empty statement handling (INSERT, UPDATE). + // + { + using namespace test3; + + // None of the database operations should yet include the + // added members. + // + object o; + o.str = "bcd"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + o.str += 'e'; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + { + using namespace test4; + + // None of the database operations should yet include the + // added members. + // + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (1)); + assert (static_cast (*p).str == ""); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.vec.push_back (value ("abc", 123)); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "" && i->num == 123 && i->vec.empty ()); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // No longer automatically marked as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "" && p->dstr == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + + // Test empty statement detection in sections. + // + base b (3); + b.bstr = "bc"; + + { + transaction t (db->begin ()); + db->persist (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + b.bstr += 'd'; + b.s.change (); + + { + transaction t (db->begin ()); + db->update (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (b); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // None of the database operations should yet include the + // added members. + // + { + object o; + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::num == 234)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::num == 234); + t.commit (); + } + } + + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + // None of the database operations should yet include the + // added members. + // + unsigned long id; + { + object o; + o.str = "abc"; + o.num = 123; + + transaction t (db->begin ()); + db->persist (o); + id = o.id; + t.commit (); + } + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} + + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o.id); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // None of the database operations should yet include the + // added members. + // + { + object o (1); + o.num = 123; + o.vec.push_back (123); + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // No longer automatically marks as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + p->vec.push_back (123); + delete p->ptr; + p->ptr = new object1 (1); + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str.is_not_null () && + query::ptr->id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "abc" && i->num == 123 && + i->vec[0] == 123 && i->ptr->id_ == 1); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234 && + p->vec[0] == 234 && p->ptr->id_ == 2); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && + p->vec[0] == 235 && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->vec.modify (0).str = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + db->update (*p); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->str = "abc"; + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->str = "abc"; + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->bstr = "ab"; + p->dstr = "abc"; + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->str = "abc"; + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::str == "bcd")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "bcd" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::str == "bcd"); + t.commit (); + } + } + + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should now include the added + // members. + // + unsigned long id; + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + i->str = "abc"; + db->update (*i); + id = i->id; + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + p->vec.push_back (123); + db->update (*p); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should now include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + p->vec.push_back (123); + db->update (*p, p->s); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // Automatically marks section as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Test basic soft-added member logic. + // + { + using namespace test2; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); + t.commit (); + } + } + + // Test container with soft-added value member. + // + { + using namespace test5; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + } + + // Test view with soft-added member. + // + { + using namespace test6; + + // All the database operations should still include the added + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added section member. + // + { + using namespace test7; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test soft-added members of a section. + // + { + using namespace test8; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test basic soft-added member logic in polymorphic classes. + // + { + using namespace test9; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); + t.commit (); + } + } + + // Test soft-added section member in polymorphic classes. + // + { + using namespace test10; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + } + + // Test soft-added members of a section in polymorphic classes. + // + { + using namespace test11; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + } + + // Test soft-added member and optimistic concurrency. + // + { + using namespace test12; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + } + + // Test soft-added member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added member in an object with auto id. + // + { + using namespace test14; + + // All the database operations should still include the added + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + // Test soft-added container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should still include the added + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/soft-add/model.hxx b/odb-tests/evolution/soft-add/model.hxx new file mode 100644 index 0000000..39d63c4 --- /dev/null +++ b/odb-tests/evolution/soft-add/model.hxx @@ -0,0 +1,504 @@ +// file : evolution/soft-add/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#include +#include +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + // The test numbers are made to correspond to the soft-delete ones. + // + + // Test basic soft-added member logic. + // + #pragma db namespace table("t2_") + namespace test2 + { + struct object; + + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector > ptrs; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + odb::vector vec; + + #pragma db inverse(ptrs) + object1* ptr; + }; + +#if MODEL_VERSION == 3 + // Make it a LOB for Oracle and long data for SQL Server. + // + #pragma db member(object::str) added(3) \ + oracle:type("CLOB") \ + mssql:type("VARCHAR(max)") + #pragma db member(object::vec) added(3) + #pragma db member(object::ptr) added(3) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient + #pragma db member(object::ptr) transient +#endif + } + + // Test empty statement handling (INSERT, UPDATE). + // + #pragma db namespace table("t3_") + namespace test3 + { + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + #pragma db namespace table("t4_") + namespace test4 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test container with soft-added value member. + // + #pragma db namespace table("t5_") + namespace test5 + { + #pragma db value + struct value + { + value () {} + value (const std::string& s, unsigned long n): str (s), num (n) {} + + std::string str; + unsigned long num; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) added(3) +#else + #pragma db member(value::str) transient +#endif + } + + // Test view with soft-added member. + // + #pragma db namespace table("t6_") + namespace test6 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + }; + + #pragma db view object(object) + struct view + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) + #pragma db member(view::str) added(3) +#else + #pragma db member(object::str) transient + #pragma db member(view::str) transient +#endif + } + + // Test soft-added section member. + // + #pragma db namespace table("t7_") + namespace test7 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db load(lazy) update(change) added(3) + odb::section s; +#endif + + #pragma db section(s) + std::string str; + + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) section(s) + #pragma db member(object::vec) section(s) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient +#endif + } + + // Test soft-added members of a section. + // + #pragma db namespace table("t8_") + namespace test8 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + std::string str; + + #pragma db section(s) + unsigned long num; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) section(s) + #pragma db member(object::vec) added(3) section(s) +#else + #pragma db member(object::str) transient + #pragma db member(object::vec) transient +#endif + } + + // Test basic soft-added member logic in polymorphic classes. + // + #pragma db namespace table("t9_") + namespace test9 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) added(3) + #pragma db member(object::dstr) added(3) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added section member in polymorphic classes. + // + #pragma db namespace table("t10_") + namespace test10 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#if MODEL_VERSION == 3 + #pragma db load(lazy) update(change) added(3) + odb::section s; +#endif + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) section(s) + #pragma db member(object::dstr) section(s) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added members of a section in polymorphic classes. + // + #pragma db namespace table("t11_") + namespace test11 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + + #pragma db section(s) + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) added(3) section(s) + #pragma db member(object::dstr) added(3) section(s) +#else + #pragma db member(base::bstr) transient + #pragma db member(object::dstr) transient +#endif + } + + // Test soft-added member and optimistic concurrency. + // + #pragma db namespace table("t12_") + namespace test12 + { + #pragma db object optimistic + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v_; + + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added member in an object without id. + // + #pragma db namespace table("t13_") + namespace test13 + { + #pragma db object no_id + struct object + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) default("abc") \ + mysql:type("VARCHAR(255)") +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added member in an object with auto id. + // + #pragma db namespace table("t14_") + namespace test14 + { + #pragma db object + struct object + { + std::string str; + unsigned long num; + + #pragma db id auto + unsigned long id; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) added(3) +#else + #pragma db member(object::str) transient +#endif + } + + // Test soft-added container member in a non-versioned object. + // + #pragma db namespace table("t21_") + namespace test21 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) added(3) +#else + #pragma db member(object::vec) transient +#endif + } + + // Test soft-added container member in a non-versioned section. + // + #pragma db namespace table("t22_") + namespace test22 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + unsigned long num; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) added(3) section(s) +#else + #pragma db member(object::vec) transient +#endif + } +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/soft-add/test1.hxx b/odb-tests/evolution/soft-add/test1.hxx new file mode 100644 index 0000000..461d663 --- /dev/null +++ b/odb-tests/evolution/soft-add/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/soft-add/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/soft-add/test2.hxx b/odb-tests/evolution/soft-add/test2.hxx new file mode 100644 index 0000000..746da4b --- /dev/null +++ b/odb-tests/evolution/soft-add/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/soft-add/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/soft-add/test3.hxx b/odb-tests/evolution/soft-add/test3.hxx new file mode 100644 index 0000000..f2990d0 --- /dev/null +++ b/odb-tests/evolution/soft-add/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/soft-add/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/soft-delete/driver.cxx b/odb-tests/evolution/soft-delete/driver.cxx new file mode 100644 index 0000000..e41a70c --- /dev/null +++ b/odb-tests/evolution/soft-delete/driver.cxx @@ -0,0 +1,2202 @@ +// file : evolution/soft-delete/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test soft-delete functionality. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + // SQLite has broken foreign keys when it comes to DDL. + // +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=OFF"); +#endif + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + +#ifdef DATABASE_SQLITE + db->connection ()->execute ("PRAGMA foreign_keys=ON"); +#endif + } + + // Test soft-deleted objects. + // + { + using namespace test1; + + object o (1); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + o.ptr = new object1 (1); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + object o (1); + o.vec.push_back (value ("abc", 123)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test view with soft-deleted member. + // + { + using namespace test6; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted section member. + // + { + using namespace test7; + + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + object o (1); + o.str = "abc"; + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test basic soft-deleted member logic in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test9; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted section member in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test10; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted members of a section in polymorphic classes. + // + { + // We have to use v3 here because the discriminator includes + // the namespace. + // + using namespace v3::test11; + + object o (1); + o.bstr = "ab"; + o.dstr = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted member and optimistic concurrency. + // + { + using namespace test12; + + object o (1); + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted member in an object without id. + // + { + using namespace test13; + + object o; + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + object o; + o.str = "abc"; + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test summarily deleted composite values. + // + { + using namespace test15; + + object o (1); + o.v.reset (new value); + o.v->str = "abc"; + o.v->vec.push_back (123); + o.num = 123; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + object o (1); + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + object o (1); + o.num = 123; + o.vec.push_back (123); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + } + + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + // Test soft-deleted objects. + // + { + using namespace test1; + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123); + t.commit (); + } + } + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123 && + p->vec[0] == 123 && p->ptr->id_ == 1); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc" && + query::ptr->id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "abc" && i->num == 123 && + i->vec[0] == 123 && i->ptr->id_ == 1); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234 && + p->vec[0] == 234 && p->ptr->id_ == 2); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && + p->vec[0] == 235 && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "abc" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcd" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "bcde" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test view with soft-deleted member. + // + { + using namespace test6; + + // All the database operations should still include the deleted + // members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + } + + // Test soft-deleted section member. + // + { + using namespace test7; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "abc" && p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "abc" && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcd" && p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // Automatically marks section as updated. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "bcde" && p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test basic soft-deleted member logic in polymorphic classes. + // + { + using namespace test9; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "ab" && p->dstr == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-deleted section member in polymorphic classes. + // + { + using namespace test10; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-deleted members of a section in polymorphic classes. + // + { + using namespace test11; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::bstr == "ab")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + object& o (static_cast (*i)); + assert (o.bstr == "ab" && o.dstr == "abc" && o.num == 123); + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bc" && p->dstr == "bcd" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "bcd" && p->dstr == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (static_cast (o)); + t.commit (); + } + } + + // Test soft-deleted member and optimistic concurrency. + // + { + using namespace test12; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "bcde" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::str == "bcd")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "bcd" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::str == "bcd"); + t.commit (); + } + } + + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + // All the database operations should still include the deleted + // members. + // + unsigned long id; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "abc" && i->num == 123); + id = i->id; + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "abc" && p->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcd" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "bcde" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test summarily deleted composite values. + // + { + using namespace test15; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->v->str == "abc" && p->num == 123 && + p->v->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::v.str == "abc")); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->v->str == "abc" && i->num == 123 && + i->v->vec[0] == 123); + t.commit (); + } + + object o (2); + o.v.reset (new value); + o.v->str = "bcd"; + o.num = 234; + o.v->vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->v->str == "bcd" && p->num == 234 && + p->v->vec[0] == 234); + t.commit (); + } + + o.v->str += 'e'; + o.num++; + o.v->vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->v->str == "bcde" && p->num == 235 && + p->v->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + // All the database operations should still include the deleted + // members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec[0] == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec[0] == 123); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec[0] == 234); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // Automatically marks section as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec[0] == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + // Test soft-deleted objects. + // + { + using namespace test1; + + try + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); // No such table. + assert (false); + } + catch (const odb::exception&) {} + } + + // Test basic soft-deleted member logic. + // + { + using namespace test2; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->str == "" && i->num == 123 && + i->vec.empty () && i->ptr == 0); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + o.ptr = new object1 (2); + o.ptr->ptrs.push_back (&o); + + { + transaction t (db->begin ()); + db->persist (o); + db->persist (*o.ptr); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + delete o.ptr; + o.ptr = 0; + + { + transaction t (db->begin ()); + db->erase (2); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && + p->vec.empty () && p->ptr == 0); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test empty statement handling (INSERT, UPDATE). + // + { + using namespace test3; + + // Now none of the database operations should include the + // deleted member. + // + object o; + o.str = "bcd"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + + o.str += 'e'; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == ""); + t.commit (); + } + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + { + using namespace test4; + + // Now none of the database operations should include the + // deleted member. + // + object o (1); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (1)); + assert (static_cast (*p).str == ""); + t.commit (); + } + } + + // Test container with soft-deleted value member. + // + { + using namespace test5; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->vec[0].str == "" && p->vec[0].num == 123); + t.commit (); + } + + object o (2); + o.vec.push_back (value ("bcd", 234)); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 234); + t.commit (); + } + + o.vec.modify (0).str += 'e'; + o.vec.modify (0).num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->vec[0].str == "" && p->vec[0].num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test view with soft-deleted member. + // + { + using namespace test6; + + // Now none of the database operations should include the + // deleted members. + // + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + } + + // Test soft-deleted section member. + // + { + using namespace test7; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#endif + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted members of a section. + // + { + using namespace test8; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->str == "" && i->num == 123 && i->vec.empty ()); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.str += 'e'; + o.num++; + o.vec.modify (0)++; // No longer automatically marked as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->str == "" && p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test basic soft-deleted member logic in polymorphic classes. + // + { + using namespace test9; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (static_cast (db->load (1))); + assert (p->bstr == "" && p->dstr == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::bstr.is_null ())) == 1); +#endif + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::dstr.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted section member in polymorphic classes. + // + { + using namespace test10; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->load (*p, p->s); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#endif + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted members of a section in polymorphic classes. + // + { + using namespace test11; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + object& o (static_cast (*p)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::id == 1)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end ()); + object& o (static_cast (*i)); + assert (o.bstr == "" && o.dstr == "" && o.num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::bstr == "ab"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::bstr.is_null ())) == 1); +#endif + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + db->load (*i, i->s); + assert (i != r.end () && + i->bstr == "" && i->dstr == "" && i->num); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::dstr == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::dstr.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.bstr = "bc"; + o.dstr = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 234); + t.commit (); + } + + o.bstr += 'd'; + o.dstr += 'e'; + o.num++; + o.s.change (); + + { + transaction t (db->begin ()); + db->update (static_cast (o)); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->bstr == "" && p->dstr == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + + // Test empty statement detection in sections. + // + base b (3); + b.bstr = "bc"; + + { + transaction t (db->begin ()); + db->persist (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + + b.bstr += 'd'; + b.s.change (); + + { + transaction t (db->begin ()); + db->update (b); + auto_ptr p (db->load (3)); + db->load (*p, p->s); + assert (p->bstr == ""); + t.commit (); + } + } + + // Test soft-deleted member and optimistic concurrency. + // + { + using namespace test12; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + unsigned long long v (o.v_); + db->update (o); + assert (o.v_ != v); + auto_ptr p (db->load (2)); + assert (p->str == "" && p->num == 235 && p->v_ == o.v_); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted member in an object without id. + // + { + using namespace test13; + + typedef odb::query query; + typedef odb::result result; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + + result r (db->query (query::num == 234)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 234); + + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase_query (query::num == 234); + t.commit (); + } + } + + // Test soft-deleted member in an object with auto id. + // + { + using namespace test14; + + // Now none of the database operations should include the + // deleted members. + // + unsigned long id; + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->str == "" && i->num == 123); + id = i->id; + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::str.is_null ())) == 1); +#endif + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (id)); + assert (p->str == "" && p->num == 123); + t.commit (); + } + + object o; + o.str = "bcd"; + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 234); + t.commit (); + } + + o.str += 'e'; + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (o.id)); + assert (p->str == "" && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (o.id); + t.commit (); + } + } + + // Test summarily deleted composite values. + // + { + using namespace test15; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->v.get () == 0 && p->num == 123); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->v.get () == 0 && i->num == 123); + + // Logical delete in SQLite. + // +#ifndef DATABASE_SQLITE + try + { + db->query (query::v.str == "abc"); // No such column. + assert (false); + } + catch (const odb::exception&) {} +#else + assert (size (db->query (query::v.str.is_null ())) == 1); +#endif + t.commit (); + } + + object o (2); + o.num = 234; + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->v.get () == 0 && p->num == 234); + t.commit (); + } + + o.num++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->v.get () == 0 && p->num == 235); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned object. + // + { + using namespace test21; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + // Test soft-deleted container member in a non-versioned section. + // + { + using namespace test22; + + // Now none of the database operations should include the + // deleted members. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + db->load (*p, p->s); + assert (p->num == 123 && p->vec.empty ()); + t.commit (); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::num == 123)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + db->load (*i, i->s); + assert (i->num == 123 && i->vec.empty ()); + t.commit (); + } + + object o (2); + o.num = 234; + o.vec.push_back (234); + + { + transaction t (db->begin ()); + db->persist (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.num++; + o.vec.modify (0)++; // No longer automatically marks as changed. + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 234 && p->vec.empty ()); + t.commit (); + } + + o.s.change (); + + { + transaction t (db->begin ()); + db->update (o); + auto_ptr p (db->load (2)); + db->load (*p, p->s); + assert (p->num == 235 && p->vec.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + db->erase (2); + t.commit (); + } + } + + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/soft-delete/model.hxx b/odb-tests/evolution/soft-delete/model.hxx new file mode 100644 index 0000000..65083dd --- /dev/null +++ b/odb-tests/evolution/soft-delete/model.hxx @@ -0,0 +1,518 @@ +// file : evolution/soft-delete/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include // HAVE_CXX11 + +#include +#include // std::auto_ptr/unique_ptr + +#include +#include +#include +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ + // Test soft-deleted objects. + // + #pragma db namespace table("t1_") + namespace test1 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db object(object) deleted(3) +#endif + } + + // Test basic soft-deleted member logic. + // + #pragma db namespace table("t2_") + namespace test2 + { + struct object; + + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector > ptrs; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id), ptr (0) {} + ~object () {delete ptr;} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + odb::vector vec; + + #pragma db inverse(ptrs) + object1* ptr; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(object::vec) deleted(3) + #pragma db member(object::ptr) deleted(3) +#endif + } + + // Test empty statement handling (INSERT, UPDATE). + // + #pragma db namespace table("t3_") + namespace test3 + { + #pragma db object + struct object + { + #pragma db id auto + unsigned long id; + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test empty statement handling (SELECT in polymorphic loader). + // + #pragma db namespace table("t4_") + namespace test4 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string str; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test container with soft-deleted value member. + // + #pragma db namespace table("t5_") + namespace test5 + { + #pragma db value + struct value + { + value () {} + value (const std::string& s, unsigned long n): str (s), num (n) {} + + std::string str; + unsigned long num; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) deleted(3) +#endif + } + + // Test view with soft-deleted member. + // + #pragma db namespace table("t6_") + namespace test6 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str; + unsigned long num; + }; + + #pragma db view object(object) + struct view + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(view::str) deleted(3) +#endif + } + + // Test soft-deleted section member. + // + #pragma db namespace table("t7_") + namespace test7 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string str; + + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::s) deleted(3) +#endif + } + + // Test soft-deleted members of a section. + // + #pragma db namespace table("t8_") + namespace test8 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string str; + + #pragma db section(s) + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) + #pragma db member(object::vec) deleted(3) +#endif + } + + // Test basic soft-deleted member logic in polymorphic classes. + // + #pragma db namespace table("t9_") + namespace test9 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + std::string dstr; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) deleted(3) + #pragma db member(object::dstr) deleted(3) +#endif + } + + // Test soft-deleted section member in polymorphic classes. + // + #pragma db namespace table("t10_") + namespace test10 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + #pragma db section(s) + std::string dstr; + + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::s) deleted(3) +#endif + } + + // Test soft-deleted members of a section in polymorphic classes. + // + #pragma db namespace table("t11_") + namespace test11 + { + #pragma db object polymorphic + struct base + { + virtual + ~base () {} + base (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + std::string bstr; + }; + + #pragma db object + struct object: base + { + object (unsigned long id = 0): base (id) {} + + #pragma db section(s) + std::string dstr; + + #pragma db section(s) + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(base::bstr) deleted(3) + #pragma db member(object::dstr) deleted(3) +#endif + } + + // Test soft-deleted member and optimistic concurrency. + // + #pragma db namespace table("t12_") + namespace test12 + { + #pragma db object optimistic + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db version mssql:type("ROWVERSION") + unsigned long long v_; + + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test soft-deleted member in an object without id. + // + #pragma db namespace table("t13_") + namespace test13 + { + #pragma db object no_id + struct object + { + std::string str; + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test soft-deleted member in an object with auto id. + // + #pragma db namespace table("t14_") + namespace test14 + { + #pragma db object + struct object + { + std::string str; + unsigned long num; + + #pragma db id auto + unsigned long id; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::str) deleted(3) +#endif + } + + // Test summarily deleted composite values. + // + #pragma db namespace table("t15_") + namespace test15 + { + #pragma db value + struct value + { + std::string str; + odb::vector vec; + }; + + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + +#ifdef HAVE_CXX11 + std::unique_ptr v; +#else + std::auto_ptr v; +#endif + unsigned long num; + }; + +#if MODEL_VERSION == 3 + #pragma db member(value::str) deleted(3) + #pragma db member(value::vec) deleted(3) +#endif + } + + // Test soft-deleted container member in a non-versioned object. + // + #pragma db namespace table("t21_") + namespace test21 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + unsigned long num; + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) deleted(3) +#endif + } + + // Test soft-deleted container member in a non-versioned section. + // + #pragma db namespace table("t22_") + namespace test22 + { + #pragma db object + struct object + { + object (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db load(lazy) update(change) + odb::section s; + + #pragma db section(s) + unsigned long num; + + #pragma db section(s) + odb::vector vec; + }; + +#if MODEL_VERSION == 3 + #pragma db member(object::vec) deleted(3) +#endif + } +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/soft-delete/test1.hxx b/odb-tests/evolution/soft-delete/test1.hxx new file mode 100644 index 0000000..d4df90f --- /dev/null +++ b/odb-tests/evolution/soft-delete/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/soft-delete/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/soft-delete/test2.hxx b/odb-tests/evolution/soft-delete/test2.hxx new file mode 100644 index 0000000..3b2b5b4 --- /dev/null +++ b/odb-tests/evolution/soft-delete/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/soft-delete/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/soft-delete/test3.hxx b/odb-tests/evolution/soft-delete/test3.hxx new file mode 100644 index 0000000..5a90ab2 --- /dev/null +++ b/odb-tests/evolution/soft-delete/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/soft-delete/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/template/driver.cxx b/odb-tests/evolution/template/driver.cxx new file mode 100644 index 0000000..b278acd --- /dev/null +++ b/odb-tests/evolution/template/driver.cxx @@ -0,0 +1,124 @@ +// file : evolution/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + schema_catalog::create_schema (*db, "", false); + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + { + transaction t (db->begin ()); + dummy d (1); + db->persist (d); + t.commit (); + } + break; + } + case 2: + { + using namespace v3; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + } + break; + } + case 3: + { + using namespace v3; + + object o; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + } + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/template/model.hxx b/odb-tests/evolution/template/model.hxx new file mode 100644 index 0000000..182c81f --- /dev/null +++ b/odb-tests/evolution/template/model.hxx @@ -0,0 +1,40 @@ +// file : evolution/template/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 3 + #pragma db object + struct object + { + #pragma db id auto + unsigned long id_; + }; +#endif + + // The presence of this object makes sure that there are no empty + // changesets and we get the complete set of migration files. + // + #pragma db object + struct dummy + { + dummy (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + }; +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/template/template-vc10.vcxproj b/odb-tests/evolution/template/template-vc10.vcxproj new file mode 100644 index 0000000..c0ebe18 --- /dev/null +++ b/odb-tests/evolution/template/template-vc10.vcxproj @@ -0,0 +1,196 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/evolution/template/template-vc10.vcxproj.filters b/odb-tests/evolution/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..d6ac66e --- /dev/null +++ b/odb-tests/evolution/template/template-vc10.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/odb-tests/evolution/template/template-vc11.vcxproj b/odb-tests/evolution/template/template-vc11.vcxproj new file mode 100644 index 0000000..f51fd0c --- /dev/null +++ b/odb-tests/evolution/template/template-vc11.vcxproj @@ -0,0 +1,200 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/evolution/template/template-vc11.vcxproj.filters b/odb-tests/evolution/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..d6ac66e --- /dev/null +++ b/odb-tests/evolution/template/template-vc11.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/odb-tests/evolution/template/template-vc12.vcxproj b/odb-tests/evolution/template/template-vc12.vcxproj new file mode 100644 index 0000000..9562323 --- /dev/null +++ b/odb-tests/evolution/template/template-vc12.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test1.hxx, +odb test1.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__custom_build_entry__( +test2.hxx, +odb test2.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__custom_build_entry__( +test3.hxx, +odb test3.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) + + +__header_entry__(test1-odb.hxx) +__header_entry__(test1-odb.ixx) +__header_entry__(test2-odb.hxx) +__header_entry__(test2-odb.ixx) +__header_entry__(test3-odb.hxx) +__header_entry__(test3-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/evolution/template/template-vc12.vcxproj.filters b/odb-tests/evolution/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..d6ac66e --- /dev/null +++ b/odb-tests/evolution/template/template-vc12.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__header_filter_entry__(test1.hxx) +__header_filter_entry__(test1-odb.hxx) +__header_filter_entry__(test1-odb.ixx) +__header_filter_entry__(test2.hxx) +__header_filter_entry__(test2-odb.hxx) +__header_filter_entry__(test2-odb.ixx) +__header_filter_entry__(test3.hxx) +__header_filter_entry__(test3-odb.hxx) +__header_filter_entry__(test3-odb.ixx) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__source_filter_entry__(test1-odb.cxx) +__source_filter_entry__(test2-odb.cxx) +__source_filter_entry__(test3-odb.cxx) +__source_filter_entries__(extra_sources) + + diff --git a/odb-tests/evolution/template/template-vc8.vcproj b/odb-tests/evolution/template/template-vc8.vcproj new file mode 100644 index 0000000..d6c5f15 --- /dev/null +++ b/odb-tests/evolution/template/template-vc8.vcproj @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test1.hxx, +odb test1.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__file_entry__(test1-odb.hxx) +__file_entry__(test1-odb.ixx) +__file_entry_custom_build__( +test2.hxx, +odb test2.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__file_entry__(test2-odb.hxx) +__file_entry__(test2-odb.ixx) +__file_entry_custom_build__( +test3.hxx, +odb test3.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) +__file_entry__(test3-odb.hxx) +__file_entry__(test3-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/evolution/template/template-vc9.vcproj b/odb-tests/evolution/template/template-vc9.vcproj new file mode 100644 index 0000000..9177928 --- /dev/null +++ b/odb-tests/evolution/template/template-vc9.vcproj @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test1-odb.cxx) +__source_entry__(test2-odb.cxx) +__source_entry__(test3-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test1.hxx, +odb test1.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options1) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test1.hxx, +test1-odb.hxx;test1-odb.ixx;test1-odb.cxx;test1.sql;model.xml, +model.hxx) +__file_entry__(test1-odb.hxx) +__file_entry__(test1-odb.ixx) +__file_entry_custom_build__( +test2.hxx, +odb test2.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options2) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test2.hxx, +test2-odb.hxx;test2-odb.ixx;test2-odb.cxx;test2.sql;model.xml, +test1-odb.hxx;model.hxx) +__file_entry__(test2-odb.hxx) +__file_entry__(test2-odb.ixx) +__file_entry_custom_build__( +test3.hxx, +odb test3.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options3) --changelog model.xml -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 __upcase__(-Ddatabase_)__upcase__(__value__(database)) -I$(SolutionDir)\..\libcommon)) test3.hxx, +test3-odb.hxx;test3-odb.ixx;test3-odb.cxx;test3.sql;test3-002-pre.sql;test3-002-post.sql;test3-003-pre.sql;test3-003-post.sql, +test2-odb.hxx;model.hxx) +__file_entry__(test3-odb.hxx) +__file_entry__(test3-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/evolution/template/test1.hxx b/odb-tests/evolution/template/test1.hxx new file mode 100644 index 0000000..238b686 --- /dev/null +++ b/odb-tests/evolution/template/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/template/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/template/test2.hxx b/odb-tests/evolution/template/test2.hxx new file mode 100644 index 0000000..ec982f5 --- /dev/null +++ b/odb-tests/evolution/template/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/template/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/template/test3.hxx b/odb-tests/evolution/template/test3.hxx new file mode 100644 index 0000000..50f3882 --- /dev/null +++ b/odb-tests/evolution/template/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/template/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/evolution/version/driver.cxx b/odb-tests/evolution/version/driver.cxx new file mode 100644 index 0000000..236c9b4 --- /dev/null +++ b/odb-tests/evolution/version/driver.cxx @@ -0,0 +1,156 @@ +// file : evolution/version/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test schema version access via the database instance. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include // DATABASE_XXX +#include + +#include "test2.hxx" +#include "test3.hxx" +#include "test2-odb.hxx" +#include "test3-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv, false)); + bool embedded (schema_catalog::exists (*db)); + + // 1 - base version + // 2 - migration + // 3 - current version + // + unsigned short pass (*argv[argc - 1] - '0'); + + switch (pass) + { + case 1: + { + using namespace v2; + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::drop_schema (*db); + + assert (db->schema_version () == 0); + + schema_catalog::create_schema (*db, "", false); + + assert (db->schema_version () == 1 && !db->schema_migration ()); + + schema_catalog::migrate_schema (*db, 2); + t.commit (); + } + + assert (db->schema_version () == 2 && !db->schema_migration ()); + + { + transaction t (db->begin ()); + object1 o1 (1); + o1.num = 123; + db->persist (o1); + t.commit (); + } + break; + } + case 2: + { + using namespace v2; + using namespace v3; + + if (embedded) + { + assert (db->schema_version () == 2 && !db->schema_migration ()); + + transaction t (db->begin ()); + schema_catalog::migrate_schema_pre (*db, 3); + t.commit (); + } + + assert (db->schema_version () == 3 && db->schema_migration ()); + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + object2 o2 (1); + o2.num = o1->num; + db->persist (o2); + t.commit (); + } + + if (embedded) + { + transaction t (db->begin ()); + schema_catalog::migrate_schema_post (*db, 3); + t.commit (); + + assert (db->schema_version () == 3 && !db->schema_migration ()); + } + break; + } + case 3: + { + using namespace v3; + + // In transaction. + // + { + transaction t (db->begin ()); + assert (db->schema_version () == 3 && !db->schema_migration ()); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o2 (db->load (1)); + assert (o2->num == 123); + t.commit (); + } + + // Test the case where there is still no version table. + // + db->schema_version_migration (0, false); + + { + transaction t (db->begin ()); + +#ifdef DATABASE_ORACLE + db->execute ("DROP TABLE \"schema_version\""); +#else + db->execute ("DROP TABLE schema_version"); +#endif + t.commit (); + } + + assert (db->schema_version () == 0); + break; + } + default: + { + cerr << "unknown pass number '" << argv[argc - 1] << "'" << endl; + return 1; + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/evolution/version/model.hxx b/odb-tests/evolution/version/model.hxx new file mode 100644 index 0000000..cdda00e --- /dev/null +++ b/odb-tests/evolution/version/model.hxx @@ -0,0 +1,45 @@ +// file : evolution/version/model.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef MODEL_VERSION +# error model.hxx included directly +#endif + +#include + +#pragma db model version(1, MODEL_VERSION) + +#define MODEL_NAMESPACE_IMPL(V) v##V +#define MODEL_NAMESPACE(V) MODEL_NAMESPACE_IMPL(V) + +namespace MODEL_NAMESPACE(MODEL_VERSION) +{ +#if MODEL_VERSION == 2 + #pragma db object + struct object1 + { + object1 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif + +#if MODEL_VERSION == 3 + #pragma db object + struct object2 + { + object2 (unsigned long id = 0): id_ (id) {} + + #pragma db id + unsigned long id_; + + int num; + }; +#endif +} + +#undef MODEL_NAMESPACE +#undef MODEL_NAMESPACE_IMPL diff --git a/odb-tests/evolution/version/test1.hxx b/odb-tests/evolution/version/test1.hxx new file mode 100644 index 0000000..a50e54c --- /dev/null +++ b/odb-tests/evolution/version/test1.hxx @@ -0,0 +1,9 @@ +// file : evolution/version/test1.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST1_HXX +#define TEST1_HXX + +#pragma db model version(1, 1) + +#endif // TEST1_HXX diff --git a/odb-tests/evolution/version/test2.hxx b/odb-tests/evolution/version/test2.hxx new file mode 100644 index 0000000..f7fc1b7 --- /dev/null +++ b/odb-tests/evolution/version/test2.hxx @@ -0,0 +1,11 @@ +// file : evolution/version/test2.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST2_HXX +#define TEST2_HXX + +#define MODEL_VERSION 2 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST2_HXX diff --git a/odb-tests/evolution/version/test3.hxx b/odb-tests/evolution/version/test3.hxx new file mode 100644 index 0000000..364ee31 --- /dev/null +++ b/odb-tests/evolution/version/test3.hxx @@ -0,0 +1,11 @@ +// file : evolution/version/test3.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST3_HXX +#define TEST3_HXX + +#define MODEL_VERSION 3 +#include "model.hxx" +#undef MODEL_VERSION + +#endif // TEST3_HXX diff --git a/odb-tests/libcommon/.gitignore b/odb-tests/libcommon/.gitignore new file mode 100644 index 0000000..a994ddc --- /dev/null +++ b/odb-tests/libcommon/.gitignore @@ -0,0 +1,3 @@ +# Generated config header. +# +config.hxx diff --git a/odb-tests/libcommon/buffer.hxx b/odb-tests/libcommon/buffer.hxx new file mode 100644 index 0000000..41b7e46 --- /dev/null +++ b/odb-tests/libcommon/buffer.hxx @@ -0,0 +1,104 @@ +// file : libcommon/buffer.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_BUFFER_HXX +#define LIBCOMMON_BUFFER_HXX + +#include +#include // std::size_t +#include // std::{memcmp,memcpy} + +struct basic_buffer_base +{ + ~basic_buffer_base () + { + operator delete (data_); + } + + basic_buffer_base () + : data_ (0), size_ (0) + { + } + + basic_buffer_base (const void* data, std::size_t size) + : data_ (0), size_ (size) + { + data_ = operator new (size_); + std::memcpy (data_, data, size_); + } + + basic_buffer_base (const basic_buffer_base& y) + : data_ (0), size_ (0) + { + assign (y.data_, y.size_); + } + + basic_buffer_base& + operator= (const basic_buffer_base& y) + { + if (this != &y) + assign (y.data_, y.size_); + + return *this; + } + + void + assign (const void* data, std::size_t size) + { + if (size_ < size) + { + void *p (operator new (size)); + operator delete (data_); + data_ = p; + } + + std::memcpy (data_, data, size); + size_ = size; + } + + std::size_t + size () const + { + return size_; + } + + bool + operator== (const basic_buffer_base& y) const + { + return size_ == y.size_ && std::memcmp (data_, y.data_, size_) == 0; + } + +protected: + void* data_; + std::size_t size_; +}; + +template +struct basic_buffer: basic_buffer_base +{ + basic_buffer () + { + } + + basic_buffer (const T* data, std::size_t size) + : basic_buffer_base (data, size) + { + } + + T* + data () + { + return static_cast (data_); + } + + const T* + data () const + { + return static_cast (data_); + } +}; + +typedef basic_buffer buffer; +typedef basic_buffer ubuffer; + +#endif // LIBCOMMON_BUFFER_HXX diff --git a/odb-tests/libcommon/buildfile b/odb-tests/libcommon/buildfile new file mode 100644 index 0000000..eb61455 --- /dev/null +++ b/odb-tests/libcommon/buildfile @@ -0,0 +1,50 @@ +# file : libcommon/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import intf_libs = libodb%lib{odb} + +for db: $databases + import intf_libs += libodb-$db%lib{odb-$db} + +lib{common}: {hxx ixx txx cxx}{** -config} hxx{config} $intf_libs + +# Generated config file. +# +using autoconf + +hxx{config}: in{config} +{ + DATABASE_MYSQL = $mysql + DATABASE_SQLITE = $sqlite + DATABASE_PGSQL = $pgsql + DATABASE_ORACLE = $oracle + DATABASE_MSSQL = $mssql + MULTI_DATABASE = $multi +} + +# Build options. +# +cxx.poptions =+ "-I$out_root" "-I$src_root" + +{hbmia obja}{*}: cxx.poptions += -DLIBCOMMON_STATIC_BUILD +{hbmis objs}{*}: cxx.poptions += -DLIBCOMMON_SHARED_BUILD + +# Export options. +# +lib{common}: +{ + cxx.export.poptions = "-I$out_root" "-I$src_root" + cxx.export.libs = $intf_libs +} + +liba{common}: cxx.export.poptions += -DLIBCOMMON_STATIC +libs{common}: cxx.export.poptions += -DLIBCOMMON_SHARED + +# For pre-releases use the complete version to make sure they cannot +# be used in place of another pre-release or the final version. See +# the version module for details on the version.* variable values. +# +if $version.pre_release + lib{common}: bin.lib.version = "-$version.project_id" +else + lib{common}: bin.lib.version = "-$version.major.$version.minor" diff --git a/odb-tests/libcommon/common.cxx b/odb-tests/libcommon/common.cxx new file mode 100644 index 0000000..b3e4cfd --- /dev/null +++ b/odb-tests/libcommon/common.cxx @@ -0,0 +1,355 @@ +// file : libcommon/common.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::exit +#include // std::move +#include + +#include + +#include +#include + +using namespace std; +using namespace odb::core; + + +// MySQL. +// +#if defined(DATABASE_MYSQL) + +#include +#include + +static unique_ptr +create_mysql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mysql = odb::mysql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new mysql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new mysql::database (argc, argv, false, "", 0, move (f))); +} +#endif // MySQL + + +// SQLite. +// +#if defined(DATABASE_SQLITE) + +#include +#include +#include +#include +#include + +static unique_ptr +create_sqlite_database (int& argc, + char* argv[], + bool schema, + size_t max_connections) +{ + namespace sqlite = odb::sqlite; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new sqlite::connection_pool_factory (max_connections)); + + unique_ptr db ( + new sqlite::database ( + argc, argv, false, + SQLITE_OPEN_READWRITE + | SQLITE_OPEN_CREATE +#ifdef SQLITE_OPEN_URI + | SQLITE_OPEN_URI +#endif + , + true, + "", + move (f))); + + // Create the database schema. Due to bugs in SQLite foreign key + // support for DDL statements, we need to temporarily disable + // foreign keys. + // + if (schema) + { + connection_ptr c (db->connection ()); + + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + schema_catalog::create_schema (*db); + t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); + } + + return db; +} +#endif // SQLite + + +// PostgreSQL. +// +#if defined(DATABASE_PGSQL) + +#include +#include + +static unique_ptr +create_pgsql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace pgsql = odb::pgsql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new pgsql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new pgsql::database (argc, argv, false, "", move (f))); +} +#endif // PostgreSQL + + +// Oracle. +// +#if defined(DATABASE_ORACLE) + +#include +#include + +static unique_ptr +create_oracle_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace oracle = odb::oracle; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new oracle::connection_pool_factory (max_connections)); + + // Set client database character set and client national character set + // to UTF-8. + // + return unique_ptr ( + new oracle::database (argc, argv, false, 873, 873, 0, move (f))); +} +#endif // Oracle + +// SQL Server. +// +#if defined(DATABASE_MSSQL) + +#include +#include + +static unique_ptr +create_mssql_database (int& argc, char* argv[], bool, size_t max_connections) +{ + namespace mssql = odb::mssql; + + unique_ptr f; + + if (max_connections != 0) + f.reset (new mssql::connection_pool_factory (max_connections)); + + return unique_ptr ( + new mssql::database (argc, argv, false, "", + mssql::isolation_read_committed, 0, move (f))); +} +#endif // SQL Server + +// +// +unique_ptr +create_database (int argc, + char* argv[], + bool schema, + size_t max_connections, +#if defined(MULTI_DATABASE) + odb::database_id db +#else + odb::database_id +#endif +) +{ + char** argp = argv + 1; // Position of the next argument. Assignment for VC8. + int argn (argc - 1); // Number of arguments left. + +#if defined(MULTI_DATABASE) + // Figure out which database we are creating. We may be given the + // database name as a program argument or as an id. + // + if (db == odb::id_common && argn != 0) + { + string s (*argp); + + if (s == "mysql") + db = odb::id_mysql; + else if (s == "sqlite") + db = odb::id_sqlite; + else if (s == "pgsql") + db = odb::id_pgsql; + else if (s == "oracle") + db = odb::id_oracle; + else if (s == "mssql") + db = odb::id_mssql; + + if (db != odb::id_common) + { + argp++; + argn--; + } + } + + if (db == odb::id_common) + { + cerr << "Usage: " << argv[0] << " [options]" << endl; + exit (1); + } +#endif + + if (argn != 0 && *argp == string ("--help")) + { +#if defined(MULTI_DATABASE) + cout << "Usage: " << argv[0] << " [options]" << endl; +#else + cout << "Usage: " << argv[0] << " [options]" << endl; +#endif + + cout << "Options:" << endl; + +#if defined(MULTI_DATABASE) + switch (db) + { + case odb::id_mysql: +#if defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_sqlite: +#if defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_pgsql: +#if defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_oracle: +#if defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_mssql: +#if defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#else + assert (false); +#endif + break; + case odb::id_common: + assert (false); + } +#elif defined(DATABASE_MYSQL) + odb::mysql::database::print_usage (cout); +#elif defined(DATABASE_SQLITE) + odb::sqlite::database::print_usage (cout); +#elif defined(DATABASE_PGSQL) + odb::pgsql::database::print_usage (cout); +#elif defined(DATABASE_ORACLE) + odb::oracle::database::print_usage (cout); +#elif defined(DATABASE_MSSQL) + odb::mssql::database::print_usage (cout); +#else +# error unknown database +#endif + + exit (0); + } + +#if defined(MULTI_DATABASE) + switch (db) + { + case odb::id_mysql: +#if defined(DATABASE_MYSQL) + return create_mysql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_sqlite: +#if defined(DATABASE_SQLITE) + return create_sqlite_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_pgsql: +#if defined(DATABASE_PGSQL) + return create_pgsql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_oracle: +#if defined(DATABASE_ORACLE) + return create_oracle_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_mssql: +#if defined(DATABASE_MSSQL) + return create_mssql_database (argc, argv, schema, max_connections); +#else + assert (false); + break; +#endif + case odb::id_common: + assert (false); + } + return unique_ptr (); +#elif defined(DATABASE_MYSQL) + return create_mysql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_SQLITE) + return create_sqlite_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_PGSQL) + return create_pgsql_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_ORACLE) + return create_oracle_database (argc, argv, schema, max_connections); +#elif defined(DATABASE_MSSQL) + return create_mssql_database (argc, argv, schema, max_connections); +#else +# error unknown database +#endif +} + +bool +size_available () +{ +#if defined(MULTI_DATABASE) || \ + defined(DATABASE_SQLITE) || \ + defined(DATABASE_ORACLE) || \ + defined(DATABASE_MSSQL) + return false; +#else + return true; +#endif +} diff --git a/odb-tests/libcommon/common.hxx b/odb-tests/libcommon/common.hxx new file mode 100644 index 0000000..9ab978d --- /dev/null +++ b/odb-tests/libcommon/common.hxx @@ -0,0 +1,47 @@ +// file : libcommon/common.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_HXX +#define LIBCOMMON_COMMON_HXX + +#include // std::unique_ptr +#include // std::size_t + +#include +#include + +#include + +LIBCOMMON_SYMEXPORT std::unique_ptr +create_database (int argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0, + odb::database_id db = odb::id_common); + +template +std::unique_ptr +create_specific_database (int argc, + char* argv[], + bool create_schema = true, + std::size_t max_connections = 0) +{ + std::unique_ptr r ( + create_database (argc, argv, + create_schema, + max_connections, + T::database_id)); + + return std::unique_ptr (&dynamic_cast (*r.release ())); +} + +// This function returns an accurate result only if the result iterator +// hasn't been advanced and after the call the result is no longer valid. +// +template +std::size_t +size (odb::result); + +#include + +#endif // LIBCOMMON_COMMON_HXX diff --git a/odb-tests/libcommon/common.txx b/odb-tests/libcommon/common.txx new file mode 100644 index 0000000..caa7481 --- /dev/null +++ b/odb-tests/libcommon/common.txx @@ -0,0 +1,24 @@ +// file : libcommon/common.txx +// license : GNU GPL v2; see accompanying LICENSE file + +// We have to use this helper function instead of just checking which +// database is used because the DATABASE_* macro may not be defined +// in a project that includes this header. +// +LIBCOMMON_SYMEXPORT bool +size_available (); + +template +std::size_t +size (odb::result r) +{ + if (size_available ()) + return r.size (); + else + { + std::size_t n (0); + for (typename odb::result::iterator i (r.begin ()); i != r.end (); ++i) + n++; + return n; + } +} diff --git a/odb-tests/libcommon/concrete.hxx b/odb-tests/libcommon/concrete.hxx new file mode 100644 index 0000000..e0f64a5 --- /dev/null +++ b/odb-tests/libcommon/concrete.hxx @@ -0,0 +1,57 @@ +// file : libcommon/concrete.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_CONCRETE_HXX +#define LIBCOMMON_CONCRETE_HXX + +#include + +// Namespace alias for the concrete database namespace. +// +#if defined(MULTI_DATABASE) + +// Fallback to common interface. +// +#include +#include + +namespace odb_db = odb; + +#elif defined(DATABASE_MYSQL) + +#include +#include + +namespace odb_db = odb::mysql; + +#elif defined(DATABASE_SQLITE) + +#include +#include + +namespace odb_db = odb::sqlite; + +#elif defined(DATABASE_PGSQL) + +#include +#include + +namespace odb_db = odb::pgsql; + +#elif defined(DATABASE_ORACLE) + +#include +#include + +namespace odb_db = odb::oracle; + +#elif defined(DATABASE_MSSQL) + +#include +#include + +namespace odb_db = odb::mssql; + +#endif + +#endif // LIBCOMMON_CONCRETE_HXX diff --git a/odb-tests/libcommon/config.hxx.in b/odb-tests/libcommon/config.hxx.in new file mode 100644 index 0000000..ff90e61 --- /dev/null +++ b/odb-tests/libcommon/config.hxx.in @@ -0,0 +1,14 @@ +// file : libcommon/config.hxx.in +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_CONFIG_HXX +#define LIBCOMMON_CONFIG_HXX + +#undef DATABASE_MYSQL +#undef DATABASE_SQLITE +#undef DATABASE_PGSQL +#undef DATABASE_ORACLE +#undef DATABASE_MSSQL +#undef MULTI_DATABASE + +#endif // LIBCOMMON_CONFIG_HXX diff --git a/odb-tests/libcommon/export.hxx b/odb-tests/libcommon/export.hxx new file mode 100644 index 0000000..0de4565 --- /dev/null +++ b/odb-tests/libcommon/export.hxx @@ -0,0 +1,39 @@ +#pragma once + +// Normally we don't export class templates (but do complete specializations), +// inline functions, and classes with only inline member functions. Exporting +// classes that inherit from non-exported/imported bases (e.g., std::string) +// will end up badly. The only known workarounds are to not inherit or to not +// export. Also, MinGW GCC doesn't like seeing non-exported functions being +// used before their inline definition. The workaround is to reorder code. In +// the end it's all trial and error. + +#if defined(LIBCOMMON_STATIC) // Using static. +# define LIBCOMMON_SYMEXPORT +#elif defined(LIBCOMMON_STATIC_BUILD) // Building static. +# define LIBCOMMON_SYMEXPORT +#elif defined(LIBCOMMON_SHARED) // Using shared. +# ifdef _WIN32 +# define LIBCOMMON_SYMEXPORT __declspec(dllimport) +# else +# define LIBCOMMON_SYMEXPORT +# endif +#elif defined(LIBCOMMON_SHARED_BUILD) // Building shared. +# ifdef _WIN32 +# define LIBCOMMON_SYMEXPORT __declspec(dllexport) +# else +# define LIBCOMMON_SYMEXPORT +# endif +#else +// If none of the above macros are defined, then we assume we are being used +// by some third-party build system that cannot/doesn't signal the library +// type. Note that this fallback works for both static and shared libraries +// provided the library only exports functions (in other words, no global +// exported data) and for the shared case the result will be sub-optimal +// compared to having dllimport. If, however, your library does export data, +// then you will probably want to replace the fallback with the (commented +// out) error since it won't work for the shared case. +// +# define LIBCOMMON_SYMEXPORT // Using static or shared. +//# error define LIBCOMMON_STATIC or LIBCOMMON_SHARED preprocessor macro to signal libcommon library type being linked +#endif diff --git a/odb-tests/manifest b/odb-tests/manifest new file mode 100644 index 0000000..858baa7 --- /dev/null +++ b/odb-tests/manifest @@ -0,0 +1,48 @@ +: 1 +name: odb-tests +version: 2.5.0-b.26.z +project: odb +type: tests +language: c++ +summary: ODB compiler tests +license: GPL-2.0-only +description-file: README.md +url: https://www.codesynthesis.com/products/odb/ +doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml +src-url: https://git.codesynthesis.com/cgit/odb/odb/ +email: odb-users@codesynthesis.com ; Mailing list + +# @@ BUILD2 The odb dependency can only be built with GCC. However, shouldn't +# we test that the odb-generated mappings can be compiled by other +# compilers and properly run afterwards? +# +builds: default +builds: -( +windows -gcc ) ; Requires MinGW GCC. +builds: &gcc ; Requires GCC with plugin support enabled. +builds: &gcc-5+ ; Requires GCC 5 or later. +builds: -static ; Implementation uses plugins and requires -fPIC. + +depends: * build2 >= 0.16.0 +depends: * bpkg >= 0.16.0 + +depends: * odb [2.5.0-b.26.1 2.5.0-b.27) + +depends: libodb [2.5.0-b.26.1 2.5.0-b.27) +depends: libodb-mysql [2.5.0-b.26.1 2.5.0-b.27) ? ($mysql) +depends: libodb-sqlite [2.5.0-b.26.1 2.5.0-b.27) ? ($sqlite) +depends: libodb-pgsql [2.5.0-b.26.1 2.5.0-b.27) ? ($pgsql) +depends: libodb-oracle [2.5.0-b.26.1 2.5.0-b.27) ? ($oracle) +depends: libodb-mssql [2.5.0-b.26.1 2.5.0-b.27) ? ($mssql) + +# Reflect whether libodb-pgsql is likely to support bulk operations. This is +# normally the case on POSIX platforms if libodb-pgsql is linked against libpq +# of the version 14 or above. +# +depends: libpq >= 14.0.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=true | \ + libpq >= 7.4.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=false + +# @@ TODO/LATER: use an alternative to automatically detect whether we are +# using MySQL or MariaDB? But maybe we don't need to know? + +depends: mysql >= 5.0.3 ? ($mysql) +depends: psql >= 7.4.0 ? ($pgsql) diff --git a/odb-tests/mssql/custom/custom.sql b/odb-tests/mssql/custom/custom.sql new file mode 100644 index 0000000..44ef512 --- /dev/null +++ b/odb-tests/mssql/custom/custom.sql @@ -0,0 +1,42 @@ +/* This file contains helper functions. + */ + +IF OBJECT_ID('dbo.variant_to_string', 'FN') IS NOT NULL + DROP FUNCTION dbo.variant_to_string; +GO + +IF OBJECT_ID('dbo.string_to_variant', 'FN') IS NOT NULL + DROP FUNCTION dbo.string_to_variant; +GO + +CREATE FUNCTION dbo.variant_to_string (@val SQL_VARIANT) RETURNS VARCHAR(max) +AS +BEGIN + RETURN CAST(SQL_VARIANT_PROPERTY(@val, 'BaseType') AS SYSNAME) + ' ' + + CAST(@val AS VARCHAR(max)) +END; +GO + +CREATE FUNCTION dbo.string_to_variant (@val VARCHAR(max)) RETURNS SQL_VARIANT +AS +BEGIN + DECLARE @ret SQL_VARIANT + + DECLARE @pos BIGINT + DECLARE @vtype SYSNAME + DECLARE @vtext VARCHAR(max) + + SET @pos = CHARINDEX(' ', @val) + SET @vtype = SUBSTRING(@val, 1, @pos - 1) + SET @vtext = SUBSTRING(@val, @pos + 1, LEN(@val)) + + IF @vtype = 'tinyint' SET @ret = CAST(@vtext AS TINYINT) + ELSE IF @vtype = 'smallint' SET @ret = CAST(@vtext AS SMALLINT) + ELSE IF @vtype = 'int' SET @ret = CAST(@vtext AS INT) + ELSE IF @vtype = 'bigint' SET @ret = CAST(@vtext AS BIGINT) + ELSE IF @vtype = 'char' SET @ret = CAST(@vtext AS CHAR(8000)) + ELSE IF @vtype = 'varchar' SET @ret = CAST(@vtext AS VARCHAR(8000)) + + RETURN @ret +END; +GO diff --git a/odb-tests/mssql/custom/driver.cxx b/odb-tests/mssql/custom/driver.cxx new file mode 100644 index 0000000..bde7eb6 --- /dev/null +++ b/odb-tests/mssql/custom/driver.cxx @@ -0,0 +1,135 @@ +// file : mssql/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in SQL Server. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + object o (1); + + o.v = variant (123); + o.vv.push_back (variant (string (1024, 'a'))); + o.vv.push_back (variant (123)); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. +#endif + + o.xml = "AAABBBCCC"; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef mssql::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Variant comparison. + // + { + result r (db->query (query::v == o.v)); + assert (!r.empty ()); + } + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query ( + query::p + ".STEquals(" + query::_val (o.p) + ") = 1")); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } +#endif + + t.commit (); + } + + // Update. + // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; +#endif + + o.xml = "BBBCCCDDD"; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/custom/query.hxx b/odb-tests/mssql/custom/query.hxx new file mode 100644 index 0000000..fc63378 --- /dev/null +++ b/odb-tests/mssql/custom/query.hxx @@ -0,0 +1,183 @@ +// file : mssql/custom/query.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mssql + { +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + unsigned short prec_; + unsigned short scale_; + + std::string x_column_; + std::string y_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query_base + is_null () const + { + query_base q (table_, column_); + q += "IS NULL"; + return q; + } + + query_base + is_not_null () const + { + query_base q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query_base + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query_base + equal (val_bind v) const + { + query_base q (table_, column_); + q += ".STEquals("; + q.append (v, conversion_); + q += ") = 1"; + return q; + } + + query_base + equal (ref_bind r) const + { + query_base q (table_, column_); + q += ".STEquals("; + q.append (r, conversion_); + q += ") = 1"; + return q; + } + + friend query_base + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query_base + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query_base + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query_base + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query_base + operator== (const query_column& c) const + { + query_base q (table_, column_); + q += ".STEquals("; + q.append (c.table (), c.column ()); + q += ") = 1"; + return q; + } + + public: + query_column (const char* table, + const char* column, + const char* conv, + unsigned short prec = 0, + unsigned short scale = 0xFFFF) + : table_ (table), column_ (column), conversion_ (conv), + prec_ (prec), scale_ (scale), + x_column_ (std::string (column) + ".STX"), + y_column_ (std::string (column) + ".STY"), + x (table, x_column_.c_str (), 0), + y (table, y_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + + unsigned short + prec () const + { + return prec_; + } + + unsigned short + scale () const + { + return scale_; + } + }; +#endif // SQL Server > 2005 + } +} + +#endif // QUERY_HXX diff --git a/odb-tests/mssql/custom/test.hxx b/odb-tests/mssql/custom/test.hxx new file mode 100644 index 0000000..4b8a5d7 --- /dev/null +++ b/odb-tests/mssql/custom/test.hxx @@ -0,0 +1,121 @@ +// file : mssql/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Map SQL Server SQL_VARIANT type to our variant C++ class that is capable +// of storing either an integer or a string (QVariant and boost::variant +// would be natural alternatives to our own type). The SQL Server functions +// that are used in the 'to' and 'from' expressions below are defined in +// the custom.sql file. The other half of this mapping is in traits.hxx +// (value_traits). +// +#pragma db map type("SQL_VARIANT") \ + as("VARCHAR(max)") \ + to("dbo.string_to_variant((?))") \ + from("dbo.variant_to_string((?))") + +#pragma db value type("SQL_VARIANT") +struct variant +{ + variant (unsigned long v = 0): val_type (type_int), int_val (v) {} + variant (const std::string& v): val_type (type_str), str_val (v) {} + + enum {type_int, type_str} val_type; + unsigned long int_val; + std::string str_val; +}; + +inline bool +operator== (const variant& a, const variant& b) +{ + if (a.val_type != b.val_type) + return false; + + switch (a.val_type) + { + case variant::type_int: + return a.int_val == b.int_val; + case variant::type_str: + return a.str_val == b.str_val; + } + + return false; +} + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 +// Map GEOMETRY SQL Server type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// Note that GEOMETRY is not available in SQL Server 2005. +// +#pragma db map type("GEOMETRY") \ + as("VARCHAR(256)") \ + to("GEOMETRY::STGeomFromText((?), 0)") \ + from("(?).STAsText()") + +#pragma db value type("GEOMETRY") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} +#endif // SQL Server > 2005 + +// Map XML SQL Server type to std::string (or any other type that provides +// the value_traits specialization). Note also that +// another alternative would be to interface with the XML data type using +// VARBINARY or NVARCHAR. Here we use implicit string to/from XML conversion, +// however, CAST/CONVERT can be used instead for greater control over +// whitespace handling, etc. +// +#pragma db map type("XML *(\\(.+\\))?") as("VARCHAR(max)") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + variant v; + std::vector vv; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + point p; + std::vector pv; +#endif + + #pragma db type("XML") + std::string xml; + + bool + operator== (const object& y) const + { + return id == y.id + && vv == y.vv +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && p == y.p + && pv == y.pv +#endif + && xml == y.xml; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/mssql/custom/traits.cxx b/odb-tests/mssql/custom/traits.cxx new file mode 100644 index 0000000..3f14ae7 --- /dev/null +++ b/odb-tests/mssql/custom/traits.cxx @@ -0,0 +1,128 @@ +// file : mssql/types/traits.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +#include "traits.hxx" + +using namespace std; + +namespace odb +{ + namespace mssql + { + void value_traits:: + param_callback (const void* context, + size_t*, + const void** buffer, + size_t* size, + chunk_type* chunk, + void* tmp_buf, + size_t tmp_capacity) + { + const variant& v (*static_cast (context)); + string str; + + switch (v.val_type) + { + case variant::type_int: + { + ostringstream os; + os << v.int_val; + + str = "bigint "; + str += os.str (); + break; + } + case variant::type_str: + { + str = "varchar "; + str += v.str_val; + break; + } + } + + // Here we assume that the temoprary buffer is large enough to fit + // the whole string in one go. If that were not the case, then we + // would have had to chunk it. + // + assert (tmp_capacity >= str.size ()); + memcpy (tmp_buf, str.c_str (), str.size ()); + + *buffer = tmp_buf; + *size = str.size (); + *chunk = chunk_one; + } + + void value_traits:: + result_callback (void* context, + size_t*, + void** buffer, + size_t* size, + chunk_type chunk, + size_t, + void* tmp_buf, + size_t tmp_capacity) + { + variant& v (*static_cast (context)); + + switch (chunk) + { + case chunk_null: + case chunk_one: + { + assert (false); // The value cannot be NULL or empty. + break; + } + case chunk_first: + { + // Use the variant's string value as a temporary buffer. If this + // were not possible, we could have allocated one as part of + // context. + // + v.str_val.clear (); + + *buffer = tmp_buf; + *size = tmp_capacity; + break; + } + case chunk_next: + { + v.str_val.append (static_cast (tmp_buf), *size); + + *buffer = tmp_buf; + *size = tmp_capacity; + break; + } + case chunk_last: + { + v.str_val.append (static_cast (tmp_buf), *size); + + // Figure out what we've got. + // + string::size_type p (v.str_val.find (' ')); + assert (p != string::npos); // Must have type followed by value. + string type (v.str_val, 0, p); + string text (v.str_val, p + 1, string::npos); + + if (type == "tinyint" || + type == "smallint" || + type == "int" || + type == "bigint") + { + istringstream is (text); + is >> v.int_val; + v.val_type = variant::type_int; + } + else if (type == "char" || type == "varchar") + { + v.str_val = text; + v.val_type = variant::type_str; + } + else + assert (false); // Unknown type. + + break; + } + } + } + } +} diff --git a/odb-tests/mssql/custom/traits.hxx b/odb-tests/mssql/custom/traits.hxx new file mode 100644 index 0000000..2bd99cb --- /dev/null +++ b/odb-tests/mssql/custom/traits.hxx @@ -0,0 +1,148 @@ +// file : mssql/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include // std::memcpy +#include + +#include + +#include "test.hxx" // variant, point + +namespace odb +{ + namespace mssql + { + template <> + class value_traits + { + public: + typedef variant value_type; + typedef variant query_type; + typedef long_callback image_type; + + static void + set_value (variant& v, + result_callback_type& cb, + void*& context) + { + cb = &result_callback; + context = &v; + } + + static void + set_image (param_callback_type& cb, + const void*& context, + bool& is_null, + const variant& v) + { + is_null = false; + cb = ¶m_callback; + context = &v; + } + + static void + param_callback (const void* context, + std::size_t* position, + const void** buffer, + std::size_t* size, + chunk_type* chunk, + void* tmp_buffer, + std::size_t tmp_capacity); + + static void + result_callback (void* context, + std::size_t* position, + void** buffer, + std::size_t* size, + chunk_type chunk, + std::size_t size_left, + void* tmp_buffer, + std::size_t tmp_capacity); + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_long_string; + + struct conversion + { + static const char* to () {return "dbo.string_to_variant((?))";} + }; + }; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + + typedef char* image_type; + + static void + set_value (point& v, + const char* b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "POINT (x y)". + // + std::istringstream is (std::string (b + 7, n - 7)); + + is >> v.x; + is >> v.y; + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << "POINT (" << v.x << ' ' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + assert (n <= c); + std::memcpy (b, s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "GEOMETRY::STGeomFromText((?), 0)";} + }; + }; +#endif // SQL Server > 2005 + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/mssql/database/driver.cxx b/odb-tests/mssql/database/driver.cxx new file mode 100644 index 0000000..08ad34f --- /dev/null +++ b/odb-tests/mssql/database/driver.cxx @@ -0,0 +1,105 @@ +// file : mssql/database/driver.cxx +// license : GNU GPL; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include +#include + +#include + +namespace mssql = odb::mssql; +using namespace mssql; + +static const char* isolation_map[] = {"1", "2", "3", "5", "4"}; + +static bool +check_isolation (connection& c, transaction_isolation i) +{ + std::string s ("SELECT 1 FROM sys.dm_exec_sessions WHERE session_id = @@SPID" + " AND transaction_isolation_level = "); + s += isolation_map[i]; + return c.execute (s) == 1; +} + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc == 0) + { + { + database d1 ("bob", "secret", "db1", "server1"); + database d2 ("bob", "secret", "db1", "server1", "driver1"); + database d3 ("bob", "secret", "db1", "server1", "driver1", "extra"); + database d4 ("bob", "secret", "db1", "server1", "driver1", "extra", + isolation_read_uncommitted); + } + + { + database d1 ("bob", "secret", "db1", protocol_auto); + database d2 ("bob", "secret", "db1", protocol_auto, "server1"); + database d3 ("bob", "secret", "db1", protocol_auto, "server1", "inst1"); + database d4 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1"); + database d5 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1", "extra"); + database d6 ("bob", "secret", "db1", protocol_auto, "server1", "inst1", + "driver1", "extra", isolation_read_uncommitted); + } + + { + database d1 ("bob", "secret", "db1", "server1", 0); + database d2 ("bob", "secret", "db1", "server1", 999, "driver1"); + database d3 ("bob", "secret", "db1", "server1", 999, "driver1", "extra"); + database d4 ("bob", "secret", "db1", "server1", 999, "driver1", "extra", + isolation_read_uncommitted); + } + + { + database d1 ("conn1"); + database d2 ("conn1", isolation_read_uncommitted); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "extra"); + database d4 (argc, argv, false, "extra", isolation_read_uncommitted); + } + } + + // Test transaction isolation levels. + // + { + database d (argc, argv, false, "", isolation_read_uncommitted); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_read_uncommitted)); + } + + { + database d (argc, argv, false, ""); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_read_committed)); + } + + { + database d (argc, argv, false, "", isolation_repeatable_read); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_repeatable_read)); + } + + { + database d (argc, argv, false, "", isolation_snapshot); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_snapshot)); + } + + { + database d (argc, argv, false, "", isolation_serializable); + connection_ptr c (d.connection ()); + assert (check_isolation (*c, isolation_serializable)); + } +} diff --git a/odb-tests/mssql/native/driver.cxx b/odb-tests/mssql/native/driver.cxx new file mode 100644 index 0000000..f4b4fd7 --- /dev/null +++ b/odb-tests/mssql/native/driver.cxx @@ -0,0 +1,73 @@ +// file : mssql/native/driver.cxx +// license : GNU GPL; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("IF OBJECT_ID('mssql_native_test', 'U') IS NOT NULL\n" + " DROP TABLE mssql_native_test"); + + db->execute ("CREATE TABLE mssql_native_test (n int)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO mssql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO mssql_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM mssql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM mssql_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/query/driver.cxx b/odb-tests/mssql/query/driver.cxx new file mode 100644 index 0000000..5600c81 --- /dev/null +++ b/odb-tests/mssql/query/driver.cxx @@ -0,0 +1,188 @@ +// file : mssql/query/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server-specific query support aspects. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + { + object o1; + object o2; + object o3; + + o1.num = 1; + o1.str = "aaa"; + o1.nstr = L"aaa"; + o1.lstr.assign (1024, 'a'); + o1.lnstr.assign (1024, L'a'); + o1.smoney = 11000; + o1.money = 1.1; + + o2.num = 2; + o2.str = "bbb"; + o2.nstr = L"bbb"; + o2.lstr.assign (1024, 'b'); + o2.lnstr.assign (1024, L'b'); + o2.smoney = 22000; + o2.money = 2.2; + + o3.num = 3; + o3.str = "ccc"; + o3.nstr = L"ccc"; + o3.lstr.assign (1024, 'c'); + o3.lnstr.assign (1024, L'c'); + o3.smoney = 33000; + o3.money = 3.3; + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + typedef mssql::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Money and small money. + // + { + result r (db->query (query::smoney < 22000)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->smoney == 11000); + assert (++i == r.end ()); + } + + { + result r (db->query ("smoney < " + query::_val (2.1F))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->smoney == 11000); + assert (++i == r.end ()); + } + + { + result r (db->query (query::money < 2.2)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->money == 1.1); + assert (++i == r.end ()); + } + + { + result r (db->query ("money < " + query::_val (2.2))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->money == 1.1); + assert (++i == r.end ()); + } + + // Short/long string. + // + { + result r (db->query (query::str < "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query ("str < " + query::_val ("bbb", 3))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::nstr < L"bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->nstr == L"aaa"); + assert (++i == r.end ()); + } + + { + result r (db->query (query::lstr < string (1024, 'b'))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lstr == string (1024, 'a')); + assert (++i == r.end ()); + } + + { + string v (1024, 'b'); + result r (db->query (query::lstr < query::_ref (v))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lstr == string (1024, 'a')); + assert (++i == r.end ()); + } + + { + result r (db->query (query::lnstr < wstring (1024, L'b'))); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->lnstr == wstring (1024, L'a')); + assert (++i == r.end ()); + } + + // Test image copying with long data. + // + { + result r (db->query (query::str < "ccc")); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + ++i; + assert (i != r.end ()); + + { + result r (db->query (query::str < "bbb")); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (i->str == "aaa"); + assert (++i == r.end ()); + } + + assert (i->str == "bbb"); // Load from copy. + assert (++i == r.end ()); + } + + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/query/test.hxx b/odb-tests/mssql/query/test.hxx new file mode 100644 index 0000000..85c644e --- /dev/null +++ b/odb-tests/mssql/query/test.hxx @@ -0,0 +1,38 @@ +// file : mssql/query/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + unsigned int num; + + #pragma db type ("SMALLMONEY") + int smoney; + + #pragma db type ("MONEY") + double money; + + #pragma db type ("VARCHAR(256)") + std::string str; + + #pragma db type ("NVARCHAR(128)") + std::wstring nstr; + + #pragma db type ("VARCHAR(max)") + std::string lstr; + + #pragma db type ("NVARCHAR(max)") + std::wstring lnstr; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mssql/stored-proc/driver.cxx b/odb-tests/mssql/stored-proc/driver.cxx new file mode 100644 index 0000000..2389798 --- /dev/null +++ b/odb-tests/mssql/stored-proc/driver.cxx @@ -0,0 +1,231 @@ +// file : mssql/stored-proc/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server stored procedure support. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +void +create_procedure (database& db, const string& name, const string& body) +{ + transaction t (db.begin ()); + + string s (db.query_value ().name); + + db.execute ( + "IF EXISTS (" + " SELECT * FROM sysobjects" + " WHERE name = '" + name + "' AND user_name(uid) = '" + s +"')" + " DROP PROCEDURE [" + s + "].[" + name + "]"); + + db.execute ("CREATE PROCEDURE [" + s + "].[" + name + "] " + body); + + t.commit (); +} + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + object o1 (1, "a"); + object o2 (2, "b"); + object o3 (3, "c"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + create_procedure ( + *db, "select_all_objects", + "AS" + " SELECT num, str FROM mssql_stored_proc_object ORDER BY id;"); + + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ()); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->num << " " << i->str << endl; + cout << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "select_objects", + "(@id INT, @n VARCHAR(512))" + "AS" + " SELECT str FROM mssql_stored_proc_object " + " WHERE [id] = @id OR [num] = @n ORDER BY id;"); + + typedef mssql::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query ( + query::_val (o1.id) + "," + query::_val (o2.num))); + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << i->str << endl; + cout << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "objects_min_max", + "(@min INT = NULL OUTPUT, @max INT = NULL OUTPUT)" + "AS" + " SELECT @min = MIN(num), @max = MAX(num)" + " FROM mssql_stored_proc_object;"); + + create_procedure ( + *db, "objects_min_max_odb", + "AS" + " DECLARE @min INT, @max INT;" + " EXEC objects_min_max @min OUTPUT, @max OUTPUT;" + " SELECT @min, @max;"); + + transaction t (db->begin ()); + + objects_min_max omm (db->query_value ()); + cout << omm.num_min << " " << omm.num_max << endl + << endl; + + t.commit (); + } + + { + create_procedure ( + *db, "insert_object_id", + "(@n INT, @s VARCHAR(512))" + "AS" + " INSERT INTO mssql_stored_proc_object([num], [str])" + " VALUES(@n, @s);"); + + { + typedef mssql::query query; + + transaction t (db->begin ()); + + db->query_one ( + query::_val (4) + "," + query::_val ("d")); + + auto_ptr o (db->load (4)); + cout << o->num << " " << o->str << endl + << endl; + + t.commit (); + } + + { + typedef mssql::query query; + + transaction t (db->begin ()); + + db->query_one ( + "EXEC insert_object_id" + query::_val (5) + "," + query::_val ("e")); + + auto_ptr o (db->load (5)); + cout << o->num << " " << o->str << endl + << endl; + + t.commit (); + } + } + + { + create_procedure ( + *db, "insert_object_id", + "(@n INT, @s VARCHAR(512), @id INT = NULL OUTPUT)" + "AS" + " INSERT INTO mssql_stored_proc_object([num], [str])" + " VALUES(@n, @s);" + " SET @id = SCOPE_IDENTITY();" + " RETURN 123;"); + + typedef mssql::query query; + + { + create_procedure ( + *db, "insert_object_id_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); + + transaction t (db->begin ()); + + insert_object_id io ( + db->query_value ( + query::_val (6) + "," + query::_val ("f"))); + + cout << io.ret << " " << io.id << endl + << endl; + + t.commit (); + } + + // An alternative implementation that produces a different + // result set configuration at the ODBC level. + // + { + create_procedure ( + *db, "insert_object_id_odb", + "(@n INT, @s VARCHAR(512))" + "AS" + " DECLARE @id INT;" + " DECLARE @ret INT;" + " DECLARE @tbl TABLE(dummy INT);" + " INSERT INTO @tbl EXEC @ret = insert_object_id @n, @s, @id OUTPUT;" + " SELECT @ret, @id;"); + + transaction t (db->begin ()); + + insert_object_id io ( + db->query_value ( + query::_val (7) + "," + query::_val ("g"))); + + cout << io.ret << " " << io.id << endl + << endl; + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/stored-proc/test.hxx b/odb-tests/mssql/stored-proc/test.hxx new file mode 100644 index 0000000..5958ea3 --- /dev/null +++ b/odb-tests/mssql/stored-proc/test.hxx @@ -0,0 +1,63 @@ +// file : mssql/stored-proc/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db view query("SELECT SCHEMA_NAME()") +struct default_schema +{ + std::string name; +}; + +#pragma db object +struct object +{ + object () {} + object (unsigned int n, std::string s): num (n), str (s) {} + + #pragma db id auto + unsigned long id; + + unsigned int num; + std::string str; +}; + +#pragma db view +struct no_result {}; + +#pragma db view query("EXEC select_all_objects") +struct select_all_objects +{ + unsigned int num; + std::string str; +}; + +#pragma db view query("EXEC select_objects (?)") +struct select_objects +{ + std::string str; +}; + +#pragma db view query("EXEC objects_min_max_odb") +struct objects_min_max +{ + unsigned int num_min; + unsigned int num_max; +}; + +#pragma db view query("EXEC insert_object_id (?)") +struct insert_object {}; + +#pragma db view query("EXEC insert_object_id_odb (?)") +struct insert_object_id +{ + unsigned int ret; + unsigned long id; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mssql/template/driver.cxx b/odb-tests/mssql/template/driver.cxx new file mode 100644 index 0000000..ded03f1 --- /dev/null +++ b/odb-tests/mssql/template/driver.cxx @@ -0,0 +1,40 @@ +// file : mssql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/template/template-vc10.vcxproj b/odb-tests/mssql/template/template-vc10.vcxproj new file mode 100644 index 0000000..5875d9b --- /dev/null +++ b/odb-tests/mssql/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/mssql/template/template-vc10.vcxproj.filters b/odb-tests/mssql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/mssql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/mssql/template/template-vc11.vcxproj b/odb-tests/mssql/template/template-vc11.vcxproj new file mode 100644 index 0000000..0bee18f --- /dev/null +++ b/odb-tests/mssql/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/mssql/template/template-vc11.vcxproj.filters b/odb-tests/mssql/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/mssql/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/mssql/template/template-vc12.vcxproj b/odb-tests/mssql/template/template-vc12.vcxproj new file mode 100644 index 0000000..35ffb0f --- /dev/null +++ b/odb-tests/mssql/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-mssql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/mssql/template/template-vc12.vcxproj.filters b/odb-tests/mssql/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/mssql/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/mssql/template/template-vc8.vcproj b/odb-tests/mssql/template/template-vc8.vcproj new file mode 100644 index 0000000..cfd697f --- /dev/null +++ b/odb-tests/mssql/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/mssql/template/template-vc9.vcproj b/odb-tests/mssql/template/template-vc9.vcproj new file mode 100644 index 0000000..72a95d9 --- /dev/null +++ b/odb-tests/mssql/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/mssql/template/test.hxx b/odb-tests/mssql/template/test.hxx new file mode 100644 index 0000000..0bc1f95 --- /dev/null +++ b/odb-tests/mssql/template/test.hxx @@ -0,0 +1,25 @@ +// file : mssql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mssql/types/driver.cxx b/odb-tests/mssql/types/driver.cxx new file mode 100644 index 0000000..d900a95 --- /dev/null +++ b/odb-tests/mssql/types/driver.cxx @@ -0,0 +1,381 @@ +// file : mssql/types/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQL Server type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace mssql = odb::mssql; +using namespace mssql; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + { + object o (1); + + o.bit_ = 1; + o.utint_ = 222; + o.stint_ = -123; + o.usint_ = 65000; + o.ssint_ = -12345; + o.uint_ = 4294967290U; + o.sint_ = -1234567890; + o.ubint_ = 18446744073709551610ULL; + o.sbint_ = -1234567890123456789LL; + + o.fsm_ = -214748.3648F; + o.dsm_ = 214748.3647; + o.ism_ = -2147483647 -1; + + o.dm1_ = -922337203685477.5808; + o.dm2_ = 922337203685476.3520; // 922337203685477.5807 + o.im_ = 9223372036854775807LL; + + o.f4_ = 123.123F; + o.f8_ = 123.1234567; + + o.schar_ = "short data char "; + o.svchar_ = "short data varchar"; + + o.lchar_.assign (1025, 'a'); + o.lvchar_ = "long data varchar"; // Test the short string optimization. + o.mvchar_.assign (70000, 'm'); + o.text_.assign (70000, 't'); + + o.snchar_ = L"short data nchar\x1FFF\xD7FF "; + o.snvchar_ = L"short data nvarchar \x1FFF\xD7FF"; + + o.lnchar_.assign (513, L'\x1234'); + o.lnvchar_ = L""; // Test empty string. + o.mnvchar_.assign (70000, L'\x2345'); + o.ntext_.assign (70000, L'\x4356'); + + const char sdata[] = "abc""\x00\x01""def"; + memcpy (o.sbin_, sdata, sizeof (sdata)); + o.svbin_.assign (sdata, sdata + sizeof (sdata)); + + string ldata (256 * 1024, '\x01'); + memset (o.lbin_, 2, sizeof (o.lbin_)); + o.lvbin_.assign (50, '\x03'); + o.mvbin_.assign (ldata.begin (), ldata.end ()); + o.image_.assign (ldata.begin (), ldata.end ()); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.date_ = date_time (2011, 12, 20, 0, 0, 0, 0, 0, 0); + o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456789, 0, 0); + o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); +#endif + o.sdt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); + o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.dt2_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 0, 0); + o.dto7_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); + o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 123456700, 2, 0); +#endif + +#ifdef _WIN32 + // 6F846D41-C89A-4E4D-B22F-56443CFA543F + o.guid_.Data1 = 0x6F846D41; + o.guid_.Data2 = 0xC89A; + o.guid_.Data3 = 0x4E4D; + memcpy (&o.guid_.Data4, "\xB2\x2F\x56\x44\x3C\xFA\x54\x3F", 8); +#endif + memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" + "\x56\x44\x3C\xFA\x54\x3F", 16); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.time7_ = date_time (0, 0, 0, 13, 34, 39, 123456700, 0, 0); + o.time4_ = date_time (0, 0, 0, 13, 34, 39, 123400000, 0, 0); +#endif + o.sdt_ = date_time (2011, 12, 20, 15, 44, 0, 0, 0, 0); + o.dt_ = date_time (2011, 12, 20, 15, 44, 29, 123000000, 0, 0); +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.dto0_ = date_time (2011, 12, 20, 15, 44, 29, 0, 2, 0); +#endif + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + typedef mssql::query query; + typedef odb::result result; + + // Test UUID in queries. + // + { + char uuid[16]; + memcpy (uuid, o.uuid_, 16); + + transaction t (db->begin ()); + + { + result r (db->query (query::uuid == uuid)); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_val (uuid))); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_ref (uuid))); + assert (size (r) == 1); + } + + { + const char* d (uuid); + result r (db->query (query::uuid == d)); + assert (size (r) == 1); + } + + t.commit (); + } + + // Test short/long data in queries. + // + { + transaction t (db->begin ()); + + { + result r (db->query (query::svchar == o.svchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::snvchar == o.snvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mvchar == o.mvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mnvchar == o.mnvchar_)); + assert (size (r) == 1); + } + + t.commit (); + } + } + + // Test long NULL data. + // + { + long_null o1 (1); + long_null o2 (2); + o2.str_.reset (new string); + o2.str_->assign (70000, 'x'); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + } + } + + // Test long data in containers. + // + { + long_cont o (1); + o.v.push_back (long_comp ("aaa", 123)); + o.v.push_back (long_comp (string (500, 'b'), 234)); + o.v.push_back (long_comp (string (70000, 'c'), 345)); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (1)); + t.commit (); + + assert (o == *p); + } + } + + // Test char/wchar_t arrays. + // + { + char_array o1 (1, "", L""); + char_array o2 (2, "1234567890", L"12345678\x1FFF\xD7FF"); + char_array o3 (3, "1234567890123456", L"12345678901234\x1FFF\xD7FF"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // SQL Server returns padded values for CHAR(N)/NCHAR(N). + // + memcpy (o1.s2, " ", 16); + o1.s3[0] = o1.c1 = ' '; + memcpy (o2.s2, "1234567890 ", 16); + + memset (o1.ls2, ' ', 1025); + memset (o2.ls2 + 10, ' ', 1025 - 10); + + memcpy (o1.ws2, L" ", 16 * sizeof (wchar_t)); + o1.ws3[0] = o1.wc1 = L' '; + memcpy (o2.ws2, L"12345678\x1FFF\xD7FF ", 16 * sizeof (wchar_t)); + + for (size_t i (0); i < 257; ++i) + o1.lws2[i] = L' '; + + for (size_t i (10); i < 257; ++i) + o2.lws2[i] = L' '; + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + + // Test optimistic concurrency using ROWVERSION. + // + { + rowversion o (123); + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + assert (o.ver != 0); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + assert (p->ver == o.ver); + p->str += 'd'; + db->update (*p); + assert (p->ver > o.ver); + + // Double-check object version was updated. + // + { + auto_ptr p1 (db->load (o.id_)); + assert (p->ver == p1->ver); + } + + o.str += 'D'; + try + { + db->update (o); + assert (false); + } + catch (const odb::object_changed&) {} + db->reload (o); + assert (o.ver == p->ver); + o.str += 'D'; + db->update (o); + t.commit (); + } + } + + { + rowversion_auto o; + o.str = "abc"; + + { + transaction t (db->begin ()); + db->persist (o); + assert (o.ver != 0); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + assert (p->ver == o.ver); + p->str += 'd'; + db->update (*p); + assert (p->ver > o.ver); + o.str += 'D'; + try + { + db->update (o); + assert (false); + } + catch (const odb::object_changed&) {} + db->reload (o); + assert (o.ver == p->ver); + o.str += 'D'; + db->update (o); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mssql/types/test.hxx b/odb-tests/mssql/types/test.hxx new file mode 100644 index 0000000..5d651a8 --- /dev/null +++ b/odb-tests/mssql/types/test.hxx @@ -0,0 +1,517 @@ +// file : mssql/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include // GUID +#elif defined(HOST_WIN32) +typedef struct _GUID +{ + unsigned int Data1; + unsigned short Data2; + unsigned short Data3; + unsigned char Data4[8]; +} GUID; +#endif + +#include // HAVE_CXX11 + +#include +#include +#include // std::auto_ptr +#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen +#include // std::wcslen, std::wcs[n]cmp + +#include + +struct date_time +{ + date_time () + { + } + + date_time (short y, + unsigned short m, + unsigned short d, + unsigned short h, + unsigned short min, + unsigned short sec, + unsigned int f, + short tzh, + short tzm) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + fraction (f), + timezone_hour (tzh), + timezone_minute (tzm) + { + } + + bool + operator== (const date_time& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + fraction == y.fraction && + timezone_hour == y.timezone_hour && + timezone_minute == y.timezone_minute; + } + + short year; + unsigned short month; + unsigned short day; + unsigned short hour; + unsigned short minute; + unsigned short second; + unsigned int fraction; + short timezone_hour; + short timezone_minute; +}; + +#pragma db object +struct object +{ + object () {} + object (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + // Integer types. + // + #pragma db type ("BIT") + unsigned char bit_; + + #pragma db type ("TINYINT") + unsigned char utint_; + + #pragma db type ("TINYINT") + unsigned char stint_; + + #pragma db type ("SMALLINT") + unsigned short usint_; + + #pragma db type ("SMALLINT") + short ssint_; + + #pragma db type ("INT") + unsigned int uint_; + + #pragma db type ("INTEGER") + int sint_; + + #pragma db type ("BIGINT") + unsigned long long ubint_; + + #pragma db type ("BIGINT") + long long sbint_; + + // Floating/fixed point types. + // + #pragma db type ("SMALLMONEY") + float fsm_; + + #pragma db type ("SMALLMONEY") + double dsm_; + + #pragma db type ("SMALLMONEY") + int ism_; + + #pragma db type ("MONEY") + double dm1_; + + #pragma db type ("MONEY") + double dm2_; + + #pragma db type ("MONEY") + long long im_; + + #pragma db type ("REAL") + float f4_; + + #pragma db type ("FLOAT") + double f8_; + + // Strings. + // + #pragma db type ("CHAR(20)") + std::string schar_; + + #pragma db type ("VARCHAR(128)") + std::string svchar_; + + #pragma db type ("CHAR(1025)") + std::string lchar_; + + #pragma db type ("CHARACTER VARYING(8000)") + std::string lvchar_; + + #pragma db type ("VARCHAR(max)") + std::string mvchar_; + + #pragma db type ("TEXT") + std::string text_; + + // National strings. + // + #pragma db type ("NCHAR(20)") + std::wstring snchar_; + + #pragma db type ("NVARCHAR(128)") + std::wstring snvchar_; + + #pragma db type ("NCHAR(513)") + std::wstring lnchar_; + + #pragma db type ("NATIONAL CHARACTER VARYING(4000)") + std::wstring lnvchar_; + + #pragma db type ("NVARCHAR(max)") + std::wstring mnvchar_; + + #pragma db type ("NTEXT") + std::wstring ntext_; + + // Binary. + // + #pragma db type ("BINARY(9)") + unsigned char sbin_[9]; + + #pragma db type ("VARBINARY(256)") + std::vector svbin_; + + #pragma db type ("BINARY(1025)") + char lbin_[1025]; + + #pragma db type ("BINARY VARYING(8000)") + std::vector lvbin_; + + #pragma db type ("VARBINARY(max)") + std::vector mvbin_; + + #pragma db type ("IMAGE") + std::vector image_; + + // Date-time. SQL Server 2005 (9.0) only has DATETIME and SMALLDATETIME. + // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + #pragma db type ("DATE") + date_time date_; + + #pragma db type ("TIME") + date_time time7_; + + #pragma db type ("TIME(4)") + date_time time4_; +#endif + + #pragma db type ("SMALLDATETIME") + date_time sdt_; + + #pragma db type ("DATETIME") + date_time dt_; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + #pragma db type ("DATETIME2") + date_time dt2_; + + #pragma db type ("DATETIMEOFFSET") + date_time dto7_; + + #pragma db type ("DATETIMEOFFSET(0)") + date_time dto0_; +#endif + + // Other types. + // +#if defined(_WIN32) || defined(HOST_WIN32) + //#pragma db type ("UNIQUEIDENTIFIER") + GUID guid_; +#endif + + #pragma db type ("UNIQUEIDENTIFIER") + char uuid_[16]; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bit_ == y.bit_ && + utint_ == y.utint_ && + stint_ == y.stint_ && + usint_ == y.usint_ && + ssint_ == y.ssint_ && + uint_ == y.uint_ && + sint_ == y.sint_ && + ubint_ == y.ubint_ && + sbint_ == y.sbint_ && + fsm_ == y.fsm_ && + dsm_ == y.dsm_ && + ism_ == y.ism_ && + dm1_ == y.dm1_ && + dm2_ == y.dm2_ && + im_ == y.im_ && + f4_ == y.f4_ && + f8_ == y.f8_ && + + schar_ == y.schar_ && + svchar_ == y.svchar_ && + lchar_ == y.lchar_ && + lvchar_ == y.lvchar_ && + mvchar_ == y.mvchar_ && + text_ == y.text_ && + + snchar_ == y.snchar_ && + snvchar_ == y.snvchar_ && + lnchar_ == y.lnchar_ && + lnvchar_ == y.lnvchar_ && + mnvchar_ == y.mnvchar_ && + ntext_ == y.ntext_ && + + std::memcmp (sbin_, y.sbin_, sizeof (sbin_)) == 0 && + svbin_ == y.svbin_ && + std::memcmp (lbin_, y.lbin_, sizeof (lbin_)) == 0 && + lvbin_ == y.lvbin_ && + mvbin_ == y.mvbin_ && + image_ == y.image_ + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date_ == y.date_ + && time7_ == y.time7_ + && time4_ == y.time4_ +#endif + && sdt_ == y.sdt_ + && dt_ == y.dt_ +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && dt2_ == y.dt2_ + && dto7_ == y.dto7_ + && dto0_ == y.dto0_ +#endif + +#ifdef _WIN32 + && std::memcmp (&guid_, &y.guid_, sizeof (guid_)) == 0 +#endif + && std::memcmp (uuid_, y.uuid_, sizeof (uuid_)) == 0; + } +}; + +// Test long NULL data. +// +#pragma db object +struct long_null +{ + long_null () {} + long_null (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + #pragma db type ("VARCHAR(max)") null +#ifdef HAVE_CXX11 + std::unique_ptr str_; +#else + std::auto_ptr str_; +#endif + + bool + operator== (const long_null& y) const + { + return + id_ == y.id_ && + ((str_.get () == 0 && y.str_.get () == 0) || *str_ == *y.str_); + } +}; + +// Test long data in containers, in particular column re-arrangement. +// +#pragma db value +struct long_comp +{ + long_comp () {} + long_comp (std::string s, unsigned int n): str (s), num (n) {} + + #pragma db type ("VARCHAR(max)") + std::string str; + + unsigned int num; + + bool + operator== (const long_comp& y) const + { + return str == y.str && num == y.num; + } +}; + +#pragma db object +struct long_cont +{ + long_cont () {} + long_cont (unsigned int id): id_ (id) {} + + #pragma db id + unsigned int id_; + + std::vector v; + + bool + operator== (const long_cont& y) const + { + return id_ == y.id_ && v == y.v; + } +}; + +// Test char/wchar_t arrays. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s, const wchar_t* ws) + : id_ (id) + { + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); + s3[0] = c1 = *s; + + std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + std::memcpy (ws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + ws3[0] = wc1 = *ws; + + if (std::strlen (s) == sizeof (s2)) + { + std::memset (ls1, '1', 1025); + ls1[1025] = '\0'; + std::memset (ls2, '2', 1025); + + for (std::size_t i (0); i < 257; ++i) + { + lws1[i] = L'1'; + lws2[i] = L'2'; + } + lws1[257] = L'\0'; + } + else + { + std::memcpy (ls1, s, std::strlen (s) + 1); // VC++ strcpy deprecation. + std::memcpy (ls2, s, std::strlen (s) + 1); + + std::memcpy (lws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + std::memcpy (lws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + } + } + + #pragma db id + unsigned long id_; + + // + // + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + // Long data. + // + char ls1[1026]; + + #pragma db type("CHAR(1025)") + char ls2[1025]; + + // + // + wchar_t ws1[17]; + + #pragma db type("NCHAR(16)") + wchar_t ws2[16]; + + wchar_t ws3[1]; + wchar_t wc1; + + // Long data. + // + wchar_t lws1[258]; + + #pragma db type("NCHAR(257)") + wchar_t lws2[257]; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1 && + + std::strcmp (ls1, y.ls1) == 0 && + std::strncmp (ls2, y.ls2, sizeof (ls2)) == 0 && + + std::wcscmp (ws1, y.ws1) == 0 && + std::wcsncmp (ws2, y.ws2, sizeof (ws2) / sizeof (wchar_t)) == 0 && + ws3[0] == y.ws3[0] && + wc1 == y.wc1 && + + std::wcscmp (lws1, y.lws1) == 0 && + std::wcsncmp (lws2, y.lws2, sizeof (lws2) / sizeof (wchar_t)) == 0; + } +}; + +// Test optimistic concurrency using ROWVERSION, both with auto and +// manually-assigned ids. +// +#pragma db object optimistic +struct rowversion +{ + rowversion (unsigned int id = 0): id_ (id), ver (0) {} + + #pragma db id + unsigned int id_; + + #pragma db version type("ROWVERSION") +#ifdef _WIN32 + unsigned __int64 ver; +#else + unsigned long long ver; +#endif + + std::string str; +}; + +#pragma db object optimistic +struct rowversion_auto +{ + rowversion_auto (): ver (0) {} + + #pragma db id auto + unsigned int id_; + + #pragma db version type("ROWVERSION") +#ifdef _WIN32 + unsigned __int64 ver; +#else + unsigned long long ver; +#endif + + std::string str; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mssql/types/traits.hxx b/odb-tests/mssql/types/traits.hxx new file mode 100644 index 0000000..5881f50 --- /dev/null +++ b/odb-tests/mssql/types/traits.hxx @@ -0,0 +1,223 @@ +// file : mssql/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // date, time, datetime, datetimeoffset +#include + +#include "test.hxx" // date_time + +namespace odb +{ + namespace mssql + { + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef date image_type; + + static void + set_value (date_time& v, const date& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = 0; + v.minute = 0; + v.second = 0; + v.fraction = 0; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (date& i, bool& is_null, const date_time& v) + { + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef time image_type; + + static void + set_value (date_time& v, const time& i, bool is_null) + { + if (!is_null) + { + v.year = 0; + v.month = 0; + v.day = 0; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (time& i, unsigned short s, bool& is_null, const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetime image_type; + + static void + set_value (date_time& v, const datetime& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = 0; + v.timezone_minute = 0; + } + } + + static void + set_image (datetime& i, + unsigned short s, + bool& is_null, + const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + + // Scale value 8 indicates we are dealing with SMALLDATETIME + // which has the minutes precision. + // + if (s != 8) + { + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + } + else + { + i.second = 0; + i.fraction = 0; + } + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetimeoffset image_type; + + static void + set_value (date_time& v, const datetimeoffset& i, bool is_null) + { + if (!is_null) + { + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.fraction = i.fraction; + v.timezone_hour = i.timezone_hour; + v.timezone_minute = i.timezone_minute; + } + } + + static void + set_image (datetimeoffset& i, + unsigned short s, + bool& is_null, + const date_time& v) + { + const unsigned int divider[8] = + { + 1000000000, + 100000000, + 10000000, + 1000000, + 100000, + 10000, + 1000, + 100 + }; + + is_null = false; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.fraction = v.fraction - v.fraction % divider[s]; + i.timezone_hour = v.timezone_hour; + i.timezone_minute = v.timezone_minute; + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/mysql-schema.testscript b/odb-tests/mysql-schema.testscript new file mode 100644 index 0000000..dfa7852 --- /dev/null +++ b/odb-tests/mysql-schema.testscript @@ -0,0 +1,9 @@ +# file : mysql-schema.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the MySQL database schema creation canned command base. +# +create_schema_cmd = [cmdline] \ + $mysql_client_cmd 2>&1 | \ + sed -e "'"'s/^mysql: \[Warning\] Using a password on the command .*//'"'" | \ + sed -n -e "'"'s/(.+)/\1/p'"'" >&2 diff --git a/odb-tests/mysql.testscript b/odb-tests/mysql.testscript new file mode 100644 index 0000000..e218ece --- /dev/null +++ b/odb-tests/mysql.testscript @@ -0,0 +1,12 @@ +# file : mysql.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the MySQL database schema creation canned command and setup the test +# driver command line for the subsequent tests. +# +.include mysql-schema.testscript + +schema_file = [path] $out_base/"$schema"($multi ? '-mysql' : '').sql +create_schema = [cmdline] cat "'""$schema_file""'" | $create_schema_cmd + +test.arguments += ($multi ? 'mysql' : ) $mysql_options diff --git a/odb-tests/mysql/custom/buildfile b/odb-tests/mysql/custom/buildfile new file mode 100644 index 0000000..4934e7c --- /dev/null +++ b/odb-tests/mysql/custom/buildfile @@ -0,0 +1,37 @@ +# file : mysql/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' \ + --hxx-prologue '#include "query.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/odb-tests/mysql/custom/driver.cxx b/odb-tests/mysql/custom/driver.cxx new file mode 100644 index 0000000..526dbdc --- /dev/null +++ b/odb-tests/mysql/custom/driver.cxx @@ -0,0 +1,117 @@ +// file : mysql/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in MySQL. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + object o (1); + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + // VC just cannot roundtrip this. +#ifndef _MSC_VER + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. +#endif + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef mysql::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query (query::p + "=" + query::_val (o.p))); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } + + t.commit (); + } + + // Update. + // + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mysql/custom/query.hxx b/odb-tests/mysql/custom/query.hxx new file mode 100644 index 0000000..2fa8f73 --- /dev/null +++ b/odb-tests/mysql/custom/query.hxx @@ -0,0 +1,160 @@ +// file : mysql/custom/query.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mysql + { + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + std::string x_table_; + std::string y_table_; + std::string s_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query_base + is_null () const + { + query_base q (table_, column_); + q += "IS NULL"; + return q; + } + + query_base + is_not_null () const + { + query_base q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query_base + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query_base + equal (val_bind v) const + { + query_base q (table_, column_); + q += "="; + q.append (v, conversion_); + return q; + } + + query_base + equal (ref_bind r) const + { + query_base q (table_, column_); + q += "="; + q.append (r, conversion_); + return q; + } + + friend query_base + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query_base + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query_base + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query_base + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query_base + operator== (const query_column& c) const + { + query_base q (table_, column_); + q += "="; + q.append (c.table (), c.column ()); + return q; + } + + public: + query_column (const char* table, const char* column, const char* conv) + : table_ (table), column_ (column), conversion_ (conv), + x_table_ ("ST_X(" + std::string (table)), // @@ Not very clean. + y_table_ ("ST_Y(" + std::string (table)), + s_column_ (std::string (column) + ")"), // X & Y column suffix. + x (x_table_.c_str (), s_column_.c_str (), 0), + y (y_table_.c_str (), s_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + }; + } +} + +#endif // QUERY_HXX diff --git a/odb-tests/mysql/custom/test.hxx b/odb-tests/mysql/custom/test.hxx new file mode 100644 index 0000000..82cc59d --- /dev/null +++ b/odb-tests/mysql/custom/test.hxx @@ -0,0 +1,54 @@ +// file : mysql/custom/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Map GEOMETRY MySQL type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// +#pragma db map type("GEOMETRY") \ + as("VARCHAR(256)") \ + to("ST_GeomFromText((?))") \ + from("ST_AsText((?))") + +#pragma db value type("GEOMETRY") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + point p; + std::vector pv; + + bool + operator== (const object& y) const + { + return id == y.id && p == y.p && pv == y.pv; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/mysql/custom/testscript b/odb-tests/mysql/custom/testscript new file mode 100644 index 0000000..9bc8839 --- /dev/null +++ b/odb-tests/mysql/custom/testscript @@ -0,0 +1,11 @@ +# file : mysql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/mysql/custom/traits.hxx b/odb-tests/mysql/custom/traits.hxx new file mode 100644 index 0000000..5386d86 --- /dev/null +++ b/odb-tests/mysql/custom/traits.hxx @@ -0,0 +1,88 @@ +// file : mysql/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include // std::memcpy + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace mysql + { + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + + typedef char* image_type; + + static void + set_value (point& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "POINT(x y)". + // + std::istringstream is (std::string (b.data () + 6, n - 6)); + + is >> v.x; + is >> v.y; + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << "POINT(" << v.x << ' ' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "ST_GeomFromText((?))";} + }; + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/mysql/database/buildfile b/odb-tests/mysql/database/buildfile new file mode 100644 index 0000000..304034e --- /dev/null +++ b/odb-tests/mysql/database/buildfile @@ -0,0 +1,11 @@ +# file : mysql/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-mysql%lib{odb-mysql} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/mysql/database/driver.cxx b/odb-tests/mysql/database/driver.cxx new file mode 100644 index 0000000..525ee87 --- /dev/null +++ b/odb-tests/mysql/database/driver.cxx @@ -0,0 +1,72 @@ +// file : mysql/database/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +#include + +#undef NDEBUG +#include + +using std::string; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 (0, 0, 0); + database d2 ("bob", "secret", "db1"); + database d3 ("bob", "secret", "db1", "server1"); + database d4 ("bob", "secret", "db1", "server1", 999); + database d5 ("bob", "secret", "db1", "server1", 999, "sock1"); + database d6 ("bob", "secret", "db1", "server1", 999, "sock1", "charset1"); + } + + std::string u ("bob"), p ("secret"), db ("bd1"), h ("server1"), + s ("sock1"), cs ("charset1"); + + { + database d1 (u, p, db); + database d2 (u, p, db, h); + database d3 (u, p, db, h, 999); + database d4 (u, p, db, h, 999, &s); + database d5 (u, p, db, h, 999, &s, cs); + } + + { + database d1 (u, 0, db); + database d2 (u, &p, db); + database d3 (u, &p, db, h); + database d4 (u, &p, db, h, 999); + database d5 (u, &p, db, h, 999, &s); + database d6 (u, &p, db, h, 999, &s, cs); + } + + { + database d1 (u, p, db, h, 999, "socket1"); + database d2 (u, p, db, h, 999, s); + database d3 (u, p, db, h, 999, s, cs); + } + + { + database d1 (u, 0, db, h, 999, s); + database d2 (u, &p, db, h, 999, "socket1"); + database d3 (u, &p, db, h, 999, s, cs); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "charset1"); + } +} diff --git a/odb-tests/mysql/database/testscript b/odb-tests/mysql/database/testscript new file mode 100644 index 0000000..c2ff256 --- /dev/null +++ b/odb-tests/mysql/database/testscript @@ -0,0 +1,6 @@ +# file : mysql/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/odb-tests/mysql/index/buildfile b/odb-tests/mysql/index/buildfile new file mode 100644 index 0000000..9cadce3 --- /dev/null +++ b/odb-tests/mysql/index/buildfile @@ -0,0 +1,34 @@ +# file : mysql/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_index_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/odb-tests/mysql/index/driver.cxx b/odb-tests/mysql/index/driver.cxx new file mode 100644 index 0000000..4d0b7ad --- /dev/null +++ b/odb-tests/mysql/index/driver.cxx @@ -0,0 +1,44 @@ +// file : mysql/index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test MySQL index creation. See also the common test. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + unique_ptr db (create_specific_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mysql/index/test.hxx b/odb-tests/mysql/index/test.hxx new file mode 100644 index 0000000..b4f6ae8 --- /dev/null +++ b/odb-tests/mysql/index/test.hxx @@ -0,0 +1,20 @@ +// file : mysql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + std::string s; + #pragma db index method("BTREE") member(s, "(200) DESC") +}; + +#endif // TEST_HXX diff --git a/odb-tests/mysql/index/testscript b/odb-tests/mysql/index/testscript new file mode 100644 index 0000000..26dfc4f --- /dev/null +++ b/odb-tests/mysql/index/testscript @@ -0,0 +1,11 @@ +# file : mysql/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/mysql/native/buildfile b/odb-tests/mysql/native/buildfile new file mode 100644 index 0000000..57c3c30 --- /dev/null +++ b/odb-tests/mysql/native/buildfile @@ -0,0 +1,16 @@ +# file : mysql/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/odb-tests/mysql/native/driver.cxx b/odb-tests/mysql/native/driver.cxx new file mode 100644 index 0000000..9b34fd2 --- /dev/null +++ b/odb-tests/mysql/native/driver.cxx @@ -0,0 +1,75 @@ +// file : mysql/native/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#undef NDEBUG +#include + +using namespace std; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS mysql_native_test"); + + db->execute ("CREATE TABLE mysql_native_test (n INT PRIMARY KEY) " + "ENGINE=InnoDB"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO mysql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO mysql_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM mysql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM mysql_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mysql/native/testscript b/odb-tests/mysql/native/testscript new file mode 100644 index 0000000..21327ff --- /dev/null +++ b/odb-tests/mysql/native/testscript @@ -0,0 +1,9 @@ +# file : mysql/native/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + +: basics +: +$* diff --git a/odb-tests/mysql/truncation/buildfile b/odb-tests/mysql/truncation/buildfile new file mode 100644 index 0000000..fbd936b --- /dev/null +++ b/odb-tests/mysql/truncation/buildfile @@ -0,0 +1,35 @@ +# file : mysql/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/odb-tests/mysql/truncation/driver.cxx b/odb-tests/mysql/truncation/driver.cxx new file mode 100644 index 0000000..21084f5 --- /dev/null +++ b/odb-tests/mysql/truncation/driver.cxx @@ -0,0 +1,192 @@ +// file : mysql/truncation/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::unique_ptr +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + // The default pre-allocated buffer is 256 bytes long. + // + string long_str (300, 'c'); // This will get the buffer to 512 + string longer_str (1025, 'b'); + + try + { + // Test basic operations. + // + { + unique_ptr db (create_specific_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + + // Test query. + // + { + typedef mysql::query query; + typedef odb::result result; + + unique_ptr db (create_specific_database (argc, argv)); + + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); + + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } + + // Test buffer growth with cached result. + // + { + object1 o; + + transaction t (db->begin ()); + + result r (db->query (query::id >= 20)); + result::iterator i (r.begin ()); + + o.id_ = i->id_; + o.str_ = long_str; + + // This forces buffer growth in the middle of result iteration. + // + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } + } + + // Test containers. + // + { + unique_ptr db (create_specific_database (argc, argv)); + + // Use different connections to persist and load the object. + // + connection_ptr c1 (db->connection ()); + connection_ptr c2 (db->connection ()); + + container o (1); + o.vec_.push_back (string (513, 'x')); + + { + transaction t (c1->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (c2->begin ()); + unique_ptr p (db->load (1)); + t.commit (); + + assert (p->vec_ == o.vec_); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mysql/truncation/test.hxx b/odb-tests/mysql/truncation/test.hxx new file mode 100644 index 0000000..1883b0e --- /dev/null +++ b/odb-tests/mysql/truncation/test.hxx @@ -0,0 +1,48 @@ +// file : mysql/truncation/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#pragma db object table ("test") +struct object1 +{ + object1 () {} + object1 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object table ("test") +struct object2 +{ + object2 () {} + object2 (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object +struct container +{ + container () {} + container (unsigned long id) : id_ (id) {} + + #pragma db id + unsigned long id_; + + std::vector vec_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mysql/truncation/testscript b/odb-tests/mysql/truncation/testscript new file mode 100644 index 0000000..b9b6792 --- /dev/null +++ b/odb-tests/mysql/truncation/testscript @@ -0,0 +1,11 @@ +# file : mysql/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/mysql/types/buildfile b/odb-tests/mysql/types/buildfile new file mode 100644 index 0000000..112a81f --- /dev/null +++ b/odb-tests/mysql/types/buildfile @@ -0,0 +1,36 @@ +# file : mysql/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($mysql && !$multi || $build.meta_operation == 'dist') \ +"mysql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-mysql%lib{odb-mysql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix mysql_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{mysql-client}: include = adhoc diff --git a/odb-tests/mysql/types/driver.cxx b/odb-tests/mysql/types/driver.cxx new file mode 100644 index 0000000..2354b04 --- /dev/null +++ b/odb-tests/mysql/types/driver.cxx @@ -0,0 +1,168 @@ +// file : mysql/types/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test MySQL type conversion. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace mysql = odb::mysql; +using namespace mysql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + //cerr << "MySQL " << v.major << '.' << v.minor << '.' << v.release + // << " protocol " << v.protocol << endl; + + object o (1); + + o.bool_ = true; + o.schar_ = -123; + o.uchar_ = 123; + o.short_ = -12345; + o.ushort_ = 12345; + o.mint_ = -123456; + o.umint_ = 123456; + o.int_ = -123456; + o.uint_ = 123456; + o.long_long_ = -123456; + o.ulong_long_ = 123456; + + o.float_ = 1.123F; + o.float8_ = 1.123; + o.double_ = 1.123; + o.decimal_ = "123.456"; + + o.date_ = date_time (false, 2010, 8, 29, 0, 0, 0); + o.time_ = date_time (true, 0, 0, 0, 12, 26, 59); + o.date_time_ = date_time (false, 2010, 8, 29, 12, 26, 59); + o.timestamp_ = date_time (false, 2010, 8, 29, 12, 26, 59); + o.year_ = 2010; + + // If we are running against MySQL 5.6.4 or later, add fractional + // seconds and also alter the table to allow sub-second precision. + // + if (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))) + { + o.time_.microseconds = 123456; + o.date_time_.microseconds = 234567; + o.timestamp_.microseconds = 345678; + + transaction t (db->begin ()); + db->execute ("ALTER TABLE `mysql_types_object`" \ + " MODIFY COLUMN `time` TIME(6)," \ + " MODIFY COLUMN `date_time` DATETIME(6)," \ + " MODIFY COLUMN `timestamp` TIMESTAMP(6)"); + t.commit (); + } + + string short_str (128, 's'); + string medium_str (250, 'm'); + string long_str (2040, 'l'); + + const char* sb (short_str.c_str ()), *se (sb + short_str.size ()); + const char* mb (medium_str.c_str ()), *me (mb + medium_str.size ()); + const char* lb (long_str.c_str ()), *le (lb + long_str.size ()); + + o.char_ = short_str; + o.binary_.assign (sb, se); + o.varchar_ = medium_str; + o.varbinary_.assign (mb, me); + o.tinytext_ = short_str; + o.tinyblob_.assign (sb, se); + o.text_ = long_str; + o.blob_.assign (lb, le); + o.mediumtext_ = long_str; + o.mediumblob_.assign (lb, le); + o.longtext_ = long_str; + o.longblob_.assign (lb, le); + + o.bit_.a = 1; + o.bit_.b = 0; + o.bit_.c = 0; + o.bit_.d = 1; + + o.enum_def_ = green; + o.enum_cst_ = blue; + o.enum_str_ = "green"; + o.set_.insert ("green"); + o.set_.insert ("red"); + o.set_.insert ("blue"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/mysql/types/test.hxx b/odb-tests/mysql/types/test.hxx new file mode 100644 index 0000000..82f7496 --- /dev/null +++ b/odb-tests/mysql/types/test.hxx @@ -0,0 +1,328 @@ +// file : mysql/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // std::unique_ptr +#include // std::memcpy, std::str[n]cmp, std::strlen + +#include + +typedef std::vector buffer; + +struct date_time +{ + date_time () + { + } + + date_time (bool n, + unsigned int y, + unsigned int m, + unsigned int d, + unsigned int h, + unsigned int min, + unsigned int sec, + unsigned int msec = 0) + : negative (n), + year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + microseconds (msec) + { + } + + bool + operator== (const date_time& y) const + { + return + negative == y.negative && + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + microseconds == y.microseconds; + } + + bool negative; + unsigned int year; + unsigned int month; + unsigned int day; + unsigned int hour; + unsigned int minute; + unsigned int second; + unsigned int microseconds; +}; + +struct bitfield +{ + unsigned int a: 1; + unsigned int b: 1; + unsigned int c: 1; + unsigned int d: 1; +}; + +inline bool +operator== (bitfield x, bitfield y) +{ + return + x.a == y.a && + x.b == y.b && + x.c == y.c && + x.d == y.d; +} + +#pragma db value(bitfield) type ("BIT(4)") + +typedef std::set set; +typedef std::unique_ptr string_ptr; + +enum color {red, green, blue}; + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + // Integral types. + // + #pragma db type ("BOOL") + bool bool_; + + #pragma db type ("TINYINT") + signed char schar_; + + #pragma db type ("TINYINT UNSIGNED") + unsigned char uchar_; + + #pragma db type ("SMALLINT") + short short_; + + #pragma db type ("SMALLINT UNSIGNED") + unsigned short ushort_; + + #pragma db type ("MEDIUMINT") + int mint_; + + #pragma db type ("MEDIUMINT UNSIGNED") + unsigned int umint_; + + #pragma db type ("INT") + int int_; + + #pragma db type ("INT UNSIGNED") + unsigned int uint_; + + #pragma db type ("BIGINT") + long long long_long_; + + #pragma db type ("BIGINT UNSIGNED") + unsigned long long ulong_long_; + + // Float types. + // + #pragma db type ("FLOAT") + float float_; + + #pragma db type ("FLOAT(32)") + double float8_; + + #pragma db type ("DOUBLE") + double double_; + + #pragma db type ("DECIMAL(6,3)") + std::string decimal_; + + // Data-time types. + // + #pragma db type ("DATE") + date_time date_; + + #pragma db type ("TIME") + date_time time_; + + #pragma db type ("DATETIME") + date_time date_time_; + + #pragma db type ("TIMESTAMP") + date_time timestamp_; + + #pragma db type ("YEAR") + short year_; + + // String and binary types. + // + #pragma db type ("CHAR(128)") + std::string char_; + + #pragma db type ("BINARY(128)") + buffer binary_; + + #pragma db type ("VARCHAR(256)") + std::string varchar_; + + #pragma db type ("VARBINARY(256)") + buffer varbinary_; + + #pragma db type ("TINYTEXT") + std::string tinytext_; + + #pragma db type ("TINYBLOB") + buffer tinyblob_; + + #pragma db type ("TEXT") + std::string text_; + + #pragma db type ("BLOB") + buffer blob_; + + #pragma db type ("MEDIUMTEXT") + std::string mediumtext_; + + #pragma db type ("MEDIUMBLOB") + buffer mediumblob_; + + #pragma db type ("LONGTEXT") + std::string longtext_; + + #pragma db type ("LONGBLOB") + buffer longblob_; + + // Other types. + // + // #pragma db type ("BIT(4)") - assigned by #pragma db value + bitfield bit_; + + // Test ENUM representations (integer and string). + // + color enum_def_; + + // Map to a custom MySQL ENUM type. + // + #pragma db type ("ENUM('R', 'G', 'B')") + color enum_cst_; + + #pragma db type ("ENUM('red', 'green', 'blue')") + std::string enum_str_; + + #pragma db type ("SET('red', 'green', 'blue')") + set set_; + + // Test NULL value. + // + #pragma db type ("TEXT") null + string_ptr null_; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bool_ == y.bool_ && + schar_ == y.schar_ && + uchar_ == y.uchar_ && + short_ == y.short_ && + ushort_ == y.ushort_ && + mint_ == y.mint_ && + umint_ == y.umint_ && + int_ == y.int_ && + uint_ == y.uint_ && + long_long_ == y.long_long_ && + ulong_long_ == y.ulong_long_ && + float_ == y.float_ && + float8_ == y.float8_ && + double_ == y.double_ && + decimal_ == y.decimal_ && + date_ == y.date_ && + time_ == y.time_ && + date_time_ == y.date_time_ && + timestamp_ == y.timestamp_ && + year_ == y.year_ && + char_ == y.char_ && + binary_ == y.binary_ && + varchar_ == y.varchar_ && + varbinary_ == y.varbinary_ && + tinytext_ == y.tinytext_ && + tinyblob_ == y.tinyblob_ && + text_ == y.text_ && + blob_ == y.blob_ && + mediumtext_ == y.mediumtext_ && + mediumblob_ == y.mediumblob_ && + longtext_ == y.longtext_ && + longblob_ == y.longblob_ && + bit_ == y.bit_ && + enum_def_ == y.enum_def_ && + enum_cst_ == y.enum_cst_ && + enum_str_ == y.enum_str_ && + set_ == y.set_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + +#endif // TEST_HXX diff --git a/odb-tests/mysql/types/testscript b/odb-tests/mysql/types/testscript new file mode 100644 index 0000000..2962d1c --- /dev/null +++ b/odb-tests/mysql/types/testscript @@ -0,0 +1,11 @@ +# file : mysql/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../mysql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/mysql/types/traits.hxx b/odb-tests/mysql/types/traits.hxx new file mode 100644 index 0000000..d4ce200 --- /dev/null +++ b/odb-tests/mysql/types/traits.hxx @@ -0,0 +1,198 @@ +// file : mysql/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::memcpy, std::memset + +#include + +#include "test.hxx" // date_time, string_ptr + +namespace odb +{ + namespace mysql + { + template + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef MYSQL_TIME image_type; + + static void + set_value (date_time& v, const MYSQL_TIME& i, bool is_null) + { + if (!is_null) + { + v.negative = i.neg; + v.year = i.year; + v.month = i.month; + v.day = i.day; + v.hour = i.hour; + v.minute = i.minute; + v.second = i.second; + v.microseconds = static_cast (i.second_part); + } + else + v = date_time (); + } + + static void + set_image (MYSQL_TIME& i, bool& is_null, const date_time& v) + { + is_null = false; + i.neg = v.negative; + i.year = v.year; + i.month = v.month; + i.day = v.day; + i.hour = v.hour; + i.minute = v.minute; + i.second = v.second; + i.second_part = v.microseconds; + } + }; + + template <> + class value_traits + { + public: + typedef bitfield value_type; + typedef bitfield query_type; + typedef unsigned char* image_type; + + static void + set_value (bitfield& v, + const unsigned char* s, + std::size_t, + bool is_null) + { + if (!is_null) + { + v.a = *s & 1; + v.b = (*s >> 1) & 1; + v.c = (*s >> 2) & 1; + v.d = (*s >> 3) & 1; + } + else + v.a = v.b = v.c = v.d = 0; + } + + static void + set_image (unsigned char* s, + std::size_t, + std::size_t& n, + bool& is_null, + bitfield v) + { + is_null = false; + n = 1; + *s = v.a | (v.b << 1) | (v.c << 2) | (v.d << 3); + } + }; + + template <> + class value_traits + { + public: + typedef set value_type; + typedef set query_type; + typedef details::buffer image_type; + + static void + set_value (set& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.clear (); + + if (!is_null) + { + const char* s (b.data ()); + const char* e (s + n); + + while (s < e) + { + const char* p (s); + + while (p < e && *p != ',') + ++p; + + v.insert (std::string (s, p - s)); + s = p; + + if (p != e) + ++s; + } + } + } + + static void + set_image (details::buffer& buf, + std::size_t& n, + bool& is_null, + const set& v) + { + is_null = false; + n = 0; + + for (set::const_iterator b (v.begin ()), i (b); i != v.end (); ++i) + { + std::size_t m (i->size () + (i != b ? 1 : 0)); + + if (n + m > buf.capacity ()) + buf.capacity (n + m, n); + + if (i != b) + buf.data ()[n++] = ','; + + std::memcpy (buf.data () + n, i->c_str (), i->size ()); + n += i->size (); + } + } + }; + + template <> + class value_traits + { + public: + typedef string_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (string_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const string_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/oracle/custom/custom.sql b/odb-tests/oracle/custom/custom.sql new file mode 100644 index 0000000..6e22903 --- /dev/null +++ b/odb-tests/oracle/custom/custom.sql @@ -0,0 +1,53 @@ +/* This file contains custom type definitions and helper functions. + */ + +/* For some reason CREATE OR REPLACE TYPE does not work on Oracle 10.2. */ +BEGIN + BEGIN + EXECUTE IMMEDIATE 'DROP TYPE Numbers'; + EXCEPTION + WHEN OTHERS THEN + IF SQLCODE != -4043 THEN RAISE; END IF; + END; +END; +/ + +CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10); +/ + +CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers +IS + ret Numbers := Numbers(); + s_pos NUMBER := 1; + e_pos NUMBER := 0; +BEGIN + IF in_str IS NOT NULL THEN + LOOP + e_pos := INSTR(in_str, ',', s_pos); + EXIT WHEN e_pos = 0; + ret.extend; + ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos, e_pos - s_pos) AS NUMBER); + s_pos := e_pos + 1; + END LOOP; + ret.extend; + ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos) AS NUMBER); + END IF; + RETURN ret; +END; +/ + +CREATE OR REPLACE FUNCTION numbers_to_string(in_nums IN Numbers) RETURN VARCHAR2 +IS + ret VARCHAR2(1500); +BEGIN + IF in_nums.COUNT != 0 THEN + FOR i IN in_nums.FIRST .. in_nums.LAST LOOP + IF i != in_nums.FIRST THEN + ret := ret || ','; + END IF; + ret := ret || in_nums(i); + END LOOP; + END IF; + RETURN ret; +END; +/ diff --git a/odb-tests/oracle/custom/driver.cxx b/odb-tests/oracle/custom/driver.cxx new file mode 100644 index 0000000..45f0a4e --- /dev/null +++ b/odb-tests/oracle/custom/driver.cxx @@ -0,0 +1,77 @@ +// file : oracle/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in Oracle. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace oracle = odb::oracle; +using namespace oracle; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + object o (1); + o.iv.push_back (123); + o.iv.push_back (234); + o.iv.push_back (-345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Update. + // + o.iv[0]++; + o.iv.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/oracle/custom/test.hxx b/odb-tests/oracle/custom/test.hxx new file mode 100644 index 0000000..523d50b --- /dev/null +++ b/odb-tests/oracle/custom/test.hxx @@ -0,0 +1,40 @@ +// file : oracle/custom/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +// Map Numbers VARRAY Oracle type to std::vector. This type is defined +// in the custom.sql file along with two helper functions that convert +// between Numbers and its string representation. The other half of this +// mapping is in traits.hxx (value_traits, id_string>). +// +#pragma db map type("Numbers") \ + as("VARCHAR2(1500)") \ + to("CAST(string_to_numbers((?)) AS Numbers)") \ + from("numbers_to_string((?))") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + #pragma db type("Numbers") + std::vector iv; + + bool + operator== (const object& y) const + { + return id == y.id && iv == y.iv; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/oracle/custom/traits.hxx b/odb-tests/oracle/custom/traits.hxx new file mode 100644 index 0000000..8df2f91 --- /dev/null +++ b/odb-tests/oracle/custom/traits.hxx @@ -0,0 +1,76 @@ +// file : oracle/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include +#include +#include // std::memcpy +#include // std::memcpy + +#include + +namespace odb +{ + namespace oracle + { + + template <> + class value_traits, id_string> + { + public: + typedef std::vector value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const char* b, + std::size_t n, + bool is_null) + { + v.clear (); + + if (!is_null) + { + // Array format is "n1,n2,n3...". + // + std::istringstream is (std::string (b, n)); + + for (char c; !is.eof (); is >> c) + { + v.push_back (int ()); + is >> v.back (); + } + } + } + + static void + set_image (char* b, + std::size_t c, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + std::ostringstream os; + + for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) + { + os << *i; + + if (++i != e) + os << ','; + } + + const std::string& s (os.str ()); + n = s.size (); + assert (n <= c); + std::memcpy (b, s.c_str (), n); + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/oracle/database/driver.cxx b/odb-tests/oracle/database/driver.cxx new file mode 100644 index 0000000..499f136 --- /dev/null +++ b/odb-tests/oracle/database/driver.cxx @@ -0,0 +1,33 @@ +// file : oracle/database/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +namespace oracle = odb::oracle; +using namespace oracle; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("bob", "secret", "db1"); + } + + { + database d1 ("bob", "secret", "svc1", "server1"); + database d2 ("bob", "secret", "svc1", "server1", 999); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + } +} diff --git a/odb-tests/oracle/native/driver.cxx b/odb-tests/oracle/native/driver.cxx new file mode 100644 index 0000000..541d21e --- /dev/null +++ b/odb-tests/oracle/native/driver.cxx @@ -0,0 +1,77 @@ +// file : oracle/native/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +using namespace std; +namespace oracle = odb::oracle; +using namespace oracle; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("BEGIN " + " EXECUTE IMMEDIATE 'DROP TABLE oracle_native_test'; " + " EXCEPTION " + " WHEN OTHERS THEN " + " IF SQLCODE != -942 THEN RAISE; END IF; " + "END;"); + + db->execute ("CREATE TABLE oracle_native_test (n NUMERIC(10,0))"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO oracle_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO oracle_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM oracle_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM oracle_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/oracle/template/driver.cxx b/odb-tests/oracle/template/driver.cxx new file mode 100644 index 0000000..13317df --- /dev/null +++ b/odb-tests/oracle/template/driver.cxx @@ -0,0 +1,40 @@ +// file : oracle/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace oracle = odb::oracle; +using namespace oracle; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_specific_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/oracle/template/template-vc10.vcxproj b/odb-tests/oracle/template/template-vc10.vcxproj new file mode 100644 index 0000000..92066cf --- /dev/null +++ b/odb-tests/oracle/template/template-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/oracle/template/template-vc10.vcxproj.filters b/odb-tests/oracle/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/oracle/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/oracle/template/template-vc11.vcxproj b/odb-tests/oracle/template/template-vc11.vcxproj new file mode 100644 index 0000000..a92e437 --- /dev/null +++ b/odb-tests/oracle/template/template-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/oracle/template/template-vc11.vcxproj.filters b/odb-tests/oracle/template/template-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/oracle/template/template-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/oracle/template/template-vc12.vcxproj b/odb-tests/oracle/template/template-vc12.vcxproj new file mode 100644 index 0000000..de35c03 --- /dev/null +++ b/odb-tests/oracle/template/template-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/oracle/template/template-vc12.vcxproj.filters b/odb-tests/oracle/template/template-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/oracle/template/template-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/oracle/template/template-vc8.vcproj b/odb-tests/oracle/template/template-vc8.vcproj new file mode 100644 index 0000000..71e2b52 --- /dev/null +++ b/odb-tests/oracle/template/template-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/oracle/template/template-vc9.vcproj b/odb-tests/oracle/template/template-vc9.vcproj new file mode 100644 index 0000000..de9804e --- /dev/null +++ b/odb-tests/oracle/template/template-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/oracle/template/test.hxx b/odb-tests/oracle/template/test.hxx new file mode 100644 index 0000000..bfa9cc9 --- /dev/null +++ b/odb-tests/oracle/template/test.hxx @@ -0,0 +1,25 @@ +// file : oracle/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/oracle/types/driver.cxx b/odb-tests/oracle/types/driver.cxx new file mode 100644 index 0000000..2e3e2e7 --- /dev/null +++ b/odb-tests/oracle/types/driver.cxx @@ -0,0 +1,366 @@ +// file : oracle/types/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Oracle type conversion. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +namespace oracle = odb::oracle; +using namespace oracle; + +int +main (int argc, char* argv[]) +{ + try + { + // Create an Oracle database instance, setting both the client database + // and national character set to UTF-8. + // + auto_ptr db (create_specific_database (argc, argv)); + + object o (1); + + o.int_ = -123456; + o.uint_ = 123456; + o.long_long_ = -123456; + o.ulong_long_ = 123456; + + o.float_ = 1.123F; + o.double_ = 1.123; + o.num_float_ = 1.123F; + o.num_double_ = 1.123; + o.binary_float_ = 1.123F; + o.binary_double_ = 1.123; + + o.date_ = date_time (2010, 8, 29, 15, 33, 18, 0); + o.timestamp_ = date_time (1996, 3, 9, 18, 2, 54, 123000); + o.interval_ds_ = time_interval (0, 0, 13, 15, 23, 19, 123000); + o.interval_ym_ = time_interval (12, 3, 0, 0, 0, 0, 0); + + string vshort_str (8, 's'); + string short_str (13, 's'); + string medium_str (104, 'm'); + string long_str (1018, 'l'); + string vlong_str (15000, 'v'); + + o.char_ = short_str; + o.varchar2_ = medium_str; + o.clob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + + o.nchar_ = vshort_str; + o.nvarchar2_ = medium_str; + o.nclob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + + o.empty_c_.push_back (""); + + o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); + o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); + + o.strs_.push_back (short_str); + o.strs_.push_back (medium_str); + o.strs_.push_back (long_str); + o.strs_.push_back (vlong_str); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Test character set conversion. + // + const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; + + // Testing of character set conversion to and from the client's database + // character set is disabled as the server database character set may + // not be able to represent some Unicode characters. If this were the case + // the test outcome would be a false negative. + // + // o.char_ = unicode_str; + // o.varchar2_ = unicode_str; + // o.clob_ = unicode_str; + + o.nchar_ = unicode_str; + o.nvarchar2_ = unicode_str; + o.nclob_ = unicode_str; + + // Persist. + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Test 64 bit integers. + // + big_int bi1 (1, 0x8000000000000000LL); + big_int bi2 (2, -123456); + big_int bi3 (3, 0); + big_int bi4 (4, 123456); + big_int bi5 (5, 0xFFFFFFFFFFFFFFFFULL); + + big_uint bui1 (1, 0); + big_uint bui2 (2, 123456); + big_uint bui3 (3, 0xFFFFFFFFFFFFFFFFULL); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (bi1); + db->persist (bi2); + db->persist (bi3); + db->persist (bi4); + db->persist (bi5); + db->persist (bui1); + db->persist (bui2); + db->persist (bui3); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr bil1 (db->load (1)); + auto_ptr bil2 (db->load (2)); + auto_ptr bil3 (db->load (3)); + auto_ptr bil4 (db->load (4)); + auto_ptr bil5 (db->load (5)); + auto_ptr buil1 (db->load (1)); + auto_ptr buil2 (db->load (2)); + auto_ptr buil3 (db->load (3)); + t.commit (); + + assert (bi1 == *bil1); + assert (bi2 == *bil2); + assert (bi3 == *bil3); + assert (bi4 == *bil4); + assert (bi5 == *bil5); + assert (bui1 == *buil1); + assert (bui2 == *buil2); + assert (bui3 == *buil3); + } + + // Test large BLOBs. + // + descriptor b1 (1); + b1.blob.assign (50000, 'b'); + b1.timestamp = date_time (1996, 3, 9, 18, 2, 54, 123000); + b1.interval_ds = time_interval (0, 0, 13, 15, 23, 19, 123000); + b1.interval_ym = time_interval (12, 3, 0, 0, 0, 0, 0); + + descriptor b2 (2); + b2.blob.assign (500000, 'b'); + b2.timestamp = date_time (1997, 4, 10, 19, 3, 55, 234000); + b2.interval_ds = time_interval (0, 0, 14, 16, 24, 20, 234000); + b2.interval_ym = time_interval (13, 4, 0, 0, 0, 0, 0); + + descriptor b3 (3); + b3.blob.assign (5000, 'b'); + b3.timestamp = date_time (1995, 2, 8, 17, 1, 53, 120000); + b3.interval_ds = time_interval (0, 0, 12, 14, 22, 18, 120000); + b3.interval_ym = time_interval (11, 2, 0, 0, 0, 0, 0); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (b1); + db->persist (b2); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + t.commit (); + + assert (b1 == *p1); + assert (b2 == *p2); + } + + // Test image copying with descriptor-based type (LOB, date-time) data. + // + { + typedef oracle::query query; + typedef odb::result result; + + transaction t (db->begin ()); + + // Pre-bind the image for other operations. + // + { + db->persist (b3); + db->update (b3); + db->reload (b3); + db->erase (b3); + } + + + result r (db->query (query::id < 3)); + result::iterator i (r.begin ()); + + assert (i != r.end ()); + + { + result r (db->query (query::id > 1)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (*i == b2); + assert (++i == r.end ()); + } + + assert (*i == b1); // Load from copy (copy c-tor). + + ++i; + assert (i != r.end ()); + + { + result r (db->query (query::id < 2)); + result::iterator i (r.begin ()); + assert (i != r.end ()); + assert (*i == b1); + assert (++i == r.end ()); + } + + assert (*i == b2); // Load from copy (copy assign). + assert (++i == r.end ()); + + // Make sure all other operations are still working. + // + { + db->persist (b3); +#ifdef HAVE_CXX11 + unique_ptr p (db->load (3)); +#else + auto_ptr p (db->load (3)); +#endif + assert (b3 == *p); + b3.blob.push_back (123); + db->update (b3); + db->reload (p); + assert (b3 == *p); + db->erase (b3); + } + + t.commit (); + } + + // Test descriptor management in TIMESTAMP and INTERVAL images. + // + { + typedef oracle::query query; + typedef odb::result result; + + query q (query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_); + + transaction t (db->begin ()); + + { + result r (db->query (q)); + assert (size (r) == 1); + } + + { + result r (db->query (q)); + assert (size (r) == 1); + } + + { + // Query temporary. + // + result r (db->query ( + query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_)); + + query dummy (query::timestamp == o.timestamp_ && + query::interval_ym == o.interval_ym_ && + query::interval_ds == o.interval_ds_); + + assert (size (r) == 1); + } + + t.commit (); + } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // Oracle returns padded values for CHAR(N) unless they are + // empty (represented as NULL). + // + memcpy (o2.s2, "1234567890 ", 16); + + { + transaction t (db->begin ()); + auto_ptr p1 (db->load (1)); + auto_ptr p2 (db->load (2)); + auto_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/oracle/types/test.hxx b/odb-tests/oracle/types/test.hxx new file mode 100644 index 0000000..255bc08 --- /dev/null +++ b/odb-tests/oracle/types/test.hxx @@ -0,0 +1,353 @@ +// file : oracle/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include +#include +#include // std::auto_ptr +#include // std::memcpy, std::str[n]cmp, std::strlen + +#include + +struct date_time +{ + date_time () + { + } + + date_time (unsigned short y, + unsigned char m, + unsigned char d, + unsigned char h, + unsigned char min, + unsigned char sec, + unsigned int nsec) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + nanosecond (nsec) + { + } + + bool + operator== (const date_time& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + nanosecond == y.nanosecond; + } + + unsigned short year; + unsigned char month; + unsigned char day; + unsigned char hour; + unsigned char minute; + unsigned char second; + unsigned int nanosecond; +}; + +struct time_interval +{ + time_interval () + { + } + + time_interval (int y, int m, int d, int h, int min, int sec, int nsec) + : year (y), + month (m), + day (d), + hour (h), + minute (min), + second (sec), + nanosecond (nsec) + { + } + + bool + operator== (const time_interval& y) const + { + return + year == y.year && + month == y.month && + day == y.day && + hour == y.hour && + minute == y.minute && + second == y.second && + nanosecond == y.nanosecond; + } + + int year; + int month; + int day; + int hour; + int minute; + int second; + int nanosecond; +}; + +#ifdef HAVE_CXX11 +typedef std::unique_ptr string_ptr; +#else +typedef std::auto_ptr string_ptr; +#endif + +typedef std::vector strings; + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned int id_; + + // Integral types. + // + #pragma db type ("NUMBER(10)") + int int_; + + #pragma db type ("NUMBER(10)") + unsigned uint_; + + #pragma db type ("NUMBER(19)") + long long long_long_; + + #pragma db type ("NUMBER(20)") + unsigned long long ulong_long_; + + // Float types. + // + #pragma db type ("FLOAT(24)") + float float_; + + #pragma db type ("FLOAT(53)") + double double_; + + #pragma db type ("NUMBER(7,3)") + float num_float_; + + #pragma db type ("NUMBER(15,5)") + double num_double_; + + #pragma db type ("BINARY_FLOAT") + float binary_float_; + + #pragma db type ("BINARY_DOUBLE") + double binary_double_; + + // Data-time types. + // + #pragma db type ("DATE") + date_time date_; + + #pragma db type ("TIMESTAMP(6)") + date_time timestamp_; + + #pragma db type ("INTERVAL DAY TO SECOND") + time_interval interval_ds_; + + #pragma db type ("INTERVAL YEAR TO MONTH") + time_interval interval_ym_; + + // String and binary types. + // + #pragma db type ("CHAR(13)") + std::string char_; + + #pragma db type ("VARCHAR2(512)") null + std::string varchar2_; + + #pragma db type ("NCHAR(8)") + std::string nchar_; + + #pragma db type ("NVARCHAR2(512)") null + std::string nvarchar2_; + + // Oracle treats empty and NULL VARCHAR2 the same. Test that we + // handle this. + // + std::string empty_; + std::vector empty_c_; + + #pragma db type ("RAW(1024)") + std::vector raw_; + + // LOB types. + // + #pragma db type ("BLOB") + std::vector blob_; + + #pragma db type ("CLOB") + std::string clob_; + + #pragma db type ("NCLOB") + std::string nclob_; + + // Test containers of LOBs + // + #pragma db value_type ("CLOB") + strings strs_; + + // Test NULL value. + // + #pragma db type ("VARCHAR2(32)") null + string_ptr null_; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + int_ == y.int_ && + uint_ == y.uint_ && + long_long_ == y.long_long_ && + ulong_long_ == y.ulong_long_ && + float_ == y.float_ && + double_ == y.double_ && + num_float_ == y.num_float_ && + num_double_ == y.num_double_ && + binary_float_ == y.binary_float_ && + binary_double_ == y.binary_double_ && + date_ == y.date_ && + timestamp_ == y.timestamp_ && + interval_ds_ == y.interval_ds_ && + interval_ym_ == y.interval_ym_ && + char_ == y.char_ && + varchar2_ == y.varchar2_ && + nchar_ == y.nchar_ && + nvarchar2_ == y.nvarchar2_ && + empty_ == y.empty_ && + empty_c_ == y.empty_c_ && + raw_ == y.raw_ && + blob_ == y.blob_ && + clob_ == y.clob_ && + nclob_ == y.nclob_ && + strs_ == y.strs_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +#pragma db object +struct big_uint +{ + big_uint (unsigned int id = 0, unsigned long long v = 0) + : id_ (id), value (v) + { + } + + #pragma db id + unsigned int id_; + + unsigned long long value; + + bool + operator== (const big_uint& y) const + { + return id_ == y.id_ && value == y.value; + } +}; + +#pragma db object +struct big_int +{ + big_int (unsigned int id = 0, long long v = 0) + : id_ (id), value (v) + { + } + + #pragma db id + unsigned int id_; + + long long value; + + bool + operator== (const big_int& y) const + { + return id_ == y.id_ && value == y.value; + } +}; + +#pragma db object +struct descriptor +{ + descriptor (unsigned int id = 0): id_ (id) {} + + #pragma db id + unsigned int id_; + + #pragma db type ("BLOB") + std::vector blob; + + #pragma db type ("TIMESTAMP(6)") + date_time timestamp; + + #pragma db type ("INTERVAL DAY TO SECOND") + time_interval interval_ds; + + #pragma db type ("INTERVAL YEAR TO MONTH") + time_interval interval_ym; + + bool + operator== (const descriptor& y) const + { + return id_ == y.id_ && + blob == y.blob && + timestamp == y.timestamp && + interval_ds == y.interval_ds && + interval_ym == y.interval_ym; + } +}; + +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") null + char s2[16]; + + #pragma db null + char s3[1]; + + #pragma db null + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/oracle/types/traits.hxx b/odb-tests/oracle/types/traits.hxx new file mode 100644 index 0000000..ad747d8 --- /dev/null +++ b/odb-tests/oracle/types/traits.hxx @@ -0,0 +1,192 @@ +// file : oracle/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // datetime, interval_ym, interval_ds +#include + +#include + +#include "test.hxx" // date_time, time_interval + +namespace odb +{ + namespace oracle + { + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef char* image_type; + + static void + set_value (date_time& v, const char* i, bool is_null) + { + if (!is_null) + { + short y (0); + unsigned char m (0), d (0), h (0), mins (0), s (0); + + details::get_date (i, y, m, d, h, mins, s); + + v.year = y; + v.month = m; + v.day = d; + v.hour = h; + v.minute = mins; + v.second = s; + + // Oracle DATE does not support fractional seconds. + // + v.nanosecond = 0; + } + } + + static void + set_image (char* i, bool& is_null, const date_time& v) + { + is_null = false; + details::set_date (i, + static_cast (v.year), + v.month, + v.day, + v.hour, + v.minute, + v.second); + } + }; + + template <> + class value_traits + { + public: + typedef date_time value_type; + typedef date_time query_type; + typedef datetime image_type; + + static void + set_value (date_time& v, const datetime& i, bool is_null) + { + if (!is_null) + { + sb2 y (0); + ub1 m (0), d (0), h (0), mins (0), s (0); + ub4 ns (0); + + i.get (y, m, d, h, mins, s, ns); + + v.year = y; + v.month = m; + v.day = d; + v.hour = h; + v.minute = mins; + v.second = s; + v.nanosecond = ns; + } + } + + static void + set_image (datetime& i, + bool& is_null, + const date_time& v) + { + is_null = false; + + i.set (static_cast (v.year), + v.month, + v.day, + v.hour, + v.minute, + v.second, + v.nanosecond); + } + }; + + template <> + class value_traits + { + public: + typedef time_interval value_type; + typedef time_interval query_type; + typedef interval_ds image_type; + + static void + set_value (time_interval& v, + const interval_ds& i, + bool is_null) + { + if (!is_null) + { + sb4 d (0), h (0), m (0), s (0), ns (0); + i.get (d, h, m, s, ns); + + v.year = 0; + v.month = 0; + v.day = static_cast (d); + v.hour = static_cast (h); + v.minute = static_cast (m); + v.second = static_cast (s); + v.nanosecond = static_cast (ns); + } + } + + static void + set_image (interval_ds& i, + bool& is_null, + const time_interval& v) + { + is_null = false; + + i.set (v.day, + v.hour, + v.minute, + v.second, + static_cast (v.nanosecond)); + } + }; + + template <> + class value_traits + { + public: + typedef time_interval value_type; + typedef time_interval query_type; + typedef interval_ym image_type; + + static void + set_value (time_interval& v, + const interval_ym& i, + bool is_null) + { + if (!is_null) + { + sb4 y (0), m (0); + i.get (y, m); + + v.year = static_cast (y); + v.month = static_cast (m); + v.day = 0; + v.hour = 0; + v.minute = 0; + v.second = 0; + v.nanosecond = 0; + } + } + + static void + set_image (interval_ym& i, + bool& is_null, + const time_interval& v) + { + is_null = false; + i.set (v.year, v.month); + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/pgsql-schema.testscript b/odb-tests/pgsql-schema.testscript new file mode 100644 index 0000000..8659bcd --- /dev/null +++ b/odb-tests/pgsql-schema.testscript @@ -0,0 +1,6 @@ +# file : pgsql-schema.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the PostgreSQL database schema creation canned command base. +# +create_schema_cmd = [cmdline] $pgsql_client_cmd diff --git a/odb-tests/pgsql.testscript b/odb-tests/pgsql.testscript new file mode 100644 index 0000000..e4b4636 --- /dev/null +++ b/odb-tests/pgsql.testscript @@ -0,0 +1,12 @@ +# file : pgsql.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Create the PostgreSQL database schema creation canned command and setup the +# test driver command line for the subsequent tests. +# +.include pgsql-schema.testscript + +schema_file = [path] $out_base/"$schema"($multi ? '-pgsql' : '').sql +create_schema = [cmdline] $create_schema_cmd -f $schema_file + +test.arguments += ($multi ? 'pgsql' : ) $pgsql_options diff --git a/odb-tests/pgsql/buildfile b/odb-tests/pgsql/buildfile new file mode 100644 index 0000000..c6385c0 --- /dev/null +++ b/odb-tests/pgsql/buildfile @@ -0,0 +1,6 @@ +# file : pgsql/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +./: {*/ -bulk/} + +./: bulk/: include = ($pgsql && !$multi && $pgsql_bulk) diff --git a/odb-tests/pgsql/bulk/buildfile b/odb-tests/pgsql/bulk/buildfile new file mode 100644 index 0000000..6984edb --- /dev/null +++ b/odb-tests/pgsql/bulk/buildfile @@ -0,0 +1,40 @@ +# file : pgsql/bulk/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +if ($build.meta_operation != 'dist') +{ + assert ($pgsql && !$multi) \ + "pgsql should be configured via config.odb_tests.database variable as a single database" + + assert ($pgsql_bulk) "bulk operations are disabled for pgsql" +} + +import libodb = libodb%lib{odb} + +import libs = libpq%lib{pq} +import libs += libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_bulk_ \ + --generate-schema \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/bulk/driver.cxx b/odb-tests/pgsql/bulk/driver.cxx new file mode 100644 index 0000000..ba25542 --- /dev/null +++ b/odb-tests/pgsql/bulk/driver.cxx @@ -0,0 +1,361 @@ +// file : pgsql/bulk/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test transaction savepoints. +// + +#include + +#include +#include +#include +#include +#include + +// Note: hack. +// +#include +#define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) + +#undef NDEBUG +#include + +static const size_t columns = 3; + +struct data +{ + long long id; + long long idata; + const char* sdata; +}; + +static char* values[columns]; +static int lengths[columns]; +static int formats[columns] = {1, 1, 1}; + +static const unsigned int types[columns] = { + 20, // int8 + 20, // int8 + 25 // text +}; + +static void +init (const struct data* d) +{ + values[0] = (char*)&d->id; + lengths[0] = sizeof (d->id); + + values[1] = (char*)&d->idata; + lengths[1] = sizeof (d->idata); + + values[2] = (char*)d->sdata; + lengths[2] = strlen (d->sdata); +} + +static void +execute (PGconn* conn, const struct data* ds, size_t n) +{ + int sock = PQsocket (conn); + assert (sock != -1); + + if (PQsetnonblocking (conn, 1) == -1 || + PQenterPipelineMode (conn) == 0) + assert (false); + + // True if we've written and read everything, respectively. + // + bool wdone = false; + bool rdone = false; + + size_t wn = 0; + size_t rn = 0; + + while (!rdone) + { + fd_set wds; + if (!wdone) + { + FD_ZERO (&wds); + FD_SET (sock, &wds); + } + + fd_set rds; + FD_ZERO (&rds); + FD_SET (sock, &rds); + + if (select (sock + 1, &rds, wdone ? NULL : &wds, NULL, NULL) == -1) + { + if (errno == EINTR) + continue; + + assert (false); + } + + // Try to minimize the chance of blocking the server by first processing + // the result and then sending more queries. + // + if (FD_ISSET (sock, &rds)) + { + if (PQconsumeInput (conn) == 0) + assert (false); + + while (wn > rn && PQisBusy (conn) == 0) + { + //fprintf (stderr, "PQgetResult %zu\n", rn); + + PGresult* res = PQgetResult (conn); + assert (res != NULL); + ExecStatusType stat = PQresultStatus (res); + + if (stat == PGRES_PIPELINE_SYNC) + { + assert (wdone && rn == n); + PQclear (res); + rdone = true; + break; + } + + if (stat == PGRES_FATAL_ERROR) + { + const char* s = PQresultErrorField (res, PG_DIAG_SQLSTATE); + + if (strcmp (s, "23505") == 0) + fprintf (stderr, "duplicate id at %zu\n", rn); + } + + PQclear (res); + assert (rn != n); + ++rn; + + // We get a NULL result after each query result. + // + { + PGresult* end = PQgetResult (conn); + assert (end == NULL); + } + } + } + + if (!wdone && FD_ISSET (sock, &wds)) + { + // Send queries until we get blocked (write-biased). This feels like + // a better overall strategy to keep the server busy compared to + // sending one query at a time and then re-checking if there is + // anything to read because the results of INSERT/UPDATE/DELETE are + // presumably small and quite a few of them can get buffered before + // the server gets blocked. + // + for (;;) + { + if (wn < n) + { + //fprintf (stderr, "PQsendQueryPrepared %zu\n", wn); + + init (ds + wn); + + if (PQsendQueryPrepared (conn, + "persist_object", + (int)(columns), + values, + lengths, + formats, + 1) == 0) + assert (false); + + if (++wn == n) + { + if (PQpipelineSync (conn) == 0) + assert (false); + + ++wn; + } + } + + // PQflush() result: + // + // 0 -- success (queue is now empty) + // 1 -- blocked + // -1 -- error + // + int r = PQflush (conn); + assert (r != -1); + + if (r == 0) + { + if (wn < n) + { + // If we continue here, then we are write-biased. And if we + // break, then we are read-biased. + // +#if 0 + break; +#else + continue; +#endif + } + + wdone = true; + } + + break; // Blocked or done. + } + } + } + + if (PQexitPipelineMode (conn) == 0 || + PQsetnonblocking (conn, 0) == -1) + assert (false); +} + +static void +test (PGconn* conn) +{ + const size_t batch = 500; + struct data ds[batch]; + + for (size_t i = 0; i != batch; ++i) + { + ds[i].id = htonll (i == batch / 2 ? i - 1 : i); // Cause duplicate PK. + ds[i].idata = htonll (i); + ds[i].sdata = "abc"; + } + + // Prepare the statement. + // + { + PGresult* res = PQprepare ( + conn, + "persist_object", + "INSERT INTO \"pgsql_bulk_object\" " + "(\"id\", " + "\"idata\", " + "\"sdata\") " + "VALUES " + "($1, $2, $3)", + (int)(columns), + types); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } + + // Begin transaction. + // + { + PGresult* res = PQexec (conn, "begin"); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } + + execute (conn, ds, batch); + + // Commit transaction. + // + { + PGresult* res = PQexec (conn, "commit"); + assert (PQresultStatus (res) == PGRES_COMMAND_OK); + PQclear (res); + } +} + +#include +#include // std::unique_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + bool fail_already_persistent (false); + + for (int i (1); i != argc; ++i) + { + if (strcmp (argv[i], "--fail-already-persistent") == 0) + { + fail_already_persistent = true; + + for (; i != argc - 1; ++i) + argv[i] = argv[i + 1]; + + --argc; + + break; + } + } + + try + { + unique_ptr db (create_specific_database (argc, argv)); + + connection_ptr cn (db->connection ()); + + if (false) + { + PGconn* conn (cn->handle ()); + test (conn); + } + + { + const unsigned long n (500); + + vector os; + + for (unsigned long i (0); i != n; ++i) + { + os.push_back (object {i, i, string (i, 'x')}); + + if (fail_already_persistent && i == n / 2) + os.push_back (object {i, i, to_string (i)}); + } + + { + transaction t (cn->begin ()); + db->persist (os.begin (), os.end ()); + t.commit (); + } + + { + transaction t (cn->begin ()); + db->find (2); + t.commit (); + } + + for (unsigned long i (0); i != n; ++i) + { + //assert (os[i].id == i + 1); + os[i].idata++; + } + + { + transaction t (cn->begin ()); + db->update (os.begin (), os.end ()); + t.commit (); + } + + { + transaction t (cn->begin ()); + db->erase (os.begin (), os.end ()); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/bulk/test.hxx b/odb-tests/pgsql/bulk/test.hxx new file mode 100644 index 0000000..25dd138 --- /dev/null +++ b/odb-tests/pgsql/bulk/test.hxx @@ -0,0 +1,34 @@ +// file : pgsql/savepoint/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object bulk(1000) +struct object +{ + /* + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + */ + + #pragma db id //auto + unsigned long id; + + unsigned long idata; + + //#pragma db + std::string sdata; +}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/bulk/testscript b/odb-tests/pgsql/bulk/testscript new file mode 100644 index 0000000..60b7d92 --- /dev/null +++ b/odb-tests/pgsql/bulk/testscript @@ -0,0 +1,18 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +{ + $*; + + $* --fail-already-persistent 2>>EOE != 0 + multiple exceptions, 252 elements attempted, 1 failed, fatal: + [251] object already persistent + EOE +} diff --git a/odb-tests/pgsql/custom/buildfile b/odb-tests/pgsql/custom/buildfile new file mode 100644 index 0000000..a5c6717 --- /dev/null +++ b/odb-tests/pgsql/custom/buildfile @@ -0,0 +1,37 @@ +# file : pgsql/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --hxx-prologue '#include "traits.hxx"' \ + --hxx-prologue '#include "query.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/custom/driver.cxx b/odb-tests/pgsql/custom/driver.cxx new file mode 100644 index 0000000..91ff0ce --- /dev/null +++ b/odb-tests/pgsql/custom/driver.cxx @@ -0,0 +1,125 @@ +// file : pgsql/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in PostgreSQL. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + object o (1); + o.p = point (1.1111, 2222222222.2); + o.pv.push_back (point (1.1234, 2.2345)); + o.pv.push_back (point (3.3456, 4.4567)); + o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. + + o.n1 = "23.5154"; + o.n2 = "235154"; + o.n3 = "2222222222222222222222222222.111111111111111111111111111111"; + + o.iv.push_back (123); + o.iv.push_back (234); + o.iv.push_back (-345); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Query. + // + typedef pgsql::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + // Point comparison. + // + { + result r (db->query (query::p == o.p)); + assert (!r.empty ()); + } + + // Point comparison using native query. + // + { + result r (db->query (query::p + "~=" + query::_val (o.p))); + assert (!r.empty ()); + } + + // Access to individual members. + // + { + result r (db->query (query::p.x == o.p.x)); + assert (!r.empty ()); + } + + t.commit (); + } + + // Update. + // + o.p.x++; + o.p.y--; + o.pv[1].x--; + o.pv[1].y++; + o.n3 += "999"; + o.iv[0]++; + o.iv.pop_back (); + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/custom/query.hxx b/odb-tests/pgsql/custom/query.hxx new file mode 100644 index 0000000..8b89047 --- /dev/null +++ b/odb-tests/pgsql/custom/query.hxx @@ -0,0 +1,158 @@ +// file : pgsql/custom/query.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef QUERY_HXX +#define QUERY_HXX + +#include + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace pgsql + { + template <> + struct query_column + { + private: + const char* table_; + const char* column_; + const char* conversion_; + + std::string x_column_; + std::string y_column_; + + // Sub-columns for individual members. + // + public: + query_column x, y; + + // is_null, is_not_null + // + public: + query_base + is_null () const + { + query_base q (table_, column_); + q += "IS NULL"; + return q; + } + + query_base + is_not_null () const + { + query_base q (table_, column_); + q += "IS NOT NULL"; + return q; + } + + // = + // + public: + query_base + equal (const point& v) const + { + return equal (val_bind (v)); + } + + query_base + equal (val_bind v) const + { + query_base q (table_, column_); + q += "~="; + q.append (v, conversion_); + return q; + } + + query_base + equal (ref_bind r) const + { + query_base q (table_, column_); + q += "~="; + q.append (r, conversion_); + return q; + } + + friend query_base + operator== (const query_column& c, const point& v) + { + return c.equal (v); + } + + friend query_base + operator== (const point& v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, val_bind v) + { + return c.equal (v); + } + + friend query_base + operator== (val_bind v, const query_column& c) + { + return c.equal (v); + } + + friend query_base + operator== (const query_column& c, ref_bind r) + { + return c.equal (r); + } + + friend query_base + operator== (ref_bind r, const query_column& c) + { + return c.equal (r); + } + + // Column comparison. + // + public: + query_base + operator== (const query_column& c) const + { + query_base q (table_, column_); + q += "~="; + q.append (c.table (), c.column ()); + return q; + } + + public: + query_column (const char* table, const char* column, const char* conv) + : table_ (table), column_ (column), conversion_ (conv), + x_column_ (std::string (column) + "[0]"), + y_column_ (std::string (column) + "[1]"), + x (table, x_column_.c_str (), 0), + y (table, y_column_.c_str (), 0) + { + } + + const char* + table () const + { + return table_; + } + + const char* + column () const + { + return column_; + } + + const char* + conversion () const + { + return conversion_; + } + }; + } +} + +#endif // QUERY_HXX diff --git a/odb-tests/pgsql/custom/test.hxx b/odb-tests/pgsql/custom/test.hxx new file mode 100644 index 0000000..ec3d496 --- /dev/null +++ b/odb-tests/pgsql/custom/test.hxx @@ -0,0 +1,86 @@ +// file : pgsql/custom/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Map POINT PostgreSQL type to the point C++ struct. The other half +// of this mapping is in traits.hxx (value_traits). +// +#pragma db map type("POINT") as("TEXT") to("(?)::POINT") from("(?)::TEXT") + +#pragma db value type("POINT") +struct point +{ + point () {} + point (double x_, double y_): x (x_), y (y_) {} + + double x; + double y; +}; + +inline bool +operator== (const point& a, const point& b) +{ + return a.x == b.x && a.y == b.y; +} + +// Map NUMERIC PostgreSQL type to std::string (or any other type that +// provides the value_traits specialization). +// +#pragma db map type("NUMERIC *(\\(.+\\))?") \ + as("TEXT") \ + to("(?)::NUMERIC$1") \ + from("(?)::TEXT") + +// Map INTEGER[] PostgreSQL type to std::vector. The other half of +// this mapping is in traits.hxx (value_traits, id_string>). +// +#pragma db map type("INTEGER *\\[(\\d*)\\]") \ + as("TEXT") \ + to("(?)::INTEGER[$1]") \ + from("(?)::TEXT") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_) : id (id_) {} + + #pragma db id + unsigned long id; + + point p; + std::vector pv; + + #pragma db type("NUMERIC(6, 4)") + std::string n1; + + #pragma db type("NUMERIC(6)") + std::string n2; + + #pragma db type("NUMERIC") + std::string n3; + + #pragma db type("INTEGER [123]") + std::vector iv; + + bool + operator== (const object& y) const + { + return id == y.id && + p == y.p && + pv == y.pv && + n1 == y.n1 && + n2 == y.n2 && + n3 == y.n3 && + iv == y.iv; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/custom/testscript b/odb-tests/pgsql/custom/testscript new file mode 100644 index 0000000..8e1448b --- /dev/null +++ b/odb-tests/pgsql/custom/testscript @@ -0,0 +1,11 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/pgsql/custom/traits.hxx b/odb-tests/pgsql/custom/traits.hxx new file mode 100644 index 0000000..c45dec0 --- /dev/null +++ b/odb-tests/pgsql/custom/traits.hxx @@ -0,0 +1,166 @@ +// file : pgsql/custom/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::numeric_limits +#include +#include +#include // std::memcpy + +#include + +#include "test.hxx" // point + +namespace odb +{ + namespace pgsql + { + template <> + class value_traits + { + public: + typedef point value_type; + typedef point query_type; + typedef details::buffer image_type; + + static void + set_value (point& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (is_null) + v = point (); + else + { + // Point format is "(x,y)". + // + char c; + std::istringstream is (std::string (b.data (), n)); + + is >> c; // '(' + is >> v.x; + is >> c; // ',' + is >> v.y; + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const point& v) + { + is_null = false; + std::ostringstream os; + + // The formula for the number of decimla digits required is given in: + // + // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf + // + os.precision (std::numeric_limits::digits10); + // os.precision (2 + std::numeric_limits::digits * 301/1000); + + os << '(' << v.x << ',' << v.y << ')'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "(?)::POINT";} + }; + }; + + template <> + class value_traits, id_string> + { + public: + typedef std::vector value_type; + typedef value_type query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.clear (); + + if (!is_null) + { + // Array format is "{n1,n2,n3...}". + // + char c; + std::istringstream is (std::string (b.data (), n)); + + is >> c; // '{' + + for (c = static_cast (is.peek ()); c != '}'; is >> c) + { + v.push_back (int ()); + is >> v.back (); + } + } + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + is_null = false; + std::ostringstream os; + + os << '{'; + + for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) + { + os << *i; + + if (++i != e) + os << ','; + } + + os << '}'; + + const std::string& s (os.str ()); + n = s.size (); + + if (n > b.capacity ()) + b.capacity (n); + + std::memcpy (b.data (), s.c_str (), n); + } + }; + + template <> + struct type_traits > + { + static const database_type_id db_type_id = id_string; + + struct conversion + { + static const char* to () {return "(?)::INTEGER[]";} + }; + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/pgsql/database/buildfile b/odb-tests/pgsql/database/buildfile new file mode 100644 index 0000000..6977ea6 --- /dev/null +++ b/odb-tests/pgsql/database/buildfile @@ -0,0 +1,11 @@ +# file : pgsql/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-pgsql%lib{odb-pgsql} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/pgsql/database/driver.cxx b/odb-tests/pgsql/database/driver.cxx new file mode 100644 index 0000000..56bde0a --- /dev/null +++ b/odb-tests/pgsql/database/driver.cxx @@ -0,0 +1,44 @@ +// file : pgsql/database/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous (compilation only). +// + +#include + +#undef NDEBUG +#include + +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("bob", "secret", "db1"); + database d2 ("bob", "secret", "db1", "server1"); + database d3 ("bob", "secret", "db1", "server1", 999); + database d4 ("bob", "secret", "db1", "server1", 999, "extra"); + } + + { + database d1 ("bob", "secret", "db1", "server1", "ext1"); + database d2 ("bob", "secret", "db1", "server1", "ext1", "extra"); + } + + { + database d1 ("conninfo"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + database d3 (argc, argv, true, "extra"); + } +} diff --git a/odb-tests/pgsql/database/testscript b/odb-tests/pgsql/database/testscript new file mode 100644 index 0000000..f57a8e1 --- /dev/null +++ b/odb-tests/pgsql/database/testscript @@ -0,0 +1,6 @@ +# file : pgsql/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/odb-tests/pgsql/index/buildfile b/odb-tests/pgsql/index/buildfile new file mode 100644 index 0000000..a84ed9a --- /dev/null +++ b/odb-tests/pgsql/index/buildfile @@ -0,0 +1,34 @@ +# file : pgsql/index/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_index_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/index/driver.cxx b/odb-tests/pgsql/index/driver.cxx new file mode 100644 index 0000000..dc4c11e --- /dev/null +++ b/odb-tests/pgsql/index/driver.cxx @@ -0,0 +1,44 @@ +// file : pgsql/index/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL index creation. See also the common test. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + // This is just a schema creation test. + // + unique_ptr db (create_specific_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/index/test.hxx b/odb-tests/pgsql/index/test.hxx new file mode 100644 index 0000000..d728188 --- /dev/null +++ b/odb-tests/pgsql/index/test.hxx @@ -0,0 +1,19 @@ +// file : pgsql/index/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + int i; + #pragma db index type("UNIQUE CONCURRENTLY") method("BTREE") member(i) +}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/index/testscript b/odb-tests/pgsql/index/testscript new file mode 100644 index 0000000..671a8c3 --- /dev/null +++ b/odb-tests/pgsql/index/testscript @@ -0,0 +1,11 @@ +# file : pgsql/index/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/pgsql/native/buildfile b/odb-tests/pgsql/native/buildfile new file mode 100644 index 0000000..ec4c80c --- /dev/null +++ b/odb-tests/pgsql/native/buildfile @@ -0,0 +1,16 @@ +# file : pgsql/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/native/driver.cxx b/odb-tests/pgsql/native/driver.cxx new file mode 100644 index 0000000..843db41 --- /dev/null +++ b/odb-tests/pgsql/native/driver.cxx @@ -0,0 +1,75 @@ +// file : pgsql/native/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL native SQL execution. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS pgsql_native_test"); + db->execute ("CREATE TABLE pgsql_native_test (n INT PRIMARY KEY)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO pgsql_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM pgsql_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } + + return 0; +} diff --git a/odb-tests/pgsql/native/testscript b/odb-tests/pgsql/native/testscript new file mode 100644 index 0000000..4fd9d2c --- /dev/null +++ b/odb-tests/pgsql/native/testscript @@ -0,0 +1,9 @@ +# file : pgsql/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + +: basics +: +$* diff --git a/odb-tests/pgsql/truncation/buildfile b/odb-tests/pgsql/truncation/buildfile new file mode 100644 index 0000000..2f2f3a2 --- /dev/null +++ b/odb-tests/pgsql/truncation/buildfile @@ -0,0 +1,35 @@ +# file : pgsql/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-pgsql%lib{odb-pgsql} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/truncation/driver.cxx b/odb-tests/pgsql/truncation/driver.cxx new file mode 100644 index 0000000..337a26e --- /dev/null +++ b/odb-tests/pgsql/truncation/driver.cxx @@ -0,0 +1,163 @@ +// file : pgsql/truncation/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + + try + { + // Test basic operations. + // + { + unique_ptr db (create_specific_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + + // Test query. + // + { + typedef pgsql::query query; + typedef odb::result result; + + unique_ptr db (create_specific_database (argc, argv)); + + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); + + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } + + // Test buffer growth with cached result. + // + { + object1 o; + + transaction t (db->begin ()); + + result r (db->query (query::id >= 20)); + result::iterator i (r.begin ()); + + o.id_ = i->id_; + o.str_ = long_str; + + // This forces buffer growth in the middle of result iteration. + // + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/truncation/test.hxx b/odb-tests/pgsql/truncation/test.hxx new file mode 100644 index 0000000..73110c0 --- /dev/null +++ b/odb-tests/pgsql/truncation/test.hxx @@ -0,0 +1,46 @@ +// file : pgsql/truncation/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object table ("test") +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object table ("test") +struct object2 +{ + object2 (unsigned long id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/truncation/testscript b/odb-tests/pgsql/truncation/testscript new file mode 100644 index 0000000..c57b723 --- /dev/null +++ b/odb-tests/pgsql/truncation/testscript @@ -0,0 +1,11 @@ +# file : pgsql/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/pgsql/types/buildfile b/odb-tests/pgsql/types/buildfile new file mode 100644 index 0000000..64f0c02 --- /dev/null +++ b/odb-tests/pgsql/types/buildfile @@ -0,0 +1,36 @@ +# file : pgsql/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ +"pgsql should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} +import libcommon = lib{common} +import libs = libodb-pgsql%lib{odb-pgsql} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb and libcommon +# libraries are resolved for the odb_compile ad hoc rule (see build/root.build +# for details). +# +libue{test-meta}: $libodb $libcommon + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix pgsql_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --cxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" + +# Testscript's run-time prerequisites. +# +exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/odb-tests/pgsql/types/driver.cxx b/odb-tests/pgsql/types/driver.cxx new file mode 100644 index 0000000..710f601 --- /dev/null +++ b/odb-tests/pgsql/types/driver.cxx @@ -0,0 +1,165 @@ +// file : pgsql/types/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test PostgreSQL type conversion. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace pgsql = odb::pgsql; +using namespace pgsql; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + object o (1); + + o.bool_ = true; + o.short_ = 12345; + o.int_ = -123456; + o.long_long_ = 123456; + + o.float_ = 1.123F; + o.float8_ = 1.123; + o.double_ = 1.123; + + o.date_ = 4015; + o.time_ = 48180000000LL; + o.timestamp_ = 346896000LL; + + string short_str (128, 's'); + string medium_str (250, 'm'); + string long_str (2040, 'l'); + + o.char_ = short_str; + o.varchar_ = medium_str; + o.text_ = long_str; + + o.bytea_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); + + unsigned char varbit_buf[8] = {1, 3, 1, 3, 1, 3, 1, 3}; + o.varbit_.size = 52; + o.varbit_.ubuffer_ = ubuffer (varbit_buf, 8); + + o.bit_.a = 0; + o.bit_.b = 1; + o.bit_.c = 0; + o.bit_.d = 1; + + // 6F846D41-C89A-4E4D-B22F-56443CFA543F + memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" + "\x56\x44\x3C\xFA\x54\x3F", 16); + + o.enum_ = green; + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + typedef pgsql::query query; + typedef odb::result result; + + // Test UUID in queries. + // + { + char uuid[16]; + memcpy (uuid, o.uuid_, 16); + + transaction t (db->begin ()); + + { + result r (db->query (query::uuid == uuid)); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_val (uuid))); + assert (size (r) == 1); + } + + { + result r (db->query (query::uuid == query::_ref (uuid))); + assert (size (r) == 1); + } + + { + const char* d (uuid); + result r (db->query (query::uuid == d)); + assert (size (r) == 1); + } + + t.commit (); + } + + // Test char array. + // + { + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "1234567890123456"); + + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + // PostgreSQL returns padded values for CHAR(N). + // + memcpy (o1.s2, " ", 16); + o1.s3[0] = o1.c1 = ' '; + memcpy (o2.s2, "1234567890 ", 16); + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/pgsql/types/test.hxx b/odb-tests/pgsql/types/test.hxx new file mode 100644 index 0000000..462ebad --- /dev/null +++ b/odb-tests/pgsql/types/test.hxx @@ -0,0 +1,220 @@ +// file : pgsql/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // std::unique_ptr +#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen +#include // std::size_t + +#include + +#include + +struct bitfield +{ + unsigned int a: 1; + unsigned int b: 1; + unsigned int c: 1; + unsigned int d: 1; +}; + +inline bool +operator== (bitfield x, bitfield y) +{ + return + x.a == y.a && + x.b == y.b && + x.c == y.c && + x.d == y.d; +} + +struct varbit +{ + std::size_t size; + ubuffer ubuffer_; + + bool + compare (const varbit& x) const + { + if (size != x.size) + return false; + + std::size_t byte_len = size / 8; + + if (std::memcmp (ubuffer_.data (), x.ubuffer_.data (), byte_len) != 0) + return false; + + std::size_t trailing_bits = size % 8; + + if (trailing_bits != 0) + { + unsigned char mask (0xFFU << (8 - trailing_bits)); + + return (ubuffer_.data ()[byte_len] & mask) == + (x.ubuffer_.data ()[byte_len] & mask); + } + + return true; + } +}; + +inline bool +operator== (const varbit& x, const varbit& y) +{ + return x.compare (y); +} + +#pragma db value(bitfield) type ("BIT(4)") + +typedef std::unique_ptr string_ptr; + +enum color {red, green, blue}; + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + // Integral types. + // + #pragma db type ("BOOL") + bool bool_; + + #pragma db type ("SMALLINT") + short short_; + + #pragma db type ("INT") + int int_; + + #pragma db type ("BIGINT") + long long long_long_; + + // Float types. + // + #pragma db type ("REAL") + float float_; + + #pragma db type ("FLOAT(32)") + double float8_; + + #pragma db type ("DOUBLE PRECISION") + double double_; + + // Data-time types. + // + #pragma db type ("DATE") + int date_; + + #pragma db type ("TIME") + long long time_; + + #pragma db type ("TIMESTAMP") + long long timestamp_; + + // String and binary types. + // + #pragma db type ("CHAR(128)") + std::string char_; + + #pragma db type ("VARCHAR(256)") + std::string varchar_; + + #pragma db type ("TEXT") + std::string text_; + + #pragma db type ("BYTEA") + std::vector bytea_; + + #pragma db type ("VARBIT(1024)") + varbit varbit_; + + // #pragma db type ("BIT(4)") - assigned by #pragma db value + bitfield bit_; + + // Other types. + // + #pragma db type ("UUID") + char uuid_[16]; + + // Test ENUM representation. + // + color enum_; + + // Test NULL value. + // + #pragma db type ("TEXT") null + string_ptr null_; + + bool + operator== (const object& y) const + { + return + id_ == y.id_ && + bool_ == y.bool_ && + short_ == y.short_ && + int_ == y.int_ && + long_long_ == y.long_long_ && + float_ == y.float_ && + float8_ == y.float8_ && + double_ == y.double_ && + date_ == y.date_ && + time_ == y.time_ && + timestamp_ == y.timestamp_ && + char_ == y.char_ && + varchar_ == y.varchar_ && + text_ == y.text_ && + bytea_ == y.bytea_ && + bit_ == y.bit_ && + varbit_ == y.varbit_ && + memcmp (uuid_, y.uuid_, 16) == 0 && + enum_ == y.enum_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +// Test char array. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id, const char* s) + : id_ (id) + { + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); + s3[0] = c1 = *s; + } + + #pragma db id + unsigned long id_; + + char s1[17]; + + #pragma db type("CHAR(16)") + char s2[16]; + + char s3[1]; + char c1; + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ && + std::strcmp (s1, y.s1) == 0 && + std::strncmp (s2, y.s2, sizeof (s2)) == 0 && + s3[0] == y.s3[0] && + c1 == y.c1; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/pgsql/types/testscript b/odb-tests/pgsql/types/testscript new file mode 100644 index 0000000..57218e1 --- /dev/null +++ b/odb-tests/pgsql/types/testscript @@ -0,0 +1,11 @@ +# file : pgsql/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../pgsql.testscript + ++$create_schema + +: basics +: +$* diff --git a/odb-tests/pgsql/types/traits.hxx b/odb-tests/pgsql/types/traits.hxx new file mode 100644 index 0000000..a1c8fbe --- /dev/null +++ b/odb-tests/pgsql/types/traits.hxx @@ -0,0 +1,171 @@ +// file : pgsql/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include +#include // std::memcpy, std::memset + +#include +#include + +#include "test.hxx" // varbit, ubuffer, string_ptr + +namespace odb +{ + namespace pgsql + { + // The first 4 bytes of the image is a signed int specifying the + // number of significant bits contained by the BIT. The following + // bytes contain the bit data. + // + template <> + class value_traits + { + public: + typedef bitfield value_type; + typedef bitfield query_type; + typedef unsigned char* image_type; + + static void + set_value (bitfield& v, + const unsigned char* i, + std::size_t, + bool is_null) + { + if (!is_null) + { + assert ( + details::endian_traits::ntoh ( + *reinterpret_cast (i)) == 4); + + const unsigned char* d (i + 4); + + v.a = *d >> 4 & 1; + v.b = (*d >> 5) & 1; + v.c = (*d >> 6) & 1; + v.d = (*d >> 7) & 1; + } + else + v.a = v.b = v.c = v.d = 0; + } + + static void + set_image (unsigned char* i, + std::size_t, + std::size_t& n, + bool& is_null, + bitfield v) + { + is_null = false; + n = 5; + + *reinterpret_cast (i) = details::endian_traits::hton (4); + *(i + 4) = v.a << 4 | (v.b << 5) | (v.c << 6) | (v.d << 7); + } + }; + + // The first 4 bytes of the image is a signed int specifying the + // number of significant bits contained by the VARBIT. The following + // bytes contain the VARBIT data. + // + template <> + class value_traits + { + public: + typedef varbit value_type; + typedef varbit query_type; + typedef details::ubuffer image_type; + + static void + set_value (varbit& v, + const details::ubuffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + { + v.size = static_cast ( + details::endian_traits::ntoh ( + *reinterpret_cast (b.data ()))); + + std::size_t byte_len (v.size / 8 + (v.size % 8 > 0 ? 1 : 0)); + assert (n >= byte_len + 4); + + v.ubuffer_.assign (b.data () + 4, byte_len); + } + + else + { + v.size = 0; + v.ubuffer_.assign (0, 0); + } + } + + static void + set_image (details::ubuffer& b, + std::size_t& n, + bool& is_null, + const varbit& v) + { + is_null = false; + n = 4 + v.size / 8 + (v.size % 8 > 0 ? 1 : 0); + + if (n > b.capacity ()) + b.capacity (n); + + // PostgreSQL requires all trailing bits of a VARBIT image + // to be zero. + // + std::memset (b.data (), 0, b.capacity ()); + + *reinterpret_cast (b.data ()) = + details::endian_traits::hton (static_cast (v.size)); + + if (v.size != 0) + std::memcpy (b.data () + 4, v.ubuffer_.data (), n - 4); + } + }; + + template <> + class value_traits + { + public: + typedef string_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (string_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const string_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/odb-tests/qt/common/basic/driver.cxx b/odb-tests/qt/common/basic/driver.cxx new file mode 100644 index 0000000..342a313 --- /dev/null +++ b/odb-tests/qt/common/basic/driver.cxx @@ -0,0 +1,66 @@ +// file : qt/common/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence (common part). +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + try + { + auto_ptr db (create_database (argc, argv)); + + object o (1); + o.uuid_ = QUuid::createUuid (); + o.null_ = QUuid (); + o.zero_ = QUuid (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + + { + typedef odb::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::uuid == o.uuid_)); + result::iterator i (r.begin ()); + assert (i != r.end () && i->id_ == o.id_); + assert (++i == r.end ()); + t.commit (); + } + + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/common/basic/test.hxx b/odb-tests/qt/common/basic/test.hxx new file mode 100644 index 0000000..e67302e --- /dev/null +++ b/odb-tests/qt/common/basic/test.hxx @@ -0,0 +1,35 @@ +// file : qt/common/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + QUuid uuid_; + QUuid null_; + + #pragma db not_null + QUuid zero_; + + bool operator== (const object& x) const + { + return id_ == x.id_ && + uuid_ == x.uuid_ && + null_ == x.null_ && + zero_ == x.zero_; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/common/containers/basics/driver.cxx b/odb-tests/qt/common/containers/basics/driver.cxx new file mode 100644 index 0000000..5e38ee1 --- /dev/null +++ b/odb-tests/qt/common/containers/basics/driver.cxx @@ -0,0 +1,569 @@ +// file : qt/common/containers/basics/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test basic Qt containers persistence. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + for (unsigned short i (0); i < 2; ++i) + { + object empty ("empty"), med ("medium"), full ("full"); + + // + // empty + // + + empty.num = 0; + empty.str = ""; + + // + // med + // + + med.num = 999; + med.str = "xxx"; + + // vector + // + med.nv.push_back (123); + med.nv.push_back (234); + + med.sv.push_back ("aaa"); + med.sv.push_back ("bbbb"); + + med.cv.push_back (comp (123, "aaa")); + med.cv.push_back (comp (234, "bbbb")); + + med.uv.push_back (123); + med.uv.push_back (234); + + // list + // + med.sl.push_back ("aaa"); + med.sl.push_back ("bbbb"); + + med.nl.push_back (123); + med.nl.push_back (234); + + med.cl.push_back (comp (123, "aaa")); + med.cl.push_back (comp (234, "bbbb")); + + // linked list + // + med.sll.push_back ("aaa"); + med.sll.push_back ("bbbb"); + + med.nll.push_back (123); + med.nll.push_back (234); + + med.cll.push_back (comp (123, "aaa")); + med.cll.push_back (comp (234, "bbbb")); + + // set + // + med.ns.insert (123); + med.ns.insert (234); + + med.ss.insert ("aaa"); + med.ss.insert ("bbbb"); + + // map + // + med.nsm[123] = "aaa"; + med.nsm[234] = "bbbb"; + + med.snm["aaa"] = 123; + med.snm["bbbb"] = 234; + + med.ncm[123] = comp (123, "aaa"); + med.ncm[234] = comp (234, "bbbb"); + + med.csm[comp (123, "aaa")] = "aaa"; + med.csm[comp (234, "bbbb")] = "bbbb"; + + // multimap + // + med.nsmm.insert (123, "aaa"); + med.nsmm.insert (123, "bbbb"); + med.nsmm.insert (234, "ccccc"); + + med.snmm.insert ("aaa", 123); + med.snmm.insert ("aaa", 234); + med.snmm.insert ("bbb", 345); + + med.ncmm.insert (123, comp (123, "aaa")); + med.ncmm.insert (123, comp (234, "bbbb")); + med.ncmm.insert (234, comp (345, "ccccc")); + + // hash + // + med.nsh[123] = "aaa"; + med.nsh[234] = "bbbb"; + + med.snh["aaa"] = 123; + med.snh["bbb"] = 234; + + med.sch["iii"] = comp (123, "aaa"); + med.sch["jjj"] = comp (234, "bbbb"); + + // multihash + // + med.nsmh.insert (123, "aaa"); + med.nsmh.insert (123, "bbbb"); + med.nsmh.insert (234, "ccccc"); + + med.snmh.insert ("aaa", 123); + med.snmh.insert ("aaa", 234); + med.snmh.insert ("bbb", 345); + + med.ncmh.insert (123, comp (123, "aaa")); + med.ncmh.insert (123, comp (234, "bbbb")); + med.ncmh.insert (234, comp (345, "ccccc")); + + // + // full + // + + full.num = 9999; + full.str = "xxxx"; + + // vector + // + full.nv.push_back (1234); + full.nv.push_back (2345); + full.nv.push_back (3456); + + full.sv.push_back ("aaaa"); + full.sv.push_back ("bbbbb"); + full.sv.push_back ("cccccc"); + + full.cv.push_back (comp (1234, "aaaa")); + full.cv.push_back (comp (2345, "bbbbb")); + full.cv.push_back (comp (3456, "cccccc")); + + full.uv.push_back (1234); + full.uv.push_back (2345); + full.uv.push_back (3456); + + // list + // + full.sl.push_back ("aaaa"); + full.sl.push_back ("bbbbb"); + full.sl.push_back ("cccccc"); + + full.nl.push_back (1234); + full.nl.push_back (2345); + full.nl.push_back (3456); + + full.cl.push_back (comp (1234, "aaaa")); + full.cl.push_back (comp (2345, "bbbbb")); + full.cl.push_back (comp (3456, "cccccc")); + + // linked list + // + full.sll.push_back ("aaaa"); + full.sll.push_back ("bbbbb"); + full.sll.push_back ("cccccc"); + + full.nll.push_back (1234); + full.nll.push_back (2345); + full.nll.push_back (3456); + + full.cll.push_back (comp (1234, "aaaa")); + full.cll.push_back (comp (2345, "bbbbb")); + full.cll.push_back (comp (3456, "cccccc")); + + // set + // + full.ns.insert (1234); + full.ns.insert (2345); + full.ns.insert (3456); + + full.ss.insert ("aaaa"); + full.ss.insert ("bbbbb"); + full.ss.insert ("cccccc"); + + // map + // + full.nsm[1234] = "aaaa"; + full.nsm[2345] = "bbbbb"; + full.nsm[3456] = "cccccc"; + + full.snm["aaaa"] = 1234; + full.snm["bbbb"] = 2345; + full.snm["cccc"] = 3456; + + full.ncm[1234] = comp (1234, "aaaa"); + full.ncm[2345] = comp (2345, "bbbbb"); + full.ncm[3456] = comp (3456, "cccccc"); + + full.csm[comp (1234, "aaaa")] = "aaaa"; + full.csm[comp (2345, "bbbb")] = "bbbbb"; + full.csm[comp (3456, "cccc")] = "cccccc"; + + // multimap + // + full.nsmm.insert (1234, "aaaa"); + full.nsmm.insert (1234, "bbbbb"); + full.nsmm.insert (2345, "cccccc"); + full.nsmm.insert (2345, "ddddddd"); + + full.snmm.insert ("aaaa", 1234); + full.snmm.insert ("aaaa", 2345); + full.snmm.insert ("bbbb", 3456); + full.snmm.insert ("bbbb", 4567); + + full.ncmm.insert (1234, comp (1234, "aaaa")); + full.ncmm.insert (1234, comp (2345, "bbbbb")); + full.ncmm.insert (2345, comp (3456, "cccccc")); + full.ncmm.insert (2345, comp (4567, "ddddddd")); + + // hash + // + full.nsh[1234] = "aaaa"; + full.nsh[2345] = "bbbbb"; + full.nsh[3456] = "cccccc"; + + full.snh["aaaa"] = 1234; + full.snh["bbbb"] = 2345; + full.snh["cccc"] = 3456; + + full.sch["iiii"] = comp (1234, "aaaa"); + full.sch["jjjj"] = comp (2345, "bbbbb"); + full.sch["kkkk"] = comp (3456, "cccccc"); + + // multihash + // + full.nsmh.insert (1234, "aaaa"); + full.nsmh.insert (1234, "bbbbb"); + full.nsmh.insert (2345, "cccccc"); + full.nsmh.insert (2345, "ddddddd"); + + full.snmh.insert ("aaaa", 1234); + full.snmh.insert ("aaaa", 2345); + full.snmh.insert ("bbbb", 3456); + full.snmh.insert ("bbbb", 4567); + + full.ncmh.insert (1234, comp (1234, "aaaa")); + full.ncmh.insert (1234, comp (2345, "bbbbb")); + full.ncmh.insert (2345, comp (3456, "cccccc")); + full.ncmh.insert (2345, comp (4567, "ddddddd")); + + // persist + // + { + transaction t (db->begin ()); + db->persist (empty); + db->persist (med); + db->persist (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // + // empty + // + + empty.num = 99; + empty.str = "xx"; + + // vector + // + empty.nv.push_back (12); + empty.sv.push_back ("aa"); + empty.cv.push_back (comp (12, "aa")); + empty.uv.push_back (12); + + // list + // + empty.sl.push_back ("aa"); + empty.nl.push_back (12); + empty.cl.push_back (comp (12, "aa")); + + // linked list + // + empty.nll.push_back (12); + empty.sll.push_back ("aa"); + empty.cll.push_back (comp (12, "aa")); + + // set + // + empty.ns.insert (12); + empty.ss.insert ("aa"); + + // map + // + empty.nsm[12] = "aa"; + empty.snm["aa"] = 12; + empty.ncm[12] = comp (12, "aa"); + empty.csm[comp (12, "aa")] = "aa"; + + // multimap + // + empty.nsmm.insert (12, "aa"); + empty.nsmm.insert (12, "bbb"); + empty.nsmm.insert (23, "cccc"); + empty.snmm.insert ("aa", 12); + empty.snmm.insert ("aa", 23); + empty.snmm.insert ("bb", 34); + empty.ncmm.insert (12, comp (12, "aa")); + empty.ncmm.insert (12, comp (23, "bb")); + empty.ncmm.insert (23, comp (34, "cc")); + + // hash + // + empty.nsh[12] = "aa"; + empty.snh["aa"] = 12; + empty.sch["ii"] = comp (12, "aa"); + + // multihash + // + empty.nsmh.insert (12, "aa"); + empty.nsmh.insert (12, "bbb"); + empty.nsmh.insert (23, "cccc"); + empty.snmh.insert ("aa", 12); + empty.snmh.insert ("aa", 23); + empty.snmh.insert ("bb", 34); + empty.ncmh.insert (12, comp (12, "aa")); + empty.ncmh.insert (12, comp (23, "bb")); + empty.ncmh.insert (23, comp (34, "cc")); + + // + // med + // + + med.num = 0; + med.str = ""; + + // vector + // + med.nv.clear (); + med.sv.clear (); + med.cv.clear (); + med.uv.clear (); + + // list + // + med.sl.clear (); + med.nl.clear (); + med.cl.clear (); + + // linked list + // + med.nll.clear (); + med.sll.clear (); + med.cll.clear (); + + // set + // + med.ns.clear (); + med.ss.clear (); + + // map + // + med.nsm.clear (); + med.snm.clear (); + med.ncm.clear (); + med.csm.clear (); + + // multimap + // + med.nsmm.clear (); + med.snmm.clear (); + med.ncmm.clear (); + + // hash + // + med.nsh.clear (); + med.snh.clear (); + med.sch.clear (); + + // multihash + // + med.nsmh.clear (); + med.snmh.clear (); + med.ncmh.clear (); + + + // + // full + // + + full.num++; + full.str += "x"; + + // vector + // + full.nv.back ()++; + full.nv.push_back (4567); + + full.sv.back () += "c"; + full.sv.push_back ("ddddddd"); + + full.cv.back ().num++; + full.cv.back ().str += "c"; + full.cv.push_back (comp (4567, "ddddddd")); + + full.uv.back ()++; + full.uv.push_back (4567); + + // list + // + full.sl.back () += "c"; + full.sl.push_back ("ddddddd"); + + full.nl.back ()++; + full.nl.push_back (4567); + + full.cl.back ().num++; + full.cl.back ().str += "c"; + full.cl.push_back (comp (4567, "ddddddd")); + + // linked list + // + full.sll.back () += "c"; + full.sll.push_back ("ddddddd"); + + full.nll.back ()++; + full.nll.push_back (4567); + + full.cll.back ().num++; + full.cll.back ().str += "c"; + full.cll.push_back (comp (4567, "ddddddd")); + + // set + // + full.ns.insert (4567); + full.ss.insert ("ddddddd"); + + // map + // + full.nsm[3456] += "c"; + full.nsm[4567] = "ddddddd"; + + full.snm["cccc"]++; + full.snm["dddd"] = 4567; + + full.ncm[3456].num++; + full.ncm[3456].str += "c"; + full.ncm[4567] = comp (4567, "ddddddd"); + + full.csm[comp (3456, "cccc")] += "c"; + full.csm[comp (4567, "dddd")] = "ddddddd"; + + // multimap + // + full.nsmm.find (2345).value () += "d"; + full.nsmm.insert (3456, "eeeeeeee"); + + full.snmm.find ("bbbb").value ()++; + full.snmm.insert ("cccc", 5678); + + full.ncmm.find (1234).value ().num++; + full.ncmm.find (2345).value ().str += "d"; + full.ncmm.insert (3456, comp (5678, "eeeeeeee")); + + // hash + // + full.nsh[3456] += "c"; + full.nsh[4567] = "ddddddd"; + + full.snh["cccc"]++; + full.snh["dddd"] = 4567; + + full.sch["iiii"].num++; + full.sch["jjjj"].str += "b"; + full.sch["kkkk"] = comp (4567, "dddddddd"); + + // multihash + // + full.nsmh.find (2345).value () += "d"; + full.nsmh.insert (3456, "eeeeeeee"); + + full.snmh.find ("bbbb").value ()++; + full.snmh.insert ("cccc", 5678); + + full.ncmh.find (1234).value ().num++; + full.ncmh.find (2345).value ().str += "d"; + full.ncmh.insert (3456, comp (5678, "eeeeeeee")); + + // update + // + { + transaction t (db->begin ()); + db->update (empty); + db->update (med); + db->update (full); + t.commit (); + } + + // load & check + // + { + transaction t (db->begin ()); + auto_ptr e (db->load ("empty")); + auto_ptr m (db->load ("medium")); + auto_ptr f (db->load ("full")); + t.commit (); + + assert (empty == *e); + assert (med == *m); + assert (full == *f); + } + + // erase + // + if (i == 0) + { + transaction t (db->begin ()); + db->erase ("empty"); + db->erase ("medium"); + db->erase ("full"); + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/common/containers/basics/test.hxx b/odb-tests/qt/common/containers/basics/test.hxx new file mode 100644 index 0000000..2c61c88 --- /dev/null +++ b/odb-tests/qt/common/containers/basics/test.hxx @@ -0,0 +1,224 @@ +// file : qt/common/containers/basics/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#pragma db value +struct comp +{ + comp () {} + comp (int n, const QString& s) : num (n), str (s) {} + + #pragma db column("number") + int num; + QString str; +}; + +inline bool +operator== (const comp& x, const comp& y) +{ + return x.num == y.num && x.str == y.str; +} + +inline bool +operator< (const comp& x, const comp& y) +{ + return x.num != y.num ? x.num < y.num : x.str < y.str; +} + +typedef QVector num_vector; +typedef QVector str_vector; +typedef QVector comp_vector; + +typedef QList num_list; +typedef QList str_list; +typedef QList comp_list; + +typedef QLinkedList num_linked_list; +typedef QLinkedList str_linked_list; +typedef QLinkedList comp_linked_list; + +typedef QSet num_set; +typedef QSet str_set; + +typedef QMap num_str_map; +typedef QMap str_num_map; +typedef QMap num_comp_map; +typedef QMap comp_str_map; + +typedef QMultiMap num_str_multimap; +typedef QMultiMap str_num_multimap; +typedef QMultiMap num_comp_multimap; + +typedef QHash num_str_hash; +typedef QHash str_num_hash; +typedef QHash str_comp_hash; + +typedef QMultiHash num_str_multihash; +typedef QMultiHash str_num_multihash; +typedef QMultiHash num_comp_multihash; + +#pragma db value +struct cont_comp1 +{ + // This composite value does not have any columns. + // + num_vector sv; // Have the name "conflict" with the one in the object. +}; + +#pragma db value +struct cont_comp2 +{ + cont_comp2 (): num (777), str ("ggg") {} + + int num; + str_list sl; + QString str; +}; + +#pragma db object +struct object +{ + object (): nv (comp1_.sv), sl (comp2_.sl) {} + object (const QString& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} + + #pragma db id + QString id_; + + int num; + + cont_comp1 comp1_; + cont_comp2 comp2_; + + // vector + // + #pragma db transient + num_vector& nv; + + #pragma db table("object_strings") id_column ("obj_id") + str_vector sv; + + #pragma db value_column("") + comp_vector cv; + + #pragma db unordered + num_vector uv; + + // list + // + #pragma db transient + str_list& sl; + + num_list nl; + comp_list cl; + + // linked list + // + str_linked_list sll; + num_linked_list nll; + comp_linked_list cll; + + // set + // + num_set ns; + str_set ss; + + // map + // + num_str_map nsm; + str_num_map snm; + num_comp_map ncm; + comp_str_map csm; + + // multimap + // + num_str_multimap nsmm; + str_num_multimap snmm; + num_comp_multimap ncmm; + + // hash + // + num_str_hash nsh; + str_num_hash snh; + str_comp_hash sch; + + // multihash + // + num_str_multihash nsmh; + str_num_multihash snmh; + num_comp_multihash ncmh; + + QString str; +}; + +inline bool +operator== (const object& x, const object& y) +{ + if (x.uv.size () != y.uv.size ()) + return false; + + int xs (0), ys (0); + + for (num_vector::size_type i (0); i < x.uv.size (); ++i) + { + xs += x.uv[i]; + ys += y.uv[i]; + } + + return + x.id_ == y.id_ && + x.num == y.num && + + x.comp2_.num == y.comp2_.num && + x.comp2_.str == y.comp2_.str && + + x.nv == y.nv && + x.sv == y.sv && + x.cv == y.cv && + xs == ys && + + x.sl == y.sl && + x.nl == y.nl && + x.cl == y.cl && + + x.nll == y.nll && + x.sll == y.sll && + x.cll == y.cll && + + x.ns == y.ns && + x.ss == y.ss && + + x.nsm == y.nsm && + x.snm == y.snm && + x.ncm == y.ncm && + x.csm == y.csm && + + x.nsmm.uniqueKeys () == y.nsmm.uniqueKeys () && + x.snmm.uniqueKeys () == y.snmm.uniqueKeys () && + x.ncmm.uniqueKeys () == y.ncmm.uniqueKeys () && + + x.nsh == y.nsh && + x.snh == y.snh && + x.sch == y.sch && + + x.nsmh.uniqueKeys () == y.nsmh.uniqueKeys () && + x.snmh.uniqueKeys () == y.snmh.uniqueKeys () && + x.ncmh.uniqueKeys () == y.ncmh.uniqueKeys () && + + x.str == y.str; +} + +#endif // TEST_HXX diff --git a/odb-tests/qt/common/containers/change-tracking/driver.cxx b/odb-tests/qt/common/containers/change-tracking/driver.cxx new file mode 100644 index 0000000..8157d96 --- /dev/null +++ b/odb-tests/qt/common/containers/change-tracking/driver.cxx @@ -0,0 +1,643 @@ +// file : qt/common/containers/change-tracking/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test change-tracking Qt containers. +// + +#include // HAVE_CXX11 + +#include // std::auto_ptr +#include +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include // QT_VERSION, Q_FOREACH +#include + +#include +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +struct counting_tracer: odb::tracer +{ + void + reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} + + virtual void + execute (odb::connection&, const char* stmt) + { + string p (stmt, 6); + if (p == "UPDATE") + u++; + else if (p == "INSERT") + i++; + else if (p == "DELETE") + d++; + else if (p == "SELECT") + s++; + t++; + } + + size_t u, i, d, s, t; +}; + +static counting_tracer tr; + +// Compilation test: instantiate all the functions. Only do this if we +// have a fairly recent version of Qt, otherwise some underlying +// functions will be missing. +// +#if QT_VERSION >= 0x050000 +template class QOdbList; +template class QOdbListIteratorImpl >; +template class QOdbListIterator; +template class QMutableOdbListIterator; +#endif + +void +f (const QList&) {} + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + // Test extended interface. + // + { + typedef QOdbList list; + + list ol; + QList ql; + f (ol); // Implicit conversion to QList. + list ol1 (ql); // Initialization from QList. + ol = ql; // Assignement from QList. + + // Container comparison. + // + if (ol != ol1 || + ol != ql || + ql != ol1) + ol.clear (); + + // Container operators. + // + ol += ol1; + ol += ql; + ol = ol1 + ql; + ol = ql + ol1; + + // Iterator comparison/conversion. + // +#ifndef QT_STRICT_ITERATORS + list::const_iterator i (ol.begin ()); + if (i != ol.end ()) + i = ol.end (); +#endif + + Q_FOREACH (const int& i, ol) + cerr << i; + } + + auto_ptr db (create_database (argc, argv)); + + // Test traits logic. + // + { + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + assert (!o.s._tracking ()); + + // persist + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // load + // + { + transaction t (db->begin ()); +#ifdef HAVE_CXX11 + unique_ptr p (db->load ("1")); +#else + auto_ptr p (db->load ("1")); +#endif + assert (p->s._tracking ()); + t.commit (); + } + + // update + // + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + assert (o.s._tracking ()); + + // erase + // + { + transaction t (db->begin ()); + db->erase (o); + t.commit (); + } + + assert (!o.s._tracking ()); + } + + // Test change tracking. + // + object o ("1"); + o.i = 123; + o.s.push_back ("a"); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // push_back/pop_back + // + { + o.s.push_back ("b"); // insert + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); + o.s.push_back ("c"); // update + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.pop_back (); // delete + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.push_back ("b"); + o.s.pop_back (); // no-op + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + assert (*db->load ("1") == o); + t.commit (); + } + + // insert + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin (), "a1"); // insert front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.begin () + 1, "a2"); // insert middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.i == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.insert (o.s.end (), "b1"); // insert back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // erase + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin ()); // erase front + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.d == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.begin () + 1); // erase middle + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.d == 1 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.erase (o.s.end () - 1); // erase back + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // modify + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify (1) += 'b'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.modify_front () += 'a'; + o.s.modify_back () += 'd'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.t == 3); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.begin ().modify () += 'a'; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 2 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.mbegin (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 5 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // clear + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.clear (); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.d == 1 && tr.t == 2); + assert (*db->load ("1") == o); + t.commit (); + } + + // assign + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + QList v; + v.push_back ("1"); + v.push_back ("2"); + v.push_back ("3"); + v.push_back ("4"); + o.s = v; + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 4 && tr.i == 1 && tr.t == 5); + assert (*db->load ("1") == o); + t.commit (); + } + + // removeOne/removeAll + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + o.s.push_back ("a"); + o.s.push_back ("d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.removeOne ("c"); + assert (o.s.size () == 5 && o.s[3] == "a"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.d == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + { + o.s.removeAll ("a"); + assert (o.s.size () == 2 && o.s[0] == "b" && o.s[1] == "d"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 3 && tr.d == 1 && tr.t == 4); + assert (*db->load ("1") == o); + t.commit (); + } + + // Transaction rollback. + // + { + o.s.clear (); + o.s.push_back ("a"); + o.s.push_back ("b"); + o.s.push_back ("c"); + + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (*db->load ("1") == o); + t.commit (); + } + + { + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (o); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed copy. + // + { + +#ifdef HAVE_CXX11 + unique_ptr c; +#else + auto_ptr c; +#endif + + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + c.reset (new object (o)); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } + + // Armed swap. + // +#if QT_VERSION >= 0x040800 + { + object c (o); + + { + o.s.push_back ("d"); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking () && !c.s._tracking ()); + c.s.swap (o.s); + assert (!o.s._tracking () && c.s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } +#endif + + // Armed move. + // +#ifdef HAVE_CXX11 + { + unique_ptr c; + + { + o.s.pop_back (); + + transaction t (db->begin ()); + db->update (o); + assert (o.s._tracking ()); + c.reset (new object (std::move (o))); + assert (!o.s._tracking () && c->s._tracking ()); + t.rollback (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); + t.commit (); + } + + { + transaction t (db->begin ()); + tr.reset (t); + db->update (c); + assert (tr.u == 1 && tr.t == 1); + t.commit (); + } + } +#endif + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/common/containers/change-tracking/test.hxx b/odb-tests/qt/common/containers/change-tracking/test.hxx new file mode 100644 index 0000000..6067581 --- /dev/null +++ b/odb-tests/qt/common/containers/change-tracking/test.hxx @@ -0,0 +1,46 @@ +// file : qt/common/containers/change-tracking/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include // HAVE_CXX11 + +#include + +#ifdef HAVE_CXX11 +# include // std::move +#endif + +#include + +#include +#include + +#ifdef HAVE_CXX11 +#pragma db object pointer(std::unique_ptr) +#else +#pragma db object pointer(std::auto_ptr) +#endif +struct object +{ + object () {} + object (const QString& id): id_ (id) {} + +#ifdef HAVE_CXX11 + object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} + object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} +#endif + + #pragma db id + QString id_; + + unsigned int i; + + QOdbList s; + + inline bool + operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;} +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/common/smart-ptr/driver.cxx b/odb-tests/qt/common/smart-ptr/driver.cxx new file mode 100644 index 0000000..2c7c38a --- /dev/null +++ b/odb-tests/qt/common/smart-ptr/driver.cxx @@ -0,0 +1,248 @@ +// file : qt/common/smart-ptr/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt smart pointers. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +// Force instantiation of all QLazySharedPointer and QLazyWeakPointer +// class template members. +// +template class QLazySharedPointer; +template class QLazyWeakPointer; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + QSharedPointer c1 (new cont (1)); + QSharedPointer c2 (new cont (2)); + + // Test boolean conversion operator. + // + { + assert (!QLazySharedPointer ()); + assert (!QLazyWeakPointer ()); + assert (QLazySharedPointer (c1)); + assert (QLazySharedPointer (*db, 1)); + assert (QLazyWeakPointer (c1)); + assert (QLazyWeakPointer (*db, 1)); + } + + // Test loaded () implementation. + // + { + assert (QLazySharedPointer ().loaded ()); + assert (!QLazySharedPointer (c1).loaded ()); + assert (!QLazySharedPointer (*db, 1).loaded ()); + assert (QLazySharedPointer (*db, c1).loaded ()); + assert (QLazyWeakPointer ().loaded ()); + assert (!QLazyWeakPointer (c1).loaded ()); + assert (!QLazyWeakPointer (*db, 1).loaded ()); + assert (QLazyWeakPointer (*db, c1).loaded ()); + } + + // Test comparison operators. + // + { + // Transient QLazySharedPointer. + // + assert (QLazySharedPointer () == QLazySharedPointer ()); + assert (QLazySharedPointer () != QLazySharedPointer (c1)); + assert (QLazySharedPointer (c1) != QLazySharedPointer (c2)); + assert (QLazySharedPointer (c2) == QLazySharedPointer (c2)); + + // Persistent QLazySharedPointer. + // + QLazySharedPointer ls1 (*db, 1), ls2 (*db, c2); + assert (ls1 != QLazySharedPointer ()); + assert (ls1 != QLazySharedPointer (c1)); + assert (ls1 == QLazySharedPointer (*db, c1)); + assert (ls1 != ls2); + assert (ls2 == QLazySharedPointer (c2)); + + // Transient QLazyWeakPointer. + // + assert (QLazyWeakPointer () == QLazyWeakPointer ()); + assert (QLazyWeakPointer () != QLazyWeakPointer (c1)); + assert (QLazyWeakPointer (c1) != QLazyWeakPointer (c2)); + assert (QLazyWeakPointer (c2) == QLazyWeakPointer (c2)); + assert (QLazyWeakPointer () == QLazySharedPointer ()); + assert (QLazyWeakPointer () != QLazySharedPointer (c1)); + assert (QLazyWeakPointer (c1) != QLazySharedPointer (c2)); + assert (QLazyWeakPointer (c2) == QLazySharedPointer (c2)); + + // Persistent QLazyWeakPointer. + // + QLazyWeakPointer lw1 (*db, 1), lw2 (*db, c2); + assert (lw1 != QLazyWeakPointer ()); + assert (lw1 != QLazyWeakPointer (c1)); + assert (lw1 == QLazyWeakPointer (*db, c1)); + assert (lw1 != lw2); + assert (lw2 == QLazyWeakPointer (c2)); + assert (ls1 == lw1); + assert (ls1 != QLazyWeakPointer (c1)); + assert (ls1 == QLazyWeakPointer (*db, c1)); + assert (ls1 != lw2); + assert (ls2 == QLazyWeakPointer (c2)); + } + + // Test swap. + // + { + QLazySharedPointer lx (*db, 1), ly; + swap (lx, ly); + + assert (lx.isNull ()); + assert (ly == QLazySharedPointer (*db, c1)); + } + + // Persist. + // + QSharedPointer o1 (new obj (1)); + QSharedPointer o2 (new obj (2)); + QSharedPointer o3 (new obj (3)); + QSharedPointer o4 (new obj (4)); + + o1->c = c1; + o2->c = c1; + o3->c = c2; + o4->c = c2; + + { + transaction t (db->begin ()); + + db->persist (c1); + + db->persist (o1); + db->persist (o2); + db->persist (o3); + db->persist (o4); + + db->persist (c2); + + t.commit (); + } + + // Load. + // + { + session s; + transaction t (db->begin ()); + + QSharedPointer c (db->load (1)); + QSharedPointer o (db->load (1)); + + // Ensure that lazy pointers are present but not loaded. + // + assert (c->o.size () == 2); + assert (!c->o[0].loaded ()); + assert (!c->o[1].loaded ()); + assert (!o->c.loaded ()); + + // Ensure that the correct object IDs were loaded. + // + assert (c->o[0].objectId () == 1); + assert (c->o[1].objectId () == 2); + assert (o->c.objectId () == 1); + + // Load the lazy pointer targets ensuring that the loaded + // targets correspond to the cached session objects. + // + QSharedPointer cl (o->c.load ()); + QSharedPointer ol (c->o[0].load ()); + + assert (c->o[0].loaded ()); + assert (o->c.loaded ()); + + assert (cl == c); + assert (ol == o); + + t.commit (); + } + + // Test lazy weak locking and reloading. + // + { + // No session. + // + transaction t (db->begin ()); + QSharedPointer c (db->load (1)); + + // Lock. + // + assert (!c->o[1].loaded ()); + QLazySharedPointer l (c->o[1].toStrongRef ()); + assert (!l.loaded ()); + assert (l.objectId () == c->o[1].objectId ()); + + // Reload. + // + assert (!c->o[1].loaded ()); + + QSharedPointer ol (c->o[1].load ()); + assert (c->o[1].loaded ()); + + ol.clear (); + assert (!c->o[1].loaded ()); + + ol = c->o[1].load (); + assert (c->o[1].loaded ()); + + t.commit (); + } + + // + // Test QSharedPointer as a value wrapper. + // + + { + obj2 o1 (1); + obj2 o2 (2); + o2.num = QSharedPointer (new unsigned long (123)); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + QSharedPointer o1 (db->load (1)); + QSharedPointer o2 (db->load (2)); + t.commit (); + + assert (!o1->num); + assert (o2->num && *o2->num == 123); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/common/smart-ptr/test.hxx b/odb-tests/qt/common/smart-ptr/test.hxx new file mode 100644 index 0000000..2c8bf36 --- /dev/null +++ b/odb-tests/qt/common/smart-ptr/test.hxx @@ -0,0 +1,77 @@ +// file : qt/common/smart-ptr/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include +#include + +struct obj; + +#pragma db object +struct cont +{ + cont () + { + } + + cont (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + typedef std::vector > obj_list; + + #pragma db inverse(c) value_not_null + obj_list o; +}; + +#pragma db object +struct obj +{ + obj () + { + } + + obj (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db not_null + QLazySharedPointer c; +}; + +// Test QSharedPointer as a value wrapper. +// +#pragma db object +struct obj2 +{ + obj2 () + { + } + + obj2 (unsigned long id) + : id (id) + { + } + + #pragma db id + unsigned long id; + + #pragma db null + QSharedPointer num; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/common/template/driver.cxx b/odb-tests/qt/common/template/driver.cxx new file mode 100644 index 0000000..30f9fc6 --- /dev/null +++ b/odb-tests/qt/common/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/common/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/common/template/template-qt4-vc10.vcxproj b/odb-tests/qt/common/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..fddcac3 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/common/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt4-vc11.vcxproj b/odb-tests/qt/common/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..a71ac6b --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/common/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt4-vc12.vcxproj b/odb-tests/qt/common/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..eaa4d12 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/common/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt4-vc8.vcproj b/odb-tests/qt/common/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..63fc22c --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc8.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/common/template/template-qt4-vc9.vcproj b/odb-tests/qt/common/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..b37675e --- /dev/null +++ b/odb-tests/qt/common/template/template-qt4-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/common/template/template-qt5-vc10.vcxproj b/odb-tests/qt/common/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..add071a --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc10.vcxproj @@ -0,0 +1,177 @@ + + + + + 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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/common/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt5-vc11.vcxproj b/odb-tests/qt/common/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..07daa25 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc11.vcxproj @@ -0,0 +1,181 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/common/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt5-vc12.vcxproj b/odb-tests/qt/common/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..a64ba40 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc12.vcxproj @@ -0,0 +1,185 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + + +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/common/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/common/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..f3ee658 --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__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) +__source_filter_entry__(test-odb.cxx) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/common/template/template-qt5-vc9.vcproj b/odb-tests/qt/common/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..57b4edc --- /dev/null +++ b/odb-tests/qt/common/template/template-qt5-vc9.vcproj @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__source_entry__(test-odb.cxx) +__source_entries__(extra_sources) + + +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/common/template/test.hxx b/odb-tests/qt/common/template/test.hxx new file mode 100644 index 0000000..6f38186 --- /dev/null +++ b/odb-tests/qt/common/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/common/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mssql/basic/driver.cxx b/odb-tests/qt/mssql/basic/driver.cxx new file mode 100644 index 0000000..fca335d --- /dev/null +++ b/odb-tests/qt/mssql/basic/driver.cxx @@ -0,0 +1,65 @@ +// file : qt/mssql/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.id_ = "object 1"; + o.sstr_ = QString (512, 's'); + o.lstr_ = QString (65000, 'l'); // Test temp buffer boundary. + o.snstr_ = QString (512, QChar (0x1234)); + o.lnstr_ = QString (65536, QChar (0x2345)); + o.sbuf_ = QByteArray (512, 0x01); + o.lbuf_ = QByteArray (65536, 0x02); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.id_)); + t.commit (); + + assert (*p == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/mssql/basic/test.hxx b/odb-tests/qt/mssql/basic/test.hxx new file mode 100644 index 0000000..bce87b6 --- /dev/null +++ b/odb-tests/qt/mssql/basic/test.hxx @@ -0,0 +1,46 @@ +// file : qt/mssql/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id_ == x.id_ && + sstr_ == x.sstr_ && + lstr_ == x.lstr_ && + snstr_ == x.snstr_ && + lnstr_ == x.lnstr_ && + sbuf_ == x.sbuf_ && + lbuf_ == x.lbuf_; + } + + #pragma db id + QString id_; + + QString sstr_; + + #pragma db type ("VARCHAR(max)") + QString lstr_; + + #pragma db type ("NVARCHAR(512)") + QString snstr_; + + #pragma db type ("NVARCHAR(max)") + QString lnstr_; + + #pragma db type ("VARBINARY(512)") + QByteArray sbuf_; + + QByteArray lbuf_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mssql/date-time/driver.cxx b/odb-tests/qt/mssql/date-time/driver.cxx new file mode 100644 index 0000000..9b4320e --- /dev/null +++ b/odb-tests/qt/mssql/date-time/driver.cxx @@ -0,0 +1,94 @@ +// file : qt/mssql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. SQL Server version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + QDateTime t (QDateTime::currentDateTime ()); + + o.date = t.date (); + o.date_time = t; +#endif + + // In DATETIME fractional seconds are rounded to .000, .003, or .007. + // + o.date_time_dt = QDateTime (QDate (2012, 1, 14), + QTime (11, 57, 13, 3)); + + // SMALLDATETIME doesn't have seconds (always 0). + // + o.date_time_sdt = QDateTime (QDate (2012, 1, 14), + QTime (11, 57, 0, 0)); + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + o.time = t.time (); +#endif + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/mssql/date-time/test.hxx b/odb-tests/qt/mssql/date-time/test.hxx new file mode 100644 index 0000000..71769b9 --- /dev/null +++ b/odb-tests/qt/mssql/date-time/test.hxx @@ -0,0 +1,68 @@ +// file : qt/mssql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + QDate date; + + QDateTime date_time; +#endif + + #pragma db type ("DATETIME") + QDateTime date_time_dt; + + #pragma db type ("SMALLDATETIME") + QDateTime date_time_sdt; + +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + QTime time; +#endif + + bool + operator== (const object& x) const + { + return + id == x.id +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date == x.date + && date_time == x.date_time +#endif + && date_time_dt == x.date_time_dt + && date_time_sdt == x.date_time_sdt +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && time == x.time +#endif + ; + } + + bool + is_null () const + { + return + true +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && date.isNull () + && date_time.isNull () +#endif + && date_time_dt.isNull () + && date_time_sdt.isNull () +#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 + && time.isNull () +#endif + ; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mssql/template/driver.cxx b/odb-tests/qt/mssql/template/driver.cxx new file mode 100644 index 0000000..97ef6ef --- /dev/null +++ b/odb-tests/qt/mssql/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/mssql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj b/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..e4902d0 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj b/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..b9dd89c --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj b/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..0916a38 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt4-vc8.vcproj b/odb-tests/qt/mssql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..38916fa --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt4-vc9.vcproj b/odb-tests/qt/mssql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..da1b5ab --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj b/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..508e262 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj b/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..a974034 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj b/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..40e2fbb --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mssql/template/template-qt5-vc9.vcproj b/odb-tests/qt/mssql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..66ea9ab --- /dev/null +++ b/odb-tests/qt/mssql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mssql/template/test.hxx b/odb-tests/qt/mssql/template/test.hxx new file mode 100644 index 0000000..033703a --- /dev/null +++ b/odb-tests/qt/mssql/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/mssql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mysql/basic/driver.cxx b/odb-tests/qt/mysql/basic/driver.cxx new file mode 100644 index 0000000..b685d68 --- /dev/null +++ b/odb-tests/qt/mysql/basic/driver.cxx @@ -0,0 +1,60 @@ +// file : qt/mysql/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "Constantin Michael"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.str)); + t.commit (); + + assert (*p == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/mysql/basic/test.hxx b/odb-tests/qt/mysql/basic/test.hxx new file mode 100644 index 0000000..6dd246e --- /dev/null +++ b/odb-tests/qt/mysql/basic/test.hxx @@ -0,0 +1,27 @@ +// file : qt/mysql/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mysql/date-time/driver.cxx b/odb-tests/qt/mysql/date-time/driver.cxx new file mode 100644 index 0000000..94cf653 --- /dev/null +++ b/odb-tests/qt/mysql/date-time/driver.cxx @@ -0,0 +1,178 @@ +// file : qt/mysql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. MySQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +bool +test_out_of_range_value (object&, database&); + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + mysql_version v; + { + transaction t (db->begin ()); + db->query ().begin ().load (v); + t.commit (); + } + + // If we are running against MySQL 5.6.4 or later alter the tables + // to allow sub-second precision. + // + bool fs (v.major > 5 || + (v.major == 5 && (v.minor > 6 || + (v.minor == 6 && v.release >= 4)))); + if (fs) + { + transaction t (db->begin ()); + db->execute ("ALTER TABLE `qt_mysql_dt_object`" \ + " MODIFY COLUMN `date_time` DATETIME(3)," \ + " MODIFY COLUMN `timestamp` TIMESTAMP(3) NULL," \ + " MODIFY COLUMN `time` TIME(3)"); + t.commit (); + } + + // + // Check valid dates and times. + // + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // + + // Create a QDateTime containing the current date and time + // but with the milliseconds zeroed. MySQL prior to 5.6.4 + // does not support sub-second prevision. + // + QDateTime t (QDateTime::currentDateTime ()); + + if (!fs) + t.setTime (QTime (t.time ().hour (), + t.time ().minute (), + t.time ().second ())); + + o.date = t.date (); + o.date_time = t; + o.timestamp = t; + o.time = t.time (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + + // + // Check invalid dates and times. + // + + { + // Test out of range dates. + // + object or1, or2; + or1.date = QDate (999, 12, 31); + or2.date = QDate (10000, 1, 1); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + + { + // Test out of range date-times. + // + object or1, or2; + or1.date_time = QDateTime (QDate (999, 12, 31), QTime (23, 59, 59)); + or2.date_time = QDateTime (QDate (10000, 1, 1)); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + + { + // Test out of range timestamps. + // + object or1, or2; + or1.timestamp = QDateTime (QDate (1970, 1, 1)); + or2.timestamp = QDateTime (QDate (2038, 1, 19), QTime (3, 14, 8)); + + transaction t (db->begin ()); + assert (test_out_of_range_value (or1, *db)); + assert (test_out_of_range_value (or2, *db)); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_out_of_range_value (object& x, database& db) +{ + try + { + db.persist (x); + return false; + } + catch (const odb::qt::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/odb-tests/qt/mysql/date-time/test.hxx b/odb-tests/qt/mysql/date-time/test.hxx new file mode 100644 index 0000000..ba31da5 --- /dev/null +++ b/odb-tests/qt/mysql/date-time/test.hxx @@ -0,0 +1,70 @@ +// file : qt/mysql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + timestamp == x.timestamp && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + timestamp.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QDateTime date_time; + + // Make timestamp NULL-able to suppress the auto-initialization and + // auto-update characteristics of the TIMESTAMP datatype, and to + // allow NULL values. + // + #pragma db type("TIMESTAMP") null + QDateTime timestamp; + + QTime time; +}; + +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/mysql/template/driver.cxx b/odb-tests/qt/mysql/template/driver.cxx new file mode 100644 index 0000000..1e293b4 --- /dev/null +++ b/odb-tests/qt/mysql/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/mysql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj b/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..0f57bbe --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj b/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..33cb785 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj b/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..6a2812a --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt4-vc8.vcproj b/odb-tests/qt/mysql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..25e096f --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt4-vc9.vcproj b/odb-tests/qt/mysql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..a904d40 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj b/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..27eb1a8 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj b/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..7a2e2b9 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj b/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..f75d5d3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/mysql/template/template-qt5-vc9.vcproj b/odb-tests/qt/mysql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..c17267b --- /dev/null +++ b/odb-tests/qt/mysql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/mysql/template/test.hxx b/odb-tests/qt/mysql/template/test.hxx new file mode 100644 index 0000000..94b806d --- /dev/null +++ b/odb-tests/qt/mysql/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/mysql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/oracle/basic/driver.cxx b/odb-tests/qt/oracle/basic/driver.cxx new file mode 100644 index 0000000..43a20e2 --- /dev/null +++ b/odb-tests/qt/oracle/basic/driver.cxx @@ -0,0 +1,81 @@ +// file : qt/oracle/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + string short_str (13, 's'); + string medium_str (150, 'm'); + string long_str (20000, 'v'); + // Oracle UTF-8 support is limited to 3-byte sequences. + // + string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xE2\x82\xAC bcdef"); + + object o; + + o.char_= QString::fromStdString (short_str); + o.varchar2 = QString::fromStdString (medium_str); + o.clob = QString::fromStdString (long_str); + + // fromStdString() assumes ASCII in Qt4 and UTF-8 in Qt5. + // + o.nchar= QString::fromUtf8 (unicode_str.c_str (), + static_cast (unicode_str.size ())); + o.nvarchar2 = QString::fromUtf8 (unicode_str.c_str (), + static_cast (unicode_str.size ())); + o.nclob = QString::fromStdString (long_str); + + o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + o.blob = QByteArray (long_str.c_str (), + static_cast (long_str.size ())); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.varchar2)); + t.commit (); + assert (*p == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/oracle/basic/test.hxx b/odb-tests/qt/oracle/basic/test.hxx new file mode 100644 index 0000000..6781a97 --- /dev/null +++ b/odb-tests/qt/oracle/basic/test.hxx @@ -0,0 +1,51 @@ +// file : qt/oracle/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + varchar2 == x.varchar2 && + char_ == x.char_ && + nchar == x.nchar && + nvarchar2 == x.nvarchar2 && + clob == x.clob && + nclob == x.nclob && + blob == x.blob && + raw == x.raw; + } + + #pragma db id + QString varchar2; + + #pragma db type ("CHAR(13)") + QString char_; + + #pragma db type ("NCHAR(13)") + QString nchar; + + #pragma db type ("NVARCHAR2(512)") + QString nvarchar2; + + #pragma db type ("CLOB") + QString clob; + + #pragma db type ("NCLOB") + QString nclob; + + QByteArray blob; + + #pragma db type ("RAW(128)") + QByteArray raw; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/oracle/date-time/driver.cxx b/odb-tests/qt/oracle/date-time/driver.cxx new file mode 100644 index 0000000..d13fab7 --- /dev/null +++ b/odb-tests/qt/oracle/date-time/driver.cxx @@ -0,0 +1,80 @@ +// file : qt/oracle/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. Oracle version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + + // Check persistence of null values. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + + // Check persistence of valid dates and times. + // + QDateTime t (QDateTime::currentDateTime ()); + + o.date = t.date (); + o.date_time = t; + o.date_time_d = QDateTime (QDate (2012, 6, 27), QTime (14, 17, 05, 0)); + o.time = t.time (); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/oracle/date-time/test.hxx b/odb-tests/qt/oracle/date-time/test.hxx new file mode 100644 index 0000000..93bc5b7 --- /dev/null +++ b/odb-tests/qt/oracle/date-time/test.hxx @@ -0,0 +1,45 @@ +// file : qt/oracle/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + date_time_d == x.date_time_d && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + date_time_d.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QDateTime date_time; + #pragma db type("DATE") + QDateTime date_time_d; + QTime time; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/oracle/template/driver.cxx b/odb-tests/qt/oracle/template/driver.cxx new file mode 100644 index 0000000..9b092a9 --- /dev/null +++ b/odb-tests/qt/oracle/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/oracle/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj b/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..6e7c369 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj b/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..ad1e888 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj b/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..88dffa8 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt4-vc8.vcproj b/odb-tests/qt/oracle/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..187254b --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt4-vc9.vcproj b/odb-tests/qt/oracle/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..292b899 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj b/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..c388d6b --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj b/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..79d5d15 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj b/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..2ae82a6 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/oracle/template/template-qt5-vc9.vcproj b/odb-tests/qt/oracle/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..2712157 --- /dev/null +++ b/odb-tests/qt/oracle/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/oracle/template/test.hxx b/odb-tests/qt/oracle/template/test.hxx new file mode 100644 index 0000000..0ad65cf --- /dev/null +++ b/odb-tests/qt/oracle/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/oracle/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/pgsql/basic/driver.cxx b/odb-tests/qt/pgsql/basic/driver.cxx new file mode 100644 index 0000000..4c6a78a --- /dev/null +++ b/odb-tests/qt/pgsql/basic/driver.cxx @@ -0,0 +1,60 @@ +// file : qt/pgsql/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = "Constantin Michael"; + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.str)); + t.commit (); + + assert (*p == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/pgsql/basic/test.hxx b/odb-tests/qt/pgsql/basic/test.hxx new file mode 100644 index 0000000..d4a1ba6 --- /dev/null +++ b/odb-tests/qt/pgsql/basic/test.hxx @@ -0,0 +1,27 @@ +// file : qt/pgsql/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/pgsql/date-time/driver.cxx b/odb-tests/qt/pgsql/date-time/driver.cxx new file mode 100644 index 0000000..43a676d --- /dev/null +++ b/odb-tests/qt/pgsql/date-time/driver.cxx @@ -0,0 +1,108 @@ +// file : qt/pgsql/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. PostgreSQL version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +bool +test_out_of_range_value (object&, database&); + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + // Check persistence of null values. + // + { + object o; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (ol->is_null ()); + } + } + + // Check persistence of valid dates and times. + // + { + QDateTime ct (QDateTime::currentDateTime ()); + + object o; + o.date = ct.date (); + o.time = ct.time (); + o.date_time = ct; + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + + // Test a QDateTime value before PG epoch. + // + { + object o; + o.date_time = QDateTime (QDate (1969, 12, 31), QTime (23, 59, 59, 123)); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol (db->load (o.id)); + t.commit (); + + assert (*ol == o); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/pgsql/date-time/test.hxx b/odb-tests/qt/pgsql/date-time/test.hxx new file mode 100644 index 0000000..2da5587 --- /dev/null +++ b/odb-tests/qt/pgsql/date-time/test.hxx @@ -0,0 +1,43 @@ +// file : qt/pgsql/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + time == x.time && + date_time == x.date_time; + } + + bool + is_null () const + { + return + date.isNull () && + time.isNull () && + date_time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + QTime time; + QDateTime date_time; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/pgsql/template/driver.cxx b/odb-tests/qt/pgsql/template/driver.cxx new file mode 100644 index 0000000..71934a7 --- /dev/null +++ b/odb-tests/qt/pgsql/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/pgsql/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj b/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..1c1e1a7 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj b/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..a7e7a86 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj b/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..f1b9924 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc8.vcproj b/odb-tests/qt/pgsql/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..3f364d2 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt4-vc9.vcproj b/odb-tests/qt/pgsql/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..2e9e84b --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj b/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..cb6aa0c --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj b/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..863bd51 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj b/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..5d958c2 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/pgsql/template/template-qt5-vc9.vcproj b/odb-tests/qt/pgsql/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..b32a1e7 --- /dev/null +++ b/odb-tests/qt/pgsql/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/pgsql/template/test.hxx b/odb-tests/qt/pgsql/template/test.hxx new file mode 100644 index 0000000..8b866bd --- /dev/null +++ b/odb-tests/qt/pgsql/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/pgsql/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/sqlite/basic/driver.cxx b/odb-tests/qt/sqlite/basic/driver.cxx new file mode 100644 index 0000000..3bae10b --- /dev/null +++ b/odb-tests/qt/sqlite/basic/driver.cxx @@ -0,0 +1,60 @@ +// file : qt/sqlite/basic/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt basic type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + object o; + o.str = QString::fromUtf8 ("Constantin Micha\xC3\x88l"); + o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + auto_ptr p (db->load (o.str)); + t.commit (); + + assert (*p == o); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/sqlite/basic/test.hxx b/odb-tests/qt/sqlite/basic/test.hxx new file mode 100644 index 0000000..b0cdf46 --- /dev/null +++ b/odb-tests/qt/sqlite/basic/test.hxx @@ -0,0 +1,27 @@ +// file : qt/sqlite/basic/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + str == x.str && + blob == x.blob; + } + + #pragma db id + QString str; + + QByteArray blob; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/sqlite/date-time/driver.cxx b/odb-tests/qt/sqlite/date-time/driver.cxx new file mode 100644 index 0000000..adf7889 --- /dev/null +++ b/odb-tests/qt/sqlite/date-time/driver.cxx @@ -0,0 +1,140 @@ +// file : qt/sqlite/date-time/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test Qt date/time type persistence. SQLite version. +// + +#include // std::auto_ptr +#include +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +bool +test_out_of_range_value (object&, database&); + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + // Check persistence of null values. + // + object o1; + { + transaction t (db->begin ()); + db->persist (o1); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol1 (db->load (o1.id)); + t.commit (); + + assert (ol1->is_null ()); + } + + QDateTime ct (QDateTime::currentDateTime ()); + QDateTime ct_no_ms = QDateTime (QDate (ct.date ().year (), + ct.date ().month (), + ct.date ().day ()), + QTime (ct.time ().hour (), + ct.time ().minute (), + ct.time ().second ())); + + // Check persistence of valid dates and times. + // + object o2; + { + o2.date = ct.date (); + o2.unix_day = ct.date (); + o2.time = ct.time (); + + // QTime stored as SQLite INTEGER has second resolution. + // The millsecond part is zeroed to avoid false negatives. + // + o2.seconds = ct_no_ms.time (); + + o2.date_time = ct; + + // UNIX time has second reolution. The millsecond part is + // zeroed to avoid false negatives. + // + o2.unix_time = ct_no_ms; + + transaction t (db->begin ()); + db->persist (o2); + t.commit (); + } + + { + transaction t (db->begin ()); + auto_ptr ol2 (db->load (o2.id)); + t.commit (); + + assert (*ol2 == o2); + } + + // Test out of range values for QDateTime traits UNIX time + // implementation. + // + { + object o; + o.unix_time = QDateTime (QDate (1969, 12, 31), + QTime (23, 59, 59), + Qt::UTC); + + assert (test_out_of_range_value (o, *db)); + } + + // Test out of range values for QDate traits UNIX time + // implementation. + // + { + object o; + o.unix_day = QDate (QDate (1969, 12, 31)); + + assert (test_out_of_range_value (o, *db)); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} + +bool +test_out_of_range_value (object& x, database& db) +{ + try + { + transaction t (db.begin ()); + db.persist (x); + t.rollback (); + + return false; + } + catch (const odb::qt::date_time::value_out_of_range&) + { + } + + return true; +} diff --git a/odb-tests/qt/sqlite/date-time/test.hxx b/odb-tests/qt/sqlite/date-time/test.hxx new file mode 100644 index 0000000..9795846 --- /dev/null +++ b/odb-tests/qt/sqlite/date-time/test.hxx @@ -0,0 +1,60 @@ +// file : qt/sqlite/date-time/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include + +#include + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + unix_day == x.unix_day && + time == x.time && + seconds == x.seconds && + date_time == x.date_time && + unix_time == x.unix_time; + } + + bool + is_null () const + { + return + date.isNull () && + unix_day.isNull () && + time.isNull () && + seconds.isNull () && + date_time.isNull () && + unix_time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + + #pragma db type ("INTEGER") + QDate unix_day; + + QTime time; + + #pragma db type ("INTEGER") + QTime seconds; + + QDateTime date_time; + + #pragma db type ("INTEGER") + QDateTime unix_time; +}; + +#endif // TEST_HXX diff --git a/odb-tests/qt/sqlite/template/driver.cxx b/odb-tests/qt/sqlite/template/driver.cxx new file mode 100644 index 0000000..dc1181c --- /dev/null +++ b/odb-tests/qt/sqlite/template/driver.cxx @@ -0,0 +1,43 @@ +// file : qt/sqlite/template/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// PLACE TEST DESCRIPTION HERE +// + +#include // std::auto_ptr +#include +#include + +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +using namespace std; +using namespace odb::core; + +int +main (int argc, char* argv[]) +{ + QCoreApplication app (argc, argv); + + try + { + auto_ptr db (create_database (argc, argv)); + + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj b/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj new file mode 100644 index 0000000..5d4cd02 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj b/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj new file mode 100644 index 0000000..217b75e --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj b/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj new file mode 100644 index 0000000..43959de --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc8.vcproj b/odb-tests/qt/sqlite/template/template-qt4-vc8.vcproj new file mode 100644 index 0000000..16623a8 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc8.vcproj @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt4-vc9.vcproj b/odb-tests/qt/sqlite/template/template-qt4-vc9.vcproj new file mode 100644 index 0000000..b52f2ec --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt4-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj b/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj new file mode 100644 index 0000000..b0f2c28 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj b/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj new file mode 100644 index 0000000..d0ca5d9 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v110 + Unicode + + + Application + true + v110 + Unicode + + + Application + false + v110 + true + Unicode + + + Application + false + v110 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc11.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj b/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj new file mode 100644 index 0000000..dc303a6 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + v120 + Unicode + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + $(SolutionDir)\..\..\libcommon + 4068;4355;4800;4290;%(DisableSpecificWarnings) + true + + + $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) + Console + true + true + true + + +__ifelse__(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +__ifelse__(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj.filters b/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj.filters new file mode 100644 index 0000000..8ac18a3 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc12.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +__ifelse__(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/odb-tests/qt/sqlite/template/template-qt5-vc9.vcproj b/odb-tests/qt/sqlite/template/template-qt5-vc9.vcproj new file mode 100644 index 0000000..79c9389 --- /dev/null +++ b/odb-tests/qt/sqlite/template/template-qt5-vc9.vcproj @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +__ifelse__(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/odb-tests/qt/sqlite/template/test.hxx b/odb-tests/qt/sqlite/template/test.hxx new file mode 100644 index 0000000..1a8d616 --- /dev/null +++ b/odb-tests/qt/sqlite/template/test.hxx @@ -0,0 +1,25 @@ +// file : qt/sqlite/template/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite.testscript b/odb-tests/sqlite.testscript new file mode 100644 index 0000000..986bb37 --- /dev/null +++ b/odb-tests/sqlite.testscript @@ -0,0 +1,10 @@ +# file : sqlite.testscript +# license : GNU GPL v2; see accompanying LICENSE file + +# Setup the test driver command line for the subsequent SQLite tests. +# +# Note that for SQLite the schema is created implicitly by the database object +# creation function called by the test driver. +# +test.arguments += ($multi ? 'sqlite' : ) $sqlite_options +test.cleanups += &odb-test.db # See database-options.testscript for details. diff --git a/odb-tests/sqlite/attach/buildfile b/odb-tests/sqlite/attach/buildfile new file mode 100644 index 0000000..959f050 --- /dev/null +++ b/odb-tests/sqlite/attach/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/attach/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_attach_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --schema main + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/attach/driver.cxx b/odb-tests/sqlite/attach/driver.cxx new file mode 100644 index 0000000..25d279f --- /dev/null +++ b/odb-tests/sqlite/attach/driver.cxx @@ -0,0 +1,109 @@ +// file : sqlite/attach/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test attached database support. +// + +#include // std::unique_ptr +#include + +#include + +#include +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr mdb (create_specific_database (argc, argv)); + + { + object o ("one"); + + connection_ptr c (mdb->connection ()); + + database adb (c, ":memory:", "adb"); + + // Create schema similar to create_database(). + // + { + c->execute ("PRAGMA foreign_keys=OFF"); + + transaction t (c->begin ()); + odb::schema_catalog::create_schema (adb); + t.commit (); + + c->execute ("PRAGMA foreign_keys=ON"); + } + + { + transaction t (c->begin ()); + mdb->persist (o); + adb.persist (o); + t.commit (); + } + + { + transaction t (c->begin ()); + unique_ptr p (adb.load (o.id)); + t.commit (); + + assert (p->str == o.str); + } + + { + o.str = "two"; + + transaction t (c->begin ()); + adb.update (o); + t.commit (); + } + + { + typedef sqlite::query query; + + transaction t (c->begin ()); + unique_ptr p (adb.query_one (query::str == "two")); + t.commit (); + + assert (p->str == o.str); + } + + { + transaction t (c->begin ()); + adb.erase (o); + t.commit (); + } + + { + transaction t (c->begin ()); + unique_ptr p (mdb->load (o.id)); + t.commit (); + + assert (p.get () != 0); + } + + adb.detach (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/attach/test.hxx b/odb-tests/sqlite/attach/test.hxx new file mode 100644 index 0000000..b3b8f63 --- /dev/null +++ b/odb-tests/sqlite/attach/test.hxx @@ -0,0 +1,32 @@ +// file : sqlite/attach/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#include + +#pragma db object +struct object +{ + explicit + object (const std::string& s): str (s) {} + + #pragma db id auto + unsigned long id; + + #pragma db unique + std::string str; + +private: + object () {} + + friend class odb::access; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/attach/testscript b/odb-tests/sqlite/attach/testscript new file mode 100644 index 0000000..db5089d --- /dev/null +++ b/odb-tests/sqlite/attach/testscript @@ -0,0 +1,9 @@ +# file : sqlite/attach/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/auto/buildfile b/odb-tests/sqlite/auto/buildfile new file mode 100644 index 0000000..2c70b7c --- /dev/null +++ b/odb-tests/sqlite/auto/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/auto/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_auto_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --sqlite-lax-auto-id + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/auto/driver.cxx b/odb-tests/sqlite/auto/driver.cxx new file mode 100644 index 0000000..bcd42c1 --- /dev/null +++ b/odb-tests/sqlite/auto/driver.cxx @@ -0,0 +1,76 @@ +// file : sqlite/auto/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test manual/automatic id assignment. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + // object + // + { + unsigned long id1, id2, id3; + { + object o1 (1, "one"); + object o2 ("two"); + object o3 (3, "three"); + + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + + id1 = *o1.id_; + id2 = *o2.id_; + id3 = *o3.id_; + + assert (id1 == 1); + assert (id3 == 3); + + assert (id2 != id1); + assert (id2 != id3); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (id1)); + unique_ptr o2 (db->load (id2)); + unique_ptr o3 (db->load (id3)); + t.commit (); + + assert (*o1->id_ == id1 && o1->str_ == "one"); + assert (*o2->id_ == id2 && o2->str_ == "two"); + assert (*o3->id_ == id3 && o3->str_ == "three"); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/auto/test.hxx b/odb-tests/sqlite/auto/test.hxx new file mode 100644 index 0000000..9905182 --- /dev/null +++ b/odb-tests/sqlite/auto/test.hxx @@ -0,0 +1,32 @@ +// file : sqlite/auto/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +#include + +#pragma db object +struct object +{ + explicit + object (const std::string& str): str_ (str) {} + object (unsigned long id, const std::string& str): id_ (id), str_ (str) {} + + #pragma db auto id + odb::nullable id_; + + std::string str_; + +private: + object () {} + + friend class odb::access; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/auto/testscript b/odb-tests/sqlite/auto/testscript new file mode 100644 index 0000000..a5a7da5 --- /dev/null +++ b/odb-tests/sqlite/auto/testscript @@ -0,0 +1,9 @@ +# file : sqlite/auto/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/custom/buildfile b/odb-tests/sqlite/custom/buildfile new file mode 100644 index 0000000..3325762 --- /dev/null +++ b/odb-tests/sqlite/custom/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_custom_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/custom/driver.cxx b/odb-tests/sqlite/custom/driver.cxx new file mode 100644 index 0000000..0627708 --- /dev/null +++ b/odb-tests/sqlite/custom/driver.cxx @@ -0,0 +1,78 @@ +// file : sqlite/custom/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test custom database type mapping in SQLite. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + object o (1); + o.nv.push_back ("123"); // INTEGER + o.nv.push_back ("1.23"); // REAL + o.nv.push_back ("abc"); // TEXT + + // Persist. + // + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + // Load. + // + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + + // Update. + // + o.nv[1] += "4"; + + { + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/custom/test.hxx b/odb-tests/sqlite/custom/test.hxx new file mode 100644 index 0000000..54a2ba3 --- /dev/null +++ b/odb-tests/sqlite/custom/test.hxx @@ -0,0 +1,39 @@ +// file : sqlite/custom/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#include + +// Map NUMERIC SQLite type to std::string (or any other type that +// provides the value_traits specialization). By +// default ODB treats NUMERIC as REAL. Note also that we don't +// need to specify to/from conversions since SQLite will convert +// implicitly. +// +#pragma db map type("NUMERIC") as("TEXT") + +#pragma db object +struct object +{ + object () {} + object (unsigned long id_): id (id_) {} + + #pragma db id + unsigned long id; + + #pragma db value_type("NUMERIC") + std::vector nv; + + bool + operator== (const object& y) const + { + return id == y.id && nv == y.nv; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/custom/testscript b/odb-tests/sqlite/custom/testscript new file mode 100644 index 0000000..53561ae --- /dev/null +++ b/odb-tests/sqlite/custom/testscript @@ -0,0 +1,9 @@ +# file : sqlite/custom/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/database/buildfile b/odb-tests/sqlite/database/buildfile new file mode 100644 index 0000000..e74ab1a --- /dev/null +++ b/odb-tests/sqlite/database/buildfile @@ -0,0 +1,11 @@ +# file : sqlite/database/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/database/driver.cxx b/odb-tests/sqlite/database/driver.cxx new file mode 100644 index 0000000..5e16653 --- /dev/null +++ b/odb-tests/sqlite/database/driver.cxx @@ -0,0 +1,40 @@ +// file : sqlite/database/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test that database constructors are unambiguous and some other things. +// + +#include + +#undef NDEBUG +#include + +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + // Test UTF-16 to UTF-8 conversion. + // +#ifdef _WIN32 + { + database d (L"t\x00C8st"); + assert (d.name () == "t\xC3\x88st"); + } +#endif + + // This code should not execute. + // + if (argc != 0) + return 0; + + { + database d1 ("db1"); + } + + { + database d1 (argc, argv); + database d2 (argc, argv, false); + } +} diff --git a/odb-tests/sqlite/database/testscript b/odb-tests/sqlite/database/testscript new file mode 100644 index 0000000..b9c0f5f --- /dev/null +++ b/odb-tests/sqlite/database/testscript @@ -0,0 +1,6 @@ +# file : sqlite/database/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +: basics +: +$* diff --git a/odb-tests/sqlite/native/buildfile b/odb-tests/sqlite/native/buildfile new file mode 100644 index 0000000..49aa05b --- /dev/null +++ b/odb-tests/sqlite/native/buildfile @@ -0,0 +1,12 @@ +# file : sqlite/native/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{*} $libs testscript + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/native/driver.cxx b/odb-tests/sqlite/native/driver.cxx new file mode 100644 index 0000000..c87aa5d --- /dev/null +++ b/odb-tests/sqlite/native/driver.cxx @@ -0,0 +1,74 @@ +// file : sqlite/native/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test native SQL execution. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db ( + create_specific_database (argc, argv, false)); + + // Create the database schema. + // + { + transaction t (db->begin ()); + + db->execute ("DROP TABLE IF EXISTS sqlitex_native_test"); + db->execute ("CREATE TABLE sqlitex_native_test (n INTEGER PRIMARY KEY)"); + + t.commit (); + } + + // Insert a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (1)") == 1); + + assert ( + db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (2)") == 1); + + t.commit (); + } + + // Select a few rows. + // + { + transaction t (db->begin ()); + + assert ( + db->execute ("SELECT n FROM sqlitex_native_test WHERE n < 3") == 2); + + assert ( + db->execute ("SELECT n FROM sqlitex_native_test WHERE n > 3") == 0); + + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/native/testscript b/odb-tests/sqlite/native/testscript new file mode 100644 index 0000000..16f05e0 --- /dev/null +++ b/odb-tests/sqlite/native/testscript @@ -0,0 +1,9 @@ +# file : sqlite/native/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/stream/buildfile b/odb-tests/sqlite/stream/buildfile new file mode 100644 index 0000000..fb8f605 --- /dev/null +++ b/odb-tests/sqlite/stream/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/stream/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} +import libodb_sqlite = libodb-sqlite%lib{odb-sqlite} +import libs = lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb and +# libodb-sqlite libraries are resolved for the odb_compile ad hoc rule (see +# build/root.build for details). +# +libue{test-meta}: $libodb $libodb_sqlite + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_stream_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/stream/driver.cxx b/odb-tests/sqlite/stream/driver.cxx new file mode 100644 index 0000000..86522ec --- /dev/null +++ b/odb-tests/sqlite/stream/driver.cxx @@ -0,0 +1,281 @@ +// file : sqlite/stream/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQLite BLOB/TEXT incremental I/O. +// + +#include +#include // std::unique_ptr +#include + +#include +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +template +void +print (const S&) +{ + /* + cerr << s.db () << '.' + << s.table () << '.' + << s.column () << '#' + << s.rowid () << endl; + */ +} + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + string txt (1024 * 1024, 't'); + vector blb (1024 * 1024, 'b'); + + object o; + + { + transaction tx (db->begin ()); + + o.t.size (txt.size ()); + o.b.size (blb.size ()); + o.bv.push_back (blob (blb.size ())); + o.bv.push_back (blob (blb.size ())); + + db->persist (o); + + print (o.t); + print (o.b); + print (o.bv[0]); + print (o.bv[1]); + + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + + for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) + { + blob_stream bs (*i, true); + bs.write (blb.data (), blb.size ()); + } + + tx.commit (); + } + + { + transaction tx (db->begin ()); + unique_ptr p (db->load (o.id)); + + print (p->t); + print (p->b); + print (p->bv[0]); + print (p->bv[1]); + + text_stream ts (p->t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + + blob_stream bs (p->b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) + { + blob_stream bs (*i, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + assert (p->nb.null ()); + + tx.commit (); + } + + txt.resize (txt.size () + 1, 't'); + txt[0] = 'A'; + txt[txt.size () - 1] = 'Z'; + + blb.resize (blb.size () - 1); + blb.front () = 'A'; + blb.back () = 'Z'; + + { + transaction tx (db->begin ()); + + o.t.clear (); + o.t.size (txt.size ()); + + o.b.clear (); + o.b.size (blb.size ()); + + o.bv[0].clear (); + o.bv[0].size (blb.size ()); + + o.bv[1].clear (); + o.bv[1].size (blb.size ()); + + o.nb = blob (blb.size ()); + + db->update (o); + + print (o.t); + print (o.b); + print (o.bv[0]); + print (o.bv[1]); + print (*o.nb); + + { + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + } + + { + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + } + + for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) + { + blob_stream bs (*i, true); + bs.write (blb.data (), blb.size ()); + } + + { + blob_stream bs (*o.nb, true); + bs.write (blb.data (), blb.size ()); + } + + tx.commit (); + } + + { + transaction tx (db->begin ()); + unique_ptr p (db->load (o.id)); + + print (p->t); + print (p->b); + print (p->bv[0]); + print (p->bv[1]); + print (*p->nb); + + text_stream ts (p->t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + + blob_stream bs (p->b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) + { + blob_stream bs (*i, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + { + blob_stream bs (*p->nb, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + tx.commit (); + } + + // Test query. + // + + txt.resize (32); + blb.resize (64); + + { + transaction tx (db->begin ()); + + o.t.size (txt.size ()); + o.b.size (blb.size ()); + o.bv.clear (); + o.nb.reset (); + + db->update (o); + + text_stream ts (o.t, true); + ts.write (txt.data (), txt.size ()); + + blob_stream bs (o.b, true); + bs.write (blb.data (), blb.size ()); + + tx.commit (); + } + + { + typedef sqlite::query query; + transaction tx (db->begin ()); + + { + object o1 (db->query_value (query::t == txt)); + + blob_stream bs (o1.b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + } + + { + object o1 (db->query_value (query::b == blb)); + + text_stream ts (o1.t, false); + string t (ts.size (), '*'); + ts.read (const_cast (t.c_str ()), t.size ()); + assert (t == txt); + } + + tx.commit (); + } + + // Test view. + // + { + typedef sqlite::query query; + transaction tx (db->begin ()); + + view v (db->query_value (query::t == txt)); + + blob_stream bs (v.b, false); + vector b (bs.size (), '\0'); + bs.read (b.data (), b.size ()); + assert (b == blb); + + tx.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/stream/test.hxx b/odb-tests/sqlite/stream/test.hxx new file mode 100644 index 0000000..9189a87 --- /dev/null +++ b/odb-tests/sqlite/stream/test.hxx @@ -0,0 +1,37 @@ +// file : sqlite/stream/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#include +#include + +#include +#include + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; + + odb::sqlite::text t; + + #pragma db column("_123foo_bar") + odb::sqlite::blob b; + + std::vector bv; + + odb::nullable nb; +}; + +#pragma db view object(object) +struct view +{ + odb::sqlite::blob b; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/stream/testscript b/odb-tests/sqlite/stream/testscript new file mode 100644 index 0000000..2b9f019 --- /dev/null +++ b/odb-tests/sqlite/stream/testscript @@ -0,0 +1,9 @@ +# file : sqlite/stream/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/transaction/buildfile b/odb-tests/sqlite/transaction/buildfile new file mode 100644 index 0000000..e29092d --- /dev/null +++ b/odb-tests/sqlite/transaction/buildfile @@ -0,0 +1,30 @@ +# file : sqlite/transaction/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_transaction_ \ + --generate-schema \ + --default-database common + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/transaction/driver.cxx b/odb-tests/sqlite/transaction/driver.cxx new file mode 100644 index 0000000..80a0804 --- /dev/null +++ b/odb-tests/sqlite/transaction/driver.cxx @@ -0,0 +1,61 @@ +// file : sqlite/transaction/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test esoteric SQLite transaction semantics aspects. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + // In SQLite, when a commit fails because of the deferred foreign + // key constraint violation, the transaction is not automatically + // rolled back. Make sure we compensate for that. + // + try + { + object o; + o.p = odb::lazy_ptr (*db, 0); + + transaction t (db->begin ()); + db->persist(o); + t.commit (); + } + catch (const odb::exception&) + { + } + + // Make sure we can start a new transaction. + // + { + transaction t (db->begin ()); + t.commit (); + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/transaction/test.hxx b/odb-tests/sqlite/transaction/test.hxx new file mode 100644 index 0000000..bfb981b --- /dev/null +++ b/odb-tests/sqlite/transaction/test.hxx @@ -0,0 +1,26 @@ +// file : sqlite/transaction/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object +struct object1 +{ + #pragma db id + unsigned long id_; +}; + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id_; + + odb::lazy_ptr p; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/transaction/testscript b/odb-tests/sqlite/transaction/testscript new file mode 100644 index 0000000..c3388cb --- /dev/null +++ b/odb-tests/sqlite/transaction/testscript @@ -0,0 +1,9 @@ +# file : sqlite/transaction/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/truncation/buildfile b/odb-tests/sqlite/truncation/buildfile new file mode 100644 index 0000000..9a014e6 --- /dev/null +++ b/odb-tests/sqlite/truncation/buildfile @@ -0,0 +1,31 @@ +# file : sqlite/truncation/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_truncation_ \ + --generate-schema \ + --default-database common \ + --generate-query + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/truncation/driver.cxx b/odb-tests/sqlite/truncation/driver.cxx new file mode 100644 index 0000000..a2f6d66 --- /dev/null +++ b/odb-tests/sqlite/truncation/driver.cxx @@ -0,0 +1,163 @@ +// file : sqlite/truncation/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test insufficient buffer/truncation handling. +// + +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + // The default pre-allocated buffer is 512 bytes long. + // + string long_str (640, 'c'); // This will get the buffer to 1024 + string longer_str (1025, 'b'); + + try + { + // Test basic operations. + // + { + unique_ptr db (create_specific_database (argc, argv)); + + // Run persist/load so that the initial bindings are established + // (version == 0). + // + { + object1 o (1); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (1, o); + t.commit (); + } + + { + object2 o (2); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + db->load (2, o); + t.commit (); + } + + // Store/load the long string which should trigger buffer growth. + // + { + object1 o (3); + o.str_ = long_str; + + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == long_str); + t.commit (); + } + + // Store/load longer string. + // + { + object1 o (3); + o.str_ = longer_str; + + transaction t (db->begin ()); + db->update (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o (db->load (3)); + assert (o->str_ == longer_str); + t.commit (); + } + } + + // Test query. + // + { + unique_ptr db (create_specific_database (argc, argv)); + + typedef sqlite::query query; + typedef odb::result result; + + // Run persist/query so that the initial bindings are established + // (version == 0). + // + { + object1 o (20); + o.str_ = "test string"; + + transaction t (db->begin ()); + db->persist (o); + o.id_++; + db->persist (o); + o.id_++; + db->persist (o); + + result r (db->query (query::id == 20)); + assert (r.begin ()->id_ == 20); + t.commit (); + } + + // Test buffer growth with cached result. + // + { + object1 o; + + transaction t (db->begin ()); + + result r (db->query (query::id >= 20)); + result::iterator i (r.begin ()); + + o.id_ = i->id_; + o.str_ = long_str; + + // This forces buffer growth in the middle of result iteration. + // + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + o.id_ = i->id_; + o.str_ = longer_str; + db->update (o); + + ++i; + assert (i->str_ == "test string"); + + t.commit (); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/truncation/test.hxx b/odb-tests/sqlite/truncation/test.hxx new file mode 100644 index 0000000..8ca44ea --- /dev/null +++ b/odb-tests/sqlite/truncation/test.hxx @@ -0,0 +1,46 @@ +// file : sqlite/truncation/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include + +#pragma db object table ("test") +struct object1 +{ + object1 (unsigned long id) + : id_ (id) + { + } + + object1 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#pragma db object table ("test") +struct object2 +{ + object2 (unsigned long id) + : id_ (id) + { + } + + object2 () + { + } + + #pragma db id + unsigned long id_; + + std::string str_; +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/truncation/testscript b/odb-tests/sqlite/truncation/testscript new file mode 100644 index 0000000..97e04f7 --- /dev/null +++ b/odb-tests/sqlite/truncation/testscript @@ -0,0 +1,9 @@ +# file : sqlite/truncation/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/types/buildfile b/odb-tests/sqlite/types/buildfile new file mode 100644 index 0000000..1bf719d --- /dev/null +++ b/odb-tests/sqlite/types/buildfile @@ -0,0 +1,32 @@ +# file : sqlite/types/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ +"sqlite should be configured via config.odb_tests.database variable as a single database" + +import libodb = libodb%lib{odb} + +import libs = libodb-sqlite%lib{odb-sqlite} +import libs += lib{common} + +exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript + +# Introduce the metadata library target to make sure the libodb library is +# resolved for the odb_compile ad hoc rule (see build/root.build for details). +# +libue{test-meta}: $libodb + +<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} + +exe{driver}: libue{test-meta} $libs + +# Specify the ODB custom options to be used by the odb_compile ad hoc rule +# (see build/root.build for details). +# +odb_options = --table-prefix sqlitex_types_ \ + --generate-schema \ + --default-database common \ + --generate-query \ + --cxx-prologue '#include "traits.hxx"' + +cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/odb-tests/sqlite/types/driver.cxx b/odb-tests/sqlite/types/driver.cxx new file mode 100644 index 0000000..b444d94 --- /dev/null +++ b/odb-tests/sqlite/types/driver.cxx @@ -0,0 +1,113 @@ +// file : sqlite/types/driver.cxx +// license : GNU GPL v2; see accompanying LICENSE file + +// Test SQLite type conversion. +// + +#include // std::numeric_limits +#include // std::unique_ptr +#include + +#include +#include + +#include + +#include "test.hxx" +#include "test-odb.hxx" + +#undef NDEBUG +#include + +using namespace std; +namespace sqlite = odb::sqlite; +using namespace sqlite; + +int +main (int argc, char* argv[]) +{ + try + { + unique_ptr db (create_specific_database (argc, argv)); + + object o (1); + + o.bool_ = true; + o.integer_ = -123456; + o.real_ = 1.123; + o.nan_ = numeric_limits::quiet_NaN (); + + string long_str (2040, 'l'); + + o.text_ = long_str; +#ifdef _WIN32 + o.wtext_ = L"t\x00C8st string"; +#endif + o.blob_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr o1 (db->load (1)); + t.commit (); + + assert (o == *o1); + } + +#ifdef _WIN32 + { + typedef sqlite::query query; + typedef odb::result result; + + transaction t (db->begin ()); + result r (db->query (query::wtext == L"t\x00C8st string")); + assert (!r.empty ()); + t.commit (); + } +#endif + + // Test char/wchar_t arrays + // + { +#ifndef _WIN32 + char_array o1 (1, ""); + char_array o2 (2, "1234567890"); + char_array o3 (3, "12345678901234567"); +#else + char_array o1 (1, "", L""); + char_array o2 (2, "1234567890", L"123456789\x00C8"); + char_array o3 (3, "12345678901234567", L"1234567890123456\x00C8"); +#endif + + { + transaction t (db->begin ()); + db->persist (o1); + db->persist (o2); + db->persist (o3); + t.commit (); + } + + { + transaction t (db->begin ()); + unique_ptr p1 (db->load (1)); + unique_ptr p2 (db->load (2)); + unique_ptr p3 (db->load (3)); + t.commit (); + + assert (o1 == *p1); + assert (o2 == *p2); + assert (o3 == *p3); + } + } + } + catch (const odb::exception& e) + { + cerr << e.what () << endl; + return 1; + } +} diff --git a/odb-tests/sqlite/types/test.hxx b/odb-tests/sqlite/types/test.hxx new file mode 100644 index 0000000..fe0b274 --- /dev/null +++ b/odb-tests/sqlite/types/test.hxx @@ -0,0 +1,125 @@ +// file : sqlite/types/test.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include +#include +#include +#include // std::unique_ptr +#include // std::memcpy, std::str[n]cmp, std::strlen + +#ifdef _WIN32 +# include // std::wcslen, std::wcs[n]cmp +#endif + +#include + +typedef std::unique_ptr string_ptr; + +#pragma db object +struct object +{ + object () {} + object (unsigned long id): id_ (id) {} + + #pragma db id + unsigned long id_; + + #pragma db type("BOOL") + bool bool_; + + #pragma db type("INTEGER") + int integer_; + + #pragma db type("REAL") + double real_; + + double nan_; // Represented in SQLite as NULL. + + #pragma db type("TEXT") + std::string text_; + +#ifdef _WIN32 + std::wstring wtext_; +#endif + + #pragma db type("BLOB") + std::vector blob_; + + // Test NULL value. + // + #pragma db type("TEXT") null + string_ptr null_; + + bool + operator== (const object& y) const + { + return id_ == y.id_ + && bool_ == y.bool_ + && integer_ == y.integer_ + && real_ == y.real_ + && nan_ != nan_ + && text_ == y.text_ +#ifdef _WIN32 + && wtext_ == y.wtext_ +#endif + && blob_ == y.blob_ + && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); + } +}; + +// Test char/wchar_t arrays. +// +#pragma db object +struct char_array +{ + char_array () {} + char_array (unsigned long id + , const char* s +#ifdef _WIN32 + , const wchar_t* ws +#endif + ) + : id_ (id) + { + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + s2[0] = c1 = *s; + +#ifdef _WIN32 + std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); + ws2[0] = wc1 = *ws; +#endif + } + + #pragma db id + unsigned long id_; + + char s1[17]; + char s2[1]; + char c1; + +#ifdef _WIN32 + wchar_t ws1[17]; + wchar_t ws2[1]; + wchar_t wc1; +#endif + + bool + operator== (const char_array& y) const + { + return id_ == y.id_ + && std::strncmp (s1, y.s1, sizeof (s1)) == 0 + && s2[0] == y.s2[0] + && c1 == y.c1 +#ifdef _WIN32 + && std::wcsncmp (ws1, y.ws1, sizeof (ws1) / 2) == 0 + && ws2[0] == y.ws2[0] + && wc1 == y.wc1 +#endif + ; + } +}; + +#endif // TEST_HXX diff --git a/odb-tests/sqlite/types/testscript b/odb-tests/sqlite/types/testscript new file mode 100644 index 0000000..5e50d32 --- /dev/null +++ b/odb-tests/sqlite/types/testscript @@ -0,0 +1,9 @@ +# file : sqlite/types/testscript +# license : GNU GPL v2; see accompanying LICENSE file + +.include ../../database-options.testscript +.include ../../sqlite.testscript + +: basics +: +$* diff --git a/odb-tests/sqlite/types/traits.hxx b/odb-tests/sqlite/types/traits.hxx new file mode 100644 index 0000000..9483f58 --- /dev/null +++ b/odb-tests/sqlite/types/traits.hxx @@ -0,0 +1,57 @@ +// file : sqlite/types/traits.hxx +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TRAITS_HXX +#define TRAITS_HXX + +#include // std::memcpy, std::memset + +#include + +#include "test.hxx" // string_ptr + +namespace odb +{ + namespace sqlite + { + template <> + class value_traits + { + public: + typedef string_ptr value_type; + typedef std::string query_type; + typedef details::buffer image_type; + + static void + set_value (string_ptr& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + v.reset (is_null ? 0 : new std::string (b.data (), n)); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const string_ptr& v) + { + is_null = v.get () == 0; + + if (!is_null) + { + n = v->size (); + + if (n > b.capacity ()) + b.capacity (n); + + if (n != 0) + std::memcpy (b.data (), v->c_str (), n); + } + } + }; + } +} + +#endif // TRAITS_HXX diff --git a/oracle/custom/custom.sql b/oracle/custom/custom.sql deleted file mode 100644 index 6e22903..0000000 --- a/oracle/custom/custom.sql +++ /dev/null @@ -1,53 +0,0 @@ -/* This file contains custom type definitions and helper functions. - */ - -/* For some reason CREATE OR REPLACE TYPE does not work on Oracle 10.2. */ -BEGIN - BEGIN - EXECUTE IMMEDIATE 'DROP TYPE Numbers'; - EXCEPTION - WHEN OTHERS THEN - IF SQLCODE != -4043 THEN RAISE; END IF; - END; -END; -/ - -CREATE TYPE Numbers AS VARRAY(100) OF NUMBER(10); -/ - -CREATE OR REPLACE FUNCTION string_to_numbers(in_str IN VARCHAR2) RETURN Numbers -IS - ret Numbers := Numbers(); - s_pos NUMBER := 1; - e_pos NUMBER := 0; -BEGIN - IF in_str IS NOT NULL THEN - LOOP - e_pos := INSTR(in_str, ',', s_pos); - EXIT WHEN e_pos = 0; - ret.extend; - ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos, e_pos - s_pos) AS NUMBER); - s_pos := e_pos + 1; - END LOOP; - ret.extend; - ret(ret.COUNT) := CAST(SUBSTR(in_str, s_pos) AS NUMBER); - END IF; - RETURN ret; -END; -/ - -CREATE OR REPLACE FUNCTION numbers_to_string(in_nums IN Numbers) RETURN VARCHAR2 -IS - ret VARCHAR2(1500); -BEGIN - IF in_nums.COUNT != 0 THEN - FOR i IN in_nums.FIRST .. in_nums.LAST LOOP - IF i != in_nums.FIRST THEN - ret := ret || ','; - END IF; - ret := ret || in_nums(i); - END LOOP; - END IF; - RETURN ret; -END; -/ diff --git a/oracle/custom/driver.cxx b/oracle/custom/driver.cxx deleted file mode 100644 index 45f0a4e..0000000 --- a/oracle/custom/driver.cxx +++ /dev/null @@ -1,77 +0,0 @@ -// file : oracle/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom database type mapping in Oracle. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace oracle = odb::oracle; -using namespace oracle; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - object o (1); - o.iv.push_back (123); - o.iv.push_back (234); - o.iv.push_back (-345); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Update. - // - o.iv[0]++; - o.iv.pop_back (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/oracle/custom/test.hxx b/oracle/custom/test.hxx deleted file mode 100644 index 523d50b..0000000 --- a/oracle/custom/test.hxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : oracle/custom/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -// Map Numbers VARRAY Oracle type to std::vector. This type is defined -// in the custom.sql file along with two helper functions that convert -// between Numbers and its string representation. The other half of this -// mapping is in traits.hxx (value_traits, id_string>). -// -#pragma db map type("Numbers") \ - as("VARCHAR2(1500)") \ - to("CAST(string_to_numbers((?)) AS Numbers)") \ - from("numbers_to_string((?))") - -#pragma db object -struct object -{ - object () {} - object (unsigned long id_) : id (id_) {} - - #pragma db id - unsigned long id; - - #pragma db type("Numbers") - std::vector iv; - - bool - operator== (const object& y) const - { - return id == y.id && iv == y.iv; - } -}; - -#endif // TEST_HXX diff --git a/oracle/custom/traits.hxx b/oracle/custom/traits.hxx deleted file mode 100644 index 8df2f91..0000000 --- a/oracle/custom/traits.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : oracle/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include -#include -#include // std::memcpy -#include // std::memcpy - -#include - -namespace odb -{ - namespace oracle - { - - template <> - class value_traits, id_string> - { - public: - typedef std::vector value_type; - typedef value_type query_type; - typedef details::buffer image_type; - - static void - set_value (value_type& v, - const char* b, - std::size_t n, - bool is_null) - { - v.clear (); - - if (!is_null) - { - // Array format is "n1,n2,n3...". - // - std::istringstream is (std::string (b, n)); - - for (char c; !is.eof (); is >> c) - { - v.push_back (int ()); - is >> v.back (); - } - } - } - - static void - set_image (char* b, - std::size_t c, - std::size_t& n, - bool& is_null, - const value_type& v) - { - is_null = false; - std::ostringstream os; - - for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) - { - os << *i; - - if (++i != e) - os << ','; - } - - const std::string& s (os.str ()); - n = s.size (); - assert (n <= c); - std::memcpy (b, s.c_str (), n); - } - }; - } -} - -#endif // TRAITS_HXX diff --git a/oracle/database/driver.cxx b/oracle/database/driver.cxx deleted file mode 100644 index 499f136..0000000 --- a/oracle/database/driver.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : oracle/database/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test that database constructors are unambiguous (compilation only). -// - -#include - -namespace oracle = odb::oracle; -using namespace oracle; - -int -main (int argc, char* argv[]) -{ - // This code should not execute. - // - if (argc != 0) - return 0; - - { - database d1 ("bob", "secret", "db1"); - } - - { - database d1 ("bob", "secret", "svc1", "server1"); - database d2 ("bob", "secret", "svc1", "server1", 999); - } - - { - database d1 (argc, argv); - database d2 (argc, argv, false); - } -} diff --git a/oracle/native/driver.cxx b/oracle/native/driver.cxx deleted file mode 100644 index 541d21e..0000000 --- a/oracle/native/driver.cxx +++ /dev/null @@ -1,77 +0,0 @@ -// file : oracle/native/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test native SQL execution. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -using namespace std; -namespace oracle = odb::oracle; -using namespace oracle; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - // Create the database schema. - // - { - transaction t (db->begin ()); - - db->execute ("BEGIN " - " EXECUTE IMMEDIATE 'DROP TABLE oracle_native_test'; " - " EXCEPTION " - " WHEN OTHERS THEN " - " IF SQLCODE != -942 THEN RAISE; END IF; " - "END;"); - - db->execute ("CREATE TABLE oracle_native_test (n NUMERIC(10,0))"); - - t.commit (); - } - - // Insert a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("INSERT INTO oracle_native_test (n) VALUES (1)") == 1); - - assert ( - db->execute ("INSERT INTO oracle_native_test (n) VALUES (2)") == 1); - - t.commit (); - } - - // Select a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("SELECT n FROM oracle_native_test WHERE n < 3") == 2); - - assert ( - db->execute ("SELECT n FROM oracle_native_test WHERE n > 3") == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/oracle/template/driver.cxx b/oracle/template/driver.cxx deleted file mode 100644 index 13317df..0000000 --- a/oracle/template/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : oracle/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace oracle = odb::oracle; -using namespace oracle; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/oracle/template/template-vc10.vcxproj b/oracle/template/template-vc10.vcxproj deleted file mode 100644 index 92066cf..0000000 --- a/oracle/template/template-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/oracle/template/template-vc10.vcxproj.filters b/oracle/template/template-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/oracle/template/template-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/oracle/template/template-vc11.vcxproj b/oracle/template/template-vc11.vcxproj deleted file mode 100644 index a92e437..0000000 --- a/oracle/template/template-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/oracle/template/template-vc11.vcxproj.filters b/oracle/template/template-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/oracle/template/template-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/oracle/template/template-vc12.vcxproj b/oracle/template/template-vc12.vcxproj deleted file mode 100644 index de35c03..0000000 --- a/oracle/template/template-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-d.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\libcommon\lib64\common.lib;odb-oracle.lib;odb.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/oracle/template/template-vc12.vcxproj.filters b/oracle/template/template-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/oracle/template/template-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/oracle/template/template-vc8.vcproj b/oracle/template/template-vc8.vcproj deleted file mode 100644 index 71e2b52..0000000 --- a/oracle/template/template-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/oracle/template/template-vc9.vcproj b/oracle/template/template-vc9.vcproj deleted file mode 100644 index de9804e..0000000 --- a/oracle/template/template-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), __value__(src_base)/, ) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/oracle/template/test.hxx b/oracle/template/test.hxx deleted file mode 100644 index bfa9cc9..0000000 --- a/oracle/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : oracle/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx deleted file mode 100644 index 2e3e2e7..0000000 --- a/oracle/types/driver.cxx +++ /dev/null @@ -1,366 +0,0 @@ -// file : oracle/types/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Oracle type conversion. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -namespace oracle = odb::oracle; -using namespace oracle; - -int -main (int argc, char* argv[]) -{ - try - { - // Create an Oracle database instance, setting both the client database - // and national character set to UTF-8. - // - auto_ptr db (create_specific_database (argc, argv)); - - object o (1); - - o.int_ = -123456; - o.uint_ = 123456; - o.long_long_ = -123456; - o.ulong_long_ = 123456; - - o.float_ = 1.123F; - o.double_ = 1.123; - o.num_float_ = 1.123F; - o.num_double_ = 1.123; - o.binary_float_ = 1.123F; - o.binary_double_ = 1.123; - - o.date_ = date_time (2010, 8, 29, 15, 33, 18, 0); - o.timestamp_ = date_time (1996, 3, 9, 18, 2, 54, 123000); - o.interval_ds_ = time_interval (0, 0, 13, 15, 23, 19, 123000); - o.interval_ym_ = time_interval (12, 3, 0, 0, 0, 0, 0); - - string vshort_str (8, 's'); - string short_str (13, 's'); - string medium_str (104, 'm'); - string long_str (1018, 'l'); - string vlong_str (15000, 'v'); - - o.char_ = short_str; - o.varchar2_ = medium_str; - o.clob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); - - o.nchar_ = vshort_str; - o.nvarchar2_ = medium_str; - o.nclob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); - - o.empty_c_.push_back (""); - - o.raw_.assign (long_str.data (), long_str.data () + long_str.size ()); - o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ()); - - o.strs_.push_back (short_str); - o.strs_.push_back (medium_str); - o.strs_.push_back (long_str); - o.strs_.push_back (vlong_str); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Test character set conversion. - // - const char* unicode_str = "a \xD5\x95 \xEA\xAA\xAA \xF2\xAA\xAA\xAA"; - - // Testing of character set conversion to and from the client's database - // character set is disabled as the server database character set may - // not be able to represent some Unicode characters. If this were the case - // the test outcome would be a false negative. - // - // o.char_ = unicode_str; - // o.varchar2_ = unicode_str; - // o.clob_ = unicode_str; - - o.nchar_ = unicode_str; - o.nvarchar2_ = unicode_str; - o.nclob_ = unicode_str; - - // Persist. - // - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Test 64 bit integers. - // - big_int bi1 (1, 0x8000000000000000LL); - big_int bi2 (2, -123456); - big_int bi3 (3, 0); - big_int bi4 (4, 123456); - big_int bi5 (5, 0xFFFFFFFFFFFFFFFFULL); - - big_uint bui1 (1, 0); - big_uint bui2 (2, 123456); - big_uint bui3 (3, 0xFFFFFFFFFFFFFFFFULL); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (bi1); - db->persist (bi2); - db->persist (bi3); - db->persist (bi4); - db->persist (bi5); - db->persist (bui1); - db->persist (bui2); - db->persist (bui3); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr bil1 (db->load (1)); - auto_ptr bil2 (db->load (2)); - auto_ptr bil3 (db->load (3)); - auto_ptr bil4 (db->load (4)); - auto_ptr bil5 (db->load (5)); - auto_ptr buil1 (db->load (1)); - auto_ptr buil2 (db->load (2)); - auto_ptr buil3 (db->load (3)); - t.commit (); - - assert (bi1 == *bil1); - assert (bi2 == *bil2); - assert (bi3 == *bil3); - assert (bi4 == *bil4); - assert (bi5 == *bil5); - assert (bui1 == *buil1); - assert (bui2 == *buil2); - assert (bui3 == *buil3); - } - - // Test large BLOBs. - // - descriptor b1 (1); - b1.blob.assign (50000, 'b'); - b1.timestamp = date_time (1996, 3, 9, 18, 2, 54, 123000); - b1.interval_ds = time_interval (0, 0, 13, 15, 23, 19, 123000); - b1.interval_ym = time_interval (12, 3, 0, 0, 0, 0, 0); - - descriptor b2 (2); - b2.blob.assign (500000, 'b'); - b2.timestamp = date_time (1997, 4, 10, 19, 3, 55, 234000); - b2.interval_ds = time_interval (0, 0, 14, 16, 24, 20, 234000); - b2.interval_ym = time_interval (13, 4, 0, 0, 0, 0, 0); - - descriptor b3 (3); - b3.blob.assign (5000, 'b'); - b3.timestamp = date_time (1995, 2, 8, 17, 1, 53, 120000); - b3.interval_ds = time_interval (0, 0, 12, 14, 22, 18, 120000); - b3.interval_ym = time_interval (11, 2, 0, 0, 0, 0, 0); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (b1); - db->persist (b2); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - t.commit (); - - assert (b1 == *p1); - assert (b2 == *p2); - } - - // Test image copying with descriptor-based type (LOB, date-time) data. - // - { - typedef oracle::query query; - typedef odb::result result; - - transaction t (db->begin ()); - - // Pre-bind the image for other operations. - // - { - db->persist (b3); - db->update (b3); - db->reload (b3); - db->erase (b3); - } - - - result r (db->query (query::id < 3)); - result::iterator i (r.begin ()); - - assert (i != r.end ()); - - { - result r (db->query (query::id > 1)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (*i == b2); - assert (++i == r.end ()); - } - - assert (*i == b1); // Load from copy (copy c-tor). - - ++i; - assert (i != r.end ()); - - { - result r (db->query (query::id < 2)); - result::iterator i (r.begin ()); - assert (i != r.end ()); - assert (*i == b1); - assert (++i == r.end ()); - } - - assert (*i == b2); // Load from copy (copy assign). - assert (++i == r.end ()); - - // Make sure all other operations are still working. - // - { - db->persist (b3); -#ifdef HAVE_CXX11 - unique_ptr p (db->load (3)); -#else - auto_ptr p (db->load (3)); -#endif - assert (b3 == *p); - b3.blob.push_back (123); - db->update (b3); - db->reload (p); - assert (b3 == *p); - db->erase (b3); - } - - t.commit (); - } - - // Test descriptor management in TIMESTAMP and INTERVAL images. - // - { - typedef oracle::query query; - typedef odb::result result; - - query q (query::timestamp == o.timestamp_ && - query::interval_ym == o.interval_ym_ && - query::interval_ds == o.interval_ds_); - - transaction t (db->begin ()); - - { - result r (db->query (q)); - assert (size (r) == 1); - } - - { - result r (db->query (q)); - assert (size (r) == 1); - } - - { - // Query temporary. - // - result r (db->query ( - query::timestamp == o.timestamp_ && - query::interval_ym == o.interval_ym_ && - query::interval_ds == o.interval_ds_)); - - query dummy (query::timestamp == o.timestamp_ && - query::interval_ym == o.interval_ym_ && - query::interval_ds == o.interval_ds_); - - assert (size (r) == 1); - } - - t.commit (); - } - - // Test char array. - // - { - char_array o1 (1, ""); - char_array o2 (2, "1234567890"); - char_array o3 (3, "1234567890123456"); - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - // Oracle returns padded values for CHAR(N) unless they are - // empty (represented as NULL). - // - memcpy (o2.s2, "1234567890 ", 16); - - { - transaction t (db->begin ()); - auto_ptr p1 (db->load (1)); - auto_ptr p2 (db->load (2)); - auto_ptr p3 (db->load (3)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - assert (o3 == *p3); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx deleted file mode 100644 index 255bc08..0000000 --- a/oracle/types/test.hxx +++ /dev/null @@ -1,353 +0,0 @@ -// file : oracle/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11 - -#include -#include -#include // std::auto_ptr -#include // std::memcpy, std::str[n]cmp, std::strlen - -#include - -struct date_time -{ - date_time () - { - } - - date_time (unsigned short y, - unsigned char m, - unsigned char d, - unsigned char h, - unsigned char min, - unsigned char sec, - unsigned int nsec) - : year (y), - month (m), - day (d), - hour (h), - minute (min), - second (sec), - nanosecond (nsec) - { - } - - bool - operator== (const date_time& y) const - { - return - year == y.year && - month == y.month && - day == y.day && - hour == y.hour && - minute == y.minute && - second == y.second && - nanosecond == y.nanosecond; - } - - unsigned short year; - unsigned char month; - unsigned char day; - unsigned char hour; - unsigned char minute; - unsigned char second; - unsigned int nanosecond; -}; - -struct time_interval -{ - time_interval () - { - } - - time_interval (int y, int m, int d, int h, int min, int sec, int nsec) - : year (y), - month (m), - day (d), - hour (h), - minute (min), - second (sec), - nanosecond (nsec) - { - } - - bool - operator== (const time_interval& y) const - { - return - year == y.year && - month == y.month && - day == y.day && - hour == y.hour && - minute == y.minute && - second == y.second && - nanosecond == y.nanosecond; - } - - int year; - int month; - int day; - int hour; - int minute; - int second; - int nanosecond; -}; - -#ifdef HAVE_CXX11 -typedef std::unique_ptr string_ptr; -#else -typedef std::auto_ptr string_ptr; -#endif - -typedef std::vector strings; - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned int id_; - - // Integral types. - // - #pragma db type ("NUMBER(10)") - int int_; - - #pragma db type ("NUMBER(10)") - unsigned uint_; - - #pragma db type ("NUMBER(19)") - long long long_long_; - - #pragma db type ("NUMBER(20)") - unsigned long long ulong_long_; - - // Float types. - // - #pragma db type ("FLOAT(24)") - float float_; - - #pragma db type ("FLOAT(53)") - double double_; - - #pragma db type ("NUMBER(7,3)") - float num_float_; - - #pragma db type ("NUMBER(15,5)") - double num_double_; - - #pragma db type ("BINARY_FLOAT") - float binary_float_; - - #pragma db type ("BINARY_DOUBLE") - double binary_double_; - - // Data-time types. - // - #pragma db type ("DATE") - date_time date_; - - #pragma db type ("TIMESTAMP(6)") - date_time timestamp_; - - #pragma db type ("INTERVAL DAY TO SECOND") - time_interval interval_ds_; - - #pragma db type ("INTERVAL YEAR TO MONTH") - time_interval interval_ym_; - - // String and binary types. - // - #pragma db type ("CHAR(13)") - std::string char_; - - #pragma db type ("VARCHAR2(512)") null - std::string varchar2_; - - #pragma db type ("NCHAR(8)") - std::string nchar_; - - #pragma db type ("NVARCHAR2(512)") null - std::string nvarchar2_; - - // Oracle treats empty and NULL VARCHAR2 the same. Test that we - // handle this. - // - std::string empty_; - std::vector empty_c_; - - #pragma db type ("RAW(1024)") - std::vector raw_; - - // LOB types. - // - #pragma db type ("BLOB") - std::vector blob_; - - #pragma db type ("CLOB") - std::string clob_; - - #pragma db type ("NCLOB") - std::string nclob_; - - // Test containers of LOBs - // - #pragma db value_type ("CLOB") - strings strs_; - - // Test NULL value. - // - #pragma db type ("VARCHAR2(32)") null - string_ptr null_; - - bool - operator== (const object& y) const - { - return - id_ == y.id_ && - int_ == y.int_ && - uint_ == y.uint_ && - long_long_ == y.long_long_ && - ulong_long_ == y.ulong_long_ && - float_ == y.float_ && - double_ == y.double_ && - num_float_ == y.num_float_ && - num_double_ == y.num_double_ && - binary_float_ == y.binary_float_ && - binary_double_ == y.binary_double_ && - date_ == y.date_ && - timestamp_ == y.timestamp_ && - interval_ds_ == y.interval_ds_ && - interval_ym_ == y.interval_ym_ && - char_ == y.char_ && - varchar2_ == y.varchar2_ && - nchar_ == y.nchar_ && - nvarchar2_ == y.nvarchar2_ && - empty_ == y.empty_ && - empty_c_ == y.empty_c_ && - raw_ == y.raw_ && - blob_ == y.blob_ && - clob_ == y.clob_ && - nclob_ == y.nclob_ && - strs_ == y.strs_ && - ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); - } -}; - -#pragma db object -struct big_uint -{ - big_uint (unsigned int id = 0, unsigned long long v = 0) - : id_ (id), value (v) - { - } - - #pragma db id - unsigned int id_; - - unsigned long long value; - - bool - operator== (const big_uint& y) const - { - return id_ == y.id_ && value == y.value; - } -}; - -#pragma db object -struct big_int -{ - big_int (unsigned int id = 0, long long v = 0) - : id_ (id), value (v) - { - } - - #pragma db id - unsigned int id_; - - long long value; - - bool - operator== (const big_int& y) const - { - return id_ == y.id_ && value == y.value; - } -}; - -#pragma db object -struct descriptor -{ - descriptor (unsigned int id = 0): id_ (id) {} - - #pragma db id - unsigned int id_; - - #pragma db type ("BLOB") - std::vector blob; - - #pragma db type ("TIMESTAMP(6)") - date_time timestamp; - - #pragma db type ("INTERVAL DAY TO SECOND") - time_interval interval_ds; - - #pragma db type ("INTERVAL YEAR TO MONTH") - time_interval interval_ym; - - bool - operator== (const descriptor& y) const - { - return id_ == y.id_ && - blob == y.blob && - timestamp == y.timestamp && - interval_ds == y.interval_ds && - interval_ym == y.interval_ym; - } -}; - -// Test char array. -// -#pragma db object -struct char_array -{ - char_array () {} - char_array (unsigned long id, const char* s) - : id_ (id) - { - std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - std::memcpy (s2, s, std::strlen (s) + 1); - s3[0] = c1 = *s; - } - - #pragma db id - unsigned long id_; - - char s1[17]; - - #pragma db type("CHAR(16)") null - char s2[16]; - - #pragma db null - char s3[1]; - - #pragma db null - char c1; - - bool - operator== (const char_array& y) const - { - return id_ == y.id_ && - std::strcmp (s1, y.s1) == 0 && - std::strncmp (s2, y.s2, sizeof (s2)) == 0 && - s3[0] == y.s3[0] && - c1 == y.c1; - } -}; - -#endif // TEST_HXX diff --git a/oracle/types/traits.hxx b/oracle/types/traits.hxx deleted file mode 100644 index ad747d8..0000000 --- a/oracle/types/traits.hxx +++ /dev/null @@ -1,192 +0,0 @@ -// file : oracle/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // datetime, interval_ym, interval_ds -#include - -#include - -#include "test.hxx" // date_time, time_interval - -namespace odb -{ - namespace oracle - { - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef char* image_type; - - static void - set_value (date_time& v, const char* i, bool is_null) - { - if (!is_null) - { - short y (0); - unsigned char m (0), d (0), h (0), mins (0), s (0); - - details::get_date (i, y, m, d, h, mins, s); - - v.year = y; - v.month = m; - v.day = d; - v.hour = h; - v.minute = mins; - v.second = s; - - // Oracle DATE does not support fractional seconds. - // - v.nanosecond = 0; - } - } - - static void - set_image (char* i, bool& is_null, const date_time& v) - { - is_null = false; - details::set_date (i, - static_cast (v.year), - v.month, - v.day, - v.hour, - v.minute, - v.second); - } - }; - - template <> - class value_traits - { - public: - typedef date_time value_type; - typedef date_time query_type; - typedef datetime image_type; - - static void - set_value (date_time& v, const datetime& i, bool is_null) - { - if (!is_null) - { - sb2 y (0); - ub1 m (0), d (0), h (0), mins (0), s (0); - ub4 ns (0); - - i.get (y, m, d, h, mins, s, ns); - - v.year = y; - v.month = m; - v.day = d; - v.hour = h; - v.minute = mins; - v.second = s; - v.nanosecond = ns; - } - } - - static void - set_image (datetime& i, - bool& is_null, - const date_time& v) - { - is_null = false; - - i.set (static_cast (v.year), - v.month, - v.day, - v.hour, - v.minute, - v.second, - v.nanosecond); - } - }; - - template <> - class value_traits - { - public: - typedef time_interval value_type; - typedef time_interval query_type; - typedef interval_ds image_type; - - static void - set_value (time_interval& v, - const interval_ds& i, - bool is_null) - { - if (!is_null) - { - sb4 d (0), h (0), m (0), s (0), ns (0); - i.get (d, h, m, s, ns); - - v.year = 0; - v.month = 0; - v.day = static_cast (d); - v.hour = static_cast (h); - v.minute = static_cast (m); - v.second = static_cast (s); - v.nanosecond = static_cast (ns); - } - } - - static void - set_image (interval_ds& i, - bool& is_null, - const time_interval& v) - { - is_null = false; - - i.set (v.day, - v.hour, - v.minute, - v.second, - static_cast (v.nanosecond)); - } - }; - - template <> - class value_traits - { - public: - typedef time_interval value_type; - typedef time_interval query_type; - typedef interval_ym image_type; - - static void - set_value (time_interval& v, - const interval_ym& i, - bool is_null) - { - if (!is_null) - { - sb4 y (0), m (0); - i.get (y, m); - - v.year = static_cast (y); - v.month = static_cast (m); - v.day = 0; - v.hour = 0; - v.minute = 0; - v.second = 0; - v.nanosecond = 0; - } - } - - static void - set_image (interval_ym& i, - bool& is_null, - const time_interval& v) - { - is_null = false; - i.set (v.year, v.month); - } - }; - } -} - -#endif // TRAITS_HXX diff --git a/pgsql-schema.testscript b/pgsql-schema.testscript deleted file mode 100644 index 8659bcd..0000000 --- a/pgsql-schema.testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : pgsql-schema.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# Create the PostgreSQL database schema creation canned command base. -# -create_schema_cmd = [cmdline] $pgsql_client_cmd diff --git a/pgsql.testscript b/pgsql.testscript deleted file mode 100644 index e4b4636..0000000 --- a/pgsql.testscript +++ /dev/null @@ -1,12 +0,0 @@ -# file : pgsql.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# Create the PostgreSQL database schema creation canned command and setup the -# test driver command line for the subsequent tests. -# -.include pgsql-schema.testscript - -schema_file = [path] $out_base/"$schema"($multi ? '-pgsql' : '').sql -create_schema = [cmdline] $create_schema_cmd -f $schema_file - -test.arguments += ($multi ? 'pgsql' : ) $pgsql_options diff --git a/pgsql/buildfile b/pgsql/buildfile deleted file mode 100644 index c6385c0..0000000 --- a/pgsql/buildfile +++ /dev/null @@ -1,6 +0,0 @@ -# file : pgsql/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -./: {*/ -bulk/} - -./: bulk/: include = ($pgsql && !$multi && $pgsql_bulk) diff --git a/pgsql/bulk/buildfile b/pgsql/bulk/buildfile deleted file mode 100644 index 6984edb..0000000 --- a/pgsql/bulk/buildfile +++ /dev/null @@ -1,40 +0,0 @@ -# file : pgsql/bulk/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -if ($build.meta_operation != 'dist') -{ - assert ($pgsql && !$multi) \ - "pgsql should be configured via config.odb_tests.database variable as a single database" - - assert ($pgsql_bulk) "bulk operations are disabled for pgsql" -} - -import libodb = libodb%lib{odb} - -import libs = libpq%lib{pq} -import libs += libodb-pgsql%lib{odb-pgsql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pgsql_bulk_ \ - --generate-schema \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/bulk/driver.cxx b/pgsql/bulk/driver.cxx deleted file mode 100644 index ba25542..0000000 --- a/pgsql/bulk/driver.cxx +++ /dev/null @@ -1,361 +0,0 @@ -// file : pgsql/bulk/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test transaction savepoints. -// - -#include - -#include -#include -#include -#include -#include - -// Note: hack. -// -#include -#define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) - -#undef NDEBUG -#include - -static const size_t columns = 3; - -struct data -{ - long long id; - long long idata; - const char* sdata; -}; - -static char* values[columns]; -static int lengths[columns]; -static int formats[columns] = {1, 1, 1}; - -static const unsigned int types[columns] = { - 20, // int8 - 20, // int8 - 25 // text -}; - -static void -init (const struct data* d) -{ - values[0] = (char*)&d->id; - lengths[0] = sizeof (d->id); - - values[1] = (char*)&d->idata; - lengths[1] = sizeof (d->idata); - - values[2] = (char*)d->sdata; - lengths[2] = strlen (d->sdata); -} - -static void -execute (PGconn* conn, const struct data* ds, size_t n) -{ - int sock = PQsocket (conn); - assert (sock != -1); - - if (PQsetnonblocking (conn, 1) == -1 || - PQenterPipelineMode (conn) == 0) - assert (false); - - // True if we've written and read everything, respectively. - // - bool wdone = false; - bool rdone = false; - - size_t wn = 0; - size_t rn = 0; - - while (!rdone) - { - fd_set wds; - if (!wdone) - { - FD_ZERO (&wds); - FD_SET (sock, &wds); - } - - fd_set rds; - FD_ZERO (&rds); - FD_SET (sock, &rds); - - if (select (sock + 1, &rds, wdone ? NULL : &wds, NULL, NULL) == -1) - { - if (errno == EINTR) - continue; - - assert (false); - } - - // Try to minimize the chance of blocking the server by first processing - // the result and then sending more queries. - // - if (FD_ISSET (sock, &rds)) - { - if (PQconsumeInput (conn) == 0) - assert (false); - - while (wn > rn && PQisBusy (conn) == 0) - { - //fprintf (stderr, "PQgetResult %zu\n", rn); - - PGresult* res = PQgetResult (conn); - assert (res != NULL); - ExecStatusType stat = PQresultStatus (res); - - if (stat == PGRES_PIPELINE_SYNC) - { - assert (wdone && rn == n); - PQclear (res); - rdone = true; - break; - } - - if (stat == PGRES_FATAL_ERROR) - { - const char* s = PQresultErrorField (res, PG_DIAG_SQLSTATE); - - if (strcmp (s, "23505") == 0) - fprintf (stderr, "duplicate id at %zu\n", rn); - } - - PQclear (res); - assert (rn != n); - ++rn; - - // We get a NULL result after each query result. - // - { - PGresult* end = PQgetResult (conn); - assert (end == NULL); - } - } - } - - if (!wdone && FD_ISSET (sock, &wds)) - { - // Send queries until we get blocked (write-biased). This feels like - // a better overall strategy to keep the server busy compared to - // sending one query at a time and then re-checking if there is - // anything to read because the results of INSERT/UPDATE/DELETE are - // presumably small and quite a few of them can get buffered before - // the server gets blocked. - // - for (;;) - { - if (wn < n) - { - //fprintf (stderr, "PQsendQueryPrepared %zu\n", wn); - - init (ds + wn); - - if (PQsendQueryPrepared (conn, - "persist_object", - (int)(columns), - values, - lengths, - formats, - 1) == 0) - assert (false); - - if (++wn == n) - { - if (PQpipelineSync (conn) == 0) - assert (false); - - ++wn; - } - } - - // PQflush() result: - // - // 0 -- success (queue is now empty) - // 1 -- blocked - // -1 -- error - // - int r = PQflush (conn); - assert (r != -1); - - if (r == 0) - { - if (wn < n) - { - // If we continue here, then we are write-biased. And if we - // break, then we are read-biased. - // -#if 0 - break; -#else - continue; -#endif - } - - wdone = true; - } - - break; // Blocked or done. - } - } - } - - if (PQexitPipelineMode (conn) == 0 || - PQsetnonblocking (conn, 0) == -1) - assert (false); -} - -static void -test (PGconn* conn) -{ - const size_t batch = 500; - struct data ds[batch]; - - for (size_t i = 0; i != batch; ++i) - { - ds[i].id = htonll (i == batch / 2 ? i - 1 : i); // Cause duplicate PK. - ds[i].idata = htonll (i); - ds[i].sdata = "abc"; - } - - // Prepare the statement. - // - { - PGresult* res = PQprepare ( - conn, - "persist_object", - "INSERT INTO \"pgsql_bulk_object\" " - "(\"id\", " - "\"idata\", " - "\"sdata\") " - "VALUES " - "($1, $2, $3)", - (int)(columns), - types); - assert (PQresultStatus (res) == PGRES_COMMAND_OK); - PQclear (res); - } - - // Begin transaction. - // - { - PGresult* res = PQexec (conn, "begin"); - assert (PQresultStatus (res) == PGRES_COMMAND_OK); - PQclear (res); - } - - execute (conn, ds, batch); - - // Commit transaction. - // - { - PGresult* res = PQexec (conn, "commit"); - assert (PQresultStatus (res) == PGRES_COMMAND_OK); - PQclear (res); - } -} - -#include -#include // std::unique_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - bool fail_already_persistent (false); - - for (int i (1); i != argc; ++i) - { - if (strcmp (argv[i], "--fail-already-persistent") == 0) - { - fail_already_persistent = true; - - for (; i != argc - 1; ++i) - argv[i] = argv[i + 1]; - - --argc; - - break; - } - } - - try - { - unique_ptr db (create_specific_database (argc, argv)); - - connection_ptr cn (db->connection ()); - - if (false) - { - PGconn* conn (cn->handle ()); - test (conn); - } - - { - const unsigned long n (500); - - vector os; - - for (unsigned long i (0); i != n; ++i) - { - os.push_back (object {i, i, string (i, 'x')}); - - if (fail_already_persistent && i == n / 2) - os.push_back (object {i, i, to_string (i)}); - } - - { - transaction t (cn->begin ()); - db->persist (os.begin (), os.end ()); - t.commit (); - } - - { - transaction t (cn->begin ()); - db->find (2); - t.commit (); - } - - for (unsigned long i (0); i != n; ++i) - { - //assert (os[i].id == i + 1); - os[i].idata++; - } - - { - transaction t (cn->begin ()); - db->update (os.begin (), os.end ()); - t.commit (); - } - - { - transaction t (cn->begin ()); - db->erase (os.begin (), os.end ()); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/bulk/test.hxx b/pgsql/bulk/test.hxx deleted file mode 100644 index 25dd138..0000000 --- a/pgsql/bulk/test.hxx +++ /dev/null @@ -1,34 +0,0 @@ -// file : pgsql/savepoint/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object bulk(1000) -struct object -{ - /* - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - */ - - #pragma db id //auto - unsigned long id; - - unsigned long idata; - - //#pragma db - std::string sdata; -}; - -#endif // TEST_HXX diff --git a/pgsql/bulk/testscript b/pgsql/bulk/testscript deleted file mode 100644 index 60b7d92..0000000 --- a/pgsql/bulk/testscript +++ /dev/null @@ -1,18 +0,0 @@ -# file : pgsql/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -+$create_schema - -: basics -: -{ - $*; - - $* --fail-already-persistent 2>>EOE != 0 - multiple exceptions, 252 elements attempted, 1 failed, fatal: - [251] object already persistent - EOE -} diff --git a/pgsql/custom/buildfile b/pgsql/custom/buildfile deleted file mode 100644 index a5c6717..0000000 --- a/pgsql/custom/buildfile +++ /dev/null @@ -1,37 +0,0 @@ -# file : pgsql/custom/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-pgsql%lib{odb-pgsql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pgsql_custom_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --hxx-prologue '#include "traits.hxx"' \ - --hxx-prologue '#include "query.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/custom/driver.cxx b/pgsql/custom/driver.cxx deleted file mode 100644 index 91ff0ce..0000000 --- a/pgsql/custom/driver.cxx +++ /dev/null @@ -1,125 +0,0 @@ -// file : pgsql/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom database type mapping in PostgreSQL. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - object o (1); - o.p = point (1.1111, 2222222222.2); - o.pv.push_back (point (1.1234, 2.2345)); - o.pv.push_back (point (3.3456, 4.4567)); - o.pv.push_back (point (0.0000001, 0.000000001)); // Scientific notation. - - o.n1 = "23.5154"; - o.n2 = "235154"; - o.n3 = "2222222222222222222222222222.111111111111111111111111111111"; - - o.iv.push_back (123); - o.iv.push_back (234); - o.iv.push_back (-345); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Query. - // - typedef pgsql::query query; - typedef odb::result result; - - { - transaction t (db->begin ()); - - // Point comparison. - // - { - result r (db->query (query::p == o.p)); - assert (!r.empty ()); - } - - // Point comparison using native query. - // - { - result r (db->query (query::p + "~=" + query::_val (o.p))); - assert (!r.empty ()); - } - - // Access to individual members. - // - { - result r (db->query (query::p.x == o.p.x)); - assert (!r.empty ()); - } - - t.commit (); - } - - // Update. - // - o.p.x++; - o.p.y--; - o.pv[1].x--; - o.pv[1].y++; - o.n3 += "999"; - o.iv[0]++; - o.iv.pop_back (); - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/custom/query.hxx b/pgsql/custom/query.hxx deleted file mode 100644 index 8b89047..0000000 --- a/pgsql/custom/query.hxx +++ /dev/null @@ -1,158 +0,0 @@ -// file : pgsql/custom/query.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef QUERY_HXX -#define QUERY_HXX - -#include - -#include - -#include "test.hxx" // point - -namespace odb -{ - namespace pgsql - { - template <> - struct query_column - { - private: - const char* table_; - const char* column_; - const char* conversion_; - - std::string x_column_; - std::string y_column_; - - // Sub-columns for individual members. - // - public: - query_column x, y; - - // is_null, is_not_null - // - public: - query_base - is_null () const - { - query_base q (table_, column_); - q += "IS NULL"; - return q; - } - - query_base - is_not_null () const - { - query_base q (table_, column_); - q += "IS NOT NULL"; - return q; - } - - // = - // - public: - query_base - equal (const point& v) const - { - return equal (val_bind (v)); - } - - query_base - equal (val_bind v) const - { - query_base q (table_, column_); - q += "~="; - q.append (v, conversion_); - return q; - } - - query_base - equal (ref_bind r) const - { - query_base q (table_, column_); - q += "~="; - q.append (r, conversion_); - return q; - } - - friend query_base - operator== (const query_column& c, const point& v) - { - return c.equal (v); - } - - friend query_base - operator== (const point& v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, val_bind v) - { - return c.equal (v); - } - - friend query_base - operator== (val_bind v, const query_column& c) - { - return c.equal (v); - } - - friend query_base - operator== (const query_column& c, ref_bind r) - { - return c.equal (r); - } - - friend query_base - operator== (ref_bind r, const query_column& c) - { - return c.equal (r); - } - - // Column comparison. - // - public: - query_base - operator== (const query_column& c) const - { - query_base q (table_, column_); - q += "~="; - q.append (c.table (), c.column ()); - return q; - } - - public: - query_column (const char* table, const char* column, const char* conv) - : table_ (table), column_ (column), conversion_ (conv), - x_column_ (std::string (column) + "[0]"), - y_column_ (std::string (column) + "[1]"), - x (table, x_column_.c_str (), 0), - y (table, y_column_.c_str (), 0) - { - } - - const char* - table () const - { - return table_; - } - - const char* - column () const - { - return column_; - } - - const char* - conversion () const - { - return conversion_; - } - }; - } -} - -#endif // QUERY_HXX diff --git a/pgsql/custom/test.hxx b/pgsql/custom/test.hxx deleted file mode 100644 index ec3d496..0000000 --- a/pgsql/custom/test.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// file : pgsql/custom/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Map POINT PostgreSQL type to the point C++ struct. The other half -// of this mapping is in traits.hxx (value_traits). -// -#pragma db map type("POINT") as("TEXT") to("(?)::POINT") from("(?)::TEXT") - -#pragma db value type("POINT") -struct point -{ - point () {} - point (double x_, double y_): x (x_), y (y_) {} - - double x; - double y; -}; - -inline bool -operator== (const point& a, const point& b) -{ - return a.x == b.x && a.y == b.y; -} - -// Map NUMERIC PostgreSQL type to std::string (or any other type that -// provides the value_traits specialization). -// -#pragma db map type("NUMERIC *(\\(.+\\))?") \ - as("TEXT") \ - to("(?)::NUMERIC$1") \ - from("(?)::TEXT") - -// Map INTEGER[] PostgreSQL type to std::vector. The other half of -// this mapping is in traits.hxx (value_traits, id_string>). -// -#pragma db map type("INTEGER *\\[(\\d*)\\]") \ - as("TEXT") \ - to("(?)::INTEGER[$1]") \ - from("(?)::TEXT") - -#pragma db object -struct object -{ - object () {} - object (unsigned long id_) : id (id_) {} - - #pragma db id - unsigned long id; - - point p; - std::vector pv; - - #pragma db type("NUMERIC(6, 4)") - std::string n1; - - #pragma db type("NUMERIC(6)") - std::string n2; - - #pragma db type("NUMERIC") - std::string n3; - - #pragma db type("INTEGER [123]") - std::vector iv; - - bool - operator== (const object& y) const - { - return id == y.id && - p == y.p && - pv == y.pv && - n1 == y.n1 && - n2 == y.n2 && - n3 == y.n3 && - iv == y.iv; - } -}; - -#endif // TEST_HXX diff --git a/pgsql/custom/testscript b/pgsql/custom/testscript deleted file mode 100644 index 8e1448b..0000000 --- a/pgsql/custom/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : pgsql/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -+$create_schema - -: basics -: -$* diff --git a/pgsql/custom/traits.hxx b/pgsql/custom/traits.hxx deleted file mode 100644 index c45dec0..0000000 --- a/pgsql/custom/traits.hxx +++ /dev/null @@ -1,166 +0,0 @@ -// file : pgsql/custom/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // std::numeric_limits -#include -#include -#include // std::memcpy - -#include - -#include "test.hxx" // point - -namespace odb -{ - namespace pgsql - { - template <> - class value_traits - { - public: - typedef point value_type; - typedef point query_type; - typedef details::buffer image_type; - - static void - set_value (point& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = point (); - else - { - // Point format is "(x,y)". - // - char c; - std::istringstream is (std::string (b.data (), n)); - - is >> c; // '(' - is >> v.x; - is >> c; // ',' - is >> v.y; - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const point& v) - { - is_null = false; - std::ostringstream os; - - // The formula for the number of decimla digits required is given in: - // - // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf - // - os.precision (std::numeric_limits::digits10); - // os.precision (2 + std::numeric_limits::digits * 301/1000); - - os << '(' << v.x << ',' << v.y << ')'; - - const std::string& s (os.str ()); - n = s.size (); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), s.c_str (), n); - } - }; - - template <> - struct type_traits - { - static const database_type_id db_type_id = id_string; - - struct conversion - { - static const char* to () {return "(?)::POINT";} - }; - }; - - template <> - class value_traits, id_string> - { - public: - typedef std::vector value_type; - typedef value_type query_type; - typedef details::buffer image_type; - - static void - set_value (value_type& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.clear (); - - if (!is_null) - { - // Array format is "{n1,n2,n3...}". - // - char c; - std::istringstream is (std::string (b.data (), n)); - - is >> c; // '{' - - for (c = static_cast (is.peek ()); c != '}'; is >> c) - { - v.push_back (int ()); - is >> v.back (); - } - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const value_type& v) - { - is_null = false; - std::ostringstream os; - - os << '{'; - - for (value_type::const_iterator i (v.begin ()), e (v.end ()); i != e;) - { - os << *i; - - if (++i != e) - os << ','; - } - - os << '}'; - - const std::string& s (os.str ()); - n = s.size (); - - if (n > b.capacity ()) - b.capacity (n); - - std::memcpy (b.data (), s.c_str (), n); - } - }; - - template <> - struct type_traits > - { - static const database_type_id db_type_id = id_string; - - struct conversion - { - static const char* to () {return "(?)::INTEGER[]";} - }; - }; - } -} - -#endif // TRAITS_HXX diff --git a/pgsql/database/buildfile b/pgsql/database/buildfile deleted file mode 100644 index 6977ea6..0000000 --- a/pgsql/database/buildfile +++ /dev/null @@ -1,11 +0,0 @@ -# file : pgsql/database/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-pgsql%lib{odb-pgsql} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/pgsql/database/driver.cxx b/pgsql/database/driver.cxx deleted file mode 100644 index 56bde0a..0000000 --- a/pgsql/database/driver.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : pgsql/database/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test that database constructors are unambiguous (compilation only). -// - -#include - -#undef NDEBUG -#include - -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - // This code should not execute. - // - if (argc != 0) - return 0; - - { - database d1 ("bob", "secret", "db1"); - database d2 ("bob", "secret", "db1", "server1"); - database d3 ("bob", "secret", "db1", "server1", 999); - database d4 ("bob", "secret", "db1", "server1", 999, "extra"); - } - - { - database d1 ("bob", "secret", "db1", "server1", "ext1"); - database d2 ("bob", "secret", "db1", "server1", "ext1", "extra"); - } - - { - database d1 ("conninfo"); - } - - { - database d1 (argc, argv); - database d2 (argc, argv, false); - database d3 (argc, argv, true, "extra"); - } -} diff --git a/pgsql/database/testscript b/pgsql/database/testscript deleted file mode 100644 index f57a8e1..0000000 --- a/pgsql/database/testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : pgsql/database/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -: basics -: -$* diff --git a/pgsql/index/buildfile b/pgsql/index/buildfile deleted file mode 100644 index a84ed9a..0000000 --- a/pgsql/index/buildfile +++ /dev/null @@ -1,34 +0,0 @@ -# file : pgsql/index/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-pgsql%lib{odb-pgsql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pgsql_index_ \ - --generate-schema \ - --default-database common - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/index/driver.cxx b/pgsql/index/driver.cxx deleted file mode 100644 index dc4c11e..0000000 --- a/pgsql/index/driver.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : pgsql/index/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test PostgreSQL index creation. See also the common test. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - // This is just a schema creation test. - // - unique_ptr db (create_specific_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/index/test.hxx b/pgsql/index/test.hxx deleted file mode 100644 index d728188..0000000 --- a/pgsql/index/test.hxx +++ /dev/null @@ -1,19 +0,0 @@ -// file : pgsql/index/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id_; - - int i; - #pragma db index type("UNIQUE CONCURRENTLY") method("BTREE") member(i) -}; - -#endif // TEST_HXX diff --git a/pgsql/index/testscript b/pgsql/index/testscript deleted file mode 100644 index 671a8c3..0000000 --- a/pgsql/index/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : pgsql/index/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -+$create_schema - -: basics -: -$* diff --git a/pgsql/native/buildfile b/pgsql/native/buildfile deleted file mode 100644 index ec4c80c..0000000 --- a/pgsql/native/buildfile +++ /dev/null @@ -1,16 +0,0 @@ -# file : pgsql/native/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-pgsql%lib{odb-pgsql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/native/driver.cxx b/pgsql/native/driver.cxx deleted file mode 100644 index 843db41..0000000 --- a/pgsql/native/driver.cxx +++ /dev/null @@ -1,75 +0,0 @@ -// file : pgsql/native/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test PostgreSQL native SQL execution. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - // Create the database schema. - // - { - transaction t (db->begin ()); - - db->execute ("DROP TABLE IF EXISTS pgsql_native_test"); - db->execute ("CREATE TABLE pgsql_native_test (n INT PRIMARY KEY)"); - - t.commit (); - } - - // Insert a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("INSERT INTO pgsql_native_test (n) VALUES (1)") == 1); - - assert ( - db->execute ("INSERT INTO pgsql_native_test (n) VALUES (2)") == 1); - - t.commit (); - } - - // select a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("SELECT n FROM pgsql_native_test WHERE n < 3") == 2); - - assert ( - db->execute ("SELECT n FROM pgsql_native_test WHERE n > 3") == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } - - return 0; -} diff --git a/pgsql/native/testscript b/pgsql/native/testscript deleted file mode 100644 index 4fd9d2c..0000000 --- a/pgsql/native/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : pgsql/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -: basics -: -$* diff --git a/pgsql/truncation/buildfile b/pgsql/truncation/buildfile deleted file mode 100644 index 2f2f3a2..0000000 --- a/pgsql/truncation/buildfile +++ /dev/null @@ -1,35 +0,0 @@ -# file : pgsql/truncation/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-pgsql%lib{odb-pgsql} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pgsql_truncation_ \ - --generate-schema \ - --default-database common \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/truncation/driver.cxx b/pgsql/truncation/driver.cxx deleted file mode 100644 index 337a26e..0000000 --- a/pgsql/truncation/driver.cxx +++ /dev/null @@ -1,163 +0,0 @@ -// file : pgsql/truncation/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test insufficient buffer/truncation handling. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - // The default pre-allocated buffer is 512 bytes long. - // - string long_str (640, 'c'); // This will get the buffer to 1024 - string longer_str (1025, 'b'); - - try - { - // Test basic operations. - // - { - unique_ptr db (create_specific_database (argc, argv)); - - // Run persist/load so that the initial bindings are established - // (version == 0). - // - { - object1 o (1); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (1, o); - t.commit (); - } - - { - object2 o (2); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (2, o); - t.commit (); - } - - // Store/load the long string which should trigger buffer growth. - // - { - object1 o (3); - o.str_ = long_str; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == long_str); - t.commit (); - } - - // Store/load longer string. - // - { - object1 o (3); - o.str_ = longer_str; - - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == longer_str); - t.commit (); - } - } - - // Test query. - // - { - typedef pgsql::query query; - typedef odb::result result; - - unique_ptr db (create_specific_database (argc, argv)); - - // Run persist/query so that the initial bindings are established - // (version == 0). - // - { - object1 o (20); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - o.id_++; - db->persist (o); - o.id_++; - db->persist (o); - - result r (db->query (query::id == 20)); - assert (r.begin ()->id_ == 20); - t.commit (); - } - - // Test buffer growth with cached result. - // - { - object1 o; - - transaction t (db->begin ()); - - result r (db->query (query::id >= 20)); - result::iterator i (r.begin ()); - - o.id_ = i->id_; - o.str_ = long_str; - - // This forces buffer growth in the middle of result iteration. - // - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - o.id_ = i->id_; - o.str_ = longer_str; - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/truncation/test.hxx b/pgsql/truncation/test.hxx deleted file mode 100644 index 73110c0..0000000 --- a/pgsql/truncation/test.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : pgsql/truncation/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object table ("test") -struct object1 -{ - object1 (unsigned long id) - : id_ (id) - { - } - - object1 () - { - } - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#pragma db object table ("test") -struct object2 -{ - object2 (unsigned long id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#endif // TEST_HXX diff --git a/pgsql/truncation/testscript b/pgsql/truncation/testscript deleted file mode 100644 index c57b723..0000000 --- a/pgsql/truncation/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : pgsql/truncation/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -+$create_schema - -: basics -: -$* diff --git a/pgsql/types/buildfile b/pgsql/types/buildfile deleted file mode 100644 index 64f0c02..0000000 --- a/pgsql/types/buildfile +++ /dev/null @@ -1,36 +0,0 @@ -# file : pgsql/types/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($pgsql && !$multi || $build.meta_operation == 'dist') \ -"pgsql should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} -import libcommon = lib{common} -import libs = libodb-pgsql%lib{odb-pgsql} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb and libcommon -# libraries are resolved for the odb_compile ad hoc rule (see build/root.build -# for details). -# -libue{test-meta}: $libodb $libcommon - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix pgsql_types_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --cxx-prologue '#include "traits.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" - -# Testscript's run-time prerequisites. -# -exe{driver}: ../../alias{pgsql-client}: include = adhoc diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx deleted file mode 100644 index 710f601..0000000 --- a/pgsql/types/driver.cxx +++ /dev/null @@ -1,165 +0,0 @@ -// file : pgsql/types/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test PostgreSQL type conversion. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace pgsql = odb::pgsql; -using namespace pgsql; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - object o (1); - - o.bool_ = true; - o.short_ = 12345; - o.int_ = -123456; - o.long_long_ = 123456; - - o.float_ = 1.123F; - o.float8_ = 1.123; - o.double_ = 1.123; - - o.date_ = 4015; - o.time_ = 48180000000LL; - o.timestamp_ = 346896000LL; - - string short_str (128, 's'); - string medium_str (250, 'm'); - string long_str (2040, 'l'); - - o.char_ = short_str; - o.varchar_ = medium_str; - o.text_ = long_str; - - o.bytea_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); - - unsigned char varbit_buf[8] = {1, 3, 1, 3, 1, 3, 1, 3}; - o.varbit_.size = 52; - o.varbit_.ubuffer_ = ubuffer (varbit_buf, 8); - - o.bit_.a = 0; - o.bit_.b = 1; - o.bit_.c = 0; - o.bit_.d = 1; - - // 6F846D41-C89A-4E4D-B22F-56443CFA543F - memcpy (o.uuid_, "\x6F\x84\x6D\x41\xC8\x9A\x4E\x4D\xB2\x2F" - "\x56\x44\x3C\xFA\x54\x3F", 16); - - o.enum_ = green; - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - typedef pgsql::query query; - typedef odb::result result; - - // Test UUID in queries. - // - { - char uuid[16]; - memcpy (uuid, o.uuid_, 16); - - transaction t (db->begin ()); - - { - result r (db->query (query::uuid == uuid)); - assert (size (r) == 1); - } - - { - result r (db->query (query::uuid == query::_val (uuid))); - assert (size (r) == 1); - } - - { - result r (db->query (query::uuid == query::_ref (uuid))); - assert (size (r) == 1); - } - - { - const char* d (uuid); - result r (db->query (query::uuid == d)); - assert (size (r) == 1); - } - - t.commit (); - } - - // Test char array. - // - { - char_array o1 (1, ""); - char_array o2 (2, "1234567890"); - char_array o3 (3, "1234567890123456"); - - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - // PostgreSQL returns padded values for CHAR(N). - // - memcpy (o1.s2, " ", 16); - o1.s3[0] = o1.c1 = ' '; - memcpy (o2.s2, "1234567890 ", 16); - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (1)); - unique_ptr p2 (db->load (2)); - unique_ptr p3 (db->load (3)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - assert (o3 == *p3); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx deleted file mode 100644 index 462ebad..0000000 --- a/pgsql/types/test.hxx +++ /dev/null @@ -1,220 +0,0 @@ -// file : pgsql/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include // std::unique_ptr -#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen -#include // std::size_t - -#include - -#include - -struct bitfield -{ - unsigned int a: 1; - unsigned int b: 1; - unsigned int c: 1; - unsigned int d: 1; -}; - -inline bool -operator== (bitfield x, bitfield y) -{ - return - x.a == y.a && - x.b == y.b && - x.c == y.c && - x.d == y.d; -} - -struct varbit -{ - std::size_t size; - ubuffer ubuffer_; - - bool - compare (const varbit& x) const - { - if (size != x.size) - return false; - - std::size_t byte_len = size / 8; - - if (std::memcmp (ubuffer_.data (), x.ubuffer_.data (), byte_len) != 0) - return false; - - std::size_t trailing_bits = size % 8; - - if (trailing_bits != 0) - { - unsigned char mask (0xFFU << (8 - trailing_bits)); - - return (ubuffer_.data ()[byte_len] & mask) == - (x.ubuffer_.data ()[byte_len] & mask); - } - - return true; - } -}; - -inline bool -operator== (const varbit& x, const varbit& y) -{ - return x.compare (y); -} - -#pragma db value(bitfield) type ("BIT(4)") - -typedef std::unique_ptr string_ptr; - -enum color {red, green, blue}; - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - // Integral types. - // - #pragma db type ("BOOL") - bool bool_; - - #pragma db type ("SMALLINT") - short short_; - - #pragma db type ("INT") - int int_; - - #pragma db type ("BIGINT") - long long long_long_; - - // Float types. - // - #pragma db type ("REAL") - float float_; - - #pragma db type ("FLOAT(32)") - double float8_; - - #pragma db type ("DOUBLE PRECISION") - double double_; - - // Data-time types. - // - #pragma db type ("DATE") - int date_; - - #pragma db type ("TIME") - long long time_; - - #pragma db type ("TIMESTAMP") - long long timestamp_; - - // String and binary types. - // - #pragma db type ("CHAR(128)") - std::string char_; - - #pragma db type ("VARCHAR(256)") - std::string varchar_; - - #pragma db type ("TEXT") - std::string text_; - - #pragma db type ("BYTEA") - std::vector bytea_; - - #pragma db type ("VARBIT(1024)") - varbit varbit_; - - // #pragma db type ("BIT(4)") - assigned by #pragma db value - bitfield bit_; - - // Other types. - // - #pragma db type ("UUID") - char uuid_[16]; - - // Test ENUM representation. - // - color enum_; - - // Test NULL value. - // - #pragma db type ("TEXT") null - string_ptr null_; - - bool - operator== (const object& y) const - { - return - id_ == y.id_ && - bool_ == y.bool_ && - short_ == y.short_ && - int_ == y.int_ && - long_long_ == y.long_long_ && - float_ == y.float_ && - float8_ == y.float8_ && - double_ == y.double_ && - date_ == y.date_ && - time_ == y.time_ && - timestamp_ == y.timestamp_ && - char_ == y.char_ && - varchar_ == y.varchar_ && - text_ == y.text_ && - bytea_ == y.bytea_ && - bit_ == y.bit_ && - varbit_ == y.varbit_ && - memcmp (uuid_, y.uuid_, 16) == 0 && - enum_ == y.enum_ && - ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); - } -}; - -// Test char array. -// -#pragma db object -struct char_array -{ - char_array () {} - char_array (unsigned long id, const char* s) - : id_ (id) - { - std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - std::memcpy (s2, s, std::strlen (s) + 1); - s3[0] = c1 = *s; - } - - #pragma db id - unsigned long id_; - - char s1[17]; - - #pragma db type("CHAR(16)") - char s2[16]; - - char s3[1]; - char c1; - - bool - operator== (const char_array& y) const - { - return id_ == y.id_ && - std::strcmp (s1, y.s1) == 0 && - std::strncmp (s2, y.s2, sizeof (s2)) == 0 && - s3[0] == y.s3[0] && - c1 == y.c1; - } -}; - -#endif // TEST_HXX diff --git a/pgsql/types/testscript b/pgsql/types/testscript deleted file mode 100644 index 57218e1..0000000 --- a/pgsql/types/testscript +++ /dev/null @@ -1,11 +0,0 @@ -# file : pgsql/types/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../pgsql.testscript - -+$create_schema - -: basics -: -$* diff --git a/pgsql/types/traits.hxx b/pgsql/types/traits.hxx deleted file mode 100644 index a1c8fbe..0000000 --- a/pgsql/types/traits.hxx +++ /dev/null @@ -1,171 +0,0 @@ -// file : pgsql/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include -#include // std::memcpy, std::memset - -#include -#include - -#include "test.hxx" // varbit, ubuffer, string_ptr - -namespace odb -{ - namespace pgsql - { - // The first 4 bytes of the image is a signed int specifying the - // number of significant bits contained by the BIT. The following - // bytes contain the bit data. - // - template <> - class value_traits - { - public: - typedef bitfield value_type; - typedef bitfield query_type; - typedef unsigned char* image_type; - - static void - set_value (bitfield& v, - const unsigned char* i, - std::size_t, - bool is_null) - { - if (!is_null) - { - assert ( - details::endian_traits::ntoh ( - *reinterpret_cast (i)) == 4); - - const unsigned char* d (i + 4); - - v.a = *d >> 4 & 1; - v.b = (*d >> 5) & 1; - v.c = (*d >> 6) & 1; - v.d = (*d >> 7) & 1; - } - else - v.a = v.b = v.c = v.d = 0; - } - - static void - set_image (unsigned char* i, - std::size_t, - std::size_t& n, - bool& is_null, - bitfield v) - { - is_null = false; - n = 5; - - *reinterpret_cast (i) = details::endian_traits::hton (4); - *(i + 4) = v.a << 4 | (v.b << 5) | (v.c << 6) | (v.d << 7); - } - }; - - // The first 4 bytes of the image is a signed int specifying the - // number of significant bits contained by the VARBIT. The following - // bytes contain the VARBIT data. - // - template <> - class value_traits - { - public: - typedef varbit value_type; - typedef varbit query_type; - typedef details::ubuffer image_type; - - static void - set_value (varbit& v, - const details::ubuffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - { - v.size = static_cast ( - details::endian_traits::ntoh ( - *reinterpret_cast (b.data ()))); - - std::size_t byte_len (v.size / 8 + (v.size % 8 > 0 ? 1 : 0)); - assert (n >= byte_len + 4); - - v.ubuffer_.assign (b.data () + 4, byte_len); - } - - else - { - v.size = 0; - v.ubuffer_.assign (0, 0); - } - } - - static void - set_image (details::ubuffer& b, - std::size_t& n, - bool& is_null, - const varbit& v) - { - is_null = false; - n = 4 + v.size / 8 + (v.size % 8 > 0 ? 1 : 0); - - if (n > b.capacity ()) - b.capacity (n); - - // PostgreSQL requires all trailing bits of a VARBIT image - // to be zero. - // - std::memset (b.data (), 0, b.capacity ()); - - *reinterpret_cast (b.data ()) = - details::endian_traits::hton (static_cast (v.size)); - - if (v.size != 0) - std::memcpy (b.data () + 4, v.ubuffer_.data (), n - 4); - } - }; - - template <> - class value_traits - { - public: - typedef string_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (string_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const string_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_HXX diff --git a/qt/common/basic/driver.cxx b/qt/common/basic/driver.cxx deleted file mode 100644 index 342a313..0000000 --- a/qt/common/basic/driver.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : qt/common/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence (common part). -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - try - { - auto_ptr db (create_database (argc, argv)); - - object o (1); - o.uuid_ = QUuid::createUuid (); - o.null_ = QUuid (); - o.zero_ = QUuid (); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - t.commit (); - - assert (*p == o); - } - - { - typedef odb::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::uuid == o.uuid_)); - result::iterator i (r.begin ()); - assert (i != r.end () && i->id_ == o.id_); - assert (++i == r.end ()); - t.commit (); - } - - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/basic/test.hxx b/qt/common/basic/test.hxx deleted file mode 100644 index e67302e..0000000 --- a/qt/common/basic/test.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : qt/common/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - QUuid uuid_; - QUuid null_; - - #pragma db not_null - QUuid zero_; - - bool operator== (const object& x) const - { - return id_ == x.id_ && - uuid_ == x.uuid_ && - null_ == x.null_ && - zero_ == x.zero_; - } -}; - -#endif // TEST_HXX diff --git a/qt/common/containers/basics/driver.cxx b/qt/common/containers/basics/driver.cxx deleted file mode 100644 index 5e38ee1..0000000 --- a/qt/common/containers/basics/driver.cxx +++ /dev/null @@ -1,569 +0,0 @@ -// file : qt/common/containers/basics/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test basic Qt containers persistence. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - for (unsigned short i (0); i < 2; ++i) - { - object empty ("empty"), med ("medium"), full ("full"); - - // - // empty - // - - empty.num = 0; - empty.str = ""; - - // - // med - // - - med.num = 999; - med.str = "xxx"; - - // vector - // - med.nv.push_back (123); - med.nv.push_back (234); - - med.sv.push_back ("aaa"); - med.sv.push_back ("bbbb"); - - med.cv.push_back (comp (123, "aaa")); - med.cv.push_back (comp (234, "bbbb")); - - med.uv.push_back (123); - med.uv.push_back (234); - - // list - // - med.sl.push_back ("aaa"); - med.sl.push_back ("bbbb"); - - med.nl.push_back (123); - med.nl.push_back (234); - - med.cl.push_back (comp (123, "aaa")); - med.cl.push_back (comp (234, "bbbb")); - - // linked list - // - med.sll.push_back ("aaa"); - med.sll.push_back ("bbbb"); - - med.nll.push_back (123); - med.nll.push_back (234); - - med.cll.push_back (comp (123, "aaa")); - med.cll.push_back (comp (234, "bbbb")); - - // set - // - med.ns.insert (123); - med.ns.insert (234); - - med.ss.insert ("aaa"); - med.ss.insert ("bbbb"); - - // map - // - med.nsm[123] = "aaa"; - med.nsm[234] = "bbbb"; - - med.snm["aaa"] = 123; - med.snm["bbbb"] = 234; - - med.ncm[123] = comp (123, "aaa"); - med.ncm[234] = comp (234, "bbbb"); - - med.csm[comp (123, "aaa")] = "aaa"; - med.csm[comp (234, "bbbb")] = "bbbb"; - - // multimap - // - med.nsmm.insert (123, "aaa"); - med.nsmm.insert (123, "bbbb"); - med.nsmm.insert (234, "ccccc"); - - med.snmm.insert ("aaa", 123); - med.snmm.insert ("aaa", 234); - med.snmm.insert ("bbb", 345); - - med.ncmm.insert (123, comp (123, "aaa")); - med.ncmm.insert (123, comp (234, "bbbb")); - med.ncmm.insert (234, comp (345, "ccccc")); - - // hash - // - med.nsh[123] = "aaa"; - med.nsh[234] = "bbbb"; - - med.snh["aaa"] = 123; - med.snh["bbb"] = 234; - - med.sch["iii"] = comp (123, "aaa"); - med.sch["jjj"] = comp (234, "bbbb"); - - // multihash - // - med.nsmh.insert (123, "aaa"); - med.nsmh.insert (123, "bbbb"); - med.nsmh.insert (234, "ccccc"); - - med.snmh.insert ("aaa", 123); - med.snmh.insert ("aaa", 234); - med.snmh.insert ("bbb", 345); - - med.ncmh.insert (123, comp (123, "aaa")); - med.ncmh.insert (123, comp (234, "bbbb")); - med.ncmh.insert (234, comp (345, "ccccc")); - - // - // full - // - - full.num = 9999; - full.str = "xxxx"; - - // vector - // - full.nv.push_back (1234); - full.nv.push_back (2345); - full.nv.push_back (3456); - - full.sv.push_back ("aaaa"); - full.sv.push_back ("bbbbb"); - full.sv.push_back ("cccccc"); - - full.cv.push_back (comp (1234, "aaaa")); - full.cv.push_back (comp (2345, "bbbbb")); - full.cv.push_back (comp (3456, "cccccc")); - - full.uv.push_back (1234); - full.uv.push_back (2345); - full.uv.push_back (3456); - - // list - // - full.sl.push_back ("aaaa"); - full.sl.push_back ("bbbbb"); - full.sl.push_back ("cccccc"); - - full.nl.push_back (1234); - full.nl.push_back (2345); - full.nl.push_back (3456); - - full.cl.push_back (comp (1234, "aaaa")); - full.cl.push_back (comp (2345, "bbbbb")); - full.cl.push_back (comp (3456, "cccccc")); - - // linked list - // - full.sll.push_back ("aaaa"); - full.sll.push_back ("bbbbb"); - full.sll.push_back ("cccccc"); - - full.nll.push_back (1234); - full.nll.push_back (2345); - full.nll.push_back (3456); - - full.cll.push_back (comp (1234, "aaaa")); - full.cll.push_back (comp (2345, "bbbbb")); - full.cll.push_back (comp (3456, "cccccc")); - - // set - // - full.ns.insert (1234); - full.ns.insert (2345); - full.ns.insert (3456); - - full.ss.insert ("aaaa"); - full.ss.insert ("bbbbb"); - full.ss.insert ("cccccc"); - - // map - // - full.nsm[1234] = "aaaa"; - full.nsm[2345] = "bbbbb"; - full.nsm[3456] = "cccccc"; - - full.snm["aaaa"] = 1234; - full.snm["bbbb"] = 2345; - full.snm["cccc"] = 3456; - - full.ncm[1234] = comp (1234, "aaaa"); - full.ncm[2345] = comp (2345, "bbbbb"); - full.ncm[3456] = comp (3456, "cccccc"); - - full.csm[comp (1234, "aaaa")] = "aaaa"; - full.csm[comp (2345, "bbbb")] = "bbbbb"; - full.csm[comp (3456, "cccc")] = "cccccc"; - - // multimap - // - full.nsmm.insert (1234, "aaaa"); - full.nsmm.insert (1234, "bbbbb"); - full.nsmm.insert (2345, "cccccc"); - full.nsmm.insert (2345, "ddddddd"); - - full.snmm.insert ("aaaa", 1234); - full.snmm.insert ("aaaa", 2345); - full.snmm.insert ("bbbb", 3456); - full.snmm.insert ("bbbb", 4567); - - full.ncmm.insert (1234, comp (1234, "aaaa")); - full.ncmm.insert (1234, comp (2345, "bbbbb")); - full.ncmm.insert (2345, comp (3456, "cccccc")); - full.ncmm.insert (2345, comp (4567, "ddddddd")); - - // hash - // - full.nsh[1234] = "aaaa"; - full.nsh[2345] = "bbbbb"; - full.nsh[3456] = "cccccc"; - - full.snh["aaaa"] = 1234; - full.snh["bbbb"] = 2345; - full.snh["cccc"] = 3456; - - full.sch["iiii"] = comp (1234, "aaaa"); - full.sch["jjjj"] = comp (2345, "bbbbb"); - full.sch["kkkk"] = comp (3456, "cccccc"); - - // multihash - // - full.nsmh.insert (1234, "aaaa"); - full.nsmh.insert (1234, "bbbbb"); - full.nsmh.insert (2345, "cccccc"); - full.nsmh.insert (2345, "ddddddd"); - - full.snmh.insert ("aaaa", 1234); - full.snmh.insert ("aaaa", 2345); - full.snmh.insert ("bbbb", 3456); - full.snmh.insert ("bbbb", 4567); - - full.ncmh.insert (1234, comp (1234, "aaaa")); - full.ncmh.insert (1234, comp (2345, "bbbbb")); - full.ncmh.insert (2345, comp (3456, "cccccc")); - full.ncmh.insert (2345, comp (4567, "ddddddd")); - - // persist - // - { - transaction t (db->begin ()); - db->persist (empty); - db->persist (med); - db->persist (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // - // empty - // - - empty.num = 99; - empty.str = "xx"; - - // vector - // - empty.nv.push_back (12); - empty.sv.push_back ("aa"); - empty.cv.push_back (comp (12, "aa")); - empty.uv.push_back (12); - - // list - // - empty.sl.push_back ("aa"); - empty.nl.push_back (12); - empty.cl.push_back (comp (12, "aa")); - - // linked list - // - empty.nll.push_back (12); - empty.sll.push_back ("aa"); - empty.cll.push_back (comp (12, "aa")); - - // set - // - empty.ns.insert (12); - empty.ss.insert ("aa"); - - // map - // - empty.nsm[12] = "aa"; - empty.snm["aa"] = 12; - empty.ncm[12] = comp (12, "aa"); - empty.csm[comp (12, "aa")] = "aa"; - - // multimap - // - empty.nsmm.insert (12, "aa"); - empty.nsmm.insert (12, "bbb"); - empty.nsmm.insert (23, "cccc"); - empty.snmm.insert ("aa", 12); - empty.snmm.insert ("aa", 23); - empty.snmm.insert ("bb", 34); - empty.ncmm.insert (12, comp (12, "aa")); - empty.ncmm.insert (12, comp (23, "bb")); - empty.ncmm.insert (23, comp (34, "cc")); - - // hash - // - empty.nsh[12] = "aa"; - empty.snh["aa"] = 12; - empty.sch["ii"] = comp (12, "aa"); - - // multihash - // - empty.nsmh.insert (12, "aa"); - empty.nsmh.insert (12, "bbb"); - empty.nsmh.insert (23, "cccc"); - empty.snmh.insert ("aa", 12); - empty.snmh.insert ("aa", 23); - empty.snmh.insert ("bb", 34); - empty.ncmh.insert (12, comp (12, "aa")); - empty.ncmh.insert (12, comp (23, "bb")); - empty.ncmh.insert (23, comp (34, "cc")); - - // - // med - // - - med.num = 0; - med.str = ""; - - // vector - // - med.nv.clear (); - med.sv.clear (); - med.cv.clear (); - med.uv.clear (); - - // list - // - med.sl.clear (); - med.nl.clear (); - med.cl.clear (); - - // linked list - // - med.nll.clear (); - med.sll.clear (); - med.cll.clear (); - - // set - // - med.ns.clear (); - med.ss.clear (); - - // map - // - med.nsm.clear (); - med.snm.clear (); - med.ncm.clear (); - med.csm.clear (); - - // multimap - // - med.nsmm.clear (); - med.snmm.clear (); - med.ncmm.clear (); - - // hash - // - med.nsh.clear (); - med.snh.clear (); - med.sch.clear (); - - // multihash - // - med.nsmh.clear (); - med.snmh.clear (); - med.ncmh.clear (); - - - // - // full - // - - full.num++; - full.str += "x"; - - // vector - // - full.nv.back ()++; - full.nv.push_back (4567); - - full.sv.back () += "c"; - full.sv.push_back ("ddddddd"); - - full.cv.back ().num++; - full.cv.back ().str += "c"; - full.cv.push_back (comp (4567, "ddddddd")); - - full.uv.back ()++; - full.uv.push_back (4567); - - // list - // - full.sl.back () += "c"; - full.sl.push_back ("ddddddd"); - - full.nl.back ()++; - full.nl.push_back (4567); - - full.cl.back ().num++; - full.cl.back ().str += "c"; - full.cl.push_back (comp (4567, "ddddddd")); - - // linked list - // - full.sll.back () += "c"; - full.sll.push_back ("ddddddd"); - - full.nll.back ()++; - full.nll.push_back (4567); - - full.cll.back ().num++; - full.cll.back ().str += "c"; - full.cll.push_back (comp (4567, "ddddddd")); - - // set - // - full.ns.insert (4567); - full.ss.insert ("ddddddd"); - - // map - // - full.nsm[3456] += "c"; - full.nsm[4567] = "ddddddd"; - - full.snm["cccc"]++; - full.snm["dddd"] = 4567; - - full.ncm[3456].num++; - full.ncm[3456].str += "c"; - full.ncm[4567] = comp (4567, "ddddddd"); - - full.csm[comp (3456, "cccc")] += "c"; - full.csm[comp (4567, "dddd")] = "ddddddd"; - - // multimap - // - full.nsmm.find (2345).value () += "d"; - full.nsmm.insert (3456, "eeeeeeee"); - - full.snmm.find ("bbbb").value ()++; - full.snmm.insert ("cccc", 5678); - - full.ncmm.find (1234).value ().num++; - full.ncmm.find (2345).value ().str += "d"; - full.ncmm.insert (3456, comp (5678, "eeeeeeee")); - - // hash - // - full.nsh[3456] += "c"; - full.nsh[4567] = "ddddddd"; - - full.snh["cccc"]++; - full.snh["dddd"] = 4567; - - full.sch["iiii"].num++; - full.sch["jjjj"].str += "b"; - full.sch["kkkk"] = comp (4567, "dddddddd"); - - // multihash - // - full.nsmh.find (2345).value () += "d"; - full.nsmh.insert (3456, "eeeeeeee"); - - full.snmh.find ("bbbb").value ()++; - full.snmh.insert ("cccc", 5678); - - full.ncmh.find (1234).value ().num++; - full.ncmh.find (2345).value ().str += "d"; - full.ncmh.insert (3456, comp (5678, "eeeeeeee")); - - // update - // - { - transaction t (db->begin ()); - db->update (empty); - db->update (med); - db->update (full); - t.commit (); - } - - // load & check - // - { - transaction t (db->begin ()); - auto_ptr e (db->load ("empty")); - auto_ptr m (db->load ("medium")); - auto_ptr f (db->load ("full")); - t.commit (); - - assert (empty == *e); - assert (med == *m); - assert (full == *f); - } - - // erase - // - if (i == 0) - { - transaction t (db->begin ()); - db->erase ("empty"); - db->erase ("medium"); - db->erase ("full"); - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/containers/basics/test.hxx b/qt/common/containers/basics/test.hxx deleted file mode 100644 index 2c61c88..0000000 --- a/qt/common/containers/basics/test.hxx +++ /dev/null @@ -1,224 +0,0 @@ -// file : qt/common/containers/basics/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#pragma db value -struct comp -{ - comp () {} - comp (int n, const QString& s) : num (n), str (s) {} - - #pragma db column("number") - int num; - QString str; -}; - -inline bool -operator== (const comp& x, const comp& y) -{ - return x.num == y.num && x.str == y.str; -} - -inline bool -operator< (const comp& x, const comp& y) -{ - return x.num != y.num ? x.num < y.num : x.str < y.str; -} - -typedef QVector num_vector; -typedef QVector str_vector; -typedef QVector comp_vector; - -typedef QList num_list; -typedef QList str_list; -typedef QList comp_list; - -typedef QLinkedList num_linked_list; -typedef QLinkedList str_linked_list; -typedef QLinkedList comp_linked_list; - -typedef QSet num_set; -typedef QSet str_set; - -typedef QMap num_str_map; -typedef QMap str_num_map; -typedef QMap num_comp_map; -typedef QMap comp_str_map; - -typedef QMultiMap num_str_multimap; -typedef QMultiMap str_num_multimap; -typedef QMultiMap num_comp_multimap; - -typedef QHash num_str_hash; -typedef QHash str_num_hash; -typedef QHash str_comp_hash; - -typedef QMultiHash num_str_multihash; -typedef QMultiHash str_num_multihash; -typedef QMultiHash num_comp_multihash; - -#pragma db value -struct cont_comp1 -{ - // This composite value does not have any columns. - // - num_vector sv; // Have the name "conflict" with the one in the object. -}; - -#pragma db value -struct cont_comp2 -{ - cont_comp2 (): num (777), str ("ggg") {} - - int num; - str_list sl; - QString str; -}; - -#pragma db object -struct object -{ - object (): nv (comp1_.sv), sl (comp2_.sl) {} - object (const QString& id) : id_ (id), nv (comp1_.sv), sl (comp2_.sl) {} - - #pragma db id - QString id_; - - int num; - - cont_comp1 comp1_; - cont_comp2 comp2_; - - // vector - // - #pragma db transient - num_vector& nv; - - #pragma db table("object_strings") id_column ("obj_id") - str_vector sv; - - #pragma db value_column("") - comp_vector cv; - - #pragma db unordered - num_vector uv; - - // list - // - #pragma db transient - str_list& sl; - - num_list nl; - comp_list cl; - - // linked list - // - str_linked_list sll; - num_linked_list nll; - comp_linked_list cll; - - // set - // - num_set ns; - str_set ss; - - // map - // - num_str_map nsm; - str_num_map snm; - num_comp_map ncm; - comp_str_map csm; - - // multimap - // - num_str_multimap nsmm; - str_num_multimap snmm; - num_comp_multimap ncmm; - - // hash - // - num_str_hash nsh; - str_num_hash snh; - str_comp_hash sch; - - // multihash - // - num_str_multihash nsmh; - str_num_multihash snmh; - num_comp_multihash ncmh; - - QString str; -}; - -inline bool -operator== (const object& x, const object& y) -{ - if (x.uv.size () != y.uv.size ()) - return false; - - int xs (0), ys (0); - - for (num_vector::size_type i (0); i < x.uv.size (); ++i) - { - xs += x.uv[i]; - ys += y.uv[i]; - } - - return - x.id_ == y.id_ && - x.num == y.num && - - x.comp2_.num == y.comp2_.num && - x.comp2_.str == y.comp2_.str && - - x.nv == y.nv && - x.sv == y.sv && - x.cv == y.cv && - xs == ys && - - x.sl == y.sl && - x.nl == y.nl && - x.cl == y.cl && - - x.nll == y.nll && - x.sll == y.sll && - x.cll == y.cll && - - x.ns == y.ns && - x.ss == y.ss && - - x.nsm == y.nsm && - x.snm == y.snm && - x.ncm == y.ncm && - x.csm == y.csm && - - x.nsmm.uniqueKeys () == y.nsmm.uniqueKeys () && - x.snmm.uniqueKeys () == y.snmm.uniqueKeys () && - x.ncmm.uniqueKeys () == y.ncmm.uniqueKeys () && - - x.nsh == y.nsh && - x.snh == y.snh && - x.sch == y.sch && - - x.nsmh.uniqueKeys () == y.nsmh.uniqueKeys () && - x.snmh.uniqueKeys () == y.snmh.uniqueKeys () && - x.ncmh.uniqueKeys () == y.ncmh.uniqueKeys () && - - x.str == y.str; -} - -#endif // TEST_HXX diff --git a/qt/common/containers/change-tracking/driver.cxx b/qt/common/containers/change-tracking/driver.cxx deleted file mode 100644 index 8157d96..0000000 --- a/qt/common/containers/change-tracking/driver.cxx +++ /dev/null @@ -1,643 +0,0 @@ -// file : qt/common/containers/change-tracking/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test change-tracking Qt containers. -// - -#include // HAVE_CXX11 - -#include // std::auto_ptr -#include -#include - -#ifdef HAVE_CXX11 -# include // std::move -#endif - -#include // QT_VERSION, Q_FOREACH -#include - -#include -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -struct counting_tracer: odb::tracer -{ - void - reset (transaction& tr) {u = i = d = s = t = 0; tr.tracer (*this);} - - virtual void - execute (odb::connection&, const char* stmt) - { - string p (stmt, 6); - if (p == "UPDATE") - u++; - else if (p == "INSERT") - i++; - else if (p == "DELETE") - d++; - else if (p == "SELECT") - s++; - t++; - } - - size_t u, i, d, s, t; -}; - -static counting_tracer tr; - -// Compilation test: instantiate all the functions. Only do this if we -// have a fairly recent version of Qt, otherwise some underlying -// functions will be missing. -// -#if QT_VERSION >= 0x050000 -template class QOdbList; -template class QOdbListIteratorImpl >; -template class QOdbListIterator; -template class QMutableOdbListIterator; -#endif - -void -f (const QList&) {} - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - // Test extended interface. - // - { - typedef QOdbList list; - - list ol; - QList ql; - f (ol); // Implicit conversion to QList. - list ol1 (ql); // Initialization from QList. - ol = ql; // Assignement from QList. - - // Container comparison. - // - if (ol != ol1 || - ol != ql || - ql != ol1) - ol.clear (); - - // Container operators. - // - ol += ol1; - ol += ql; - ol = ol1 + ql; - ol = ql + ol1; - - // Iterator comparison/conversion. - // -#ifndef QT_STRICT_ITERATORS - list::const_iterator i (ol.begin ()); - if (i != ol.end ()) - i = ol.end (); -#endif - - Q_FOREACH (const int& i, ol) - cerr << i; - } - - auto_ptr db (create_database (argc, argv)); - - // Test traits logic. - // - { - object o ("1"); - o.i = 123; - o.s.push_back ("a"); - - assert (!o.s._tracking ()); - - // persist - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - assert (o.s._tracking ()); - - // load - // - { - transaction t (db->begin ()); -#ifdef HAVE_CXX11 - unique_ptr p (db->load ("1")); -#else - auto_ptr p (db->load ("1")); -#endif - assert (p->s._tracking ()); - t.commit (); - } - - // update - // - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - assert (o.s._tracking ()); - - // erase - // - { - transaction t (db->begin ()); - db->erase (o); - t.commit (); - } - - assert (!o.s._tracking ()); - } - - // Test change tracking. - // - object o ("1"); - o.i = 123; - o.s.push_back ("a"); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // push_back/pop_back - // - { - o.s.push_back ("b"); // insert - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.pop_back (); - o.s.push_back ("c"); // update - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.pop_back (); // delete - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.push_back ("b"); - o.s.pop_back (); // no-op - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.t == 1); - assert (*db->load ("1") == o); - t.commit (); - } - - // insert - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.begin (), "a1"); // insert front - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.i == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.begin () + 1, "a2"); // insert middle - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.i == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.insert (o.s.end (), "b1"); // insert back - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // erase - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - o.s.push_back ("d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.begin ()); // erase front - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 4 && tr.d == 1 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.begin () + 1); // erase middle - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.d == 1 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.erase (o.s.end () - 1); // erase back - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // modify - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - o.s.push_back ("d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.modify (1) += 'b'; - o.s.modify_back () += 'd'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.modify_front () += 'a'; - o.s.modify_back () += 'd'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.t == 3); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.begin ().modify () += 'a'; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 2 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.mbegin (); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 5 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - // clear - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.clear (); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.d == 1 && tr.t == 2); - assert (*db->load ("1") == o); - t.commit (); - } - - // assign - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - QList v; - v.push_back ("1"); - v.push_back ("2"); - v.push_back ("3"); - v.push_back ("4"); - o.s = v; - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 4 && tr.i == 1 && tr.t == 5); - assert (*db->load ("1") == o); - t.commit (); - } - - // removeOne/removeAll - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - o.s.push_back ("a"); - o.s.push_back ("d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.removeOne ("c"); - assert (o.s.size () == 5 && o.s[3] == "a"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.d == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - { - o.s.removeAll ("a"); - assert (o.s.size () == 2 && o.s[0] == "b" && o.s[1] == "d"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 3 && tr.d == 1 && tr.t == 4); - assert (*db->load ("1") == o); - t.commit (); - } - - // Transaction rollback. - // - { - o.s.clear (); - o.s.push_back ("a"); - o.s.push_back ("b"); - o.s.push_back ("c"); - - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (*db->load ("1") == o); - t.commit (); - } - - { - { - o.s.push_back ("d"); - - transaction t (db->begin ()); - db->update (o); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (o); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Armed copy. - // - { - -#ifdef HAVE_CXX11 - unique_ptr c; -#else - auto_ptr c; -#endif - - - { - o.s.pop_back (); - - transaction t (db->begin ()); - db->update (o); - c.reset (new object (o)); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 3 && tr.d == 1 && tr.t == 5); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } - - // Armed swap. - // -#if QT_VERSION >= 0x040800 - { - object c (o); - - { - o.s.push_back ("d"); - - transaction t (db->begin ()); - db->update (o); - assert (o.s._tracking () && !c.s._tracking ()); - c.s.swap (o.s); - assert (!o.s._tracking () && c.s._tracking ()); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 4 && tr.d == 1 && tr.t == 6); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } -#endif - - // Armed move. - // -#ifdef HAVE_CXX11 - { - unique_ptr c; - - { - o.s.pop_back (); - - transaction t (db->begin ()); - db->update (o); - assert (o.s._tracking ()); - c.reset (new object (std::move (o))); - assert (!o.s._tracking () && c->s._tracking ()); - t.rollback (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.i == 2 && tr.d == 1 && tr.t == 4); - t.commit (); - } - - { - transaction t (db->begin ()); - tr.reset (t); - db->update (c); - assert (tr.u == 1 && tr.t == 1); - t.commit (); - } - } -#endif - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/containers/change-tracking/test.hxx b/qt/common/containers/change-tracking/test.hxx deleted file mode 100644 index 6067581..0000000 --- a/qt/common/containers/change-tracking/test.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : qt/common/containers/change-tracking/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include // HAVE_CXX11 - -#include - -#ifdef HAVE_CXX11 -# include // std::move -#endif - -#include - -#include -#include - -#ifdef HAVE_CXX11 -#pragma db object pointer(std::unique_ptr) -#else -#pragma db object pointer(std::auto_ptr) -#endif -struct object -{ - object () {} - object (const QString& id): id_ (id) {} - -#ifdef HAVE_CXX11 - object (const object& x): id_ (x.id_), i (x.i), s (x.s) {} - object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {} -#endif - - #pragma db id - QString id_; - - unsigned int i; - - QOdbList s; - - inline bool - operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;} -}; - -#endif // TEST_HXX diff --git a/qt/common/smart-ptr/driver.cxx b/qt/common/smart-ptr/driver.cxx deleted file mode 100644 index 2c7c38a..0000000 --- a/qt/common/smart-ptr/driver.cxx +++ /dev/null @@ -1,248 +0,0 @@ -// file : qt/common/smart-ptr/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt smart pointers. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -// Force instantiation of all QLazySharedPointer and QLazyWeakPointer -// class template members. -// -template class QLazySharedPointer; -template class QLazyWeakPointer; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - QSharedPointer c1 (new cont (1)); - QSharedPointer c2 (new cont (2)); - - // Test boolean conversion operator. - // - { - assert (!QLazySharedPointer ()); - assert (!QLazyWeakPointer ()); - assert (QLazySharedPointer (c1)); - assert (QLazySharedPointer (*db, 1)); - assert (QLazyWeakPointer (c1)); - assert (QLazyWeakPointer (*db, 1)); - } - - // Test loaded () implementation. - // - { - assert (QLazySharedPointer ().loaded ()); - assert (!QLazySharedPointer (c1).loaded ()); - assert (!QLazySharedPointer (*db, 1).loaded ()); - assert (QLazySharedPointer (*db, c1).loaded ()); - assert (QLazyWeakPointer ().loaded ()); - assert (!QLazyWeakPointer (c1).loaded ()); - assert (!QLazyWeakPointer (*db, 1).loaded ()); - assert (QLazyWeakPointer (*db, c1).loaded ()); - } - - // Test comparison operators. - // - { - // Transient QLazySharedPointer. - // - assert (QLazySharedPointer () == QLazySharedPointer ()); - assert (QLazySharedPointer () != QLazySharedPointer (c1)); - assert (QLazySharedPointer (c1) != QLazySharedPointer (c2)); - assert (QLazySharedPointer (c2) == QLazySharedPointer (c2)); - - // Persistent QLazySharedPointer. - // - QLazySharedPointer ls1 (*db, 1), ls2 (*db, c2); - assert (ls1 != QLazySharedPointer ()); - assert (ls1 != QLazySharedPointer (c1)); - assert (ls1 == QLazySharedPointer (*db, c1)); - assert (ls1 != ls2); - assert (ls2 == QLazySharedPointer (c2)); - - // Transient QLazyWeakPointer. - // - assert (QLazyWeakPointer () == QLazyWeakPointer ()); - assert (QLazyWeakPointer () != QLazyWeakPointer (c1)); - assert (QLazyWeakPointer (c1) != QLazyWeakPointer (c2)); - assert (QLazyWeakPointer (c2) == QLazyWeakPointer (c2)); - assert (QLazyWeakPointer () == QLazySharedPointer ()); - assert (QLazyWeakPointer () != QLazySharedPointer (c1)); - assert (QLazyWeakPointer (c1) != QLazySharedPointer (c2)); - assert (QLazyWeakPointer (c2) == QLazySharedPointer (c2)); - - // Persistent QLazyWeakPointer. - // - QLazyWeakPointer lw1 (*db, 1), lw2 (*db, c2); - assert (lw1 != QLazyWeakPointer ()); - assert (lw1 != QLazyWeakPointer (c1)); - assert (lw1 == QLazyWeakPointer (*db, c1)); - assert (lw1 != lw2); - assert (lw2 == QLazyWeakPointer (c2)); - assert (ls1 == lw1); - assert (ls1 != QLazyWeakPointer (c1)); - assert (ls1 == QLazyWeakPointer (*db, c1)); - assert (ls1 != lw2); - assert (ls2 == QLazyWeakPointer (c2)); - } - - // Test swap. - // - { - QLazySharedPointer lx (*db, 1), ly; - swap (lx, ly); - - assert (lx.isNull ()); - assert (ly == QLazySharedPointer (*db, c1)); - } - - // Persist. - // - QSharedPointer o1 (new obj (1)); - QSharedPointer o2 (new obj (2)); - QSharedPointer o3 (new obj (3)); - QSharedPointer o4 (new obj (4)); - - o1->c = c1; - o2->c = c1; - o3->c = c2; - o4->c = c2; - - { - transaction t (db->begin ()); - - db->persist (c1); - - db->persist (o1); - db->persist (o2); - db->persist (o3); - db->persist (o4); - - db->persist (c2); - - t.commit (); - } - - // Load. - // - { - session s; - transaction t (db->begin ()); - - QSharedPointer c (db->load (1)); - QSharedPointer o (db->load (1)); - - // Ensure that lazy pointers are present but not loaded. - // - assert (c->o.size () == 2); - assert (!c->o[0].loaded ()); - assert (!c->o[1].loaded ()); - assert (!o->c.loaded ()); - - // Ensure that the correct object IDs were loaded. - // - assert (c->o[0].objectId () == 1); - assert (c->o[1].objectId () == 2); - assert (o->c.objectId () == 1); - - // Load the lazy pointer targets ensuring that the loaded - // targets correspond to the cached session objects. - // - QSharedPointer cl (o->c.load ()); - QSharedPointer ol (c->o[0].load ()); - - assert (c->o[0].loaded ()); - assert (o->c.loaded ()); - - assert (cl == c); - assert (ol == o); - - t.commit (); - } - - // Test lazy weak locking and reloading. - // - { - // No session. - // - transaction t (db->begin ()); - QSharedPointer c (db->load (1)); - - // Lock. - // - assert (!c->o[1].loaded ()); - QLazySharedPointer l (c->o[1].toStrongRef ()); - assert (!l.loaded ()); - assert (l.objectId () == c->o[1].objectId ()); - - // Reload. - // - assert (!c->o[1].loaded ()); - - QSharedPointer ol (c->o[1].load ()); - assert (c->o[1].loaded ()); - - ol.clear (); - assert (!c->o[1].loaded ()); - - ol = c->o[1].load (); - assert (c->o[1].loaded ()); - - t.commit (); - } - - // - // Test QSharedPointer as a value wrapper. - // - - { - obj2 o1 (1); - obj2 o2 (2); - o2.num = QSharedPointer (new unsigned long (123)); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - QSharedPointer o1 (db->load (1)); - QSharedPointer o2 (db->load (2)); - t.commit (); - - assert (!o1->num); - assert (o2->num && *o2->num == 123); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/smart-ptr/test.hxx b/qt/common/smart-ptr/test.hxx deleted file mode 100644 index 2c8bf36..0000000 --- a/qt/common/smart-ptr/test.hxx +++ /dev/null @@ -1,77 +0,0 @@ -// file : qt/common/smart-ptr/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#include -#include - -struct obj; - -#pragma db object -struct cont -{ - cont () - { - } - - cont (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - typedef std::vector > obj_list; - - #pragma db inverse(c) value_not_null - obj_list o; -}; - -#pragma db object -struct obj -{ - obj () - { - } - - obj (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - #pragma db not_null - QLazySharedPointer c; -}; - -// Test QSharedPointer as a value wrapper. -// -#pragma db object -struct obj2 -{ - obj2 () - { - } - - obj2 (unsigned long id) - : id (id) - { - } - - #pragma db id - unsigned long id; - - #pragma db null - QSharedPointer num; -}; - -#endif // TEST_HXX diff --git a/qt/common/template/driver.cxx b/qt/common/template/driver.cxx deleted file mode 100644 index 30f9fc6..0000000 --- a/qt/common/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/common/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/common/template/template-qt4-vc10.vcxproj b/qt/common/template/template-qt4-vc10.vcxproj deleted file mode 100644 index fddcac3..0000000 --- a/qt/common/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,177 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt4-vc10.vcxproj.filters b/qt/common/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt4-vc11.vcxproj b/qt/common/template/template-qt4-vc11.vcxproj deleted file mode 100644 index a71ac6b..0000000 --- a/qt/common/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt4-vc11.vcxproj.filters b/qt/common/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt4-vc12.vcxproj b/qt/common/template/template-qt4-vc12.vcxproj deleted file mode 100644 index eaa4d12..0000000 --- a/qt/common/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt4-vc12.vcxproj.filters b/qt/common/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt4-vc8.vcproj b/qt/common/template/template-qt4-vc8.vcproj deleted file mode 100644 index 63fc22c..0000000 --- a/qt/common/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/qt/common/template/template-qt4-vc9.vcproj b/qt/common/template/template-qt4-vc9.vcproj deleted file mode 100644 index b37675e..0000000 --- a/qt/common/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/qt/common/template/template-qt5-vc10.vcxproj b/qt/common/template/template-qt5-vc10.vcxproj deleted file mode 100644 index add071a..0000000 --- a/qt/common/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,177 +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;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt5-vc10.vcxproj.filters b/qt/common/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc11.vcxproj b/qt/common/template/template-qt5-vc11.vcxproj deleted file mode 100644 index 07daa25..0000000 --- a/qt/common/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,181 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt5-vc11.vcxproj.filters b/qt/common/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc12.vcxproj b/qt/common/template/template-qt5-vc12.vcxproj deleted file mode 100644 index a64ba40..0000000 --- a/qt/common/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-__value__(database)-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;__upcase__(database_)__upcase__(__value__(database));HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-__value__(database).lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - - -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - - - - diff --git a/qt/common/template/template-qt5-vc12.vcxproj.filters b/qt/common/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index f3ee658..0000000 --- a/qt/common/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__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) -__source_filter_entry__(test-odb.cxx) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/common/template/template-qt5-vc9.vcproj b/qt/common/template/template-qt5-vc9.vcproj deleted file mode 100644 index 57b4edc..0000000 --- a/qt/common/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,360 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__source_entry__(test-odb.cxx) -__source_entries__(extra_sources) - - -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx) -__file_entries__(extra_headers) - - - - - diff --git a/qt/common/template/test.hxx b/qt/common/template/test.hxx deleted file mode 100644 index 6f38186..0000000 --- a/qt/common/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/common/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/qt/mssql/basic/driver.cxx b/qt/mssql/basic/driver.cxx deleted file mode 100644 index fca335d..0000000 --- a/qt/mssql/basic/driver.cxx +++ /dev/null @@ -1,65 +0,0 @@ -// file : qt/mssql/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence. SQL Server version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - o.id_ = "object 1"; - o.sstr_ = QString (512, 's'); - o.lstr_ = QString (65000, 'l'); // Test temp buffer boundary. - o.snstr_ = QString (512, QChar (0x1234)); - o.lnstr_ = QString (65536, QChar (0x2345)); - o.sbuf_ = QByteArray (512, 0x01); - o.lbuf_ = QByteArray (65536, 0x02); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.id_)); - t.commit (); - - assert (*p == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mssql/basic/test.hxx b/qt/mssql/basic/test.hxx deleted file mode 100644 index bce87b6..0000000 --- a/qt/mssql/basic/test.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : qt/mssql/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - id_ == x.id_ && - sstr_ == x.sstr_ && - lstr_ == x.lstr_ && - snstr_ == x.snstr_ && - lnstr_ == x.lnstr_ && - sbuf_ == x.sbuf_ && - lbuf_ == x.lbuf_; - } - - #pragma db id - QString id_; - - QString sstr_; - - #pragma db type ("VARCHAR(max)") - QString lstr_; - - #pragma db type ("NVARCHAR(512)") - QString snstr_; - - #pragma db type ("NVARCHAR(max)") - QString lnstr_; - - #pragma db type ("VARBINARY(512)") - QByteArray sbuf_; - - QByteArray lbuf_; -}; - -#endif // TEST_HXX diff --git a/qt/mssql/date-time/driver.cxx b/qt/mssql/date-time/driver.cxx deleted file mode 100644 index 9b4320e..0000000 --- a/qt/mssql/date-time/driver.cxx +++ /dev/null @@ -1,94 +0,0 @@ -// file : qt/mssql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt date/time type persistence. SQL Server version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Check persistence of null values. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (ol->is_null ()); - } - - // Check persistence of valid dates and times. - // -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - QDateTime t (QDateTime::currentDateTime ()); - - o.date = t.date (); - o.date_time = t; -#endif - - // In DATETIME fractional seconds are rounded to .000, .003, or .007. - // - o.date_time_dt = QDateTime (QDate (2012, 1, 14), - QTime (11, 57, 13, 3)); - - // SMALLDATETIME doesn't have seconds (always 0). - // - o.date_time_sdt = QDateTime (QDate (2012, 1, 14), - QTime (11, 57, 0, 0)); - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - o.time = t.time (); -#endif - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx deleted file mode 100644 index 71769b9..0000000 --- a/qt/mssql/date-time/test.hxx +++ /dev/null @@ -1,68 +0,0 @@ -// file : qt/mssql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - QDate date; - - QDateTime date_time; -#endif - - #pragma db type ("DATETIME") - QDateTime date_time_dt; - - #pragma db type ("SMALLDATETIME") - QDateTime date_time_sdt; - -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - QTime time; -#endif - - bool - operator== (const object& x) const - { - return - id == x.id -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && date == x.date - && date_time == x.date_time -#endif - && date_time_dt == x.date_time_dt - && date_time_sdt == x.date_time_sdt -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && time == x.time -#endif - ; - } - - bool - is_null () const - { - return - true -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && date.isNull () - && date_time.isNull () -#endif - && date_time_dt.isNull () - && date_time_sdt.isNull () -#if !defined(MSSQL_SERVER_VERSION) || MSSQL_SERVER_VERSION >= 1000 - && time.isNull () -#endif - ; - } -}; - -#endif // TEST_HXX diff --git a/qt/mssql/template/driver.cxx b/qt/mssql/template/driver.cxx deleted file mode 100644 index 97ef6ef..0000000 --- a/qt/mssql/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/mssql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mssql/template/template-qt4-vc10.vcxproj b/qt/mssql/template/template-qt4-vc10.vcxproj deleted file mode 100644 index e4902d0..0000000 --- a/qt/mssql/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt4-vc10.vcxproj.filters b/qt/mssql/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt4-vc11.vcxproj b/qt/mssql/template/template-qt4-vc11.vcxproj deleted file mode 100644 index b9dd89c..0000000 --- a/qt/mssql/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt4-vc11.vcxproj.filters b/qt/mssql/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt4-vc12.vcxproj b/qt/mssql/template/template-qt4-vc12.vcxproj deleted file mode 100644 index 0916a38..0000000 --- a/qt/mssql/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt4-vc12.vcxproj.filters b/qt/mssql/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt4-vc8.vcproj b/qt/mssql/template/template-qt4-vc8.vcproj deleted file mode 100644 index 38916fa..0000000 --- a/qt/mssql/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mssql/template/template-qt4-vc9.vcproj b/qt/mssql/template/template-qt4-vc9.vcproj deleted file mode 100644 index da1b5ab..0000000 --- a/qt/mssql/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mssql/template/template-qt5-vc10.vcxproj b/qt/mssql/template/template-qt5-vc10.vcxproj deleted file mode 100644 index 508e262..0000000 --- a/qt/mssql/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt5-vc10.vcxproj.filters b/qt/mssql/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj b/qt/mssql/template/template-qt5-vc11.vcxproj deleted file mode 100644 index a974034..0000000 --- a/qt/mssql/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt5-vc11.vcxproj.filters b/qt/mssql/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc12.vcxproj b/qt/mssql/template/template-qt5-vc12.vcxproj deleted file mode 100644 index 40e2fbb..0000000 --- a/qt/mssql/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mssql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mssql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mssql/template/template-qt5-vc12.vcxproj.filters b/qt/mssql/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mssql/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mssql/template/template-qt5-vc9.vcproj b/qt/mssql/template/template-qt5-vc9.vcproj deleted file mode 100644 index 66ea9ab..0000000 --- a/qt/mssql/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mssql/template/test.hxx b/qt/mssql/template/test.hxx deleted file mode 100644 index 033703a..0000000 --- a/qt/mssql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/mssql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/qt/mysql/basic/driver.cxx b/qt/mysql/basic/driver.cxx deleted file mode 100644 index b685d68..0000000 --- a/qt/mysql/basic/driver.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : qt/mysql/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence. MySQL version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - o.str = "Constantin Michael"; - o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.str)); - t.commit (); - - assert (*p == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mysql/basic/test.hxx b/qt/mysql/basic/test.hxx deleted file mode 100644 index 6dd246e..0000000 --- a/qt/mysql/basic/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : qt/mysql/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - str == x.str && - blob == x.blob; - } - - #pragma db id - QString str; - - QByteArray blob; -}; - -#endif // TEST_HXX diff --git a/qt/mysql/date-time/driver.cxx b/qt/mysql/date-time/driver.cxx deleted file mode 100644 index 94cf653..0000000 --- a/qt/mysql/date-time/driver.cxx +++ /dev/null @@ -1,178 +0,0 @@ -// file : qt/mysql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt date/time type persistence. MySQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -bool -test_out_of_range_value (object&, database&); - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - mysql_version v; - { - transaction t (db->begin ()); - db->query ().begin ().load (v); - t.commit (); - } - - // If we are running against MySQL 5.6.4 or later alter the tables - // to allow sub-second precision. - // - bool fs (v.major > 5 || - (v.major == 5 && (v.minor > 6 || - (v.minor == 6 && v.release >= 4)))); - if (fs) - { - transaction t (db->begin ()); - db->execute ("ALTER TABLE `qt_mysql_dt_object`" \ - " MODIFY COLUMN `date_time` DATETIME(3)," \ - " MODIFY COLUMN `timestamp` TIMESTAMP(3) NULL," \ - " MODIFY COLUMN `time` TIME(3)"); - t.commit (); - } - - // - // Check valid dates and times. - // - - object o; - - // Check persistence of null values. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (ol->is_null ()); - } - - // Check persistence of valid dates and times. - // - - // Create a QDateTime containing the current date and time - // but with the milliseconds zeroed. MySQL prior to 5.6.4 - // does not support sub-second prevision. - // - QDateTime t (QDateTime::currentDateTime ()); - - if (!fs) - t.setTime (QTime (t.time ().hour (), - t.time ().minute (), - t.time ().second ())); - - o.date = t.date (); - o.date_time = t; - o.timestamp = t; - o.time = t.time (); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - - // - // Check invalid dates and times. - // - - { - // Test out of range dates. - // - object or1, or2; - or1.date = QDate (999, 12, 31); - or2.date = QDate (10000, 1, 1); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, *db)); - assert (test_out_of_range_value (or2, *db)); - t.commit (); - } - - { - // Test out of range date-times. - // - object or1, or2; - or1.date_time = QDateTime (QDate (999, 12, 31), QTime (23, 59, 59)); - or2.date_time = QDateTime (QDate (10000, 1, 1)); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, *db)); - assert (test_out_of_range_value (or2, *db)); - t.commit (); - } - - { - // Test out of range timestamps. - // - object or1, or2; - or1.timestamp = QDateTime (QDate (1970, 1, 1)); - or2.timestamp = QDateTime (QDate (2038, 1, 19), QTime (3, 14, 8)); - - transaction t (db->begin ()); - assert (test_out_of_range_value (or1, *db)); - assert (test_out_of_range_value (or2, *db)); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_out_of_range_value (object& x, database& db) -{ - try - { - db.persist (x); - return false; - } - catch (const odb::qt::date_time::value_out_of_range&) - { - } - - return true; -} diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx deleted file mode 100644 index ba31da5..0000000 --- a/qt/mysql/date-time/test.hxx +++ /dev/null @@ -1,70 +0,0 @@ -// file : qt/mysql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - id == x.id && - date == x.date && - date_time == x.date_time && - timestamp == x.timestamp && - time == x.time; - } - - bool - is_null () const - { - return - date.isNull () && - date_time.isNull () && - timestamp.isNull () && - time.isNull (); - } - - #pragma db id auto - unsigned long id; - - QDate date; - QDateTime date_time; - - // Make timestamp NULL-able to suppress the auto-initialization and - // auto-update characteristics of the TIMESTAMP datatype, and to - // allow NULL values. - // - #pragma db type("TIMESTAMP") null - QDateTime timestamp; - - QTime time; -}; - -// MySQL server version view. -// -#pragma db view query( \ - "SELECT " \ - "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ - "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ - "@@protocol_version") -struct mysql_version -{ - unsigned int major; - unsigned int minor; - unsigned int release; - - unsigned int protocol; -}; - -#endif // TEST_HXX diff --git a/qt/mysql/template/driver.cxx b/qt/mysql/template/driver.cxx deleted file mode 100644 index 1e293b4..0000000 --- a/qt/mysql/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/mysql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/mysql/template/template-qt4-vc10.vcxproj b/qt/mysql/template/template-qt4-vc10.vcxproj deleted file mode 100644 index 0f57bbe..0000000 --- a/qt/mysql/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt4-vc10.vcxproj.filters b/qt/mysql/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt4-vc11.vcxproj b/qt/mysql/template/template-qt4-vc11.vcxproj deleted file mode 100644 index 33cb785..0000000 --- a/qt/mysql/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt4-vc11.vcxproj.filters b/qt/mysql/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt4-vc12.vcxproj b/qt/mysql/template/template-qt4-vc12.vcxproj deleted file mode 100644 index 6a2812a..0000000 --- a/qt/mysql/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt4-vc12.vcxproj.filters b/qt/mysql/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt4-vc8.vcproj b/qt/mysql/template/template-qt4-vc8.vcproj deleted file mode 100644 index 25e096f..0000000 --- a/qt/mysql/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mysql/template/template-qt4-vc9.vcproj b/qt/mysql/template/template-qt4-vc9.vcproj deleted file mode 100644 index a904d40..0000000 --- a/qt/mysql/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mysql/template/template-qt5-vc10.vcxproj b/qt/mysql/template/template-qt5-vc10.vcxproj deleted file mode 100644 index 27eb1a8..0000000 --- a/qt/mysql/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt5-vc10.vcxproj.filters b/qt/mysql/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj b/qt/mysql/template/template-qt5-vc11.vcxproj deleted file mode 100644 index 7a2e2b9..0000000 --- a/qt/mysql/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt5-vc11.vcxproj.filters b/qt/mysql/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc12.vcxproj b/qt/mysql/template/template-qt5-vc12.vcxproj deleted file mode 100644 index f75d5d3..0000000 --- a/qt/mysql/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-mysql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-mysql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/mysql/template/template-qt5-vc12.vcxproj.filters b/qt/mysql/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/mysql/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/mysql/template/template-qt5-vc9.vcproj b/qt/mysql/template/template-qt5-vc9.vcproj deleted file mode 100644 index c17267b..0000000 --- a/qt/mysql/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/mysql/template/test.hxx b/qt/mysql/template/test.hxx deleted file mode 100644 index 94b806d..0000000 --- a/qt/mysql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/mysql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx deleted file mode 100644 index 43a20e2..0000000 --- a/qt/oracle/basic/driver.cxx +++ /dev/null @@ -1,81 +0,0 @@ -// file : qt/oracle/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence. Oracle version. -// - -#include // std::auto_ptr -#include -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - string short_str (13, 's'); - string medium_str (150, 'm'); - string long_str (20000, 'v'); - // Oracle UTF-8 support is limited to 3-byte sequences. - // - string unicode_str ("a \xD5\x95 \xEA\xAA\xAA \xE2\x82\xAC bcdef"); - - object o; - - o.char_= QString::fromStdString (short_str); - o.varchar2 = QString::fromStdString (medium_str); - o.clob = QString::fromStdString (long_str); - - // fromStdString() assumes ASCII in Qt4 and UTF-8 in Qt5. - // - o.nchar= QString::fromUtf8 (unicode_str.c_str (), - static_cast (unicode_str.size ())); - o.nvarchar2 = QString::fromUtf8 (unicode_str.c_str (), - static_cast (unicode_str.size ())); - o.nclob = QString::fromStdString (long_str); - - o.raw = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); - o.blob = QByteArray (long_str.c_str (), - static_cast (long_str.size ())); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.varchar2)); - t.commit (); - assert (*p == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/oracle/basic/test.hxx b/qt/oracle/basic/test.hxx deleted file mode 100644 index 6781a97..0000000 --- a/qt/oracle/basic/test.hxx +++ /dev/null @@ -1,51 +0,0 @@ -// file : qt/oracle/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - varchar2 == x.varchar2 && - char_ == x.char_ && - nchar == x.nchar && - nvarchar2 == x.nvarchar2 && - clob == x.clob && - nclob == x.nclob && - blob == x.blob && - raw == x.raw; - } - - #pragma db id - QString varchar2; - - #pragma db type ("CHAR(13)") - QString char_; - - #pragma db type ("NCHAR(13)") - QString nchar; - - #pragma db type ("NVARCHAR2(512)") - QString nvarchar2; - - #pragma db type ("CLOB") - QString clob; - - #pragma db type ("NCLOB") - QString nclob; - - QByteArray blob; - - #pragma db type ("RAW(128)") - QByteArray raw; -}; - -#endif // TEST_HXX diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx deleted file mode 100644 index d13fab7..0000000 --- a/qt/oracle/date-time/driver.cxx +++ /dev/null @@ -1,80 +0,0 @@ -// file : qt/oracle/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt date/time type persistence. Oracle version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - - // Check persistence of null values. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (ol->is_null ()); - } - - // Check persistence of valid dates and times. - // - QDateTime t (QDateTime::currentDateTime ()); - - o.date = t.date (); - o.date_time = t; - o.date_time_d = QDateTime (QDate (2012, 6, 27), QTime (14, 17, 05, 0)); - o.time = t.time (); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/oracle/date-time/test.hxx b/qt/oracle/date-time/test.hxx deleted file mode 100644 index 93bc5b7..0000000 --- a/qt/oracle/date-time/test.hxx +++ /dev/null @@ -1,45 +0,0 @@ -// file : qt/oracle/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - id == x.id && - date == x.date && - date_time == x.date_time && - date_time_d == x.date_time_d && - time == x.time; - } - - bool - is_null () const - { - return - date.isNull () && - date_time.isNull () && - date_time_d.isNull () && - time.isNull (); - } - - #pragma db id auto - unsigned long id; - - QDate date; - QDateTime date_time; - #pragma db type("DATE") - QDateTime date_time_d; - QTime time; -}; - -#endif // TEST_HXX diff --git a/qt/oracle/template/driver.cxx b/qt/oracle/template/driver.cxx deleted file mode 100644 index 9b092a9..0000000 --- a/qt/oracle/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/oracle/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/oracle/template/template-qt4-vc10.vcxproj b/qt/oracle/template/template-qt4-vc10.vcxproj deleted file mode 100644 index 6e7c369..0000000 --- a/qt/oracle/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt4-vc10.vcxproj.filters b/qt/oracle/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt4-vc11.vcxproj b/qt/oracle/template/template-qt4-vc11.vcxproj deleted file mode 100644 index ad1e888..0000000 --- a/qt/oracle/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt4-vc11.vcxproj.filters b/qt/oracle/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt4-vc12.vcxproj b/qt/oracle/template/template-qt4-vc12.vcxproj deleted file mode 100644 index 88dffa8..0000000 --- a/qt/oracle/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt4-vc12.vcxproj.filters b/qt/oracle/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt4-vc8.vcproj b/qt/oracle/template/template-qt4-vc8.vcproj deleted file mode 100644 index 187254b..0000000 --- a/qt/oracle/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/oracle/template/template-qt4-vc9.vcproj b/qt/oracle/template/template-qt4-vc9.vcproj deleted file mode 100644 index 292b899..0000000 --- a/qt/oracle/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/oracle/template/template-qt5-vc10.vcxproj b/qt/oracle/template/template-qt5-vc10.vcxproj deleted file mode 100644 index c388d6b..0000000 --- a/qt/oracle/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt5-vc10.vcxproj.filters b/qt/oracle/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj b/qt/oracle/template/template-qt5-vc11.vcxproj deleted file mode 100644 index 79d5d15..0000000 --- a/qt/oracle/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt5-vc11.vcxproj.filters b/qt/oracle/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc12.vcxproj b/qt/oracle/template/template-qt5-vc12.vcxproj deleted file mode 100644 index 2ae82a6..0000000 --- a/qt/oracle/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-oracle-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-oracle.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/oracle/template/template-qt5-vc12.vcxproj.filters b/qt/oracle/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/oracle/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/oracle/template/template-qt5-vc9.vcproj b/qt/oracle/template/template-qt5-vc9.vcproj deleted file mode 100644 index 2712157..0000000 --- a/qt/oracle/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/oracle/template/test.hxx b/qt/oracle/template/test.hxx deleted file mode 100644 index 0ad65cf..0000000 --- a/qt/oracle/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/oracle/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/qt/pgsql/basic/driver.cxx b/qt/pgsql/basic/driver.cxx deleted file mode 100644 index 4c6a78a..0000000 --- a/qt/pgsql/basic/driver.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : qt/pgsql/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence. PostgreSQL version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - o.str = "Constantin Michael"; - o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.str)); - t.commit (); - - assert (*p == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/pgsql/basic/test.hxx b/qt/pgsql/basic/test.hxx deleted file mode 100644 index d4a1ba6..0000000 --- a/qt/pgsql/basic/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : qt/pgsql/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - str == x.str && - blob == x.blob; - } - - #pragma db id - QString str; - - QByteArray blob; -}; - -#endif // TEST_HXX diff --git a/qt/pgsql/date-time/driver.cxx b/qt/pgsql/date-time/driver.cxx deleted file mode 100644 index 43a676d..0000000 --- a/qt/pgsql/date-time/driver.cxx +++ /dev/null @@ -1,108 +0,0 @@ -// file : qt/pgsql/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt date/time type persistence. PostgreSQL version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -bool -test_out_of_range_value (object&, database&); - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - // Check persistence of null values. - // - { - object o; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (ol->is_null ()); - } - } - - // Check persistence of valid dates and times. - // - { - QDateTime ct (QDateTime::currentDateTime ()); - - object o; - o.date = ct.date (); - o.time = ct.time (); - o.date_time = ct; - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - } - - // Test a QDateTime value before PG epoch. - // - { - object o; - o.date_time = QDateTime (QDate (1969, 12, 31), QTime (23, 59, 59, 123)); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol (db->load (o.id)); - t.commit (); - - assert (*ol == o); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/pgsql/date-time/test.hxx b/qt/pgsql/date-time/test.hxx deleted file mode 100644 index 2da5587..0000000 --- a/qt/pgsql/date-time/test.hxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/pgsql/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - id == x.id && - date == x.date && - time == x.time && - date_time == x.date_time; - } - - bool - is_null () const - { - return - date.isNull () && - time.isNull () && - date_time.isNull (); - } - - #pragma db id auto - unsigned long id; - - QDate date; - QTime time; - QDateTime date_time; -}; - -#endif // TEST_HXX diff --git a/qt/pgsql/template/driver.cxx b/qt/pgsql/template/driver.cxx deleted file mode 100644 index 71934a7..0000000 --- a/qt/pgsql/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/pgsql/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/pgsql/template/template-qt4-vc10.vcxproj b/qt/pgsql/template/template-qt4-vc10.vcxproj deleted file mode 100644 index 1c1e1a7..0000000 --- a/qt/pgsql/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt4-vc10.vcxproj.filters b/qt/pgsql/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt4-vc11.vcxproj b/qt/pgsql/template/template-qt4-vc11.vcxproj deleted file mode 100644 index a7e7a86..0000000 --- a/qt/pgsql/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt4-vc11.vcxproj.filters b/qt/pgsql/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt4-vc12.vcxproj b/qt/pgsql/template/template-qt4-vc12.vcxproj deleted file mode 100644 index f1b9924..0000000 --- a/qt/pgsql/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt4-vc12.vcxproj.filters b/qt/pgsql/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt4-vc8.vcproj b/qt/pgsql/template/template-qt4-vc8.vcproj deleted file mode 100644 index 3f364d2..0000000 --- a/qt/pgsql/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/pgsql/template/template-qt4-vc9.vcproj b/qt/pgsql/template/template-qt4-vc9.vcproj deleted file mode 100644 index 2e9e84b..0000000 --- a/qt/pgsql/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/pgsql/template/template-qt5-vc10.vcxproj b/qt/pgsql/template/template-qt5-vc10.vcxproj deleted file mode 100644 index cb6aa0c..0000000 --- a/qt/pgsql/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt5-vc10.vcxproj.filters b/qt/pgsql/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj b/qt/pgsql/template/template-qt5-vc11.vcxproj deleted file mode 100644 index 863bd51..0000000 --- a/qt/pgsql/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt5-vc11.vcxproj.filters b/qt/pgsql/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc12.vcxproj b/qt/pgsql/template/template-qt5-vc12.vcxproj deleted file mode 100644 index 5d958c2..0000000 --- a/qt/pgsql/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-pgsql-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-pgsql.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/pgsql/template/template-qt5-vc12.vcxproj.filters b/qt/pgsql/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/pgsql/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/pgsql/template/template-qt5-vc9.vcproj b/qt/pgsql/template/template-qt5-vc9.vcproj deleted file mode 100644 index b32a1e7..0000000 --- a/qt/pgsql/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/pgsql/template/test.hxx b/qt/pgsql/template/test.hxx deleted file mode 100644 index 8b866bd..0000000 --- a/qt/pgsql/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/pgsql/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/qt/sqlite/basic/driver.cxx b/qt/sqlite/basic/driver.cxx deleted file mode 100644 index 3bae10b..0000000 --- a/qt/sqlite/basic/driver.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : qt/sqlite/basic/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt basic type persistence. SQLite version. -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - object o; - o.str = QString::fromUtf8 ("Constantin Micha\xC3\x88l"); - o.blob = QByteArray ("\0x13\0xDE\0x00\0x00\0x00\0x54\0xF2\0x6A", 8); - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - auto_ptr p (db->load (o.str)); - t.commit (); - - assert (*p == o); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/sqlite/basic/test.hxx b/qt/sqlite/basic/test.hxx deleted file mode 100644 index b0cdf46..0000000 --- a/qt/sqlite/basic/test.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// file : qt/sqlite/basic/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - str == x.str && - blob == x.blob; - } - - #pragma db id - QString str; - - QByteArray blob; -}; - -#endif // TEST_HXX diff --git a/qt/sqlite/date-time/driver.cxx b/qt/sqlite/date-time/driver.cxx deleted file mode 100644 index adf7889..0000000 --- a/qt/sqlite/date-time/driver.cxx +++ /dev/null @@ -1,140 +0,0 @@ -// file : qt/sqlite/date-time/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test Qt date/time type persistence. SQLite version. -// - -#include // std::auto_ptr -#include -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -bool -test_out_of_range_value (object&, database&); - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - // Check persistence of null values. - // - object o1; - { - transaction t (db->begin ()); - db->persist (o1); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol1 (db->load (o1.id)); - t.commit (); - - assert (ol1->is_null ()); - } - - QDateTime ct (QDateTime::currentDateTime ()); - QDateTime ct_no_ms = QDateTime (QDate (ct.date ().year (), - ct.date ().month (), - ct.date ().day ()), - QTime (ct.time ().hour (), - ct.time ().minute (), - ct.time ().second ())); - - // Check persistence of valid dates and times. - // - object o2; - { - o2.date = ct.date (); - o2.unix_day = ct.date (); - o2.time = ct.time (); - - // QTime stored as SQLite INTEGER has second resolution. - // The millsecond part is zeroed to avoid false negatives. - // - o2.seconds = ct_no_ms.time (); - - o2.date_time = ct; - - // UNIX time has second reolution. The millsecond part is - // zeroed to avoid false negatives. - // - o2.unix_time = ct_no_ms; - - transaction t (db->begin ()); - db->persist (o2); - t.commit (); - } - - { - transaction t (db->begin ()); - auto_ptr ol2 (db->load (o2.id)); - t.commit (); - - assert (*ol2 == o2); - } - - // Test out of range values for QDateTime traits UNIX time - // implementation. - // - { - object o; - o.unix_time = QDateTime (QDate (1969, 12, 31), - QTime (23, 59, 59), - Qt::UTC); - - assert (test_out_of_range_value (o, *db)); - } - - // Test out of range values for QDate traits UNIX time - // implementation. - // - { - object o; - o.unix_day = QDate (QDate (1969, 12, 31)); - - assert (test_out_of_range_value (o, *db)); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} - -bool -test_out_of_range_value (object& x, database& db) -{ - try - { - transaction t (db.begin ()); - db.persist (x); - t.rollback (); - - return false; - } - catch (const odb::qt::date_time::value_out_of_range&) - { - } - - return true; -} diff --git a/qt/sqlite/date-time/test.hxx b/qt/sqlite/date-time/test.hxx deleted file mode 100644 index 9795846..0000000 --- a/qt/sqlite/date-time/test.hxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : qt/sqlite/date-time/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include - -#include - -#pragma db object -struct object -{ - bool - operator== (const object& x) const - { - return - id == x.id && - date == x.date && - unix_day == x.unix_day && - time == x.time && - seconds == x.seconds && - date_time == x.date_time && - unix_time == x.unix_time; - } - - bool - is_null () const - { - return - date.isNull () && - unix_day.isNull () && - time.isNull () && - seconds.isNull () && - date_time.isNull () && - unix_time.isNull (); - } - - #pragma db id auto - unsigned long id; - - QDate date; - - #pragma db type ("INTEGER") - QDate unix_day; - - QTime time; - - #pragma db type ("INTEGER") - QTime seconds; - - QDateTime date_time; - - #pragma db type ("INTEGER") - QDateTime unix_time; -}; - -#endif // TEST_HXX diff --git a/qt/sqlite/template/driver.cxx b/qt/sqlite/template/driver.cxx deleted file mode 100644 index dc1181c..0000000 --- a/qt/sqlite/template/driver.cxx +++ /dev/null @@ -1,43 +0,0 @@ -// file : qt/sqlite/template/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// PLACE TEST DESCRIPTION HERE -// - -#include // std::auto_ptr -#include -#include - -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -using namespace std; -using namespace odb::core; - -int -main (int argc, char* argv[]) -{ - QCoreApplication app (argc, argv); - - try - { - auto_ptr db (create_database (argc, argv)); - - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/qt/sqlite/template/template-qt4-vc10.vcxproj b/qt/sqlite/template/template-qt4-vc10.vcxproj deleted file mode 100644 index 5d4cd02..0000000 --- a/qt/sqlite/template/template-qt4-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt4-vc10.vcxproj.filters b/qt/sqlite/template/template-qt4-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt4-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt4-vc11.vcxproj b/qt/sqlite/template/template-qt4-vc11.vcxproj deleted file mode 100644 index 217b75e..0000000 --- a/qt/sqlite/template/template-qt4-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt4-vc11.vcxproj.filters b/qt/sqlite/template/template-qt4-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt4-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt4-vc12.vcxproj b/qt/sqlite/template/template-qt4-vc12.vcxproj deleted file mode 100644 index 43959de..0000000 --- a/qt/sqlite/template/template-qt4-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;QtCored4.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;QtCore4.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt4-vc12.vcxproj.filters b/qt/sqlite/template/template-qt4-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt4-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt4-vc8.vcproj b/qt/sqlite/template/template-qt4-vc8.vcproj deleted file mode 100644 index 16623a8..0000000 --- a/qt/sqlite/template/template-qt4-vc8.vcproj +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1400 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/sqlite/template/template-qt4-vc9.vcproj b/qt/sqlite/template/template-qt4-vc9.vcproj deleted file mode 100644 index b52f2ec..0000000 --- a/qt/sqlite/template/template-qt4-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/sqlite/template/template-qt5-vc10.vcxproj b/qt/sqlite/template/template-qt5-vc10.vcxproj deleted file mode 100644 index b0f2c28..0000000 --- a/qt/sqlite/template/template-qt5-vc10.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - Unicode - - - Application - true - Unicode - - - Application - false - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt5-vc10.vcxproj.filters b/qt/sqlite/template/template-qt5-vc10.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt5-vc10.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj b/qt/sqlite/template/template-qt5-vc11.vcxproj deleted file mode 100644 index d0ca5d9..0000000 --- a/qt/sqlite/template/template-qt5-vc11.vcxproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt5-vc11.vcxproj.filters b/qt/sqlite/template/template-qt5-vc11.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt5-vc11.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc12.vcxproj b/qt/sqlite/template/template-qt5-vc12.vcxproj deleted file mode 100644 index dc303a6..0000000 --- a/qt/sqlite/template/template-qt5-vc12.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {__uuid__()} - Win32Proj - __value__(name) - - - - Application - true - v120 - Unicode - - - Application - true - v120 - Unicode - - - Application - false - v120 - true - Unicode - - - Application - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - true - $(Configuration)\ - driver - - - true - $(Platform)\$(Configuration)\ - driver - - - false - $(Configuration)\ - driver - - - false - $(Platform)\$(Configuration)\ - driver - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common-d.lib;odb-sqlite-d.lib;odb-qt-d.lib;odb-d.lib;Qt5Cored.lib;%(AdditionalDependencies) - Console - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) - $(SolutionDir)\..\..\libcommon - 4068;4355;4800;4290;%(DisableSpecificWarnings) - true - - - $(SolutionDir)\..\..\libcommon\lib64\common.lib;odb-sqlite.lib;odb-qt.lib;odb.lib;Qt5Core.lib;%(AdditionalDependencies) - Console - true - true - true - - -__ifelse__(__value__(odb_options),,, -m4_dnl - -__custom_build_entry__( -test.hxx, -odb test.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1700 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) - ) - -__ifelse__(__value__(odb_options),,, -__header_entry__(test-odb.hxx) -__header_entry__(test-odb.ixx)) -__header_entries__(extra_headers) - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - - - - diff --git a/qt/sqlite/template/template-qt5-vc12.vcxproj.filters b/qt/sqlite/template/template-qt5-vc12.vcxproj.filters deleted file mode 100644 index 8ac18a3..0000000 --- a/qt/sqlite/template/template-qt5-vc12.vcxproj.filters +++ /dev/null @@ -1,25 +0,0 @@ - - - - - {__uuid__()} - cxx - - - {__uuid__()} - h;hxx;ixx;txx - - - -__ifelse__(__value__(odb_options),,, -__header_filter_entry__(test.hxx) -__header_filter_entry__(test-odb.hxx) -__header_filter_entry__(test-odb.ixx)) -__header_filter_entries__(extra_headers) - - -__source_filter_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) -__source_filter_entries__(extra_sources) - - \ No newline at end of file diff --git a/qt/sqlite/template/template-qt5-vc9.vcproj b/qt/sqlite/template/template-qt5-vc9.vcproj deleted file mode 100644 index 79c9389..0000000 --- a/qt/sqlite/template/template-qt5-vc9.vcproj +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__source_entry__(driver.cxx) -__ifelse__(__value__(odb_options),,,__source_entry__(test-odb.cxx)) -__source_entries__(extra_sources) - - -__ifelse__(__value__(odb_options),,, -__file_entry_custom_build__( -test.hxx, -odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\..\libcommon)) test.hxx, -test-odb.hxx;test-odb.ixx;test-odb.cxx) -__file_entry__(test-odb.hxx) -__file_entry__(test-odb.ixx)) -__file_entries__(extra_headers) - - - - - diff --git a/qt/sqlite/template/test.hxx b/qt/sqlite/template/test.hxx deleted file mode 100644 index 1a8d616..0000000 --- a/qt/sqlite/template/test.hxx +++ /dev/null @@ -1,25 +0,0 @@ -// file : qt/sqlite/template/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#pragma db object -struct object -{ - object (unsigned long id) - : id_ (id) - { - } - - object () - { - } - - #pragma db id - unsigned long id_; -}; - -#endif // TEST_HXX diff --git a/repositories.manifest b/repositories.manifest deleted file mode 100644 index a5b9faa..0000000 --- a/repositories.manifest +++ /dev/null @@ -1,44 +0,0 @@ -: 1 -summary: ODB test suite repository - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb-mysql.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb-sqlite.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb-pgsql.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb-oracle.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/libodb-mssql.git##HEAD - -: -role: prerequisite -location: https://git.codesynthesis.com/odb/odb.git##HEAD - -# @@ TMP Uncomment when mysql package is added to mysql.git repository. -# -#: -#role: prerequisite -#location: https://git.build2.org/packaging/mysql/mysql.git##HEAD - -: -role: prerequisite -location: https://git.build2.org/packaging/sqlite/sqlite.git##HEAD - -: -role: prerequisite -location: https://git.build2.org/packaging/postgresql/postgresql.git##HEAD diff --git a/sqlite.testscript b/sqlite.testscript deleted file mode 100644 index 986bb37..0000000 --- a/sqlite.testscript +++ /dev/null @@ -1,10 +0,0 @@ -# file : sqlite.testscript -# license : GNU GPL v2; see accompanying LICENSE file - -# Setup the test driver command line for the subsequent SQLite tests. -# -# Note that for SQLite the schema is created implicitly by the database object -# creation function called by the test driver. -# -test.arguments += ($multi ? 'sqlite' : ) $sqlite_options -test.cleanups += &odb-test.db # See database-options.testscript for details. diff --git a/sqlite/attach/buildfile b/sqlite/attach/buildfile deleted file mode 100644 index 959f050..0000000 --- a/sqlite/attach/buildfile +++ /dev/null @@ -1,32 +0,0 @@ -# file : sqlite/attach/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_attach_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --schema main - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/attach/driver.cxx b/sqlite/attach/driver.cxx deleted file mode 100644 index 25d279f..0000000 --- a/sqlite/attach/driver.cxx +++ /dev/null @@ -1,109 +0,0 @@ -// file : sqlite/attach/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test attached database support. -// - -#include // std::unique_ptr -#include - -#include - -#include -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr mdb (create_specific_database (argc, argv)); - - { - object o ("one"); - - connection_ptr c (mdb->connection ()); - - database adb (c, ":memory:", "adb"); - - // Create schema similar to create_database(). - // - { - c->execute ("PRAGMA foreign_keys=OFF"); - - transaction t (c->begin ()); - odb::schema_catalog::create_schema (adb); - t.commit (); - - c->execute ("PRAGMA foreign_keys=ON"); - } - - { - transaction t (c->begin ()); - mdb->persist (o); - adb.persist (o); - t.commit (); - } - - { - transaction t (c->begin ()); - unique_ptr p (adb.load (o.id)); - t.commit (); - - assert (p->str == o.str); - } - - { - o.str = "two"; - - transaction t (c->begin ()); - adb.update (o); - t.commit (); - } - - { - typedef sqlite::query query; - - transaction t (c->begin ()); - unique_ptr p (adb.query_one (query::str == "two")); - t.commit (); - - assert (p->str == o.str); - } - - { - transaction t (c->begin ()); - adb.erase (o); - t.commit (); - } - - { - transaction t (c->begin ()); - unique_ptr p (mdb->load (o.id)); - t.commit (); - - assert (p.get () != 0); - } - - adb.detach (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/attach/test.hxx b/sqlite/attach/test.hxx deleted file mode 100644 index b3b8f63..0000000 --- a/sqlite/attach/test.hxx +++ /dev/null @@ -1,32 +0,0 @@ -// file : sqlite/attach/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#include - -#pragma db object -struct object -{ - explicit - object (const std::string& s): str (s) {} - - #pragma db id auto - unsigned long id; - - #pragma db unique - std::string str; - -private: - object () {} - - friend class odb::access; -}; - -#endif // TEST_HXX diff --git a/sqlite/attach/testscript b/sqlite/attach/testscript deleted file mode 100644 index db5089d..0000000 --- a/sqlite/attach/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/attach/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/auto/buildfile b/sqlite/auto/buildfile deleted file mode 100644 index 2c70b7c..0000000 --- a/sqlite/auto/buildfile +++ /dev/null @@ -1,32 +0,0 @@ -# file : sqlite/auto/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_auto_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --sqlite-lax-auto-id - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/auto/driver.cxx b/sqlite/auto/driver.cxx deleted file mode 100644 index bcd42c1..0000000 --- a/sqlite/auto/driver.cxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : sqlite/auto/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test manual/automatic id assignment. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - // object - // - { - unsigned long id1, id2, id3; - { - object o1 (1, "one"); - object o2 ("two"); - object o3 (3, "three"); - - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - - id1 = *o1.id_; - id2 = *o2.id_; - id3 = *o3.id_; - - assert (id1 == 1); - assert (id3 == 3); - - assert (id2 != id1); - assert (id2 != id3); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (id1)); - unique_ptr o2 (db->load (id2)); - unique_ptr o3 (db->load (id3)); - t.commit (); - - assert (*o1->id_ == id1 && o1->str_ == "one"); - assert (*o2->id_ == id2 && o2->str_ == "two"); - assert (*o3->id_ == id3 && o3->str_ == "three"); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/auto/test.hxx b/sqlite/auto/test.hxx deleted file mode 100644 index 9905182..0000000 --- a/sqlite/auto/test.hxx +++ /dev/null @@ -1,32 +0,0 @@ -// file : sqlite/auto/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -#include - -#pragma db object -struct object -{ - explicit - object (const std::string& str): str_ (str) {} - object (unsigned long id, const std::string& str): id_ (id), str_ (str) {} - - #pragma db auto id - odb::nullable id_; - - std::string str_; - -private: - object () {} - - friend class odb::access; -}; - -#endif // TEST_HXX diff --git a/sqlite/auto/testscript b/sqlite/auto/testscript deleted file mode 100644 index a5a7da5..0000000 --- a/sqlite/auto/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/auto/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/custom/buildfile b/sqlite/custom/buildfile deleted file mode 100644 index 3325762..0000000 --- a/sqlite/custom/buildfile +++ /dev/null @@ -1,31 +0,0 @@ -# file : sqlite/custom/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_custom_ \ - --generate-schema \ - --default-database common \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/custom/driver.cxx b/sqlite/custom/driver.cxx deleted file mode 100644 index 0627708..0000000 --- a/sqlite/custom/driver.cxx +++ /dev/null @@ -1,78 +0,0 @@ -// file : sqlite/custom/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test custom database type mapping in SQLite. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - object o (1); - o.nv.push_back ("123"); // INTEGER - o.nv.push_back ("1.23"); // REAL - o.nv.push_back ("abc"); // TEXT - - // Persist. - // - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - // Load. - // - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - - // Update. - // - o.nv[1] += "4"; - - { - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/custom/test.hxx b/sqlite/custom/test.hxx deleted file mode 100644 index 54a2ba3..0000000 --- a/sqlite/custom/test.hxx +++ /dev/null @@ -1,39 +0,0 @@ -// file : sqlite/custom/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#include - -// Map NUMERIC SQLite type to std::string (or any other type that -// provides the value_traits specialization). By -// default ODB treats NUMERIC as REAL. Note also that we don't -// need to specify to/from conversions since SQLite will convert -// implicitly. -// -#pragma db map type("NUMERIC") as("TEXT") - -#pragma db object -struct object -{ - object () {} - object (unsigned long id_): id (id_) {} - - #pragma db id - unsigned long id; - - #pragma db value_type("NUMERIC") - std::vector nv; - - bool - operator== (const object& y) const - { - return id == y.id && nv == y.nv; - } -}; - -#endif // TEST_HXX diff --git a/sqlite/custom/testscript b/sqlite/custom/testscript deleted file mode 100644 index 53561ae..0000000 --- a/sqlite/custom/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/custom/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/database/buildfile b/sqlite/database/buildfile deleted file mode 100644 index e74ab1a..0000000 --- a/sqlite/database/buildfile +++ /dev/null @@ -1,11 +0,0 @@ -# file : sqlite/database/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-sqlite%lib{odb-sqlite} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/database/driver.cxx b/sqlite/database/driver.cxx deleted file mode 100644 index 5e16653..0000000 --- a/sqlite/database/driver.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : sqlite/database/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test that database constructors are unambiguous and some other things. -// - -#include - -#undef NDEBUG -#include - -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - // Test UTF-16 to UTF-8 conversion. - // -#ifdef _WIN32 - { - database d (L"t\x00C8st"); - assert (d.name () == "t\xC3\x88st"); - } -#endif - - // This code should not execute. - // - if (argc != 0) - return 0; - - { - database d1 ("db1"); - } - - { - database d1 (argc, argv); - database d2 (argc, argv, false); - } -} diff --git a/sqlite/database/testscript b/sqlite/database/testscript deleted file mode 100644 index b9c0f5f..0000000 --- a/sqlite/database/testscript +++ /dev/null @@ -1,6 +0,0 @@ -# file : sqlite/database/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -: basics -: -$* diff --git a/sqlite/native/buildfile b/sqlite/native/buildfile deleted file mode 100644 index 49aa05b..0000000 --- a/sqlite/native/buildfile +++ /dev/null @@ -1,12 +0,0 @@ -# file : sqlite/native/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{*} $libs testscript - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/native/driver.cxx b/sqlite/native/driver.cxx deleted file mode 100644 index c87aa5d..0000000 --- a/sqlite/native/driver.cxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : sqlite/native/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test native SQL execution. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db ( - create_specific_database (argc, argv, false)); - - // Create the database schema. - // - { - transaction t (db->begin ()); - - db->execute ("DROP TABLE IF EXISTS sqlitex_native_test"); - db->execute ("CREATE TABLE sqlitex_native_test (n INTEGER PRIMARY KEY)"); - - t.commit (); - } - - // Insert a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (1)") == 1); - - assert ( - db->execute ("INSERT INTO sqlitex_native_test (n) VALUES (2)") == 1); - - t.commit (); - } - - // Select a few rows. - // - { - transaction t (db->begin ()); - - assert ( - db->execute ("SELECT n FROM sqlitex_native_test WHERE n < 3") == 2); - - assert ( - db->execute ("SELECT n FROM sqlitex_native_test WHERE n > 3") == 0); - - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/native/testscript b/sqlite/native/testscript deleted file mode 100644 index 16f05e0..0000000 --- a/sqlite/native/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/native/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/stream/buildfile b/sqlite/stream/buildfile deleted file mode 100644 index fb8f605..0000000 --- a/sqlite/stream/buildfile +++ /dev/null @@ -1,31 +0,0 @@ -# file : sqlite/stream/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} -import libodb_sqlite = libodb-sqlite%lib{odb-sqlite} -import libs = lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb and -# libodb-sqlite libraries are resolved for the odb_compile ad hoc rule (see -# build/root.build for details). -# -libue{test-meta}: $libodb $libodb_sqlite - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_stream_ \ - --generate-schema \ - --default-database common \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/stream/driver.cxx b/sqlite/stream/driver.cxx deleted file mode 100644 index 86522ec..0000000 --- a/sqlite/stream/driver.cxx +++ /dev/null @@ -1,281 +0,0 @@ -// file : sqlite/stream/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test SQLite BLOB/TEXT incremental I/O. -// - -#include -#include // std::unique_ptr -#include - -#include -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -template -void -print (const S&) -{ - /* - cerr << s.db () << '.' - << s.table () << '.' - << s.column () << '#' - << s.rowid () << endl; - */ -} - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - string txt (1024 * 1024, 't'); - vector blb (1024 * 1024, 'b'); - - object o; - - { - transaction tx (db->begin ()); - - o.t.size (txt.size ()); - o.b.size (blb.size ()); - o.bv.push_back (blob (blb.size ())); - o.bv.push_back (blob (blb.size ())); - - db->persist (o); - - print (o.t); - print (o.b); - print (o.bv[0]); - print (o.bv[1]); - - blob_stream bs (o.b, true); - bs.write (blb.data (), blb.size ()); - - text_stream ts (o.t, true); - ts.write (txt.data (), txt.size ()); - - for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) - { - blob_stream bs (*i, true); - bs.write (blb.data (), blb.size ()); - } - - tx.commit (); - } - - { - transaction tx (db->begin ()); - unique_ptr p (db->load (o.id)); - - print (p->t); - print (p->b); - print (p->bv[0]); - print (p->bv[1]); - - text_stream ts (p->t, false); - string t (ts.size (), '*'); - ts.read (const_cast (t.c_str ()), t.size ()); - assert (t == txt); - - blob_stream bs (p->b, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - - for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) - { - blob_stream bs (*i, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - } - - assert (p->nb.null ()); - - tx.commit (); - } - - txt.resize (txt.size () + 1, 't'); - txt[0] = 'A'; - txt[txt.size () - 1] = 'Z'; - - blb.resize (blb.size () - 1); - blb.front () = 'A'; - blb.back () = 'Z'; - - { - transaction tx (db->begin ()); - - o.t.clear (); - o.t.size (txt.size ()); - - o.b.clear (); - o.b.size (blb.size ()); - - o.bv[0].clear (); - o.bv[0].size (blb.size ()); - - o.bv[1].clear (); - o.bv[1].size (blb.size ()); - - o.nb = blob (blb.size ()); - - db->update (o); - - print (o.t); - print (o.b); - print (o.bv[0]); - print (o.bv[1]); - print (*o.nb); - - { - text_stream ts (o.t, true); - ts.write (txt.data (), txt.size ()); - } - - { - blob_stream bs (o.b, true); - bs.write (blb.data (), blb.size ()); - } - - for (vector::iterator i (o.bv.begin ()); i != o.bv.end (); ++i) - { - blob_stream bs (*i, true); - bs.write (blb.data (), blb.size ()); - } - - { - blob_stream bs (*o.nb, true); - bs.write (blb.data (), blb.size ()); - } - - tx.commit (); - } - - { - transaction tx (db->begin ()); - unique_ptr p (db->load (o.id)); - - print (p->t); - print (p->b); - print (p->bv[0]); - print (p->bv[1]); - print (*p->nb); - - text_stream ts (p->t, false); - string t (ts.size (), '*'); - ts.read (const_cast (t.c_str ()), t.size ()); - assert (t == txt); - - blob_stream bs (p->b, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - - for (vector::iterator i (p->bv.begin ()); i != p->bv.end (); ++i) - { - blob_stream bs (*i, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - } - - { - blob_stream bs (*p->nb, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - } - - tx.commit (); - } - - // Test query. - // - - txt.resize (32); - blb.resize (64); - - { - transaction tx (db->begin ()); - - o.t.size (txt.size ()); - o.b.size (blb.size ()); - o.bv.clear (); - o.nb.reset (); - - db->update (o); - - text_stream ts (o.t, true); - ts.write (txt.data (), txt.size ()); - - blob_stream bs (o.b, true); - bs.write (blb.data (), blb.size ()); - - tx.commit (); - } - - { - typedef sqlite::query query; - transaction tx (db->begin ()); - - { - object o1 (db->query_value (query::t == txt)); - - blob_stream bs (o1.b, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - } - - { - object o1 (db->query_value (query::b == blb)); - - text_stream ts (o1.t, false); - string t (ts.size (), '*'); - ts.read (const_cast (t.c_str ()), t.size ()); - assert (t == txt); - } - - tx.commit (); - } - - // Test view. - // - { - typedef sqlite::query query; - transaction tx (db->begin ()); - - view v (db->query_value (query::t == txt)); - - blob_stream bs (v.b, false); - vector b (bs.size (), '\0'); - bs.read (b.data (), b.size ()); - assert (b == blb); - - tx.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/stream/test.hxx b/sqlite/stream/test.hxx deleted file mode 100644 index 9189a87..0000000 --- a/sqlite/stream/test.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// file : sqlite/stream/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include - -#include -#include - -#include -#include - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id; - - odb::sqlite::text t; - - #pragma db column("_123foo_bar") - odb::sqlite::blob b; - - std::vector bv; - - odb::nullable nb; -}; - -#pragma db view object(object) -struct view -{ - odb::sqlite::blob b; -}; - -#endif // TEST_HXX diff --git a/sqlite/stream/testscript b/sqlite/stream/testscript deleted file mode 100644 index 2b9f019..0000000 --- a/sqlite/stream/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/stream/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/transaction/buildfile b/sqlite/transaction/buildfile deleted file mode 100644 index e29092d..0000000 --- a/sqlite/transaction/buildfile +++ /dev/null @@ -1,30 +0,0 @@ -# file : sqlite/transaction/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_transaction_ \ - --generate-schema \ - --default-database common - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/transaction/driver.cxx b/sqlite/transaction/driver.cxx deleted file mode 100644 index 80a0804..0000000 --- a/sqlite/transaction/driver.cxx +++ /dev/null @@ -1,61 +0,0 @@ -// file : sqlite/transaction/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test esoteric SQLite transaction semantics aspects. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - // In SQLite, when a commit fails because of the deferred foreign - // key constraint violation, the transaction is not automatically - // rolled back. Make sure we compensate for that. - // - try - { - object o; - o.p = odb::lazy_ptr (*db, 0); - - transaction t (db->begin ()); - db->persist(o); - t.commit (); - } - catch (const odb::exception&) - { - } - - // Make sure we can start a new transaction. - // - { - transaction t (db->begin ()); - t.commit (); - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/transaction/test.hxx b/sqlite/transaction/test.hxx deleted file mode 100644 index bfb981b..0000000 --- a/sqlite/transaction/test.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : sqlite/transaction/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object -struct object1 -{ - #pragma db id - unsigned long id_; -}; - -#pragma db object -struct object -{ - #pragma db id auto - unsigned long id_; - - odb::lazy_ptr p; -}; - -#endif // TEST_HXX diff --git a/sqlite/transaction/testscript b/sqlite/transaction/testscript deleted file mode 100644 index c3388cb..0000000 --- a/sqlite/transaction/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/transaction/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/truncation/buildfile b/sqlite/truncation/buildfile deleted file mode 100644 index 9a014e6..0000000 --- a/sqlite/truncation/buildfile +++ /dev/null @@ -1,31 +0,0 @@ -# file : sqlite/truncation/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_truncation_ \ - --generate-schema \ - --default-database common \ - --generate-query - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/truncation/driver.cxx b/sqlite/truncation/driver.cxx deleted file mode 100644 index a2f6d66..0000000 --- a/sqlite/truncation/driver.cxx +++ /dev/null @@ -1,163 +0,0 @@ -// file : sqlite/truncation/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test insufficient buffer/truncation handling. -// - -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - // The default pre-allocated buffer is 512 bytes long. - // - string long_str (640, 'c'); // This will get the buffer to 1024 - string longer_str (1025, 'b'); - - try - { - // Test basic operations. - // - { - unique_ptr db (create_specific_database (argc, argv)); - - // Run persist/load so that the initial bindings are established - // (version == 0). - // - { - object1 o (1); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (1, o); - t.commit (); - } - - { - object2 o (2); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - db->load (2, o); - t.commit (); - } - - // Store/load the long string which should trigger buffer growth. - // - { - object1 o (3); - o.str_ = long_str; - - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == long_str); - t.commit (); - } - - // Store/load longer string. - // - { - object1 o (3); - o.str_ = longer_str; - - transaction t (db->begin ()); - db->update (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o (db->load (3)); - assert (o->str_ == longer_str); - t.commit (); - } - } - - // Test query. - // - { - unique_ptr db (create_specific_database (argc, argv)); - - typedef sqlite::query query; - typedef odb::result result; - - // Run persist/query so that the initial bindings are established - // (version == 0). - // - { - object1 o (20); - o.str_ = "test string"; - - transaction t (db->begin ()); - db->persist (o); - o.id_++; - db->persist (o); - o.id_++; - db->persist (o); - - result r (db->query (query::id == 20)); - assert (r.begin ()->id_ == 20); - t.commit (); - } - - // Test buffer growth with cached result. - // - { - object1 o; - - transaction t (db->begin ()); - - result r (db->query (query::id >= 20)); - result::iterator i (r.begin ()); - - o.id_ = i->id_; - o.str_ = long_str; - - // This forces buffer growth in the middle of result iteration. - // - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - o.id_ = i->id_; - o.str_ = longer_str; - db->update (o); - - ++i; - assert (i->str_ == "test string"); - - t.commit (); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/truncation/test.hxx b/sqlite/truncation/test.hxx deleted file mode 100644 index 8ca44ea..0000000 --- a/sqlite/truncation/test.hxx +++ /dev/null @@ -1,46 +0,0 @@ -// file : sqlite/truncation/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include - -#pragma db object table ("test") -struct object1 -{ - object1 (unsigned long id) - : id_ (id) - { - } - - object1 () - { - } - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#pragma db object table ("test") -struct object2 -{ - object2 (unsigned long id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma db id - unsigned long id_; - - std::string str_; -}; - -#endif // TEST_HXX diff --git a/sqlite/truncation/testscript b/sqlite/truncation/testscript deleted file mode 100644 index 97e04f7..0000000 --- a/sqlite/truncation/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/truncation/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/types/buildfile b/sqlite/types/buildfile deleted file mode 100644 index 1bf719d..0000000 --- a/sqlite/types/buildfile +++ /dev/null @@ -1,32 +0,0 @@ -# file : sqlite/types/buildfile -# license : GNU GPL v2; see accompanying LICENSE file - -assert ($sqlite && !$multi || $build.meta_operation == 'dist') \ -"sqlite should be configured via config.odb_tests.database variable as a single database" - -import libodb = libodb%lib{odb} - -import libs = libodb-sqlite%lib{odb-sqlite} -import libs += lib{common} - -exe{driver}: {hxx cxx}{* -*-odb} {hxx ixx cxx}{test-odb} testscript - -# Introduce the metadata library target to make sure the libodb library is -# resolved for the odb_compile ad hoc rule (see build/root.build for details). -# -libue{test-meta}: $libodb - -<{hxx ixx cxx}{test-odb}>: hxx{test} libue{test-meta} - -exe{driver}: libue{test-meta} $libs - -# Specify the ODB custom options to be used by the odb_compile ad hoc rule -# (see build/root.build for details). -# -odb_options = --table-prefix sqlitex_types_ \ - --generate-schema \ - --default-database common \ - --generate-query \ - --cxx-prologue '#include "traits.hxx"' - -cxx.poptions =+ "-I$out_base" "-I$src_base" diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx deleted file mode 100644 index b444d94..0000000 --- a/sqlite/types/driver.cxx +++ /dev/null @@ -1,113 +0,0 @@ -// file : sqlite/types/driver.cxx -// license : GNU GPL v2; see accompanying LICENSE file - -// Test SQLite type conversion. -// - -#include // std::numeric_limits -#include // std::unique_ptr -#include - -#include -#include - -#include - -#include "test.hxx" -#include "test-odb.hxx" - -#undef NDEBUG -#include - -using namespace std; -namespace sqlite = odb::sqlite; -using namespace sqlite; - -int -main (int argc, char* argv[]) -{ - try - { - unique_ptr db (create_specific_database (argc, argv)); - - object o (1); - - o.bool_ = true; - o.integer_ = -123456; - o.real_ = 1.123; - o.nan_ = numeric_limits::quiet_NaN (); - - string long_str (2040, 'l'); - - o.text_ = long_str; -#ifdef _WIN32 - o.wtext_ = L"t\x00C8st string"; -#endif - o.blob_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); - - { - transaction t (db->begin ()); - db->persist (o); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr o1 (db->load (1)); - t.commit (); - - assert (o == *o1); - } - -#ifdef _WIN32 - { - typedef sqlite::query query; - typedef odb::result result; - - transaction t (db->begin ()); - result r (db->query (query::wtext == L"t\x00C8st string")); - assert (!r.empty ()); - t.commit (); - } -#endif - - // Test char/wchar_t arrays - // - { -#ifndef _WIN32 - char_array o1 (1, ""); - char_array o2 (2, "1234567890"); - char_array o3 (3, "12345678901234567"); -#else - char_array o1 (1, "", L""); - char_array o2 (2, "1234567890", L"123456789\x00C8"); - char_array o3 (3, "12345678901234567", L"1234567890123456\x00C8"); -#endif - - { - transaction t (db->begin ()); - db->persist (o1); - db->persist (o2); - db->persist (o3); - t.commit (); - } - - { - transaction t (db->begin ()); - unique_ptr p1 (db->load (1)); - unique_ptr p2 (db->load (2)); - unique_ptr p3 (db->load (3)); - t.commit (); - - assert (o1 == *p1); - assert (o2 == *p2); - assert (o3 == *p3); - } - } - } - catch (const odb::exception& e) - { - cerr << e.what () << endl; - return 1; - } -} diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx deleted file mode 100644 index fe0b274..0000000 --- a/sqlite/types/test.hxx +++ /dev/null @@ -1,125 +0,0 @@ -// file : sqlite/types/test.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST_HXX -#define TEST_HXX - -#include -#include -#include -#include // std::unique_ptr -#include // std::memcpy, std::str[n]cmp, std::strlen - -#ifdef _WIN32 -# include // std::wcslen, std::wcs[n]cmp -#endif - -#include - -typedef std::unique_ptr string_ptr; - -#pragma db object -struct object -{ - object () {} - object (unsigned long id): id_ (id) {} - - #pragma db id - unsigned long id_; - - #pragma db type("BOOL") - bool bool_; - - #pragma db type("INTEGER") - int integer_; - - #pragma db type("REAL") - double real_; - - double nan_; // Represented in SQLite as NULL. - - #pragma db type("TEXT") - std::string text_; - -#ifdef _WIN32 - std::wstring wtext_; -#endif - - #pragma db type("BLOB") - std::vector blob_; - - // Test NULL value. - // - #pragma db type("TEXT") null - string_ptr null_; - - bool - operator== (const object& y) const - { - return id_ == y.id_ - && bool_ == y.bool_ - && integer_ == y.integer_ - && real_ == y.real_ - && nan_ != nan_ - && text_ == y.text_ -#ifdef _WIN32 - && wtext_ == y.wtext_ -#endif - && blob_ == y.blob_ - && ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); - } -}; - -// Test char/wchar_t arrays. -// -#pragma db object -struct char_array -{ - char_array () {} - char_array (unsigned long id - , const char* s -#ifdef _WIN32 - , const wchar_t* ws -#endif - ) - : id_ (id) - { - std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. - s2[0] = c1 = *s; - -#ifdef _WIN32 - std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); - ws2[0] = wc1 = *ws; -#endif - } - - #pragma db id - unsigned long id_; - - char s1[17]; - char s2[1]; - char c1; - -#ifdef _WIN32 - wchar_t ws1[17]; - wchar_t ws2[1]; - wchar_t wc1; -#endif - - bool - operator== (const char_array& y) const - { - return id_ == y.id_ - && std::strncmp (s1, y.s1, sizeof (s1)) == 0 - && s2[0] == y.s2[0] - && c1 == y.c1 -#ifdef _WIN32 - && std::wcsncmp (ws1, y.ws1, sizeof (ws1) / 2) == 0 - && ws2[0] == y.ws2[0] - && wc1 == y.wc1 -#endif - ; - } -}; - -#endif // TEST_HXX diff --git a/sqlite/types/testscript b/sqlite/types/testscript deleted file mode 100644 index 5e50d32..0000000 --- a/sqlite/types/testscript +++ /dev/null @@ -1,9 +0,0 @@ -# file : sqlite/types/testscript -# license : GNU GPL v2; see accompanying LICENSE file - -.include ../../database-options.testscript -.include ../../sqlite.testscript - -: basics -: -$* diff --git a/sqlite/types/traits.hxx b/sqlite/types/traits.hxx deleted file mode 100644 index 9483f58..0000000 --- a/sqlite/types/traits.hxx +++ /dev/null @@ -1,57 +0,0 @@ -// file : sqlite/types/traits.hxx -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TRAITS_HXX -#define TRAITS_HXX - -#include // std::memcpy, std::memset - -#include - -#include "test.hxx" // string_ptr - -namespace odb -{ - namespace sqlite - { - template <> - class value_traits - { - public: - typedef string_ptr value_type; - typedef std::string query_type; - typedef details::buffer image_type; - - static void - set_value (string_ptr& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - v.reset (is_null ? 0 : new std::string (b.data (), n)); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const string_ptr& v) - { - is_null = v.get () == 0; - - if (!is_null) - { - n = v->size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v->c_str (), n); - } - } - }; - } -} - -#endif // TRAITS_HXX -- cgit v1.1